@sovereignbase/sequencer 0.0.0-stage → 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,50 @@
1
+
2
+ //#region src/typescript/types/type.d.ts
3
+ /** Structural words may be typed views or numeric arrays received as JSON. */
4
+ type U32List = Uint32Array | ReadonlyArray<number>;
5
+ /**
6
+ * Exactly six words, in the replication order:
7
+ * `[anchorSession, anchorStart, anchorDiff,
8
+ * insertionSession, insertionStart, insertionDiff]`.
9
+ * Signed coordinates use their 32-bit bit pattern; WASM interprets those lanes
10
+ * as signed.
11
+ */
12
+ type InsertionWords = U32List;
13
+ /** Insertion coordinates plus optional JS-owned content. Only words enter WASM. */
14
+ type Insertion<T> = Readonly<[words: InsertionWords, footage?: ReadonlyArray<T | undefined>]>;
15
+ /** `[actorID, sessionID, sessionEnd, ...]`. */
16
+ type Acknowledgement = U32List;
17
+ type Gossip<T> = ReadonlyArray<Acknowledgement | Insertion<T>>;
18
+ /**
19
+ * One structural array and one JS-owned content array.
20
+ * `words[0]` is the start of the six-word insertion records. Before that:
21
+ * `[frontiersEnd, acknowledgementLength, ...acknowledgement, ...]`.
22
+ * Positive insertion diffs consume successive spans of `footage`.
23
+ * `[[], []]` is an empty Sequence. Both numeric arrays and typed views are accepted.
24
+ */
25
+ type Sequence<T> = Readonly<[words: U32List, footage: ReadonlyArray<T | undefined>]>;
26
+ type Splice<T> = Readonly<[startAt: number, endWith: number, values?: ReadonlyArray<T | undefined>]>;
27
+ type Change<T> = ReadonlyArray<Splice<T>>;
28
+ type Result<T> = Readonly<[change: Change<T>, gossip?: Gossip<T>]>;
29
+ //#endregion
30
+ //#region src/typescript/class.d.ts
31
+ /** Public API; algorithms execute synchronously in one WASM instance. */
32
+ export declare class Projection<T> {
33
+ readonly actorID: number;
34
+ private id;
35
+ constructor(actorID: number, trustedSequence?: unknown);
36
+ apply(gossip: unknown): Result<T> | undefined;
37
+ insert(values: Array<T>, at: number): Gossip<T>;
38
+ length(): number;
39
+ merge(sequence: unknown): Result<T> | undefined;
40
+ remove(startAt?: number, endWith?: number): Gossip<T>;
41
+ replace(withValues: Array<T>, startAt?: number, endWith?: number): Gossip<T>;
42
+ retire(actorID: number): void;
43
+ sequence(): Sequence<T>;
44
+ value(at: number): T | undefined;
45
+ values(startAt?: number, endWith?: number): Array<T>;
46
+ destroy(): void;
47
+ }
48
+ //#endregion
49
+ export type { Acknowledgement, Change, Gossip, Insertion, InsertionWords, Result, Sequence, Splice, U32List };
50
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/typescript/types/type.ts","../src/typescript/class.ts"],"mappings":";;;KACY,UAAU,cAAc;;;;;;;;KASxB,iBAAiB;;KAGjB,UAAU,KAAK,UACxB,OAAO,gBAAgB,UAAU,cAAc;;KAItC,kBAAkB;KAElB,OAAO,KAAK,cAAc,kBAAkB,UAAU;;;;;;;;KAStD,SAAS,KAAK,UACvB,OAAO,SAAS,SAAS,cAAc;KAG9B,OAAO,KAAK,UACrB,iBAAiB,iBAAiB,SAAS,cAAc;KAGhD,OAAO,KAAK,cAAc,OAAO;KACjC,OAAO,KAAK,UAAU,QAAQ,OAAO,IAAI,SAAS,OAAO;;;;qBCjCxD,WAAW;WAIJ;UAHV;EAGU,YAAA,iBAChB;EAKF,MAAM,kBAAkB,OAAO;EAI/B,OAAO,QAAQ,MAAM,IAAI,aAAa,OAAO;EAI7C;EAIA,MAAM,oBAAoB,OAAO;EAIjC,OAAO,kBAAkB,mBAAmB,OAAO;EAInD,QAAQ,YAAY,MAAM,IAAI,kBAAkB,mBAAmB,OAAO;EAU1E,OAAO;EAIP,YAAY,SAAS;EAIrB,MAAM,aAAa;EAInB,OAAO,kBAAkB,mBAAmB,MAAM;EAIlD"}
@@ -0,0 +1,50 @@
1
+
2
+ //#region src/typescript/types/type.d.ts
3
+ /** Structural words may be typed views or numeric arrays received as JSON. */
4
+ type U32List = Uint32Array | ReadonlyArray<number>;
5
+ /**
6
+ * Exactly six words, in the replication order:
7
+ * `[anchorSession, anchorStart, anchorDiff,
8
+ * insertionSession, insertionStart, insertionDiff]`.
9
+ * Signed coordinates use their 32-bit bit pattern; WASM interprets those lanes
10
+ * as signed.
11
+ */
12
+ type InsertionWords = U32List;
13
+ /** Insertion coordinates plus optional JS-owned content. Only words enter WASM. */
14
+ type Insertion<T> = Readonly<[words: InsertionWords, footage?: ReadonlyArray<T | undefined>]>;
15
+ /** `[actorID, sessionID, sessionEnd, ...]`. */
16
+ type Acknowledgement = U32List;
17
+ type Gossip<T> = ReadonlyArray<Acknowledgement | Insertion<T>>;
18
+ /**
19
+ * One structural array and one JS-owned content array.
20
+ * `words[0]` is the start of the six-word insertion records. Before that:
21
+ * `[frontiersEnd, acknowledgementLength, ...acknowledgement, ...]`.
22
+ * Positive insertion diffs consume successive spans of `footage`.
23
+ * `[[], []]` is an empty Sequence. Both numeric arrays and typed views are accepted.
24
+ */
25
+ type Sequence<T> = Readonly<[words: U32List, footage: ReadonlyArray<T | undefined>]>;
26
+ type Splice<T> = Readonly<[startAt: number, endWith: number, values?: ReadonlyArray<T | undefined>]>;
27
+ type Change<T> = ReadonlyArray<Splice<T>>;
28
+ type Result<T> = Readonly<[change: Change<T>, gossip?: Gossip<T>]>;
29
+ //#endregion
30
+ //#region src/typescript/class.d.ts
31
+ /** Public API; algorithms execute synchronously in one WASM instance. */
32
+ export declare class Projection<T> {
33
+ readonly actorID: number;
34
+ private id;
35
+ constructor(actorID: number, trustedSequence?: unknown);
36
+ apply(gossip: unknown): Result<T> | undefined;
37
+ insert(values: Array<T>, at: number): Gossip<T>;
38
+ length(): number;
39
+ merge(sequence: unknown): Result<T> | undefined;
40
+ remove(startAt?: number, endWith?: number): Gossip<T>;
41
+ replace(withValues: Array<T>, startAt?: number, endWith?: number): Gossip<T>;
42
+ retire(actorID: number): void;
43
+ sequence(): Sequence<T>;
44
+ value(at: number): T | undefined;
45
+ values(startAt?: number, endWith?: number): Array<T>;
46
+ destroy(): void;
47
+ }
48
+ //#endregion
49
+ export type { Acknowledgement, Change, Gossip, Insertion, InsertionWords, Result, Sequence, Splice, U32List };
50
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/typescript/types/type.ts","../src/typescript/class.ts"],"mappings":";;;KACY,UAAU,cAAc;;;;;;;;KASxB,iBAAiB;;KAGjB,UAAU,KAAK,UACxB,OAAO,gBAAgB,UAAU,cAAc;;KAItC,kBAAkB;KAElB,OAAO,KAAK,cAAc,kBAAkB,UAAU;;;;;;;;KAStD,SAAS,KAAK,UACvB,OAAO,SAAS,SAAS,cAAc;KAG9B,OAAO,KAAK,UACrB,iBAAiB,iBAAiB,SAAS,cAAc;KAGhD,OAAO,KAAK,cAAc,OAAO;KACjC,OAAO,KAAK,UAAU,QAAQ,OAAO,IAAI,SAAS,OAAO;;;;qBCjCxD,WAAW;WAIJ;UAHV;EAGU,YAAA,iBAChB;EAKF,MAAM,kBAAkB,OAAO;EAI/B,OAAO,QAAQ,MAAM,IAAI,aAAa,OAAO;EAI7C;EAIA,MAAM,oBAAoB,OAAO;EAIjC,OAAO,kBAAkB,mBAAmB,OAAO;EAInD,QAAQ,YAAY,MAAM,IAAI,kBAAkB,mBAAmB,OAAO;EAU1E,OAAO;EAIP,YAAY,SAAS;EAIrB,MAAM,aAAa;EAInB,OAAO,kBAAkB,mBAAmB,MAAM;EAIlD"}