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[]);
|
|
|
|
//@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;
|
|
|
|
NashornEngineStartTime: number;
|
|
|
|
setGlobal: (key: string, value: any) => void;
|
|
|
|
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;
|
|
|
|
stack(err: Error): string[];
|
|
|
|
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
|
|
|
}
|
2019-09-07 04:23:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export { };
|