mirror of
https://github.com/SikongJueluo/kubejs-utils.git
synced 2026-01-29 08:17:49 +08:00
feat(types): add DataBus system with auto-generated type declarations
This commit is contained in:
93
types/DataBus.d.ts
vendored
Normal file
93
types/DataBus.d.ts
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
/**
|
||||
* Auto-generated DataBus type declarations
|
||||
* Generated by scripts/AutoExport.js
|
||||
* Do not edit manually
|
||||
*/
|
||||
|
||||
declare global {
|
||||
/**
|
||||
* All exported data types
|
||||
*/
|
||||
interface ExportTypes {
|
||||
/**
|
||||
* Source: startup_scripts\C4.js
|
||||
* Type: number
|
||||
*/
|
||||
"C4_EXPLOSION_POWER": number;
|
||||
/**
|
||||
* Source: startup_scripts\C4.js
|
||||
* Type: number
|
||||
*/
|
||||
"C4_EXPLOSION_TIME": number;
|
||||
/**
|
||||
* Source: startup_scripts\C4.js
|
||||
* Type: number
|
||||
*/
|
||||
"C4_USE_TIME": number;
|
||||
/**
|
||||
* Source: startup_scripts\DataBus.js
|
||||
* Type: any
|
||||
*/
|
||||
"dataBus": any;
|
||||
/**
|
||||
* Source: startup_scripts\EventBus.js
|
||||
* Type: any
|
||||
*/
|
||||
"eventBus": any;
|
||||
/**
|
||||
* Source: startup_scripts\C4.js
|
||||
* Type: { [key: string]:{ angle: {x: number, y:number, z:number}, pos: {x: number, y: number, z: number}, blockPos: {x: number, y: number, z: number} } | undefined}
|
||||
*/
|
||||
"lastPlayerInfoMap": { [key: string]:{ angle: {x: number, y:number, z:number}, pos: {x: number, y: number, z: number}, blockPos: {x: number, y: number, z: number} } | undefined};
|
||||
/**
|
||||
* Source: startup_scripts\C4.js
|
||||
* Type: (itemstack: Internal.ItemStack, level: Internal.Level, player: Internal.Player) => boolean
|
||||
*/
|
||||
"shouldActivateC4": (itemstack: Internal.ItemStack, level: Internal.Level, player: Internal.Player) => boolean;
|
||||
/**
|
||||
* Source: startup_scripts\C4.js
|
||||
* Type: (player: Internal.Player, level: Internal.Level) => boolean
|
||||
*/
|
||||
"shouldStartUseC4": (player: Internal.Player, level: Internal.Level) => boolean;
|
||||
/**
|
||||
* Source: startup_scripts\C4.js
|
||||
* Type: {[key:string]: boolean | null}
|
||||
*/
|
||||
"toExplosionC4Map": {[key:string]: boolean | null};
|
||||
}
|
||||
|
||||
/**
|
||||
* DataBus interface with type-safe import
|
||||
*/
|
||||
interface DataBus {
|
||||
/**
|
||||
* Export a value
|
||||
* @template T
|
||||
* @param {string} name - Export identifier
|
||||
* @param {T} value - Value to export
|
||||
*/
|
||||
export<T>(name: string, value: T): void;
|
||||
|
||||
/**
|
||||
* Import a previously exported value
|
||||
* @template T
|
||||
* @param {string} name - Export identifier
|
||||
* @returns {T} The exported value
|
||||
*/
|
||||
import<T extends keyof ExportTypes>(name: T): ExportTypes[T];
|
||||
|
||||
/**
|
||||
* Check if an export exists
|
||||
* @param {string} name - Export identifier
|
||||
*/
|
||||
hasExport(name: string): boolean;
|
||||
|
||||
/**
|
||||
* List all available export names
|
||||
* @returns {string[]}
|
||||
*/
|
||||
listExports(): string[];
|
||||
}
|
||||
}
|
||||
|
||||
export {};
|
||||
Reference in New Issue
Block a user