@angular-wave/angular.ts 0.4.1 → 0.4.3
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/dist/angular-ts.esm.js +2 -2
- package/dist/angular-ts.umd.js +2 -2
- package/package.json +7 -7
- package/src/angular.spec.js +1 -264
- package/src/animations/animate-css-driver.js +2 -2
- package/src/animations/animate-css.js +7 -8
- package/src/animations/animate-js-driver.js +1 -3
- package/src/animations/animate-js.js +4 -4
- package/src/animations/animate-queue.js +6 -6
- package/src/animations/animation.js +3 -3
- package/src/animations/shared.js +16 -14
- package/src/core/compile/attributes.js +2 -3
- package/src/core/compile/compile.js +248 -232
- package/src/core/compile/compile.spec.js +46 -51
- package/src/core/compile/compile.test.js +1 -1
- package/src/core/interpolate/interpolate.js +2 -2
- package/src/core/interval/interval.test.js +1 -1
- package/src/core/{parser/lexer.html → parse/ast/ast.html} +1 -1
- package/src/core/{parser → parse/ast}/ast.js +43 -29
- package/src/core/parse/ast/ast.spec.js +1462 -0
- package/src/core/parse/ast/ast.test.js +10 -0
- package/src/core/{parser → parse}/interpreter.js +10 -10
- package/src/core/parse/lexer/lexer.html +18 -0
- package/src/core/{parser → parse/lexer}/lexer.js +1 -1
- package/src/core/{parser → parse/lexer}/lexer.spec.js +2 -2
- package/src/core/parse/lexer/lexer.test.js +10 -0
- package/src/core/{parser → parse}/parse.html +1 -1
- package/src/core/{parser → parse}/parse.js +6 -6
- package/src/core/{parser → parse}/parse.spec.js +6 -1725
- package/src/core/parse/parse.test.js +10 -0
- package/src/core/parse/parser/parser.html +18 -0
- package/src/core/{parser → parse/parser}/parser.js +6 -6
- package/src/core/parse/parser/parser.spec.js +8 -0
- package/src/core/parse/parser/parser.test.js +10 -0
- package/src/core/sce/sce.js +1 -2
- package/src/core/scope/scope.js +4 -5
- package/src/directive/attrs/attrs.test.js +11 -0
- package/src/directive/attrs/boolean.html +18 -0
- package/src/directive/attrs/boolean.test.js +11 -0
- package/src/directive/attrs/element-style.html +21 -0
- package/src/directive/attrs/element-style.test.js +11 -0
- package/src/directive/bind/bing-html.spec.js +1 -1
- package/src/directive/class/class.js +1 -1
- package/src/directive/form/form.js +12 -19
- package/src/directive/if/if.spec.js +2 -3
- package/src/directive/if/if.test.js +1 -2
- package/src/directive/include/include.js +2 -2
- package/src/directive/input/input.js +1 -2
- package/src/directive/input/input.spec.js +187 -191
- package/src/directive/list/list.js +2 -2
- package/src/directive/model/model.js +14 -19
- package/src/directive/model-options/model-options.js +22 -26
- package/src/directive/options/options.js +1 -3
- package/src/directive/options/options.spec.js +3 -4
- package/src/directive/repeat/repeat.js +2 -2
- package/src/directive/repeat/repeat.spec.js +48 -57
- package/src/directive/select/select.spec.js +9 -10
- package/src/directive/switch/switch.js +1 -2
- package/src/directive/validators/validators.js +3 -3
- package/src/public.js +1 -1
- package/src/router/directives/state-directives.js +18 -16
- package/src/router/directives/view-directive.js +2 -2
- package/src/router/state/views.js +2 -2
- package/src/router/url/url-service.js +2 -8
- package/src/router/url/url-service.spec.js +3 -4
- package/src/services/http/http.js +5 -6
- package/src/services/http-backend/http-backend.js +19 -17
- package/src/shared/common.js +5 -8
- package/src/shared/jqlite/jqlite.js +14 -12
- package/src/shared/jqlite/jqlite.spec.js +2 -2
- package/src/shared/utils.js +15 -92
- package/types/animations/shared.d.ts +1 -1
- package/types/core/compile/compile.d.ts +1 -1
- package/types/core/interpolate/interpolate.d.ts +1 -1
- package/types/core/{parser → parse/ast}/ast.d.ts +17 -17
- package/types/core/{parser → parse}/interpreter.d.ts +7 -7
- package/types/core/{parser → parse/parser}/parser.d.ts +8 -8
- package/types/core/scope/scope.d.ts +3 -3
- package/types/directive/class/class.d.ts +3 -3
- package/types/directive/form/form.d.ts +1 -0
- package/types/directive/model/model.d.ts +6 -6
- package/types/directive/validators/validators.d.ts +3 -3
- package/types/shared/common.d.ts +0 -1
- package/types/shared/utils.d.ts +0 -35
- package/src/core/parser/parser.test.js +0 -19
- /package/src/core/{parser → parse}/ast-type.js +0 -0
- /package/src/core/{parser → parse}/parse.md +0 -0
- /package/types/core/{parser → parse}/ast-type.d.ts +0 -0
- /package/types/core/{parser → parse/lexer}/lexer.d.ts +0 -0
- /package/types/core/{parser → parse}/parse.d.ts +0 -0
package/src/shared/utils.js
CHANGED
|
@@ -288,86 +288,6 @@ export function snakeCase(name, separator) {
|
|
|
288
288
|
);
|
|
289
289
|
}
|
|
290
290
|
|
|
291
|
-
/**
|
|
292
|
-
* Invokes the `iterator` function once for each item in `obj` collection, which can be either an
|
|
293
|
-
* object or an array. The `iterator` function is invoked with `iterator(value, key, obj)`, where `value`
|
|
294
|
-
* is the value of an object property or an array element, `key` is the object property key or
|
|
295
|
-
* array element index and obj is the `obj` itself. Specifying a `context` for the function is optional.
|
|
296
|
-
*
|
|
297
|
-
* It is worth noting that `.forEach` does not iterate over inherited properties because it filters
|
|
298
|
-
* using the `hasOwnProperty` method.
|
|
299
|
-
*
|
|
300
|
-
* Unlike ES262's
|
|
301
|
-
* [Array.prototype.forEach](http://www.ecma-international.org/ecma-262/5.1/#sec-15.4.4.18),
|
|
302
|
-
* providing 'undefined' or 'null' values for `obj` will not throw a TypeError, but rather just
|
|
303
|
-
* return the value provided.
|
|
304
|
-
*
|
|
305
|
-
```js
|
|
306
|
-
let values = {name: 'misko', gender: 'male'};
|
|
307
|
-
let log = [];
|
|
308
|
-
forEach(values, function(value, key) {
|
|
309
|
-
this.push(key + ': ' + value);
|
|
310
|
-
}, log);
|
|
311
|
-
expect(log).toEqual(['name: misko', 'gender: male']);
|
|
312
|
-
```
|
|
313
|
-
*
|
|
314
|
-
* @param {Object|Array} obj Object to iterate over.
|
|
315
|
-
* @param {Function} iterator Iterator function.
|
|
316
|
-
* @param {Object=} context Object to become context (`this`) for the iterator function.
|
|
317
|
-
* @returns {Object|Array} Reference to `obj`.
|
|
318
|
-
*/
|
|
319
|
-
export function forEach(obj, iterator, context) {
|
|
320
|
-
let key;
|
|
321
|
-
let length;
|
|
322
|
-
if (obj) {
|
|
323
|
-
if (isFunction(obj)) {
|
|
324
|
-
for (key in obj) {
|
|
325
|
-
if (
|
|
326
|
-
key !== "prototype" &&
|
|
327
|
-
key !== "length" &&
|
|
328
|
-
key !== "name" &&
|
|
329
|
-
Object.prototype.hasOwnProperty.call(obj, key)
|
|
330
|
-
) {
|
|
331
|
-
iterator.call(context, obj[key], key, obj);
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
} else if (Array.isArray(obj) || isArrayLike(obj)) {
|
|
335
|
-
const isPrimitive = typeof obj !== "object";
|
|
336
|
-
for (key = 0, length = obj.length; key < length; key++) {
|
|
337
|
-
if (isPrimitive || key in obj) {
|
|
338
|
-
iterator.call(context, obj[key], key, obj);
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
} else if (obj.forEach && obj.forEach !== forEach) {
|
|
342
|
-
obj.forEach(iterator, context, obj);
|
|
343
|
-
} else if (isBlankObject(obj)) {
|
|
344
|
-
// Object.create(null) fast path --- Safe to avoid hasOwnProperty check because prototype chain is empty
|
|
345
|
-
for (key in obj) {
|
|
346
|
-
iterator.call(context, obj[key], key, obj);
|
|
347
|
-
}
|
|
348
|
-
} else {
|
|
349
|
-
// Slow path for objects which do not have a method `hasOwnProperty`
|
|
350
|
-
for (key in obj) {
|
|
351
|
-
if (Object.hasOwnProperty.call(obj, key)) {
|
|
352
|
-
iterator.call(context, obj[key], key, obj);
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
return obj;
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
/**
|
|
361
|
-
* when using forEach the params are value, key, but it is often useful to have key, value.
|
|
362
|
-
* @param {function(string, *):any} iteratorFn
|
|
363
|
-
* @returns {function(*, string)}
|
|
364
|
-
*/
|
|
365
|
-
export function reverseParams(iteratorFn) {
|
|
366
|
-
return function (value, key) {
|
|
367
|
-
iteratorFn(key, value);
|
|
368
|
-
};
|
|
369
|
-
}
|
|
370
|
-
|
|
371
291
|
/**
|
|
372
292
|
* Set or clear the hashkey for an object.
|
|
373
293
|
* @param obj object
|
|
@@ -923,21 +843,24 @@ export function parseKeyValue(keyValue) {
|
|
|
923
843
|
|
|
924
844
|
export function toKeyValue(obj) {
|
|
925
845
|
const parts = [];
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
846
|
+
obj &&
|
|
847
|
+
Object.entries(obj).forEach(([key, value]) => {
|
|
848
|
+
if (Array.isArray(value)) {
|
|
849
|
+
value.forEach((arrayValue) => {
|
|
850
|
+
parts.push(
|
|
851
|
+
encodeUriQuery(key, true) +
|
|
852
|
+
(arrayValue === true
|
|
853
|
+
? ""
|
|
854
|
+
: `=${encodeUriQuery(arrayValue, true)}`),
|
|
855
|
+
);
|
|
856
|
+
});
|
|
857
|
+
} else {
|
|
929
858
|
parts.push(
|
|
930
859
|
encodeUriQuery(key, true) +
|
|
931
|
-
(
|
|
860
|
+
(value === true ? "" : `=${encodeUriQuery(value, true)}`),
|
|
932
861
|
);
|
|
933
|
-
}
|
|
934
|
-
}
|
|
935
|
-
parts.push(
|
|
936
|
-
encodeUriQuery(key, true) +
|
|
937
|
-
(value === true ? "" : `=${encodeUriQuery(value, true)}`),
|
|
938
|
-
);
|
|
939
|
-
}
|
|
940
|
-
});
|
|
862
|
+
}
|
|
863
|
+
});
|
|
941
864
|
return parts.length ? parts.join("&") : "";
|
|
942
865
|
}
|
|
943
866
|
|
|
@@ -62,4 +62,4 @@ export const ANIMATION_DURATION_PROP: string;
|
|
|
62
62
|
export const TRANSITION_DELAY_PROP: string;
|
|
63
63
|
export const TRANSITION_DURATION_PROP: string;
|
|
64
64
|
export const ngMinErr: (arg0: string, ...arg1: any[]) => Error;
|
|
65
|
-
import { JQLite } from "../shared/jqlite/jqlite";
|
|
65
|
+
import { JQLite } from "../shared/jqlite/jqlite.js";
|
|
@@ -99,7 +99,7 @@ export class CompileProvider {
|
|
|
99
99
|
* @returns {object} `this` for chaining
|
|
100
100
|
*/
|
|
101
101
|
addPropertySecurityContext: (elementName: string, propertyName: string, ctx: string) => object;
|
|
102
|
-
$get: (string | (($injector: import("../../core/di/internal-injector").InjectorService, $interpolate: any, $exceptionHandler: import("../exception-handler").ErrorHandler, $templateRequest: any, $parse: import("../
|
|
102
|
+
$get: (string | (($injector: import("../../core/di/internal-injector").InjectorService, $interpolate: any, $exceptionHandler: import("../exception-handler").ErrorHandler, $templateRequest: any, $parse: import("../parse/parse").ParseService, $controller: any, $rootScope: import("../scope/scope").Scope, $sce: any, $animate: any) => ($compileNodes: string | NodeList, transcludeFn: any, maxPriority: any, ignoreDirective: any, previousCompileContext: any) => (scope: any, cloneConnectFn: any, options: any) => JQLite))[];
|
|
103
103
|
}
|
|
104
104
|
export namespace CompileProvider {
|
|
105
105
|
let $inject: string[];
|
|
@@ -29,7 +29,7 @@ export class InterpolateProvider {
|
|
|
29
29
|
* @returns {string|InterpolateProvider} Returns the symbol when used as getter and self if used as setter.
|
|
30
30
|
*/
|
|
31
31
|
endSymbol(value?: string | undefined): string | InterpolateProvider;
|
|
32
|
-
$get: (string | (($parse: import("../
|
|
32
|
+
$get: (string | (($parse: import("../parse/parse").ParseService, $sce: any) => {
|
|
33
33
|
(text: string, mustHaveExpression?: boolean | undefined, trustedContext?: string | undefined, allOrNothing?: boolean | undefined): Function;
|
|
34
34
|
/**
|
|
35
35
|
* Symbol to denote the start of expression in the interpolated string. Defaults to `{{`.
|
|
@@ -32,11 +32,11 @@ export const literals: Map<string, any>;
|
|
|
32
32
|
*/
|
|
33
33
|
export class AST {
|
|
34
34
|
/**
|
|
35
|
-
* @param {import('
|
|
35
|
+
* @param {import('../lexer/lexer.js').Lexer} lexer - The lexer instance for tokenizing input
|
|
36
36
|
*/
|
|
37
|
-
constructor(lexer: import("
|
|
38
|
-
/** @type {import('
|
|
39
|
-
lexer: import("
|
|
37
|
+
constructor(lexer: import("../lexer/lexer.js").Lexer);
|
|
38
|
+
/** @type {import('../lexer/lexer.js').Lexer} */
|
|
39
|
+
lexer: import("../lexer/lexer.js").Lexer;
|
|
40
40
|
selfReferential: {
|
|
41
41
|
this: {
|
|
42
42
|
type: 15;
|
|
@@ -52,7 +52,7 @@ export class AST {
|
|
|
52
52
|
*/
|
|
53
53
|
ast(text: string): ASTNode;
|
|
54
54
|
text: string;
|
|
55
|
-
tokens: import("
|
|
55
|
+
tokens: import("../lexer/lexer.js").Token[];
|
|
56
56
|
/**
|
|
57
57
|
* Parses a program.
|
|
58
58
|
* @returns {ASTNode} The program node.
|
|
@@ -152,39 +152,39 @@ export class AST {
|
|
|
152
152
|
/**
|
|
153
153
|
* Throws a syntax error.
|
|
154
154
|
* @param {string} msg - The error message.
|
|
155
|
-
* @param {import("
|
|
155
|
+
* @param {import("../lexer/lexer.js").Token} [token] - The token that caused the error.
|
|
156
156
|
*/
|
|
157
|
-
throwError(msg: string, token?: import("
|
|
157
|
+
throwError(msg: string, token?: import("../lexer/lexer.js").Token): void;
|
|
158
158
|
/**
|
|
159
159
|
* Consumes a token if it matches the expected type.
|
|
160
160
|
* @param {string} [e1] - The expected token type.
|
|
161
|
-
* @returns {import("
|
|
161
|
+
* @returns {import("../lexer/lexer.js").Token} The consumed token.
|
|
162
162
|
*/
|
|
163
|
-
consume(e1?: string): import("
|
|
163
|
+
consume(e1?: string): import("../lexer/lexer.js").Token;
|
|
164
164
|
/**
|
|
165
165
|
* Returns the next token without consuming it.
|
|
166
|
-
* @returns {import("
|
|
166
|
+
* @returns {import("../lexer/lexer.js").Token} The next token.
|
|
167
167
|
*/
|
|
168
|
-
peekToken(): import("
|
|
168
|
+
peekToken(): import("../lexer/lexer.js").Token;
|
|
169
169
|
/**
|
|
170
170
|
* Checks if the next token matches any of the expected types.
|
|
171
171
|
* @param {...string} [expected] - The expected token types.
|
|
172
|
-
* @returns {import('
|
|
172
|
+
* @returns {import('../lexer/lexer.js').Token|boolean} The next token if it matches, otherwise false.
|
|
173
173
|
*/
|
|
174
|
-
peek(...expected?: string[]): import("
|
|
174
|
+
peek(...expected?: string[]): import("../lexer/lexer.js").Token | boolean;
|
|
175
175
|
/**
|
|
176
176
|
* Checks if the token at the specified index matches any of the expected types.
|
|
177
177
|
* @param {number} i - The index to check.
|
|
178
178
|
* @param {...string} [expected] - The expected token types.
|
|
179
|
-
* @returns {import("
|
|
179
|
+
* @returns {import("../lexer/lexer.js").Token|boolean} The token at the specified index if it matches, otherwise false.
|
|
180
180
|
*/
|
|
181
|
-
peekAhead(i: number, ...expected?: string[]): import("
|
|
181
|
+
peekAhead(i: number, ...expected?: string[]): import("../lexer/lexer.js").Token | boolean;
|
|
182
182
|
/**
|
|
183
183
|
* Consumes the next token if it matches any of the expected types.
|
|
184
184
|
* @param {...string} [expected] - The expected token types.
|
|
185
|
-
* @returns {import("
|
|
185
|
+
* @returns {import("../lexer/lexer.js").Token|boolean} The consumed token if it matches, otherwise false.
|
|
186
186
|
*/
|
|
187
|
-
expect(...expected?: string[]): import("
|
|
187
|
+
expect(...expected?: string[]): import("../lexer/lexer.js").Token | boolean;
|
|
188
188
|
}
|
|
189
189
|
export type ASTNode = {
|
|
190
190
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @param {import("./ast").ASTNode} ast
|
|
2
|
+
* @param {import("./ast/ast").ASTNode} ast
|
|
3
3
|
* @returns {boolean}
|
|
4
4
|
*/
|
|
5
|
-
export function isAssignable(ast: import("./ast").ASTNode): boolean;
|
|
5
|
+
export function isAssignable(ast: import("./ast/ast").ASTNode): boolean;
|
|
6
6
|
export const PURITY_ABSOLUTE: 1;
|
|
7
7
|
export const PURITY_RELATIVE: 2;
|
|
8
8
|
export class ASTInterpreter {
|
|
@@ -13,18 +13,18 @@ export class ASTInterpreter {
|
|
|
13
13
|
$filter: (arg0: any) => any;
|
|
14
14
|
/**
|
|
15
15
|
* Compiles the AST into a function.
|
|
16
|
-
* @param {import("./ast").ASTNode} ast - The AST to compile.
|
|
16
|
+
* @param {import("./ast/ast").ASTNode} ast - The AST to compile.
|
|
17
17
|
* @returns {import("./parse").CompiledExpression}
|
|
18
18
|
*/
|
|
19
|
-
compile(ast: import("./ast").ASTNode): import("./parse").CompiledExpression;
|
|
19
|
+
compile(ast: import("./ast/ast").ASTNode): import("./parse").CompiledExpression;
|
|
20
20
|
/**
|
|
21
21
|
* Recurses the AST nodes.
|
|
22
|
-
* @param {import("./ast").ASTNode} ast - The AST node.
|
|
22
|
+
* @param {import("./ast/ast").ASTNode} ast - The AST node.
|
|
23
23
|
* @param {Object} [context] - The context.
|
|
24
24
|
* @param {boolean|1} [create] - The create flag.
|
|
25
25
|
* @returns {import("./parse").CompiledExpressionFunction} The recursive function.
|
|
26
26
|
*/
|
|
27
|
-
recurse(ast: import("./ast").ASTNode, context?: any, create?: boolean | 1): import("./parse").CompiledExpressionFunction;
|
|
27
|
+
recurse(ast: import("./ast/ast").ASTNode, context?: any, create?: boolean | 1): import("./parse").CompiledExpressionFunction;
|
|
28
28
|
/**
|
|
29
29
|
* Unary plus operation.
|
|
30
30
|
* @param {function} argument - The argument function.
|
|
@@ -204,7 +204,7 @@ export class ASTInterpreter {
|
|
|
204
204
|
*/
|
|
205
205
|
nonComputedMember(left: Function, right: string, context?: any, create?: boolean | 1): Function;
|
|
206
206
|
}
|
|
207
|
-
export type DecoratedASTNode = import("./ast").ASTNode & {
|
|
207
|
+
export type DecoratedASTNode = import("./ast/ast").ASTNode & {
|
|
208
208
|
isPure: boolean | number;
|
|
209
209
|
constant: boolean;
|
|
210
210
|
toWatch: any[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @typedef {Object} ParsedAST
|
|
3
|
-
* @property {import("
|
|
3
|
+
* @property {import("../ast/ast.js").ASTNode} ast - AST representation of expression
|
|
4
4
|
* @property {boolean} oneTime - True if expression should be evaluated only once
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
export class Parser {
|
|
10
10
|
/**
|
|
11
11
|
*
|
|
12
|
-
* @param {import('
|
|
12
|
+
* @param {import('../lexer/lexer.js').Lexer} lexer
|
|
13
13
|
* @param {function(any):any} $filter
|
|
14
14
|
*/
|
|
15
|
-
constructor(lexer: import("
|
|
15
|
+
constructor(lexer: import("../lexer/lexer.js").Lexer, $filter: (arg0: any) => any);
|
|
16
16
|
/** @type {AST} */
|
|
17
17
|
ast: AST;
|
|
18
18
|
/** @type {ASTInterpreter} */
|
|
@@ -20,9 +20,9 @@ export class Parser {
|
|
|
20
20
|
/**
|
|
21
21
|
*
|
|
22
22
|
* @param {string} exp - Expression to be parsed
|
|
23
|
-
* @returns {import("
|
|
23
|
+
* @returns {import("../parse.js").CompiledExpression}
|
|
24
24
|
*/
|
|
25
|
-
parse(exp: string): import("
|
|
25
|
+
parse(exp: string): import("../parse.js").CompiledExpression;
|
|
26
26
|
/**
|
|
27
27
|
* @param {string} exp - Expression to be parsed
|
|
28
28
|
* @returns {ParsedAST}
|
|
@@ -33,11 +33,11 @@ export type ParsedAST = {
|
|
|
33
33
|
/**
|
|
34
34
|
* - AST representation of expression
|
|
35
35
|
*/
|
|
36
|
-
ast: import("
|
|
36
|
+
ast: import("../ast/ast.js").ASTNode;
|
|
37
37
|
/**
|
|
38
38
|
* - True if expression should be evaluated only once
|
|
39
39
|
*/
|
|
40
40
|
oneTime: boolean;
|
|
41
41
|
};
|
|
42
|
-
import { AST } from "
|
|
43
|
-
import { ASTInterpreter } from "
|
|
42
|
+
import { AST } from "../ast/ast.js";
|
|
43
|
+
import { ASTInterpreter } from "../interpreter.js";
|
|
@@ -74,7 +74,7 @@ export const $$applyAsyncQueue: Function[];
|
|
|
74
74
|
*/
|
|
75
75
|
export class RootScopeProvider {
|
|
76
76
|
rootScope: Scope;
|
|
77
|
-
$get: (string | ((exceptionHandler: import("../exception-handler").ErrorHandler, parse: import("../
|
|
77
|
+
$get: (string | ((exceptionHandler: import("../exception-handler").ErrorHandler, parse: import("../parse/parse").ParseService, browser: import("../../services/browser").Browser) => Scope))[];
|
|
78
78
|
}
|
|
79
79
|
/**
|
|
80
80
|
* DESIGN NOTES
|
|
@@ -282,7 +282,7 @@ export class Scope {
|
|
|
282
282
|
*
|
|
283
283
|
*
|
|
284
284
|
*
|
|
285
|
-
* @param {string | ((scope: Scope) => any) | import("../
|
|
285
|
+
* @param {string | ((scope: Scope) => any) | import("../parse/parse.js").CompiledExpression} watchExp Expression that is evaluated on each
|
|
286
286
|
* {@link ng.$rootScope.Scope#$digest $digest} cycle. A change in the return value triggers
|
|
287
287
|
* a call to the `listener`.
|
|
288
288
|
*
|
|
@@ -293,7 +293,7 @@ export class Scope {
|
|
|
293
293
|
* comparing for reference equality.
|
|
294
294
|
* @returns {function()} Returns a deregistration function for this listener.
|
|
295
295
|
*/
|
|
296
|
-
$watch(watchExp: string | ((scope: Scope) => any) | import("../
|
|
296
|
+
$watch(watchExp: string | ((scope: Scope) => any) | import("../parse/parse.js").CompiledExpression, listener?: WatchListener, objectEquality?: boolean | undefined): () => any;
|
|
297
297
|
/**
|
|
298
298
|
* A variant of {@link ng.$rootScope.Scope#$watch $watch()} where it watches an array of `watchExpressions`.
|
|
299
299
|
* If any one expression in the collection changes the `listener` is executed.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export const ngClassDirective: (string | (($parse: import("../../core/
|
|
2
|
-
export const ngClassOddDirective: (string | (($parse: import("../../core/
|
|
3
|
-
export const ngClassEvenDirective: (string | (($parse: import("../../core/
|
|
1
|
+
export const ngClassDirective: (string | (($parse: import("../../core/parse/parse.js").ParseService) => import("../../types").Directive))[];
|
|
2
|
+
export const ngClassOddDirective: (string | (($parse: import("../../core/parse/parse.js").ParseService) => import("../../types").Directive))[];
|
|
3
|
+
export const ngClassEvenDirective: (string | (($parse: import("../../core/parse/parse.js").ParseService) => import("../../types").Directive))[];
|
|
@@ -55,13 +55,13 @@ export class NgModelController {
|
|
|
55
55
|
* @param {import('../../core/exception-handler').ErrorHandler} $exceptionHandler
|
|
56
56
|
* @param {import('../../core/compile/attributes').Attributes} $attr
|
|
57
57
|
* @param {import('../../shared/jqlite/jqlite').JQLite} $element
|
|
58
|
-
* @param {import("../../core/
|
|
58
|
+
* @param {import("../../core/parse/parse").ParseService} $parse
|
|
59
59
|
* @param {*} $animate
|
|
60
60
|
* @param {*} $timeout
|
|
61
61
|
* @param {import("../../core/q/q").QPromise<any>} $q
|
|
62
62
|
* @param {*} $interpolate
|
|
63
63
|
*/
|
|
64
|
-
constructor($scope: import("../../core/scope/scope").Scope, $exceptionHandler: import("../../core/exception-handler").ErrorHandler, $attr: import("../../core/compile/attributes").Attributes, $element: import("../../shared/jqlite/jqlite").JQLite, $parse: import("../../core/
|
|
64
|
+
constructor($scope: import("../../core/scope/scope").Scope, $exceptionHandler: import("../../core/exception-handler").ErrorHandler, $attr: import("../../core/compile/attributes").Attributes, $element: import("../../shared/jqlite/jqlite").JQLite, $parse: import("../../core/parse/parse").ParseService, $animate: any, $timeout: any, $q: import("../../core/q/q").QPromise<any>, $interpolate: any);
|
|
65
65
|
/** @type {any} The actual value from the control's view */
|
|
66
66
|
$viewValue: any;
|
|
67
67
|
/** @type {any} The value in the model that the control is bound to. */
|
|
@@ -108,10 +108,10 @@ export class NgModelController {
|
|
|
108
108
|
};
|
|
109
109
|
$$updateEvents: string;
|
|
110
110
|
$$updateEventHandler(ev: any): void;
|
|
111
|
-
$$parsedNgModel: import("../../core/
|
|
111
|
+
$$parsedNgModel: import("../../core/parse/parse").CompiledExpression;
|
|
112
112
|
$$parsedNgModelAssign: (arg0: any, arg1: any) => any;
|
|
113
|
-
/** @type {import("../../core/
|
|
114
|
-
$$ngModelGet: import("../../core/
|
|
113
|
+
/** @type {import("../../core/parse/parse").CompiledExpression|((Scope) => any)} */
|
|
114
|
+
$$ngModelGet: import("../../core/parse/parse").CompiledExpression | ((Scope: any) => any);
|
|
115
115
|
$$ngModelSet: (arg0: any, arg1: any) => any;
|
|
116
116
|
$$pendingDebounce: any;
|
|
117
117
|
$$parserValid: boolean;
|
|
@@ -127,7 +127,7 @@ export class NgModelController {
|
|
|
127
127
|
$$element: import("../../shared/jqlite/jqlite").JQLite;
|
|
128
128
|
$$animate: any;
|
|
129
129
|
$$timeout: any;
|
|
130
|
-
$$parse: import("../../core/
|
|
130
|
+
$$parse: import("../../core/parse/parse").ParseService;
|
|
131
131
|
$q: import("../../core/q/q").QPromise<any>;
|
|
132
132
|
$$exceptionHandler: import("../../core/exception-handler").ErrorHandler;
|
|
133
133
|
$$hasNativeValidators: boolean;
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* custom controls, `$isEmpty()` can be overwritten to account for a $viewValue that is not string-based.
|
|
22
22
|
*
|
|
23
23
|
*/
|
|
24
|
-
export const requiredDirective: (string | (($parse: import("../../core/
|
|
24
|
+
export const requiredDirective: (string | (($parse: import("../../core/parse/parse.js").ParseService) => import("../../types.js").Directive))[];
|
|
25
25
|
/**
|
|
26
26
|
* @param {String|RegExp} ngPattern AngularJS expression that must evaluate to a `RegExp` or a `String`
|
|
27
27
|
* parsable into a `RegExp`, or a `RegExp` literal. See above for
|
|
@@ -61,7 +61,7 @@ export const requiredDirective: (string | (($parse: import("../../core/parser/pa
|
|
|
61
61
|
* </ol>
|
|
62
62
|
* </div>
|
|
63
63
|
*/
|
|
64
|
-
export const patternDirective: (string | (($parse: import("../../core/
|
|
64
|
+
export const patternDirective: (string | (($parse: import("../../core/parse/parse.js").ParseService) => import("../../types.js").Directive))[];
|
|
65
65
|
/**
|
|
66
66
|
* @param {string} ngMaxlength AngularJS expression that must evaluate to a `Number` or `String`
|
|
67
67
|
* parsable into a `Number`. Used as value for the `maxlength`
|
|
@@ -92,7 +92,7 @@ export const patternDirective: (string | (($parse: import("../../core/parser/par
|
|
|
92
92
|
* </div>
|
|
93
93
|
*
|
|
94
94
|
*/
|
|
95
|
-
export const maxlengthDirective: (string | (($parse: import("../../core/
|
|
95
|
+
export const maxlengthDirective: (string | (($parse: import("../../core/parse/parse.js").ParseService) => import("../../types.js").Directive))[];
|
|
96
96
|
/**
|
|
97
97
|
*
|
|
98
98
|
* @param {string} ngMinlength AngularJS expression that must evaluate to a `Number` or `String`
|
package/types/shared/common.d.ts
CHANGED
package/types/shared/utils.d.ts
CHANGED
|
@@ -163,41 +163,6 @@ export function isArrayBuffer(obj: any): boolean;
|
|
|
163
163
|
*/
|
|
164
164
|
export function trim(value: any): string | any;
|
|
165
165
|
export function snakeCase(name: any, separator: any): any;
|
|
166
|
-
/**
|
|
167
|
-
* Invokes the `iterator` function once for each item in `obj` collection, which can be either an
|
|
168
|
-
* object or an array. The `iterator` function is invoked with `iterator(value, key, obj)`, where `value`
|
|
169
|
-
* is the value of an object property or an array element, `key` is the object property key or
|
|
170
|
-
* array element index and obj is the `obj` itself. Specifying a `context` for the function is optional.
|
|
171
|
-
*
|
|
172
|
-
* It is worth noting that `.forEach` does not iterate over inherited properties because it filters
|
|
173
|
-
* using the `hasOwnProperty` method.
|
|
174
|
-
*
|
|
175
|
-
* Unlike ES262's
|
|
176
|
-
* [Array.prototype.forEach](http://www.ecma-international.org/ecma-262/5.1/#sec-15.4.4.18),
|
|
177
|
-
* providing 'undefined' or 'null' values for `obj` will not throw a TypeError, but rather just
|
|
178
|
-
* return the value provided.
|
|
179
|
-
*
|
|
180
|
-
```js
|
|
181
|
-
let values = {name: 'misko', gender: 'male'};
|
|
182
|
-
let log = [];
|
|
183
|
-
forEach(values, function(value, key) {
|
|
184
|
-
this.push(key + ': ' + value);
|
|
185
|
-
}, log);
|
|
186
|
-
expect(log).toEqual(['name: misko', 'gender: male']);
|
|
187
|
-
```
|
|
188
|
-
*
|
|
189
|
-
* @param {Object|Array} obj Object to iterate over.
|
|
190
|
-
* @param {Function} iterator Iterator function.
|
|
191
|
-
* @param {Object=} context Object to become context (`this`) for the iterator function.
|
|
192
|
-
* @returns {Object|Array} Reference to `obj`.
|
|
193
|
-
*/
|
|
194
|
-
export function forEach(obj: any | any[], iterator: Function, context?: any | undefined): any | any[];
|
|
195
|
-
/**
|
|
196
|
-
* when using forEach the params are value, key, but it is often useful to have key, value.
|
|
197
|
-
* @param {function(string, *):any} iteratorFn
|
|
198
|
-
* @returns {function(*, string)}
|
|
199
|
-
*/
|
|
200
|
-
export function reverseParams(iteratorFn: (arg0: string, arg1: any) => any): (arg0: any, arg1: string) => any;
|
|
201
166
|
/**
|
|
202
167
|
* Set or clear the hashkey for an object.
|
|
203
168
|
* @param obj object
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { test, expect } from "@playwright/test";
|
|
2
|
-
|
|
3
|
-
test("lexer unit tests contain no errors", async ({ page }) => {
|
|
4
|
-
await page.goto("src/core/parser/lexer.html");
|
|
5
|
-
await page.content();
|
|
6
|
-
await page.waitForTimeout(100);
|
|
7
|
-
await expect(page.locator(".jasmine-overall-result")).toHaveText(
|
|
8
|
-
/0 failures/,
|
|
9
|
-
);
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
test("parser unit tests contain no errors", async ({ page }) => {
|
|
13
|
-
await page.goto("src/core/parser/parse.html");
|
|
14
|
-
await page.content();
|
|
15
|
-
await page.waitForTimeout(100);
|
|
16
|
-
await expect(page.locator(".jasmine-overall-result")).toHaveText(
|
|
17
|
-
/0 failures/,
|
|
18
|
-
);
|
|
19
|
-
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|