UNPKG

1.35 kBTypeScriptView Raw
1/// <reference path="jdk/index.d.ts" />
2
3/**
4 * Reference:
5 * http://docs.oracle.com/javase/8/docs/technotes/guides/scripting/nashorn/api.html
6 * http://docs.oracle.com/javase/8/docs/technotes/guides/scripting/nashorn/shell.html
7 */
8
9type byte = number
10type char = object // typeof (new java.lang.String("char").toCharArray()[0])
11type double = number
12type float = number
13type int = number
14type long = number
15type short = number
16
17declare const $ARG: string[]
18declare const $ENV: any
19declare const Packages: any
20
21declare function String(arg: any): java.lang.String
22declare function echo(...args: any[]): void
23declare function exit(code?: number): void
24declare function load(script: string | object): void
25declare function loadWithNewGlobal(script: string | object): void
26declare function quit(code?: number): void
27declare function readFully(filepath: string): string
28declare function readLine(prompt?: string): string
29
30declare class Java {
31 static extend(type: any, impl?: object): any
32 static super(variable: object): any
33 static from(value: any): any
34 static to(jsValue: any, javaType: any): any
35 static type(className: string): any
36}
37
38declare namespace java {
39 namespace util {
40 namespace function$ {
41 interface Consumer$$TypeScript<T> {
42 (arg: T): any
43 }
44 }
45 }
46}
47
\No newline at end of file