@sf-kmods/kdataforgejs 2026.4.19 → 2026.4.20
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/declarations.json +1 -1
- package/index.d.ts +33 -1
- package/package.json +1 -1
package/declarations.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"package": "@sf-kmods/kdataforgejs",
|
|
4
4
|
"baseDeclaration": "@sf-kmods/kdataforgejs/index.d.ts",
|
|
5
5
|
"typeGenerator": {
|
|
6
|
-
"formatVersion":
|
|
6
|
+
"formatVersion": 9,
|
|
7
7
|
"outputPrefix": "typescript/kdataforgejs",
|
|
8
8
|
"generatedDeclaration": "typescript/kdataforgejs/kdataforge.generated.d.ts",
|
|
9
9
|
"artifacts": [
|
package/index.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ declare module "@sf-kmods/kdataforgejs" {
|
|
|
5
5
|
export interface CapabilityMap {
|
|
6
6
|
readonly "kdf.behavior.runtime": true;
|
|
7
7
|
readonly "kdf.classes.define": true;
|
|
8
|
+
readonly "kdf.conditions.evaluate": true;
|
|
9
|
+
readonly "kdf.config.read": true;
|
|
8
10
|
readonly "kdf.documents.apply": true;
|
|
9
11
|
readonly "kdf.imports.read": true;
|
|
10
12
|
readonly "kdf.items.define": true;
|
|
@@ -19,6 +21,7 @@ declare module "@sf-kmods/kdataforgejs" {
|
|
|
19
21
|
readonly "kdf.reflection.read": true;
|
|
20
22
|
readonly "kdf.reflection.write": true;
|
|
21
23
|
readonly "kdf.script.admin": true;
|
|
24
|
+
readonly "kdf.world.read": true;
|
|
22
25
|
}
|
|
23
26
|
export type Capability = keyof CapabilityMap & string;
|
|
24
27
|
export interface Meta { readonly capabilities: readonly Capability[]; }
|
|
@@ -169,7 +172,33 @@ declare module "@sf-kmods/kdataforgejs" {
|
|
|
169
172
|
readonly authors: string; readonly docsUrl: string; readonly supportUrl: string;
|
|
170
173
|
}
|
|
171
174
|
export interface PackMeta { readonly reference: string; readonly name: string; readonly version: string; readonly priority: number; }
|
|
172
|
-
export interface
|
|
175
|
+
export interface ConditionMap {
|
|
176
|
+
readonly gameVersion?: string;
|
|
177
|
+
readonly hasMod?: string | readonly string[];
|
|
178
|
+
readonly modVersion?: Readonly<Record<string, string>>;
|
|
179
|
+
readonly hasClass?: string | readonly string[];
|
|
180
|
+
readonly config?: string | readonly string[];
|
|
181
|
+
readonly ifNotMatch?: boolean;
|
|
182
|
+
}
|
|
183
|
+
export interface Conditions {
|
|
184
|
+
all(conditions: readonly boolean[]): boolean;
|
|
185
|
+
any(conditions: readonly boolean[]): boolean;
|
|
186
|
+
evaluate(conditions: ConditionMap | readonly ConditionMap[], behavior?: "AND" | "OR"): boolean;
|
|
187
|
+
}
|
|
188
|
+
export type ConfigScalar = boolean | number | bigint | string;
|
|
189
|
+
export type ConfigValue = ConfigScalar | readonly ConfigScalar[];
|
|
190
|
+
export interface ConfigValueMap { }
|
|
191
|
+
export interface ConfigChange<T = ConfigValue> { readonly id: string; readonly value: T; readonly previous: T; }
|
|
192
|
+
export interface PackConfig {
|
|
193
|
+
get<K extends keyof ConfigValueMap & string>(id: K): ConfigValueMap[K] | null;
|
|
194
|
+
get(id: string): ConfigValue | null;
|
|
195
|
+
onChange<K extends keyof ConfigValueMap & string>(id: K, callback: (change: ConfigChange<ConfigValueMap[K]>) => void): Subscription;
|
|
196
|
+
onChange(id: string, callback: (change: ConfigChange) => void): Subscription;
|
|
197
|
+
}
|
|
198
|
+
export interface ActorQuery { readonly limit?: number; readonly after?: string; }
|
|
199
|
+
export interface ActorPage<T extends UObject> { readonly actors: readonly T[]; readonly nextCursor: string | null; }
|
|
200
|
+
export type ActorChange<T extends UObject> = Readonly<{ kind: "added"; actor: T; path: string }> | Readonly<{ kind: "removed"; actor: null; path: string }>;
|
|
201
|
+
export interface ActorObservationOptions { readonly includeExisting?: boolean; }
|
|
173
202
|
export type Comparable = string | number | bigint;
|
|
174
203
|
export type Falsy = false | 0 | 0n | "" | null | undefined;
|
|
175
204
|
export type Truthy<T> = T extends Falsy ? never : T;
|
|
@@ -421,6 +450,9 @@ declare module "@sf-kmods/kdataforgejs" {
|
|
|
421
450
|
<C extends Class<UObject>>(type: C, value: UObject, options?: LookupOptions): ClassValue<C> | null;
|
|
422
451
|
};
|
|
423
452
|
readonly findClasses: <C extends Class<UObject>>(type: C, search?: ClassSearchParams) => readonly C[];
|
|
453
|
+
readonly config: PackConfig;
|
|
454
|
+
readonly findActors: <C extends Class<UObject>>(type: C, query?: ActorQuery) => ActorPage<ClassValue<C>>;
|
|
455
|
+
readonly observeActors: <C extends Class<UObject>>(type: C, callback: (change: ActorChange<ClassValue<C>>) => void, options?: ActorObservationOptions) => Subscription;
|
|
424
456
|
readonly createItem: <C extends Class<UObject> = Class<UObject>>(definition: ItemDefinition<C>) => ContentRef<"item">;
|
|
425
457
|
readonly updateItem: <C extends Class<UObject> = Class<UObject>>(definition: ItemDefinition<C>) => ContentRef<"item">;
|
|
426
458
|
readonly removeItem: (id: string) => ContentRef<"item">;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sf-kmods/kdataforgejs",
|
|
3
|
-
"version": "2026.4.
|
|
3
|
+
"version": "2026.4.20",
|
|
4
4
|
"description": "TypeScript types for KDataForgeJS packs: declarations of the built-in @sf-kmods/kdataforgejs module plus a strict tsconfig base.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Kyri123/Kyrium",
|