Some checks are pending
Sharenet Passport CI / test-native (push) Waiting to run
Sharenet Passport CI / test-wasm-headless (push) Waiting to run
Sharenet Passport CI / test-wasm-webdriver (push) Waiting to run
Sharenet Passport CI / build-wasm (push) Waiting to run
Sharenet Passport CI / lint (push) Waiting to run
113 lines
5.1 KiB
TypeScript
113 lines
5.1 KiB
TypeScript
/* tslint:disable */
|
|
/* eslint-disable */
|
|
/**
|
|
* Create a new passport with the given universe ID and password
|
|
*
|
|
* Returns a JSON string containing both the passport and recovery phrase
|
|
* This function works entirely in memory and doesn't write to any storage.
|
|
*/
|
|
export function create_passport(univ_id: string, _password: string): any;
|
|
/**
|
|
* Import a passport from recovery phrase
|
|
* Returns the imported passport as JSON
|
|
*/
|
|
export function import_from_recovery(univ_id: string, recovery_words: string[], _password: string): any;
|
|
/**
|
|
* Load a passport from encrypted data (ArrayBuffer/Blob)
|
|
* This accepts encrypted passport data as bytes and returns the decrypted passport
|
|
*/
|
|
export function import_from_encrypted_data(encrypted_data: Uint8Array, password: string): any;
|
|
/**
|
|
* Export a passport to encrypted data (ArrayBuffer/Blob)
|
|
* This returns encrypted passport data as bytes that can be downloaded or stored
|
|
*/
|
|
export function export_to_encrypted_data(passport_json: any, password: string): Uint8Array;
|
|
/**
|
|
* Sign a message with the passport's private key
|
|
*/
|
|
export function sign_message(passport_json: any, message: string): Uint8Array;
|
|
/**
|
|
* Generate a new recovery phrase
|
|
*/
|
|
export function generate_recovery_phrase(): any;
|
|
/**
|
|
* Validate a recovery phrase
|
|
*/
|
|
export function validate_recovery_phrase(recovery_words: string[]): boolean;
|
|
/**
|
|
* Create a new user profile for a passport
|
|
* Returns the updated passport as JSON
|
|
*/
|
|
export function create_user_profile(passport_json: any, hub_did: string | null | undefined, identity_json: any, preferences_json: any): any;
|
|
/**
|
|
* Update an existing user profile
|
|
* Returns the updated passport as JSON
|
|
*/
|
|
export function update_user_profile(passport_json: any, profile_id: string, identity_json: any, preferences_json: any): any;
|
|
/**
|
|
* Delete a user profile
|
|
* Returns the updated passport as JSON
|
|
*/
|
|
export function delete_user_profile(passport_json: any, profile_id: string): any;
|
|
/**
|
|
* Change passport password
|
|
* Returns the updated passport as JSON
|
|
*/
|
|
export function change_passport_password(_passport_json: any, _old_password: string, _new_password: string): any;
|
|
/**
|
|
* Get passport metadata from encrypted data
|
|
* This can extract public metadata without full decryption
|
|
*/
|
|
export function get_passport_metadata(encrypted_data: Uint8Array): any;
|
|
/**
|
|
* Validate passport file integrity from encrypted data
|
|
*/
|
|
export function validate_passport_file(encrypted_data: Uint8Array): boolean;
|
|
|
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
|
|
export interface InitOutput {
|
|
readonly memory: WebAssembly.Memory;
|
|
readonly create_passport: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
readonly import_from_recovery: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
readonly import_from_encrypted_data: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
readonly export_to_encrypted_data: (a: any, b: number, c: number) => [number, number, number, number];
|
|
readonly sign_message: (a: any, b: number, c: number) => [number, number, number, number];
|
|
readonly generate_recovery_phrase: () => [number, number, number];
|
|
readonly validate_recovery_phrase: (a: number, b: number) => [number, number, number];
|
|
readonly create_user_profile: (a: any, b: number, c: number, d: any, e: any) => [number, number, number];
|
|
readonly update_user_profile: (a: any, b: number, c: number, d: any, e: any) => [number, number, number];
|
|
readonly delete_user_profile: (a: any, b: number, c: number) => [number, number, number];
|
|
readonly change_passport_password: (a: any, b: number, c: number, d: number, e: number) => [number, number, number];
|
|
readonly get_passport_metadata: (a: number, b: number) => [number, number, number];
|
|
readonly validate_passport_file: (a: number, b: number) => [number, number, number];
|
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
readonly __wbindgen_exn_store: (a: number) => void;
|
|
readonly __externref_table_alloc: () => number;
|
|
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
readonly __externref_table_dealloc: (a: number) => void;
|
|
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
readonly __wbindgen_start: () => void;
|
|
}
|
|
|
|
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
/**
|
|
* Instantiates the given `module`, which can either be bytes or
|
|
* a precompiled `WebAssembly.Module`.
|
|
*
|
|
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
*
|
|
* @returns {InitOutput}
|
|
*/
|
|
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
|
|
/**
|
|
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
*
|
|
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
*
|
|
* @returns {Promise<InitOutput>}
|
|
*/
|
|
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|