This repository has been archived on 2023-11-26. You can view files and clone it, but cannot push or open issues or pull requests.
ScriptCraft/scriptcraft/src/main/ts/types/scriptcraft-core/index.d.ts

32 lines
967 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;
interface String {
// eslint-disable-next-line @typescript-eslint/naming-convention
__quote(): string;
}
declare module 'scriptcraft-core' {
function addBridge(name: string, bridge: BridgeType): void;
function useBridge(name: string, ...args: readonly BridgeValueType[]): BridgeValueType;
}