@sf-kmods/kdataforgejs 2026.4.28 → 2026.4.36
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 +16 -3
- package/authoring.kdfjs.json +24434 -0
- package/declarations.json +8 -1
- package/enums.kdfjs.json +754 -0
- package/index.d.ts +424 -115
- package/package.json +8 -4
package/index.d.ts
CHANGED
|
@@ -1,37 +1,363 @@
|
|
|
1
1
|
/** UE class handle. Generated declarations merge this global shape for ergonomic `Class<T>` use. */
|
|
2
2
|
/** Vendored KDataForgeJS runtime declaration. No package manager or node_modules required. */
|
|
3
3
|
declare module "@sf-kmods/kdataforgejs" {
|
|
4
|
+
export enum TypeKind {
|
|
5
|
+
Value = 0,
|
|
6
|
+
Struct = 1,
|
|
7
|
+
Object = 2,
|
|
8
|
+
Class = 3,
|
|
9
|
+
Enum = 4,
|
|
10
|
+
}
|
|
11
|
+
export enum MemberAccess {
|
|
12
|
+
None = 0,
|
|
13
|
+
Read = 1,
|
|
14
|
+
Write = 2,
|
|
15
|
+
ReadWrite = 3,
|
|
16
|
+
}
|
|
17
|
+
export enum InvocationKind {
|
|
18
|
+
None = 0,
|
|
19
|
+
Static = 1,
|
|
20
|
+
Member = 2,
|
|
21
|
+
Custom = 3,
|
|
22
|
+
}
|
|
23
|
+
export enum CallEffect {
|
|
24
|
+
None = 0,
|
|
25
|
+
ReadOnly = 1,
|
|
26
|
+
ReversibleMutation = 2,
|
|
27
|
+
IrreversibleMutation = 3,
|
|
28
|
+
}
|
|
29
|
+
export enum TargetKind {
|
|
30
|
+
Realm = 0,
|
|
31
|
+
Class = 1,
|
|
32
|
+
CDO = 2,
|
|
33
|
+
Actor = 3,
|
|
34
|
+
Behavior = 4,
|
|
35
|
+
}
|
|
36
|
+
export enum TargetCardinality {
|
|
37
|
+
One = 0,
|
|
38
|
+
Many = 1,
|
|
39
|
+
}
|
|
40
|
+
export enum Authority {
|
|
41
|
+
Server = 0,
|
|
42
|
+
ClientCosmetic = 1,
|
|
43
|
+
Both = 2,
|
|
44
|
+
}
|
|
45
|
+
export enum ThreadAffinity {
|
|
46
|
+
GameThreadOnly = 0,
|
|
47
|
+
AnyThread = 1,
|
|
48
|
+
}
|
|
49
|
+
export enum LifecyclePhase {
|
|
50
|
+
Initialization = 0,
|
|
51
|
+
WorldReady = 1,
|
|
52
|
+
Runtime = 2,
|
|
53
|
+
}
|
|
54
|
+
export enum CompareOperator {
|
|
55
|
+
Equal = "equals",
|
|
56
|
+
EqualSymbol = "==",
|
|
57
|
+
NotEqual = "notEquals",
|
|
58
|
+
NotEqualSymbol = "!=",
|
|
59
|
+
Less = "less",
|
|
60
|
+
LessSymbol = "<",
|
|
61
|
+
LessOrEqual = "lessOrEqual",
|
|
62
|
+
LessOrEqualSymbol = "<=",
|
|
63
|
+
Greater = "greater",
|
|
64
|
+
GreaterThan = "greaterThan",
|
|
65
|
+
GreaterSymbol = ">",
|
|
66
|
+
GreaterOrEqual = "greaterOrEqual",
|
|
67
|
+
GreaterOrEqualSymbol = ">=",
|
|
68
|
+
}
|
|
69
|
+
export enum ImportKind {
|
|
70
|
+
Text = "text",
|
|
71
|
+
Yaml = "yaml",
|
|
72
|
+
Binary = "binary",
|
|
73
|
+
Image = "image",
|
|
74
|
+
Audio = "audio",
|
|
75
|
+
}
|
|
76
|
+
export enum HookPhase {
|
|
77
|
+
Before = "before",
|
|
78
|
+
After = "after",
|
|
79
|
+
Replace = "replace",
|
|
80
|
+
}
|
|
81
|
+
export enum ConditionBehavior {
|
|
82
|
+
And = "AND",
|
|
83
|
+
Or = "OR",
|
|
84
|
+
}
|
|
85
|
+
export enum TagMatch {
|
|
86
|
+
All = "all",
|
|
87
|
+
Any = "any",
|
|
88
|
+
}
|
|
89
|
+
export enum ConditionOutcome {
|
|
90
|
+
Match = "match",
|
|
91
|
+
NoMatch = "noMatch",
|
|
92
|
+
Deferred = "deferred",
|
|
93
|
+
Invalid = "invalid",
|
|
94
|
+
}
|
|
95
|
+
export enum EventScalarType {
|
|
96
|
+
Boolean = "boolean",
|
|
97
|
+
Int64 = "int64",
|
|
98
|
+
Number = "number",
|
|
99
|
+
String = "string",
|
|
100
|
+
UInt64 = "uint64",
|
|
101
|
+
}
|
|
102
|
+
export enum NumericSign {
|
|
103
|
+
Negative = -1,
|
|
104
|
+
Positive = 1,
|
|
105
|
+
}
|
|
106
|
+
export enum Ordering {
|
|
107
|
+
Less = -1,
|
|
108
|
+
Equal = 0,
|
|
109
|
+
Greater = 1,
|
|
110
|
+
}
|
|
111
|
+
export enum SemVerRelease {
|
|
112
|
+
Major = "major",
|
|
113
|
+
Minor = "minor",
|
|
114
|
+
Patch = "patch",
|
|
115
|
+
Prerelease = "prerelease",
|
|
116
|
+
}
|
|
117
|
+
export enum ResourceForm {
|
|
118
|
+
Solid = "solid",
|
|
119
|
+
Liquid = "liquid",
|
|
120
|
+
Gas = "gas",
|
|
121
|
+
}
|
|
122
|
+
export enum StackSize {
|
|
123
|
+
One = "one",
|
|
124
|
+
Small = "small",
|
|
125
|
+
Medium = "medium",
|
|
126
|
+
Big = "big",
|
|
127
|
+
Huge = "huge",
|
|
128
|
+
Fluid = "fluid",
|
|
129
|
+
}
|
|
130
|
+
export enum ContentKind {
|
|
131
|
+
Item = "item",
|
|
132
|
+
Recipe = "recipe",
|
|
133
|
+
}
|
|
134
|
+
export enum DiagnosticSeverity {
|
|
135
|
+
Info = "info",
|
|
136
|
+
Warning = "warning",
|
|
137
|
+
Error = "error",
|
|
138
|
+
}
|
|
139
|
+
export enum DeliveryMode {
|
|
140
|
+
Immediate = "immediate",
|
|
141
|
+
Debounce = "debounce",
|
|
142
|
+
Throttle = "throttle",
|
|
143
|
+
}
|
|
144
|
+
export enum ActorChangeKind {
|
|
145
|
+
Added = "added",
|
|
146
|
+
Removed = "removed",
|
|
147
|
+
}
|
|
148
|
+
export enum AsyncResultStatus {
|
|
149
|
+
Fulfilled = "fulfilled",
|
|
150
|
+
Rejected = "rejected",
|
|
151
|
+
}
|
|
152
|
+
export enum LifecycleEvent {
|
|
153
|
+
WorldReady = "worldReady",
|
|
154
|
+
Travel = "travel",
|
|
155
|
+
Shutdown = "shutdown",
|
|
156
|
+
}
|
|
157
|
+
export enum DocumentType {
|
|
158
|
+
Asset = "asset",
|
|
159
|
+
CategoryReorder = "category_reorder",
|
|
160
|
+
Cdo = "cdo",
|
|
161
|
+
Class = "class",
|
|
162
|
+
Config = "config",
|
|
163
|
+
Curve = "curve",
|
|
164
|
+
Localization = "localization",
|
|
165
|
+
Item = "item",
|
|
166
|
+
Resource = "resource",
|
|
167
|
+
Building = "building",
|
|
168
|
+
Unlock = "unlock",
|
|
169
|
+
Recipe = "recipe",
|
|
170
|
+
Schematic = "schematic",
|
|
171
|
+
Research = "research",
|
|
172
|
+
Mam = "mam",
|
|
173
|
+
Sound = "sound",
|
|
174
|
+
Sublevel = "sublevel",
|
|
175
|
+
DataAsset = "dataasset",
|
|
176
|
+
EventRule = "eventrule",
|
|
177
|
+
GameTag = "gametag",
|
|
178
|
+
ResourceNode = "resourcenode",
|
|
179
|
+
SinkPoints = "sinkpoints",
|
|
180
|
+
}
|
|
181
|
+
export enum CurveType {
|
|
182
|
+
Float = "float",
|
|
183
|
+
Vector = "vector",
|
|
184
|
+
}
|
|
185
|
+
export enum CategoryKind {
|
|
186
|
+
Items = "items",
|
|
187
|
+
Recipe = "recipe",
|
|
188
|
+
Schematic = "schematic",
|
|
189
|
+
Settings = "settings",
|
|
190
|
+
}
|
|
191
|
+
export enum ActorAction {
|
|
192
|
+
Destroy = "destroy",
|
|
193
|
+
Dismantle = "dismantle",
|
|
194
|
+
}
|
|
195
|
+
export enum ClassScope {
|
|
196
|
+
Any = "any",
|
|
197
|
+
Blueprint = "blueprint",
|
|
198
|
+
Native = "native",
|
|
199
|
+
}
|
|
200
|
+
export enum PropertyOperation {
|
|
201
|
+
Add = "add",
|
|
202
|
+
Append = "append",
|
|
203
|
+
AppendUnique = "append_unique",
|
|
204
|
+
Clamp = "clamp",
|
|
205
|
+
Clear = "clear",
|
|
206
|
+
Copy = "copy",
|
|
207
|
+
Divide = "divide",
|
|
208
|
+
Duplicate = "duplicate",
|
|
209
|
+
Insert = "insert",
|
|
210
|
+
Max = "max",
|
|
211
|
+
Min = "min",
|
|
212
|
+
Move = "move",
|
|
213
|
+
Multiply = "multiply",
|
|
214
|
+
Prepend = "prepend",
|
|
215
|
+
Remove = "remove",
|
|
216
|
+
RemoveAt = "remove_at",
|
|
217
|
+
ReplaceRefs = "replace_refs",
|
|
218
|
+
Replace = "replace",
|
|
219
|
+
Reverse = "reverse",
|
|
220
|
+
Set = "set",
|
|
221
|
+
Sort = "sort",
|
|
222
|
+
Subtract = "subtract",
|
|
223
|
+
Swap = "swap",
|
|
224
|
+
Unique = "unique",
|
|
225
|
+
UpdateWhere = "update_where",
|
|
226
|
+
}
|
|
227
|
+
export enum ConfigFieldKind {
|
|
228
|
+
Text = "text",
|
|
229
|
+
Number = "number",
|
|
230
|
+
Boolean = "boolean",
|
|
231
|
+
Select = "select",
|
|
232
|
+
}
|
|
233
|
+
export enum ConfigApplyMode {
|
|
234
|
+
Hot = "hot",
|
|
235
|
+
Cold = "cold",
|
|
236
|
+
}
|
|
237
|
+
export enum ConfigValueType {
|
|
238
|
+
String = "string",
|
|
239
|
+
Text = "text",
|
|
240
|
+
Name = "name",
|
|
241
|
+
Tag = "tag",
|
|
242
|
+
Int8 = "int8",
|
|
243
|
+
Int16 = "int16",
|
|
244
|
+
Int32 = "int32",
|
|
245
|
+
Int64 = "int64",
|
|
246
|
+
Uint8 = "uint8",
|
|
247
|
+
Float = "float",
|
|
248
|
+
Double = "double",
|
|
249
|
+
Bool = "bool",
|
|
250
|
+
}
|
|
251
|
+
export enum NumberDisplayMode {
|
|
252
|
+
Slider = "slider",
|
|
253
|
+
Input = "input",
|
|
254
|
+
}
|
|
255
|
+
export enum CurveExtrapolation {
|
|
256
|
+
None = "none",
|
|
257
|
+
Constant = "constant",
|
|
258
|
+
Linear = "linear",
|
|
259
|
+
Cycle = "cycle",
|
|
260
|
+
CycleWithOffset = "cycleWithOffset",
|
|
261
|
+
Oscillate = "oscillate",
|
|
262
|
+
}
|
|
263
|
+
export enum CurveInterpolation {
|
|
264
|
+
Constant = "constant",
|
|
265
|
+
Linear = "linear",
|
|
266
|
+
Cubic = "cubic",
|
|
267
|
+
}
|
|
268
|
+
export enum CurveTangentMode {
|
|
269
|
+
Auto = "auto",
|
|
270
|
+
SmartAuto = "smartAuto",
|
|
271
|
+
User = "user",
|
|
272
|
+
Break = "break",
|
|
273
|
+
}
|
|
274
|
+
export enum CurveTangentWeightMode {
|
|
275
|
+
None = "none",
|
|
276
|
+
Arrive = "arrive",
|
|
277
|
+
Leave = "leave",
|
|
278
|
+
Both = "both",
|
|
279
|
+
}
|
|
280
|
+
export enum EventRuleEvent {
|
|
281
|
+
WorldReady = "worldReady",
|
|
282
|
+
SchematicPurchased = "schematicPurchased",
|
|
283
|
+
}
|
|
284
|
+
export enum ResourcePurity {
|
|
285
|
+
Impure = "Impure",
|
|
286
|
+
Normal = "Normal",
|
|
287
|
+
Pure = "Pure",
|
|
288
|
+
}
|
|
289
|
+
export enum ResourceNodeKind {
|
|
290
|
+
Node = "Node",
|
|
291
|
+
FrackingSatellite = "FrackingSatellite",
|
|
292
|
+
FrackingCore = "FrackingCore",
|
|
293
|
+
Geyser = "Geyser",
|
|
294
|
+
Deposit = "Deposit",
|
|
295
|
+
}
|
|
296
|
+
export enum SinkTrack {
|
|
297
|
+
Default = "Default",
|
|
298
|
+
Exploration = "Exploration",
|
|
299
|
+
}
|
|
300
|
+
export enum Capability {
|
|
301
|
+
SchematicsRead = "kdf.schematics.read",
|
|
302
|
+
OverridesTemporary = "kdf.overrides.temporary",
|
|
303
|
+
FilesWrite = "kdf.files.write",
|
|
304
|
+
DatatablesWrite = "kdf.datatables.write",
|
|
305
|
+
DatatablesRead = "kdf.datatables.read",
|
|
306
|
+
BehaviorRuntime = "kdf.behavior.runtime",
|
|
307
|
+
ClassesDefine = "kdf.classes.define",
|
|
308
|
+
ConfigRead = "kdf.config.read",
|
|
309
|
+
ConditionsEvaluate = "kdf.conditions.evaluate",
|
|
310
|
+
DiagnosticsWrite = "kdf.diagnostics.write",
|
|
311
|
+
DocumentsApply = "kdf.documents.apply",
|
|
312
|
+
EventsCustom = "kdf.events.custom",
|
|
313
|
+
ImportsRead = "kdf.imports.read",
|
|
314
|
+
ItemsDefine = "kdf.items.define",
|
|
315
|
+
ItemsRead = "kdf.items.read",
|
|
316
|
+
NativeCall = "kdf.native.call",
|
|
317
|
+
NativeHook = "kdf.native.hook",
|
|
318
|
+
NativeRead = "kdf.native.read",
|
|
319
|
+
NativeWrite = "kdf.native.write",
|
|
320
|
+
RecipesDefine = "kdf.recipes.define",
|
|
321
|
+
RecipesRead = "kdf.recipes.read",
|
|
322
|
+
ReflectionCall = "kdf.reflection.call",
|
|
323
|
+
ReflectionRead = "kdf.reflection.read",
|
|
324
|
+
ReflectionWrite = "kdf.reflection.write",
|
|
325
|
+
ScriptAdmin = "kdf.script.admin",
|
|
326
|
+
WorldRead = "kdf.world.read",
|
|
327
|
+
}
|
|
4
328
|
/** Capability ids for `defineMeta`. Reading and writing reflected values is always granted. */
|
|
5
329
|
export interface CapabilityMap {
|
|
6
|
-
readonly
|
|
7
|
-
readonly
|
|
8
|
-
readonly
|
|
9
|
-
readonly
|
|
10
|
-
readonly
|
|
11
|
-
readonly
|
|
12
|
-
readonly
|
|
13
|
-
readonly
|
|
14
|
-
readonly
|
|
15
|
-
readonly
|
|
16
|
-
readonly
|
|
17
|
-
readonly
|
|
18
|
-
readonly
|
|
19
|
-
readonly
|
|
20
|
-
readonly
|
|
21
|
-
readonly
|
|
22
|
-
readonly
|
|
23
|
-
readonly
|
|
24
|
-
readonly
|
|
25
|
-
readonly
|
|
26
|
-
readonly
|
|
27
|
-
readonly
|
|
28
|
-
readonly
|
|
29
|
-
readonly
|
|
30
|
-
readonly
|
|
31
|
-
readonly
|
|
32
|
-
}
|
|
33
|
-
export type
|
|
34
|
-
export interface Meta { readonly capabilities: readonly
|
|
330
|
+
readonly [Capability.SchematicsRead]: true;
|
|
331
|
+
readonly [Capability.OverridesTemporary]: true;
|
|
332
|
+
readonly [Capability.FilesWrite]: true;
|
|
333
|
+
readonly [Capability.DatatablesWrite]: true;
|
|
334
|
+
readonly [Capability.DatatablesRead]: true;
|
|
335
|
+
readonly [Capability.BehaviorRuntime]: true;
|
|
336
|
+
readonly [Capability.ClassesDefine]: true;
|
|
337
|
+
readonly [Capability.ConfigRead]: true;
|
|
338
|
+
readonly [Capability.ConditionsEvaluate]: true;
|
|
339
|
+
readonly [Capability.DiagnosticsWrite]: true;
|
|
340
|
+
readonly [Capability.DocumentsApply]: true;
|
|
341
|
+
readonly [Capability.EventsCustom]: true;
|
|
342
|
+
readonly [Capability.ImportsRead]: true;
|
|
343
|
+
readonly [Capability.ItemsDefine]: true;
|
|
344
|
+
readonly [Capability.ItemsRead]: true;
|
|
345
|
+
readonly [Capability.NativeCall]: true;
|
|
346
|
+
readonly [Capability.NativeHook]: true;
|
|
347
|
+
readonly [Capability.NativeRead]: true;
|
|
348
|
+
readonly [Capability.NativeWrite]: true;
|
|
349
|
+
readonly [Capability.RecipesDefine]: true;
|
|
350
|
+
readonly [Capability.RecipesRead]: true;
|
|
351
|
+
readonly [Capability.ReflectionCall]: true;
|
|
352
|
+
readonly [Capability.ReflectionRead]: true;
|
|
353
|
+
readonly [Capability.ReflectionWrite]: true;
|
|
354
|
+
readonly [Capability.ScriptAdmin]: true;
|
|
355
|
+
readonly [Capability.WorldRead]: true;
|
|
356
|
+
}
|
|
357
|
+
export type CapabilityId = keyof CapabilityMap & string;
|
|
358
|
+
export interface Meta { readonly capabilities: readonly CapabilityId[]; }
|
|
359
|
+
/** The current script realm's shared context. Import it in entry points and helper modules. */
|
|
360
|
+
export const ctx: Context;
|
|
35
361
|
export type Main = (ctx: Context) => Promise<void>;
|
|
36
362
|
export function defineMeta(meta: Meta): Readonly<Meta>;
|
|
37
363
|
export function defineHandler(handler: (ctx: Context) => Promise<void>): (ctx: Context) => Promise<void>;
|
|
@@ -48,16 +374,6 @@ declare module "@sf-kmods/kdataforgejs" {
|
|
|
48
374
|
export type InputValue = null | undefined | boolean | bigint | number | string;
|
|
49
375
|
/** Scalar neutral values returned by property reads and calls. */
|
|
50
376
|
export type Value = null | boolean | bigint | number | string;
|
|
51
|
-
export type TypeKind = 0 | 1 | 2 | 3 | 4;
|
|
52
|
-
export type MemberAccess = 0 | 1 | 2 | 3;
|
|
53
|
-
export type InvocationKind = 0 | 1 | 2 | 3;
|
|
54
|
-
export type CallEffect = 0 | 1 | 2 | 3;
|
|
55
|
-
export type TargetKind = 0 | 1 | 2 | 3 | 4;
|
|
56
|
-
export type TargetCardinality = 0 | 1;
|
|
57
|
-
export type Authority = 0 | 1 | 2;
|
|
58
|
-
export type ThreadAffinity = 0 | 1;
|
|
59
|
-
export type LifecyclePhase = 0 | 1 | 2;
|
|
60
|
-
export type CompareOperator = "equals" | "==" | "notEquals" | "!=" | "less" | "<" | "lessOrEqual" | "<=" | "greater" | "greaterThan" | ">" | "greaterOrEqual" | ">=";
|
|
61
377
|
|
|
62
378
|
export interface ExecutableDescriptor { readonly providerId: string; readonly adapterId: string; readonly targetId: string; readonly targetKind: TargetKind; readonly authority: Authority; readonly threadAffinity: ThreadAffinity; readonly lifecyclePhase: LifecyclePhase; }
|
|
63
379
|
export interface TypeDescriptor { readonly id: string; readonly kind: TypeKind; readonly baseTypeId: string; readonly capabilities: readonly string[]; readonly providerId: string; readonly nativeTypeScriptName: string; }
|
|
@@ -157,7 +473,6 @@ declare module "@sf-kmods/kdataforgejs" {
|
|
|
157
473
|
export interface EventArgs { readonly [field: string]: Value | undefined; }
|
|
158
474
|
export type NamedEventCallback = (args: EventArgs) => void;
|
|
159
475
|
export type PositionalEventCallback = (value: Value, ...values: readonly Value[]) => void;
|
|
160
|
-
export type HookPhase = "before" | "after" | "replace";
|
|
161
476
|
/** Typed handle to one hookable function of a class; `Class.hooks.<Name>` is the only way to obtain one. */
|
|
162
477
|
export interface Hook<TTarget extends UObject = UObject, TArgs extends readonly Value[] = readonly Value[], TReturn = void> {
|
|
163
478
|
readonly [hookBrand]: never;
|
|
@@ -195,7 +510,7 @@ declare module "@sf-kmods/kdataforgejs" {
|
|
|
195
510
|
export interface Conditions {
|
|
196
511
|
all(conditions: readonly boolean[]): boolean;
|
|
197
512
|
any(conditions: readonly boolean[]): boolean;
|
|
198
|
-
evaluate(conditions: ConditionMap | readonly ConditionMap[], behavior?:
|
|
513
|
+
evaluate(conditions: ConditionMap | readonly ConditionMap[], behavior?: ConditionBehavior): boolean;
|
|
199
514
|
evaluate(conditions: ConditionMap | readonly ConditionMap[], any: boolean): ConditionResult;
|
|
200
515
|
evaluateResult(conditions: ConditionMap | readonly ConditionMap[], any?: boolean): ConditionResult;
|
|
201
516
|
}
|
|
@@ -214,16 +529,16 @@ declare module "@sf-kmods/kdataforgejs" {
|
|
|
214
529
|
}
|
|
215
530
|
export interface ActorFilter {
|
|
216
531
|
readonly nameContains?: string; readonly pathPrefix?: string;
|
|
217
|
-
readonly tags?: string | readonly string[]; readonly tagMatch?:
|
|
532
|
+
readonly tags?: string | readonly string[]; readonly tagMatch?: TagMatch;
|
|
218
533
|
readonly exactClass?: boolean; readonly caseSensitive?: boolean;
|
|
219
534
|
}
|
|
220
535
|
export interface ActorQuery extends ActorFilter { readonly limit?: number; readonly after?: string; }
|
|
221
536
|
export interface WorldActorQuery extends ActorFilter { readonly limit?: number; }
|
|
222
537
|
export interface ActorPage<T extends UObject> { readonly actors: readonly T[]; readonly nextCursor: string | null; }
|
|
223
|
-
export type ActorChange<T extends UObject> = Readonly<{ kind:
|
|
538
|
+
export type ActorChange<T extends UObject> = Readonly<{ kind: ActorChangeKind.Added; actor: T; path: string }> | Readonly<{ kind: ActorChangeKind.Removed; actor: null; path: string }>;
|
|
224
539
|
export interface ActorObservationOptions { readonly includeExisting?: boolean; }
|
|
225
540
|
export interface ConditionResult {
|
|
226
|
-
readonly outcome:
|
|
541
|
+
readonly outcome: ConditionOutcome;
|
|
227
542
|
readonly readConfigKeys: readonly string[];
|
|
228
543
|
}
|
|
229
544
|
export interface ConfigSnapshot {
|
|
@@ -252,11 +567,10 @@ declare module "@sf-kmods/kdataforgejs" {
|
|
|
252
567
|
/** Requires an imported PlayerState-derived class and runtime server authority. */
|
|
253
568
|
players(query?: number | WorldActorQuery): WorldQueryResult<UObject>;
|
|
254
569
|
}
|
|
255
|
-
export type EventScalarType = "boolean" | "int64" | "uint64" | "number" | "string";
|
|
256
570
|
export type EventSchema = Readonly<Record<string, EventScalarType>>;
|
|
257
571
|
export type EventPayload<S extends EventSchema> = {
|
|
258
|
-
readonly [K in keyof S]: S[K] extends
|
|
259
|
-
S[K] extends
|
|
572
|
+
readonly [K in keyof S]: S[K] extends EventScalarType.Boolean ? boolean :
|
|
573
|
+
S[K] extends EventScalarType.Int64 | EventScalarType.UInt64 ? bigint : S[K] extends EventScalarType.Number ? number : string;
|
|
260
574
|
};
|
|
261
575
|
const customEventBrand: unique symbol;
|
|
262
576
|
export interface CustomEvent<S extends EventSchema> { readonly [customEventBrand]: S; }
|
|
@@ -323,7 +637,7 @@ declare module "@sf-kmods/kdataforgejs" {
|
|
|
323
637
|
min(values: readonly number[]): number | undefined; max(values: readonly number[]): number | undefined;
|
|
324
638
|
product(values: readonly number[]): number; percentage(value: number, total: number): number;
|
|
325
639
|
percentOf(percent: number, total: number): number; nearlyEqual(left: number, right: number, epsilon?: number): boolean;
|
|
326
|
-
signNonZero(value: number):
|
|
640
|
+
signNonZero(value: number): NumericSign; inRange(value: number, minimum: number, maximum: number, inclusive?: boolean): boolean;
|
|
327
641
|
}
|
|
328
642
|
export interface ObjectHelpers {
|
|
329
643
|
pick<T extends object, K extends keyof T>(value: T, keys: readonly K[]): Pick<T, K>;
|
|
@@ -378,7 +692,7 @@ declare module "@sf-kmods/kdataforgejs" {
|
|
|
378
692
|
times<T>(count: number, callback: (index: number) => T): T[];
|
|
379
693
|
tryOr<T>(callback: () => T, fallback: T | ((error: unknown) => T)): T;
|
|
380
694
|
}
|
|
381
|
-
export type Settled<T> = Readonly<{ status:
|
|
695
|
+
export type Settled<T> = Readonly<{ status: AsyncResultStatus.Fulfilled; value: T }> | Readonly<{ status: AsyncResultStatus.Rejected; reason: unknown }>;
|
|
382
696
|
export interface PromiseHelpers {
|
|
383
697
|
mapSeries<T, R>(values: readonly T[], transform: (value: T, index: number) => R | PromiseLike<R>): Promise<R[]>;
|
|
384
698
|
filterSeries<T>(values: readonly T[], predicate: (value: T, index: number) => unknown | PromiseLike<unknown>): Promise<T[]>;
|
|
@@ -390,13 +704,12 @@ declare module "@sf-kmods/kdataforgejs" {
|
|
|
390
704
|
readonly prerelease: readonly (string | number)[]; readonly build: readonly string[];
|
|
391
705
|
}
|
|
392
706
|
export type SemVerInput = string | SemVer;
|
|
393
|
-
export type SemVerRelease = "major" | "minor" | "patch" | "prerelease";
|
|
394
707
|
/** Semantic Versioning 2.0 with npm-style ranges: `^`, `~`, `>=`, `1.x`, `1.2 - 1.4`, `||`, space for AND. */
|
|
395
708
|
export interface SemVerHelpers {
|
|
396
709
|
parse(value: string): SemVer | null;
|
|
397
710
|
create(major: number, minor?: number, patch?: number, prerelease?: readonly (string | number)[], build?: readonly string[]): SemVer;
|
|
398
711
|
format(version: SemVerInput): string; isValid(value: unknown): boolean; coerce(value: unknown): SemVer | null;
|
|
399
|
-
compare(left: SemVerInput, right: SemVerInput):
|
|
712
|
+
compare(left: SemVerInput, right: SemVerInput): Ordering;
|
|
400
713
|
eq(left: SemVerInput, right: SemVerInput): boolean; neq(left: SemVerInput, right: SemVerInput): boolean;
|
|
401
714
|
gt(left: SemVerInput, right: SemVerInput): boolean; gte(left: SemVerInput, right: SemVerInput): boolean;
|
|
402
715
|
lt(left: SemVerInput, right: SemVerInput): boolean; lte(left: SemVerInput, right: SemVerInput): boolean;
|
|
@@ -427,8 +740,8 @@ declare module "@sf-kmods/kdataforgejs" {
|
|
|
427
740
|
export interface ItemDefinition<C extends Class<UObject> = Class<UObject>> {
|
|
428
741
|
/** Pass the exported parent class (for example `FGConsumableDescriptor`) to type `properties` from its members. */
|
|
429
742
|
readonly id: string; readonly parent: ItemReference | C; readonly displayName: LocalizedText;
|
|
430
|
-
readonly form:
|
|
431
|
-
readonly stackSize:
|
|
743
|
+
readonly form: ResourceForm;
|
|
744
|
+
readonly stackSize: StackSize;
|
|
432
745
|
readonly description?: LocalizedText; readonly energyValueMJ?: number; readonly radioactiveDecay?: number;
|
|
433
746
|
readonly canBeDiscarded?: boolean; readonly categories?: readonly string[];
|
|
434
747
|
/** Typed writes on the generated class, limited to what the parent's exported descriptor exposes. */
|
|
@@ -447,12 +760,12 @@ declare module "@sf-kmods/kdataforgejs" {
|
|
|
447
760
|
/** Property writes on the generated recipe class that the fixed fields do not cover. */
|
|
448
761
|
readonly extra?: ExtraWrites;
|
|
449
762
|
}
|
|
450
|
-
export interface ContentRef<K extends
|
|
763
|
+
export interface ContentRef<K extends ContentKind> { readonly kind: K; readonly id: string; }
|
|
451
764
|
/** Generic bounded document shape used by catalog tooling. Authors should prefer HandlerDocument<K>. */
|
|
452
|
-
export interface KDFDocument extends StructuredInputObject { readonly type:
|
|
765
|
+
export interface KDFDocument extends StructuredInputObject { readonly type: HandlerKey; }
|
|
453
766
|
/** One bounded handler-owned map entry. Handler validation still enforces its detailed native schema. */
|
|
454
767
|
export type KDFDocumentEntry = Readonly<Record<string, StructuredInputValue>>;
|
|
455
|
-
export interface KDFPropertyOperation extends KDFDocumentEntry { readonly path: string; readonly op?:
|
|
768
|
+
export interface KDFPropertyOperation extends KDFDocumentEntry { readonly path: string; readonly op?: PropertyOperation; readonly value?: StructuredInputValue; }
|
|
456
769
|
/** Shared create/update schema used by the native content-class handlers. Property paths stay handler-validated. */
|
|
457
770
|
export interface GeneratedContentEntry extends KDFDocumentEntry {
|
|
458
771
|
readonly id: string; readonly parent?: string; readonly properties?: readonly KDFPropertyOperation[];
|
|
@@ -465,53 +778,49 @@ declare module "@sf-kmods/kdataforgejs" {
|
|
|
465
778
|
/** Native removal filters are validated by the selected handler and use the same transactional document seam. */
|
|
466
779
|
export type ContentRemoval = string | KDFDocumentEntry;
|
|
467
780
|
export interface KDFCdoPatch extends KDFDocumentEntry { readonly target?: string; readonly properties: readonly KDFPropertyOperation[]; }
|
|
468
|
-
export interface CdoDocument extends KDFDocument { readonly type:
|
|
469
|
-
export interface AssetDocument extends KDFDocument { readonly type:
|
|
470
|
-
export interface DataAssetDocument extends KDFDocument { readonly type:
|
|
471
|
-
export interface ItemDocument extends KDFDocument { readonly type:
|
|
472
|
-
export interface ResourceDocument extends KDFDocument { readonly type:
|
|
473
|
-
export interface BuildingDocument extends KDFDocument { readonly type:
|
|
474
|
-
export interface UnlockDocument extends KDFDocument { readonly type:
|
|
475
|
-
export interface RecipeDocument extends KDFDocument { readonly type:
|
|
476
|
-
export interface SchematicDocument extends KDFDocument { readonly type:
|
|
477
|
-
export interface ResearchDocument extends KDFDocument { readonly type:
|
|
478
|
-
export interface CurveDocument extends KDFDocument { readonly type:
|
|
479
|
-
export interface LocalizationDocument extends KDFDocument { readonly type:
|
|
480
|
-
export interface GameTagDocument extends KDFDocument { readonly type:
|
|
481
|
-
export interface SinkPointsDocument extends KDFDocument { readonly type:
|
|
482
|
-
export interface ResourceNodeDocument extends KDFDocument { readonly type:
|
|
483
|
-
export interface SoundDocument extends KDFDocument { readonly type:
|
|
484
|
-
export interface SublevelDocument extends KDFDocument { readonly type:
|
|
485
|
-
export interface EventRuleDocument extends KDFDocument { readonly type:
|
|
486
|
-
export interface CategoryReorderDocument extends KDFDocument { readonly type:
|
|
781
|
+
export interface CdoDocument extends KDFDocument { readonly type: DocumentType.Cdo; readonly patches: readonly KDFCdoPatch[]; }
|
|
782
|
+
export interface AssetDocument extends KDFDocument { readonly type: DocumentType.Asset; readonly assets: readonly KDFDocumentEntry[]; }
|
|
783
|
+
export interface DataAssetDocument extends KDFDocument { readonly type: DocumentType.DataAsset; readonly assets: readonly KDFDocumentEntry[]; }
|
|
784
|
+
export interface ItemDocument extends KDFDocument { readonly type: DocumentType.Item; readonly items: readonly GeneratedContentEntry[]; }
|
|
785
|
+
export interface ResourceDocument extends KDFDocument { readonly type: DocumentType.Resource; readonly resources: readonly GeneratedContentEntry[]; }
|
|
786
|
+
export interface BuildingDocument extends KDFDocument { readonly type: DocumentType.Building; readonly buildings: readonly GeneratedContentEntry[]; }
|
|
787
|
+
export interface UnlockDocument extends KDFDocument { readonly type: DocumentType.Unlock; readonly unlocks: readonly GeneratedContentEntry[]; }
|
|
788
|
+
export interface RecipeDocument extends KDFDocument { readonly type: DocumentType.Recipe; readonly recipes?: readonly ContentClassEntry[]; readonly remove?: readonly ContentRemoval[]; }
|
|
789
|
+
export interface SchematicDocument extends KDFDocument { readonly type: DocumentType.Schematic; readonly schematics?: readonly ContentClassEntry[]; readonly remove?: readonly ContentRemoval[]; }
|
|
790
|
+
export interface ResearchDocument extends KDFDocument { readonly type: DocumentType.Research; readonly research?: readonly ContentClassEntry[]; readonly remove?: readonly ContentRemoval[]; }
|
|
791
|
+
export interface CurveDocument extends KDFDocument { readonly type: DocumentType.Curve; readonly curveType: CurveType; readonly curves: readonly KDFDocumentEntry[]; }
|
|
792
|
+
export interface LocalizationDocument extends KDFDocument { readonly type: DocumentType.Localization; readonly namespace: string; readonly culture?: string; readonly entries: Readonly<Record<string, StructuredInputValue>>; }
|
|
793
|
+
export interface GameTagDocument extends KDFDocument { readonly type: DocumentType.GameTag; readonly tags: readonly StructuredInputValue[]; }
|
|
794
|
+
export interface SinkPointsDocument extends KDFDocument { readonly type: DocumentType.SinkPoints; readonly entries: readonly KDFDocumentEntry[]; readonly track?: SinkTrack; }
|
|
795
|
+
export interface ResourceNodeDocument extends KDFDocument { readonly type: DocumentType.ResourceNode; }
|
|
796
|
+
export interface SoundDocument extends KDFDocument { readonly type: DocumentType.Sound; readonly sounds: readonly KDFDocumentEntry[]; }
|
|
797
|
+
export interface SublevelDocument extends KDFDocument { readonly type: DocumentType.Sublevel; readonly block: readonly StructuredInputValue[]; }
|
|
798
|
+
export interface EventRuleDocument extends KDFDocument { readonly type: DocumentType.EventRule; readonly rules: readonly KDFDocumentEntry[]; }
|
|
799
|
+
export interface CategoryReorderDocument extends KDFDocument { readonly type: DocumentType.CategoryReorder; readonly subType: CategoryKind; readonly category: string; readonly order: readonly string[]; readonly subCategory?: string; readonly categoryPriority?: number; readonly subCategoryPriority?: number; }
|
|
487
800
|
export interface ClassEntryDefinition extends StructuredInputObject {
|
|
488
801
|
readonly id: string; readonly parent: string; readonly properties?: readonly StructuredInputValue[];
|
|
489
|
-
readonly registerAs?:
|
|
802
|
+
readonly registerAs?: DocumentType.Recipe | DocumentType.Schematic | DocumentType.Research;
|
|
490
803
|
}
|
|
491
804
|
/** DynamicContent class document. Script methods are supplied separately through defineBehavior. */
|
|
492
|
-
export interface ClassDefinition extends KDFDocument { readonly type:
|
|
805
|
+
export interface ClassDefinition extends KDFDocument { readonly type: DocumentType.Class; readonly classes: readonly [ClassEntryDefinition]; }
|
|
493
806
|
export interface DynamicClassHandle { readonly id: string; }
|
|
494
807
|
export interface HandlerDocumentMap {
|
|
495
|
-
readonly
|
|
496
|
-
readonly
|
|
497
|
-
readonly
|
|
498
|
-
readonly
|
|
499
|
-
readonly
|
|
500
|
-
readonly
|
|
501
|
-
readonly
|
|
502
|
-
readonly
|
|
808
|
+
readonly [DocumentType.Asset]: AssetDocument; readonly [DocumentType.CategoryReorder]: CategoryReorderDocument;
|
|
809
|
+
readonly [DocumentType.Cdo]: CdoDocument; readonly [DocumentType.Class]: ClassDefinition; readonly [DocumentType.Curve]: CurveDocument;
|
|
810
|
+
readonly [DocumentType.DataAsset]: DataAssetDocument; readonly [DocumentType.EventRule]: EventRuleDocument; readonly [DocumentType.GameTag]: GameTagDocument;
|
|
811
|
+
readonly [DocumentType.Localization]: LocalizationDocument; readonly [DocumentType.Item]: ItemDocument; readonly [DocumentType.Resource]: ResourceDocument;
|
|
812
|
+
readonly [DocumentType.Building]: BuildingDocument; readonly [DocumentType.Unlock]: UnlockDocument; readonly [DocumentType.Recipe]: RecipeDocument;
|
|
813
|
+
readonly [DocumentType.Schematic]: SchematicDocument; readonly [DocumentType.Research]: ResearchDocument;
|
|
814
|
+
readonly [DocumentType.ResourceNode]: ResourceNodeDocument; readonly [DocumentType.SinkPoints]: SinkPointsDocument;
|
|
815
|
+
readonly [DocumentType.Sound]: SoundDocument; readonly [DocumentType.Sublevel]: SublevelDocument;
|
|
503
816
|
}
|
|
504
817
|
export type HandlerKey = keyof HandlerDocumentMap & string;
|
|
505
818
|
export type HandlerDocument<K extends HandlerKey> = HandlerDocumentMap[K];
|
|
506
819
|
|
|
507
820
|
/** Frozen context supplied to default main. Every member below is installed by KDFJSRuntime. */
|
|
508
821
|
export type Promisify<F> = F extends (...args: infer A) => infer R ? (...args: A) => Promise<Awaited<R>> : never;
|
|
509
|
-
export
|
|
510
|
-
|
|
511
|
-
"defineClass" | "import" | "listMods" | "getModMeta" |
|
|
512
|
-
"isModLoaded" | "listPacks" | "getPackMeta" | "isPackLoaded" | "gameVersion" |
|
|
513
|
-
"spawnActorById" | "destroyActor" | "modifyActorById" | "createBehavior" |
|
|
514
|
-
"destroyBehavior" | "unregisterBehavior" | "unregisterBehaviorClass";
|
|
822
|
+
export interface PromiseMethodMap { readonly catalog: true; readonly runtimeStats: true; readonly lookupItem: true; readonly lookupRecipe: true; readonly resolve: true; readonly removeItem: true; readonly removeRecipe: true; readonly defineClass: true; readonly import: true; readonly listMods: true; readonly getModMeta: true; readonly isModLoaded: true; readonly listPacks: true; readonly getPackMeta: true; readonly isPackLoaded: true; readonly gameVersion: true; readonly spawnActorById: true; readonly destroyActor: true; readonly modifyActorById: true; readonly createBehavior: true; readonly destroyBehavior: true; readonly unregisterBehavior: true; readonly unregisterBehaviorClass: true; }
|
|
823
|
+
export type PromiseRootMethod = keyof PromiseMethodMap;
|
|
515
824
|
/** Settled wrappers around immediate host calls. Calls still execute synchronously; rejection captures thrown KDF errors. */
|
|
516
825
|
export type PromiseContext = Readonly<{ [K in PromiseRootMethod]: Promisify<Context[K]> }> & {
|
|
517
826
|
readonly getClass: {
|
|
@@ -537,10 +846,10 @@ declare module "@sf-kmods/kdataforgejs" {
|
|
|
537
846
|
readonly batch: <T extends readonly InputValue[]>(writes: {
|
|
538
847
|
readonly [K in keyof T]: { readonly property: WritableValueRef<T[K]>; readonly value: NoInfer<T[K]> };
|
|
539
848
|
}) => Promise<void>;
|
|
540
|
-
readonly createItem: <C extends Class<UObject> = Class<UObject>>(definition: ItemDefinition<C>) => Promise<ContentRef<
|
|
541
|
-
readonly updateItem: <C extends Class<UObject> = Class<UObject>>(definition: ItemDefinition<C>) => Promise<ContentRef<
|
|
542
|
-
readonly createRecipe: <C extends Class<UObject> = Class<UObject>>(definition: RecipeDefinition<C>) => Promise<ContentRef<
|
|
543
|
-
readonly updateRecipe: <C extends Class<UObject> = Class<UObject>>(definition: RecipeDefinition<C>) => Promise<ContentRef<
|
|
849
|
+
readonly createItem: <C extends Class<UObject> = Class<UObject>>(definition: ItemDefinition<C>) => Promise<ContentRef<ContentKind.Item>>;
|
|
850
|
+
readonly updateItem: <C extends Class<UObject> = Class<UObject>>(definition: ItemDefinition<C>) => Promise<ContentRef<ContentKind.Item>>;
|
|
851
|
+
readonly createRecipe: <C extends Class<UObject> = Class<UObject>>(definition: RecipeDefinition<C>) => Promise<ContentRef<ContentKind.Recipe>>;
|
|
852
|
+
readonly updateRecipe: <C extends Class<UObject> = Class<UObject>>(definition: RecipeDefinition<C>) => Promise<ContentRef<ContentKind.Recipe>>;
|
|
544
853
|
readonly applyDocument: <K extends HandlerKey>(handlerId: K, document: HandlerDocumentMap[NoInfer<K>]) => Promise<void>;
|
|
545
854
|
readonly spawnActor: <K extends ActorClassKey>(
|
|
546
855
|
classDescriptorId: K, initialWrites?: ActorInitialWrites<K>
|
|
@@ -559,12 +868,12 @@ declare module "@sf-kmods/kdataforgejs" {
|
|
|
559
868
|
players(query?: number | WorldActorQuery): Promise<WorldQueryResult<UObject>>;
|
|
560
869
|
}>;
|
|
561
870
|
readonly conditions: Readonly<{
|
|
562
|
-
evaluate(conditions: ConditionMap | readonly ConditionMap[], behavior?:
|
|
871
|
+
evaluate(conditions: ConditionMap | readonly ConditionMap[], behavior?: ConditionBehavior): Promise<boolean>;
|
|
563
872
|
evaluate(conditions: ConditionMap | readonly ConditionMap[], any: boolean): Promise<ConditionResult>;
|
|
564
873
|
evaluateResult(conditions: ConditionMap | readonly ConditionMap[], any?: boolean): Promise<ConditionResult>;
|
|
565
874
|
}>;
|
|
566
875
|
readonly diagnostics: Readonly<{
|
|
567
|
-
add(severity:
|
|
876
|
+
add(severity: DiagnosticSeverity, message: string, authoredPath?: string): Promise<void>;
|
|
568
877
|
}>;
|
|
569
878
|
};
|
|
570
879
|
|
|
@@ -573,7 +882,7 @@ declare module "@sf-kmods/kdataforgejs" {
|
|
|
573
882
|
/** Bounded, side-effect-free summary: no getters, proxies, toJSON or object coercion. */
|
|
574
883
|
readonly inspect: (value: unknown) => string;
|
|
575
884
|
readonly runtimeStats: () => RuntimeStats;
|
|
576
|
-
readonly diagnostics: { add(severity:
|
|
885
|
+
readonly diagnostics: { add(severity: DiagnosticSeverity, message: string, authoredPath?: string): void; };
|
|
577
886
|
readonly world: WorldAccess;
|
|
578
887
|
readonly promises: PromiseContext;
|
|
579
888
|
/** Local game time, affected by pause/dilation; never a cross-peer deterministic clock. */
|
|
@@ -588,7 +897,7 @@ declare module "@sf-kmods/kdataforgejs" {
|
|
|
588
897
|
}) => void;
|
|
589
898
|
readonly lookupItem: (id: string, pack?: string) => Class<UObject> | null;
|
|
590
899
|
readonly lookupRecipe: (id: string, pack?: string) => Class<UObject> | null;
|
|
591
|
-
readonly resolve: (reference: ContentRef<
|
|
900
|
+
readonly resolve: (reference: ContentRef<ContentKind>, pack?: string) => Class<UObject> | null;
|
|
592
901
|
/** Lowercase MD5 digest of UTF-8 text. */
|
|
593
902
|
readonly md5: (text: string) => string;
|
|
594
903
|
/** Lowercase SHA-1 digest of UTF-8 text. */
|
|
@@ -624,15 +933,15 @@ declare module "@sf-kmods/kdataforgejs" {
|
|
|
624
933
|
readonly config: PackConfig;
|
|
625
934
|
readonly findActors: <C extends Class<UObject>>(type: C, query?: ActorQuery) => ActorPage<ClassValue<C>>;
|
|
626
935
|
readonly observeActors: <C extends Class<UObject>>(type: C, callback: (change: ActorChange<ClassValue<C>>) => void, options?: ActorObservationOptions) => Subscription;
|
|
627
|
-
readonly createItem: <C extends Class<UObject> = Class<UObject>>(definition: ItemDefinition<C>) => ContentRef<
|
|
628
|
-
readonly updateItem: <C extends Class<UObject> = Class<UObject>>(definition: ItemDefinition<C>) => ContentRef<
|
|
629
|
-
readonly removeItem: (id: string) => ContentRef<
|
|
630
|
-
readonly createRecipe: <C extends Class<UObject> = Class<UObject>>(definition: RecipeDefinition<C>) => ContentRef<
|
|
631
|
-
readonly updateRecipe: <C extends Class<UObject> = Class<UObject>>(definition: RecipeDefinition<C>) => ContentRef<
|
|
632
|
-
readonly removeRecipe: (id: string) => ContentRef<
|
|
936
|
+
readonly createItem: <C extends Class<UObject> = Class<UObject>>(definition: ItemDefinition<C>) => ContentRef<ContentKind.Item>;
|
|
937
|
+
readonly updateItem: <C extends Class<UObject> = Class<UObject>>(definition: ItemDefinition<C>) => ContentRef<ContentKind.Item>;
|
|
938
|
+
readonly removeItem: (id: string) => ContentRef<ContentKind.Item>;
|
|
939
|
+
readonly createRecipe: <C extends Class<UObject> = Class<UObject>>(definition: RecipeDefinition<C>) => ContentRef<ContentKind.Recipe>;
|
|
940
|
+
readonly updateRecipe: <C extends Class<UObject> = Class<UObject>>(definition: RecipeDefinition<C>) => ContentRef<ContentKind.Recipe>;
|
|
941
|
+
readonly removeRecipe: (id: string) => ContentRef<ContentKind.Recipe>;
|
|
633
942
|
readonly applyDocument: <K extends HandlerKey>(handlerId: K, document: HandlerDocumentMap[NoInfer<K>]) => void;
|
|
634
943
|
readonly defineClass: (definition: ClassDefinition) => DynamicClassHandle;
|
|
635
|
-
readonly import: (kind:
|
|
944
|
+
readonly import: (kind: ImportKind, path: string) => StructuredValue;
|
|
636
945
|
readonly compare: (left: InputValue, operator: CompareOperator, right: InputValue) => boolean;
|
|
637
946
|
readonly isAuthority: () => boolean;
|
|
638
947
|
/** True when SML loaded the mod. With `range` (same syntax as the `modVersion` condition, e.g. `^3.12.0`) its version must match too. */
|
|
@@ -658,8 +967,8 @@ declare module "@sf-kmods/kdataforgejs" {
|
|
|
658
967
|
readonly unregisterEvent: (key: string) => void;
|
|
659
968
|
readonly hook: {
|
|
660
969
|
<T extends UObject, A extends readonly Value[], R>(target: Class<T>, hook: Hook<T, A, R>, callback: (call: HookCall<T, A, R>) => void, options?: HookOptions<A>): Subscription;
|
|
661
|
-
<T extends UObject, A extends readonly Value[], R>(target: Class<T>, hook: Hook<T, A, R>, phase:
|
|
662
|
-
<T extends UObject, A extends readonly Value[], R>(target: Class<T>, hook: Hook<T, A, R>, phase:
|
|
970
|
+
<T extends UObject, A extends readonly Value[], R>(target: Class<T>, hook: Hook<T, A, R>, phase: HookPhase.Before | HookPhase.After, callback: (call: HookCall<T, A, R>) => void, options?: HookOptions<A>): Subscription;
|
|
971
|
+
<T extends UObject, A extends readonly Value[], R>(target: Class<T>, hook: Hook<T, A, R>, phase: HookPhase.Replace, callback: (call: HookCall<T, A, R>) => R | void): Subscription;
|
|
663
972
|
};
|
|
664
973
|
readonly unhook: (subscription: Subscription) => void;
|
|
665
974
|
readonly onTyped: {
|
|
@@ -700,7 +1009,7 @@ declare module "@sf-kmods/kdataforgejs" {
|
|
|
700
1009
|
|
|
701
1010
|
/** ABI 13 / declaration format 10 authoring extensions. Native limits and phase checks apply at every use. */
|
|
702
1011
|
declare module "@sf-kmods/kdataforgejs" {
|
|
703
|
-
export type Delivery = { readonly mode:
|
|
1012
|
+
export type Delivery = { readonly mode: DeliveryMode.Immediate } | { readonly mode: DeliveryMode.Debounce | DeliveryMode.Throttle; readonly seconds: number };
|
|
704
1013
|
export interface EventOptions<P = Readonly<Record<string, Value>>> {
|
|
705
1014
|
readonly priority?: number;
|
|
706
1015
|
readonly once?: boolean;
|
|
@@ -738,19 +1047,19 @@ declare module "@sf-kmods/kdataforgejs" {
|
|
|
738
1047
|
export type ValueProperties<T> = T extends ValuePropertyTag<infer P> ? P : { readonly [K in keyof T as T[K] extends ReadonlyValueRef<unknown> ? K : never]: T[K] };
|
|
739
1048
|
/** Explicit initialization-only scalar CDO sets. No selectors, insertion, generation or registration. */
|
|
740
1049
|
export interface ReversibleCdoDocument {
|
|
741
|
-
readonly type:
|
|
742
|
-
readonly patches: readonly { readonly target: string; readonly properties: readonly { readonly path: string; readonly op?:
|
|
1050
|
+
readonly type: DocumentType.Cdo;
|
|
1051
|
+
readonly patches: readonly { readonly target: string; readonly properties: readonly { readonly path: string; readonly op?: PropertyOperation.Set; readonly value: Exclude<InputValue, null | undefined> }[] }[];
|
|
743
1052
|
}
|
|
744
1053
|
export interface LifecyclePayloads {
|
|
745
|
-
readonly
|
|
746
|
-
readonly
|
|
747
|
-
readonly
|
|
1054
|
+
readonly [LifecycleEvent.WorldReady]: { readonly worldGeneration: bigint };
|
|
1055
|
+
readonly [LifecycleEvent.Travel]: { readonly worldGeneration: bigint };
|
|
1056
|
+
readonly [LifecycleEvent.Shutdown]: { readonly worldGeneration: bigint; readonly reason: "shutdown" };
|
|
748
1057
|
}
|
|
749
1058
|
export interface TemporaryOverride extends Subscription { restore(): void; }
|
|
750
1059
|
export interface Context {
|
|
751
1060
|
readonly hookOnce: {
|
|
752
1061
|
<T extends UObject, A extends readonly Value[], R>(target: Class<T>, hook: Hook<T,A,R>, callback: (call: HookCall<T,A,R>) => void, options?: Omit<HookOptions<A>,"once">): Subscription;
|
|
753
|
-
<T extends UObject, A extends readonly Value[], R>(target: Class<T>, hook: Hook<T,A,R>, phase:
|
|
1062
|
+
<T extends UObject, A extends readonly Value[], R>(target: Class<T>, hook: Hook<T,A,R>, phase: HookPhase.Before | HookPhase.After, callback: (call: HookCall<T,A,R>) => void, options?: Omit<HookOptions<A>,"once">): Subscription;
|
|
754
1063
|
};
|
|
755
1064
|
readonly observeHook: <T extends UObject, A extends readonly Value[], R>(target: Class<T>, hook: Hook<T,A,R>, key: string, callback: (call: HookObservation<A,R>) => void, options?: HookOptions<A> & { readonly delivery?: Delivery }) => Subscription;
|
|
756
1065
|
readonly lifecycle: { on<K extends keyof LifecyclePayloads>(event: K, key: string, callback: (event: LifecyclePayloads[K]) => void): Subscription };
|