2019-09-07 04:23:15 +00:00
|
|
|
declare global {
|
2019-09-19 11:00:35 +00:00
|
|
|
const __FILE__: string;
|
|
|
|
const __LINE__: number;
|
|
|
|
const __DIR__: string;
|
|
|
|
let Packages: any;
|
|
|
|
|
|
|
|
function print(...message: any[]): void;
|
|
|
|
function load(script: string | object);
|
|
|
|
function loadWithNewGlobal(script: string | object);
|
|
|
|
function exit(code?: number);
|
|
|
|
function quit(code?: number);
|
|
|
|
function JavaImporter(...className: string[]);
|
|
|
|
|
2019-09-07 04:23:15 +00:00
|
|
|
namespace Java {
|
|
|
|
function type(clazz: string): any;
|
|
|
|
function from(javaObj: any): any[];
|
|
|
|
function to(array: any[]): any;
|
2019-09-19 11:00:35 +00:00
|
|
|
function extend(...parentTypes: any[]);
|
2020-05-30 02:43:33 +00:00
|
|
|
function synchronized(func: () => void, lock: any);
|
2019-09-19 11:00:35 +00:00
|
|
|
//@ts-ignore
|
|
|
|
// function super(type: any);
|
|
|
|
}
|
|
|
|
|
|
|
|
interface Error {
|
|
|
|
readonly lineNumber?: number;
|
|
|
|
readonly columnNumber?: number;
|
|
|
|
readonly fileName?: string;
|
|
|
|
dumpStack?: Function;
|
|
|
|
printStackTrace?: Function;
|
|
|
|
getStackTrace?: () => any[];
|
|
|
|
}
|
|
|
|
|
|
|
|
interface String {
|
2020-05-07 09:12:15 +00:00
|
|
|
trimLeft(): string;
|
|
|
|
trimRight(): string;
|
2019-09-19 11:00:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
interface Object {
|
2020-05-07 09:12:15 +00:00
|
|
|
setPrototypeOf(obj: object, prototype: object): void;
|
|
|
|
bindProperties(to: object, from: object): void;
|
2019-09-07 04:23:15 +00:00
|
|
|
}
|
2020-03-01 12:28:16 +00:00
|
|
|
|
|
|
|
namespace NodeJS {
|
|
|
|
interface Global {
|
2020-05-02 16:14:47 +00:00
|
|
|
scope: string;
|
2020-03-01 12:28:16 +00:00
|
|
|
logger: any;
|
|
|
|
debug: boolean;
|
|
|
|
level: string;
|
2020-05-13 10:41:05 +00:00
|
|
|
eventCenter: EventEmitter;
|
2020-03-01 12:28:16 +00:00
|
|
|
NashornEngineStartTime: number;
|
2020-05-11 09:20:50 +00:00
|
|
|
setGlobal: (key: string, value: any, config?: PropertyDescriptor & ThisType<any>) => void;
|
2020-03-01 12:28:16 +00:00
|
|
|
noop: () => void;
|
|
|
|
console: Console;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var root: string;
|
|
|
|
var base: Core;
|
|
|
|
var ScriptEngineContextHolder: any;
|
|
|
|
function engineLoad(str: string): any;
|
|
|
|
interface Core {
|
|
|
|
getClass(name: String): any;
|
|
|
|
getProxyClass(): any;
|
|
|
|
getInstance(): any;
|
|
|
|
read(path: string): string;
|
|
|
|
save(path: string, content: string): void;
|
|
|
|
delete(path: string): void;
|
|
|
|
}
|
|
|
|
interface Console {
|
|
|
|
ex(err: Error): void;
|
2020-06-02 10:02:49 +00:00
|
|
|
stack(err: Error, color?: boolean): string[];
|
2020-03-01 12:28:16 +00:00
|
|
|
sender(...args: any): void;
|
|
|
|
console(...args: any): void;
|
2020-05-07 09:12:15 +00:00
|
|
|
i18n(name: string, ...params: any[]): void;
|
2020-03-01 12:28:16 +00:00
|
|
|
}
|
2020-05-13 10:41:05 +00:00
|
|
|
interface ProxyConstructor {
|
|
|
|
newProxy<T extends object>(target: T, handler: ProxyHandler<T>): T;
|
|
|
|
}
|
2019-09-07 04:23:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export { };
|