Provide dynamic operations currying for Algebra<T> instead of eager calls and add JS code generation support #162
@ -9,6 +9,12 @@ kotlin.sourceSets {
|
||||
}
|
||||
}
|
||||
|
||||
jsMain {
|
||||
dependencies {
|
||||
implementation(npm("astring", "1.4.3"))
|
||||
}
|
||||
}
|
||||
|
||||
jvmMain {
|
||||
dependencies {
|
||||
api("com.github.h0tk3y.betterParse:better-parse:0.4.0")
|
||||
|
0
kmath-ast/src/jsMain/kotlin/Codegen.kt
Normal file
0
kmath-ast/src/jsMain/kotlin/Codegen.kt
Normal file
50
kmath-ast/src/jsMain/kotlin/astring.d.ts
vendored
Normal file
50
kmath-ast/src/jsMain/kotlin/astring.d.ts
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
// Type definitions for astring 1.3
|
||||
// Project: https://github.com/davidbonnet/astring
|
||||
// Definitions by: Nikolaj Kappler <https://github.com/nkappler>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import * as ESTree from 'estree';
|
||||
import 'node';
|
||||
import { Stream } from 'stream';
|
||||
|
||||
export interface Options {
|
||||
/** string to use for indentation (defaults to " ") */
|
||||
indent?: string;
|
||||
/** string to use for line endings (defaults to "\n") */
|
||||
lineEnd?: string;
|
||||
/** indent level to start from (defaults to 0) */
|
||||
startingIndentLevel?: number;
|
||||
/** generate comments if true (defaults to false) */
|
||||
comments?: boolean;
|
||||
/** custom code generator (defaults to astring.baseGenerator) */
|
||||
generator?: object;
|
||||
/** source map generator (defaults to null), see https://github.com/mozilla/source-map#sourcemapgenerator */
|
||||
sourceMap?: any;
|
||||
}
|
||||
|
||||
/** Returns a string representing the rendered code of the provided AST `node`. However, if an `output` stream is provided in the options, it writes to that stream and returns it. */
|
||||
export function generate(node: ESTree.Node, options?: Options): string;
|
||||
/** Returns a string representing the rendered code of the provided AST `node`. However, if an `output` stream is provided in the options, it writes to that stream and returns it. */
|
||||
export function generate(node: ESTree.Node, options: Options & {
|
||||
/** output stream to write the rendered code to (defaults to null) */
|
||||
output: Stream;
|
||||
}): Stream;
|
||||
|
||||
/**
|
||||
* A code generator consists of a mapping of node names and functions that take two arguments: `node` and `state`.
|
||||
* The `node` points to the node from which to generate the code and the `state` exposes the `write` method that takes generated code strings.
|
||||
*/
|
||||
export type Generator = { [key in ESTree.Node["type"]]: (node: Extract<ESTree.Node, { type: key }>, state: { write(s: string): void }) => void };
|
||||
|
||||
/** Base generator that can be used to extend Astring. See https://github.com/davidbonnet/astring#extending */
|
||||
export const baseGenerator: Generator;
|
||||
|
||||
declare global {
|
||||
interface astring {
|
||||
generate: typeof generate;
|
||||
/** Base generator that can be used to extend Astring. See https://github.com/davidbonnet/astring#extending */
|
||||
baseGenerator: Generator;
|
||||
}
|
||||
const astring: astring;
|
||||
}
|
17
kmath-ast/src/jsMain/kotlin/astring.global.kt
Normal file
17
kmath-ast/src/jsMain/kotlin/astring.global.kt
Normal file
@ -0,0 +1,17 @@
|
||||
@file:JsQualifier("global")
|
||||
@file:Suppress(
|
||||
"INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS",
|
||||
"NO_EXPLICIT_VISIBILITY_IN_API_MODE_WARNING", "KDocMissingDocumentation", "PackageDirectoryMismatch", "ClassName"
|
||||
)
|
||||
|
||||
package global
|
||||
|
||||
import Generator
|
||||
|
||||
@Suppress("EXTERNAL_DELEGATION", "NESTED_CLASS_IN_EXTERNAL_INTERFACE")
|
||||
external interface astring {
|
||||
var generate: Any
|
||||
var baseGenerator: Generator
|
||||
|
||||
companion object : astring by definedExternally
|
||||
}
|
32
kmath-ast/src/jsMain/kotlin/astring.kt
Normal file
32
kmath-ast/src/jsMain/kotlin/astring.kt
Normal file
@ -0,0 +1,32 @@
|
||||
@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS",
|
||||
"NO_EXPLICIT_VISIBILITY_IN_API_MODE_WARNING", "KDocMissingDocumentation"
|
||||
)
|
||||
|
||||
external interface Options {
|
||||
var indent: String?
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
var lineEnd: String?
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
var startingIndentLevel: Number?
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
var comments: Boolean?
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
var generator: Any?
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
var sourceMap: Any?
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
}
|
||||
|
||||
external fun generate(node: BaseNode, options: Options /* Options & `T$0` */ = definedExternally): String
|
||||
|
||||
external fun generate(node: BaseNode): String
|
||||
|
||||
typealias Generator = Any
|
||||
|
||||
external var baseGenerator: Generator
|
19
kmath-ast/src/jsMain/kotlin/emitter.d.ts
vendored
Normal file
19
kmath-ast/src/jsMain/kotlin/emitter.d.ts
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
export class Emitter {
|
||||
constructor(obj: any)
|
||||
constructor()
|
||||
|
||||
on(event: string, fn: () => void)
|
||||
|
||||
off(event: string, fn: () => void)
|
||||
|
||||
once(event: string, fn: () => void)
|
||||
|
||||
emit(event: string, ...any: any[])
|
||||
|
||||
listeners(event: string): (() => void)[]
|
||||
|
||||
hasListeners(event: string): boolean
|
||||
}
|
||||
|
||||
|
||||
function mixin(obj: any): any
|
18
kmath-ast/src/jsMain/kotlin/emitter.kt
Normal file
18
kmath-ast/src/jsMain/kotlin/emitter.kt
Normal file
@ -0,0 +1,18 @@
|
||||
@file:Suppress(
|
||||
"INTERFACE_WITH_SUPERCLASS",
|
||||
"OVERRIDING_FINAL_MEMBER",
|
||||
"RETURN_TYPE_MISMATCH_ON_OVERRIDE",
|
||||
"CONFLICTING_OVERLOADS", "NO_EXPLICIT_VISIBILITY_IN_API_MODE_WARNING", "KDocMissingDocumentation", "SortModifiers"
|
||||
)
|
||||
|
||||
external open class Emitter {
|
||||
constructor(obj: Any)
|
||||
constructor()
|
||||
|
||||
open fun on(event: String, fn: () -> Unit)
|
||||
open fun off(event: String, fn: () -> Unit)
|
||||
open fun once(event: String, fn: () -> Unit)
|
||||
open fun emit(event: String, vararg any: Any)
|
||||
open fun listeners(event: String): Array<() -> Unit>
|
||||
open fun hasListeners(event: String): Boolean
|
||||
}
|
569
kmath-ast/src/jsMain/kotlin/estree.d.ts
vendored
Normal file
569
kmath-ast/src/jsMain/kotlin/estree.d.ts
vendored
Normal file
@ -0,0 +1,569 @@
|
||||
// Type definitions for ESTree AST specification
|
||||
// Project: https://github.com/estree/estree
|
||||
// Definitions by: RReverser <https://github.com/RReverser>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// This definition file follows a somewhat unusual format. ESTree allows
|
||||
// runtime type checks based on the `type` parameter. In order to explain this
|
||||
// to typescript we want to use discriminated union types:
|
||||
// https://github.com/Microsoft/TypeScript/pull/9163
|
||||
//
|
||||
// For ESTree this is a bit tricky because the high level interfaces like
|
||||
// Node or Function are pulling double duty. We want to pass common fields down
|
||||
// to the interfaces that extend them (like Identifier or
|
||||
// ArrowFunctionExpression), but you can't extend a type union or enforce
|
||||
// common fields on them. So we've split the high level interfaces into two
|
||||
// types, a base type which passes down inhereted fields, and a type union of
|
||||
// all types which extend the base type. Only the type union is exported, and
|
||||
// the union is how other types refer to the collection of inheriting types.
|
||||
//
|
||||
// This makes the definitions file here somewhat more difficult to maintain,
|
||||
// but it has the notable advantage of making ESTree much easier to use as
|
||||
// an end user.
|
||||
|
||||
interface BaseNodeWithoutComments {
|
||||
// Every leaf interface that extends BaseNode must specify a type property.
|
||||
// The type property should be a string literal. For example, Identifier
|
||||
// has: `type: "Identifier"`
|
||||
type: string;
|
||||
loc?: SourceLocation | null;
|
||||
range?: [number, number];
|
||||
}
|
||||
|
||||
interface BaseNode extends BaseNodeWithoutComments {
|
||||
leadingComments?: Array<Comment>;
|
||||
trailingComments?: Array<Comment>;
|
||||
}
|
||||
|
||||
export type Node =
|
||||
Identifier | Literal | Program | Function | SwitchCase | CatchClause |
|
||||
VariableDeclarator | Statement | Expression | Property |
|
||||
AssignmentProperty | Super | TemplateElement | SpreadElement | Pattern |
|
||||
ClassBody | Class | MethodDefinition | ModuleDeclaration | ModuleSpecifier;
|
||||
|
||||
export interface Comment extends BaseNodeWithoutComments {
|
||||
type: "Line" | "Block";
|
||||
value: string;
|
||||
}
|
||||
|
||||
interface SourceLocation {
|
||||
source?: string | null;
|
||||
start: Position;
|
||||
end: Position;
|
||||
}
|
||||
|
||||
export interface Position {
|
||||
/** >= 1 */
|
||||
line: number;
|
||||
/** >= 0 */
|
||||
column: number;
|
||||
}
|
||||
|
||||
export interface Program extends BaseNode {
|
||||
type: "Program";
|
||||
sourceType: "script" | "module";
|
||||
body: Array<Directive | Statement | ModuleDeclaration>;
|
||||
comments?: Array<Comment>;
|
||||
}
|
||||
|
||||
export interface Directive extends BaseNode {
|
||||
type: "ExpressionStatement";
|
||||
expression: Literal;
|
||||
directive: string;
|
||||
}
|
||||
|
||||
interface BaseFunction extends BaseNode {
|
||||
params: Array<Pattern>;
|
||||
generator?: boolean;
|
||||
async?: boolean;
|
||||
// The body is either BlockStatement or Expression because arrow functions
|
||||
// can have a body that's either. FunctionDeclarations and
|
||||
// FunctionExpressions have only BlockStatement bodies.
|
||||
body: BlockStatement | Expression;
|
||||
}
|
||||
|
||||
export type Function =
|
||||
FunctionDeclaration | FunctionExpression | ArrowFunctionExpression;
|
||||
|
||||
export type Statement =
|
||||
ExpressionStatement | BlockStatement | EmptyStatement |
|
||||
DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement |
|
||||
BreakStatement | ContinueStatement | IfStatement | SwitchStatement |
|
||||
ThrowStatement | TryStatement | WhileStatement | DoWhileStatement |
|
||||
ForStatement | ForInStatement | ForOfStatement | Declaration;
|
||||
|
||||
interface BaseStatement extends BaseNode { }
|
||||
|
||||
export interface EmptyStatement extends BaseStatement {
|
||||
type: "EmptyStatement";
|
||||
}
|
||||
|
||||
export interface BlockStatement extends BaseStatement {
|
||||
type: "BlockStatement";
|
||||
body: Array<Statement>;
|
||||
innerComments?: Array<Comment>;
|
||||
}
|
||||
|
||||
export interface ExpressionStatement extends BaseStatement {
|
||||
type: "ExpressionStatement";
|
||||
expression: Expression;
|
||||
}
|
||||
|
||||
export interface IfStatement extends BaseStatement {
|
||||
type: "IfStatement";
|
||||
test: Expression;
|
||||
consequent: Statement;
|
||||
alternate?: Statement | null;
|
||||
}
|
||||
|
||||
export interface LabeledStatement extends BaseStatement {
|
||||
type: "LabeledStatement";
|
||||
label: Identifier;
|
||||
body: Statement;
|
||||
}
|
||||
|
||||
export interface BreakStatement extends BaseStatement {
|
||||
type: "BreakStatement";
|
||||
label?: Identifier | null;
|
||||
}
|
||||
|
||||
export interface ContinueStatement extends BaseStatement {
|
||||
type: "ContinueStatement";
|
||||
label?: Identifier | null;
|
||||
}
|
||||
|
||||
export interface WithStatement extends BaseStatement {
|
||||
type: "WithStatement";
|
||||
object: Expression;
|
||||
body: Statement;
|
||||
}
|
||||
|
||||
export interface SwitchStatement extends BaseStatement {
|
||||
type: "SwitchStatement";
|
||||
discriminant: Expression;
|
||||
cases: Array<SwitchCase>;
|
||||
}
|
||||
|
||||
export interface ReturnStatement extends BaseStatement {
|
||||
type: "ReturnStatement";
|
||||
argument?: Expression | null;
|
||||
}
|
||||
|
||||
export interface ThrowStatement extends BaseStatement {
|
||||
type: "ThrowStatement";
|
||||
argument: Expression;
|
||||
}
|
||||
|
||||
export interface TryStatement extends BaseStatement {
|
||||
type: "TryStatement";
|
||||
block: BlockStatement;
|
||||
handler?: CatchClause | null;
|
||||
finalizer?: BlockStatement | null;
|
||||
}
|
||||
|
||||
export interface WhileStatement extends BaseStatement {
|
||||
type: "WhileStatement";
|
||||
test: Expression;
|
||||
body: Statement;
|
||||
}
|
||||
|
||||
export interface DoWhileStatement extends BaseStatement {
|
||||
type: "DoWhileStatement";
|
||||
body: Statement;
|
||||
test: Expression;
|
||||
}
|
||||
|
||||
export interface ForStatement extends BaseStatement {
|
||||
type: "ForStatement";
|
||||
init?: VariableDeclaration | Expression | null;
|
||||
test?: Expression | null;
|
||||
update?: Expression | null;
|
||||
body: Statement;
|
||||
}
|
||||
|
||||
interface BaseForXStatement extends BaseStatement {
|
||||
left: VariableDeclaration | Pattern;
|
||||
right: Expression;
|
||||
body: Statement;
|
||||
}
|
||||
|
||||
export interface ForInStatement extends BaseForXStatement {
|
||||
type: "ForInStatement";
|
||||
}
|
||||
|
||||
export interface DebuggerStatement extends BaseStatement {
|
||||
type: "DebuggerStatement";
|
||||
}
|
||||
|
||||
export type Declaration =
|
||||
FunctionDeclaration | VariableDeclaration | ClassDeclaration;
|
||||
|
||||
interface BaseDeclaration extends BaseStatement { }
|
||||
|
||||
export interface FunctionDeclaration extends BaseFunction, BaseDeclaration {
|
||||
type: "FunctionDeclaration";
|
||||
/** It is null when a function declaration is a part of the `export default function` statement */
|
||||
id: Identifier | null;
|
||||
body: BlockStatement;
|
||||
}
|
||||
|
||||
export interface VariableDeclaration extends BaseDeclaration {
|
||||
type: "VariableDeclaration";
|
||||
declarations: Array<VariableDeclarator>;
|
||||
kind: "var" | "let" | "const";
|
||||
}
|
||||
|
||||
export interface VariableDeclarator extends BaseNode {
|
||||
type: "VariableDeclarator";
|
||||
id: Pattern;
|
||||
init?: Expression | null;
|
||||
}
|
||||
|
||||
type Expression =
|
||||
ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression |
|
||||
ArrowFunctionExpression | YieldExpression | Literal | UnaryExpression |
|
||||
UpdateExpression | BinaryExpression | AssignmentExpression |
|
||||
LogicalExpression | MemberExpression | ConditionalExpression |
|
||||
CallExpression | NewExpression | SequenceExpression | TemplateLiteral |
|
||||
TaggedTemplateExpression | ClassExpression | MetaProperty | Identifier |
|
||||
AwaitExpression | ImportExpression | ChainExpression;
|
||||
|
||||
export interface BaseExpression extends BaseNode { }
|
||||
|
||||
type ChainElement = SimpleCallExpression | MemberExpression;
|
||||
|
||||
export interface ChainExpression extends BaseExpression {
|
||||
type: "ChainExpression";
|
||||
expression: ChainElement;
|
||||
}
|
||||
|
||||
export interface ThisExpression extends BaseExpression {
|
||||
type: "ThisExpression";
|
||||
}
|
||||
|
||||
export interface ArrayExpression extends BaseExpression {
|
||||
type: "ArrayExpression";
|
||||
elements: Array<Expression | SpreadElement>;
|
||||
}
|
||||
|
||||
export interface ObjectExpression extends BaseExpression {
|
||||
type: "ObjectExpression";
|
||||
properties: Array<Property | SpreadElement>;
|
||||
}
|
||||
|
||||
export interface Property extends BaseNode {
|
||||
type: "Property";
|
||||
key: Expression;
|
||||
value: Expression | Pattern; // Could be an AssignmentProperty
|
||||
kind: "init" | "get" | "set";
|
||||
method: boolean;
|
||||
shorthand: boolean;
|
||||
computed: boolean;
|
||||
}
|
||||
|
||||
export interface FunctionExpression extends BaseFunction, BaseExpression {
|
||||
id?: Identifier | null;
|
||||
type: "FunctionExpression";
|
||||
body: BlockStatement;
|
||||
}
|
||||
|
||||
export interface SequenceExpression extends BaseExpression {
|
||||
type: "SequenceExpression";
|
||||
expressions: Array<Expression>;
|
||||
}
|
||||
|
||||
export interface UnaryExpression extends BaseExpression {
|
||||
type: "UnaryExpression";
|
||||
operator: UnaryOperator;
|
||||
prefix: true;
|
||||
argument: Expression;
|
||||
}
|
||||
|
||||
export interface BinaryExpression extends BaseExpression {
|
||||
type: "BinaryExpression";
|
||||
operator: BinaryOperator;
|
||||
left: Expression;
|
||||
right: Expression;
|
||||
}
|
||||
|
||||
export interface AssignmentExpression extends BaseExpression {
|
||||
type: "AssignmentExpression";
|
||||
operator: AssignmentOperator;
|
||||
left: Pattern | MemberExpression;
|
||||
right: Expression;
|
||||
}
|
||||
|
||||
export interface UpdateExpression extends BaseExpression {
|
||||
type: "UpdateExpression";
|
||||
operator: UpdateOperator;
|
||||
argument: Expression;
|
||||
prefix: boolean;
|
||||
}
|
||||
|
||||
export interface LogicalExpression extends BaseExpression {
|
||||
type: "LogicalExpression";
|
||||
operator: LogicalOperator;
|
||||
left: Expression;
|
||||
right: Expression;
|
||||
}
|
||||
|
||||
export interface ConditionalExpression extends BaseExpression {
|
||||
type: "ConditionalExpression";
|
||||
test: Expression;
|
||||
alternate: Expression;
|
||||
consequent: Expression;
|
||||
}
|
||||
|
||||
interface BaseCallExpression extends BaseExpression {
|
||||
callee: Expression | Super;
|
||||
arguments: Array<Expression | SpreadElement>;
|
||||
}
|
||||
export type CallExpression = SimpleCallExpression | NewExpression;
|
||||
|
||||
export interface SimpleCallExpression extends BaseCallExpression {
|
||||
type: "CallExpression";
|
||||
optional: boolean;
|
||||
}
|
||||
|
||||
export interface NewExpression extends BaseCallExpression {
|
||||
type: "NewExpression";
|
||||
}
|
||||
|
||||
export interface MemberExpression extends BaseExpression, BasePattern {
|
||||
type: "MemberExpression";
|
||||
object: Expression | Super;
|
||||
property: Expression;
|
||||
computed: boolean;
|
||||
optional: boolean;
|
||||
}
|
||||
|
||||
export type Pattern =
|
||||
Identifier | ObjectPattern | ArrayPattern | RestElement |
|
||||
AssignmentPattern | MemberExpression;
|
||||
|
||||
interface BasePattern extends BaseNode { }
|
||||
|
||||
export interface SwitchCase extends BaseNode {
|
||||
type: "SwitchCase";
|
||||
test?: Expression | null;
|
||||
consequent: Array<Statement>;
|
||||
}
|
||||
|
||||
export interface CatchClause extends BaseNode {
|
||||
type: "CatchClause";
|
||||
param: Pattern | null;
|
||||
body: BlockStatement;
|
||||
}
|
||||
|
||||
export interface Identifier extends BaseNode, BaseExpression, BasePattern {
|
||||
type: "Identifier";
|
||||
name: string;
|
||||
}
|
||||
|
||||
export type Literal = SimpleLiteral | RegExpLiteral;
|
||||
|
||||
export interface SimpleLiteral extends BaseNode, BaseExpression {
|
||||
type: "Literal";
|
||||
value: string | boolean | number | null;
|
||||
raw?: string;
|
||||
}
|
||||
|
||||
export interface RegExpLiteral extends BaseNode, BaseExpression {
|
||||
type: "Literal";
|
||||
value?: RegExp | null;
|
||||
regex: {
|
||||
pattern: string;
|
||||
flags: string;
|
||||
};
|
||||
raw?: string;
|
||||
}
|
||||
|
||||
export type UnaryOperator =
|
||||
"-" | "+" | "!" | "~" | "typeof" | "void" | "delete";
|
||||
|
||||
export type BinaryOperator =
|
||||
"==" | "!=" | "===" | "!==" | "<" | "<=" | ">" | ">=" | "<<" |
|
||||
">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "**" | "|" | "^" | "&" | "in" |
|
||||
"instanceof";
|
||||
|
||||
export type LogicalOperator = "||" | "&&" | "??";
|
||||
|
||||
export type AssignmentOperator =
|
||||
"=" | "+=" | "-=" | "*=" | "/=" | "%=" | "**=" | "<<=" | ">>=" | ">>>=" |
|
||||
"|=" | "^=" | "&=";
|
||||
|
||||
export type UpdateOperator = "++" | "--";
|
||||
|
||||
export interface ForOfStatement extends BaseForXStatement {
|
||||
type: "ForOfStatement";
|
||||
await: boolean;
|
||||
}
|
||||
|
||||
export interface Super extends BaseNode {
|
||||
type: "Super";
|
||||
}
|
||||
|
||||
export interface SpreadElement extends BaseNode {
|
||||
type: "SpreadElement";
|
||||
argument: Expression;
|
||||
}
|
||||
|
||||
export interface ArrowFunctionExpression extends BaseExpression, BaseFunction {
|
||||
type: "ArrowFunctionExpression";
|
||||
expression: boolean;
|
||||
body: BlockStatement | Expression;
|
||||
}
|
||||
|
||||
export interface YieldExpression extends BaseExpression {
|
||||
type: "YieldExpression";
|
||||
argument?: Expression | null;
|
||||
delegate: boolean;
|
||||
}
|
||||
|
||||
export interface TemplateLiteral extends BaseExpression {
|
||||
type: "TemplateLiteral";
|
||||
quasis: Array<TemplateElement>;
|
||||
expressions: Array<Expression>;
|
||||
}
|
||||
|
||||
export interface TaggedTemplateExpression extends BaseExpression {
|
||||
type: "TaggedTemplateExpression";
|
||||
tag: Expression;
|
||||
quasi: TemplateLiteral;
|
||||
}
|
||||
|
||||
export interface TemplateElement extends BaseNode {
|
||||
type: "TemplateElement";
|
||||
tail: boolean;
|
||||
value: {
|
||||
cooked: string;
|
||||
raw: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface AssignmentProperty extends Property {
|
||||
value: Pattern;
|
||||
kind: "init";
|
||||
method: boolean; // false
|
||||
}
|
||||
|
||||
export interface ObjectPattern extends BasePattern {
|
||||
type: "ObjectPattern";
|
||||
properties: Array<AssignmentProperty | RestElement>;
|
||||
}
|
||||
|
||||
export interface ArrayPattern extends BasePattern {
|
||||
type: "ArrayPattern";
|
||||
elements: Array<Pattern>;
|
||||
}
|
||||
|
||||
export interface RestElement extends BasePattern {
|
||||
type: "RestElement";
|
||||
argument: Pattern;
|
||||
}
|
||||
|
||||
export interface AssignmentPattern extends BasePattern {
|
||||
type: "AssignmentPattern";
|
||||
left: Pattern;
|
||||
right: Expression;
|
||||
}
|
||||
|
||||
export type Class = ClassDeclaration | ClassExpression;
|
||||
interface BaseClass extends BaseNode {
|
||||
superClass?: Expression | null;
|
||||
body: ClassBody;
|
||||
}
|
||||
|
||||
export interface ClassBody extends BaseNode {
|
||||
type: "ClassBody";
|
||||
body: Array<MethodDefinition>;
|
||||
}
|
||||
|
||||
export interface MethodDefinition extends BaseNode {
|
||||
type: "MethodDefinition";
|
||||
key: Expression;
|
||||
value: FunctionExpression;
|
||||
kind: "constructor" | "method" | "get" | "set";
|
||||
computed: boolean;
|
||||
static: boolean;
|
||||
}
|
||||
|
||||
export interface ClassDeclaration extends BaseClass, BaseDeclaration {
|
||||
type: "ClassDeclaration";
|
||||
/** It is null when a class declaration is a part of the `export default class` statement */
|
||||
id: Identifier | null;
|
||||
}
|
||||
|
||||
export interface ClassExpression extends BaseClass, BaseExpression {
|
||||
type: "ClassExpression";
|
||||
id?: Identifier | null;
|
||||
}
|
||||
|
||||
export interface MetaProperty extends BaseExpression {
|
||||
type: "MetaProperty";
|
||||
meta: Identifier;
|
||||
property: Identifier;
|
||||
}
|
||||
|
||||
export type ModuleDeclaration =
|
||||
ImportDeclaration | ExportNamedDeclaration | ExportDefaultDeclaration |
|
||||
ExportAllDeclaration;
|
||||
interface BaseModuleDeclaration extends BaseNode { }
|
||||
|
||||
export type ModuleSpecifier =
|
||||
ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier |
|
||||
ExportSpecifier;
|
||||
interface BaseModuleSpecifier extends BaseNode {
|
||||
local: Identifier;
|
||||
}
|
||||
|
||||
export interface ImportDeclaration extends BaseModuleDeclaration {
|
||||
type: "ImportDeclaration";
|
||||
specifiers: Array<ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier>;
|
||||
source: Literal;
|
||||
}
|
||||
|
||||
export interface ImportSpecifier extends BaseModuleSpecifier {
|
||||
type: "ImportSpecifier";
|
||||
imported: Identifier;
|
||||
}
|
||||
|
||||
export interface ImportExpression extends BaseExpression {
|
||||
type: "ImportExpression";
|
||||
source: Expression;
|
||||
}
|
||||
|
||||
export interface ImportDefaultSpecifier extends BaseModuleSpecifier {
|
||||
type: "ImportDefaultSpecifier";
|
||||
}
|
||||
|
||||
export interface ImportNamespaceSpecifier extends BaseModuleSpecifier {
|
||||
type: "ImportNamespaceSpecifier";
|
||||
}
|
||||
|
||||
export interface ExportNamedDeclaration extends BaseModuleDeclaration {
|
||||
type: "ExportNamedDeclaration";
|
||||
declaration?: Declaration | null;
|
||||
specifiers: Array<ExportSpecifier>;
|
||||
source?: Literal | null;
|
||||
}
|
||||
|
||||
export interface ExportSpecifier extends BaseModuleSpecifier {
|
||||
type: "ExportSpecifier";
|
||||
exported: Identifier;
|
||||
}
|
||||
|
||||
export interface ExportDefaultDeclaration extends BaseModuleDeclaration {
|
||||
type: "ExportDefaultDeclaration";
|
||||
declaration: Declaration | Expression;
|
||||
}
|
||||
|
||||
export interface ExportAllDeclaration extends BaseModuleDeclaration {
|
||||
type: "ExportAllDeclaration";
|
||||
source: Literal;
|
||||
}
|
||||
|
||||
export interface AwaitExpression extends BaseExpression {
|
||||
type: "AwaitExpression";
|
||||
argument: Expression;
|
||||
}
|
647
kmath-ast/src/jsMain/kotlin/estree.kt
Normal file
647
kmath-ast/src/jsMain/kotlin/estree.kt
Normal file
@ -0,0 +1,647 @@
|
||||
@file:Suppress(
|
||||
"INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS",
|
||||
"NO_EXPLICIT_VISIBILITY_IN_API_MODE_WARNING", "KDocMissingDocumentation", "ClassName",
|
||||
)
|
||||
|
||||
import kotlin.js.RegExp
|
||||
|
||||
external interface BaseNodeWithoutComments {
|
||||
var type: String
|
||||
var loc: SourceLocation?
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
var range: dynamic /* JsTuple<Number, Number> */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
}
|
||||
|
||||
external interface BaseNode : BaseNodeWithoutComments {
|
||||
var leadingComments: Array<Comment>?
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
var trailingComments: Array<Comment>?
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
}
|
||||
|
||||
external interface Comment : BaseNodeWithoutComments {
|
||||
override var type: String /* "Line" | "Block" */
|
||||
var value: String
|
||||
}
|
||||
|
||||
external interface SourceLocation {
|
||||
var source: String?
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
var start: Position
|
||||
var end: Position
|
||||
}
|
||||
|
||||
external interface Position {
|
||||
var line: Number
|
||||
var column: Number
|
||||
}
|
||||
|
||||
external interface Program : BaseNode {
|
||||
override var type: String /* "Program" */
|
||||
var sourceType: String /* "script" | "module" */
|
||||
var body: Array<dynamic /* Directive | ExpressionStatement | BlockStatement | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | FunctionDeclaration | VariableDeclaration | ClassDeclaration | ImportDeclaration | ExportNamedDeclaration | ExportDefaultDeclaration | ExportAllDeclaration */>
|
||||
var comments: Array<Comment>?
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
}
|
||||
|
||||
external interface Directive : BaseNode {
|
||||
override var type: String /* "ExpressionStatement" */
|
||||
var expression: dynamic /* SimpleLiteral | RegExpLiteral */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
var directive: String
|
||||
}
|
||||
|
||||
external interface BaseFunction : BaseNode {
|
||||
var params: Array<dynamic /* Identifier | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | MemberExpression */>
|
||||
var generator: Boolean?
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
var async: Boolean?
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
var body: dynamic /* BlockStatement | ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression | ArrowFunctionExpression | YieldExpression | SimpleLiteral | RegExpLiteral | UnaryExpression | UpdateExpression | BinaryExpression | AssignmentExpression | LogicalExpression | MemberExpression | ConditionalExpression | SimpleCallExpression | NewExpression | SequenceExpression | TemplateLiteral | TaggedTemplateExpression | ClassExpression | MetaProperty | Identifier | AwaitExpression | ImportExpression | ChainExpression */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
}
|
||||
|
||||
external interface BaseStatement : BaseNode
|
||||
|
||||
external interface EmptyStatement : BaseStatement {
|
||||
override var type: String /* "EmptyStatement" */
|
||||
}
|
||||
|
||||
external interface BlockStatement : BaseStatement {
|
||||
override var type: String /* "BlockStatement" */
|
||||
var body: Array<dynamic /* ExpressionStatement | BlockStatement | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | FunctionDeclaration | VariableDeclaration | ClassDeclaration */>
|
||||
var innerComments: Array<Comment>?
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
}
|
||||
|
||||
external interface ExpressionStatement : BaseStatement {
|
||||
override var type: String /* "ExpressionStatement" */
|
||||
var expression: dynamic /* ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression | ArrowFunctionExpression | YieldExpression | SimpleLiteral | RegExpLiteral | UnaryExpression | UpdateExpression | BinaryExpression | AssignmentExpression | LogicalExpression | MemberExpression | ConditionalExpression | SimpleCallExpression | NewExpression | SequenceExpression | TemplateLiteral | TaggedTemplateExpression | ClassExpression | MetaProperty | Identifier | AwaitExpression | ImportExpression | ChainExpression */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
}
|
||||
|
||||
external interface IfStatement : BaseStatement {
|
||||
override var type: String /* "IfStatement" */
|
||||
var test: dynamic /* ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression | ArrowFunctionExpression | YieldExpression | SimpleLiteral | RegExpLiteral | UnaryExpression | UpdateExpression | BinaryExpression | AssignmentExpression | LogicalExpression | MemberExpression | ConditionalExpression | SimpleCallExpression | NewExpression | SequenceExpression | TemplateLiteral | TaggedTemplateExpression | ClassExpression | MetaProperty | Identifier | AwaitExpression | ImportExpression | ChainExpression */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
var consequent: dynamic /* ExpressionStatement | BlockStatement | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | FunctionDeclaration | VariableDeclaration | ClassDeclaration */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
var alternate: dynamic /* ExpressionStatement? | BlockStatement? | EmptyStatement? | DebuggerStatement? | WithStatement? | ReturnStatement? | LabeledStatement? | BreakStatement? | ContinueStatement? | IfStatement? | SwitchStatement? | ThrowStatement? | TryStatement? | WhileStatement? | DoWhileStatement? | ForStatement? | ForInStatement? | ForOfStatement? | FunctionDeclaration? | VariableDeclaration? | ClassDeclaration? */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
}
|
||||
|
||||
external interface LabeledStatement : BaseStatement {
|
||||
override var type: String /* "LabeledStatement" */
|
||||
var label: Identifier
|
||||
var body: dynamic /* ExpressionStatement | BlockStatement | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | FunctionDeclaration | VariableDeclaration | ClassDeclaration */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
}
|
||||
|
||||
external interface BreakStatement : BaseStatement {
|
||||
override var type: String /* "BreakStatement" */
|
||||
var label: Identifier?
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
}
|
||||
|
||||
external interface ContinueStatement : BaseStatement {
|
||||
override var type: String /* "ContinueStatement" */
|
||||
var label: Identifier?
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
}
|
||||
|
||||
external interface WithStatement : BaseStatement {
|
||||
override var type: String /* "WithStatement" */
|
||||
var `object`: dynamic /* ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression | ArrowFunctionExpression | YieldExpression | SimpleLiteral | RegExpLiteral | UnaryExpression | UpdateExpression | BinaryExpression | AssignmentExpression | LogicalExpression | MemberExpression | ConditionalExpression | SimpleCallExpression | NewExpression | SequenceExpression | TemplateLiteral | TaggedTemplateExpression | ClassExpression | MetaProperty | Identifier | AwaitExpression | ImportExpression | ChainExpression */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
var body: dynamic /* ExpressionStatement | BlockStatement | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | FunctionDeclaration | VariableDeclaration | ClassDeclaration */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
}
|
||||
|
||||
external interface SwitchStatement : BaseStatement {
|
||||
override var type: String /* "SwitchStatement" */
|
||||
var discriminant: dynamic /* ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression | ArrowFunctionExpression | YieldExpression | SimpleLiteral | RegExpLiteral | UnaryExpression | UpdateExpression | BinaryExpression | AssignmentExpression | LogicalExpression | MemberExpression | ConditionalExpression | SimpleCallExpression | NewExpression | SequenceExpression | TemplateLiteral | TaggedTemplateExpression | ClassExpression | MetaProperty | Identifier | AwaitExpression | ImportExpression | ChainExpression */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
var cases: Array<SwitchCase>
|
||||
}
|
||||
|
||||
external interface ReturnStatement : BaseStatement {
|
||||
override var type: String /* "ReturnStatement" */
|
||||
var argument: dynamic /* ThisExpression? | ArrayExpression? | ObjectExpression? | FunctionExpression? | ArrowFunctionExpression? | YieldExpression? | SimpleLiteral? | RegExpLiteral? | UnaryExpression? | UpdateExpression? | BinaryExpression? | AssignmentExpression? | LogicalExpression? | MemberExpression? | ConditionalExpression? | SimpleCallExpression? | NewExpression? | SequenceExpression? | TemplateLiteral? | TaggedTemplateExpression? | ClassExpression? | MetaProperty? | Identifier? | AwaitExpression? | ImportExpression? | ChainExpression? */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
}
|
||||
|
||||
external interface ThrowStatement : BaseStatement {
|
||||
override var type: String /* "ThrowStatement" */
|
||||
var argument: dynamic /* ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression | ArrowFunctionExpression | YieldExpression | SimpleLiteral | RegExpLiteral | UnaryExpression | UpdateExpression | BinaryExpression | AssignmentExpression | LogicalExpression | MemberExpression | ConditionalExpression | SimpleCallExpression | NewExpression | SequenceExpression | TemplateLiteral | TaggedTemplateExpression | ClassExpression | MetaProperty | Identifier | AwaitExpression | ImportExpression | ChainExpression */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
}
|
||||
|
||||
external interface TryStatement : BaseStatement {
|
||||
override var type: String /* "TryStatement" */
|
||||
var block: BlockStatement
|
||||
var handler: CatchClause?
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
var finalizer: BlockStatement?
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
}
|
||||
|
||||
external interface WhileStatement : BaseStatement {
|
||||
override var type: String /* "WhileStatement" */
|
||||
var test: dynamic /* ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression | ArrowFunctionExpression | YieldExpression | SimpleLiteral | RegExpLiteral | UnaryExpression | UpdateExpression | BinaryExpression | AssignmentExpression | LogicalExpression | MemberExpression | ConditionalExpression | SimpleCallExpression | NewExpression | SequenceExpression | TemplateLiteral | TaggedTemplateExpression | ClassExpression | MetaProperty | Identifier | AwaitExpression | ImportExpression | ChainExpression */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
var body: dynamic /* ExpressionStatement | BlockStatement | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | FunctionDeclaration | VariableDeclaration | ClassDeclaration */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
}
|
||||
|
||||
external interface DoWhileStatement : BaseStatement {
|
||||
override var type: String /* "DoWhileStatement" */
|
||||
var body: dynamic /* ExpressionStatement | BlockStatement | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | FunctionDeclaration | VariableDeclaration | ClassDeclaration */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
var test: dynamic /* ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression | ArrowFunctionExpression | YieldExpression | SimpleLiteral | RegExpLiteral | UnaryExpression | UpdateExpression | BinaryExpression | AssignmentExpression | LogicalExpression | MemberExpression | ConditionalExpression | SimpleCallExpression | NewExpression | SequenceExpression | TemplateLiteral | TaggedTemplateExpression | ClassExpression | MetaProperty | Identifier | AwaitExpression | ImportExpression | ChainExpression */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
}
|
||||
|
||||
external interface ForStatement : BaseStatement {
|
||||
override var type: String /* "ForStatement" */
|
||||
var init: dynamic /* VariableDeclaration? | ThisExpression? | ArrayExpression? | ObjectExpression? | FunctionExpression? | ArrowFunctionExpression? | YieldExpression? | SimpleLiteral? | RegExpLiteral? | UnaryExpression? | UpdateExpression? | BinaryExpression? | AssignmentExpression? | LogicalExpression? | MemberExpression? | ConditionalExpression? | SimpleCallExpression? | NewExpression? | SequenceExpression? | TemplateLiteral? | TaggedTemplateExpression? | ClassExpression? | MetaProperty? | Identifier? | AwaitExpression? | ImportExpression? | ChainExpression? */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
var test: dynamic /* ThisExpression? | ArrayExpression? | ObjectExpression? | FunctionExpression? | ArrowFunctionExpression? | YieldExpression? | SimpleLiteral? | RegExpLiteral? | UnaryExpression? | UpdateExpression? | BinaryExpression? | AssignmentExpression? | LogicalExpression? | MemberExpression? | ConditionalExpression? | SimpleCallExpression? | NewExpression? | SequenceExpression? | TemplateLiteral? | TaggedTemplateExpression? | ClassExpression? | MetaProperty? | Identifier? | AwaitExpression? | ImportExpression? | ChainExpression? */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
var update: dynamic /* ThisExpression? | ArrayExpression? | ObjectExpression? | FunctionExpression? | ArrowFunctionExpression? | YieldExpression? | SimpleLiteral? | RegExpLiteral? | UnaryExpression? | UpdateExpression? | BinaryExpression? | AssignmentExpression? | LogicalExpression? | MemberExpression? | ConditionalExpression? | SimpleCallExpression? | NewExpression? | SequenceExpression? | TemplateLiteral? | TaggedTemplateExpression? | ClassExpression? | MetaProperty? | Identifier? | AwaitExpression? | ImportExpression? | ChainExpression? */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
var body: dynamic /* ExpressionStatement | BlockStatement | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | FunctionDeclaration | VariableDeclaration | ClassDeclaration */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
}
|
||||
|
||||
external interface BaseForXStatement : BaseStatement {
|
||||
var left: dynamic /* VariableDeclaration | Identifier | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | MemberExpression */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
var right: dynamic /* ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression | ArrowFunctionExpression | YieldExpression | SimpleLiteral | RegExpLiteral | UnaryExpression | UpdateExpression | BinaryExpression | AssignmentExpression | LogicalExpression | MemberExpression | ConditionalExpression | SimpleCallExpression | NewExpression | SequenceExpression | TemplateLiteral | TaggedTemplateExpression | ClassExpression | MetaProperty | Identifier | AwaitExpression | ImportExpression | ChainExpression */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
var body: dynamic /* ExpressionStatement | BlockStatement | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | FunctionDeclaration | VariableDeclaration | ClassDeclaration */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
}
|
||||
|
||||
external interface ForInStatement : BaseForXStatement {
|
||||
override var type: String /* "ForInStatement" */
|
||||
}
|
||||
|
||||
external interface DebuggerStatement : BaseStatement {
|
||||
override var type: String /* "DebuggerStatement" */
|
||||
}
|
||||
|
||||
external interface BaseDeclaration : BaseStatement
|
||||
|
||||
external interface FunctionDeclaration : BaseFunction, BaseDeclaration {
|
||||
override var type: String /* "FunctionDeclaration" */
|
||||
var id: Identifier?
|
||||
override var body: BlockStatement
|
||||
}
|
||||
|
||||
external interface VariableDeclaration : BaseDeclaration {
|
||||
override var type: String /* "VariableDeclaration" */
|
||||
var declarations: Array<VariableDeclarator>
|
||||
var kind: String /* "var" | "let" | "const" */
|
||||
}
|
||||
|
||||
external interface VariableDeclarator : BaseNode {
|
||||
override var type: String /* "VariableDeclarator" */
|
||||
var id: dynamic /* Identifier | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | MemberExpression */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
var init: dynamic /* ThisExpression? | ArrayExpression? | ObjectExpression? | FunctionExpression? | ArrowFunctionExpression? | YieldExpression? | SimpleLiteral? | RegExpLiteral? | UnaryExpression? | UpdateExpression? | BinaryExpression? | AssignmentExpression? | LogicalExpression? | MemberExpression? | ConditionalExpression? | SimpleCallExpression? | NewExpression? | SequenceExpression? | TemplateLiteral? | TaggedTemplateExpression? | ClassExpression? | MetaProperty? | Identifier? | AwaitExpression? | ImportExpression? | ChainExpression? */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
}
|
||||
|
||||
external interface BaseExpression : BaseNode
|
||||
|
||||
external interface ChainExpression : BaseExpression {
|
||||
override var type: String /* "ChainExpression" */
|
||||
var expression: dynamic /* SimpleCallExpression | MemberExpression */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
}
|
||||
|
||||
external interface ThisExpression : BaseExpression {
|
||||
override var type: String /* "ThisExpression" */
|
||||
}
|
||||
|
||||
external interface ArrayExpression : BaseExpression {
|
||||
override var type: String /* "ArrayExpression" */
|
||||
var elements: Array<dynamic /* ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression | ArrowFunctionExpression | YieldExpression | SimpleLiteral | RegExpLiteral | UnaryExpression | UpdateExpression | BinaryExpression | AssignmentExpression | LogicalExpression | MemberExpression | ConditionalExpression | SimpleCallExpression | NewExpression | SequenceExpression | TemplateLiteral | TaggedTemplateExpression | ClassExpression | MetaProperty | Identifier | AwaitExpression | ImportExpression | ChainExpression | SpreadElement */>
|
||||
}
|
||||
|
||||
external interface ObjectExpression : BaseExpression {
|
||||
override var type: String /* "ObjectExpression" */
|
||||
var properties: Array<dynamic /* Property | SpreadElement */>
|
||||
}
|
||||
|
||||
external interface Property : BaseNode {
|
||||
override var type: String /* "Property" */
|
||||
var key: dynamic /* ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression | ArrowFunctionExpression | YieldExpression | SimpleLiteral | RegExpLiteral | UnaryExpression | UpdateExpression | BinaryExpression | AssignmentExpression | LogicalExpression | MemberExpression | ConditionalExpression | SimpleCallExpression | NewExpression | SequenceExpression | TemplateLiteral | TaggedTemplateExpression | ClassExpression | MetaProperty | Identifier | AwaitExpression | ImportExpression | ChainExpression */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
var value: dynamic /* ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression | ArrowFunctionExpression | YieldExpression | SimpleLiteral | RegExpLiteral | UnaryExpression | UpdateExpression | BinaryExpression | AssignmentExpression | LogicalExpression | MemberExpression | ConditionalExpression | SimpleCallExpression | NewExpression | SequenceExpression | TemplateLiteral | TaggedTemplateExpression | ClassExpression | MetaProperty | Identifier | AwaitExpression | ImportExpression | ChainExpression | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
var kind: String /* "init" | "get" | "set" */
|
||||
var method: Boolean
|
||||
var shorthand: Boolean
|
||||
var computed: Boolean
|
||||
}
|
||||
|
||||
external interface FunctionExpression : BaseFunction, BaseExpression {
|
||||
var id: Identifier?
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
override var type: String /* "FunctionExpression" */
|
||||
override var body: BlockStatement
|
||||
}
|
||||
|
||||
external interface SequenceExpression : BaseExpression {
|
||||
override var type: String /* "SequenceExpression" */
|
||||
var expressions: Array<dynamic /* ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression | ArrowFunctionExpression | YieldExpression | SimpleLiteral | RegExpLiteral | UnaryExpression | UpdateExpression | BinaryExpression | AssignmentExpression | LogicalExpression | MemberExpression | ConditionalExpression | SimpleCallExpression | NewExpression | SequenceExpression | TemplateLiteral | TaggedTemplateExpression | ClassExpression | MetaProperty | Identifier | AwaitExpression | ImportExpression | ChainExpression */>
|
||||
}
|
||||
|
||||
external interface UnaryExpression : BaseExpression {
|
||||
override var type: String /* "UnaryExpression" */
|
||||
var operator: String /* "-" | "+" | "!" | "~" | "typeof" | "void" | "delete" */
|
||||
var prefix: Boolean
|
||||
var argument: dynamic /* ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression | ArrowFunctionExpression | YieldExpression | SimpleLiteral | RegExpLiteral | UnaryExpression | UpdateExpression | BinaryExpression | AssignmentExpression | LogicalExpression | MemberExpression | ConditionalExpression | SimpleCallExpression | NewExpression | SequenceExpression | TemplateLiteral | TaggedTemplateExpression | ClassExpression | MetaProperty | Identifier | AwaitExpression | ImportExpression | ChainExpression */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
}
|
||||
|
||||
external interface BinaryExpression : BaseExpression {
|
||||
override var type: String /* "BinaryExpression" */
|
||||
var operator: String /* "==" | "!=" | "===" | "!==" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "**" | "|" | "^" | "&" | "in" | "instanceof" */
|
||||
var left: dynamic /* ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression | ArrowFunctionExpression | YieldExpression | SimpleLiteral | RegExpLiteral | UnaryExpression | UpdateExpression | BinaryExpression | AssignmentExpression | LogicalExpression | MemberExpression | ConditionalExpression | SimpleCallExpression | NewExpression | SequenceExpression | TemplateLiteral | TaggedTemplateExpression | ClassExpression | MetaProperty | Identifier | AwaitExpression | ImportExpression | ChainExpression */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
var right: dynamic /* ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression | ArrowFunctionExpression | YieldExpression | SimpleLiteral | RegExpLiteral | UnaryExpression | UpdateExpression | BinaryExpression | AssignmentExpression | LogicalExpression | MemberExpression | ConditionalExpression | SimpleCallExpression | NewExpression | SequenceExpression | TemplateLiteral | TaggedTemplateExpression | ClassExpression | MetaProperty | Identifier | AwaitExpression | ImportExpression | ChainExpression */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
}
|
||||
|
||||
external interface AssignmentExpression : BaseExpression {
|
||||
override var type: String /* "AssignmentExpression" */
|
||||
var operator: String /* "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "**=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=" */
|
||||
var left: dynamic /* Identifier | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | MemberExpression */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
var right: dynamic /* ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression | ArrowFunctionExpression | YieldExpression | SimpleLiteral | RegExpLiteral | UnaryExpression | UpdateExpression | BinaryExpression | AssignmentExpression | LogicalExpression | MemberExpression | ConditionalExpression | SimpleCallExpression | NewExpression | SequenceExpression | TemplateLiteral | TaggedTemplateExpression | ClassExpression | MetaProperty | Identifier | AwaitExpression | ImportExpression | ChainExpression */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
}
|
||||
|
||||
external interface UpdateExpression : BaseExpression {
|
||||
override var type: String /* "UpdateExpression" */
|
||||
var operator: String /* "++" | "--" */
|
||||
var argument: dynamic /* ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression | ArrowFunctionExpression | YieldExpression | SimpleLiteral | RegExpLiteral | UnaryExpression | UpdateExpression | BinaryExpression | AssignmentExpression | LogicalExpression | MemberExpression | ConditionalExpression | SimpleCallExpression | NewExpression | SequenceExpression | TemplateLiteral | TaggedTemplateExpression | ClassExpression | MetaProperty | Identifier | AwaitExpression | ImportExpression | ChainExpression */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
var prefix: Boolean
|
||||
}
|
||||
|
||||
external interface LogicalExpression : BaseExpression {
|
||||
override var type: String /* "LogicalExpression" */
|
||||
var operator: String /* "||" | "&&" | "??" */
|
||||
var left: dynamic /* ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression | ArrowFunctionExpression | YieldExpression | SimpleLiteral | RegExpLiteral | UnaryExpression | UpdateExpression | BinaryExpression | AssignmentExpression | LogicalExpression | MemberExpression | ConditionalExpression | SimpleCallExpression | NewExpression | SequenceExpression | TemplateLiteral | TaggedTemplateExpression | ClassExpression | MetaProperty | Identifier | AwaitExpression | ImportExpression | ChainExpression */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
var right: dynamic /* ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression | ArrowFunctionExpression | YieldExpression | SimpleLiteral | RegExpLiteral | UnaryExpression | UpdateExpression | BinaryExpression | AssignmentExpression | LogicalExpression | MemberExpression | ConditionalExpression | SimpleCallExpression | NewExpression | SequenceExpression | TemplateLiteral | TaggedTemplateExpression | ClassExpression | MetaProperty | Identifier | AwaitExpression | ImportExpression | ChainExpression */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
}
|
||||
|
||||
external interface ConditionalExpression : BaseExpression {
|
||||
override var type: String /* "ConditionalExpression" */
|
||||
var test: dynamic /* ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression | ArrowFunctionExpression | YieldExpression | SimpleLiteral | RegExpLiteral | UnaryExpression | UpdateExpression | BinaryExpression | AssignmentExpression | LogicalExpression | MemberExpression | ConditionalExpression | SimpleCallExpression | NewExpression | SequenceExpression | TemplateLiteral | TaggedTemplateExpression | ClassExpression | MetaProperty | Identifier | AwaitExpression | ImportExpression | ChainExpression */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
var alternate: dynamic /* ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression | ArrowFunctionExpression | YieldExpression | SimpleLiteral | RegExpLiteral | UnaryExpression | UpdateExpression | BinaryExpression | AssignmentExpression | LogicalExpression | MemberExpression | ConditionalExpression | SimpleCallExpression | NewExpression | SequenceExpression | TemplateLiteral | TaggedTemplateExpression | ClassExpression | MetaProperty | Identifier | AwaitExpression | ImportExpression | ChainExpression */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
var consequent: dynamic /* ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression | ArrowFunctionExpression | YieldExpression | SimpleLiteral | RegExpLiteral | UnaryExpression | UpdateExpression | BinaryExpression | AssignmentExpression | LogicalExpression | MemberExpression | ConditionalExpression | SimpleCallExpression | NewExpression | SequenceExpression | TemplateLiteral | TaggedTemplateExpression | ClassExpression | MetaProperty | Identifier | AwaitExpression | ImportExpression | ChainExpression */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
}
|
||||
|
||||
external interface BaseCallExpression : BaseExpression {
|
||||
var callee: dynamic /* ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression | ArrowFunctionExpression | YieldExpression | SimpleLiteral | RegExpLiteral | UnaryExpression | UpdateExpression | BinaryExpression | AssignmentExpression | LogicalExpression | MemberExpression | ConditionalExpression | SimpleCallExpression | NewExpression | SequenceExpression | TemplateLiteral | TaggedTemplateExpression | ClassExpression | MetaProperty | Identifier | AwaitExpression | ImportExpression | ChainExpression | Super */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
var arguments: Array<dynamic /* ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression | ArrowFunctionExpression | YieldExpression | SimpleLiteral | RegExpLiteral | UnaryExpression | UpdateExpression | BinaryExpression | AssignmentExpression | LogicalExpression | MemberExpression | ConditionalExpression | SimpleCallExpression | NewExpression | SequenceExpression | TemplateLiteral | TaggedTemplateExpression | ClassExpression | MetaProperty | Identifier | AwaitExpression | ImportExpression | ChainExpression | SpreadElement */>
|
||||
}
|
||||
|
||||
external interface SimpleCallExpression : BaseCallExpression {
|
||||
override var type: String /* "CallExpression" */
|
||||
var optional: Boolean
|
||||
}
|
||||
|
||||
external interface NewExpression : BaseCallExpression {
|
||||
override var type: String /* "NewExpression" */
|
||||
}
|
||||
|
||||
external interface MemberExpression : BaseExpression, BasePattern {
|
||||
override var type: String /* "MemberExpression" */
|
||||
var `object`: dynamic /* ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression | ArrowFunctionExpression | YieldExpression | SimpleLiteral | RegExpLiteral | UnaryExpression | UpdateExpression | BinaryExpression | AssignmentExpression | LogicalExpression | MemberExpression | ConditionalExpression | SimpleCallExpression | NewExpression | SequenceExpression | TemplateLiteral | TaggedTemplateExpression | ClassExpression | MetaProperty | Identifier | AwaitExpression | ImportExpression | ChainExpression | Super */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
var property: dynamic /* ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression | ArrowFunctionExpression | YieldExpression | SimpleLiteral | RegExpLiteral | UnaryExpression | UpdateExpression | BinaryExpression | AssignmentExpression | LogicalExpression | MemberExpression | ConditionalExpression | SimpleCallExpression | NewExpression | SequenceExpression | TemplateLiteral | TaggedTemplateExpression | ClassExpression | MetaProperty | Identifier | AwaitExpression | ImportExpression | ChainExpression */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
var computed: Boolean
|
||||
var optional: Boolean
|
||||
}
|
||||
|
||||
external interface BasePattern : BaseNode
|
||||
|
||||
external interface SwitchCase : BaseNode {
|
||||
override var type: String /* "SwitchCase" */
|
||||
var test: dynamic /* ThisExpression? | ArrayExpression? | ObjectExpression? | FunctionExpression? | ArrowFunctionExpression? | YieldExpression? | SimpleLiteral? | RegExpLiteral? | UnaryExpression? | UpdateExpression? | BinaryExpression? | AssignmentExpression? | LogicalExpression? | MemberExpression? | ConditionalExpression? | SimpleCallExpression? | NewExpression? | SequenceExpression? | TemplateLiteral? | TaggedTemplateExpression? | ClassExpression? | MetaProperty? | Identifier? | AwaitExpression? | ImportExpression? | ChainExpression? */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
var consequent: Array<dynamic /* ExpressionStatement | BlockStatement | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | FunctionDeclaration | VariableDeclaration | ClassDeclaration */>
|
||||
}
|
||||
|
||||
external interface CatchClause : BaseNode {
|
||||
override var type: String /* "CatchClause" */
|
||||
var param: dynamic /* Identifier? | ObjectPattern? | ArrayPattern? | RestElement? | AssignmentPattern? | MemberExpression? */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
var body: BlockStatement
|
||||
}
|
||||
|
||||
external interface Identifier : BaseNode, BaseExpression, BasePattern {
|
||||
override var type: String /* "Identifier" */
|
||||
var name: String
|
||||
}
|
||||
|
||||
external interface SimpleLiteral : BaseNode, BaseExpression {
|
||||
override var type: String /* "Literal" */
|
||||
var value: dynamic /* String? | Boolean? | Number? */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
var raw: String?
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
}
|
||||
|
||||
external interface `T$1` {
|
||||
var pattern: String
|
||||
var flags: String
|
||||
}
|
||||
|
||||
external interface RegExpLiteral : BaseNode, BaseExpression {
|
||||
override var type: String /* "Literal" */
|
||||
var value: RegExp?
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
var regex: `T$1`
|
||||
var raw: String?
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
}
|
||||
|
||||
external interface ForOfStatement : BaseForXStatement {
|
||||
override var type: String /* "ForOfStatement" */
|
||||
var await: Boolean
|
||||
}
|
||||
|
||||
external interface Super : BaseNode {
|
||||
override var type: String /* "Super" */
|
||||
}
|
||||
|
||||
external interface SpreadElement : BaseNode {
|
||||
override var type: String /* "SpreadElement" */
|
||||
var argument: dynamic /* ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression | ArrowFunctionExpression | YieldExpression | SimpleLiteral | RegExpLiteral | UnaryExpression | UpdateExpression | BinaryExpression | AssignmentExpression | LogicalExpression | MemberExpression | ConditionalExpression | SimpleCallExpression | NewExpression | SequenceExpression | TemplateLiteral | TaggedTemplateExpression | ClassExpression | MetaProperty | Identifier | AwaitExpression | ImportExpression | ChainExpression */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
}
|
||||
|
||||
external interface ArrowFunctionExpression : BaseExpression, BaseFunction {
|
||||
override var type: String /* "ArrowFunctionExpression" */
|
||||
var expression: Boolean
|
||||
override var body: dynamic /* BlockStatement | ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression | ArrowFunctionExpression | YieldExpression | SimpleLiteral | RegExpLiteral | UnaryExpression | UpdateExpression | BinaryExpression | AssignmentExpression | LogicalExpression | MemberExpression | ConditionalExpression | SimpleCallExpression | NewExpression | SequenceExpression | TemplateLiteral | TaggedTemplateExpression | ClassExpression | MetaProperty | Identifier | AwaitExpression | ImportExpression | ChainExpression */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
}
|
||||
|
||||
external interface YieldExpression : BaseExpression {
|
||||
override var type: String /* "YieldExpression" */
|
||||
var argument: dynamic /* ThisExpression? | ArrayExpression? | ObjectExpression? | FunctionExpression? | ArrowFunctionExpression? | YieldExpression? | SimpleLiteral? | RegExpLiteral? | UnaryExpression? | UpdateExpression? | BinaryExpression? | AssignmentExpression? | LogicalExpression? | MemberExpression? | ConditionalExpression? | SimpleCallExpression? | NewExpression? | SequenceExpression? | TemplateLiteral? | TaggedTemplateExpression? | ClassExpression? | MetaProperty? | Identifier? | AwaitExpression? | ImportExpression? | ChainExpression? */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
var delegate: Boolean
|
||||
}
|
||||
|
||||
external interface TemplateLiteral : BaseExpression {
|
||||
override var type: String /* "TemplateLiteral" */
|
||||
var quasis: Array<TemplateElement>
|
||||
var expressions: Array<dynamic /* ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression | ArrowFunctionExpression | YieldExpression | SimpleLiteral | RegExpLiteral | UnaryExpression | UpdateExpression | BinaryExpression | AssignmentExpression | LogicalExpression | MemberExpression | ConditionalExpression | SimpleCallExpression | NewExpression | SequenceExpression | TemplateLiteral | TaggedTemplateExpression | ClassExpression | MetaProperty | Identifier | AwaitExpression | ImportExpression | ChainExpression */>
|
||||
}
|
||||
|
||||
external interface TaggedTemplateExpression : BaseExpression {
|
||||
override var type: String /* "TaggedTemplateExpression" */
|
||||
var tag: dynamic /* ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression | ArrowFunctionExpression | YieldExpression | SimpleLiteral | RegExpLiteral | UnaryExpression | UpdateExpression | BinaryExpression | AssignmentExpression | LogicalExpression | MemberExpression | ConditionalExpression | SimpleCallExpression | NewExpression | SequenceExpression | TemplateLiteral | TaggedTemplateExpression | ClassExpression | MetaProperty | Identifier | AwaitExpression | ImportExpression | ChainExpression */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
var quasi: TemplateLiteral
|
||||
}
|
||||
|
||||
external interface `T$2` {
|
||||
var cooked: String
|
||||
var raw: String
|
||||
}
|
||||
|
||||
external interface TemplateElement : BaseNode {
|
||||
override var type: String /* "TemplateElement" */
|
||||
var tail: Boolean
|
||||
var value: `T$2`
|
||||
}
|
||||
|
||||
external interface AssignmentProperty : Property {
|
||||
override var value: dynamic /* Identifier | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | MemberExpression */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
override var kind: String /* "init" */
|
||||
override var method: Boolean
|
||||
}
|
||||
|
||||
external interface ObjectPattern : BasePattern {
|
||||
override var type: String /* "ObjectPattern" */
|
||||
var properties: Array<dynamic /* AssignmentProperty | RestElement */>
|
||||
}
|
||||
|
||||
external interface ArrayPattern : BasePattern {
|
||||
override var type: String /* "ArrayPattern" */
|
||||
var elements: Array<dynamic /* Identifier | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | MemberExpression */>
|
||||
}
|
||||
|
||||
external interface RestElement : BasePattern {
|
||||
override var type: String /* "RestElement" */
|
||||
var argument: dynamic /* Identifier | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | MemberExpression */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
}
|
||||
|
||||
external interface AssignmentPattern : BasePattern {
|
||||
override var type: String /* "AssignmentPattern" */
|
||||
var left: dynamic /* Identifier | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | MemberExpression */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
var right: dynamic /* ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression | ArrowFunctionExpression | YieldExpression | SimpleLiteral | RegExpLiteral | UnaryExpression | UpdateExpression | BinaryExpression | AssignmentExpression | LogicalExpression | MemberExpression | ConditionalExpression | SimpleCallExpression | NewExpression | SequenceExpression | TemplateLiteral | TaggedTemplateExpression | ClassExpression | MetaProperty | Identifier | AwaitExpression | ImportExpression | ChainExpression */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
}
|
||||
|
||||
external interface BaseClass : BaseNode {
|
||||
var superClass: dynamic /* ThisExpression? | ArrayExpression? | ObjectExpression? | FunctionExpression? | ArrowFunctionExpression? | YieldExpression? | SimpleLiteral? | RegExpLiteral? | UnaryExpression? | UpdateExpression? | BinaryExpression? | AssignmentExpression? | LogicalExpression? | MemberExpression? | ConditionalExpression? | SimpleCallExpression? | NewExpression? | SequenceExpression? | TemplateLiteral? | TaggedTemplateExpression? | ClassExpression? | MetaProperty? | Identifier? | AwaitExpression? | ImportExpression? | ChainExpression? */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
var body: ClassBody
|
||||
}
|
||||
|
||||
external interface ClassBody : BaseNode {
|
||||
override var type: String /* "ClassBody" */
|
||||
var body: Array<MethodDefinition>
|
||||
}
|
||||
|
||||
external interface MethodDefinition : BaseNode {
|
||||
override var type: String /* "MethodDefinition" */
|
||||
var key: dynamic /* ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression | ArrowFunctionExpression | YieldExpression | SimpleLiteral | RegExpLiteral | UnaryExpression | UpdateExpression | BinaryExpression | AssignmentExpression | LogicalExpression | MemberExpression | ConditionalExpression | SimpleCallExpression | NewExpression | SequenceExpression | TemplateLiteral | TaggedTemplateExpression | ClassExpression | MetaProperty | Identifier | AwaitExpression | ImportExpression | ChainExpression */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
var value: FunctionExpression
|
||||
var kind: String /* "constructor" | "method" | "get" | "set" */
|
||||
var computed: Boolean
|
||||
var static: Boolean
|
||||
}
|
||||
|
||||
external interface ClassDeclaration : BaseClass, BaseDeclaration {
|
||||
override var type: String /* "ClassDeclaration" */
|
||||
var id: Identifier?
|
||||
}
|
||||
|
||||
external interface ClassExpression : BaseClass, BaseExpression {
|
||||
override var type: String /* "ClassExpression" */
|
||||
var id: Identifier?
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
}
|
||||
|
||||
external interface MetaProperty : BaseExpression {
|
||||
override var type: String /* "MetaProperty" */
|
||||
var meta: Identifier
|
||||
var property: Identifier
|
||||
}
|
||||
|
||||
external interface BaseModuleDeclaration : BaseNode
|
||||
|
||||
external interface BaseModuleSpecifier : BaseNode {
|
||||
var local: Identifier
|
||||
}
|
||||
|
||||
external interface ImportDeclaration : BaseModuleDeclaration {
|
||||
override var type: String /* "ImportDeclaration" */
|
||||
var specifiers: Array<dynamic /* ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier */>
|
||||
var source: dynamic /* SimpleLiteral | RegExpLiteral */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
}
|
||||
|
||||
external interface ImportSpecifier : BaseModuleSpecifier {
|
||||
override var type: String /* "ImportSpecifier" */
|
||||
var imported: Identifier
|
||||
}
|
||||
|
||||
external interface ImportExpression : BaseExpression {
|
||||
override var type: String /* "ImportExpression" */
|
||||
var source: dynamic /* ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression | ArrowFunctionExpression | YieldExpression | SimpleLiteral | RegExpLiteral | UnaryExpression | UpdateExpression | BinaryExpression | AssignmentExpression | LogicalExpression | MemberExpression | ConditionalExpression | SimpleCallExpression | NewExpression | SequenceExpression | TemplateLiteral | TaggedTemplateExpression | ClassExpression | MetaProperty | Identifier | AwaitExpression | ImportExpression | ChainExpression */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
}
|
||||
|
||||
external interface ImportDefaultSpecifier : BaseModuleSpecifier {
|
||||
override var type: String /* "ImportDefaultSpecifier" */
|
||||
}
|
||||
|
||||
external interface ImportNamespaceSpecifier : BaseModuleSpecifier {
|
||||
override var type: String /* "ImportNamespaceSpecifier" */
|
||||
}
|
||||
|
||||
external interface ExportNamedDeclaration : BaseModuleDeclaration {
|
||||
override var type: String /* "ExportNamedDeclaration" */
|
||||
var declaration: dynamic /* FunctionDeclaration? | VariableDeclaration? | ClassDeclaration? */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
var specifiers: Array<ExportSpecifier>
|
||||
var source: dynamic /* SimpleLiteral? | RegExpLiteral? */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
}
|
||||
|
||||
external interface ExportSpecifier : BaseModuleSpecifier {
|
||||
override var type: String /* "ExportSpecifier" */
|
||||
var exported: Identifier
|
||||
}
|
||||
|
||||
external interface ExportDefaultDeclaration : BaseModuleDeclaration {
|
||||
override var type: String /* "ExportDefaultDeclaration" */
|
||||
var declaration: dynamic /* FunctionDeclaration | VariableDeclaration | ClassDeclaration | ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression | ArrowFunctionExpression | YieldExpression | SimpleLiteral | RegExpLiteral | UnaryExpression | UpdateExpression | BinaryExpression | AssignmentExpression | LogicalExpression | MemberExpression | ConditionalExpression | SimpleCallExpression | NewExpression | SequenceExpression | TemplateLiteral | TaggedTemplateExpression | ClassExpression | MetaProperty | Identifier | AwaitExpression | ImportExpression | ChainExpression */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
}
|
||||
|
||||
external interface ExportAllDeclaration : BaseModuleDeclaration {
|
||||
override var type: String /* "ExportAllDeclaration" */
|
||||
var source: dynamic /* SimpleLiteral | RegExpLiteral */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
}
|
||||
|
||||
external interface AwaitExpression : BaseExpression {
|
||||
override var type: String /* "AwaitExpression" */
|
||||
var argument: dynamic /* ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression | ArrowFunctionExpression | YieldExpression | SimpleLiteral | RegExpLiteral | UnaryExpression | UpdateExpression | BinaryExpression | AssignmentExpression | LogicalExpression | MemberExpression | ConditionalExpression | SimpleCallExpression | NewExpression | SequenceExpression | TemplateLiteral | TaggedTemplateExpression | ClassExpression | MetaProperty | Identifier | AwaitExpression | ImportExpression | ChainExpression */
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
}
|
40
kmath-ast/src/jsMain/kotlin/lib.es2015.iterable.kt
Normal file
40
kmath-ast/src/jsMain/kotlin/lib.es2015.iterable.kt
Normal file
@ -0,0 +1,40 @@
|
||||
@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS")
|
||||
package tsstdlib
|
||||
|
||||
import kotlin.js.*
|
||||
import org.khronos.webgl.*
|
||||
import org.w3c.dom.*
|
||||
import org.w3c.dom.events.*
|
||||
import org.w3c.dom.parsing.*
|
||||
import org.w3c.dom.svg.*
|
||||
import org.w3c.dom.url.*
|
||||
import org.w3c.fetch.*
|
||||
import org.w3c.files.*
|
||||
import org.w3c.notifications.*
|
||||
import org.w3c.performance.*
|
||||
import org.w3c.workers.*
|
||||
import org.w3c.xhr.*
|
||||
|
||||
external interface IteratorYieldResult<TYield> {
|
||||
var done: Boolean?
|
||||
get() = definedExternally
|
||||
set(value) = definedExternally
|
||||
var value: TYield
|
||||
}
|
||||
|
||||
external interface IteratorReturnResult<TReturn> {
|
||||
var done: Boolean
|
||||
var value: TReturn
|
||||
}
|
||||
|
||||
external interface Iterator<T, TReturn, TNext> {
|
||||
fun next(vararg args: Any /* JsTuple<> | JsTuple<TNext> */): dynamic /* IteratorYieldResult<T> | IteratorReturnResult<TReturn> */
|
||||
val `return`: ((value: TReturn) -> dynamic)?
|
||||
val `throw`: ((e: Any) -> dynamic)?
|
||||
}
|
||||
|
||||
typealias Iterator__1<T> = Iterator<T, Any, Nothing?>
|
||||
|
||||
external interface Iterable<T>
|
||||
|
||||
external interface IterableIterator<T> : Iterator__1<T>
|
86
kmath-ast/src/jsMain/kotlin/lib.es5.kt
Normal file
86
kmath-ast/src/jsMain/kotlin/lib.es5.kt
Normal file
@ -0,0 +1,86 @@
|
||||
@file:Suppress(
|
||||
"INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS",
|
||||
"NO_EXPLICIT_VISIBILITY_IN_API_MODE_WARNING", "DEPRECATION", "PackageDirectoryMismatch", "KDocMissingDocumentation",
|
||||
"PropertyName"
|
||||
)
|
||||
|
||||
package tsstdlib
|
||||
|
||||
import kotlin.js.RegExp
|
||||
|
||||
typealias RegExpMatchArray = Array<String>
|
||||
|
||||
typealias RegExpExecArray = Array<String>
|
||||
|
||||
external interface RegExpConstructor {
|
||||
@nativeInvoke
|
||||
operator fun invoke(pattern: RegExp, flags: String = definedExternally): RegExp
|
||||
|
||||
@nativeInvoke
|
||||
operator fun invoke(pattern: RegExp): RegExp
|
||||
|
||||
@nativeInvoke
|
||||
operator fun invoke(pattern: String, flags: String = definedExternally): RegExp
|
||||
|
||||
@nativeInvoke
|
||||
operator fun invoke(pattern: String): RegExp
|
||||
var prototype: RegExp
|
||||
var `$1`: String
|
||||
var `$2`: String
|
||||
var `$3`: String
|
||||
var `$4`: String
|
||||
var `$5`: String
|
||||
var `$6`: String
|
||||
var `$7`: String
|
||||
var `$8`: String
|
||||
var `$9`: String
|
||||
var lastMatch: String
|
||||
}
|
||||
|
||||
external interface ConcatArray<T> {
|
||||
var length: Number
|
||||
|
||||
@nativeGetter
|
||||
operator fun get(n: Number): T?
|
||||
|
||||
@nativeSetter
|
||||
operator fun set(n: Number, value: T)
|
||||
fun join(separator: String = definedExternally): String
|
||||
fun slice(start: Number = definedExternally, end: Number = definedExternally): Array<T>
|
||||
}
|
||||
|
||||
external interface ArrayConstructor {
|
||||
fun <T> from(iterable: Iterable<T>): Array<T>
|
||||
fun <T> from(iterable: ArrayLike<T>): Array<T>
|
||||
fun <T, U> from(iterable: Iterable<T>, mapfn: (v: T, k: Number) -> U, thisArg: Any = definedExternally): Array<U>
|
||||
fun <T, U> from(iterable: Iterable<T>, mapfn: (v: T, k: Number) -> U): Array<U>
|
||||
fun <T, U> from(iterable: ArrayLike<T>, mapfn: (v: T, k: Number) -> U, thisArg: Any = definedExternally): Array<U>
|
||||
fun <T, U> from(iterable: ArrayLike<T>, mapfn: (v: T, k: Number) -> U): Array<U>
|
||||
fun <T> of(vararg items: T): Array<T>
|
||||
|
||||
@nativeInvoke
|
||||
operator fun invoke(arrayLength: Number = definedExternally): Array<Any>
|
||||
|
||||
@nativeInvoke
|
||||
operator fun invoke(): Array<Any>
|
||||
|
||||
@nativeInvoke
|
||||
operator fun <T> invoke(arrayLength: Number): Array<T>
|
||||
|
||||
@nativeInvoke
|
||||
operator fun <T> invoke(vararg items: T): Array<T>
|
||||
fun isArray(arg: Any): Boolean
|
||||
var prototype: Array<Any>
|
||||
}
|
||||
|
||||
external interface ArrayLike<T> {
|
||||
var length: Number
|
||||
|
||||
@nativeGetter
|
||||
operator fun get(n: Number): T?
|
||||
|
||||
@nativeSetter
|
||||
operator fun set(n: Number, value: T)
|
||||
}
|
||||
|
||||
typealias Extract<T, U> = Any
|
5
kmath-ast/src/jsMain/kotlin/stream.d.ts
vendored
Normal file
5
kmath-ast/src/jsMain/kotlin/stream.d.ts
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
import {Emitter} from 'emitter'
|
||||
|
||||
export class Stream extends Emitter {
|
||||
pipe(dest: any, options: any): any
|
||||
}
|
9
kmath-ast/src/jsMain/kotlin/stream.kt
Normal file
9
kmath-ast/src/jsMain/kotlin/stream.kt
Normal file
@ -0,0 +1,9 @@
|
||||
@file:Suppress(
|
||||
"INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS",
|
||||
"NO_EXPLICIT_VISIBILITY_IN_API_MODE_WARNING", "NO_EXPLICIT_VISIBILITY_IN_API_MODE_WARNING", "SortModifiers",
|
||||
"KDocMissingDocumentation"
|
||||
)
|
||||
|
||||
external open class Stream : Emitter {
|
||||
open fun pipe(dest: Any, options: Any): Any
|
||||
}
|
Loading…
Reference in New Issue
Block a user