2019-09-07 04:23:15 +00:00
|
|
|
declare global {
|
2020-06-20 08:38:14 +00:00
|
|
|
const __FILE__: string
|
|
|
|
const __LINE__: number
|
|
|
|
const __DIR__: string
|
|
|
|
const Packages: any
|
2019-09-19 11:00:35 +00:00
|
|
|
|
2020-06-20 08:38:14 +00:00
|
|
|
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-19 11:00:35 +00:00
|
|
|
|
2019-09-07 04:23:15 +00:00
|
|
|
namespace Java {
|
2020-06-20 08:38:14 +00:00
|
|
|
function type<T = any>(clazz: string): T
|
2020-06-22 02:44:17 +00:00
|
|
|
function from<T = any>(javaObj: T[]): T[]
|
|
|
|
function to<T = any>(array: T[], type?: T): T[]
|
2020-06-20 08:38:14 +00:00
|
|
|
function extend(...parentTypes: any[]): any
|
|
|
|
function synchronized(func: () => void, lock: any): Function
|
|
|
|
function asJSONCompatible<T = any>(obj: T): T
|
2019-09-19 11:00:35 +00:00
|
|
|
//@ts-ignore
|
|
|
|
// function super(type: any);
|
|
|
|
}
|
|
|
|
|
|
|
|
interface Error {
|
2020-06-20 08:38:14 +00:00
|
|
|
readonly class?: any
|
|
|
|
readonly lineNumber?: number
|
|
|
|
readonly columnNumber?: number
|
|
|
|
readonly fileName?: string
|
|
|
|
dumpStack?: Function
|
|
|
|
printStackTrace?: Function
|
|
|
|
getStackTrace?: () => any[]
|
2019-09-19 11:00:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
interface String {
|
2020-06-20 08:38:14 +00:00
|
|
|
trimLeft(): string
|
|
|
|
trimRight(): string
|
2019-09-19 11:00:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
interface Object {
|
2020-06-20 08:38:14 +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-06-20 08:38:14 +00:00
|
|
|
scope: string
|
|
|
|
logger: any
|
|
|
|
debug: boolean
|
|
|
|
level: string
|
|
|
|
NashornEngineStartTime: number
|
|
|
|
setGlobal: (key: string, value: any, config?: PropertyDescriptor & ThisType<any>) => void
|
|
|
|
noop: () => void
|
|
|
|
console: Console
|
|
|
|
}
|
|
|
|
interface Process {
|
|
|
|
on(event: string, listener: any): this
|
|
|
|
emit(event: string, ...message: any): this
|
2020-03-01 12:28:16 +00:00
|
|
|
}
|
|
|
|
}
|
2020-06-20 08:38:14 +00:00
|
|
|
const root: string
|
|
|
|
const base: Core
|
|
|
|
const ScriptEngineContextHolder: any
|
|
|
|
function engineLoad(str: string | { script: string, name: string }): any
|
2020-03-01 12:28:16 +00:00
|
|
|
interface Core {
|
2020-06-20 08:38:14 +00:00
|
|
|
getClass(name: String): any
|
|
|
|
getProxyClass(): any
|
|
|
|
getInstance(): any
|
|
|
|
read(path: string): string
|
|
|
|
save(path: string, content: string): void
|
|
|
|
delete(path: string): void
|
2020-03-01 12:28:16 +00:00
|
|
|
}
|
|
|
|
interface Console {
|
2020-06-20 08:38:14 +00:00
|
|
|
ex(err: Error): void
|
|
|
|
stack(err: Error, color?: boolean): string[]
|
2020-07-23 05:44:39 +00:00
|
|
|
sender(sender: any, ...args: any): void
|
2020-06-20 08:38:14 +00:00
|
|
|
sender(...args: any): void
|
|
|
|
console(...args: any): void
|
|
|
|
i18n(name: string, ...params: any[]): void
|
2020-03-01 12:28:16 +00:00
|
|
|
}
|
2020-05-13 10:41:05 +00:00
|
|
|
interface ProxyConstructor {
|
2020-06-20 08:38:14 +00:00
|
|
|
newProxy<T extends object>(target: T, handler: ProxyHandler<T>): T
|
2020-05-13 10:41:05 +00:00
|
|
|
}
|
2019-09-07 04:23:15 +00:00
|
|
|
}
|
|
|
|
|
2020-06-20 08:38:14 +00:00
|
|
|
export { }
|