@angular-wave/angular.ts 0.0.49 → 0.0.50

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.
@@ -1,17 +1,17 @@
1
1
  /**
2
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.
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
5
  */
6
6
  /**
7
7
  * Represents a token produced by the lexer.
8
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.
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
15
  */
16
16
  /**
17
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.
@@ -20,7 +20,7 @@
20
20
  export class Lexer {
21
21
  /**
22
22
  * Creates an instance of Lexer.
23
- * @param {LexerOptions} options Lexer options.
23
+ * @param {LexerOptions} options - Lexer options.
24
24
  */
25
25
  constructor(options: LexerOptions);
26
26
  /** @type {LexerOptions} */
@@ -114,11 +114,11 @@ export class Lexer {
114
114
  }
115
115
  export type LexerOptions = {
116
116
  /**
117
- * Custom function to determine if a character is a valid identifier start.
117
+ * - Custom function to determine if a character is a valid identifier start.
118
118
  */
119
119
  isIdentifierStart?: (ch: string, codePoint: number) => boolean;
120
120
  /**
121
- * Custom function to determine if a character is a valid identifier continuation.
121
+ * - Custom function to determine if a character is a valid identifier continuation.
122
122
  */
123
123
  isIdentifierContinue?: (ch: string, codePoint: number) => boolean;
124
124
  };
@@ -127,27 +127,27 @@ export type LexerOptions = {
127
127
  */
128
128
  export type Token = {
129
129
  /**
130
- * Index of the token.
130
+ * - Index of the token.
131
131
  */
132
132
  index: number;
133
133
  /**
134
- * Text of the token.
134
+ * - Text of the token.
135
135
  */
136
136
  text: string;
137
137
  /**
138
- * Indicates if token is an identifier.
138
+ * - Indicates if token is an identifier.
139
139
  */
140
140
  identifier?: boolean;
141
141
  /**
142
- * Indicates if token is a constant.
142
+ * - Indicates if token is a constant.
143
143
  */
144
144
  constant?: boolean;
145
145
  /**
146
- * Value of the token if it's a constant.
146
+ * - Value of the token if it's a constant.
147
147
  */
148
148
  value?: string | number;
149
149
  /**
150
- * Indicates if token is an operator.
150
+ * - Indicates if token is an operator.
151
151
  */
152
152
  operator?: boolean;
153
153
  };
@@ -13,11 +13,6 @@ export class $ParseProvider {
13
13
  **/
14
14
  addLiteral: (literalName: string, literalValue: any) => void;
15
15
  /**
16
- * @ngdoc method
17
- * @name $parseProvider#setIdentifierFns
18
- *
19
- * @description
20
- *
21
16
  * Allows defining the set of characters that are allowed in AngularJS expressions. The function
22
17
  * `identifierStart` will get called to know if a given character is a valid character to be the
23
18
  * first character for an identifier. The function `identifierContinue` will get called to know if
@@ -31,30 +26,34 @@ export class $ParseProvider {
31
26
  * Since this function will be called extensively, keep the implementation of these functions fast,
32
27
  * as the performance of these functions have a direct impact on the expressions parsing speed.
33
28
  *
34
- * @param {function(any):boolean=} identifierStart The function that will decide whether the given character is
29
+ * @param {function(any):boolean} [identifierStart] The function that will decide whether the given character is
35
30
  * a valid identifier start character.
36
- * @param {function(any):boolean=} identifierContinue The function that will decide whether the given character is
31
+ * @param {function(any):boolean} [identifierContinue] The function that will decide whether the given character is
37
32
  * a valid identifier continue character.
33
+ * @returns {$ParseProvider}
38
34
  */
39
- setIdentifierFns: (identifierStart?: ((arg0: any) => boolean) | undefined, identifierContinue?: ((arg0: any) => boolean) | undefined) => this;
35
+ setIdentifierFns: (identifierStart?: (arg0: any) => boolean, identifierContinue?: (arg0: any) => boolean) => $ParseProvider;
40
36
  $get: (string | (($filter: any) => {
41
37
  (exp: any, interceptorFn: any): any;
42
- $$getAst: (exp: any) => {
43
- type: string;
44
- body: {
45
- type: string;
46
- expression: any;
47
- }[];
48
- };
38
+ $$getAst: (exp: string) => import("./ast").ASTNode;
49
39
  }))[];
50
40
  }
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
- };
41
+ export function constantWatchDelegate(scope: any, listener: any, objectEquality: any, parsedExpression: any): any;
42
+ /**
43
+ * @typedef {function} CompiledExpression
44
+ * @param {import('../scope/scope').Scope} context - An object against which any expressions embedded in the strings are evaluated against (typically a scope object).
45
+ * @param {object} [locals] - local variables context object, useful for overriding values in `context`.
46
+ * @returns {any}
47
+ * @property {boolean} literal - Indicates if the expression is a literal.
48
+ * @property {boolean} constant - Indicates if the expression is constant.
49
+ * @property {function(any, any): any} assign - Assigns a value to a context. If value is not provided,
50
+ * undefined is gonna be used since the implementation
51
+ * does not check the parameter. Let's force a value for consistency. If consumer
52
+ * wants to undefine it, pass the undefined value explicitly.
53
+ */
54
+ /**
55
+ * @typedef {function(string|function(import('../scope/scope').Scope):any, function(any, import('../scope/scope').Scope, any):any=, boolean=): CompiledExpression} ParseService
56
+ */
58
57
  export const $parseMinErr: (arg0: string, ...arg1: any[]) => Error;
59
58
  export namespace literals {
60
59
  let _true: boolean;
@@ -65,4 +64,5 @@ export namespace literals {
65
64
  export { _null as null };
66
65
  export let undefined: any;
67
66
  }
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;
67
+ export type CompiledExpression = Function;
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) => CompiledExpression;
@@ -1,3 +1,12 @@
1
+ /**
2
+ * @typedef {Object} ParsedAST
3
+ * @property {import("./ast").ASTNode} ast - AST representation of expression
4
+ * @property {boolean} oneTime - True if expression should be evaluated only once
5
+ */
6
+ /**
7
+ * @typedef {Object} ParserOptions
8
+ * @property {function(string):any} literals
9
+ */
1
10
  /**
2
11
  * @constructor
3
12
  */
@@ -5,24 +14,38 @@ export class Parser {
5
14
  /**
6
15
  *
7
16
  * @param {import('./lexer').Lexer} lexer
8
- * @param {*} $filter
9
- * @param {*} options
17
+ * @param {function(any):any} $filter
18
+ * @param {ParserOptions} options
10
19
  */
11
- constructor(lexer: import("./lexer").Lexer, $filter: any, options: any);
20
+ constructor(lexer: import("./lexer").Lexer, $filter: (arg0: any) => any, options: ParserOptions);
21
+ /** @type {AST} */
12
22
  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
- };
23
+ /** @type {ASTInterpreter} */
24
+ astCompiler: ASTInterpreter;
25
+ /**
26
+ *
27
+ * @param {string} exp - Expression to be parsed
28
+ * @returns
29
+ */
30
+ parse(exp: string): any;
31
+ /**
32
+ * @param {string} exp - Expression to be parsed
33
+ * @returns {ParsedAST}
34
+ */
35
+ getAst(exp: string): ParsedAST;
25
36
  }
37
+ export type ParsedAST = {
38
+ /**
39
+ * - AST representation of expression
40
+ */
41
+ ast: import("./ast").ASTNode;
42
+ /**
43
+ * - True if expression should be evaluated only once
44
+ */
45
+ oneTime: boolean;
46
+ };
47
+ export type ParserOptions = {
48
+ literals: (arg0: string) => any;
49
+ };
26
50
  import { AST } from "./ast";
27
51
  import { ASTInterpreter } from "./interpreter";
28
- import { ASTCompiler } from "./compiler";
@@ -11,7 +11,13 @@ export function ifDefined(v: any, d: any): any;
11
11
  export function plusFn(l: any, r: any): any;
12
12
  export function isStateless($filter: any, filterName: any): boolean;
13
13
  export function isPure(node: any, parentIsPure: any): any;
14
- export function findConstantAndWatchExpressions(ast: any, $filter: any, parentIsPure: any): void;
14
+ /**
15
+ * Decorates ast with constant, toWatch, and isPure properties
16
+ * @param {import("./ast").ASTNode} ast
17
+ * @param {function(any):any} $filter
18
+ * @param {*} parentIsPure
19
+ */
20
+ export function findConstantAndWatchExpressions(ast: import("./ast").ASTNode, $filter: (arg0: any) => any, parentIsPure: any): void;
15
21
  export function getInputs(body: any): any;
16
22
  export function isAssignable(ast: any): boolean;
17
23
  export function assignableAST(ast: any): {
@@ -66,16 +66,16 @@ export class JQLite {
66
66
  /**
67
67
  * Gets or sets data on a parent element
68
68
  * @param {string} name
69
- * @param {any} value
69
+ * @param {any} [value]
70
70
  * @returns {JQLite|any}
71
71
  */
72
- inheritedData(name: string, value: any): JQLite | any;
72
+ inheritedData(name: string, value?: any): JQLite | any;
73
73
  /**
74
74
  * Gets or sets innerHTML on the first element in JQLite collection
75
- * @param {string} value
75
+ * @param {string} [value]
76
76
  * @returns {JQLite|any|undefined}
77
77
  */
78
- html(value: string): JQLite | any | undefined;
78
+ html(value?: string): JQLite | any | undefined;
79
79
  /**
80
80
  * Get the combined text contents of each element in the JQLite collection
81
81
  * or set the text contents of all elements.
package/types/types.d.ts CHANGED
@@ -1,6 +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
+ export type CompiledExpression = Function;
4
4
  export type ComponentOptions = any;
5
5
  export type ControllerConstructor = Function;
6
6
  export type OnChangesObject = any;