@sf-kmods/kdataforgejs 0.0.0-stage → 0.1.17

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 CHANGED
@@ -1,3 +1,24 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
1
+ # @sf-kmods/kdataforgejs
2
+
3
+ TypeScript types for KDataForgeJS packs. They describe the built-in `@sf-kmods/kdataforgejs` module that the runtime
4
+ provides to a pack (`defineMeta`, `defineHandler`, `Context`, ...) and ship a strict `tsconfig` base.
5
+ Use together with [`@sf-kmods/kdataforgejs-cli`](../cli/README.md); `kdf init` sets everything up.
6
+
7
+ ```sh
8
+ npm install --save-dev @sf-kmods/kdataforgejs
9
+ ```
10
+
11
+ ```jsonc
12
+ // tsconfig.json
13
+ { "extends": "@sf-kmods/kdataforgejs/tsconfig.base.json", "include": ["DataForge/**/*.ts"] }
14
+ ```
15
+
16
+ ```ts
17
+ // DataForge/scripts/main.ts
18
+ import { defineHandler, defineMeta } from "@sf-kmods/kdataforgejs";
19
+
20
+ export const meta = defineMeta({ capabilities: ["kdf.reflection.read"] }); // optional
21
+ ```
22
+
23
+ This package is **editor tooling only**. Packs never contain `package.json` or `node_modules`; the runtime resolves
24
+ `@sf-kmods/kdataforgejs` itself. The declarations are copied from the KDataForgeJS plugin at build time.
@@ -0,0 +1,16 @@
1
+ {
2
+ "formatVersion": 1,
3
+ "package": "@sf-kmods/kdataforgejs",
4
+ "baseDeclaration": "@sf-kmods/kdataforgejs/index.d.ts",
5
+ "typeGenerator": {
6
+ "formatVersion": 8,
7
+ "outputPrefix": "typescript/kdataforgejs",
8
+ "generatedDeclaration": "typescript/kdataforgejs/kdataforge.generated.d.ts",
9
+ "artifacts": [
10
+ "kdataforge.generated.d.ts",
11
+ "tsconfig.json",
12
+ "paths.json",
13
+ "editor.json"
14
+ ]
15
+ }
16
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "formatVersion": 1,
3
+ "codeoss": {
4
+ "typescript": {
5
+ "tsconfig": "tsconfig.kdfjs.json",
6
+ "module": "@sf-kmods/kdataforgejs",
7
+ "baseDeclaration": "@sf-kmods/kdataforgejs/index.d.ts",
8
+ "generatedDeclarationPattern": "typescript/kdataforgejs/kdataforge.generated.d.ts"
9
+ }
10
+ }
11
+ }
package/index.d.ts ADDED
@@ -0,0 +1,321 @@
1
+ /** UE class handle. Generated declarations merge this global shape for ergonomic `Class<T>` use. */
2
+ /** Vendored KDataForgeJS runtime declaration. No package manager or node_modules required. */
3
+ declare module "@sf-kmods/kdataforgejs" {
4
+ /** Capability ids for `defineMeta`. Reading and writing reflected values is always granted. */
5
+ export interface CapabilityMap {
6
+ readonly "kdf.behavior.runtime": true;
7
+ readonly "kdf.classes.define": true;
8
+ readonly "kdf.documents.apply": true;
9
+ readonly "kdf.imports.read": true;
10
+ readonly "kdf.items.define": true;
11
+ readonly "kdf.items.read": true;
12
+ readonly "kdf.native.call": true;
13
+ readonly "kdf.native.hook": true;
14
+ readonly "kdf.native.read": true;
15
+ readonly "kdf.native.write": true;
16
+ readonly "kdf.recipes.define": true;
17
+ readonly "kdf.recipes.read": true;
18
+ readonly "kdf.reflection.call": true;
19
+ readonly "kdf.reflection.read": true;
20
+ readonly "kdf.reflection.write": true;
21
+ readonly "kdf.script.admin": true;
22
+ }
23
+ export type Capability = keyof CapabilityMap & string;
24
+ export interface Meta { readonly capabilities: readonly Capability[]; }
25
+ export type Main = (ctx: Context) => Promise<void>;
26
+ export function defineMeta(meta: Meta): Readonly<Meta>;
27
+ export function defineHandler(handler: (ctx: Context) => Promise<void>): (ctx: Context) => Promise<void>;
28
+ export function defineBehavior<T extends object>(behavior: T): Readonly<T>;
29
+ export function all(values: readonly unknown[]): boolean;
30
+ export function any(values: readonly unknown[]): boolean;
31
+
32
+ /**
33
+ * Scalar neutral values accepted by property writes, calls, and comparisons.
34
+ * TypeScript cannot range-check primitive bigint values. Runtime accepts signed bigint values
35
+ * from -9223372036854775808n through 9223372036854775807n and unsigned bigint values
36
+ * 0n through 18446744073709551615n; values outside those ranges are rejected at runtime.
37
+ */
38
+ export type InputValue = null | undefined | boolean | bigint | number | string;
39
+ /** Scalar neutral values returned by property reads and calls. */
40
+ export type Value = null | boolean | bigint | number | string;
41
+ export type TypeKind = 0 | 1 | 2 | 3 | 4;
42
+ export type MemberAccess = 0 | 1 | 2 | 3;
43
+ export type InvocationKind = 0 | 1 | 2 | 3;
44
+ export type CallEffect = 0 | 1 | 2 | 3;
45
+ export type TargetKind = 0 | 1 | 2 | 3 | 4;
46
+ export type TargetCardinality = 0 | 1;
47
+ export type Authority = 0 | 1 | 2;
48
+ export type ThreadAffinity = 0 | 1;
49
+ export type LifecyclePhase = 0 | 1 | 2;
50
+ export type CompareOperator = "equals" | "==" | "notEquals" | "!=" | "less" | "<" | "lessOrEqual" | "<=" | "greater" | "greaterThan" | ">" | "greaterOrEqual" | ">=";
51
+
52
+ export interface ExecutableDescriptor { readonly providerId: string; readonly adapterId: string; readonly targetId: string; readonly targetKind: TargetKind; readonly authority: Authority; readonly threadAffinity: ThreadAffinity; readonly lifecyclePhase: LifecyclePhase; }
53
+ export interface TypeDescriptor { readonly id: string; readonly kind: TypeKind; readonly baseTypeId: string; readonly capabilities: readonly string[]; readonly providerId: string; readonly nativeTypeScriptName: string; }
54
+ export interface PropertyDescriptor extends ExecutableDescriptor { readonly id: string; readonly ownerTypeId: string; readonly valueTypeId: string; readonly access: MemberAccess; readonly capabilities: readonly string[]; readonly nativeMemberName: string; readonly nativeContainerName: string; }
55
+ export interface FunctionDescriptor extends ExecutableDescriptor { readonly id: string; readonly ownerTypeId: string; readonly returnTypeId: string; readonly invocation: InvocationKind; readonly callEffect: CallEffect; readonly parameterTypeIds: readonly string[]; readonly capabilities: readonly string[]; readonly nativeMemberName: string; }
56
+ export interface EventFieldDescriptor { readonly name: string; readonly valueTypeId: string; readonly optional: boolean; }
57
+ export interface EventDescriptor extends ExecutableDescriptor { readonly id: string; readonly ownerTypeId: string; readonly returnTypeId: string; readonly payloadTypeIds: readonly string[]; readonly payloadFields: readonly EventFieldDescriptor[]; readonly capabilities: readonly string[]; }
58
+ export interface ImportDescriptor extends ExecutableDescriptor { readonly id: string; readonly valueTypeId: string; readonly capabilities: readonly string[]; }
59
+ export interface TargetDescriptor { readonly id: string; readonly declaredTypeId: string; readonly providerId: string; readonly kind: TargetKind; readonly cardinality: TargetCardinality; readonly authority: Authority; readonly threadAffinity: ThreadAffinity; readonly lifecyclePhase: LifecyclePhase; readonly nativeClassPath: string; }
60
+ export interface TrackedDescriptor extends ExecutableDescriptor { readonly id: string; readonly ownerTypeId: string; readonly valueTypeId: string; readonly targetId: string; readonly access: MemberAccess; readonly capabilities: readonly string[]; }
61
+ export interface NativeAdapterDescriptor { readonly providerId: string; readonly adapterId: string; readonly families: number; }
62
+ export interface Catalog { readonly token: string; readonly generation: bigint; readonly digest: string; readonly types: readonly TypeDescriptor[]; readonly properties: readonly PropertyDescriptor[]; readonly functions: readonly FunctionDescriptor[]; readonly events: readonly EventDescriptor[]; readonly imports: readonly ImportDescriptor[]; readonly targets: readonly TargetDescriptor[]; readonly tracked: readonly TrackedDescriptor[]; readonly nativeAdapters: readonly NativeAdapterDescriptor[]; }
63
+
64
+ const targetBrand: unique symbol; const valueRefBrand: unique symbol; const subscriptionBrand: unique symbol;
65
+ const actorBrand: unique symbol; const actorClassBrand: unique symbol; const hookBrand: unique symbol;
66
+ export interface Target { readonly [targetBrand]: never; }
67
+ export interface UObject extends Target { }
68
+ export interface Class<T extends UObject = UObject> extends Target {
69
+ readonly __kdfClassBrand: never;
70
+ readonly path: string;
71
+ getClassDefaultObject(): T;
72
+ }
73
+ export interface NativeClassPathMap { }
74
+ export interface LookupOptions { readonly checked?: boolean; }
75
+ export interface CheckedLookupOptions { readonly checked: true; }
76
+ export type ClassValue<C extends Class<UObject>> = C extends Class<infer T> ? T : never;
77
+ export type ExactType<A, B> = [A] extends [B] ? ([B] extends [A] ? true : false) : false;
78
+ export type NativeClassPathFor<C extends Class<UObject>> = {
79
+ readonly [P in keyof NativeClassPathMap & string]:
80
+ ExactType<NativeClassPathMap[P], ClassValue<C>> extends true ? P : never;
81
+ }[keyof NativeClassPathMap & string];
82
+ export interface ClassSearchParams {
83
+ readonly pathPrefix?: string;
84
+ readonly nameContains?: string;
85
+ readonly includeNative?: boolean;
86
+ readonly includeBlueprints?: boolean;
87
+ readonly limit?: number;
88
+ }
89
+ export interface Realm extends Target {
90
+ readonly counter: WritableValueRef<bigint>;
91
+ readonly uint64_max: ReadonlyValueRef<bigint>;
92
+ }
93
+ /** Read-only recursive containers avoid circular aliases in the bundled TypeScript compiler. */
94
+ export interface StructuredInputArray extends ReadonlyArray<StructuredInputValue> { }
95
+ export interface StructuredInputObject { readonly [key: string]: StructuredInputValue; }
96
+ export interface StructuredInputMap {
97
+ readonly size: number; get(key: StructuredInputValue): StructuredInputValue | undefined;
98
+ has(key: StructuredInputValue): boolean; entries(): IterableIterator<[StructuredInputValue, StructuredInputValue]>;
99
+ keys(): IterableIterator<StructuredInputValue>; values(): IterableIterator<StructuredInputValue>;
100
+ forEach(callback: (value: StructuredInputValue, key: StructuredInputValue) => void, thisArg?: unknown): void;
101
+ [Symbol.iterator](): IterableIterator<[StructuredInputValue, StructuredInputValue]>;
102
+ }
103
+ export interface StructuredInputSet {
104
+ readonly size: number; has(value: StructuredInputValue): boolean; entries(): IterableIterator<[StructuredInputValue, StructuredInputValue]>;
105
+ keys(): IterableIterator<StructuredInputValue>; values(): IterableIterator<StructuredInputValue>;
106
+ forEach(callback: (value: StructuredInputValue, value2: StructuredInputValue) => void, thisArg?: unknown): void;
107
+ [Symbol.iterator](): IterableIterator<StructuredInputValue>;
108
+ }
109
+ /** Bounded structured values accepted by target resolution, tracked CAS, and actor writes. */
110
+ export type StructuredInputValue = InputValue | Target | StructuredInputArray | StructuredInputObject | StructuredInputMap | StructuredInputSet;
111
+ export interface StructuredArray extends ReadonlyArray<StructuredValue> { }
112
+ export interface StructuredObject { readonly [key: string]: StructuredValue; }
113
+ export interface StructuredMap {
114
+ readonly size: number; get(key: StructuredValue): StructuredValue | undefined;
115
+ has(key: StructuredValue): boolean; entries(): IterableIterator<[StructuredValue, StructuredValue]>;
116
+ keys(): IterableIterator<StructuredValue>; values(): IterableIterator<StructuredValue>;
117
+ forEach(callback: (value: StructuredValue, key: StructuredValue) => void, thisArg?: unknown): void;
118
+ [Symbol.iterator](): IterableIterator<[StructuredValue, StructuredValue]>;
119
+ }
120
+ export interface StructuredSet {
121
+ readonly size: number; has(value: StructuredValue): boolean; entries(): IterableIterator<[StructuredValue, StructuredValue]>;
122
+ keys(): IterableIterator<StructuredValue>; values(): IterableIterator<StructuredValue>;
123
+ forEach(callback: (value: StructuredValue, value2: StructuredValue) => void, thisArg?: unknown): void;
124
+ [Symbol.iterator](): IterableIterator<StructuredValue>;
125
+ }
126
+ /** Bounded structured values returned by tracked reads and authorized content imports. */
127
+ export type StructuredValue = Value | Target | StructuredArray | StructuredObject | StructuredMap | StructuredSet;
128
+ export interface ReadonlyValueRef<T = Value> { readonly [valueRefBrand]: never; get(): T; }
129
+ export interface WritableValueRef<T = Value> extends ReadonlyValueRef<T> { set(value: T): void; }
130
+ export type ValueRef<T = Value> = ReadonlyValueRef<T> | WritableValueRef<T>;
131
+ export interface Subscription { readonly [subscriptionBrand]: never; unsubscribe(): void; }
132
+ export interface Actor { readonly [actorBrand]: never; }
133
+ export type CatalogActor<K extends string> = Actor & { readonly [actorClassBrand]: K };
134
+ /** Pack-generated declarations augment these maps with closed catalog literals. */
135
+ export interface ActorClassMap { }
136
+ export interface ActorPropertyMap { }
137
+ export type ActorClassKey = keyof ActorClassMap & string;
138
+ export type ActorInitialWrites<K extends ActorClassKey> = Partial<ActorPropertyMap[K]>;
139
+ export type ActorPropertyKey<K extends ActorClassKey> = keyof ActorPropertyMap[K] & string;
140
+ export type ActorPropertyValue<K extends ActorClassKey, P extends ActorPropertyKey<K>> = ActorPropertyMap[K][P];
141
+ /** Named events receive one frozen object; positional events receive each value as a callback argument. */
142
+ export interface EventArgs { readonly [field: string]: Value | undefined; }
143
+ export type NamedEventCallback = (args: EventArgs) => void;
144
+ export type PositionalEventCallback = (value: Value, ...values: readonly Value[]) => void;
145
+ export type HookPhase = "before" | "after" | "replace";
146
+ /** Typed handle to one hookable function of a class; `Class.hooks.<Name>` is the only way to obtain one. */
147
+ export interface Hook<TTarget extends UObject = UObject, TArgs extends readonly Value[] = readonly Value[], TReturn = void> {
148
+ readonly [hookBrand]: never;
149
+ readonly __target?: TTarget; readonly __args?: TArgs; readonly __return?: TReturn;
150
+ }
151
+ /** A Blueprint-assignable delegate of an object. Binding a key again replaces that binding. */
152
+ export interface Delegate<TArgs extends readonly Value[]> {
153
+ bind(key: string, callback: (...args: TArgs) => void): Subscription;
154
+ unbind(key: string): void;
155
+ }
156
+ /** What a hook callback receives: the receiving object, the call arguments and, after the call, its return value. */
157
+ export interface HookCall<TTarget extends UObject, TArgs extends readonly Value[], TReturn> {
158
+ readonly target?: TTarget; readonly args: TArgs; readonly returnValue?: TReturn;
159
+ }
160
+ export interface BehaviorHandlerDescriptor { readonly eventId: string; readonly callbackToken: string; readonly payloadTypeIds: readonly string[]; }
161
+ export interface BehaviorDescriptor { readonly id: string; readonly baseTypeId: string; readonly maxInstances: number; readonly composedBehaviorIds?: readonly string[]; readonly handlers: readonly BehaviorHandlerDescriptor[]; readonly authority?: Authority; readonly threadAffinity?: ThreadAffinity; }
162
+ export interface BehaviorInvocation { readonly eventId: string; readonly target: Actor; readonly payload: Readonly<Record<string, Value>> | readonly Value[]; }
163
+ export type BehaviorHandler = (invocation: BehaviorInvocation) => unknown;
164
+ export interface BehaviorRegistration { readonly id: string; }
165
+ export interface BehaviorInstance { readonly __kdfBehaviorInstance: never; }
166
+ export interface TickSubscription extends Subscription { }
167
+ export interface Conditions { all(conditions: readonly boolean[]): boolean; any(conditions: readonly boolean[]): boolean; }
168
+ /** Canonical descriptor identity. `id` names authored content; `classPath` names an existing soft class path. */
169
+ export type ItemReference = Readonly<{ id: string }> | Readonly<{ classPath: string }>;
170
+ export interface LocalizedText { readonly namespace: string; readonly key: string; readonly source: string; }
171
+ export interface ItemAmount { readonly item: ItemReference; readonly amount: number | bigint; }
172
+ /** Members of an exported class that a definition can write: the scalar, enum and string properties of its descriptor. */
173
+ export type WritableKeys<T> = { [K in keyof T]-?: T[K] extends WritableValueRef<any> ? K : never }[keyof T];
174
+ export type PropertyWrites<T> = { readonly [K in WritableKeys<T>]?: T[K] extends WritableValueRef<infer V> ? V : never };
175
+ /** Values for properties the export does not describe: class references (handles), lists and nested structs. */
176
+ export type ExtraValue = boolean | number | bigint | string | Class<UObject> | readonly ExtraValue[] | { readonly [key: string]: ExtraValue };
177
+ export interface ExtraWrites { readonly [property: string]: ExtraValue }
178
+ export interface ItemDefinition<C extends Class<UObject> = Class<UObject>> {
179
+ /** Pass the exported parent class (for example `FGConsumableDescriptor`) to type `properties` from its members. */
180
+ readonly id: string; readonly parent: ItemReference | C; readonly displayName: LocalizedText;
181
+ readonly form: "solid" | "liquid" | "gas";
182
+ readonly stackSize: "one" | "small" | "medium" | "big" | "huge" | "fluid";
183
+ readonly description?: LocalizedText; readonly energyValueMJ?: number; readonly radioactiveDecay?: number;
184
+ readonly canBeDiscarded?: boolean; readonly categories?: readonly string[];
185
+ /** Typed writes on the generated class, limited to what the parent's exported descriptor exposes. */
186
+ readonly properties?: PropertyWrites<ClassValue<C>>;
187
+ /** Anything the export does not describe, such as sub categories as class handles. */
188
+ readonly extra?: ExtraWrites;
189
+ }
190
+ export interface RecipeDefinition {
191
+ readonly id: string; readonly ingredients: readonly ItemAmount[]; readonly products: readonly ItemAmount[];
192
+ readonly producedIn: readonly ItemReference[]; readonly durationSeconds: number;
193
+ readonly displayName?: LocalizedText; readonly manualMultiplier?: number; readonly menuPriority?: number | bigint;
194
+ readonly register?: boolean; readonly categories?: readonly string[];
195
+ /** Property writes on the generated recipe class that the fixed fields do not cover. */
196
+ readonly extra?: ExtraWrites;
197
+ }
198
+ export interface ContentRef<K extends "item" | "recipe"> { readonly kind: K; readonly id: string; }
199
+ /** Generic bounded document shape used by catalog tooling. Authors should prefer HandlerDocument<K>. */
200
+ export interface KDFDocument extends StructuredInputObject { readonly type: string; }
201
+ /** One bounded handler-owned map entry. Handler validation still enforces its detailed native schema. */
202
+ export type KDFDocumentEntry = Readonly<Record<string, StructuredInputValue>>;
203
+ export interface KDFPropertyOperation extends KDFDocumentEntry { readonly path: string; readonly op?: string; readonly value?: StructuredInputValue; }
204
+ export interface KDFCdoPatch extends KDFDocumentEntry { readonly target?: string; readonly properties: readonly KDFPropertyOperation[]; }
205
+ export interface CdoDocument extends KDFDocument { readonly type: "cdo"; readonly patches: readonly KDFCdoPatch[]; }
206
+ export interface AssetDocument extends KDFDocument { readonly type: "asset"; readonly assets: readonly KDFDocumentEntry[]; }
207
+ export interface DataAssetDocument extends KDFDocument { readonly type: "dataasset"; readonly assets: readonly KDFDocumentEntry[]; }
208
+ export interface ItemDocument extends KDFDocument { readonly type: "item"; readonly items: readonly KDFDocumentEntry[]; }
209
+ export interface ResourceDocument extends KDFDocument { readonly type: "resource"; readonly resources: readonly KDFDocumentEntry[]; }
210
+ export interface BuildingDocument extends KDFDocument { readonly type: "building"; readonly buildings: readonly KDFDocumentEntry[]; }
211
+ export interface UnlockDocument extends KDFDocument { readonly type: "unlock"; readonly unlocks: readonly KDFDocumentEntry[]; }
212
+ export interface RecipeDocument extends KDFDocument { readonly type: "recipe"; readonly recipes: readonly KDFDocumentEntry[]; }
213
+ export interface SchematicDocument extends KDFDocument { readonly type: "schematic"; readonly schematics: readonly KDFDocumentEntry[]; }
214
+ export interface ResearchDocument extends KDFDocument { readonly type: "research"; readonly research: readonly KDFDocumentEntry[]; }
215
+ export interface CurveDocument extends KDFDocument { readonly type: "curve"; readonly curveType: "float" | "vector"; readonly curves: readonly KDFDocumentEntry[]; }
216
+ export interface LocalizationDocument extends KDFDocument { readonly type: "localization"; readonly namespace: string; readonly culture?: string; readonly entries: Readonly<Record<string, StructuredInputValue>>; }
217
+ export interface GameTagDocument extends KDFDocument { readonly type: "gametag"; readonly tags: readonly StructuredInputValue[]; }
218
+ export interface SinkPointsDocument extends KDFDocument { readonly type: "sinkpoints"; readonly entries: readonly KDFDocumentEntry[]; readonly track?: string; }
219
+ export interface ResourceNodeDocument extends KDFDocument { readonly type: "resourcenode"; }
220
+ export interface SoundDocument extends KDFDocument { readonly type: "sound"; readonly sounds: readonly KDFDocumentEntry[]; }
221
+ export interface SublevelDocument extends KDFDocument { readonly type: "sublevel"; readonly block: readonly StructuredInputValue[]; }
222
+ export interface EventRuleDocument extends KDFDocument { readonly type: "eventrule"; readonly rules: readonly KDFDocumentEntry[]; }
223
+ export interface CategoryReorderDocument extends KDFDocument { readonly type: "category_reorder"; readonly subType: "items" | "recipe" | "schematic" | "settings"; readonly category: string; readonly order: readonly string[]; readonly subCategory?: string; readonly categoryPriority?: number; readonly subCategoryPriority?: number; }
224
+ export interface ClassEntryDefinition extends StructuredInputObject {
225
+ readonly id: string; readonly parent: string; readonly properties?: readonly StructuredInputValue[];
226
+ readonly registerAs?: "recipe" | "schematic" | "research";
227
+ }
228
+ /** DynamicContent class document. Script methods are supplied separately through defineBehavior. */
229
+ export interface ClassDefinition extends KDFDocument { readonly type: "class"; readonly classes: readonly [ClassEntryDefinition]; }
230
+ export interface DynamicClassHandle { readonly id: string; }
231
+ export interface HandlerDocumentMap {
232
+ readonly asset: AssetDocument; readonly category_reorder: CategoryReorderDocument;
233
+ readonly cdo: CdoDocument; readonly class: ClassDefinition; readonly curve: CurveDocument;
234
+ readonly dataasset: DataAssetDocument; readonly eventrule: EventRuleDocument; readonly gametag: GameTagDocument;
235
+ readonly localization: LocalizationDocument; readonly item: ItemDocument; readonly resource: ResourceDocument;
236
+ readonly building: BuildingDocument; readonly unlock: UnlockDocument; readonly recipe: RecipeDocument;
237
+ readonly schematic: SchematicDocument; readonly research: ResearchDocument;
238
+ readonly resourcenode: ResourceNodeDocument; readonly sinkpoints: SinkPointsDocument;
239
+ readonly sound: SoundDocument; readonly sublevel: SublevelDocument;
240
+ }
241
+ export type HandlerKey = keyof HandlerDocumentMap & string;
242
+ export type HandlerDocument<K extends HandlerKey> = HandlerDocumentMap[K];
243
+
244
+ /** Frozen context supplied to default main. Every member below is installed by KDFJSRuntime. */
245
+ export interface Context {
246
+ readonly catalog: () => Catalog;
247
+ readonly target: { (): Realm; (name: "realm"): Realm; };
248
+ readonly getClass: {
249
+ <C extends Class<UObject>, P extends NativeClassPathFor<C>>(type: C, path: P, options: CheckedLookupOptions): C;
250
+ <C extends Class<UObject>, P extends NativeClassPathFor<C>>(type: C, path: P, options?: LookupOptions): C | null;
251
+ };
252
+ readonly getObject: {
253
+ <C extends Class<UObject>>(type: C, path: string, options: CheckedLookupOptions): ClassValue<C>;
254
+ <C extends Class<UObject>>(type: C, path: string, options?: LookupOptions): ClassValue<C> | null;
255
+ };
256
+ readonly getDataAsset: {
257
+ <C extends Class<UObject>>(type: C, path: string, options: CheckedLookupOptions): ClassValue<C>;
258
+ <C extends Class<UObject>>(type: C, path: string, options?: LookupOptions): ClassValue<C> | null;
259
+ };
260
+ readonly cast: {
261
+ <C extends Class<UObject>>(type: C, value: Class<UObject>, options: CheckedLookupOptions): Class<ClassValue<C>>;
262
+ <C extends Class<UObject>>(type: C, value: Class<UObject>, options?: LookupOptions): Class<ClassValue<C>> | null;
263
+ <C extends Class<UObject>>(type: C, value: UObject, options: CheckedLookupOptions): ClassValue<C>;
264
+ <C extends Class<UObject>>(type: C, value: UObject, options?: LookupOptions): ClassValue<C> | null;
265
+ };
266
+ readonly findClasses: <C extends Class<UObject>>(type: C, search?: ClassSearchParams) => readonly C[];
267
+ readonly createItem: <C extends Class<UObject> = Class<UObject>>(definition: ItemDefinition<C>) => ContentRef<"item">;
268
+ readonly updateItem: <C extends Class<UObject> = Class<UObject>>(definition: ItemDefinition<C>) => ContentRef<"item">;
269
+ readonly removeItem: (id: string) => ContentRef<"item">;
270
+ readonly createRecipe: (definition: RecipeDefinition) => ContentRef<"recipe">;
271
+ readonly updateRecipe: (definition: RecipeDefinition) => ContentRef<"recipe">;
272
+ readonly removeRecipe: (id: string) => ContentRef<"recipe">;
273
+ readonly applyDocument: <K extends HandlerKey>(handlerId: K, document: HandlerDocumentMap[NoInfer<K>]) => void;
274
+ readonly defineClass: (definition: ClassDefinition) => DynamicClassHandle;
275
+ readonly import: (kind: "text" | "yaml" | "binary" | "image" | "audio", path: string) => StructuredValue;
276
+ readonly compare: (left: InputValue, operator: CompareOperator, right: InputValue) => boolean;
277
+ readonly isAuthority: () => boolean;
278
+ readonly conditions: Conditions;
279
+ readonly on: {
280
+ (target: Target, eventId: string, callback: PositionalEventCallback): Subscription;
281
+ (target: Target, eventId: string, callback: NamedEventCallback): Subscription;
282
+ <K extends string>(target: Target, eventId: string, key: K, callback: PositionalEventCallback): Subscription;
283
+ <K extends string>(target: Target, eventId: string, key: K, callback: NamedEventCallback): Subscription;
284
+ <K extends string, TKey extends string>(eventId: K, key: TKey, callback: PositionalEventCallback | NamedEventCallback): Subscription;
285
+ };
286
+ readonly off: (subscription: Subscription) => void;
287
+ readonly unregisterEvent: (key: string) => void;
288
+ readonly hook: {
289
+ <T extends UObject, A extends readonly Value[], R>(target: Class<T>, hook: Hook<T, A, R>, callback: (call: HookCall<T, A, R>) => void): Subscription;
290
+ <T extends UObject, A extends readonly Value[], R>(target: Class<T>, hook: Hook<T, A, R>, phase: "before" | "after", callback: (call: HookCall<T, A, R>) => void): Subscription;
291
+ <T extends UObject, A extends readonly Value[], R>(target: Class<T>, hook: Hook<T, A, R>, phase: "replace", callback: (call: HookCall<T, A, R>) => R | void): Subscription;
292
+ };
293
+ readonly unhook: (subscription: Subscription) => void;
294
+ readonly onTyped: {
295
+ (target: Target, eventId: string, callback: PositionalEventCallback): Subscription;
296
+ (target: Target, eventId: string, callback: NamedEventCallback): Subscription;
297
+ <K extends string>(target: Target, eventId: string, key: K, callback: PositionalEventCallback): Subscription;
298
+ <K extends string>(target: Target, eventId: string, key: K, callback: NamedEventCallback): Subscription;
299
+ <K extends string, TKey extends string>(eventId: K, key: TKey, callback: PositionalEventCallback | NamedEventCallback): Subscription;
300
+ };
301
+ readonly spawnActor: <K extends ActorClassKey>(classDescriptorId: K, initialWrites?: ActorInitialWrites<K>) => CatalogActor<K>;
302
+ /** Explicit untyped escape hatch for tools operating on runtime-discovered catalogs. */
303
+ readonly spawnActorById: (classDescriptorId: string, initialWrites?: Readonly<Record<string, StructuredInputValue>>) => Actor;
304
+ readonly destroyActor: (actor: Actor) => void;
305
+ readonly modifyActor: <K extends ActorClassKey, P extends ActorPropertyKey<K>>(actor: CatalogActor<K>, propertyId: P, value: ActorPropertyValue<K, P>) => void;
306
+ /** Explicit untyped escape hatch for tools operating on runtime-discovered catalogs. */
307
+ readonly modifyActorById: (actor: Actor, propertyId: string, value: StructuredInputValue) => void;
308
+ readonly registerBehavior: (descriptor: BehaviorDescriptor, handlers: Readonly<Record<string, BehaviorHandler>>) => BehaviorRegistration;
309
+ readonly createBehavior: (registration: BehaviorRegistration, target: Actor) => BehaviorInstance;
310
+ readonly destroyBehavior: (instance: BehaviorInstance) => void;
311
+ readonly unregisterBehavior: (instance: BehaviorInstance) => void;
312
+ readonly unregisterBehaviorClass: (registration: BehaviorRegistration, options?: { cascade?: boolean }) => void;
313
+ readonly registerTick: (key: string, callback: (deltaSeconds: number) => void, options: { every: number; requireGameThread?: boolean }) => TickSubscription;
314
+ readonly unregisterTick: (key: string) => void;
315
+ readonly setTimeout: (callback: () => void, seconds: number) => Subscription;
316
+ readonly clearTimeout: (handle: Subscription) => void;
317
+ readonly log: (...data: readonly unknown[]) => void; readonly info: (...data: readonly unknown[]) => void;
318
+ readonly warn: (...data: readonly unknown[]) => void; readonly error: (...data: readonly unknown[]) => void;
319
+ readonly debug: (...data: readonly unknown[]) => void;
320
+ }
321
+ }
@@ -0,0 +1,87 @@
1
+ /* QuickJS-NG declarations for offline KDataForgeJS packs. No Node, browser DOM (except native DOMException/base64), Intl, Temporal, WebAssembly, crypto, timers, filesystem, network, process, or Atomics.waitAsync. Atomics.wait exists but blocking is disabled by host policy. */
2
+ type PropertyKey = string | number | symbol;
3
+ type NoInfer<T> = intrinsic;
4
+ type Awaited<T> = T extends null | undefined ? T : T extends PromiseLike<infer V> ? Awaited<V> : T;
5
+ type Partial<T> = { [P in keyof T]?: T[P] }; type Required<T> = { [P in keyof T]-?: T[P] }; type Readonly<T> = { readonly [P in keyof T]: T[P] };
6
+ type Pick<T, K extends keyof T> = { [P in K]: T[P] }; type Record<K extends PropertyKey, T> = { [P in K]: T }; type Exclude<T, U> = T extends U ? never : T; type Extract<T, U> = T extends U ? T : never; type NonNullable<T> = T & {};
7
+ type Parameters<T extends (...args: readonly unknown[]) => unknown> = T extends (...args: infer P) => unknown ? P : never; type ReturnType<T extends (...args: readonly unknown[]) => unknown> = T extends (...args: readonly unknown[]) => infer R ? R : unknown;
8
+ interface ThisType<T> {}
9
+
10
+ interface Symbol { readonly description: string | undefined; toString(): string; valueOf(): symbol; [Symbol.toPrimitive](hint: string): symbol; } interface SymbolConstructor { readonly iterator: unique symbol; readonly asyncIterator: unique symbol; readonly hasInstance: unique symbol; readonly isConcatSpreadable: unique symbol; readonly match: unique symbol; readonly matchAll: unique symbol; readonly replace: unique symbol; readonly search: unique symbol; readonly species: unique symbol; readonly split: unique symbol; readonly toPrimitive: unique symbol; readonly toStringTag: unique symbol; readonly unscopables: unique symbol; (description?: string | number): symbol; for(key: string): symbol; keyFor(sym: symbol): string | undefined; }
11
+ declare const Symbol: SymbolConstructor;
12
+ interface IteratorYieldResult<T> { done?: false; value: T; } interface IteratorReturnResult<T> { done: true; value: T; } type IteratorResult<T, R = unknown> = IteratorYieldResult<T> | IteratorReturnResult<R>;
13
+ interface Iterator<T, R = unknown, N = unknown> { next(...args: [] | [N]): IteratorResult<T, R>; return?(value?: R): IteratorResult<T, R>; throw?(error?: unknown): IteratorResult<T, R>; } interface Iterable<T, R = unknown, N = unknown> { [Symbol.iterator](): Iterator<T, R, N>; } interface IterableIterator<T, R = unknown, N = unknown> extends Iterator<T, R, N> { [Symbol.iterator](): IterableIterator<T, R, N>; } interface AsyncIterator<T, R = unknown, N = unknown> { next(...args: [] | [N]): Promise<IteratorResult<T, R>>; return?(value?: R): Promise<IteratorResult<T, R>>; throw?(error?: unknown): Promise<IteratorResult<T, R>>; } interface AsyncIterable<T, R = unknown, N = unknown> { [Symbol.asyncIterator](): AsyncIterator<T, R, N>; } interface ArrayLike<T> { readonly length: number; readonly [index: number]: T; }
14
+
15
+ interface Object { constructor: Function; __proto__: object | null; toString(): string; toLocaleString(): string; valueOf(): Object; hasOwnProperty(v: PropertyKey): boolean; isPrototypeOf(v: Object): boolean; propertyIsEnumerable(v: PropertyKey): boolean; __defineGetter__(p: PropertyKey, g: () => unknown): void; __defineSetter__(p: PropertyKey, s: (v: unknown) => void): void; __lookupGetter__(p: PropertyKey): (() => unknown) | undefined; __lookupSetter__(p: PropertyKey): ((v: unknown) => void) | undefined; }
16
+ interface PropertyDescriptor { configurable?: boolean; enumerable?: boolean; value?: unknown; writable?: boolean; get?(): unknown; set?(v: unknown): void; } interface PropertyDescriptorMap { [key: PropertyKey]: PropertyDescriptor; }
17
+ interface ObjectConstructor { (): Object; new(value?: unknown): Object; assign<T extends object, U extends object>(target: T, source: U): T & U; assign<T extends object, U extends object, V extends object>(target: T, a: U, b: V): T & U & V; create(proto: object | null, properties?: PropertyDescriptorMap): object; defineProperties<T extends object>(o: T, p: PropertyDescriptorMap): T; defineProperty<T extends object>(o: T, p: PropertyKey, a: PropertyDescriptor): T; entries<T extends object>(o: T): [string, T[keyof T]][]; freeze<T>(o: T): Readonly<T>; fromEntries<T = unknown>(e: Iterable<readonly [PropertyKey, T]>): { [k: string]: T }; getOwnPropertyDescriptor(o: object, p: PropertyKey): PropertyDescriptor | undefined; getOwnPropertyDescriptors<T extends object>(o: T): { [P in keyof T]: PropertyDescriptor }; getOwnPropertyNames(o: object): string[]; getOwnPropertySymbols(o: object): symbol[]; getPrototypeOf(o: object): object | null; hasOwn(o: object, p: PropertyKey): boolean; is(a: unknown, b: unknown): boolean; isExtensible(o: object): boolean; isFrozen(o: object): boolean; isSealed(o: object): boolean; keys(o: object): string[]; preventExtensions<T extends object>(o: T): T; seal<T extends object>(o: T): T; setPrototypeOf(o: object, p: object | null): object; values<T extends object>(o: T): T[keyof T][]; }
18
+ declare const Object: ObjectConstructor;
19
+ interface Function { readonly length: number; readonly name: string; readonly prototype: object; readonly fileName: string; readonly lineNumber: number; readonly columnNumber: number; (...args: readonly unknown[]): unknown; apply(this: Function, thisArg: unknown, argArray?: ArrayLike<unknown>): unknown; bind(this: Function, thisArg: unknown, ...args: readonly unknown[]): Function; call(this: Function, thisArg: unknown, ...args: readonly unknown[]): unknown; toString(): string; [Symbol.hasInstance](value: unknown): boolean; } interface CallableFunction extends Function {} interface NewableFunction extends Function {} interface FunctionConstructor { (...args: string[]): Function; new(...args: string[]): Function; } declare const Function: FunctionConstructor; interface IArguments { readonly [index: number]: unknown; readonly length: number; callee: Function; }
20
+ interface Boolean { toString(): string; valueOf(): boolean; } interface BooleanConstructor { (value?: unknown): boolean; new(value?: unknown): Boolean; } declare const Boolean: BooleanConstructor;
21
+ interface Number { toExponential(f?: number): string; toFixed(f?: number): string; toLocaleString(locales?: string | readonly string[], options?: object): string; toPrecision(p?: number): string; toString(radix?: number): string; valueOf(): number; } interface NumberConstructor { (value?: unknown): number; new(value?: unknown): Number; readonly EPSILON: number; readonly MAX_SAFE_INTEGER: number; readonly MAX_VALUE: number; readonly MIN_SAFE_INTEGER: number; readonly MIN_VALUE: number; readonly NaN: number; readonly NEGATIVE_INFINITY: number; readonly POSITIVE_INFINITY: number; isFinite(n: unknown): boolean; isInteger(n: unknown): boolean; isNaN(n: unknown): boolean; isSafeInteger(n: unknown): boolean; parseFloat(s: string): number; parseInt(s: string, r?: number): number; } declare const Number: NumberConstructor;
22
+ interface BigInt { toString(radix?: number): string; valueOf(): bigint; } interface BigIntConstructor { (value: bigint | boolean | number | string): bigint; asIntN(bits: number, value: bigint): bigint; asUintN(bits: number, value: bigint): bigint; } declare const BigInt: BigIntConstructor;
23
+ interface String { readonly length: number; charAt(p: number): string; charCodeAt(p: number): number; codePointAt(p: number): number | undefined; concat(...s: readonly string[]): string; endsWith(s: string, p?: number): boolean; includes(s: string, p?: number): boolean; indexOf(s: string, p?: number): number; lastIndexOf(s: string, p?: number): number; localeCompare(s: string, locales?: string | readonly string[], options?: object): number; match(r: string | RegExp): RegExpMatchArray | null; matchAll(r: RegExp): IterableIterator<RegExpMatchArray>; normalize(f?: "NFC" | "NFD" | "NFKC" | "NFKD"): string; padEnd(n: number, fill?: string): string; padStart(n: number, fill?: string): string; repeat(n: number): string; replace(s: string | RegExp, r: string | ((s: string, ...a: readonly unknown[]) => string)): string; replaceAll(s: string | RegExp, r: string | ((s: string, ...a: readonly unknown[]) => string)): string; search(r: string | RegExp): number; slice(a?: number, b?: number): string; split(s: string | RegExp, n?: number): string[]; startsWith(s: string, p?: number): boolean; substring(a: number, b?: number): string; toLocaleLowerCase(l?: string | readonly string[]): string; toLocaleUpperCase(l?: string | readonly string[]): string; toLowerCase(): string; toString(): string; toUpperCase(): string; trim(): string; trimEnd(): string; trimStart(): string; valueOf(): string; at(i: number): string | undefined; [index: number]: string; [Symbol.iterator](): IterableIterator<string>; } interface StringConstructor { (v?: unknown): string; new(v?: unknown): String; fromCharCode(...c: readonly number[]): string; fromCodePoint(...c: readonly number[]): string; raw(t: { readonly raw: readonly string[] | ArrayLike<string> }, ...s: readonly unknown[]): string; } declare const String: StringConstructor;
24
+
25
+ interface ConcatArray<T> { readonly length: number; readonly [n: number]: T; }
26
+ interface ReadonlyArray<T> { readonly length: number; readonly [n: number]: T; at(i: number): T | undefined; concat(...i: readonly (T | ConcatArray<T>)[]): T[]; entries(): IterableIterator<[number, T]>; every(p: (v: T, i: number, a: readonly T[]) => unknown): boolean; filter<S extends T>(p: (v: T, i: number, a: readonly T[]) => v is S): S[]; filter(p: (v: T, i: number, a: readonly T[]) => unknown): T[]; find<S extends T>(p: (v: T, i: number, a: readonly T[]) => v is S): S | undefined; find(p: (v: T, i: number, a: readonly T[]) => unknown): T | undefined; findIndex(p: (v: T, i: number, a: readonly T[]) => unknown): number; flat<D extends number = 1>(depth?: D): unknown[]; flatMap<U>(f: (v: T, i: number, a: readonly T[]) => U | readonly U[]): U[]; forEach(f: (v: T, i: number, a: readonly T[]) => void): void; includes(v: T, i?: number): boolean; indexOf(v: T, i?: number): number; join(s?: string): string; keys(): IterableIterator<number>; lastIndexOf(v: T, i?: number): number; map<U>(f: (v: T, i: number, a: readonly T[]) => U): U[]; reduce(f: (p: T, c: T, i: number, a: readonly T[]) => T): T; reduce<U>(f: (p: U, c: T, i: number, a: readonly T[]) => U, initial: U): U; slice(a?: number, b?: number): T[]; some(p: (v: T, i: number, a: readonly T[]) => unknown): boolean; toLocaleString(): string; toString(): string; values(): IterableIterator<T>; [Symbol.iterator](): IterableIterator<T>; }
27
+ interface Array<T> extends ReadonlyArray<T> { [n: number]: T; copyWithin(t: number, s: number, e?: number): this; fill(v: T, s?: number, e?: number): this; pop(): T | undefined; push(...v: readonly T[]): number; reverse(): this; shift(): T | undefined; sort(f?: (a: T, b: T) => number): this; splice(s: number, d?: number, ...i: readonly T[]): T[]; unshift(...v: readonly T[]): number; } interface ArrayConstructor { new <T>(...i: readonly T[]): T[]; <T>(...i: readonly T[]): T[]; isArray(a: unknown): a is readonly unknown[]; from<T>(i: Iterable<T> | ArrayLike<T>): T[]; from<T, U>(i: Iterable<T> | ArrayLike<T>, f: (v: T, i: number) => U): U[]; of<T>(...i: readonly T[]): T[]; } declare const Array: ArrayConstructor;
28
+ interface Math { readonly E: number; readonly LN10: number; readonly LN2: number; readonly LOG10E: number; readonly LOG2E: number; readonly PI: number; readonly SQRT1_2: number; readonly SQRT2: number; abs(x: number): number; acos(x: number): number; acosh(x: number): number; asin(x: number): number; asinh(x: number): number; atan(x: number): number; atan2(y: number, x: number): number; atanh(x: number): number; ceil(x: number): number; cbrt(x: number): number; clz32(x: number): number; cos(x: number): number; cosh(x: number): number; exp(x: number): number; expm1(x: number): number; floor(x: number): number; fround(x: number): number; hypot(...v: readonly number[]): number; imul(x: number, y: number): number; log(x: number): number; log10(x: number): number; log1p(x: number): number; log2(x: number): number; max(...v: readonly number[]): number; min(...v: readonly number[]): number; pow(x: number, y: number): number; random(): number; round(x: number): number; sign(x: number): number; sin(x: number): number; sinh(x: number): number; sqrt(x: number): number; tan(x: number): number; tanh(x: number): number; trunc(x: number): number; } declare const Math: Math;
29
+ interface Date { toString(): string; toDateString(): string; toTimeString(): string; toISOString(): string; toJSON(k?: unknown): string | null; valueOf(): number; getTime(): number; getFullYear(): number; getUTCFullYear(): number; getMonth(): number; getUTCMonth(): number; getDate(): number; getUTCDate(): number; getDay(): number; getUTCDay(): number; getHours(): number; getUTCHours(): number; getMinutes(): number; getUTCMinutes(): number; getSeconds(): number; getUTCSeconds(): number; getMilliseconds(): number; getUTCMilliseconds(): number; getTimezoneOffset(): number; setTime(t: number): number; setFullYear(y: number, m?: number, d?: number): number; setUTCFullYear(y: number, m?: number, d?: number): number; setMonth(m: number, d?: number): number; setUTCMonth(m: number, d?: number): number; setDate(d: number): number; setUTCDate(d: number): number; setHours(h: number, m?: number, s?: number, ms?: number): number; setUTCHours(h: number, m?: number, s?: number, ms?: number): number; setMinutes(m: number, s?: number, ms?: number): number; setUTCMinutes(m: number, s?: number, ms?: number): number; setSeconds(s: number, ms?: number): number; setUTCSeconds(s: number, ms?: number): number; setMilliseconds(ms: number): number; setUTCMilliseconds(ms: number): number; } interface DateConstructor { new(): Date; new(v: number | string): Date; new(y: number, m: number, d?: number, h?: number, min?: number, s?: number, ms?: number): Date; (): string; parse(s: string): number; UTC(y: number, m: number, d?: number, h?: number, min?: number, s?: number, ms?: number): number; now(): number; } declare const Date: DateConstructor;
30
+ interface RegExpMatchArray extends Array<string> { index?: number; input?: string; groups?: { [k: string]: string }; } interface RegExpExecArray extends RegExpMatchArray { index: number; input: string; } interface RegExp { readonly source: string; readonly global: boolean; readonly ignoreCase: boolean; readonly multiline: boolean; readonly dotAll: boolean; readonly unicode: boolean; readonly sticky: boolean; lastIndex: number; exec(s: string): RegExpExecArray | null; test(s: string): boolean; compile(p: string | RegExp, f?: string): this; toString(): string; [Symbol.match](s: string): RegExpMatchArray | null; [Symbol.matchAll](s: string): IterableIterator<RegExpMatchArray>; [Symbol.replace](s: string, r: string | ((s: string, ...a: readonly unknown[]) => string)): string; [Symbol.search](s: string): number; [Symbol.split](s: string, l?: number): string[]; } interface RegExpConstructor { new(p: string | RegExp, f?: string): RegExp; (p: string | RegExp, f?: string): RegExp; } declare const RegExp: RegExpConstructor;
31
+ interface ErrorOptions { cause?: unknown; } interface Error { name: string; message: string; stack?: string; cause?: unknown; toString(): string; } interface ErrorConstructor { new(m?: string, o?: ErrorOptions): Error; (m?: string, o?: ErrorOptions): Error; readonly prototype: Error; } declare const Error: ErrorConstructor; interface EvalError extends Error {} interface RangeError extends Error {} interface ReferenceError extends Error {} interface SyntaxError extends Error {} interface TypeError extends Error {} interface URIError extends Error {} interface InternalError extends Error {} interface ErrorSubclassConstructor<T extends Error> { new(m?: string, o?: ErrorOptions): T; (m?: string, o?: ErrorOptions): T; readonly prototype: T; } declare const EvalError: ErrorSubclassConstructor<EvalError>; declare const RangeError: ErrorSubclassConstructor<RangeError>; declare const ReferenceError: ErrorSubclassConstructor<ReferenceError>; declare const SyntaxError: ErrorSubclassConstructor<SyntaxError>; declare const TypeError: ErrorSubclassConstructor<TypeError>; declare const URIError: ErrorSubclassConstructor<URIError>; declare const InternalError: ErrorSubclassConstructor<InternalError>; interface AggregateError extends Error { errors: Iterable<unknown>; } interface AggregateErrorConstructor { new(e: Iterable<unknown>, m?: string, o?: ErrorOptions): AggregateError; } declare const AggregateError: AggregateErrorConstructor; interface SuppressedError extends Error { error: unknown; suppressed: unknown; } interface SuppressedErrorConstructor { new(e: unknown, s: unknown, m?: string, o?: ErrorOptions): SuppressedError; } declare const SuppressedError: SuppressedErrorConstructor;
32
+ interface JSON { parse(t: string, r?: (this: unknown, k: string, v: unknown) => unknown): unknown; stringify(v: unknown, r?: ((this: unknown, k: string, v: unknown) => unknown) | readonly (string | number)[] | null, s?: string | number): string | undefined; } declare const JSON: JSON;
33
+ interface PromiseLike<T> { then<R1 = T, R2 = never>(ok?: ((v: T) => R1 | PromiseLike<R1>) | null, fail?: ((r: unknown) => R2 | PromiseLike<R2>) | null): PromiseLike<R1 | R2>; } interface Promise<T> extends PromiseLike<T> { catch<R = never>(f?: ((r: unknown) => R | PromiseLike<R>) | null): Promise<T | R>; finally(f?: (() => void) | null): Promise<T>; } interface PromiseConstructor { new <T>(e: (resolve: (v: T | PromiseLike<T>) => void, reject: (r?: unknown) => void) => void): Promise<T>; all<T>(v: Iterable<T | PromiseLike<T>>): Promise<Awaited<T>[]>; allSettled<T>(v: Iterable<T | PromiseLike<T>>): Promise<PromiseSettledResult<Awaited<T>>[]>; any<T>(v: Iterable<T | PromiseLike<T>>): Promise<Awaited<T>>; race<T>(v: Iterable<T | PromiseLike<T>>): Promise<Awaited<T>>; reject<T = never>(r?: unknown): Promise<T>; resolve(): Promise<void>; resolve<T>(v: T | PromiseLike<T>): Promise<Awaited<T>>; } interface PromiseFulfilledResult<T> { status: "fulfilled"; value: T; } interface PromiseRejectedResult { status: "rejected"; reason: unknown; } type PromiseSettledResult<T> = PromiseFulfilledResult<T> | PromiseRejectedResult; declare const Promise: PromiseConstructor; declare function queueMicrotask(f: () => void): void;
34
+ interface Map<K, V> { readonly size: number; clear(): void; delete(k: K): boolean; entries(): IterableIterator<[K, V]>; forEach(f: (v: V, k: K, m: Map<K, V>) => void, thisArg?: unknown): void; get(k: K): V | undefined; has(k: K): boolean; keys(): IterableIterator<K>; set(k: K, v: V): this; values(): IterableIterator<V>; [Symbol.iterator](): IterableIterator<[K, V]>; } interface MapConstructor { new <K, V>(e?: readonly (readonly [K, V])[] | Iterable<readonly [K, V]>): Map<K, V>; } declare const Map: MapConstructor; interface Set<T> { readonly size: number; add(v: T): this; clear(): void; delete(v: T): boolean; entries(): IterableIterator<[T, T]>; forEach(f: (v: T, v2: T, s: Set<T>) => void, thisArg?: unknown): void; has(v: T): boolean; keys(): IterableIterator<T>; values(): IterableIterator<T>; [Symbol.iterator](): IterableIterator<T>; } interface SetConstructor { new <T>(v?: readonly T[] | Iterable<T>): Set<T>; } declare const Set: SetConstructor; type WeakKey = object | Function; interface WeakMap<K extends WeakKey, V> { delete(k: K): boolean; get(k: K): V | undefined; has(k: K): boolean; set(k: K, v: V): this; } interface WeakMapConstructor { new <K extends WeakKey, V>(e?: readonly (readonly [K, V])[] | Iterable<readonly [K, V]>): WeakMap<K, V>; } declare const WeakMap: WeakMapConstructor; interface WeakSet<T extends WeakKey> { add(v: T): this; delete(v: T): boolean; has(v: T): boolean; } interface WeakSetConstructor { new <T extends WeakKey>(v?: readonly T[] | Iterable<T>): WeakSet<T>; } declare const WeakSet: WeakSetConstructor;
35
+ interface ArrayBufferOptions { maxByteLength?: number; } interface ArrayBuffer { readonly byteLength: number; slice(a: number, b?: number): ArrayBuffer; } interface ArrayBufferConstructor { new(n: number, options?: ArrayBufferOptions): ArrayBuffer; isView(a: unknown): a is ArrayBufferView; } declare const ArrayBuffer: ArrayBufferConstructor; interface SharedArrayBuffer { readonly byteLength: number; slice(a: number, b?: number): SharedArrayBuffer; } interface SharedArrayBufferConstructor { new(n: number, options?: ArrayBufferOptions): SharedArrayBuffer; } declare const SharedArrayBuffer: SharedArrayBufferConstructor; type ArrayBufferLike = ArrayBuffer | SharedArrayBuffer;
36
+ interface DataView { readonly buffer: ArrayBufferLike; readonly byteLength: number; readonly byteOffset: number; getBigInt64(o: number, l?: boolean): bigint; getBigUint64(o: number, l?: boolean): bigint; getFloat16(o: number, l?: boolean): number; getFloat32(o: number, l?: boolean): number; getFloat64(o: number, l?: boolean): number; getInt8(o: number): number; getInt16(o: number, l?: boolean): number; getInt32(o: number, l?: boolean): number; getUint8(o: number): number; getUint16(o: number, l?: boolean): number; getUint32(o: number, l?: boolean): number; setBigInt64(o: number, v: bigint, l?: boolean): void; setBigUint64(o: number, v: bigint, l?: boolean): void; setFloat16(o: number, v: number, l?: boolean): void; setFloat32(o: number, v: number, l?: boolean): void; setFloat64(o: number, v: number, l?: boolean): void; setInt8(o: number, v: number): void; setInt16(o: number, v: number, l?: boolean): void; setInt32(o: number, v: number, l?: boolean): void; setUint8(o: number, v: number): void; setUint16(o: number, v: number, l?: boolean): void; setUint32(o: number, v: number, l?: boolean): void; } interface DataViewConstructor { new(b: ArrayBufferLike, o?: number, l?: number): DataView; } declare const DataView: DataViewConstructor;
37
+ interface TypedArray<T> extends ArrayLike<T>, Iterable<T> { readonly buffer: ArrayBufferLike; readonly byteLength: number; readonly byteOffset: number; readonly BYTES_PER_ELEMENT: number; at(i: number): T | undefined; copyWithin(t: number, s: number, e?: number): this; entries(): IterableIterator<[number, T]>; every(p: (v: T, i: number, a: this) => unknown): boolean; fill(v: T, s?: number, e?: number): this; filter(p: (v: T, i: number, a: this) => unknown): T[]; find(p: (v: T, i: number, a: this) => unknown): T | undefined; findIndex(p: (v: T, i: number, a: this) => unknown): number; forEach(f: (v: T, i: number, a: this) => void): void; includes(v: T, i?: number): boolean; indexOf(v: T, i?: number): number; join(s?: string): string; keys(): IterableIterator<number>; lastIndexOf(v: T, i?: number): number; map<U>(f: (v: T, i: number, a: this) => U): U[]; reduce(f: (p: T, c: T, i: number, a: this) => T): T; reduce<U>(f: (p: U, c: T, i: number, a: this) => U, initial: U): U; reverse(): this; set(a: ArrayLike<T>, o?: number): void; slice(s?: number, e?: number): T[]; some(p: (v: T, i: number, a: this) => unknown): boolean; sort(f?: (a: T, b: T) => number): this; subarray(b?: number, e?: number): this; values(): IterableIterator<T>; [index: number]: T; [Symbol.iterator](): IterableIterator<T>; }
38
+ interface Int8Array extends TypedArray<number> {} interface Uint8Array extends TypedArray<number> {} interface Uint8ClampedArray extends TypedArray<number> {} interface Int16Array extends TypedArray<number> {} interface Uint16Array extends TypedArray<number> {} interface Int32Array extends TypedArray<number> {} interface Uint32Array extends TypedArray<number> {} interface Float16Array extends TypedArray<number> {} interface Float32Array extends TypedArray<number> {} interface Float64Array extends TypedArray<number> {} interface BigInt64Array extends TypedArray<bigint> {} interface BigUint64Array extends TypedArray<bigint> {} interface TypedArrayConstructor<T, A extends TypedArray<T>> { new(n: number): A; new(a: ArrayLike<T> | Iterable<T>): A; new(b: ArrayBufferLike, o?: number, l?: number): A; readonly BYTES_PER_ELEMENT: number; from(s: ArrayLike<T> | Iterable<T>): A; of(...i: readonly T[]): A; } declare const Int8Array: TypedArrayConstructor<number, Int8Array>; declare const Uint8Array: Uint8ArrayConstructor; declare const Uint8ClampedArray: TypedArrayConstructor<number, Uint8ClampedArray>; declare const Int16Array: TypedArrayConstructor<number, Int16Array>; declare const Uint16Array: TypedArrayConstructor<number, Uint16Array>; declare const Int32Array: TypedArrayConstructor<number, Int32Array>; declare const Uint32Array: TypedArrayConstructor<number, Uint32Array>; declare const Float16Array: TypedArrayConstructor<number, Float16Array>; declare const Float32Array: TypedArrayConstructor<number, Float32Array>; declare const Float64Array: TypedArrayConstructor<number, Float64Array>; declare const BigInt64Array: TypedArrayConstructor<bigint, BigInt64Array>; declare const BigUint64Array: TypedArrayConstructor<bigint, BigUint64Array>; type ArrayBufferView = DataView | Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float16Array | Float32Array | Float64Array | BigInt64Array | BigUint64Array;
39
+ interface Atomics { add(a: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, i: number, v: number): number; add(a: BigInt64Array | BigUint64Array, i: number, v: bigint): bigint; and(a: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, i: number, v: number): number; and(a: BigInt64Array | BigUint64Array, i: number, v: bigint): bigint; compareExchange<T extends number | bigint>(a: TypedArray<T>, i: number, e: T, r: T): T; exchange<T extends number | bigint>(a: TypedArray<T>, i: number, v: T): T; isLockFree(s: number): boolean; load<T extends number | bigint>(a: TypedArray<T>, i: number): T; notify(a: Int32Array | BigInt64Array, i: number, c?: number): number; or(a: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, i: number, v: number): number; or(a: BigInt64Array | BigUint64Array, i: number, v: bigint): bigint; pause(i?: number): void; store<T extends number | bigint>(a: TypedArray<T>, i: number, v: T): T; sub(a: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, i: number, v: number): number; sub(a: BigInt64Array | BigUint64Array, i: number, v: bigint): bigint; xor(a: Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array, i: number, v: number): number; xor(a: BigInt64Array | BigUint64Array, i: number, v: bigint): bigint; } declare const Atomics: Atomics;
40
+ interface ProxyHandler<T extends object> { apply?(t: T, thisArg: unknown, args: readonly unknown[]): unknown; construct?(t: T, args: readonly unknown[], n: Function): object; defineProperty?(t: T, p: PropertyKey, a: PropertyDescriptor): boolean; deleteProperty?(t: T, p: PropertyKey): boolean; get?(t: T, p: PropertyKey, r: unknown): unknown; getOwnPropertyDescriptor?(t: T, p: PropertyKey): PropertyDescriptor | undefined; getPrototypeOf?(t: T): object | null; has?(t: T, p: PropertyKey): boolean; isExtensible?(t: T): boolean; ownKeys?(t: T): readonly PropertyKey[]; preventExtensions?(t: T): boolean; set?(t: T, p: PropertyKey, v: unknown, r: unknown): boolean; setPrototypeOf?(t: T, p: object | null): boolean; } interface ProxyConstructor { new <T extends object>(t: T, h: ProxyHandler<T>): T; revocable<T extends object>(t: T, h: ProxyHandler<T>): { proxy: T; revoke: () => void }; } declare const Proxy: ProxyConstructor; interface Reflect { apply(t: Function, thisArg: unknown, args: ArrayLike<unknown>): unknown; construct(t: Function, args: ArrayLike<unknown>, n?: Function): object; defineProperty(t: object, p: PropertyKey, a: PropertyDescriptor): boolean; deleteProperty(t: object, p: PropertyKey): boolean; get(t: object, p: PropertyKey, r?: unknown): unknown; getOwnPropertyDescriptor(t: object, p: PropertyKey): PropertyDescriptor | undefined; getPrototypeOf(t: object): object | null; has(t: object, p: PropertyKey): boolean; isExtensible(t: object): boolean; ownKeys(t: object): PropertyKey[]; preventExtensions(t: object): boolean; set(t: object, p: PropertyKey, v: unknown, r?: unknown): boolean; setPrototypeOf(t: object, p: object | null): boolean; } declare const Reflect: Reflect;
41
+ interface WeakRef<T extends WeakKey> { deref(): T | undefined; } interface WeakRefConstructor { new <T extends WeakKey>(t: T): WeakRef<T>; } declare const WeakRef: WeakRefConstructor; interface FinalizationRegistry<T> { register(t: WeakKey, h: T, token?: WeakKey): void; unregister(token: WeakKey): boolean; } interface FinalizationRegistryConstructor { new <T>(f: (h: T) => void): FinalizationRegistry<T>; } declare const FinalizationRegistry: FinalizationRegistryConstructor;
42
+ declare function decodeURI(s: string): string; declare function decodeURIComponent(s: string): string; declare function encodeURI(s: string): string; declare function encodeURIComponent(s: string): string; declare function eval(s: string): unknown; declare function isFinite(n: number): boolean; declare function isNaN(n: number): boolean; declare function parseFloat(s: string): number; declare function parseInt(s: string, r?: number): number; declare const NaN: number; declare const Infinity: number;
43
+
44
+ /* QuickJS-NG 0.17 native ECMAScript additions installed by JS_NewContext(). */
45
+ interface SymbolConstructor { readonly dispose: unique symbol; readonly asyncDispose: unique symbol; }
46
+ interface ObjectConstructor { groupBy<K extends PropertyKey, T>(items: Iterable<T>, callback: (value: T, index: number) => K): Record<K, T[]>; }
47
+ interface ObjectConstructor { assign<T extends object>(target: T, ...sources: readonly object[]): T; }
48
+ interface ErrorConstructor { isError(value: unknown): value is Error; captureStackTrace(target: object, constructor?: Function): void; stackTraceLimit: number; prepareStackTrace?: (error: Error, callSites: readonly CallSite[]) => unknown; }
49
+ interface String { isWellFormed(): boolean; toWellFormed(): string; substr(from: number, length?: number): string; trimLeft(): string; trimRight(): string; anchor(name: string): string; big(): string; blink(): string; bold(): string; fixed(): string; fontcolor(color: string): string; fontsize(size: string | number): string; italics(): string; link(url: string): string; small(): string; strike(): string; sub(): string; sup(): string; }
50
+ interface ReadonlyArray<T> { findLast<S extends T>(predicate: (value: T, index: number, array: readonly T[]) => value is S): S | undefined; findLast(predicate: (value: T, index: number, array: readonly T[]) => unknown): T | undefined; findLastIndex(predicate: (value: T, index: number, array: readonly T[]) => unknown): number; toReversed(): T[]; toSorted(compare?: (a: T, b: T) => number): T[]; toSpliced(start: number, deleteCount?: number, ...items: readonly T[]): T[]; with(index: number, value: T): T[]; reduceRight(callback: (previous: T, current: T, index: number, array: readonly T[]) => T): T; reduceRight<U>(callback: (previous: U, current: T, index: number, array: readonly T[]) => U, initial: U): U; }
51
+ interface ArrayConstructor { from<T, U>(items: Iterable<T> | ArrayLike<T>, map: (value: T, index: number) => U, thisArg: unknown): U[]; fromAsync<T>(items: AsyncIterable<T> | Iterable<T | PromiseLike<T>>): Promise<Awaited<T>[]>; fromAsync<T, U>(items: AsyncIterable<T> | Iterable<T | PromiseLike<T>>, map: (value: T, index: number) => U | PromiseLike<U>, thisArg?: unknown): Promise<Awaited<U>[]>; }
52
+ interface Math { f16round(x: number): number; sumPrecise(values: Iterable<number>): number; }
53
+ interface Date { getYear(): number; setYear(year: number): number; toUTCString(): string; toGMTString(): string; toLocaleDateString(locales?: string | readonly string[], options?: object): string; toLocaleTimeString(locales?: string | readonly string[], options?: object): string; toLocaleString(locales?: string | readonly string[], options?: object): string; [Symbol.toPrimitive](hint: "default" | "string" | "number"): string | number; }
54
+ interface RegExpIndicesArray extends Array<[number, number] | undefined> { groups?: { [key: string]: [number, number] | undefined }; }
55
+ interface RegExpExecArray { indices?: RegExpIndicesArray; }
56
+ interface RegExp { readonly hasIndices: boolean; readonly unicodeSets: boolean; readonly flags: string; } interface RegExpConstructor { escape(value: string): string; }
57
+ interface JSON { rawJSON(text: string): object; isRawJSON(value: unknown): boolean; }
58
+ interface PromiseWithResolvers<T> { promise: Promise<T>; resolve(value: T | PromiseLike<T>): void; reject(reason?: unknown): void; }
59
+ interface PromiseConstructor { try<T>(callback: () => T | PromiseLike<T>): Promise<Awaited<T>>; withResolvers<T>(): PromiseWithResolvers<T>; }
60
+ interface Map<K, V> { getOrInsert(key: K, value: V): V; getOrInsertComputed(key: K, callback: (key: K) => V): V; }
61
+ interface MapConstructor { groupBy<K, T>(items: Iterable<T>, callback: (value: T, index: number) => K): Map<K, T[]>; }
62
+ interface WeakMap<K extends WeakKey, V> { getOrInsert(key: K, value: V): V; getOrInsertComputed(key: K, callback: (key: K) => V): V; }
63
+ interface Set<T> { union(other: ReadonlySetLike<T>): Set<T>; intersection(other: ReadonlySetLike<T>): Set<T>; difference(other: ReadonlySetLike<T>): Set<T>; symmetricDifference(other: ReadonlySetLike<T>): Set<T>; isSubsetOf(other: ReadonlySetLike<T>): boolean; isSupersetOf(other: ReadonlySetLike<T>): boolean; isDisjointFrom(other: ReadonlySetLike<T>): boolean; }
64
+ interface ReadonlySetLike<T> { readonly size: number; has(value: T): boolean; keys(): Iterator<T>; }
65
+ interface ArrayBuffer { readonly maxByteLength: number; readonly resizable: boolean; readonly detached: boolean; readonly immutable: boolean; resize(newLength: number): void; sliceToImmutable(begin?: number, end?: number): ArrayBuffer; transfer(newLength?: number): ArrayBuffer; transferToImmutable(newLength?: number): ArrayBuffer; transferToFixedLength(newLength?: number): ArrayBuffer; }
66
+ interface SharedArrayBuffer { readonly maxByteLength: number; readonly growable: boolean; grow(newLength: number): void; }
67
+ interface TypedArray<T> { with(index: number, value: T): this; findLast(predicate: (value: T, index: number, array: this) => unknown): T | undefined; findLastIndex(predicate: (value: T, index: number, array: this) => unknown): number; reduceRight(callback: (previous: T, current: T, index: number, array: this) => T): T; reduceRight<U>(callback: (previous: U, current: T, index: number, array: this) => U, initial: U): U; toLocaleString(): string; toString(): string; toReversed(): this; toSorted(compare?: (a: T, b: T) => number): this; }
68
+ interface TypedArrayConstructor<T, A extends TypedArray<T>> { from<U>(source: ArrayLike<U> | Iterable<U>, map: (value: U, index: number) => T, thisArg?: unknown): A; }
69
+ interface Uint8ArrayBase64Options { alphabet?: "base64" | "base64url"; omitPadding?: boolean; lastChunkHandling?: "loose" | "strict" | "stop-before-partial"; }
70
+ interface Uint8Array extends TypedArray<number> { toBase64(options?: Uint8ArrayBase64Options): string; toHex(): string; setFromBase64(value: string, options?: Uint8ArrayBase64Options): { read: number; written: number }; setFromHex(value: string): { read: number; written: number }; }
71
+ interface Uint8ArrayConstructor extends TypedArrayConstructor<number, Uint8Array> { fromBase64(value: string, options?: Uint8ArrayBase64Options): Uint8Array; fromHex(value: string): Uint8Array; }
72
+ interface Atomics { wait(array: Int32Array | BigInt64Array, index: number, value: number | bigint, timeout?: number): "ok" | "not-equal" | "timed-out"; }
73
+ interface IteratorObject<T, TReturn = unknown, TNext = unknown> extends Iterator<T, TReturn, TNext> { chunks(size: number): IteratorObject<T[]>; drop(limit: number): IteratorObject<T>; filter(predicate: (value: T, index: number) => unknown): IteratorObject<T>; flatMap<U>(callback: (value: T, index: number) => Iterator<U> | Iterable<U>): IteratorObject<U>; map<U>(callback: (value: T, index: number) => U): IteratorObject<U>; take(limit: number): IteratorObject<T>; windows(size: number): IteratorObject<T[]>; every(predicate: (value: T, index: number) => unknown): boolean; find(predicate: (value: T, index: number) => unknown): T | undefined; forEach(callback: (value: T, index: number) => void): void; some(predicate: (value: T, index: number) => unknown): boolean; includes(value: T): boolean; join(separator?: string): string; reduce(callback: (previous: T, current: T, index: number) => T): T; reduce<U>(callback: (previous: U, current: T, index: number) => U, initial: U): U; toArray(): T[]; [Symbol.iterator](): IteratorObject<T, TReturn, TNext>; [Symbol.dispose](): void; }
74
+ interface IteratorConstructor { from<T>(value: Iterator<T> | Iterable<T>): IteratorObject<T>; concat<T>(...iterables: readonly Iterable<T>[]): IteratorObject<T>; }
75
+ declare const Iterator: IteratorConstructor;
76
+ interface Generator<T = unknown, TReturn = unknown, TNext = unknown> extends IteratorObject<T, TReturn, TNext> { next(...args: [] | [TNext]): IteratorResult<T, TReturn>; return(value: TReturn): IteratorResult<T, TReturn>; throw(error: unknown): IteratorResult<T, TReturn>; }
77
+ interface AsyncGenerator<T = unknown, TReturn = unknown, TNext = unknown> extends AsyncIterator<T, TReturn, TNext>, AsyncIterable<T> { next(...args: [] | [TNext]): Promise<IteratorResult<T, TReturn>>; return(value: TReturn): Promise<IteratorResult<T, TReturn>>; throw(error: unknown): Promise<IteratorResult<T, TReturn>>; [Symbol.asyncDispose](): Promise<void>; }
78
+ interface Disposable { [Symbol.dispose](): void; } interface AsyncDisposable { [Symbol.asyncDispose](): void | PromiseLike<void>; }
79
+ interface DisposableStack { readonly disposed: boolean; use<T extends Disposable | null | undefined>(value: T): T; adopt<T>(value: T, onDispose: (value: T) => void): T; defer(onDispose: () => void): void; move(): DisposableStack; dispose(): void; [Symbol.dispose](): void; } interface DisposableStackConstructor { new(): DisposableStack; } declare const DisposableStack: DisposableStackConstructor;
80
+ interface AsyncDisposableStack { readonly disposed: boolean; use<T extends AsyncDisposable | Disposable | null | undefined>(value: T): T; adopt<T>(value: T, onDispose: (value: T) => void | PromiseLike<void>): T; defer(onDispose: () => void | PromiseLike<void>): void; move(): AsyncDisposableStack; disposeAsync(): Promise<void>; [Symbol.asyncDispose](): Promise<void>; } interface AsyncDisposableStackConstructor { new(): AsyncDisposableStack; } declare const AsyncDisposableStack: AsyncDisposableStackConstructor;
81
+ interface CallSite { isNative(): boolean; isConstructor(): boolean; getFileName(): string | undefined; getFunction(): Function | undefined; getFunctionName(): string | undefined; getColumnNumber(): number | undefined; getLineNumber(): number | undefined; }
82
+ interface DOMException extends Error { readonly name: string; readonly message: string; readonly code: number; readonly INDEX_SIZE_ERR: 1; readonly DOMSTRING_SIZE_ERR: 2; readonly HIERARCHY_REQUEST_ERR: 3; readonly WRONG_DOCUMENT_ERR: 4; readonly INVALID_CHARACTER_ERR: 5; readonly NO_DATA_ALLOWED_ERR: 6; readonly NO_MODIFICATION_ALLOWED_ERR: 7; readonly NOT_FOUND_ERR: 8; readonly NOT_SUPPORTED_ERR: 9; readonly INUSE_ATTRIBUTE_ERR: 10; readonly INVALID_STATE_ERR: 11; readonly SYNTAX_ERR: 12; readonly INVALID_MODIFICATION_ERR: 13; readonly NAMESPACE_ERR: 14; readonly INVALID_ACCESS_ERR: 15; readonly VALIDATION_ERR: 16; readonly TYPE_MISMATCH_ERR: 17; readonly SECURITY_ERR: 18; readonly NETWORK_ERR: 19; readonly ABORT_ERR: 20; readonly URL_MISMATCH_ERR: 21; readonly QUOTA_EXCEEDED_ERR: 22; readonly TIMEOUT_ERR: 23; readonly INVALID_NODE_TYPE_ERR: 24; readonly DATA_CLONE_ERR: 25; } interface DOMExceptionConstructor extends DOMException { new(message?: string, name?: string): DOMException; readonly prototype: DOMException; } declare const DOMException: DOMExceptionConstructor;
83
+ declare function atob(value: string): string; declare function btoa(value: string): string; declare function escape(value: string): string; declare function unescape(value: string): string;
84
+ interface Performance { readonly timeOrigin: number; now(): number; } declare const performance: Performance;
85
+ /** Bounded KDataForgeJS logging. No inspection, grouping, timing, table, or trace APIs. */
86
+ interface Console { log(...data: readonly unknown[]): void; info(...data: readonly unknown[]): void; warn(...data: readonly unknown[]): void; error(...data: readonly unknown[]): void; debug(...data: readonly unknown[]): void; }
87
+ declare const console: Console;
package/package.json CHANGED
@@ -1,6 +1,40 @@
1
1
  {
2
2
  "name": "@sf-kmods/kdataforgejs",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.17",
4
+ "description": "TypeScript types for KDataForgeJS packs: declarations of the built-in @sf-kmods/kdataforgejs module plus a strict tsconfig base.",
5
+ "license": "MIT",
6
+ "author": "Kyri123/Kyrium",
7
+ "homepage": "https://docs.k-mods.com/kdataforge/",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/Satisfactory-KMods/modding.git",
11
+ "directory": "kdataforgejs-sdk/packages/types"
12
+ },
13
+ "publishConfig": {
14
+ "access": "public"
15
+ },
16
+ "keywords": [
17
+ "kdataforge",
18
+ "satisfactory",
19
+ "modding",
20
+ "typescript"
21
+ ],
22
+ "files": [
23
+ "index.d.ts",
24
+ "lib",
25
+ "tsconfig.base.json",
26
+ "declarations.json",
27
+ "editor.kdfjs.json",
28
+ "README.md"
29
+ ],
30
+ "exports": {
31
+ "./tsconfig.base.json": "./tsconfig.base.json",
32
+ "./declarations.json": "./declarations.json",
33
+ "./package.json": "./package.json"
34
+ },
35
+ "scripts": {
36
+ "sync": "node scripts/sync-declarations.mjs",
37
+ "build": "node scripts/sync-declarations.mjs",
38
+ "test": "node --test \"test/*.test.mjs\""
39
+ }
6
40
  }
@@ -0,0 +1,14 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "compilerOptions": {
4
+ "target": "ES2020",
5
+ "module": "ESNext",
6
+ "moduleResolution": "Bundler",
7
+ "strict": true,
8
+ "noEmit": true,
9
+ "noLib": true,
10
+ "allowImportingTsExtensions": true,
11
+ "skipLibCheck": true
12
+ },
13
+ "files": ["./lib/kdfjs-es2020.d.ts", "./index.d.ts"]
14
+ }