sval 0.6.3 → 0.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,27 @@
1
+ import { VarKind } from '../scope/variable.ts';
2
+ import { default as Scope } from '../scope/index.ts';
3
+ import * as acorn from 'acorn';
4
+ export declare function FunctionDeclaration(node: acorn.FunctionDeclaration, scope: Scope): IterableIterator<any>;
5
+ export interface VariableDeclarationOptions {
6
+ hoist?: boolean;
7
+ onlyBlock?: boolean;
8
+ feed?: any;
9
+ }
10
+ export declare function VariableDeclaration(node: acorn.VariableDeclaration, scope: Scope, options?: VariableDeclarationOptions): Generator<any, void, any>;
11
+ export interface VariableDeclaratorOptions {
12
+ kind?: VarKind;
13
+ }
14
+ export declare function VariableDeclarator(node: acorn.VariableDeclarator, scope: Scope, options?: VariableDeclaratorOptions & VariableDeclarationOptions): Generator<any, void, any>;
15
+ export declare function ClassDeclaration(node: acorn.ClassDeclaration, scope: Scope): IterableIterator<any>;
16
+ export interface ClassOptions {
17
+ klass?: any;
18
+ superClass?: (...args: any[]) => void;
19
+ }
20
+ export declare function ClassBody(node: acorn.ClassBody, scope: Scope, options?: ClassOptions): Generator<any, void, any>;
21
+ export declare function MethodDefinition(node: acorn.MethodDefinition, scope: Scope, options?: ClassOptions): Generator<any, void, any>;
22
+ export declare function PropertyDefinition(node: acorn.PropertyDefinition, scope: Scope, options?: ClassOptions): Generator<any, void, any>;
23
+ export declare function StaticBlock(node: acorn.StaticBlock, scope: Scope, options?: ClassOptions): Generator<any, any, any>;
24
+ export declare function ImportDeclaration(node: acorn.ImportDeclaration, scope: Scope): Generator<never, void, unknown>;
25
+ export declare function ExportDefaultDeclaration(node: acorn.ExportDefaultDeclaration, scope: Scope): Generator<any, void, any>;
26
+ export declare function ExportNamedDeclaration(node: acorn.ExportNamedDeclaration, scope: Scope): Generator<any, void, any>;
27
+ export declare function ExportAllDeclaration(node: acorn.ExportAllDeclaration, scope: Scope): Generator<never, void, unknown>;
@@ -0,0 +1,40 @@
1
+ import { default as Scope } from '../scope/index.ts';
2
+ import * as acorn from 'acorn';
3
+ export declare function ThisExpression(node: acorn.ThisExpression, scope: Scope): Generator<never, any, unknown>;
4
+ export declare function ArrayExpression(node: acorn.ArrayExpression, scope: Scope): Generator<any, any[], any>;
5
+ export declare function ObjectExpression(node: acorn.ObjectExpression, scope: Scope): Generator<any, {
6
+ [key: string]: any;
7
+ }, any>;
8
+ export declare function FunctionExpression(node: acorn.FunctionExpression, scope: Scope): Generator<never, any, unknown>;
9
+ export declare function UnaryExpression(node: acorn.UnaryExpression, scope: Scope): Generator<any, number | boolean | "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function", any>;
10
+ export declare function UpdateExpression(node: acorn.UpdateExpression, scope: Scope): Generator<any, any, any>;
11
+ export declare function BinaryExpression(node: acorn.BinaryExpression, scope: Scope): Generator<any, any, any>;
12
+ export declare function AssignmentExpression(node: acorn.AssignmentExpression, scope: Scope): Generator<any, any, any>;
13
+ export declare function LogicalExpression(node: acorn.LogicalExpression, scope: Scope): Generator<any, any, any>;
14
+ export interface MemberExpressionOptions {
15
+ getObj?: boolean;
16
+ getVar?: boolean;
17
+ }
18
+ export declare function MemberExpression(node: acorn.MemberExpression, scope: Scope, options?: MemberExpressionOptions): Generator<any, any, any>;
19
+ export declare function ConditionalExpression(node: acorn.ConditionalExpression, scope: Scope): Generator<any, any, any>;
20
+ export declare function CallExpression(node: acorn.CallExpression, scope: Scope): Generator<any, any, any>;
21
+ export declare function NewExpression(node: acorn.NewExpression, scope: Scope): Generator<any, any, any>;
22
+ export declare function MetaProperty(node: acorn.MetaProperty, scope: Scope): Generator<never, any, unknown>;
23
+ export declare function SequenceExpression(node: acorn.SequenceExpression, scope: Scope): Generator<any, any, any>;
24
+ export declare function ArrowFunctionExpression(node: acorn.ArrowFunctionExpression, scope: Scope): Generator<never, any, unknown>;
25
+ export declare function TemplateLiteral(node: acorn.TemplateLiteral, scope: Scope): Generator<any, string, any>;
26
+ export declare function TaggedTemplateExpression(node: acorn.TaggedTemplateExpression, scope: Scope): Generator<any, any, any>;
27
+ export declare function TemplateElement(node: acorn.TemplateElement, scope: Scope): Generator<never, string, unknown>;
28
+ export declare function ClassExpression(node: acorn.ClassExpression, scope: Scope): Generator<any, () => Generator<any, any, any>, any>;
29
+ export interface SuperOptions {
30
+ getProto?: boolean;
31
+ }
32
+ export declare function Super(node: acorn.Super, scope: Scope, options?: SuperOptions): Generator<never, any, unknown>;
33
+ export interface SpreadOptions {
34
+ spreadProps?: boolean;
35
+ }
36
+ export declare function SpreadElement(node: acorn.SpreadElement, scope: Scope, options?: SpreadOptions): Generator<any, any, any>;
37
+ export declare function ChainExpression(node: acorn.ChainExpression, scope: Scope): Generator<any, any, any>;
38
+ export declare function ImportExpression(node: acorn.ImportExpression, scope: Scope): Generator<any, Promise<any>, any>;
39
+ export declare function YieldExpression(node: acorn.YieldExpression, scope: Scope): any;
40
+ export declare function AwaitExpression(node: acorn.AwaitExpression, scope: Scope): any;
@@ -0,0 +1,18 @@
1
+ import { default as Scope } from '../scope/index.ts';
2
+ import { PatternOptions } from './pattern.ts';
3
+ import * as acorn from 'acorn';
4
+ export interface hoistOptions {
5
+ onlyBlock?: boolean;
6
+ }
7
+ export declare function hoist(block: acorn.Program | acorn.BlockStatement | acorn.StaticBlock, scope: Scope, options?: hoistOptions): Generator<any, void, any>;
8
+ export declare function pattern(node: acorn.Pattern, scope: Scope, options?: PatternOptions): IterableIterator<any>;
9
+ export interface CtorOptions {
10
+ construct?: (object: any) => Generator | void;
11
+ superClass?: (...args: any[]) => any;
12
+ }
13
+ export declare function createFunc(node: acorn.FunctionDeclaration | acorn.FunctionExpression | acorn.ArrowFunctionExpression, scope: Scope, options?: CtorOptions): any;
14
+ export declare function createClass(node: acorn.ClassDeclaration | acorn.ClassExpression, scope: Scope): Generator<any, () => Generator<any, any, any>, any>;
15
+ export interface ForXHandlerOptions {
16
+ value: any;
17
+ }
18
+ export declare function ForXHandler(node: acorn.ForInStatement | acorn.ForOfStatement, scope: Scope, options: ForXHandlerOptions): Generator<any, any, any>;
@@ -0,0 +1,7 @@
1
+ import { default as Scope } from '../scope/index.ts';
2
+ import * as acorn from 'acorn';
3
+ export interface IdentifierOptions {
4
+ getVar?: boolean;
5
+ throwErr?: boolean;
6
+ }
7
+ export declare function Identifier(node: acorn.Identifier, scope: Scope, options?: IdentifierOptions): Generator<never, any, unknown>;
@@ -0,0 +1,3 @@
1
+ import { Node } from 'acorn';
2
+ import { default as Scope } from '../scope/index.ts';
3
+ export default function evaluate(node: Node, scope: Scope): Generator<any, any, any>;
@@ -0,0 +1,3 @@
1
+ import { default as Scope } from '../scope/index.ts';
2
+ import * as acorn from 'acorn';
3
+ export declare function Literal(node: acorn.Literal, scope: Scope): Generator<never, string | number | bigint | boolean | RegExp, unknown>;
@@ -0,0 +1,13 @@
1
+ import { VarKind } from '../scope/variable.ts';
2
+ import { default as Scope } from '../scope/index.ts';
3
+ import * as acorn from 'acorn';
4
+ export interface PatternOptions {
5
+ kind?: VarKind;
6
+ hoist?: boolean;
7
+ onlyBlock?: boolean;
8
+ feed?: any;
9
+ }
10
+ export declare function ObjectPattern(node: acorn.ObjectPattern, scope: Scope, options?: PatternOptions): Generator<any, void, any>;
11
+ export declare function ArrayPattern(node: acorn.ArrayPattern, scope: Scope, options?: PatternOptions): Generator<any, any[], any>;
12
+ export declare function RestElement(node: acorn.RestElement, scope: Scope, options?: PatternOptions): Generator<any, void, any>;
13
+ export declare function AssignmentPattern(node: acorn.AssignmentPattern, scope: Scope, options?: PatternOptions): Generator<any, void, any>;
@@ -0,0 +1,3 @@
1
+ import { default as Scope } from '../scope/index.ts';
2
+ import * as acorn from 'acorn';
3
+ export declare function Program(program: acorn.Program, scope: Scope): Generator<any, void, any>;
@@ -0,0 +1,35 @@
1
+ import { default as Scope } from '../scope/index.ts';
2
+ import * as acorn from 'acorn';
3
+ export declare function ExpressionStatement(node: acorn.ExpressionStatement, scope: Scope): Generator<any, void, any>;
4
+ export interface LabelOptions {
5
+ label?: string;
6
+ }
7
+ export interface BlockOptions {
8
+ invasived?: boolean;
9
+ hoisted?: boolean;
10
+ }
11
+ export declare function BlockStatement(block: acorn.BlockStatement | acorn.StaticBlock, scope: Scope, options?: BlockOptions & LabelOptions): Generator<any, any, any>;
12
+ export declare function EmptyStatement(): IterableIterator<any>;
13
+ export declare function DebuggerStatement(): IterableIterator<any>;
14
+ export declare function ReturnStatement(node: acorn.ReturnStatement, scope: Scope): Generator<any, {
15
+ RES: any;
16
+ }, any>;
17
+ export declare function BreakStatement(node: acorn.BreakStatement): Generator<never, {
18
+ LABEL: string;
19
+ }, unknown>;
20
+ export declare function ContinueStatement(node: acorn.ContinueStatement): Generator<never, {
21
+ LABEL: string;
22
+ }, unknown>;
23
+ export declare function LabeledStatement(node: acorn.LabeledStatement, scope: Scope): Generator<any, any, any>;
24
+ export declare function WithStatement(node: acorn.WithStatement, scope: Scope, options?: LabelOptions): Generator<any, any, any>;
25
+ export declare function IfStatement(node: acorn.IfStatement, scope: Scope, options?: LabelOptions): Generator<any, any, any>;
26
+ export declare function SwitchStatement(node: acorn.SwitchStatement, scope: Scope, options?: LabelOptions): Generator<any, any, any>;
27
+ export declare function SwitchCase(node: acorn.SwitchCase, scope: Scope): Generator<any, any, any>;
28
+ export declare function ThrowStatement(node: acorn.ThrowStatement, scope: Scope): Generator<any, void, any>;
29
+ export declare function TryStatement(node: acorn.TryStatement, scope: Scope, options?: LabelOptions): Generator<any, any, any>;
30
+ export declare function CatchClause(node: acorn.CatchClause, scope: Scope): Generator<any, any, any>;
31
+ export declare function WhileStatement(node: acorn.WhileStatement, scope: Scope, options?: LabelOptions): Generator<any, any, any>;
32
+ export declare function DoWhileStatement(node: acorn.DoWhileStatement, scope: Scope, options?: LabelOptions): Generator<any, any, any>;
33
+ export declare function ForStatement(node: acorn.ForStatement, scope: Scope, options?: LabelOptions): Generator<any, any, any>;
34
+ export declare function ForInStatement(node: acorn.ForInStatement, scope: Scope, options?: LabelOptions): Generator<any, any, any>;
35
+ export declare function ForOfStatement(node: acorn.ForOfStatement, scope: Scope, options?: LabelOptions): any;
@@ -0,0 +1,27 @@
1
+ import { VarKind } from '../scope/variable.ts';
2
+ import { default as Scope } from '../scope/index.ts';
3
+ import * as acorn from 'acorn';
4
+ export declare function FunctionDeclaration(node: acorn.FunctionDeclaration, scope: Scope): any;
5
+ export interface VariableDeclarationOptions {
6
+ hoist?: boolean;
7
+ onlyBlock?: boolean;
8
+ feed?: any;
9
+ }
10
+ export declare function VariableDeclaration(node: acorn.VariableDeclaration, scope: Scope, options?: VariableDeclarationOptions): void;
11
+ export interface VariableDeclaratorOptions {
12
+ kind?: VarKind;
13
+ }
14
+ export declare function VariableDeclarator(node: acorn.VariableDeclarator, scope: Scope, options?: VariableDeclaratorOptions & VariableDeclarationOptions): void;
15
+ export declare function ClassDeclaration(node: acorn.ClassDeclaration, scope: Scope): any;
16
+ export interface ClassOptions {
17
+ klass?: any;
18
+ superClass?: (...args: any[]) => void;
19
+ }
20
+ export declare function ClassBody(node: acorn.ClassBody, scope: Scope, options?: ClassOptions): void;
21
+ export declare function MethodDefinition(node: acorn.MethodDefinition, scope: Scope, options?: ClassOptions): void;
22
+ export declare function PropertyDefinition(node: acorn.PropertyDefinition, scope: Scope, options?: ClassOptions): void;
23
+ export declare function StaticBlock(node: acorn.StaticBlock, scope: Scope, options?: ClassOptions): any;
24
+ export declare function ImportDeclaration(node: acorn.ImportDeclaration, scope: Scope): void;
25
+ export declare function ExportDefaultDeclaration(node: acorn.ExportDefaultDeclaration, scope: Scope): void;
26
+ export declare function ExportNamedDeclaration(node: acorn.ExportNamedDeclaration, scope: Scope): void;
27
+ export declare function ExportAllDeclaration(node: acorn.ExportAllDeclaration, scope: Scope): void;
@@ -0,0 +1,38 @@
1
+ import { default as Scope } from '../scope/index.ts';
2
+ import * as acorn from 'acorn';
3
+ export declare function ThisExpression(node: acorn.ThisExpression, scope: Scope): any;
4
+ export declare function ArrayExpression(node: acorn.ArrayExpression, scope: Scope): any[];
5
+ export declare function ObjectExpression(node: acorn.ObjectExpression, scope: Scope): {
6
+ [key: string]: any;
7
+ };
8
+ export declare function FunctionExpression(node: acorn.FunctionExpression, scope: Scope): any;
9
+ export declare function UnaryExpression(node: acorn.UnaryExpression, scope: Scope): number | boolean | "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function";
10
+ export declare function UpdateExpression(node: acorn.UpdateExpression, scope: Scope): any;
11
+ export declare function BinaryExpression(node: acorn.BinaryExpression, scope: Scope): any;
12
+ export declare function AssignmentExpression(node: acorn.AssignmentExpression, scope: Scope): any;
13
+ export declare function LogicalExpression(node: acorn.LogicalExpression, scope: Scope): any;
14
+ export interface MemberExpressionOptions {
15
+ getObj?: boolean;
16
+ getVar?: boolean;
17
+ }
18
+ export declare function MemberExpression(node: acorn.MemberExpression, scope: Scope, options?: MemberExpressionOptions): any;
19
+ export declare function ConditionalExpression(node: acorn.ConditionalExpression, scope: Scope): any;
20
+ export declare function CallExpression(node: acorn.CallExpression, scope: Scope): any;
21
+ export declare function NewExpression(node: acorn.NewExpression, scope: Scope): any;
22
+ export declare function MetaProperty(node: acorn.MetaProperty, scope: Scope): any;
23
+ export declare function SequenceExpression(node: acorn.SequenceExpression, scope: Scope): any;
24
+ export declare function ArrowFunctionExpression(node: acorn.ArrowFunctionExpression, scope: Scope): any;
25
+ export declare function TemplateLiteral(node: acorn.TemplateLiteral, scope: Scope): string;
26
+ export declare function TaggedTemplateExpression(node: acorn.TaggedTemplateExpression, scope: Scope): any;
27
+ export declare function TemplateElement(node: acorn.TemplateElement, scope: Scope): string;
28
+ export declare function ClassExpression(node: acorn.ClassExpression, scope: Scope): () => any;
29
+ export interface SuperOptions {
30
+ getProto?: boolean;
31
+ }
32
+ export declare function Super(node: acorn.Super, scope: Scope, options?: SuperOptions): any;
33
+ export interface SpreadOptions {
34
+ spreadProps?: boolean;
35
+ }
36
+ export declare function SpreadElement(node: acorn.SpreadElement, scope: Scope, options?: SpreadOptions): any;
37
+ export declare function ChainExpression(node: acorn.ChainExpression, scope: Scope): any;
38
+ export declare function ImportExpression(node: acorn.ImportExpression, scope: Scope): Promise<any>;
@@ -0,0 +1,18 @@
1
+ import { default as Scope } from '../scope/index.ts';
2
+ import { PatternOptions } from './pattern.ts';
3
+ import * as acorn from 'acorn';
4
+ export interface hoistOptions {
5
+ onlyBlock?: boolean;
6
+ }
7
+ export declare function hoist(block: acorn.Program | acorn.BlockStatement | acorn.StaticBlock, scope: Scope, options?: hoistOptions): void;
8
+ export declare function pattern(node: acorn.Pattern, scope: Scope, options?: PatternOptions): any;
9
+ export interface CtorOptions {
10
+ construct?: (object: any) => Generator | void;
11
+ superClass?: (...args: any[]) => any;
12
+ }
13
+ export declare function createFunc(node: acorn.FunctionDeclaration | acorn.FunctionExpression | acorn.ArrowFunctionExpression, scope: Scope, options?: CtorOptions): any;
14
+ export declare function createClass(node: acorn.ClassDeclaration | acorn.ClassExpression, scope: Scope): () => any;
15
+ export interface ForXHandlerOptions {
16
+ value: any;
17
+ }
18
+ export declare function ForXHandler(node: acorn.ForInStatement | acorn.ForOfStatement, scope: Scope, options: ForXHandlerOptions): any;
@@ -0,0 +1,7 @@
1
+ import { default as Scope } from '../scope/index.ts';
2
+ import * as acorn from 'acorn';
3
+ export interface IdentifierOptions {
4
+ getVar?: boolean;
5
+ throwErr?: boolean;
6
+ }
7
+ export declare function Identifier(node: acorn.Identifier, scope: Scope, options?: IdentifierOptions): any;
@@ -0,0 +1,3 @@
1
+ import { Node } from 'acorn';
2
+ import { default as Scope } from '../scope/index.ts';
3
+ export default function evaluate(node: Node, scope: Scope): any;
@@ -0,0 +1,3 @@
1
+ import { default as Scope } from '../scope/index.ts';
2
+ import * as acorn from 'acorn';
3
+ export declare function Literal(node: acorn.Literal, scope: Scope): string | number | bigint | boolean | RegExp;
@@ -0,0 +1,13 @@
1
+ import { VarKind } from '../scope/variable.ts';
2
+ import { default as Scope } from '../scope/index.ts';
3
+ import * as acorn from 'acorn';
4
+ export interface PatternOptions {
5
+ kind?: VarKind;
6
+ hoist?: boolean;
7
+ onlyBlock?: boolean;
8
+ feed?: any;
9
+ }
10
+ export declare function ObjectPattern(node: acorn.ObjectPattern, scope: Scope, options?: PatternOptions): void;
11
+ export declare function ArrayPattern(node: acorn.ArrayPattern, scope: Scope, options?: PatternOptions): any[];
12
+ export declare function RestElement(node: acorn.RestElement, scope: Scope, options?: PatternOptions): void;
13
+ export declare function AssignmentPattern(node: acorn.AssignmentPattern, scope: Scope, options?: PatternOptions): void;
@@ -0,0 +1,3 @@
1
+ import { default as Scope } from '../scope/index.ts';
2
+ import * as acorn from 'acorn';
3
+ export declare function Program(program: acorn.Program, scope: Scope): void;
@@ -0,0 +1,35 @@
1
+ import { default as Scope } from '../scope/index.ts';
2
+ import * as acorn from 'acorn';
3
+ export declare function ExpressionStatement(node: acorn.ExpressionStatement, scope: Scope): void;
4
+ export interface LabelOptions {
5
+ label?: string;
6
+ }
7
+ export interface BlockOptions {
8
+ invasived?: boolean;
9
+ hoisted?: boolean;
10
+ }
11
+ export declare function BlockStatement(block: acorn.BlockStatement | acorn.StaticBlock, scope: Scope, options?: BlockOptions & LabelOptions): any;
12
+ export declare function EmptyStatement(): any;
13
+ export declare function DebuggerStatement(): any;
14
+ export declare function ReturnStatement(node: acorn.ReturnStatement, scope: Scope): {
15
+ RES: any;
16
+ };
17
+ export declare function BreakStatement(node: acorn.BreakStatement): {
18
+ LABEL: string;
19
+ };
20
+ export declare function ContinueStatement(node: acorn.ContinueStatement): {
21
+ LABEL: string;
22
+ };
23
+ export declare function LabeledStatement(node: acorn.LabeledStatement, scope: Scope): any;
24
+ export declare function WithStatement(node: acorn.WithStatement, scope: Scope, options?: LabelOptions): any;
25
+ export declare function IfStatement(node: acorn.IfStatement, scope: Scope, options?: LabelOptions): any;
26
+ export declare function SwitchStatement(node: acorn.SwitchStatement, scope: Scope, options?: LabelOptions): any;
27
+ export declare function SwitchCase(node: acorn.SwitchCase, scope: Scope): any;
28
+ export declare function ThrowStatement(node: acorn.ThrowStatement, scope: Scope): void;
29
+ export declare function TryStatement(node: acorn.TryStatement, scope: Scope, options?: LabelOptions): any;
30
+ export declare function CatchClause(node: acorn.CatchClause, scope: Scope): any;
31
+ export declare function WhileStatement(node: acorn.WhileStatement, scope: Scope, options?: LabelOptions): any;
32
+ export declare function DoWhileStatement(node: acorn.DoWhileStatement, scope: Scope, options?: LabelOptions): any;
33
+ export declare function ForStatement(node: acorn.ForStatement, scope: Scope, options?: LabelOptions): any;
34
+ export declare function ForInStatement(node: acorn.ForInStatement, scope: Scope, options?: LabelOptions): any;
35
+ export declare function ForOfStatement(node: acorn.ForOfStatement, scope: Scope, options?: LabelOptions): any;
@@ -1,17 +1,17 @@
1
- import { Options, Node } from 'acorn';
2
- export interface SvalOptions {
3
- ecmaVer?: Options['ecmaVersion'];
4
- sourceType?: Options['sourceType'];
5
- sandBox?: boolean;
6
- }
7
- declare class Sval {
8
- static version: string;
9
- private options;
10
- private scope;
11
- exports: Record<string, any>;
12
- constructor(options?: SvalOptions);
13
- import(nameOrModules: string | Record<string, any>, mod?: any): void;
14
- parse(code: string, parser?: (code: string, options: SvalOptions) => Node): Node;
15
- run(code: string | Node): void;
16
- }
17
- export default Sval;
1
+ import { Options, Node } from 'acorn';
2
+ export interface SvalOptions {
3
+ ecmaVer?: Options['ecmaVersion'];
4
+ sourceType?: Options['sourceType'];
5
+ sandBox?: boolean;
6
+ }
7
+ declare class Sval {
8
+ static version: string;
9
+ private options;
10
+ private scope;
11
+ exports: Record<string, any>;
12
+ constructor(options?: SvalOptions);
13
+ import(nameOrModules: string | Record<string, any>, mod?: any): void;
14
+ parse(code: string, parser?: (code: string, options: SvalOptions) => Node): Node;
15
+ run(code: string | Node): void;
16
+ }
17
+ export default Sval;
@@ -0,0 +1,15 @@
1
+ import { Variable } from './variable.ts';
2
+ export default class Scope {
3
+ private readonly parent;
4
+ private readonly isolated;
5
+ private readonly context;
6
+ private withContext;
7
+ constructor(parent?: Scope, isolated?: boolean);
8
+ global(): Scope;
9
+ find(name: string): Variable;
10
+ var(name: string, value?: any): void;
11
+ let(name: string, value: any): void;
12
+ const(name: string, value: any): void;
13
+ func(name: string, value: any): void;
14
+ with(value: any): void;
15
+ }
@@ -0,0 +1,20 @@
1
+ export type VarKind = 'var' | 'let' | 'const';
2
+ export interface Variable {
3
+ get(): any;
4
+ set(value: any): boolean;
5
+ }
6
+ export declare class Var implements Variable {
7
+ readonly kind: VarKind;
8
+ private value;
9
+ constructor(kind: VarKind, value: any);
10
+ get(): any;
11
+ set(value: any): any;
12
+ }
13
+ export declare class Prop implements Variable {
14
+ private readonly object;
15
+ private readonly property;
16
+ constructor(object: any, property: string);
17
+ get(): any;
18
+ set(value: any): boolean;
19
+ del(): boolean;
20
+ }
@@ -0,0 +1,7 @@
1
+ export interface runAsyncOptions {
2
+ res?: any;
3
+ err?: any;
4
+ ret?: any;
5
+ fullRet?: boolean;
6
+ }
7
+ export declare function runAsync(iterator: IterableIterator<any>, options?: runAsyncOptions): Promise<any>;
@@ -0,0 +1,22 @@
1
+ export declare const AWAIT: {
2
+ RES: any;
3
+ };
4
+ export declare const RETURN: {
5
+ RES: any;
6
+ };
7
+ export declare const CONTINUE: {
8
+ LABEL: string;
9
+ };
10
+ export declare const BREAK: {
11
+ LABEL: string;
12
+ };
13
+ export declare const SUPER: string;
14
+ export declare const SUPERCALL: string;
15
+ export declare const NOCTOR: string;
16
+ export declare const CLSCTOR: string;
17
+ export declare const NEWTARGET: string;
18
+ export declare const PRIVATE: string;
19
+ export declare const NOINIT: string;
20
+ export declare const DEADZONE: string;
21
+ export declare const IMPORT: string;
22
+ export declare const EXPORTS: string;
@@ -0,0 +1,33 @@
1
+ export declare const freeze: {
2
+ <T extends Function>(f: T): T;
3
+ <T extends {
4
+ [idx: string]: U | null | undefined | object;
5
+ }, U extends string | bigint | number | boolean | symbol>(o: T): Readonly<T>;
6
+ <T>(o: T): Readonly<T>;
7
+ };
8
+ export declare const define: <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T;
9
+ export declare const getDptor: (o: any, p: PropertyKey) => PropertyDescriptor | undefined;
10
+ export declare function hasOwn(obj: any, key: string): boolean;
11
+ export declare const getOwnNames: (o: any) => string[];
12
+ export declare function setProto(obj: any, proto: any): void;
13
+ export declare function getProto(obj: any): any;
14
+ export declare function getGetter(obj: any, key: string): (() => any) | ((v: any) => void);
15
+ export declare function getSetter(obj: any, key: string): (() => any) | ((v: any) => void);
16
+ export declare const create: {
17
+ (o: object | null): any;
18
+ (o: object | null, properties: PropertyDescriptorMap & ThisType<any>): any;
19
+ };
20
+ export declare function inherits(subClass: (...args: any[]) => any, superClass: (...args: any[]) => any): void;
21
+ export declare function callSuper(target: any, superClass: (...args: any[]) => any, args?: any[]): any;
22
+ export declare function _assign(target: any): any;
23
+ export declare const assign: {
24
+ <T extends {}, U>(target: T, source: U): T & U;
25
+ <T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V;
26
+ <T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
27
+ (target: object, ...sources: any[]): any;
28
+ };
29
+ export declare let globalObj: any;
30
+ export declare const WINDOW: string;
31
+ export declare function createSandBox(): any;
32
+ export declare function createSymbol(key: string): string;
33
+ export declare function getAsyncIterator(obj: any): any;