27 lines
853 B
TypeScript
27 lines
853 B
TypeScript
|
interface JavaObject {
|
||
|
discriminator: 'JavaObject';
|
||
|
}
|
||
|
|
||
|
type BridgeValueType = void | string | number | boolean | JavaObject | BridgeValueType[];
|
||
|
type BridgeType = (...args: readonly BridgeValueType[]) => BridgeValueType;
|
||
|
|
||
|
interface Console {
|
||
|
log(...args: readonly string[]): void;
|
||
|
info(...args: readonly string[]): void;
|
||
|
warn(...args: readonly string[]): void;
|
||
|
error(...args: readonly string[]): void;
|
||
|
dir(...args: readonly string[]): void;
|
||
|
debug(...args: readonly string[]): void;
|
||
|
trace(...args: readonly string[]): void;
|
||
|
|
||
|
assert(condition: boolean, ...args: readonly string[]): void;
|
||
|
}
|
||
|
|
||
|
declare const console: Console;
|
||
|
|
||
|
declare module 'scriptcraft-core' {
|
||
|
function addBridge(name: string, bridge: BridgeType): void;
|
||
|
|
||
|
function useBridge(name: string, ...args: readonly BridgeValueType[]): BridgeValueType;
|
||
|
}
|