@angular-wave/angular.ts 0.15.2 → 0.16.1
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/@types/animations/interface.d.ts +4 -0
- package/@types/animations/runner/animate-runner.d.ts +2 -1
- package/@types/animations/shared.d.ts +100 -44
- package/@types/core/compile/attributes.d.ts +34 -18
- package/@types/core/compile/compile.d.ts +4 -5
- package/@types/core/controller/interface.d.ts +1 -1
- package/@types/core/di/di.d.ts +0 -10
- package/@types/core/di/interface.d.ts +28 -0
- package/@types/core/di/internal-injector.d.ts +28 -19
- package/@types/core/di/ng-module/ng-module.d.ts +35 -4
- package/@types/core/interpolate/interpolate.d.ts +1 -1
- package/@types/core/parse/ast/ast-node.d.ts +75 -38
- package/@types/core/parse/ast/ast.d.ts +6 -15
- package/@types/core/parse/ast-type.d.ts +1 -1
- package/@types/core/parse/interface.d.ts +9 -41
- package/@types/core/parse/interpreter.d.ts +26 -13
- package/@types/core/parse/lexer/lexer.d.ts +2 -30
- package/@types/core/parse/parse.d.ts +1 -34
- package/@types/core/parse/parser/parser.d.ts +2 -13
- package/@types/core/sanitize/sanitize-uri.d.ts +2 -2
- package/@types/core/scope/interface.d.ts +1 -0
- package/@types/core/scope/scope.d.ts +17 -5
- package/@types/directive/form/form.d.ts +8 -40
- package/@types/directive/model/model.d.ts +34 -30
- package/@types/directive/model-options/model-options.d.ts +1 -2
- package/@types/directive/validators/validators.d.ts +5 -7
- package/@types/filters/order-by.d.ts +2 -1
- package/@types/interface.d.ts +3 -2
- package/@types/namespace.d.ts +18 -2
- package/@types/router/state/state-object.d.ts +2 -2
- package/@types/router/state/state-service.d.ts +1 -0
- package/@types/router/template-factory.d.ts +4 -5
- package/@types/router/transition/reject-factory.d.ts +32 -9
- package/@types/router/transition/transition-event-type.d.ts +2 -2
- package/@types/router/transition/transition-hook.d.ts +5 -2
- package/@types/router/transition/transition-service.d.ts +2 -2
- package/@types/router/transition/transition.d.ts +2 -2
- package/@types/router/view/view.d.ts +4 -4
- package/@types/services/http/http.d.ts +1 -1
- package/@types/services/pubsub/pubsub.d.ts +2 -2
- package/@types/services/sce/interface.d.ts +8 -0
- package/@types/services/sce/sce.d.ts +10 -7
- package/@types/services/sse/interface.d.ts +5 -20
- package/@types/services/storage/storage.d.ts +2 -2
- package/@types/services/stream/interface.d.ts +1 -0
- package/@types/services/stream/stream.d.ts +1 -1
- package/@types/services/template-request/template-request.d.ts +0 -1
- package/@types/services/websocket/interface.d.ts +16 -0
- package/@types/services/websocket/websocket.d.ts +20 -0
- package/@types/shared/common.d.ts +48 -27
- package/@types/shared/constants.d.ts +2 -8
- package/@types/shared/dom.d.ts +33 -19
- package/@types/shared/utils.d.ts +8 -8
- package/README.md +15 -7
- package/dist/angular-ts.esm.js +4438 -4364
- package/dist/angular-ts.umd.js +4438 -4364
- package/dist/angular-ts.umd.min.js +1 -1
- package/dist/angular-ts.umd.min.js.gz +0 -0
- package/dist/angular-ts.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/@types/core/di/inteface.d.ts +0 -11
- /package/@types/core/compile/{inteface.d.ts → interface.d.ts} +0 -0
|
@@ -1,25 +1,29 @@
|
|
|
1
1
|
import { ASTType } from "../ast-type.js";
|
|
2
|
-
/**
|
|
3
|
-
|
|
4
|
-
*/
|
|
5
|
-
|
|
2
|
+
/** The kind of an object property */
|
|
3
|
+
export type PropertyKind = "init" | "get" | "set";
|
|
4
|
+
/** Base properties for all AST nodes */
|
|
5
|
+
interface BaseNode {
|
|
6
6
|
/** The type of the AST node. */
|
|
7
7
|
type: ASTType;
|
|
8
|
-
/**
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
8
|
+
/** Indicates whether the node depends on non-shallow state. */
|
|
9
|
+
isPure?: boolean;
|
|
10
|
+
/** Indicates whether the expression is a constant. */
|
|
11
|
+
constant?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/** A node that contains a list of statements, e.g., Program or BlockStatement */
|
|
14
|
+
export interface BodyNode extends BaseNode {
|
|
15
|
+
/** The body of the program or block. Always present; empty if no statements. */
|
|
16
|
+
body: ASTNode[];
|
|
17
|
+
/** Optional list of expressions to observe for changes (Angular-specific). */
|
|
18
|
+
toWatch: ASTNode[];
|
|
19
|
+
}
|
|
20
|
+
/** Expression nodes, e.g., BinaryExpression, UnaryExpression, ConditionalExpression, CallExpression, MemberExpression */
|
|
21
|
+
export interface ExpressionNode extends BaseNode {
|
|
22
|
+
/** The single expression contained by an ExpressionStatement. */
|
|
23
|
+
expression?: ASTNode;
|
|
24
|
+
/** The left-hand side of a binary or logical expression. */
|
|
21
25
|
left?: ASTNode;
|
|
22
|
-
/** The right-hand side of a binary expression. */
|
|
26
|
+
/** The right-hand side of a binary or logical expression. */
|
|
23
27
|
right?: ASTNode;
|
|
24
28
|
/** The argument of a unary expression. */
|
|
25
29
|
argument?: ASTNode;
|
|
@@ -29,30 +33,63 @@ export type ASTNode = {
|
|
|
29
33
|
alternate?: ASTNode;
|
|
30
34
|
/** The consequent expression of a conditional expression. */
|
|
31
35
|
consequent?: ASTNode;
|
|
32
|
-
/** The
|
|
33
|
-
body?: ASTNode[];
|
|
34
|
-
/** A list of expressions to observe in a program or block statement. */
|
|
35
|
-
toWatch?: ASTNode[];
|
|
36
|
-
/** The expression of an expression statement. */
|
|
37
|
-
expression?: ASTNode;
|
|
38
|
-
/** The callee of a call expression. */
|
|
36
|
+
/** The callee of a function or method call expression. */
|
|
39
37
|
callee?: ASTNode;
|
|
40
|
-
/** The arguments of a call expression. */
|
|
38
|
+
/** The arguments of a function or method call expression. */
|
|
41
39
|
arguments?: ASTNode[];
|
|
42
|
-
/**
|
|
43
|
-
prefix?: boolean;
|
|
44
|
-
/** The object of a member expression. */
|
|
40
|
+
/** The object of a member expression (e.g., `obj` in `obj.prop`). */
|
|
45
41
|
object?: ASTNode;
|
|
46
|
-
/** The property of a member expression. */
|
|
42
|
+
/** The property of a member expression (e.g., `prop` in `obj.prop`). */
|
|
47
43
|
property?: ASTNode;
|
|
48
|
-
/** Indicates if
|
|
44
|
+
/** Indicates if the member expression is computed (`obj[prop]` vs `obj.prop`). */
|
|
49
45
|
computed?: boolean;
|
|
50
|
-
/** The operator of a binary or logical expression. */
|
|
46
|
+
/** The operator of a binary or logical expression, e.g., "+", "*", "&&". */
|
|
51
47
|
operator?: string;
|
|
52
|
-
/** Indicates if the expression should be filtered. */
|
|
48
|
+
/** Indicates if the expression should be filtered (Angular-specific). */
|
|
53
49
|
filter?: boolean;
|
|
54
|
-
/** Indicates
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
50
|
+
/** Indicates if the unary operator is a prefix, e.g., `++i` vs `i++`. */
|
|
51
|
+
prefix?: boolean;
|
|
52
|
+
}
|
|
53
|
+
/** Leaf node representing a literal or identifier */
|
|
54
|
+
export interface LiteralNode extends BaseNode {
|
|
55
|
+
/** The value of a literal node, e.g., number, string, boolean. */
|
|
56
|
+
value?: any;
|
|
57
|
+
/** The name of an identifier node. */
|
|
58
|
+
name?: string;
|
|
59
|
+
}
|
|
60
|
+
/** Node representing an array literal */
|
|
61
|
+
export interface ArrayNode extends BaseNode {
|
|
62
|
+
/** The elements of the array. */
|
|
63
|
+
elements: ASTNode[];
|
|
64
|
+
}
|
|
65
|
+
/** Node representing an object literal */
|
|
66
|
+
export interface ObjectNode extends BaseNode {
|
|
67
|
+
/** The properties of the object. */
|
|
68
|
+
properties: ASTNode[];
|
|
69
|
+
}
|
|
70
|
+
/** Node representing a single property of an object literal */
|
|
71
|
+
export interface ObjectPropertyNode extends BaseNode {
|
|
72
|
+
/** Property kind (only "init" is used in Angular expressions) */
|
|
73
|
+
kind: "init";
|
|
74
|
+
/** Property key: identifier, literal, or expression */
|
|
75
|
+
key: ASTNode;
|
|
76
|
+
/** Property value expression */
|
|
77
|
+
value: ASTNode;
|
|
78
|
+
/** Whether the property key is computed (`{ [expr]: value }`) */
|
|
79
|
+
computed: boolean;
|
|
80
|
+
}
|
|
81
|
+
/** Statement node that wraps an expression */
|
|
82
|
+
export interface ExpressionStatementNode extends BaseNode {
|
|
83
|
+
/** The expression contained in this statement. */
|
|
84
|
+
expression: ASTNode;
|
|
85
|
+
}
|
|
86
|
+
/** The union type covering all AST nodes */
|
|
87
|
+
export type ASTNode =
|
|
88
|
+
| BodyNode
|
|
89
|
+
| ExpressionNode
|
|
90
|
+
| LiteralNode
|
|
91
|
+
| ArrayNode
|
|
92
|
+
| ObjectNode
|
|
93
|
+
| ObjectPropertyNode
|
|
94
|
+
| ExpressionStatementNode;
|
|
95
|
+
export {};
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @class
|
|
3
|
-
*/
|
|
4
1
|
export class AST {
|
|
5
2
|
/**
|
|
6
3
|
* @param {import('../lexer/lexer.js').Lexer} lexer - The lexer instance for tokenizing input
|
|
@@ -8,14 +5,8 @@ export class AST {
|
|
|
8
5
|
constructor(lexer: import("../lexer/lexer.js").Lexer);
|
|
9
6
|
/** @type {import('../lexer/lexer.js').Lexer} */
|
|
10
7
|
_lexer: import("../lexer/lexer.js").Lexer;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
type: number;
|
|
14
|
-
};
|
|
15
|
-
$locals: {
|
|
16
|
-
type: number;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
8
|
+
/** @type {Record<string, any>} */
|
|
9
|
+
_selfReferential: Record<string, any>;
|
|
19
10
|
_index: number;
|
|
20
11
|
/**
|
|
21
12
|
* Parses the input text and generates an AST.
|
|
@@ -124,9 +115,9 @@ export class AST {
|
|
|
124
115
|
/**
|
|
125
116
|
* Throws a syntax error.
|
|
126
117
|
* @param {string} msg - The error message.
|
|
127
|
-
* @param {import("../lexer/lexer.js").Token}
|
|
118
|
+
* @param {import("../lexer/lexer.js").Token} token - The token that caused the error.
|
|
128
119
|
*/
|
|
129
|
-
_throwError(msg: string, token
|
|
120
|
+
_throwError(msg: string, token: import("../lexer/lexer.js").Token): void;
|
|
130
121
|
/**
|
|
131
122
|
* Consumes a token if it matches the expected type.
|
|
132
123
|
* @param {string} [e1] - The expected token type.
|
|
@@ -140,13 +131,13 @@ export class AST {
|
|
|
140
131
|
_peekToken(): import("../lexer/lexer.js").Token;
|
|
141
132
|
/**
|
|
142
133
|
* Checks if the next token matches any of the expected types.
|
|
143
|
-
* @param {...string}
|
|
134
|
+
* @param {...string} expected - The expected token types.
|
|
144
135
|
* @returns {import('../lexer/lexer.js').Token|boolean} The next token if it matches, otherwise false.
|
|
145
136
|
*/
|
|
146
137
|
_peek(...expected: string[]): import("../lexer/lexer.js").Token | boolean;
|
|
147
138
|
/**
|
|
148
139
|
* Consumes the next token if it matches any of the expected types.
|
|
149
|
-
* @param {...string}
|
|
140
|
+
* @param {...string} expected - The expected token types.
|
|
150
141
|
* @returns {import("../lexer/lexer.js").Token|boolean} The consumed token if it matches, otherwise false.
|
|
151
142
|
*/
|
|
152
143
|
_expect(...expected: string[]): import("../lexer/lexer.js").Token | boolean;
|
|
@@ -1,40 +1,25 @@
|
|
|
1
|
-
import type { DecoratedASTNode } from "./interpreter.js";
|
|
2
1
|
import type { Scope } from "../scope/scope.js";
|
|
2
|
+
import { BodyNode } from "./ast/ast-node.ts";
|
|
3
3
|
/**
|
|
4
4
|
* Describes metadata and behavior for a compiled AngularTS expression.
|
|
5
5
|
*/
|
|
6
6
|
export interface CompiledExpressionProps {
|
|
7
7
|
/** Indicates if the expression is a literal. */
|
|
8
|
-
|
|
8
|
+
_literal: boolean;
|
|
9
9
|
/** Indicates if the expression is constant. */
|
|
10
10
|
constant: boolean;
|
|
11
11
|
/** Optional flag for pure expressions. */
|
|
12
|
-
|
|
13
|
-
/** Indicates if the expression should be evaluated only once. */
|
|
14
|
-
oneTime: boolean;
|
|
12
|
+
_isPure?: boolean;
|
|
15
13
|
/** AST node decorated with metadata. */
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Optional custom watch delegate function for the expression.
|
|
19
|
-
* @param scope - The current scope.
|
|
20
|
-
* @param listener - A listener function.
|
|
21
|
-
* @param equalityCheck - Whether to use deep equality.
|
|
22
|
-
* @param expression - The compiled expression or string.
|
|
23
|
-
*/
|
|
24
|
-
$$watchDelegate?: (
|
|
25
|
-
scope: Scope,
|
|
26
|
-
listener: Function,
|
|
27
|
-
equalityCheck: boolean,
|
|
28
|
-
expression: CompiledExpression | string | ((scope: Scope) => any),
|
|
29
|
-
) => any;
|
|
14
|
+
_decoratedNode: BodyNode;
|
|
30
15
|
/** Expression inputs; may be an array or a function. */
|
|
31
|
-
|
|
16
|
+
_inputs?: any[] | Function;
|
|
32
17
|
/**
|
|
33
18
|
* Optional assign function for two-way binding.
|
|
34
19
|
* Assigns a value to a context.
|
|
35
20
|
* If value is not provided, may return the getter.
|
|
36
21
|
*/
|
|
37
|
-
|
|
22
|
+
_assign?: (context: any, value: any) => any;
|
|
38
23
|
}
|
|
39
24
|
/**
|
|
40
25
|
* Expression function with context and optional locals/assign.
|
|
@@ -50,30 +35,13 @@ export type CompiledExpressionFunction = (
|
|
|
50
35
|
*/
|
|
51
36
|
export type CompiledExpression = CompiledExpressionFunction &
|
|
52
37
|
CompiledExpressionProps;
|
|
53
|
-
/**
|
|
54
|
-
* Map used for expressions that watch specific object keys.
|
|
55
|
-
*/
|
|
56
|
-
export interface CompiledExpressionHandlerMap {
|
|
57
|
-
/** Indicates if the expression is a literal. */
|
|
58
|
-
literal: boolean;
|
|
59
|
-
/** Indicates if the expression is constant. */
|
|
60
|
-
constant: boolean;
|
|
61
|
-
/** Optional flag for pure expressions. */
|
|
62
|
-
isPure?: boolean;
|
|
63
|
-
/** Indicates if the expression should be evaluated only once. */
|
|
64
|
-
oneTime: boolean;
|
|
65
|
-
/** A map of property keys to observe. */
|
|
66
|
-
keyMap: Map<string, Function>;
|
|
67
|
-
}
|
|
68
38
|
/**
|
|
69
39
|
* Parses a string or expression function into a compiled expression.
|
|
70
|
-
* @param expression - The input expression
|
|
40
|
+
* @param expression - The input expression to evaluate.
|
|
71
41
|
* @param interceptorFn - Optional value transformer.
|
|
72
|
-
* @param expensiveChecks - Whether to enable expensive change detection.
|
|
73
42
|
* @returns A compiled expression.
|
|
74
43
|
*/
|
|
75
44
|
export type ParseService = (
|
|
76
|
-
expression
|
|
77
|
-
interceptorFn?: (value: any
|
|
78
|
-
expensiveChecks?: boolean,
|
|
45
|
+
expression: string,
|
|
46
|
+
interceptorFn?: (value: any) => any,
|
|
79
47
|
) => CompiledExpression;
|
|
@@ -3,22 +3,30 @@
|
|
|
3
3
|
* @returns {boolean}
|
|
4
4
|
*/
|
|
5
5
|
export function isAssignable(ast: any): boolean;
|
|
6
|
+
/** @typedef {import("./ast/ast-node.ts").ASTNode} ASTNode */
|
|
7
|
+
/** @typedef {import("./ast/ast-node.ts").BodyNode} BodyNode */
|
|
8
|
+
/** @typedef {import("./ast/ast-node.ts").ExpressionNode} ExpressionNode */
|
|
9
|
+
/** @typedef {import("./ast/ast-node.ts").ArrayNode} ArrayNode */
|
|
10
|
+
/** @typedef {import("./ast/ast-node.ts").LiteralNode} LiteralNode */
|
|
11
|
+
/** @typedef {import("./ast/ast-node.ts").ObjectNode} ObjectNode */
|
|
12
|
+
/** @typedef {import("./ast/ast-node.ts").ObjectPropertyNode} ObjectPropertyNode */
|
|
13
|
+
/** @typedef {import("./interface.ts").CompiledExpression} CompiledExpression */
|
|
14
|
+
/** @typedef {import("./interface.ts").CompiledExpressionFunction} CompiledExpressionFunction */
|
|
6
15
|
export const PURITY_ABSOLUTE: 1;
|
|
7
16
|
export const PURITY_RELATIVE: 2;
|
|
8
17
|
export class ASTInterpreter {
|
|
9
18
|
/**
|
|
10
|
-
* @param {
|
|
19
|
+
* @param {ng.FilterService} $filter
|
|
11
20
|
*/
|
|
12
|
-
constructor($filter:
|
|
13
|
-
|
|
21
|
+
constructor($filter: ng.FilterService);
|
|
22
|
+
/** @type {ng.FilterService} */
|
|
23
|
+
_$filter: ng.FilterService;
|
|
14
24
|
/**
|
|
15
25
|
* Compiles the AST into a function.
|
|
16
|
-
* @param {
|
|
17
|
-
* @returns {
|
|
26
|
+
* @param {ASTNode} ast - The AST to compile.
|
|
27
|
+
* @returns {CompiledExpression}
|
|
18
28
|
*/
|
|
19
|
-
compile(
|
|
20
|
-
ast: import("./ast/ast.js").ASTNode,
|
|
21
|
-
): import("./interface.ts").CompiledExpression;
|
|
29
|
+
compile(ast: ASTNode): CompiledExpression;
|
|
22
30
|
/**
|
|
23
31
|
* Unary plus operation.
|
|
24
32
|
* @param {function} argument - The argument function.
|
|
@@ -217,8 +225,13 @@ export class ASTInterpreter {
|
|
|
217
225
|
): Function;
|
|
218
226
|
#private;
|
|
219
227
|
}
|
|
220
|
-
export type
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
228
|
+
export type ASTNode = import("./ast/ast-node.ts").ASTNode;
|
|
229
|
+
export type BodyNode = import("./ast/ast-node.ts").BodyNode;
|
|
230
|
+
export type ExpressionNode = import("./ast/ast-node.ts").ExpressionNode;
|
|
231
|
+
export type ArrayNode = import("./ast/ast-node.ts").ArrayNode;
|
|
232
|
+
export type LiteralNode = import("./ast/ast-node.ts").LiteralNode;
|
|
233
|
+
export type ObjectNode = import("./ast/ast-node.ts").ObjectNode;
|
|
234
|
+
export type ObjectPropertyNode = import("./ast/ast-node.ts").ObjectPropertyNode;
|
|
235
|
+
export type CompiledExpression = import("./interface.ts").CompiledExpression;
|
|
236
|
+
export type CompiledExpressionFunction =
|
|
237
|
+
import("./interface.ts").CompiledExpressionFunction;
|
|
@@ -1,28 +1,16 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {Object} LexerOptions
|
|
3
|
-
* @property {(ch: string, codePoint: number) => boolean} [isIdentifierStart] - Custom function to determine if a character is a valid identifier start.
|
|
4
|
-
* @property {(ch: string, codePoint: number) => boolean} [isIdentifierContinue] - Custom function to determine if a character is a valid identifier continuation.
|
|
5
|
-
*/
|
|
6
1
|
/**
|
|
7
2
|
* Represents a lexer that tokenizes input text. The Lexer takes the original expression string and returns an array of tokens parsed from that string.
|
|
8
3
|
* For example, the string "a + b" would result in tokens for a, +, and b.
|
|
9
4
|
*/
|
|
10
5
|
export class Lexer {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
* @param {LexerOptions} options - Lexer options.
|
|
14
|
-
*/
|
|
15
|
-
constructor(options: LexerOptions);
|
|
16
|
-
/** @type {LexerOptions} */
|
|
17
|
-
_options: LexerOptions;
|
|
6
|
+
_text: string;
|
|
7
|
+
_index: number;
|
|
18
8
|
/**
|
|
19
9
|
* Tokenizes the input text.
|
|
20
10
|
* @param {string} text Input text to lex.
|
|
21
11
|
* @returns {Array<Token>} Array of tokens.
|
|
22
12
|
*/
|
|
23
13
|
_lex(text: string): Array<Token>;
|
|
24
|
-
_text: string;
|
|
25
|
-
_index: number;
|
|
26
14
|
/** @type {Array<Token>} */
|
|
27
15
|
_tokens: Array<Token>;
|
|
28
16
|
/**
|
|
@@ -62,12 +50,6 @@ export class Lexer {
|
|
|
62
50
|
* @returns {boolean} True if character is a valid identifier continuation, false otherwise.
|
|
63
51
|
*/
|
|
64
52
|
_isIdentifierContinue(ch: string): boolean;
|
|
65
|
-
/**
|
|
66
|
-
* Converts a character to its Unicode code point.
|
|
67
|
-
* @param {string} ch Character to convert.
|
|
68
|
-
* @returns {number} Unicode code point.
|
|
69
|
-
*/
|
|
70
|
-
_codePointAt(ch: string): number;
|
|
71
53
|
/**
|
|
72
54
|
* Peeks at the next multicharacter sequence in the text.
|
|
73
55
|
* @returns {string} Next multicharacter sequence.
|
|
@@ -107,13 +89,3 @@ export class Lexer {
|
|
|
107
89
|
_handleUnicodeEscape(): string;
|
|
108
90
|
}
|
|
109
91
|
export type Token = import("./token.ts").Token;
|
|
110
|
-
export type LexerOptions = {
|
|
111
|
-
/**
|
|
112
|
-
* - Custom function to determine if a character is a valid identifier start.
|
|
113
|
-
*/
|
|
114
|
-
isIdentifierStart?: (ch: string, codePoint: number) => boolean;
|
|
115
|
-
/**
|
|
116
|
-
* - Custom function to determine if a character is a valid identifier continuation.
|
|
117
|
-
*/
|
|
118
|
-
isIdentifierContinue?: (ch: string, codePoint: number) => boolean;
|
|
119
|
-
};
|
|
@@ -1,36 +1,3 @@
|
|
|
1
|
-
export function constantWatchDelegate(
|
|
2
|
-
scope: any,
|
|
3
|
-
listener: any,
|
|
4
|
-
objectEquality: any,
|
|
5
|
-
parsedExpression: any,
|
|
6
|
-
): any;
|
|
7
1
|
export class ParseProvider {
|
|
8
|
-
|
|
9
|
-
* Allows defining the set of characters that are allowed in AngularTS expressions. The function
|
|
10
|
-
* `identifierStart` will get called to know if a given character is a valid character to be the
|
|
11
|
-
* first character for an identifier. The function `identifierContinue` will get called to know if
|
|
12
|
-
* a given character is a valid character to be a follow-up identifier character. The functions
|
|
13
|
-
* `identifierStart` and `identifierContinue` will receive as arguments the single character to be
|
|
14
|
-
* identifier and the character code point. These arguments will be `string` and `numeric`. Keep in
|
|
15
|
-
* mind that the `string` parameter can be two characters long depending on the character
|
|
16
|
-
* representation. It is expected for the function to return `true` or `false`, whether that
|
|
17
|
-
* character is allowed or not.
|
|
18
|
-
*
|
|
19
|
-
* Since this function will be called extensively, keep the implementation of these functions fast,
|
|
20
|
-
* as the performance of these functions have a direct impact on the expressions parsing speed.
|
|
21
|
-
*
|
|
22
|
-
* @param {function(any):boolean} [identifierStart] The function that will decide whether the given character is
|
|
23
|
-
* a valid identifier start character.
|
|
24
|
-
* @param {function(any):boolean} [identifierContinue] The function that will decide whether the given character is
|
|
25
|
-
* a valid identifier continue character.
|
|
26
|
-
* @returns {ParseProvider}
|
|
27
|
-
*/
|
|
28
|
-
setIdentifierFns: (
|
|
29
|
-
identifierStart?: (arg0: any) => boolean,
|
|
30
|
-
identifierContinue?: (arg0: any) => boolean,
|
|
31
|
-
) => ParseProvider;
|
|
32
|
-
$get: (
|
|
33
|
-
| string
|
|
34
|
-
| (($filter: (any: any) => any) => import("./interface.ts").ParseService)
|
|
35
|
-
)[];
|
|
2
|
+
$get: (string | (($filter: ng.FilterService) => ng.ParseService))[];
|
|
36
3
|
}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {Object} ParsedAST
|
|
3
|
-
* @property {import("../ast/ast-node.d.ts").ASTNode} ast - AST representation of expression
|
|
4
|
-
*/
|
|
5
1
|
/**
|
|
6
2
|
* @constructor
|
|
7
3
|
*/
|
|
@@ -9,11 +5,11 @@ export class Parser {
|
|
|
9
5
|
/**
|
|
10
6
|
*
|
|
11
7
|
* @param {import('../lexer/lexer.js').Lexer} lexer
|
|
12
|
-
* @param {
|
|
8
|
+
* @param {ng.FilterService} $filter
|
|
13
9
|
*/
|
|
14
10
|
constructor(
|
|
15
11
|
lexer: import("../lexer/lexer.js").Lexer,
|
|
16
|
-
$filter:
|
|
12
|
+
$filter: ng.FilterService,
|
|
17
13
|
);
|
|
18
14
|
/** @type {AST} */
|
|
19
15
|
_ast: AST;
|
|
@@ -24,13 +20,6 @@ export class Parser {
|
|
|
24
20
|
* @returns {import("../interface.ts").CompiledExpression}
|
|
25
21
|
*/
|
|
26
22
|
_parse(exp: string): import("../interface.ts").CompiledExpression;
|
|
27
|
-
#private;
|
|
28
23
|
}
|
|
29
|
-
export type ParsedAST = {
|
|
30
|
-
/**
|
|
31
|
-
* - AST representation of expression
|
|
32
|
-
*/
|
|
33
|
-
ast: import("../ast/ast-node.d.ts").ASTNode;
|
|
34
|
-
};
|
|
35
24
|
import { AST } from "../ast/ast.js";
|
|
36
25
|
import { ASTInterpreter } from "../interpreter.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/** @typedef {import('../../interface.ts').ServiceProvider} ServiceProvider */
|
|
2
2
|
/**
|
|
3
3
|
* Private service to sanitize uris for links and images. Used by $compile.
|
|
4
|
-
* @
|
|
4
|
+
* @extends {ServiceProvider}
|
|
5
5
|
*/
|
|
6
|
-
export class SanitizeUriProvider
|
|
6
|
+
export class SanitizeUriProvider {
|
|
7
7
|
/**
|
|
8
8
|
* @private
|
|
9
9
|
* @type {RegExp}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CompiledExpression } from "../parse/interface.ts";
|
|
2
2
|
export type ListenerFn = (newValue?: any, originalTarget?: object) => void;
|
|
3
|
+
export type NonScope = string[] | boolean | undefined;
|
|
3
4
|
export interface Listener {
|
|
4
5
|
originalTarget: any;
|
|
5
6
|
listenerFn: ListenerFn;
|
|
@@ -3,20 +3,24 @@
|
|
|
3
3
|
* Creates a deep proxy for the target object, intercepting property changes
|
|
4
4
|
* and recursively applying proxies to nested objects.
|
|
5
5
|
*
|
|
6
|
-
* @param {Object} target - The object to be wrapped in a proxy.
|
|
6
|
+
* @param {Object & {$nonscope?: import("./interface.ts").NonScope} & Record<string, any>} target - The object to be wrapped in a proxy.
|
|
7
7
|
* @param {Scope} [context] - The context for the handler, used to track listeners.
|
|
8
8
|
* @returns {Scope|Object} - A proxy that intercepts operations on the target object,
|
|
9
9
|
* or the original value if the target is not an object.
|
|
10
10
|
*/
|
|
11
|
-
export function createScope(
|
|
11
|
+
export function createScope(
|
|
12
|
+
target?: any & {
|
|
13
|
+
$nonscope?: import("./interface.ts").NonScope;
|
|
14
|
+
} & Record<string, any>,
|
|
15
|
+
context?: Scope,
|
|
16
|
+
): Scope | any;
|
|
12
17
|
/**
|
|
13
|
-
* @ignore
|
|
14
18
|
* Checks if a target should be excluded from scope observability
|
|
15
19
|
* @param {any} target
|
|
16
20
|
* @returns {boolean}
|
|
17
21
|
*/
|
|
18
22
|
export function isNonScope(target: any): boolean;
|
|
19
|
-
/** @ignore @type {Function[]}*/
|
|
23
|
+
/** @ignore @type {Function[]} */
|
|
20
24
|
export const $postUpdateQueue: Function[];
|
|
21
25
|
export class RootScopeProvider {
|
|
22
26
|
rootScope: any;
|
|
@@ -80,7 +84,8 @@ export class Scope {
|
|
|
80
84
|
private _scheduled;
|
|
81
85
|
$scopename: any;
|
|
82
86
|
/** @private */
|
|
83
|
-
|
|
87
|
+
/** @type {Record<any, any>} */
|
|
88
|
+
propertyMap: Record<any, any>;
|
|
84
89
|
/**
|
|
85
90
|
* Intercepts and handles property assignments on the target object. If a new value is
|
|
86
91
|
* an object, it will be recursively proxied.
|
|
@@ -177,3 +182,10 @@ export class Scope {
|
|
|
177
182
|
$searchByName(name: string): ng.Scope | undefined;
|
|
178
183
|
#private;
|
|
179
184
|
}
|
|
185
|
+
export type ExpressionNode = import("../parse/ast/ast-node.ts").ExpressionNode;
|
|
186
|
+
export type LiteralNode = import("../parse/ast/ast-node.ts").LiteralNode;
|
|
187
|
+
export type BodyNode = import("../parse/ast/ast-node.ts").BodyNode;
|
|
188
|
+
export type ArrayNode = import("../parse/ast/ast-node.ts").ArrayNode;
|
|
189
|
+
export type ObjectNode = import("../parse/ast/ast-node.ts").ObjectNode;
|
|
190
|
+
export type ObjectPropertyNode =
|
|
191
|
+
import("../parse/ast/ast-node.ts").ObjectPropertyNode;
|
|
@@ -62,7 +62,7 @@ export const PENDING_CLASS: "ng-pending";
|
|
|
62
62
|
* - `week`
|
|
63
63
|
* - `month`
|
|
64
64
|
*
|
|
65
|
-
*
|
|
65
|
+
*
|
|
66
66
|
* `FormController` keeps track of all its controls and nested forms as well as the state of them,
|
|
67
67
|
* such as being valid/invalid or dirty/pristine.
|
|
68
68
|
*
|
|
@@ -101,13 +101,13 @@ export class FormController {
|
|
|
101
101
|
$invalid: boolean;
|
|
102
102
|
$submitted: boolean;
|
|
103
103
|
/** @type {FormController|Object} */
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
_parentForm: FormController | any;
|
|
105
|
+
_element: Element;
|
|
106
|
+
_animate: import("../../animations/interface.ts").AnimateService;
|
|
107
107
|
$error: {};
|
|
108
|
-
|
|
108
|
+
_success: {};
|
|
109
109
|
$pending: any;
|
|
110
|
-
|
|
110
|
+
_classCache: {};
|
|
111
111
|
$target: {};
|
|
112
112
|
/**
|
|
113
113
|
* Rollback all form controls pending updates to the `$modelValue`.
|
|
@@ -237,41 +237,9 @@ export class FormController {
|
|
|
237
237
|
}
|
|
238
238
|
export const formDirective: (
|
|
239
239
|
| string
|
|
240
|
-
| (($parse:
|
|
241
|
-
name: string;
|
|
242
|
-
restrict: string;
|
|
243
|
-
require: string[];
|
|
244
|
-
controller: typeof FormController;
|
|
245
|
-
compile: (
|
|
246
|
-
formElement: any,
|
|
247
|
-
attr: any,
|
|
248
|
-
) => {
|
|
249
|
-
pre: (
|
|
250
|
-
scope: any,
|
|
251
|
-
formElementParam: any,
|
|
252
|
-
attrParam: any,
|
|
253
|
-
ctrls: any,
|
|
254
|
-
) => void;
|
|
255
|
-
};
|
|
256
|
-
})
|
|
240
|
+
| (($parse: ng.ParseService) => ng.Directive)
|
|
257
241
|
)[];
|
|
258
242
|
export const ngFormDirective: (
|
|
259
243
|
| string
|
|
260
|
-
| (($parse:
|
|
261
|
-
name: string;
|
|
262
|
-
restrict: string;
|
|
263
|
-
require: string[];
|
|
264
|
-
controller: typeof FormController;
|
|
265
|
-
compile: (
|
|
266
|
-
formElement: any,
|
|
267
|
-
attr: any,
|
|
268
|
-
) => {
|
|
269
|
-
pre: (
|
|
270
|
-
scope: any,
|
|
271
|
-
formElementParam: any,
|
|
272
|
-
attrParam: any,
|
|
273
|
-
ctrls: any,
|
|
274
|
-
) => void;
|
|
275
|
-
};
|
|
276
|
-
})
|
|
244
|
+
| (($parse: ng.ParseService) => ng.Directive)
|
|
277
245
|
)[];
|