(wasm) Better TS types for serialized structs, RoutingContext++, more crypto fns

This commit is contained in:
Brandon Vandegrift
2023-09-11 01:25:37 -04:00
parent 797e34f965
commit c2c607efac
13 changed files with 133 additions and 87 deletions
+10 -1
View File
@@ -3,7 +3,16 @@ use super::*;
#[wasm_bindgen(typescript_custom_section)]
const IUPDATE_VEILID_FUNCTION: &'static str = r#"
type UpdateVeilidFunction = (event: VeilidUpdate) => void;
export type UpdateVeilidFunction = (event: VeilidUpdate) => void;
// Type overrides for structs that always get serialized by serde.
export type CryptoKey = string;
export type Nonce = string;
export type Signature = string;
export type KeyPair = `${PublicKey}:${SecretKey}`;
export type FourCC = "NONE" | "VLD0" | string;
export type CryptoTyped<TCryptoKey extends string> = `${FourCC}:${TCryptoKey}`;
export type CryptoTypedGroup<TCryptoKey extends string> = Array<CryptoTyped<TCryptoKey>>;
"#;
#[wasm_bindgen]