static-injector 4.0.1 → 5.0.0-alpha.0
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.
- package/{import/commonjs → commonjs}/index.js +29 -197
- package/{import/es2022 → es2022}/di/interface/defs.js +5 -1
- package/{import/es2022 → es2022}/index.js +0 -1
- package/{transform/compiler/index.d.ts → es2022/interface/lifecycle_hooks.js} +1 -1
- package/{transform/compiler-cli/src/ngtsc/translator/src/api/ast_factory.js → es2022/render3/definition_factory.js} +3 -2
- package/es2022/util/decorators.js +31 -0
- package/{import/fesm2022 → fesm2022}/index.js +30 -196
- package/package.json +17 -14
- package/readme.md +33 -13
- package/{import/typings → typings}/di/injectable.d.ts +0 -7
- package/{import/typings → typings}/index.d.ts +0 -1
- package/import/es2022/di/injectable.js +0 -14
- package/import/es2022/error_details_base_url.js +0 -19
- package/import/es2022/render3/definition_factory.js +0 -14
- package/import/es2022/render3/di.js +0 -49
- package/import/es2022/render3/error_code.js +0 -30
- package/import/es2022/util/array_utils.js +0 -17
- package/import/es2022/util/decorators.js +0 -53
- package/import/typings/error_details_base_url.d.ts +0 -19
- package/import/typings/render3/di.d.ts +0 -12
- package/import/typings/render3/error_code.d.ts +0 -24
- package/import/typings/util/array_utils.d.ts +0 -25
- package/transform/compiler/compiler.d.ts +0 -8
- package/transform/compiler/compiler.js +0 -28
- package/transform/compiler/index.js +0 -28
- package/transform/compiler/public_api.d.ts +0 -13
- package/transform/compiler/public_api.js +0 -30
- package/transform/compiler/src/compiler.d.ts +0 -5
- package/transform/compiler/src/compiler.js +0 -21
- package/transform/compiler/src/core.d.ts +0 -25
- package/transform/compiler/src/core.js +0 -22
- package/transform/compiler/src/injectable_compiler_2.d.ts +0 -23
- package/transform/compiler/src/injectable_compiler_2.js +0 -171
- package/transform/compiler/src/output/output_ast.d.ts +0 -512
- package/transform/compiler/src/output/output_ast.js +0 -1109
- package/transform/compiler/src/parse_util.d.ts +0 -50
- package/transform/compiler/src/parse_util.js +0 -71
- package/transform/compiler/src/render3/partial/api.d.ts +0 -171
- package/transform/compiler/src/render3/partial/api.js +0 -18
- package/transform/compiler/src/render3/r3_factory.d.ts +0 -82
- package/transform/compiler/src/render3/r3_factory.js +0 -225
- package/transform/compiler/src/render3/r3_identifiers.d.ts +0 -20
- package/transform/compiler/src/render3/r3_identifiers.js +0 -55
- package/transform/compiler/src/render3/util.d.ts +0 -85
- package/transform/compiler/src/render3/util.js +0 -82
- package/transform/compiler/src/render3/view/util.d.ts +0 -24
- package/transform/compiler/src/render3/view/util.js +0 -59
- package/transform/compiler-cli/src/ngtsc/annotations/common/index.d.ts +0 -3
- package/transform/compiler-cli/src/ngtsc/annotations/common/index.js +0 -19
- package/transform/compiler-cli/src/ngtsc/annotations/common/src/di.d.ts +0 -37
- package/transform/compiler-cli/src/ngtsc/annotations/common/src/di.js +0 -195
- package/transform/compiler-cli/src/ngtsc/annotations/common/src/factory.d.ts +0 -11
- package/transform/compiler-cli/src/ngtsc/annotations/common/src/factory.js +0 -22
- package/transform/compiler-cli/src/ngtsc/annotations/common/src/util.d.ts +0 -64
- package/transform/compiler-cli/src/ngtsc/annotations/common/src/util.js +0 -189
- package/transform/compiler-cli/src/ngtsc/annotations/src/injectable.d.ts +0 -43
- package/transform/compiler-cli/src/ngtsc/annotations/src/injectable.js +0 -277
- package/transform/compiler-cli/src/ngtsc/diagnostics/error.d.ts +0 -24
- package/transform/compiler-cli/src/ngtsc/diagnostics/error.js +0 -84
- package/transform/compiler-cli/src/ngtsc/diagnostics/error_code.d.ts +0 -188
- package/transform/compiler-cli/src/ngtsc/diagnostics/error_code.js +0 -206
- package/transform/compiler-cli/src/ngtsc/diagnostics/index.d.ts +0 -2
- package/transform/compiler-cli/src/ngtsc/diagnostics/index.js +0 -18
- package/transform/compiler-cli/src/ngtsc/imports/index.d.ts +0 -1
- package/transform/compiler-cli/src/ngtsc/imports/index.js +0 -17
- package/transform/compiler-cli/src/ngtsc/imports/src/core.d.ts +0 -36
- package/transform/compiler-cli/src/ngtsc/imports/src/core.js +0 -25
- package/transform/compiler-cli/src/ngtsc/imports/src/default.d.ts +0 -19
- package/transform/compiler-cli/src/ngtsc/imports/src/default.js +0 -27
- package/transform/compiler-cli/src/ngtsc/reflection/index.d.ts +0 -3
- package/transform/compiler-cli/src/ngtsc/reflection/index.js +0 -19
- package/transform/compiler-cli/src/ngtsc/reflection/src/host.d.ts +0 -522
- package/transform/compiler-cli/src/ngtsc/reflection/src/host.js +0 -34
- package/transform/compiler-cli/src/ngtsc/reflection/src/type_to_value.d.ts +0 -25
- package/transform/compiler-cli/src/ngtsc/reflection/src/type_to_value.js +0 -271
- package/transform/compiler-cli/src/ngtsc/reflection/src/typescript.d.ts +0 -53
- package/transform/compiler-cli/src/ngtsc/reflection/src/typescript.js +0 -393
- package/transform/compiler-cli/src/ngtsc/reflection/src/util.d.ts +0 -12
- package/transform/compiler-cli/src/ngtsc/reflection/src/util.js +0 -29
- package/transform/compiler-cli/src/ngtsc/transform/index.d.ts +0 -2
- package/transform/compiler-cli/src/ngtsc/transform/index.js +0 -18
- package/transform/compiler-cli/src/ngtsc/transform/src/api.d.ts +0 -115
- package/transform/compiler-cli/src/ngtsc/transform/src/api.js +0 -29
- package/transform/compiler-cli/src/ngtsc/transform/src/utils.d.ts +0 -15
- package/transform/compiler-cli/src/ngtsc/transform/src/utils.js +0 -79
- package/transform/compiler-cli/src/ngtsc/translator/index.d.ts +0 -5
- package/transform/compiler-cli/src/ngtsc/translator/index.js +0 -21
- package/transform/compiler-cli/src/ngtsc/translator/src/api/ast_factory.d.ts +0 -289
- package/transform/compiler-cli/src/ngtsc/translator/src/api/import_generator.d.ts +0 -27
- package/transform/compiler-cli/src/ngtsc/translator/src/api/import_generator.js +0 -9
- package/transform/compiler-cli/src/ngtsc/translator/src/context.d.ts +0 -18
- package/transform/compiler-cli/src/ngtsc/translator/src/context.js +0 -28
- package/transform/compiler-cli/src/ngtsc/translator/src/import_manager.d.ts +0 -47
- package/transform/compiler-cli/src/ngtsc/translator/src/import_manager.js +0 -66
- package/transform/compiler-cli/src/ngtsc/translator/src/translator.d.ts +0 -56
- package/transform/compiler-cli/src/ngtsc/translator/src/translator.js +0 -270
- package/transform/compiler-cli/src/ngtsc/translator/src/ts_util.d.ts +0 -12
- package/transform/compiler-cli/src/ngtsc/translator/src/ts_util.js +0 -27
- package/transform/compiler-cli/src/ngtsc/translator/src/typescript_ast_factory.d.ts +0 -53
- package/transform/compiler-cli/src/ngtsc/translator/src/typescript_ast_factory.js +0 -250
- package/transform/compiler-cli/src/ngtsc/translator/src/typescript_translator.d.ts +0 -13
- package/transform/compiler-cli/src/ngtsc/translator/src/typescript_translator.js +0 -21
- package/transform/compiler-cli/src/ngtsc/ts_compatibility/index.d.ts +0 -8
- package/transform/compiler-cli/src/ngtsc/ts_compatibility/index.js +0 -24
- package/transform/compiler-cli/src/ngtsc/ts_compatibility/src/ts_cross_version_utils.d.ts +0 -45
- package/transform/compiler-cli/src/ngtsc/ts_compatibility/src/ts_cross_version_utils.js +0 -86
- package/transform/compiler-cli/src/ngtsc/util/src/typescript.d.ts +0 -4
- package/transform/compiler-cli/src/ngtsc/util/src/typescript.js +0 -16
- package/transform/index.d.ts +0 -1
- package/transform/index.js +0 -17
- package/transform/injectable-transform.d.ts +0 -41
- package/transform/injectable-transform.js +0 -245
- package/transform/node-Iteration.d.ts +0 -2
- package/transform/node-Iteration.js +0 -12
- /package/{import/es2022 → es2022}/di/create_injector.js +0 -0
- /package/{import/es2022 → es2022}/di/forward_ref.js +0 -0
- /package/{import/es2022 → es2022}/di/index.js +0 -0
- /package/{import/es2022 → es2022}/di/initializer_token.js +0 -0
- /package/{import/es2022 → es2022}/di/inject_switch.js +0 -0
- /package/{import/es2022/di/injector_marker.js → es2022/di/injectable.js} +0 -0
- /package/{import/es2022 → es2022}/di/injection_token.js +0 -0
- /package/{import/es2022 → es2022}/di/injector.js +0 -0
- /package/{import/es2022 → es2022}/di/injector_compatibility.js +0 -0
- /package/{import/es2022/di/provider_token.js → es2022/di/injector_marker.js} +0 -0
- /package/{import/es2022 → es2022}/di/injector_token.js +0 -0
- /package/{import/es2022 → es2022}/di/interface/injector.js +0 -0
- /package/{import/es2022 → es2022}/di/interface/provider.js +0 -0
- /package/{import/es2022 → es2022}/di/internal_tokens.js +0 -0
- /package/{import/es2022 → es2022}/di/metadata.js +0 -0
- /package/{import/es2022 → es2022}/di/null_injector.js +0 -0
- /package/{import/es2022 → es2022}/di/provider_collection.js +0 -0
- /package/{import/es2022/interface/lifecycle_hooks.js → es2022/di/provider_token.js} +0 -0
- /package/{import/es2022 → es2022}/di/r3_injector.js +0 -0
- /package/{import/es2022 → es2022}/di/scope.js +0 -0
- /package/{import/es2022 → es2022}/di.js +0 -0
- /package/{import/es2022 → es2022}/errors.js +0 -0
- /package/{import/es2022 → es2022}/interface/type.js +0 -0
- /package/{import/es2022 → es2022}/render3/errors_di.js +0 -0
- /package/{import/es2022 → es2022}/render3/fields.js +0 -0
- /package/{import/es2022 → es2022}/render3/instructions/di.js +0 -0
- /package/{import/es2022 → es2022}/render3/util/stringify_utils.js +0 -0
- /package/{import/es2022 → es2022}/util/closure.js +0 -0
- /package/{import/es2022 → es2022}/util/empty.js +0 -0
- /package/{import/es2022 → es2022}/util/property.js +0 -0
- /package/{import/es2022 → es2022}/util/stringify.js +0 -0
- /package/{import/typings → typings}/di/create_injector.d.ts +0 -0
- /package/{import/typings → typings}/di/forward_ref.d.ts +0 -0
- /package/{import/typings → typings}/di/index.d.ts +0 -0
- /package/{import/typings → typings}/di/initializer_token.d.ts +0 -0
- /package/{import/typings → typings}/di/inject_switch.d.ts +0 -0
- /package/{import/typings → typings}/di/injection_token.d.ts +0 -0
- /package/{import/typings → typings}/di/injector.d.ts +0 -0
- /package/{import/typings → typings}/di/injector_compatibility.d.ts +0 -0
- /package/{import/typings → typings}/di/injector_marker.d.ts +0 -0
- /package/{import/typings → typings}/di/injector_token.d.ts +0 -0
- /package/{import/typings → typings}/di/interface/defs.d.ts +0 -0
- /package/{import/typings → typings}/di/interface/injector.d.ts +0 -0
- /package/{import/typings → typings}/di/interface/provider.d.ts +0 -0
- /package/{import/typings → typings}/di/internal_tokens.d.ts +0 -0
- /package/{import/typings → typings}/di/metadata.d.ts +0 -0
- /package/{import/typings → typings}/di/null_injector.d.ts +0 -0
- /package/{import/typings → typings}/di/provider_collection.d.ts +0 -0
- /package/{import/typings → typings}/di/provider_token.d.ts +0 -0
- /package/{import/typings → typings}/di/r3_injector.d.ts +0 -0
- /package/{import/typings → typings}/di/scope.d.ts +0 -0
- /package/{import/typings → typings}/di.d.ts +0 -0
- /package/{import/typings → typings}/errors.d.ts +0 -0
- /package/{import/typings → typings}/interface/lifecycle_hooks.d.ts +0 -0
- /package/{import/typings → typings}/interface/type.d.ts +0 -0
- /package/{import/typings → typings}/render3/definition_factory.d.ts +0 -0
- /package/{import/typings → typings}/render3/errors_di.d.ts +0 -0
- /package/{import/typings → typings}/render3/fields.d.ts +0 -0
- /package/{import/typings → typings}/render3/instructions/di.d.ts +0 -0
- /package/{import/typings → typings}/render3/util/stringify_utils.d.ts +0 -0
- /package/{import/typings → typings}/util/closure.d.ts +0 -0
- /package/{import/typings → typings}/util/decorators.d.ts +0 -0
- /package/{import/typings → typings}/util/empty.d.ts +0 -0
- /package/{import/typings → typings}/util/property.d.ts +0 -0
- /package/{import/typings → typings}/util/stringify.d.ts +0 -0
|
@@ -1,512 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
8
|
-
import { ParseSourceSpan } from '../parse_util';
|
|
9
|
-
export declare enum TypeModifier {
|
|
10
|
-
None = 0,
|
|
11
|
-
Const = 1
|
|
12
|
-
}
|
|
13
|
-
export declare abstract class Type {
|
|
14
|
-
modifiers: TypeModifier;
|
|
15
|
-
constructor(modifiers?: TypeModifier);
|
|
16
|
-
abstract visitType(visitor: TypeVisitor, context: any): any;
|
|
17
|
-
hasModifier(modifier: TypeModifier): boolean;
|
|
18
|
-
}
|
|
19
|
-
export declare enum BuiltinTypeName {
|
|
20
|
-
Dynamic = 0,
|
|
21
|
-
Bool = 1,
|
|
22
|
-
String = 2,
|
|
23
|
-
Int = 3,
|
|
24
|
-
Number = 4,
|
|
25
|
-
Function = 5,
|
|
26
|
-
Inferred = 6,
|
|
27
|
-
None = 7
|
|
28
|
-
}
|
|
29
|
-
export declare class BuiltinType extends Type {
|
|
30
|
-
name: BuiltinTypeName;
|
|
31
|
-
constructor(name: BuiltinTypeName, modifiers?: TypeModifier);
|
|
32
|
-
visitType(visitor: TypeVisitor, context: any): any;
|
|
33
|
-
}
|
|
34
|
-
export declare class ExpressionType extends Type {
|
|
35
|
-
value: Expression;
|
|
36
|
-
typeParams: Type[] | null;
|
|
37
|
-
constructor(value: Expression, modifiers?: TypeModifier, typeParams?: Type[] | null);
|
|
38
|
-
visitType(visitor: TypeVisitor, context: any): any;
|
|
39
|
-
}
|
|
40
|
-
export declare class ArrayType extends Type {
|
|
41
|
-
of: Type;
|
|
42
|
-
constructor(of: Type, modifiers?: TypeModifier);
|
|
43
|
-
visitType(visitor: TypeVisitor, context: any): any;
|
|
44
|
-
}
|
|
45
|
-
export declare class MapType extends Type {
|
|
46
|
-
valueType: Type | null;
|
|
47
|
-
constructor(valueType: Type | null | undefined, modifiers?: TypeModifier);
|
|
48
|
-
visitType(visitor: TypeVisitor, context: any): any;
|
|
49
|
-
}
|
|
50
|
-
export declare class TransplantedType<T> extends Type {
|
|
51
|
-
readonly type: T;
|
|
52
|
-
constructor(type: T, modifiers?: TypeModifier);
|
|
53
|
-
visitType(visitor: TypeVisitor, context: any): any;
|
|
54
|
-
}
|
|
55
|
-
export declare const DYNAMIC_TYPE: BuiltinType;
|
|
56
|
-
export declare const INFERRED_TYPE: BuiltinType;
|
|
57
|
-
export declare const BOOL_TYPE: BuiltinType;
|
|
58
|
-
export declare const INT_TYPE: BuiltinType;
|
|
59
|
-
export declare const NUMBER_TYPE: BuiltinType;
|
|
60
|
-
export declare const STRING_TYPE: BuiltinType;
|
|
61
|
-
export declare const FUNCTION_TYPE: BuiltinType;
|
|
62
|
-
export declare const NONE_TYPE: BuiltinType;
|
|
63
|
-
export interface TypeVisitor {
|
|
64
|
-
visitBuiltinType(type: BuiltinType, context: any): any;
|
|
65
|
-
visitExpressionType(type: ExpressionType, context: any): any;
|
|
66
|
-
visitArrayType(type: ArrayType, context: any): any;
|
|
67
|
-
visitMapType(type: MapType, context: any): any;
|
|
68
|
-
visitTransplantedType(type: TransplantedType<unknown>, context: any): any;
|
|
69
|
-
}
|
|
70
|
-
export declare enum UnaryOperator {
|
|
71
|
-
Minus = 0,
|
|
72
|
-
Plus = 1
|
|
73
|
-
}
|
|
74
|
-
export declare enum BinaryOperator {
|
|
75
|
-
Equals = 0,
|
|
76
|
-
NotEquals = 1,
|
|
77
|
-
Identical = 2,
|
|
78
|
-
NotIdentical = 3,
|
|
79
|
-
Minus = 4,
|
|
80
|
-
Plus = 5,
|
|
81
|
-
Divide = 6,
|
|
82
|
-
Multiply = 7,
|
|
83
|
-
Modulo = 8,
|
|
84
|
-
And = 9,
|
|
85
|
-
Or = 10,
|
|
86
|
-
BitwiseOr = 11,
|
|
87
|
-
BitwiseAnd = 12,
|
|
88
|
-
Lower = 13,
|
|
89
|
-
LowerEquals = 14,
|
|
90
|
-
Bigger = 15,
|
|
91
|
-
BiggerEquals = 16,
|
|
92
|
-
NullishCoalesce = 17
|
|
93
|
-
}
|
|
94
|
-
export declare function nullSafeIsEquivalent<T extends {
|
|
95
|
-
isEquivalent(other: T): boolean;
|
|
96
|
-
}>(base: T | null, other: T | null): boolean;
|
|
97
|
-
export declare function areAllEquivalent<T extends {
|
|
98
|
-
isEquivalent(other: T): boolean;
|
|
99
|
-
}>(base: T[], other: T[]): boolean;
|
|
100
|
-
export declare abstract class Expression {
|
|
101
|
-
type: Type | null;
|
|
102
|
-
sourceSpan: ParseSourceSpan | null;
|
|
103
|
-
constructor(type: Type | null | undefined, sourceSpan?: ParseSourceSpan | null);
|
|
104
|
-
abstract visitExpression(visitor: ExpressionVisitor, context: any): any;
|
|
105
|
-
/**
|
|
106
|
-
* Calculates whether this expression produces the same value as the given expression.
|
|
107
|
-
* Note: We don't check Types nor ParseSourceSpans nor function arguments.
|
|
108
|
-
*/
|
|
109
|
-
abstract isEquivalent(e: Expression): boolean;
|
|
110
|
-
/**
|
|
111
|
-
* Return true if the expression is constant.
|
|
112
|
-
*/
|
|
113
|
-
abstract isConstant(): boolean;
|
|
114
|
-
abstract clone(): Expression;
|
|
115
|
-
prop(name: string, sourceSpan?: ParseSourceSpan | null): ReadPropExpr;
|
|
116
|
-
key(index: Expression, type?: Type | null, sourceSpan?: ParseSourceSpan | null): ReadKeyExpr;
|
|
117
|
-
callFn(params: Expression[], sourceSpan?: ParseSourceSpan | null, pure?: boolean): InvokeFunctionExpr;
|
|
118
|
-
bitwiseOr(rhs: Expression, sourceSpan?: ParseSourceSpan | null, parens?: boolean): BinaryOperatorExpr;
|
|
119
|
-
toStmt(): Statement;
|
|
120
|
-
}
|
|
121
|
-
export declare class ReadVarExpr extends Expression {
|
|
122
|
-
name: string;
|
|
123
|
-
constructor(name: string, type?: Type | null, sourceSpan?: ParseSourceSpan | null);
|
|
124
|
-
isEquivalent(e: Expression): boolean;
|
|
125
|
-
isConstant(): boolean;
|
|
126
|
-
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
|
127
|
-
clone(): ReadVarExpr;
|
|
128
|
-
set(value: Expression): WriteVarExpr;
|
|
129
|
-
}
|
|
130
|
-
export declare class TypeofExpr extends Expression {
|
|
131
|
-
expr: Expression;
|
|
132
|
-
constructor(expr: Expression, type?: Type | null, sourceSpan?: ParseSourceSpan | null);
|
|
133
|
-
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
|
134
|
-
isEquivalent(e: Expression): boolean;
|
|
135
|
-
isConstant(): boolean;
|
|
136
|
-
clone(): TypeofExpr;
|
|
137
|
-
}
|
|
138
|
-
export declare class WrappedNodeExpr<T> extends Expression {
|
|
139
|
-
node: T;
|
|
140
|
-
constructor(node: T, type?: Type | null, sourceSpan?: ParseSourceSpan | null);
|
|
141
|
-
isEquivalent(e: Expression): boolean;
|
|
142
|
-
isConstant(): boolean;
|
|
143
|
-
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
|
144
|
-
clone(): WrappedNodeExpr<T>;
|
|
145
|
-
}
|
|
146
|
-
export declare class WriteVarExpr extends Expression {
|
|
147
|
-
name: string;
|
|
148
|
-
value: Expression;
|
|
149
|
-
constructor(name: string, value: Expression, type?: Type | null, sourceSpan?: ParseSourceSpan | null);
|
|
150
|
-
isEquivalent(e: Expression): boolean;
|
|
151
|
-
isConstant(): boolean;
|
|
152
|
-
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
|
153
|
-
clone(): WriteVarExpr;
|
|
154
|
-
toDeclStmt(type?: Type | null, modifiers?: StmtModifier): DeclareVarStmt;
|
|
155
|
-
toConstDecl(): DeclareVarStmt;
|
|
156
|
-
}
|
|
157
|
-
export declare class WriteKeyExpr extends Expression {
|
|
158
|
-
receiver: Expression;
|
|
159
|
-
index: Expression;
|
|
160
|
-
value: Expression;
|
|
161
|
-
constructor(receiver: Expression, index: Expression, value: Expression, type?: Type | null, sourceSpan?: ParseSourceSpan | null);
|
|
162
|
-
isEquivalent(e: Expression): boolean;
|
|
163
|
-
isConstant(): boolean;
|
|
164
|
-
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
|
165
|
-
clone(): WriteKeyExpr;
|
|
166
|
-
}
|
|
167
|
-
export declare class WritePropExpr extends Expression {
|
|
168
|
-
receiver: Expression;
|
|
169
|
-
name: string;
|
|
170
|
-
value: Expression;
|
|
171
|
-
constructor(receiver: Expression, name: string, value: Expression, type?: Type | null, sourceSpan?: ParseSourceSpan | null);
|
|
172
|
-
isEquivalent(e: Expression): boolean;
|
|
173
|
-
isConstant(): boolean;
|
|
174
|
-
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
|
175
|
-
clone(): WritePropExpr;
|
|
176
|
-
}
|
|
177
|
-
export declare class InvokeFunctionExpr extends Expression {
|
|
178
|
-
fn: Expression;
|
|
179
|
-
args: Expression[];
|
|
180
|
-
pure: boolean;
|
|
181
|
-
constructor(fn: Expression, args: Expression[], type?: Type | null, sourceSpan?: ParseSourceSpan | null, pure?: boolean);
|
|
182
|
-
get receiver(): Expression;
|
|
183
|
-
isEquivalent(e: Expression): boolean;
|
|
184
|
-
isConstant(): boolean;
|
|
185
|
-
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
|
186
|
-
clone(): InvokeFunctionExpr;
|
|
187
|
-
}
|
|
188
|
-
export declare class InstantiateExpr extends Expression {
|
|
189
|
-
classExpr: Expression;
|
|
190
|
-
args: Expression[];
|
|
191
|
-
constructor(classExpr: Expression, args: Expression[], type?: Type | null, sourceSpan?: ParseSourceSpan | null);
|
|
192
|
-
isEquivalent(e: Expression): boolean;
|
|
193
|
-
isConstant(): boolean;
|
|
194
|
-
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
|
195
|
-
clone(): InstantiateExpr;
|
|
196
|
-
}
|
|
197
|
-
export declare class LiteralExpr extends Expression {
|
|
198
|
-
value: number | string | boolean | null | undefined;
|
|
199
|
-
constructor(value: number | string | boolean | null | undefined, type?: Type | null, sourceSpan?: ParseSourceSpan | null);
|
|
200
|
-
isEquivalent(e: Expression): boolean;
|
|
201
|
-
isConstant(): boolean;
|
|
202
|
-
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
|
203
|
-
clone(): LiteralExpr;
|
|
204
|
-
}
|
|
205
|
-
export declare class TemplateLiteral {
|
|
206
|
-
elements: TemplateLiteralElement[];
|
|
207
|
-
expressions: Expression[];
|
|
208
|
-
constructor(elements: TemplateLiteralElement[], expressions: Expression[]);
|
|
209
|
-
clone(): TemplateLiteral;
|
|
210
|
-
}
|
|
211
|
-
export declare class TemplateLiteralElement {
|
|
212
|
-
text: string;
|
|
213
|
-
sourceSpan?: ParseSourceSpan | undefined;
|
|
214
|
-
rawText: string;
|
|
215
|
-
constructor(text: string, sourceSpan?: ParseSourceSpan | undefined, rawText?: string);
|
|
216
|
-
clone(): TemplateLiteralElement;
|
|
217
|
-
}
|
|
218
|
-
export declare class LiteralPiece {
|
|
219
|
-
text: string;
|
|
220
|
-
sourceSpan: ParseSourceSpan;
|
|
221
|
-
constructor(text: string, sourceSpan: ParseSourceSpan);
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* A structure to hold the cooked and raw strings of a template literal element, along with its
|
|
225
|
-
* source-span range.
|
|
226
|
-
*/
|
|
227
|
-
export interface CookedRawString {
|
|
228
|
-
cooked: string;
|
|
229
|
-
raw: string;
|
|
230
|
-
range: ParseSourceSpan | null;
|
|
231
|
-
}
|
|
232
|
-
export declare class ExternalExpr extends Expression {
|
|
233
|
-
value: ExternalReference;
|
|
234
|
-
typeParams: Type[] | null;
|
|
235
|
-
constructor(value: ExternalReference, type?: Type | null, typeParams?: Type[] | null, sourceSpan?: ParseSourceSpan | null);
|
|
236
|
-
isEquivalent(e: Expression): boolean;
|
|
237
|
-
isConstant(): boolean;
|
|
238
|
-
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
|
239
|
-
clone(): ExternalExpr;
|
|
240
|
-
}
|
|
241
|
-
export declare class ExternalReference {
|
|
242
|
-
moduleName: string | null;
|
|
243
|
-
name: string | null;
|
|
244
|
-
runtime?: any;
|
|
245
|
-
constructor(moduleName: string | null, name: string | null, runtime?: any);
|
|
246
|
-
}
|
|
247
|
-
export declare class ConditionalExpr extends Expression {
|
|
248
|
-
condition: Expression;
|
|
249
|
-
falseCase: Expression | null;
|
|
250
|
-
trueCase: Expression;
|
|
251
|
-
constructor(condition: Expression, trueCase: Expression, falseCase?: Expression | null, type?: Type | null, sourceSpan?: ParseSourceSpan | null);
|
|
252
|
-
isEquivalent(e: Expression): boolean;
|
|
253
|
-
isConstant(): boolean;
|
|
254
|
-
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
|
255
|
-
clone(): ConditionalExpr;
|
|
256
|
-
}
|
|
257
|
-
export declare class DynamicImportExpr extends Expression {
|
|
258
|
-
url: string;
|
|
259
|
-
constructor(url: string, sourceSpan?: ParseSourceSpan | null);
|
|
260
|
-
isEquivalent(e: Expression): boolean;
|
|
261
|
-
isConstant(): boolean;
|
|
262
|
-
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
|
263
|
-
clone(): DynamicImportExpr;
|
|
264
|
-
}
|
|
265
|
-
export declare class NotExpr extends Expression {
|
|
266
|
-
condition: Expression;
|
|
267
|
-
constructor(condition: Expression, sourceSpan?: ParseSourceSpan | null);
|
|
268
|
-
isEquivalent(e: Expression): boolean;
|
|
269
|
-
isConstant(): boolean;
|
|
270
|
-
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
|
271
|
-
clone(): NotExpr;
|
|
272
|
-
}
|
|
273
|
-
export declare class FnParam {
|
|
274
|
-
name: string;
|
|
275
|
-
type: Type | null;
|
|
276
|
-
constructor(name: string, type?: Type | null);
|
|
277
|
-
isEquivalent(param: FnParam): boolean;
|
|
278
|
-
clone(): FnParam;
|
|
279
|
-
}
|
|
280
|
-
export declare class FunctionExpr extends Expression {
|
|
281
|
-
params: FnParam[];
|
|
282
|
-
statements: Statement[];
|
|
283
|
-
name?: string | null | undefined;
|
|
284
|
-
constructor(params: FnParam[], statements: Statement[], type?: Type | null, sourceSpan?: ParseSourceSpan | null, name?: string | null | undefined);
|
|
285
|
-
isEquivalent(e: Expression | Statement): boolean;
|
|
286
|
-
isConstant(): boolean;
|
|
287
|
-
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
|
288
|
-
toDeclStmt(name: string, modifiers?: StmtModifier): DeclareFunctionStmt;
|
|
289
|
-
clone(): FunctionExpr;
|
|
290
|
-
}
|
|
291
|
-
export declare class ArrowFunctionExpr extends Expression {
|
|
292
|
-
params: FnParam[];
|
|
293
|
-
body: Expression | Statement[];
|
|
294
|
-
constructor(params: FnParam[], body: Expression | Statement[], type?: Type | null, sourceSpan?: ParseSourceSpan | null);
|
|
295
|
-
isEquivalent(e: Expression): boolean;
|
|
296
|
-
isConstant(): boolean;
|
|
297
|
-
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
|
298
|
-
clone(): Expression;
|
|
299
|
-
toDeclStmt(name: string, modifiers?: StmtModifier): DeclareVarStmt;
|
|
300
|
-
}
|
|
301
|
-
export declare class UnaryOperatorExpr extends Expression {
|
|
302
|
-
operator: UnaryOperator;
|
|
303
|
-
expr: Expression;
|
|
304
|
-
parens: boolean;
|
|
305
|
-
constructor(operator: UnaryOperator, expr: Expression, type?: Type | null, sourceSpan?: ParseSourceSpan | null, parens?: boolean);
|
|
306
|
-
isEquivalent(e: Expression): boolean;
|
|
307
|
-
isConstant(): boolean;
|
|
308
|
-
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
|
309
|
-
clone(): UnaryOperatorExpr;
|
|
310
|
-
}
|
|
311
|
-
export declare class BinaryOperatorExpr extends Expression {
|
|
312
|
-
operator: BinaryOperator;
|
|
313
|
-
rhs: Expression;
|
|
314
|
-
parens: boolean;
|
|
315
|
-
lhs: Expression;
|
|
316
|
-
constructor(operator: BinaryOperator, lhs: Expression, rhs: Expression, type?: Type | null, sourceSpan?: ParseSourceSpan | null, parens?: boolean);
|
|
317
|
-
isEquivalent(e: Expression): boolean;
|
|
318
|
-
isConstant(): boolean;
|
|
319
|
-
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
|
320
|
-
clone(): BinaryOperatorExpr;
|
|
321
|
-
}
|
|
322
|
-
export declare class ReadPropExpr extends Expression {
|
|
323
|
-
receiver: Expression;
|
|
324
|
-
name: string;
|
|
325
|
-
constructor(receiver: Expression, name: string, type?: Type | null, sourceSpan?: ParseSourceSpan | null);
|
|
326
|
-
get index(): string;
|
|
327
|
-
isEquivalent(e: Expression): boolean;
|
|
328
|
-
isConstant(): boolean;
|
|
329
|
-
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
|
330
|
-
set(value: Expression): WritePropExpr;
|
|
331
|
-
clone(): ReadPropExpr;
|
|
332
|
-
}
|
|
333
|
-
export declare class ReadKeyExpr extends Expression {
|
|
334
|
-
receiver: Expression;
|
|
335
|
-
index: Expression;
|
|
336
|
-
constructor(receiver: Expression, index: Expression, type?: Type | null, sourceSpan?: ParseSourceSpan | null);
|
|
337
|
-
isEquivalent(e: Expression): boolean;
|
|
338
|
-
isConstant(): boolean;
|
|
339
|
-
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
|
340
|
-
set(value: Expression): WriteKeyExpr;
|
|
341
|
-
clone(): ReadKeyExpr;
|
|
342
|
-
}
|
|
343
|
-
export declare class LiteralArrayExpr extends Expression {
|
|
344
|
-
entries: Expression[];
|
|
345
|
-
constructor(entries: Expression[], type?: Type | null, sourceSpan?: ParseSourceSpan | null);
|
|
346
|
-
isConstant(): boolean;
|
|
347
|
-
isEquivalent(e: Expression): boolean;
|
|
348
|
-
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
|
349
|
-
clone(): LiteralArrayExpr;
|
|
350
|
-
}
|
|
351
|
-
export declare class LiteralMapEntry {
|
|
352
|
-
key: string;
|
|
353
|
-
value: Expression;
|
|
354
|
-
quoted: boolean;
|
|
355
|
-
constructor(key: string, value: Expression, quoted: boolean);
|
|
356
|
-
isEquivalent(e: LiteralMapEntry): boolean;
|
|
357
|
-
clone(): LiteralMapEntry;
|
|
358
|
-
}
|
|
359
|
-
export declare class LiteralMapExpr extends Expression {
|
|
360
|
-
entries: LiteralMapEntry[];
|
|
361
|
-
valueType: Type | null;
|
|
362
|
-
constructor(entries: LiteralMapEntry[], type?: MapType | null, sourceSpan?: ParseSourceSpan | null);
|
|
363
|
-
isEquivalent(e: Expression): boolean;
|
|
364
|
-
isConstant(): boolean;
|
|
365
|
-
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
|
366
|
-
clone(): LiteralMapExpr;
|
|
367
|
-
}
|
|
368
|
-
export declare class CommaExpr extends Expression {
|
|
369
|
-
parts: Expression[];
|
|
370
|
-
constructor(parts: Expression[], sourceSpan?: ParseSourceSpan | null);
|
|
371
|
-
isEquivalent(e: Expression): boolean;
|
|
372
|
-
isConstant(): boolean;
|
|
373
|
-
visitExpression(visitor: ExpressionVisitor, context: any): any;
|
|
374
|
-
clone(): CommaExpr;
|
|
375
|
-
}
|
|
376
|
-
export interface ExpressionVisitor {
|
|
377
|
-
visitReadVarExpr(ast: ReadVarExpr, context: any): any;
|
|
378
|
-
visitWriteVarExpr(expr: WriteVarExpr, context: any): any;
|
|
379
|
-
visitWriteKeyExpr(expr: WriteKeyExpr, context: any): any;
|
|
380
|
-
visitWritePropExpr(expr: WritePropExpr, context: any): any;
|
|
381
|
-
visitInvokeFunctionExpr(ast: InvokeFunctionExpr, context: any): any;
|
|
382
|
-
visitInstantiateExpr(ast: InstantiateExpr, context: any): any;
|
|
383
|
-
visitLiteralExpr(ast: LiteralExpr, context: any): any;
|
|
384
|
-
visitExternalExpr(ast: ExternalExpr, context: any): any;
|
|
385
|
-
visitConditionalExpr(ast: ConditionalExpr, context: any): any;
|
|
386
|
-
visitDynamicImportExpr(ast: DynamicImportExpr, context: any): any;
|
|
387
|
-
visitNotExpr(ast: NotExpr, context: any): any;
|
|
388
|
-
visitFunctionExpr(ast: FunctionExpr, context: any): any;
|
|
389
|
-
visitUnaryOperatorExpr(ast: UnaryOperatorExpr, context: any): any;
|
|
390
|
-
visitBinaryOperatorExpr(ast: BinaryOperatorExpr, context: any): any;
|
|
391
|
-
visitReadPropExpr(ast: ReadPropExpr, context: any): any;
|
|
392
|
-
visitReadKeyExpr(ast: ReadKeyExpr, context: any): any;
|
|
393
|
-
visitLiteralArrayExpr(ast: LiteralArrayExpr, context: any): any;
|
|
394
|
-
visitLiteralMapExpr(ast: LiteralMapExpr, context: any): any;
|
|
395
|
-
visitCommaExpr(ast: CommaExpr, context: any): any;
|
|
396
|
-
visitWrappedNodeExpr(ast: WrappedNodeExpr<any>, context: any): any;
|
|
397
|
-
visitTypeofExpr(ast: TypeofExpr, context: any): any;
|
|
398
|
-
visitArrowFunctionExpr(ast: ArrowFunctionExpr, context: any): any;
|
|
399
|
-
}
|
|
400
|
-
export declare const NULL_EXPR: LiteralExpr;
|
|
401
|
-
export declare const TYPED_NULL_EXPR: LiteralExpr;
|
|
402
|
-
export declare enum StmtModifier {
|
|
403
|
-
None = 0,
|
|
404
|
-
Final = 1,
|
|
405
|
-
Private = 2,
|
|
406
|
-
Exported = 4,
|
|
407
|
-
Static = 8
|
|
408
|
-
}
|
|
409
|
-
export declare class LeadingComment {
|
|
410
|
-
text: string;
|
|
411
|
-
multiline: boolean;
|
|
412
|
-
trailingNewline: boolean;
|
|
413
|
-
constructor(text: string, multiline: boolean, trailingNewline: boolean);
|
|
414
|
-
toString(): string;
|
|
415
|
-
}
|
|
416
|
-
export declare class JSDocComment extends LeadingComment {
|
|
417
|
-
tags: JSDocTag[];
|
|
418
|
-
constructor(tags: JSDocTag[]);
|
|
419
|
-
toString(): string;
|
|
420
|
-
}
|
|
421
|
-
export declare abstract class Statement {
|
|
422
|
-
modifiers: StmtModifier;
|
|
423
|
-
sourceSpan: ParseSourceSpan | null;
|
|
424
|
-
leadingComments?: LeadingComment[] | undefined;
|
|
425
|
-
constructor(modifiers?: StmtModifier, sourceSpan?: ParseSourceSpan | null, leadingComments?: LeadingComment[] | undefined);
|
|
426
|
-
/**
|
|
427
|
-
* Calculates whether this statement produces the same value as the given statement.
|
|
428
|
-
* Note: We don't check Types nor ParseSourceSpans nor function arguments.
|
|
429
|
-
*/
|
|
430
|
-
abstract isEquivalent(stmt: Statement): boolean;
|
|
431
|
-
abstract visitStatement(visitor: StatementVisitor, context: any): any;
|
|
432
|
-
hasModifier(modifier: StmtModifier): boolean;
|
|
433
|
-
addLeadingComment(leadingComment: LeadingComment): void;
|
|
434
|
-
}
|
|
435
|
-
export declare class DeclareVarStmt extends Statement {
|
|
436
|
-
name: string;
|
|
437
|
-
value?: Expression | undefined;
|
|
438
|
-
type: Type | null;
|
|
439
|
-
constructor(name: string, value?: Expression | undefined, type?: Type | null, modifiers?: StmtModifier, sourceSpan?: ParseSourceSpan | null, leadingComments?: LeadingComment[]);
|
|
440
|
-
isEquivalent(stmt: Statement): boolean;
|
|
441
|
-
visitStatement(visitor: StatementVisitor, context: any): any;
|
|
442
|
-
}
|
|
443
|
-
export declare class DeclareFunctionStmt extends Statement {
|
|
444
|
-
name: string;
|
|
445
|
-
params: FnParam[];
|
|
446
|
-
statements: Statement[];
|
|
447
|
-
type: Type | null;
|
|
448
|
-
constructor(name: string, params: FnParam[], statements: Statement[], type?: Type | null, modifiers?: StmtModifier, sourceSpan?: ParseSourceSpan | null, leadingComments?: LeadingComment[]);
|
|
449
|
-
isEquivalent(stmt: Statement): boolean;
|
|
450
|
-
visitStatement(visitor: StatementVisitor, context: any): any;
|
|
451
|
-
}
|
|
452
|
-
export declare class ExpressionStatement extends Statement {
|
|
453
|
-
expr: Expression;
|
|
454
|
-
constructor(expr: Expression, sourceSpan?: ParseSourceSpan | null, leadingComments?: LeadingComment[]);
|
|
455
|
-
isEquivalent(stmt: Statement): boolean;
|
|
456
|
-
visitStatement(visitor: StatementVisitor, context: any): any;
|
|
457
|
-
}
|
|
458
|
-
export declare class ReturnStatement extends Statement {
|
|
459
|
-
value: Expression;
|
|
460
|
-
constructor(value: Expression, sourceSpan?: ParseSourceSpan | null, leadingComments?: LeadingComment[]);
|
|
461
|
-
isEquivalent(stmt: Statement): boolean;
|
|
462
|
-
visitStatement(visitor: StatementVisitor, context: any): any;
|
|
463
|
-
}
|
|
464
|
-
export declare class IfStmt extends Statement {
|
|
465
|
-
condition: Expression;
|
|
466
|
-
trueCase: Statement[];
|
|
467
|
-
falseCase: Statement[];
|
|
468
|
-
constructor(condition: Expression, trueCase: Statement[], falseCase?: Statement[], sourceSpan?: ParseSourceSpan | null, leadingComments?: LeadingComment[]);
|
|
469
|
-
isEquivalent(stmt: Statement): boolean;
|
|
470
|
-
visitStatement(visitor: StatementVisitor, context: any): any;
|
|
471
|
-
}
|
|
472
|
-
export interface StatementVisitor {
|
|
473
|
-
visitDeclareVarStmt(stmt: DeclareVarStmt, context: any): any;
|
|
474
|
-
visitDeclareFunctionStmt(stmt: DeclareFunctionStmt, context: any): any;
|
|
475
|
-
visitExpressionStmt(stmt: ExpressionStatement, context: any): any;
|
|
476
|
-
visitReturnStmt(stmt: ReturnStatement, context: any): any;
|
|
477
|
-
visitIfStmt(stmt: IfStmt, context: any): any;
|
|
478
|
-
}
|
|
479
|
-
export declare function leadingComment(text: string, multiline?: boolean, trailingNewline?: boolean): LeadingComment;
|
|
480
|
-
export declare function jsDocComment(tags?: JSDocTag[]): JSDocComment;
|
|
481
|
-
export declare function variable(name: string, type?: Type | null, sourceSpan?: ParseSourceSpan | null): ReadVarExpr;
|
|
482
|
-
export declare function importExpr(id: ExternalReference, typeParams?: Type[] | null, sourceSpan?: ParseSourceSpan | null): ExternalExpr;
|
|
483
|
-
export declare function importType(id: ExternalReference, typeParams?: Type[] | null, typeModifiers?: TypeModifier): ExpressionType | null;
|
|
484
|
-
export declare function expressionType(expr: Expression, typeModifiers?: TypeModifier, typeParams?: Type[] | null): ExpressionType;
|
|
485
|
-
export declare function transplantedType<T>(type: T, typeModifiers?: TypeModifier): TransplantedType<T>;
|
|
486
|
-
export declare function typeofExpr(expr: Expression): TypeofExpr;
|
|
487
|
-
export declare function literalArr(values: Expression[], type?: Type | null, sourceSpan?: ParseSourceSpan | null): LiteralArrayExpr;
|
|
488
|
-
export declare function literalMap(values: {
|
|
489
|
-
key: string;
|
|
490
|
-
quoted: boolean;
|
|
491
|
-
value: Expression;
|
|
492
|
-
}[], type?: MapType | null): LiteralMapExpr;
|
|
493
|
-
export declare function unary(operator: UnaryOperator, expr: Expression, type?: Type, sourceSpan?: ParseSourceSpan | null): UnaryOperatorExpr;
|
|
494
|
-
export declare function not(expr: Expression, sourceSpan?: ParseSourceSpan | null): NotExpr;
|
|
495
|
-
export declare function fn(params: FnParam[], body: Statement[], type?: Type | null, sourceSpan?: ParseSourceSpan | null, name?: string | null): FunctionExpr;
|
|
496
|
-
export declare function arrowFn(params: FnParam[], body: Expression | Statement[], type?: Type | null, sourceSpan?: ParseSourceSpan | null): ArrowFunctionExpr;
|
|
497
|
-
export declare function ifStmt(condition: Expression, thenClause: Statement[], elseClause?: Statement[], sourceSpan?: ParseSourceSpan, leadingComments?: LeadingComment[]): IfStmt;
|
|
498
|
-
export declare function literal(value: any, type?: Type | null, sourceSpan?: ParseSourceSpan | null): LiteralExpr;
|
|
499
|
-
export declare function isNull(exp: Expression): boolean;
|
|
500
|
-
export declare const enum JSDocTagName {
|
|
501
|
-
Desc = "desc",
|
|
502
|
-
Id = "id",
|
|
503
|
-
Meaning = "meaning",
|
|
504
|
-
Suppress = "suppress"
|
|
505
|
-
}
|
|
506
|
-
export type JSDocTag = {
|
|
507
|
-
tagName: JSDocTagName | string;
|
|
508
|
-
text?: string;
|
|
509
|
-
} | {
|
|
510
|
-
tagName?: undefined;
|
|
511
|
-
text: string;
|
|
512
|
-
};
|