Skip to content

Commit

Permalink
Adding pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
elielnfinic committed Oct 26, 2022
1 parent c1f2621 commit 3b46f26
Show file tree
Hide file tree
Showing 8 changed files with 532 additions and 0 deletions.
Empty file added rsa-encrypt/pkg/.gitignore
Empty file.
5 changes: 5 additions & 0 deletions rsa-encrypt/pkg/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# WASM Library

## Testing

In order to test the code, run `cargo test -- --nocapture`
12 changes: 12 additions & 0 deletions rsa-encrypt/pkg/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "rsa-encrypt",
"version": "0.1.0",
"files": [
"rsa_encrypt_bg.wasm",
"rsa_encrypt.js",
"rsa_encrypt.d.ts"
],
"module": "rsa_encrypt.js",
"types": "rsa_encrypt.d.ts",
"sideEffects": false
}
56 changes: 56 additions & 0 deletions rsa-encrypt/pkg/rsa_encrypt.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/* tslint:disable */
/* eslint-disable */
/**
* @returns {string}
*/
export function get_mnemonic(): string;
/**
* @param {string} phrase
* @returns {string}
*/
export function check_mnemonic(phrase: string): string;
/**
* @param {string} data
* @returns {string}
*/
export function encrypt_data(data: string): string;
/**
* @returns {string}
*/
export function generate_keys(): string;

export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;

export interface InitOutput {
readonly memory: WebAssembly.Memory;
readonly get_mnemonic: (a: number) => void;
readonly check_mnemonic: (a: number, b: number, c: number) => void;
readonly encrypt_data: (a: number, b: number, c: number) => void;
readonly generate_keys: (a: number) => void;
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
readonly __wbindgen_free: (a: number, b: number) => void;
readonly __wbindgen_malloc: (a: number) => number;
readonly __wbindgen_realloc: (a: number, b: number, c: number) => number;
readonly __wbindgen_exn_store: (a: number) => void;
}

export type SyncInitInput = BufferSource | WebAssembly.Module;
/**
* Instantiates the given `module`, which can either be bytes or
* a precompiled `WebAssembly.Module`.
*
* @param {SyncInitInput} module
*
* @returns {InitOutput}
*/
export function initSync(module: SyncInitInput): InitOutput;

/**
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
* for everything else, calls `WebAssembly.instantiate` directly.
*
* @param {InitInput | Promise<InitInput>} module_or_path
*
* @returns {Promise<InitOutput>}
*/
export default function init (module_or_path?: InitInput | Promise<InitInput>): Promise<InitOutput>;
Loading

0 comments on commit 3b46f26

Please sign in to comment.