@angular-wave/angular.ts 0.0.47 → 0.0.49

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.
Files changed (64) hide show
  1. package/Makefile +3 -0
  2. package/README.md +1 -1
  3. package/css/angular.css +0 -6
  4. package/dist/angular-ts.esm.js +2 -2
  5. package/dist/angular-ts.umd.js +2 -2
  6. package/jsdoc.json +24 -0
  7. package/package.json +6 -2
  8. package/src/angular.spec.js +1 -2
  9. package/src/animations/animate-queue.js +0 -1
  10. package/src/animations/animation.js +1 -1
  11. package/src/animations/raf-scheduler.js +0 -1
  12. package/src/animations/shared.js +1 -1
  13. package/src/core/animate/animate.js +0 -1
  14. package/src/core/compile/compile.md +1 -1
  15. package/src/core/compile/compile.spec.js +49 -47
  16. package/src/core/location/location.spec.js +1 -1
  17. package/src/core/on.spec.js +7 -12
  18. package/src/core/parser/ast-type.js +22 -0
  19. package/src/core/parser/ast.js +426 -0
  20. package/src/core/parser/compiler.js +561 -0
  21. package/src/core/parser/interpreter.js +422 -0
  22. package/src/core/parser/lexer.js +345 -0
  23. package/src/core/parser/parse.js +23 -1984
  24. package/src/core/parser/parse.md +57 -0
  25. package/src/core/parser/parse.spec.js +2 -2
  26. package/src/core/parser/parser.js +45 -0
  27. package/src/core/parser/shared.js +228 -0
  28. package/src/core/prop.spec.js +4 -4
  29. package/src/core/q/q.spec.js +0 -1
  30. package/src/core/sce/sce.js +3 -6
  31. package/src/core/scope/scope.js +33 -21
  32. package/src/core/task-tracker-factory.js +0 -1
  33. package/src/directive/class/class.js +0 -2
  34. package/src/directive/form/form.js +0 -3
  35. package/src/directive/form/form.spec.js +18 -18
  36. package/src/directive/include/include.js +1 -1
  37. package/src/directive/include/include.spec.js +18 -19
  38. package/src/directive/input/input.js +1 -2
  39. package/src/directive/model/model.js +1 -3
  40. package/src/directive/model/model.spec.js +0 -1
  41. package/src/directive/repeat/repeat.spec.js +0 -2
  42. package/src/directive/switch/switch.spec.js +4 -4
  43. package/src/exts/aria/aria.js +0 -1
  44. package/src/filters/filter.spec.js +0 -1
  45. package/src/injector.js +1 -1
  46. package/src/injector.spec.js +0 -5
  47. package/src/loader.js +0 -5
  48. package/src/services/cookie-reader.js +0 -1
  49. package/src/services/http/http.spec.js +0 -2
  50. package/src/shared/constants.js +3 -2
  51. package/src/shared/utils.js +18 -7
  52. package/src/types.js +10 -0
  53. package/types/core/parser/ast-type.d.ts +20 -0
  54. package/types/core/parser/ast.d.ts +86 -0
  55. package/types/core/parser/compiler.d.ts +49 -0
  56. package/types/core/parser/interpreter.d.ts +57 -0
  57. package/types/core/parser/lexer.d.ts +153 -0
  58. package/types/core/parser/parse.d.ts +68 -0
  59. package/types/core/parser/parser.d.ts +28 -0
  60. package/types/core/parser/shared.d.ts +29 -0
  61. package/types/core/scope/scope.d.ts +19 -12
  62. package/types/shared/utils.d.ts +18 -5
  63. package/types/types.d.ts +1 -0
  64. package/types-back/index.d.ts +0 -12
@@ -0,0 +1,86 @@
1
+ /**
2
+ * @param {import('./lexer').Lexer} lexer
3
+ * @param {*} options
4
+ */
5
+ export function AST(lexer: import("./lexer").Lexer, options: any): void;
6
+ export class AST {
7
+ /**
8
+ * @param {import('./lexer').Lexer} lexer
9
+ * @param {*} options
10
+ */
11
+ constructor(lexer: import("./lexer").Lexer, options: any);
12
+ lexer: import("./lexer").Lexer;
13
+ options: any;
14
+ ast(text: any): {
15
+ type: string;
16
+ body: {
17
+ type: string;
18
+ expression: any;
19
+ }[];
20
+ };
21
+ text: any;
22
+ tokens: import("./lexer").Token[];
23
+ program(): {
24
+ type: string;
25
+ body: {
26
+ type: string;
27
+ expression: any;
28
+ }[];
29
+ };
30
+ expressionStatement(): {
31
+ type: string;
32
+ expression: any;
33
+ };
34
+ filterChain(): any;
35
+ expression(): any;
36
+ assignment(): any;
37
+ ternary(): any;
38
+ logicalOR(): any;
39
+ logicalAND(): any;
40
+ equality(): any;
41
+ relational(): any;
42
+ additive(): any;
43
+ multiplicative(): any;
44
+ unary(): any;
45
+ primary(): any;
46
+ filter(baseExpression: any): {
47
+ type: string;
48
+ callee: {
49
+ type: string;
50
+ name: any;
51
+ };
52
+ arguments: any[];
53
+ filter: boolean;
54
+ };
55
+ parseArguments(): any;
56
+ identifier(): {
57
+ type: string;
58
+ name: any;
59
+ };
60
+ constant(): {
61
+ type: string;
62
+ value: any;
63
+ };
64
+ arrayDeclaration(): any;
65
+ object(): {
66
+ type: string;
67
+ properties: {
68
+ type: string;
69
+ kind: string;
70
+ }[];
71
+ };
72
+ throwError(msg: any, token: any): never;
73
+ consume(e1: any): false | import("./lexer").Token;
74
+ peekToken(): import("./lexer").Token;
75
+ peek(e1: any, e2: any, e3: any, e4: any): false | import("./lexer").Token;
76
+ peekAhead(i: any, e1: any, e2: any, e3: any, e4: any): false | import("./lexer").Token;
77
+ expect(e1: any, e2: any, e3: any, e4: any): false | import("./lexer").Token;
78
+ selfReferential: {
79
+ this: {
80
+ type: string;
81
+ };
82
+ $locals: {
83
+ type: string;
84
+ };
85
+ };
86
+ }
@@ -0,0 +1,49 @@
1
+ export function ASTCompiler($filter: any): void;
2
+ export class ASTCompiler {
3
+ constructor($filter: any);
4
+ $filter: any;
5
+ compile(ast: any): any;
6
+ state: {
7
+ nextId: number;
8
+ filters: {};
9
+ fn: {
10
+ vars: any[];
11
+ body: any[];
12
+ own: {};
13
+ };
14
+ assign: {
15
+ vars: any[];
16
+ body: any[];
17
+ own: {};
18
+ };
19
+ inputs: any[];
20
+ };
21
+ stage: string;
22
+ watchFns(): string;
23
+ generateFunction(name: any, params: any): string;
24
+ filterPrefix(): string;
25
+ varsPrefix(section: any): string;
26
+ body(section: any): any;
27
+ recurse(ast: any, intoId: any, nameId: any, recursionFn: any, create: any, skipWatchIdCheck: any): void;
28
+ getHasOwnProperty(element: any, property: any): any;
29
+ assign(id: any, value: any): any;
30
+ filter(filterName: any): any;
31
+ ifDefined(id: any, defaultValue: any): string;
32
+ plus(left: any, right: any): string;
33
+ return_(id: any): void;
34
+ if_(test: any, alternate: any, consequent: any): void;
35
+ not(expression: any): string;
36
+ isNull(expression: any): string;
37
+ notNull(expression: any): string;
38
+ nonComputedMember(left: any, right: any): string;
39
+ computedMember(left: any, right: any): string;
40
+ member(left: any, right: any, computed: any): string;
41
+ getStringValue(item: any): void;
42
+ lazyRecurse(ast: any, intoId: any, nameId: any, recursionFn: any, create: any, skipWatchIdCheck: any): () => void;
43
+ lazyAssign(id: any, value: any): () => void;
44
+ stringEscapeRegex: RegExp;
45
+ stringEscapeFn(c: any): string;
46
+ escape(value: any): any;
47
+ nextId(skip: any, init: any): string;
48
+ current(): any;
49
+ }
@@ -0,0 +1,57 @@
1
+ export function ASTInterpreter($filter: any): void;
2
+ export class ASTInterpreter {
3
+ constructor($filter: any);
4
+ $filter: any;
5
+ compile(ast: any): any;
6
+ recurse(ast: any, context: any, create: any): any;
7
+ "unary+": (argument: any, context: any) => (scope: any, locals: any, assign: any, inputs: any) => any;
8
+ "unary-": (argument: any, context: any) => (scope: any, locals: any, assign: any, inputs: any) => any;
9
+ "unary!": (argument: any, context: any) => (scope: any, locals: any, assign: any, inputs: any) => boolean | {
10
+ value: boolean;
11
+ };
12
+ "binary+": (left: any, right: any, context: any) => (scope: any, locals: any, assign: any, inputs: any) => any;
13
+ "binary-": (left: any, right: any, context: any) => (scope: any, locals: any, assign: any, inputs: any) => number | {
14
+ value: number;
15
+ };
16
+ "binary*": (left: any, right: any, context: any) => (scope: any, locals: any, assign: any, inputs: any) => number | {
17
+ value: number;
18
+ };
19
+ "binary/": (left: any, right: any, context: any) => (scope: any, locals: any, assign: any, inputs: any) => number | {
20
+ value: number;
21
+ };
22
+ "binary%": (left: any, right: any, context: any) => (scope: any, locals: any, assign: any, inputs: any) => number | {
23
+ value: number;
24
+ };
25
+ "binary===": (left: any, right: any, context: any) => (scope: any, locals: any, assign: any, inputs: any) => boolean | {
26
+ value: boolean;
27
+ };
28
+ "binary!==": (left: any, right: any, context: any) => (scope: any, locals: any, assign: any, inputs: any) => boolean | {
29
+ value: boolean;
30
+ };
31
+ "binary==": (left: any, right: any, context: any) => (scope: any, locals: any, assign: any, inputs: any) => boolean | {
32
+ value: boolean;
33
+ };
34
+ "binary!=": (left: any, right: any, context: any) => (scope: any, locals: any, assign: any, inputs: any) => boolean | {
35
+ value: boolean;
36
+ };
37
+ "binary<": (left: any, right: any, context: any) => (scope: any, locals: any, assign: any, inputs: any) => boolean | {
38
+ value: boolean;
39
+ };
40
+ "binary>": (left: any, right: any, context: any) => (scope: any, locals: any, assign: any, inputs: any) => boolean | {
41
+ value: boolean;
42
+ };
43
+ "binary<=": (left: any, right: any, context: any) => (scope: any, locals: any, assign: any, inputs: any) => boolean | {
44
+ value: boolean;
45
+ };
46
+ "binary>=": (left: any, right: any, context: any) => (scope: any, locals: any, assign: any, inputs: any) => boolean | {
47
+ value: boolean;
48
+ };
49
+ "binary&&": (left: any, right: any, context: any) => (scope: any, locals: any, assign: any, inputs: any) => any;
50
+ "binary||": (left: any, right: any, context: any) => (scope: any, locals: any, assign: any, inputs: any) => any;
51
+ "ternary?:": (test: any, alternate: any, consequent: any, context: any) => (scope: any, locals: any, assign: any, inputs: any) => any;
52
+ value(value: any, context: any): () => any;
53
+ identifier(name: any, context: any, create: any): (scope: any, locals: any) => any;
54
+ computedMember(left: any, right: any, context: any, create: any): (scope: any, locals: any, assign: any, inputs: any) => any;
55
+ nonComputedMember(left: any, right: any, context: any, create: any): (scope: any, locals: any, assign: any, inputs: any) => any;
56
+ inputs(input: any, watchId: any): (scope: any, value: any, locals: any, inputs: any) => any;
57
+ }
@@ -0,0 +1,153 @@
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
+ /**
7
+ * Represents a token produced by the lexer.
8
+ * @typedef {Object} Token
9
+ * @property {number} index Index of the token.
10
+ * @property {string} text Text of the token.
11
+ * @property {boolean} [identifier] Indicates if token is an identifier.
12
+ * @property {boolean} [constant] Indicates if token is a constant.
13
+ * @property {string|number} [value] Value of the token if it's a constant.
14
+ * @property {boolean} [operator] Indicates if token is an operator.
15
+ */
16
+ /**
17
+ * Represents a lexer that tokenizes input text. The Lexer takes the original expression string and returns an array of tokens parsed from that string.
18
+ * For example, the string "a + b" would result in tokens for a, +, and b.
19
+ */
20
+ export class Lexer {
21
+ /**
22
+ * Creates an instance of Lexer.
23
+ * @param {LexerOptions} options Lexer options.
24
+ */
25
+ constructor(options: LexerOptions);
26
+ /** @type {LexerOptions} */
27
+ options: LexerOptions;
28
+ /**
29
+ * Tokenizes the input text.
30
+ * @param {string} text Input text to lex.
31
+ * @returns {Array<Token>} Array of tokens.
32
+ */
33
+ lex(text: string): Array<Token>;
34
+ text: string;
35
+ index: number;
36
+ /** @type {Array<Token>} */
37
+ tokens: Array<Token>;
38
+ /**
39
+ * Checks if a character is contained in a set of characters.
40
+ * @param {string} ch Character to check.
41
+ * @param {string} chars Set of characters.
42
+ * @returns {boolean} True if character is in the set, false otherwise.
43
+ */
44
+ is(ch: string, chars: string): boolean;
45
+ /**
46
+ * Peeks at the next character in the text.
47
+ * @param {number} [i=1] Number of characters to peek.
48
+ * @returns {string|false} Next character or false if end of text.
49
+ */
50
+ peek(i?: number): string | false;
51
+ /**
52
+ * Checks if a character is a number.
53
+ * @param {string} ch Character to check.
54
+ * @returns {boolean} True if character is a number, false otherwise.
55
+ */
56
+ isNumber(ch: string): boolean;
57
+ /**
58
+ * Checks if a character is whitespace.
59
+ * @param {string} ch Character to check.
60
+ * @returns {boolean} True if character is whitespace, false otherwise.
61
+ */
62
+ isWhitespace(ch: string): boolean;
63
+ /**
64
+ * Checks if a character is a valid identifier start.
65
+ * @param {string} ch Character to check.
66
+ * @returns {boolean} True if character is a valid identifier start, false otherwise.
67
+ */
68
+ isIdentifierStart(ch: string): boolean;
69
+ /**
70
+ * Checks if a character is a valid identifier continuation.
71
+ * @param {string} ch Character to check.
72
+ * @returns {boolean} True if character is a valid identifier continuation, false otherwise.
73
+ */
74
+ isIdentifierContinue(ch: string): boolean;
75
+ /**
76
+ * Converts a character to its Unicode code point.
77
+ * @param {string} ch Character to convert.
78
+ * @returns {number} Unicode code point.
79
+ */
80
+ codePointAt(ch: string): number;
81
+ /**
82
+ * Peeks at the next multicharacter sequence in the text.
83
+ * @returns {string} Next multicharacter sequence.
84
+ */
85
+ peekMultichar(): string;
86
+ /**
87
+ * Checks if a character is an exponent operator.
88
+ * @param {string} ch Character to check.
89
+ * @returns {boolean} True if character is an exponent operator, false otherwise.
90
+ */
91
+ isExpOperator(ch: string): boolean;
92
+ /**
93
+ * Throws a lexer error.
94
+ * @param {string} error Error message.
95
+ * @param {number} [start] Start index.
96
+ * @param {number} [end] End index.
97
+ * @throws {Error} Lexer error.
98
+ */
99
+ throwError(error: string, start?: number, end?: number): void;
100
+ /**
101
+ * Reads and tokenizes a number from the text.
102
+ */
103
+ readNumber(): void;
104
+ /**
105
+ * Reads and tokenizes an identifier from the text.
106
+ */
107
+ readIdent(): void;
108
+ /**
109
+ * Reads and tokenizes a string from the text.
110
+ * @param {string} quote Quote character used for the string.
111
+ */
112
+ readString(quote: string): void;
113
+ handleUnicodeEscape(): string;
114
+ }
115
+ export type LexerOptions = {
116
+ /**
117
+ * Custom function to determine if a character is a valid identifier start.
118
+ */
119
+ isIdentifierStart?: (ch: string, codePoint: number) => boolean;
120
+ /**
121
+ * Custom function to determine if a character is a valid identifier continuation.
122
+ */
123
+ isIdentifierContinue?: (ch: string, codePoint: number) => boolean;
124
+ };
125
+ /**
126
+ * Represents a token produced by the lexer.
127
+ */
128
+ export type Token = {
129
+ /**
130
+ * Index of the token.
131
+ */
132
+ index: number;
133
+ /**
134
+ * Text of the token.
135
+ */
136
+ text: string;
137
+ /**
138
+ * Indicates if token is an identifier.
139
+ */
140
+ identifier?: boolean;
141
+ /**
142
+ * Indicates if token is a constant.
143
+ */
144
+ constant?: boolean;
145
+ /**
146
+ * Value of the token if it's a constant.
147
+ */
148
+ value?: string | number;
149
+ /**
150
+ * Indicates if token is an operator.
151
+ */
152
+ operator?: boolean;
153
+ };
@@ -0,0 +1,68 @@
1
+ export function $ParseProvider(): void;
2
+ export class $ParseProvider {
3
+ /**
4
+ * @ngdoc method
5
+ * @name $parseProvider#addLiteral
6
+ * @description
7
+ *
8
+ * Configure $parse service to add literal values that will be present as literal at expressions.
9
+ *
10
+ * @param {string} literalName Token for the literal value. The literal name value must be a valid literal name.
11
+ * @param {*} literalValue Value for this literal. All literal values must be primitives or `undefined`.
12
+ *
13
+ **/
14
+ addLiteral: (literalName: string, literalValue: any) => void;
15
+ /**
16
+ * @ngdoc method
17
+ * @name $parseProvider#setIdentifierFns
18
+ *
19
+ * @description
20
+ *
21
+ * Allows defining the set of characters that are allowed in AngularJS expressions. The function
22
+ * `identifierStart` will get called to know if a given character is a valid character to be the
23
+ * first character for an identifier. The function `identifierContinue` will get called to know if
24
+ * a given character is a valid character to be a follow-up identifier character. The functions
25
+ * `identifierStart` and `identifierContinue` will receive as arguments the single character to be
26
+ * identifier and the character code point. These arguments will be `string` and `numeric`. Keep in
27
+ * mind that the `string` parameter can be two characters long depending on the character
28
+ * representation. It is expected for the function to return `true` or `false`, whether that
29
+ * character is allowed or not.
30
+ *
31
+ * Since this function will be called extensively, keep the implementation of these functions fast,
32
+ * as the performance of these functions have a direct impact on the expressions parsing speed.
33
+ *
34
+ * @param {function(any):boolean=} identifierStart The function that will decide whether the given character is
35
+ * a valid identifier start character.
36
+ * @param {function(any):boolean=} identifierContinue The function that will decide whether the given character is
37
+ * a valid identifier continue character.
38
+ */
39
+ setIdentifierFns: (identifierStart?: ((arg0: any) => boolean) | undefined, identifierContinue?: ((arg0: any) => boolean) | undefined) => this;
40
+ $get: (string | (($filter: any) => {
41
+ (exp: any, interceptorFn: any): any;
42
+ $$getAst: (exp: any) => {
43
+ type: string;
44
+ body: {
45
+ type: string;
46
+ expression: any;
47
+ }[];
48
+ };
49
+ }))[];
50
+ }
51
+ export function inputsWatchDelegate(scope: any, listener: any, objectEquality: any, parsedExpression: any): any;
52
+ export function oneTimeWatchDelegate(scope: any, listener: any, objectEquality: any, parsedExpression: any): any;
53
+ export function chainInterceptors(first: any, second: any): {
54
+ (value: any): any;
55
+ $stateful: any;
56
+ $$pure: any;
57
+ };
58
+ export const $parseMinErr: (arg0: string, ...arg1: any[]) => Error;
59
+ export namespace literals {
60
+ let _true: boolean;
61
+ export { _true as true };
62
+ let _false: boolean;
63
+ export { _false as false };
64
+ let _null: any;
65
+ export { _null as null };
66
+ export let undefined: any;
67
+ }
68
+ export type ParseService = (arg0: string | ((arg0: import("../scope/scope").Scope) => any), arg1: ((arg0: any, arg1: import("../scope/scope").Scope, arg2: any) => any) | undefined, arg2: boolean | undefined) => import("../../types").CompiledExpression;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @constructor
3
+ */
4
+ export class Parser {
5
+ /**
6
+ *
7
+ * @param {import('./lexer').Lexer} lexer
8
+ * @param {*} $filter
9
+ * @param {*} options
10
+ */
11
+ constructor(lexer: import("./lexer").Lexer, $filter: any, options: any);
12
+ ast: AST;
13
+ astCompiler: ASTInterpreter | ASTCompiler;
14
+ parse(text: any): any;
15
+ getAst(exp: any): {
16
+ ast: {
17
+ type: string;
18
+ body: {
19
+ type: string;
20
+ expression: any;
21
+ }[];
22
+ };
23
+ oneTime: boolean;
24
+ };
25
+ }
26
+ import { AST } from "./ast";
27
+ import { ASTInterpreter } from "./interpreter";
28
+ import { ASTCompiler } from "./compiler";
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Converts parameter to strings property name for use as keys in an object.
3
+ * Any non-string object, including a number, is typecasted into a string via the toString method.
4
+ * {@link https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Operators/Property_accessors#Property_names}
5
+ *
6
+ * @param {!any} name
7
+ * @returns {string}
8
+ */
9
+ export function getStringValue(name: any): string;
10
+ export function ifDefined(v: any, d: any): any;
11
+ export function plusFn(l: any, r: any): any;
12
+ export function isStateless($filter: any, filterName: any): boolean;
13
+ export function isPure(node: any, parentIsPure: any): any;
14
+ export function findConstantAndWatchExpressions(ast: any, $filter: any, parentIsPure: any): void;
15
+ export function getInputs(body: any): any;
16
+ export function isAssignable(ast: any): boolean;
17
+ export function assignableAST(ast: any): {
18
+ type: string;
19
+ left: any;
20
+ right: {
21
+ type: string;
22
+ };
23
+ operator: string;
24
+ };
25
+ export function isLiteral(ast: any): boolean;
26
+ export function isConstant(ast: any): any;
27
+ export function getValueOf(value: any): any;
28
+ export const PURITY_ABSOLUTE: 1;
29
+ export const PURITY_RELATIVE: 2;
@@ -45,7 +45,10 @@ export const TTL: TTL;
45
45
  /** @type {AsyncQueueTask[]} */
46
46
  export const $$asyncQueue: AsyncQueueTask[];
47
47
  export const $$postDigestQueue: any[];
48
- export const $$applyAsyncQueue: any[];
48
+ /**
49
+ * @type {Function[]}
50
+ */
51
+ export const $$applyAsyncQueue: Function[];
49
52
  /**
50
53
  * Provider responsible for instantiating the initial scope, aka - root scope.
51
54
  * Every application has a single root {@link ng.$rootScope.Scope scope}.
@@ -58,7 +61,7 @@ export const $$applyAsyncQueue: any[];
58
61
  *
59
62
  */
60
63
  export class $RootScopeProvider {
61
- $get: (string | ((exceptionHandler: angular.IExceptionHandlerService, parse: angular.IParseService, browser: any) => Scope))[];
64
+ $get: (string | ((exceptionHandler: import("../exception-handler").ErrorHandler, parse: import("../parser/parse").ParseService, browser: import("../../services/browser").Browser) => Scope))[];
62
65
  }
63
66
  /**
64
67
  * DESIGN NOTES
@@ -100,9 +103,9 @@ export class Scope {
100
103
  */
101
104
  $root: Scope | null;
102
105
  /**
103
- * @type {[]}
106
+ * @type {Array<any>}
104
107
  */
105
- $$watchers: [];
108
+ $$watchers: Array<any>;
106
109
  /**
107
110
  * @type {number}
108
111
  */
@@ -293,10 +296,10 @@ export class Scope {
293
296
  * values are examined for changes on every call to `$digest`.
294
297
  * - The `listener` is called whenever any expression in the `watchExpressions` array changes.
295
298
  *
296
- * @param {Array.<string|Function(scope)>} watchExpressions Array of expressions that will be individually
299
+ * @param {Array.<string|((Scope)=>any)>} watchExpressions Array of expressions that will be individually
297
300
  * watched using {@link ng.$rootScope.Scope#$watch $watch()}
298
301
  *
299
- * @param {function(newValues, oldValues, scope)} listener Callback called whenever the return value of any
302
+ * @param {function(any, any, Scope): any} listener Callback called whenever the return value of any
300
303
  * expression in `watchExpressions` changes
301
304
  * The `newValues` array contains the current values of the `watchExpressions`, with the indexes matching
302
305
  * those of `watchExpression`
@@ -305,7 +308,7 @@ export class Scope {
305
308
  * The `scope` refers to the current scope.
306
309
  * @returns {function()} Returns a de-registration function for all listeners.
307
310
  */
308
- $watchGroup(watchExpressions: any, listener: (arg0: any[], arg1: any[], arg2: scope) => any): () => any;
311
+ $watchGroup(watchExpressions: Array<string | ((Scope: any) => any)>, listener: (arg0: any, arg1: any, arg2: Scope) => any): () => any;
309
312
  /**
310
313
  * @ngdoc method
311
314
  * @name $rootScope.Scope#$watchCollection
@@ -324,12 +327,12 @@ export class Scope {
324
327
  *
325
328
  *
326
329
  *
327
- * @param {string|function(scope)} obj Evaluated as {@link guide/expression expression}. The
330
+ * @param {string|function(Scope):any} obj Evaluated as {@link guide/expression expression}. The
328
331
  * expression value should evaluate to an object or an array which is observed on each
329
332
  * {@link ng.$rootScope.Scope#$digest $digest} cycle. Any shallow change within the
330
333
  * collection will trigger a call to the `listener`.
331
334
  *
332
- * @param {function(newCollection, oldCollection, scope)} listener a callback function called
335
+ * @param {function(any[], any[], Scope):any} listener a callback function called
333
336
  * when a change is detected.
334
337
  * - The `newCollection` object is the newly modified data obtained from the `obj` expression
335
338
  * - The `oldCollection` object is a copy of the former collection data.
@@ -340,7 +343,7 @@ export class Scope {
340
343
  * @returns {function()} Returns a de-registration function for this listener. When the
341
344
  * de-registration function is executed, the internal watch operation is terminated.
342
345
  */
343
- $watchCollection(obj: string | ((arg0: scope) => any), listener: (arg0: newCollection, arg1: oldCollection, arg2: scope) => any): () => any;
346
+ $watchCollection(obj: string | ((arg0: Scope) => any), listener: (arg0: any[], arg1: any[], arg2: Scope) => any): () => any;
344
347
  /**
345
348
  * @ngdoc method
346
349
  * @name $rootScope.Scope#$digest
@@ -627,10 +630,10 @@ export class Scope {
627
630
  * - `defaultPrevented` - `{boolean}`: true if `preventDefault` was called.
628
631
  *
629
632
  * @param {string} name Event name to listen on.
630
- * @param {function(angular.IAngularEvent): any} listener Function to call when the event is emitted.
633
+ * @param {function(any): any} listener Function to call when the event is emitted witn angular.IAngularEvent
631
634
  * @returns {function()} Returns a deregistration function for this listener.
632
635
  */
633
- $on(name: string, listener: (arg0: angular.IAngularEvent) => any): () => any;
636
+ $on(name: string, listener: (arg0: any) => any): () => any;
634
637
  /**
635
638
  * @ngdoc method
636
639
  * @name $rootScope.Scope#$eval
@@ -664,6 +667,10 @@ export class Scope {
664
667
  * @private
665
668
  */
666
669
  private $$postDigest;
670
+ /**
671
+ * @private
672
+ */
673
+ private retry;
667
674
  clearPhase(): void;
668
675
  /**
669
676
  * @param {number} count
@@ -228,7 +228,7 @@ export function forEach(obj: any | any[], iterator: Function, context?: any | un
228
228
  export function forEachSorted(obj: any, iterator: any, context: any): string[];
229
229
  /**
230
230
  * when using forEach the params are value, key, but it is often useful to have key, value.
231
- * @param {function(string, *)} iteratorFn
231
+ * @param {function(string, *):any} iteratorFn
232
232
  * @returns {function(*, string)}
233
233
  */
234
234
  export function reverseParams(iteratorFn: (arg0: string, arg1: any) => any): (arg0: any, arg1: string) => any;
@@ -257,7 +257,7 @@ export function baseExtend(dst: any, objs: any, deep: any): any;
257
257
  * @param {...Object} src Source object(s).
258
258
  * @returns {Object} Reference to `dst`.
259
259
  */
260
- export function extend(dst: any, ...args: any[]): any;
260
+ export function extend(dst: any, ...src: any[]): any;
261
261
  /**
262
262
  * @module angular
263
263
  * @function merge
@@ -293,8 +293,21 @@ export function extend(dst: any, ...args: any[]): any;
293
293
  * @returns {Object} Reference to `dst`.
294
294
  */
295
295
  export function merge(dst: any, ...src: any[]): any;
296
- export function toInt(str: any): number;
296
+ /**
297
+ * @param {string} str
298
+ * @returns {number}
299
+ */
300
+ export function toInt(str: string): number;
301
+ /**
302
+ * @param {any} num
303
+ * @returns {boolean}
304
+ */
297
305
  export function isNumberNaN(num: any): boolean;
306
+ /**
307
+ * @param {Object} parent
308
+ * @param {Object} extra
309
+ * @returns {Object}
310
+ */
298
311
  export function inherit(parent: any, extra: any): any;
299
312
  /**
300
313
  * @module angular
@@ -349,10 +362,10 @@ export function isElement(node: any): boolean;
349
362
  *
350
363
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/nodeName)
351
364
  *
352
- * @param {JQLite|Element} element
365
+ * @param {import('../shared/jqlite/jqlite').JQLite|Element} element
353
366
  * @returns
354
367
  */
355
- export function getNodeName(element: JQLite | Element): string;
368
+ export function getNodeName(element: import("../shared/jqlite/jqlite").JQLite | Element): string;
356
369
  export function includes(array: any, obj: any): boolean;
357
370
  /**
358
371
  * Removes the first occurrence of a specified value from an array.
package/types/types.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export type BootstrapConfig = any;
2
2
  export type Injectable<T_1> = Function | Array<string | Function>;
3
+ export type CompiledExpression = any | ((arg0: any, arg1: any | undefined) => any);
3
4
  export type ComponentOptions = any;
4
5
  export type ControllerConstructor = Function;
5
6
  export type OnChangesObject = any;
@@ -782,18 +782,6 @@ declare namespace angular {
782
782
  ): void;
783
783
  }
784
784
 
785
- interface ICompiledExpression {
786
- (context: any, locals?: any): any;
787
-
788
- literal: boolean;
789
- constant: boolean;
790
-
791
- // If value is not provided, undefined is gonna be used since the implementation
792
- // does not check the parameter. Let's force a value for consistency. If consumer
793
- // whants to undefine it, pass the undefined value explicitly.
794
- assign(context: any, value: any): any;
795
- }
796
-
797
785
  /**
798
786
  * $location - $locationProvider - service in module ng
799
787
  * see https://docs.angularjs.org/api/ng/service/$location