Skip to content

Commit 8da1f61

Browse files
committed
ctstore init
1 parent 7fe1725 commit 8da1f61

File tree

13 files changed

+1378
-11
lines changed

13 files changed

+1378
-11
lines changed

typescript/package-lock.json

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# ct-engine
2+
3+
JavaScript module implementation of [ct-engine].
4+
5+
## Using
6+
7+
See `example.html` on usage.
8+
9+
## Building
10+
11+
Only this documentation, example, and tests can be found in the repository. All of the code is generated from compiling [ct-engine] via [wasm-pack].
12+
13+
Perform the build via nix:
14+
15+
```sh
16+
nix build .#engine-web
17+
```
18+
19+
[wasm-pack]: https://rustwasm.github.io
20+
[ct-engine]: ./rust/ct-engine
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
/* tslint:disable */
2+
/* eslint-disable */
3+
/**
4+
* The [`CtStore`] provides direct access to the underlying web store.
5+
*/
6+
export class CTStore {
7+
free(): void;
8+
/**
9+
* Create a new [`CtStore`].
10+
*/
11+
constructor(db_name: string, store_name: string, hash?: Uint8Array);
12+
/**
13+
* Returns the root hash of the storage, if it contains data.
14+
*/
15+
hash(): Uint8Array | undefined;
16+
/**
17+
* Sets `key` to `value`.
18+
*/
19+
set(key: Uint8Array, value: Uint8Array): Promise<void>;
20+
/**
21+
* Retrieves value with `key`.
22+
*/
23+
get(key: Uint8Array): Promise<Uint8Array | undefined>;
24+
/**
25+
* Calls `callback` with `key` and `value` arguments
26+
* for each entry within `start` and `end` range.
27+
*/
28+
getRange(start: Uint8Array, end: Uint8Array, start_inclusive: boolean, end_inclusive: boolean, callback: Function): Promise<void>;
29+
}
30+
31+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
32+
33+
export interface InitOutput {
34+
readonly memory: WebAssembly.Memory;
35+
readonly __wbg_ctstore_free: (a: number, b: number) => void;
36+
readonly ctstore_new: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
37+
readonly ctstore_hash: (a: number, b: number) => void;
38+
readonly ctstore_set: (a: number, b: number, c: number, d: number, e: number) => number;
39+
readonly ctstore_get: (a: number, b: number, c: number) => number;
40+
readonly ctstore_getRange: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
41+
readonly __wbindgen_export_0: (a: number) => void;
42+
readonly __wbindgen_export_1: (a: number, b: number, c: number) => void;
43+
readonly __wbindgen_export_2: (a: number, b: number) => number;
44+
readonly __wbindgen_export_3: (a: number, b: number, c: number, d: number) => number;
45+
readonly __wbindgen_export_4: WebAssembly.Table;
46+
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
47+
readonly __wbindgen_export_5: (a: number, b: number, c: number) => void;
48+
readonly __wbindgen_export_6: (a: number, b: number, c: number) => void;
49+
readonly __wbindgen_export_7: (a: number, b: number, c: number) => void;
50+
readonly __wbindgen_export_8: (a: number, b: number, c: number, d: number) => void;
51+
}
52+
53+
export type SyncInitInput = BufferSource | WebAssembly.Module;
54+
/**
55+
* Instantiates the given `module`, which can either be bytes or
56+
* a precompiled `WebAssembly.Module`.
57+
*
58+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
59+
*
60+
* @returns {InitOutput}
61+
*/
62+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
63+
64+
/**
65+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
66+
* for everything else, calls `WebAssembly.instantiate` directly.
67+
*
68+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
69+
*
70+
* @returns {Promise<InitOutput>}
71+
*/
72+
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;

0 commit comments

Comments
 (0)