fastdb4ts 0.0.3 → 0.2.0
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.
- package/README.md +65 -14
- package/dist/LICENSE +21 -0
- package/dist/THIRD_PARTY_NOTICES.txt +1958 -0
- package/dist/feature.js +1 -0
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -1
- package/dist/orm.d.ts +0 -1
- package/dist/orm.js +2 -9
- package/dist/payload/abi.d.ts +27 -0
- package/dist/payload/abi.js +160 -0
- package/dist/payload/builder.d.ts +98 -0
- package/dist/payload/builder.js +364 -0
- package/dist/payload/codegen.d.ts +43 -0
- package/dist/payload/codegen.js +182 -0
- package/dist/payload/error.d.ts +9 -0
- package/dist/payload/error.js +53 -0
- package/dist/payload/index.d.ts +9 -0
- package/dist/payload/index.js +9 -0
- package/dist/payload/runtime.d.ts +195 -0
- package/dist/payload/runtime.js +756 -0
- package/dist/payload/spec.d.ts +44 -0
- package/dist/payload/spec.js +220 -0
- package/dist/schema.js +1 -0
- package/dist/serializer.js +1 -0
- package/dist/wasm/fastdb4ts.js +1 -1
- package/dist/wasm/fastdb4ts.wasm +0 -0
- package/dist/wasm-loader.d.ts +134 -1
- package/package.json +6 -2
- package/dist/call-db.d.ts +0 -117
- package/dist/call-db.js +0 -1857
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import type { WxPayloadBackingHandle, WxPayloadOwnedBytesHandle } from '../wasm-loader.js';
|
|
2
|
+
import { BuildPlan } from './builder.js';
|
|
3
|
+
import { CompiledSpec, Profile } from './spec.js';
|
|
4
|
+
export declare enum BuildPolicy {
|
|
5
|
+
AllowStaging = 1,
|
|
6
|
+
RequireDirect = 2
|
|
7
|
+
}
|
|
8
|
+
export declare enum ExecutionMode {
|
|
9
|
+
Direct = 1,
|
|
10
|
+
Staged = 2
|
|
11
|
+
}
|
|
12
|
+
export declare enum FallbackReason {
|
|
13
|
+
None = 0,
|
|
14
|
+
PlanRequiresStaging = 1,
|
|
15
|
+
BackingDeclinedDirect = 2
|
|
16
|
+
}
|
|
17
|
+
export declare enum ViewKind {
|
|
18
|
+
Sequence = 1,
|
|
19
|
+
Bool = 2,
|
|
20
|
+
U8 = 3,
|
|
21
|
+
U16 = 4,
|
|
22
|
+
U32 = 5,
|
|
23
|
+
I32 = 6,
|
|
24
|
+
U8n = 7,
|
|
25
|
+
U16n = 8,
|
|
26
|
+
F32 = 9,
|
|
27
|
+
F64 = 10,
|
|
28
|
+
Str = 11,
|
|
29
|
+
Wstr = 12,
|
|
30
|
+
Bytes = 13,
|
|
31
|
+
Component = 14,
|
|
32
|
+
List = 15,
|
|
33
|
+
Ref = 16
|
|
34
|
+
}
|
|
35
|
+
/** Core identity coordinates meaningful only within one payload owner. */
|
|
36
|
+
export declare class GraphIdentity {
|
|
37
|
+
readonly componentIndex: number;
|
|
38
|
+
readonly objectId: bigint;
|
|
39
|
+
constructor(componentIndex: number, objectId: bigint);
|
|
40
|
+
}
|
|
41
|
+
export interface PayloadBackingStats {
|
|
42
|
+
readonly reservations: bigint;
|
|
43
|
+
readonly writes: bigint;
|
|
44
|
+
readonly commits: bigint;
|
|
45
|
+
readonly rollbacks: bigint;
|
|
46
|
+
readonly retains: bigint;
|
|
47
|
+
readonly releases: bigint;
|
|
48
|
+
}
|
|
49
|
+
export declare class ExecutionReport {
|
|
50
|
+
readonly mode: ExecutionMode;
|
|
51
|
+
readonly fallbackReason: FallbackReason;
|
|
52
|
+
readonly requestedBytes: bigint;
|
|
53
|
+
readonly usedBytes: bigint;
|
|
54
|
+
readonly stagingBytes: bigint;
|
|
55
|
+
readonly regionCount: bigint;
|
|
56
|
+
readonly backingCapacity: bigint;
|
|
57
|
+
constructor(mode: ExecutionMode, fallbackReason: FallbackReason, requestedBytes: bigint, usedBytes: bigint, stagingBytes: bigint, regionCount: bigint, backingCapacity: bigint);
|
|
58
|
+
}
|
|
59
|
+
export interface OpenOptionValues {
|
|
60
|
+
flags?: number;
|
|
61
|
+
maxTotalBytes?: bigint;
|
|
62
|
+
maxRegions?: bigint;
|
|
63
|
+
maxEntries?: bigint;
|
|
64
|
+
maxComponents?: bigint;
|
|
65
|
+
maxNestingDepth?: bigint;
|
|
66
|
+
maxListElements?: bigint;
|
|
67
|
+
maxGraphObjects?: bigint;
|
|
68
|
+
maxStringBytes?: bigint;
|
|
69
|
+
maxValidationWork?: bigint;
|
|
70
|
+
}
|
|
71
|
+
export declare class OpenOptions {
|
|
72
|
+
readonly values: Readonly<OpenOptionValues>;
|
|
73
|
+
constructor(values?: OpenOptionValues);
|
|
74
|
+
}
|
|
75
|
+
export interface WasmMemoryBackingOptions {
|
|
76
|
+
allowDirect?: boolean;
|
|
77
|
+
}
|
|
78
|
+
interface TestingBackingOptions extends WasmMemoryBackingOptions {
|
|
79
|
+
failWrite?: boolean;
|
|
80
|
+
failCommit?: boolean;
|
|
81
|
+
}
|
|
82
|
+
declare const testingBackingToken: unique symbol;
|
|
83
|
+
declare const createTestingBacking: unique symbol;
|
|
84
|
+
declare const backingHandleValue: unique symbol;
|
|
85
|
+
export declare class WasmMemoryBacking {
|
|
86
|
+
#private;
|
|
87
|
+
constructor(options?: WasmMemoryBackingOptions);
|
|
88
|
+
static [createTestingBacking](options: TestingBackingOptions, token: typeof testingBackingToken): WasmMemoryBacking;
|
|
89
|
+
stats(): PayloadBackingStats;
|
|
90
|
+
dispose(): void;
|
|
91
|
+
/** @internal */
|
|
92
|
+
[backingHandleValue](): WxPayloadBackingHandle;
|
|
93
|
+
private requireNative;
|
|
94
|
+
private replaceNative;
|
|
95
|
+
}
|
|
96
|
+
export declare function __testingWasmMemoryBacking(options: TestingBackingOptions): WasmMemoryBacking;
|
|
97
|
+
declare const ownedBytesHandleValue: unique symbol;
|
|
98
|
+
export declare class WasmOwnedBytes {
|
|
99
|
+
#private;
|
|
100
|
+
private constructor();
|
|
101
|
+
static copyFrom(source: Uint8Array): WasmOwnedBytes;
|
|
102
|
+
dispose(): void;
|
|
103
|
+
/** @internal */
|
|
104
|
+
[ownedBytesHandleValue](): WxPayloadOwnedBytesHandle;
|
|
105
|
+
}
|
|
106
|
+
declare const payloadConstructionToken: unique symbol;
|
|
107
|
+
declare const createPayload: unique symbol;
|
|
108
|
+
declare const accessConstructionToken: unique symbol;
|
|
109
|
+
declare const createAccess: unique symbol;
|
|
110
|
+
/** A unique Core access pin. Safe methods always return JavaScript-owned copies. */
|
|
111
|
+
export declare class Access {
|
|
112
|
+
#private;
|
|
113
|
+
private constructor();
|
|
114
|
+
static [createAccess](handle: number, token: typeof accessConstructionToken): Access;
|
|
115
|
+
dispose(): void;
|
|
116
|
+
payloadBytes(): Uint8Array;
|
|
117
|
+
str(): string;
|
|
118
|
+
wstr(): string;
|
|
119
|
+
bytes(): Uint8Array;
|
|
120
|
+
private copyByteSpan;
|
|
121
|
+
private requireHandle;
|
|
122
|
+
}
|
|
123
|
+
declare const viewConstructionToken: unique symbol;
|
|
124
|
+
declare const createView: unique symbol;
|
|
125
|
+
/** A retainable immutable Core view with generation-checked operations. */
|
|
126
|
+
export declare class View {
|
|
127
|
+
#private;
|
|
128
|
+
private constructor();
|
|
129
|
+
static [createView](handle: number, token: typeof viewConstructionToken): View;
|
|
130
|
+
clone(): View;
|
|
131
|
+
dispose(): void;
|
|
132
|
+
requireSpecSha256(expectedSha256: Uint8Array): void;
|
|
133
|
+
kind(): ViewKind;
|
|
134
|
+
isNull(): boolean;
|
|
135
|
+
length(): bigint;
|
|
136
|
+
at(index: bigint): View;
|
|
137
|
+
componentIndex(): number;
|
|
138
|
+
fieldCount(): number;
|
|
139
|
+
field(index: number): View;
|
|
140
|
+
/** Follow exactly one explicit Core ref edge. */
|
|
141
|
+
refTarget(): View;
|
|
142
|
+
/** Return Core coordinates meaningful only within this payload owner. */
|
|
143
|
+
graphIdentity(): GraphIdentity;
|
|
144
|
+
getBool(): boolean;
|
|
145
|
+
getU8(): number;
|
|
146
|
+
getU16(): number;
|
|
147
|
+
getU32(): number;
|
|
148
|
+
getI32(): number;
|
|
149
|
+
getU8nF64Bits(): bigint;
|
|
150
|
+
getU8n(): number;
|
|
151
|
+
getU16nF64Bits(): bigint;
|
|
152
|
+
getU16n(): number;
|
|
153
|
+
getF32Bits(): number;
|
|
154
|
+
getF32(): number;
|
|
155
|
+
getF64Bits(): bigint;
|
|
156
|
+
getF64(): number;
|
|
157
|
+
acquire(): Access;
|
|
158
|
+
/** Performs exactly one Core materialization call. */
|
|
159
|
+
materialize(): View;
|
|
160
|
+
private readU8;
|
|
161
|
+
private readU16;
|
|
162
|
+
private readU32;
|
|
163
|
+
private readU64;
|
|
164
|
+
private requireHandle;
|
|
165
|
+
}
|
|
166
|
+
export declare class Payload {
|
|
167
|
+
#private;
|
|
168
|
+
private constructor();
|
|
169
|
+
static [createPayload](handle: number, token: typeof payloadConstructionToken, keeper?: object): Payload;
|
|
170
|
+
static openCopy(spec: CompiledSpec, source: Uint8Array, options?: OpenOptions): Payload;
|
|
171
|
+
static openWasmOwned(spec: CompiledSpec, source: WasmOwnedBytes, options?: OpenOptions): Payload;
|
|
172
|
+
clone(): Payload;
|
|
173
|
+
dispose(): void;
|
|
174
|
+
requireSpecSha256(expectedSha256: Uint8Array): void;
|
|
175
|
+
sha256(): Uint8Array;
|
|
176
|
+
profile(): Profile;
|
|
177
|
+
executionReport(): ExecutionReport;
|
|
178
|
+
binaryBytes(): Uint8Array;
|
|
179
|
+
acquire(): Access;
|
|
180
|
+
entryView(entryIndex: number): View;
|
|
181
|
+
/**
|
|
182
|
+
* Invalidates synchronously after all access pins have been disposed.
|
|
183
|
+
* The official Wasm host is single-threaded, so retaining an Access here
|
|
184
|
+
* would prevent Core's drain from completing.
|
|
185
|
+
*/
|
|
186
|
+
invalidate(): void;
|
|
187
|
+
private requireHandle;
|
|
188
|
+
}
|
|
189
|
+
export declare class BuildResult {
|
|
190
|
+
readonly payload: Payload;
|
|
191
|
+
readonly report: ExecutionReport;
|
|
192
|
+
constructor(payload: Payload, report: ExecutionReport);
|
|
193
|
+
}
|
|
194
|
+
export declare function executePlan(plan: BuildPlan, policy: BuildPolicy, backing?: WasmMemoryBacking): BuildResult;
|
|
195
|
+
export {};
|