@angular-wave/angular.ts 0.0.59 → 0.0.61
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/README.md +3 -0
- package/dist/angular-ts.esm.js +2 -2
- package/dist/angular-ts.umd.js +2 -2
- package/package.json +5 -1
- package/src/core/parser/lexer.html +18 -0
- package/src/core/parser/lexer.spec.js +300 -0
- package/src/core/parser/parse.js +19 -0
- package/src/core/parser/parser.js +1 -1
- package/src/core/parser/parser.test.js +19 -0
- package/src/core/q/q.js +46 -289
- package/src/core/q/q.md +229 -0
- package/src/core/sanitize/sanitize-uri.js +2 -3
- package/src/core/scope/scope.js +18 -8
- package/src/directive/if/if.js +6 -1
- package/src/filters/limit-to.js +5 -2
- package/src/loader.js +1 -5
- package/src/router/params/param-type.js +2 -1
- package/src/router/state/views.js +3 -0
- package/src/router/transition/reject-factory.js +1 -0
- package/src/router/url/url-rule.js +1 -1
- package/src/router/url/url-service.js +4 -4
- package/src/services/http/http.js +7 -5
- package/src/services/template-request.js +2 -7
- package/src/shared/common.js +1 -1
- package/src/shared/utils.js +1 -1
- package/src/types.js +9 -1
- package/types/core/parser/parse.d.ts +3 -4
- package/types/core/parser/parser.d.ts +1 -1
- package/types/core/q/q.d.ts +2 -2
- package/types/core/sanitize/sanitize-uri.d.ts +4 -5
- package/types/core/scope/scope.d.ts +19 -7
- package/types/loader.d.ts +0 -4
- package/types/router/params/param-type.d.ts +2 -1
- package/types/router/state/views.d.ts +2 -0
- package/types/router/transition/reject-factory.d.ts +1 -0
- package/types/router/url/url-rule.d.ts +0 -1
- package/types/router/url/url-service.d.ts +7 -7
- package/types/services/template-request.d.ts +4 -9
- package/types/types.d.ts +6 -1
- package/src/core/parser/parse.test.js +0 -12
- package/types-back/README.md +0 -2
- package/types-back/angular.d.ts +0 -146
- package/types-back/index.d.ts +0 -2126
- package/types-back/jqlite.d.ts +0 -374
- package/types-back/router/core/common/common.d.ts +0 -416
- package/types-back/router/core/common/coreservices.d.ts +0 -77
- package/types-back/router/core/common/glob.d.ts +0 -60
- package/types-back/router/core/common/hof.d.ts +0 -168
- package/types-back/router/core/common/index.d.ts +0 -8
- package/types-back/router/core/common/predicates.d.ts +0 -25
- package/types-back/router/core/common/queue.d.ts +0 -15
- package/types-back/router/core/common/safeConsole.d.ts +0 -5
- package/types-back/router/core/common/strings.d.ts +0 -66
- package/types-back/router/core/common/trace.d.ts +0 -126
- package/types-back/router/core/globals.d.ts +0 -43
- package/types-back/router/core/hooks/coreResolvables.d.ts +0 -6
- package/types-back/router/core/hooks/ignoredTransition.d.ts +0 -4
- package/types-back/router/core/hooks/invalidTransition.d.ts +0 -4
- package/types-back/router/core/hooks/lazyLoad.d.ts +0 -17
- package/types-back/router/core/hooks/onEnterExitRetain.d.ts +0 -10
- package/types-back/router/core/hooks/redirectTo.d.ts +0 -4
- package/types-back/router/core/hooks/resolve.d.ts +0 -11
- package/types-back/router/core/hooks/updateGlobals.d.ts +0 -4
- package/types-back/router/core/hooks/url.d.ts +0 -4
- package/types-back/router/core/hooks/views.d.ts +0 -7
- package/types-back/router/core/index.d.ts +0 -11
- package/types-back/router/core/interface.d.ts +0 -91
- package/types-back/router/core/params/index.d.ts +0 -12
- package/types-back/router/core/params/interface.d.ts +0 -606
- package/types-back/router/core/params/param.d.ts +0 -77
- package/types-back/router/core/params/paramType.d.ts +0 -65
- package/types-back/router/core/params/paramTypes.d.ts +0 -193
- package/types-back/router/core/params/stateParams.d.ts +0 -15
- package/types-back/router/core/path/index.d.ts +0 -2
- package/types-back/router/core/path/pathNode.d.ts +0 -60
- package/types-back/router/core/path/pathUtils.d.ts +0 -105
- package/types-back/router/core/resolve/index.d.ts +0 -3
- package/types-back/router/core/resolve/interface.d.ts +0 -210
- package/types-back/router/core/resolve/resolvable.d.ts +0 -75
- package/types-back/router/core/resolve/resolveContext.d.ts +0 -97
- package/types-back/router/core/router.d.ts +0 -57
- package/types-back/router/core/state/index.d.ts +0 -28
- package/types-back/router/core/state/interface.d.ts +0 -732
- package/types-back/router/core/state/stateBuilder.d.ts +0 -107
- package/types-back/router/core/state/stateMatcher.d.ts +0 -13
- package/types-back/router/core/state/stateObject.d.ts +0 -170
- package/types-back/router/core/state/stateQueueManager.d.ts +0 -27
- package/types-back/router/core/state/stateRegistry.d.ts +0 -138
- package/types-back/router/core/state/stateService.d.ts +0 -386
- package/types-back/router/core/state/targetState.d.ts +0 -105
- package/types-back/router/core/transition/hookBuilder.d.ts +0 -49
- package/types-back/router/core/transition/hookRegistry.d.ts +0 -115
- package/types-back/router/core/transition/index.d.ts +0 -20
- package/types-back/router/core/transition/interface.d.ts +0 -862
- package/types-back/router/core/transition/rejectFactory.d.ts +0 -103
- package/types-back/router/core/transition/transition.d.ts +0 -575
- package/types-back/router/core/transition/transitionEventType.d.ts +0 -26
- package/types-back/router/core/transition/transitionHook.d.ts +0 -96
- package/types-back/router/core/transition/transitionService.d.ts +0 -253
- package/types-back/router/core/url/index.d.ts +0 -8
- package/types-back/router/core/url/interface.d.ts +0 -169
- package/types-back/router/core/url/urlConfig.d.ts +0 -144
- package/types-back/router/core/url/urlMatcher.d.ts +0 -185
- package/types-back/router/core/url/urlMatcherFactory.d.ts +0 -56
- package/types-back/router/core/url/urlRouter.d.ts +0 -101
- package/types-back/router/core/url/urlRule.d.ts +0 -143
- package/types-back/router/core/url/urlRules.d.ts +0 -251
- package/types-back/router/core/url/urlService.d.ts +0 -205
- package/types-back/router/core/view/index.d.ts +0 -2
- package/types-back/router/core/view/interface.d.ts +0 -46
- package/types-back/router/core/view/view.d.ts +0 -176
- package/types-back/router/directives/viewDirective.d.ts +0 -144
- package/types-back/router/index.d.ts +0 -17
- package/types-back/router/interface.d.ts +0 -500
- package/types-back/router/legacy/resolveService.d.ts +0 -47
- package/types-back/router/legacy/stateEvents.d.ts +0 -124
- package/types-back/router/services.d.ts +0 -15
- package/types-back/router/stateFilters.d.ts +0 -10
- package/types-back/router/stateProvider.d.ts +0 -258
- package/types-back/router/statebuilders/onEnterExitRetain.d.ts +0 -13
- package/types-back/router/statebuilders/views.d.ts +0 -53
- package/types-back/router/templateFactory.d.ts +0 -104
- package/types-back/router/viewScroll.d.ts +0 -9
package/src/core/scope/scope.js
CHANGED
|
@@ -28,6 +28,20 @@ export const ScopePhase = {
|
|
|
28
28
|
* @property {Object} locals
|
|
29
29
|
*/
|
|
30
30
|
|
|
31
|
+
/**
|
|
32
|
+
* @typedef {function(any, any, Scope): any} WatchListener
|
|
33
|
+
* Callback function triggered whenever the value of `watchExpression` changes.
|
|
34
|
+
*
|
|
35
|
+
* @param {any} newVal - The current value of the `watchExpression`.
|
|
36
|
+
* @param {any} oldVal - The previous value of the `watchExpression`.
|
|
37
|
+
* @param {Scope} scope - The current scope in which the `watchExpression` is evaluated.
|
|
38
|
+
*
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @typedef {string | ((scope: Scope) => any)} WatchExpression
|
|
43
|
+
*/
|
|
44
|
+
|
|
31
45
|
/**
|
|
32
46
|
*
|
|
33
47
|
* The default number of `$digest` iterations the scope should attempt to execute before giving up and
|
|
@@ -378,12 +392,7 @@ export class Scope {
|
|
|
378
392
|
*
|
|
379
393
|
* - `string`: Evaluated as {@link guide/expression expression}
|
|
380
394
|
* - `function(scope)`: called with current `scope` as a parameter.
|
|
381
|
-
* @param {
|
|
382
|
-
* of `watchExpression` changes.
|
|
383
|
-
*
|
|
384
|
-
* - `newVal` contains the current value of the `watchExpression`
|
|
385
|
-
* - `oldVal` contains the previous value of the `watchExpression`
|
|
386
|
-
* - `scope` refers to the current scope
|
|
395
|
+
* @param {WatchListener} listener
|
|
387
396
|
* @param {boolean=} [objectEquality=false] Compare for object equality using {@link angular.equals} instead of
|
|
388
397
|
* comparing for reference equality.
|
|
389
398
|
* @returns {function()} Returns a deregistration function for this listener.
|
|
@@ -687,7 +696,7 @@ export class Scope {
|
|
|
687
696
|
}
|
|
688
697
|
}
|
|
689
698
|
}
|
|
690
|
-
|
|
699
|
+
// TODO: fix this type signature
|
|
691
700
|
return this.$watch(changeDetector, $watchCollectionAction);
|
|
692
701
|
}
|
|
693
702
|
|
|
@@ -1282,7 +1291,8 @@ export class Scope {
|
|
|
1282
1291
|
if (expr) {
|
|
1283
1292
|
$$applyAsyncQueue.push(() => scope.$eval(expr));
|
|
1284
1293
|
}
|
|
1285
|
-
|
|
1294
|
+
// TODO: investigate
|
|
1295
|
+
//expr = $parse(expr);
|
|
1286
1296
|
|
|
1287
1297
|
if (applyAsyncId === null) {
|
|
1288
1298
|
applyAsyncId = $browser.defer(flushApplyAsync, null, "$applyAsync");
|
package/src/directive/if/if.js
CHANGED
|
@@ -17,7 +17,12 @@ export function ngIfDirective($animate) {
|
|
|
17
17
|
terminal: true,
|
|
18
18
|
restrict: "A",
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
*
|
|
21
|
+
* @param {*} $scope
|
|
22
|
+
* @param {*} $element
|
|
23
|
+
* @param {*} $attr
|
|
24
|
+
* @param {*} _ctrl
|
|
25
|
+
* @param {*} $transclude
|
|
21
26
|
*/
|
|
22
27
|
link($scope, $element, $attr, _ctrl, $transclude) {
|
|
23
28
|
/** @type {{clone: import("../../shared/jqlite/jqlite").JQLite }} */
|
package/src/filters/limit-to.js
CHANGED
|
@@ -19,14 +19,17 @@ export function limitToFilter() {
|
|
|
19
19
|
if (Math.abs(Number(limit)) === Infinity) {
|
|
20
20
|
limit = Number(limit);
|
|
21
21
|
} else {
|
|
22
|
-
limit = toInt(limit);
|
|
22
|
+
limit = toInt(/** @type {String} */ (limit));
|
|
23
23
|
}
|
|
24
24
|
if (isNumberNaN(limit)) return input;
|
|
25
25
|
|
|
26
26
|
if (isNumber(input)) input = input.toString();
|
|
27
27
|
if (!isArrayLike(input)) return input;
|
|
28
28
|
|
|
29
|
-
begin =
|
|
29
|
+
begin =
|
|
30
|
+
!begin || isNaN(/** @type {any} */ (begin))
|
|
31
|
+
? 0
|
|
32
|
+
: toInt(/** @type {String} */ (begin));
|
|
30
33
|
begin =
|
|
31
34
|
begin < 0 ? Math.max(0, /** @type {[]} */ (input).length + begin) : begin;
|
|
32
35
|
|
package/src/loader.js
CHANGED
|
@@ -275,10 +275,6 @@ export class Angular {
|
|
|
275
275
|
}
|
|
276
276
|
|
|
277
277
|
/**
|
|
278
|
-
* @ngdoc function
|
|
279
|
-
* @name angular.module
|
|
280
|
-
* @module ng
|
|
281
|
-
* @description
|
|
282
278
|
*
|
|
283
279
|
* The `angular.module` is a global place for creating, registering and retrieving AngularJS
|
|
284
280
|
* modules.
|
|
@@ -414,7 +410,7 @@ export class Angular {
|
|
|
414
410
|
|
|
415
411
|
/**
|
|
416
412
|
* @ngdoc property
|
|
417
|
-
* @
|
|
413
|
+
* @type import('./types').Module#requires
|
|
418
414
|
* @module ng
|
|
419
415
|
*
|
|
420
416
|
* @description
|
|
@@ -35,10 +35,11 @@ export class ParamType {
|
|
|
35
35
|
/** @inheritdoc */
|
|
36
36
|
this.inherit = true;
|
|
37
37
|
Object.assign(this, def);
|
|
38
|
+
this.name = undefined;
|
|
38
39
|
}
|
|
39
40
|
// consider these four methods to be "abstract methods" that should be overridden
|
|
40
41
|
/** @inheritdoc */
|
|
41
|
-
is() {
|
|
42
|
+
is(_val) {
|
|
42
43
|
return true;
|
|
43
44
|
}
|
|
44
45
|
/** @inheritdoc */
|
|
@@ -97,6 +97,8 @@ export class Ng1ViewConfig {
|
|
|
97
97
|
this.path = path;
|
|
98
98
|
this.viewDecl = viewDecl;
|
|
99
99
|
this.factory = factory;
|
|
100
|
+
this.component = undefined;
|
|
101
|
+
this.template = undefined;
|
|
100
102
|
|
|
101
103
|
/** @type {Number} */ this.$id = id++;
|
|
102
104
|
this.loaded = false;
|
|
@@ -110,6 +112,7 @@ export class Ng1ViewConfig {
|
|
|
110
112
|
)
|
|
111
113
|
: this.template;
|
|
112
114
|
}
|
|
115
|
+
|
|
113
116
|
load() {
|
|
114
117
|
const $q = services.$q;
|
|
115
118
|
const context = new ResolveContext(this.path);
|
|
@@ -192,11 +192,11 @@ export class UrlRuleFactory {
|
|
|
192
192
|
}
|
|
193
193
|
UrlRuleFactory.isUrlRule = (obj) =>
|
|
194
194
|
obj && ["type", "match", "handler"].every((key) => isDefined(obj[key]));
|
|
195
|
+
|
|
195
196
|
/**
|
|
196
197
|
* A base rule which calls `match`
|
|
197
198
|
*
|
|
198
199
|
* The value from the `match` function is passed through to the `handler`.
|
|
199
|
-
* @type {angular.BaseUrlRule}
|
|
200
200
|
*/
|
|
201
201
|
export class BaseUrlRule {
|
|
202
202
|
constructor(match, handler) {
|
|
@@ -26,7 +26,7 @@ export class UrlService {
|
|
|
26
26
|
];
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
|
-
* @param {
|
|
29
|
+
* @param {import("../../core/location/location").$LocationProvider} $locationProvider
|
|
30
30
|
*/
|
|
31
31
|
constructor($locationProvider, stateService, globals, urlConfigProvider) {
|
|
32
32
|
this.stateService = stateService;
|
|
@@ -53,7 +53,7 @@ export class UrlService {
|
|
|
53
53
|
* The nested [[UrlConfig]] API to configure the URL and retrieve URL information
|
|
54
54
|
*
|
|
55
55
|
* See: [[UrlConfig]] for details
|
|
56
|
-
* @type {
|
|
56
|
+
* @type {import("./url-config").UrlConfigProvider}
|
|
57
57
|
*/
|
|
58
58
|
this.config = urlConfigProvider;
|
|
59
59
|
|
|
@@ -231,7 +231,7 @@ export class UrlService {
|
|
|
231
231
|
hash: this.hash(),
|
|
232
232
|
};
|
|
233
233
|
/**
|
|
234
|
-
* @type {
|
|
234
|
+
* @type {MatchResult}
|
|
235
235
|
*/
|
|
236
236
|
const best = this.match(url);
|
|
237
237
|
const applyResult = pattern([
|
|
@@ -313,7 +313,7 @@ export class UrlService {
|
|
|
313
313
|
*
|
|
314
314
|
* Given a URL (as a [[UrlParts]] object), check all rules and determine the best matching rule.
|
|
315
315
|
* Return the result as a [[MatchResult]].
|
|
316
|
-
* @returns {
|
|
316
|
+
* @returns {any}
|
|
317
317
|
*/
|
|
318
318
|
match(url) {
|
|
319
319
|
url = Object.assign({ path: "", search: {}, hash: "" }, url);
|
|
@@ -275,9 +275,9 @@ function headersGetter(headers) {
|
|
|
275
275
|
* This function is used for both request and response transforming
|
|
276
276
|
*
|
|
277
277
|
* @param {*} data Data to transform.
|
|
278
|
-
* @param {function(string=)} headers HTTP headers getter fn.
|
|
278
|
+
* @param {function(string=):any} headers HTTP headers getter fn.
|
|
279
279
|
* @param {number} status HTTP status code of the response.
|
|
280
|
-
* @param {
|
|
280
|
+
* @param {function(...any): any | Array<Function>} fns Function or an array of functions.
|
|
281
281
|
* @returns {*} Transformed data.
|
|
282
282
|
*/
|
|
283
283
|
function transformData(data, headers, status, fns) {
|
|
@@ -285,9 +285,11 @@ function transformData(data, headers, status, fns) {
|
|
|
285
285
|
return fns(data, headers, status);
|
|
286
286
|
}
|
|
287
287
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
288
|
+
if (Array.isArray(fns)) {
|
|
289
|
+
/** @type {Array<function(...any): any>} */ (fns).forEach((fn) => {
|
|
290
|
+
data = fn(data, headers, status);
|
|
291
|
+
});
|
|
292
|
+
}
|
|
291
293
|
|
|
292
294
|
return data;
|
|
293
295
|
}
|
|
@@ -4,11 +4,6 @@ import { extend, isString, isUndefined, minErr } from "../shared/utils";
|
|
|
4
4
|
var $templateRequestMinErr = minErr("$templateRequest");
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* @ngdoc provider
|
|
8
|
-
* @name $templateRequestProvider
|
|
9
|
-
* @this
|
|
10
|
-
*
|
|
11
|
-
* @description
|
|
12
7
|
* Used to configure the options passed to the {@link $http} service when making a template request.
|
|
13
8
|
*
|
|
14
9
|
* For example, it can be used for specifying the "Accept" header that is sent to the server, when
|
|
@@ -27,8 +22,8 @@ export function TemplateRequestProvider() {
|
|
|
27
22
|
* The {@link $templateRequest} will set the `cache` and the `transformResponse` properties of the
|
|
28
23
|
* options if not overridden here.
|
|
29
24
|
*
|
|
30
|
-
* @param {string=}
|
|
31
|
-
* @returns {string|
|
|
25
|
+
* @param {string=} val new value for the {@link $http} options.
|
|
26
|
+
* @returns {string|TemplateRequestProvider} Returns the {@link $http} options when used as getter and self if used as setter.
|
|
32
27
|
*/
|
|
33
28
|
this.httpOptions = function (val) {
|
|
34
29
|
if (val) {
|
package/src/shared/common.js
CHANGED
|
@@ -345,7 +345,7 @@ export function assertFn(predicateOrMap, errMsg = "assert failure") {
|
|
|
345
345
|
return (obj) => {
|
|
346
346
|
const result = predicateOrMap(obj);
|
|
347
347
|
if (!result) {
|
|
348
|
-
throw new Error(
|
|
348
|
+
throw new Error(errMsg);
|
|
349
349
|
}
|
|
350
350
|
return result;
|
|
351
351
|
};
|
package/src/shared/utils.js
CHANGED
|
@@ -894,7 +894,7 @@ export function toJson(obj, pretty) {
|
|
|
894
894
|
if (!isNumber(pretty)) {
|
|
895
895
|
pretty = pretty ? 2 : null;
|
|
896
896
|
}
|
|
897
|
-
return JSON.stringify(obj, toJsonReplacer, pretty);
|
|
897
|
+
return JSON.stringify(obj, toJsonReplacer, /** @type {Number} */ (pretty));
|
|
898
898
|
}
|
|
899
899
|
|
|
900
900
|
/**
|
package/src/types.js
CHANGED
|
@@ -202,12 +202,18 @@
|
|
|
202
202
|
* https://docs.angularjs.org/api/ng/service/$compile#-controller-
|
|
203
203
|
* http://teropa.info/blog/2015/06/09/transclusion.html
|
|
204
204
|
*
|
|
205
|
-
* @typedef {Object}
|
|
205
|
+
* @typedef {Object} TranscludeFunctionObject
|
|
206
206
|
* @property {function(TScope, CloneAttachFunction, import('./shared/jqlite/jqlite').JQLite=, string=): import('./shared/jqlite/jqlite').JQLite} transcludeWithScope
|
|
207
207
|
* @property {function(CloneAttachFunction=, import('./shared/jqlite/jqlite').JQLite=, string=): import('./shared/jqlite/jqlite').JQLite} transcludeWithoutScope
|
|
208
208
|
* @property {function(string): boolean} isSlotFilled - Returns true if the specified slot contains content (i.e., one or more DOM nodes)
|
|
209
209
|
*/
|
|
210
210
|
|
|
211
|
+
/**
|
|
212
|
+
|
|
213
|
+
*
|
|
214
|
+
* @typedef {function(TScope, CloneAttachFunction, import('./shared/jqlite/jqlite').JQLite=, string=): import('./shared/jqlite/jqlite').JQLite} TranscludeFunction
|
|
215
|
+
*/
|
|
216
|
+
|
|
211
217
|
/**
|
|
212
218
|
* @typedef {function(TScope, CloneAttachFunction, import('./shared/jqlite/jqlite').JQLite=, string=): import('./shared/jqlite/jqlite').JQLite} transcludeWithScope
|
|
213
219
|
*/
|
|
@@ -264,6 +270,8 @@
|
|
|
264
270
|
* HTML template URL.
|
|
265
271
|
* @property {boolean | "element" | { [slot: string]: string } | undefined} [transclude]
|
|
266
272
|
* Transclusion options.
|
|
273
|
+
* @property {function(...any): any} [$$addStateInfo]
|
|
274
|
+
* Hidden properties added by router
|
|
267
275
|
*/
|
|
268
276
|
|
|
269
277
|
/**
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* @property {boolean} constant - Indicates if the expression is constant.
|
|
5
5
|
* @property {boolean} isPure
|
|
6
6
|
* @property {boolean} oneTime
|
|
7
|
+
* @property {function(import('../scope/scope').Scope, import('../scope/scope').WatchListener, boolean, CompiledExpression, string | ((scope: import('../scope/scope').Scope) => any)): any} $$watchDelegate
|
|
7
8
|
* @property {any[]} inputs
|
|
8
9
|
* @property {function(any, any): any} assign - Assigns a value to a context. If value is not provided,
|
|
9
10
|
*/
|
|
@@ -46,10 +47,7 @@ export class $ParseProvider {
|
|
|
46
47
|
* @returns {$ParseProvider}
|
|
47
48
|
*/
|
|
48
49
|
setIdentifierFns: (identifierStart?: (arg0: any) => boolean, identifierContinue?: (arg0: any) => boolean) => $ParseProvider;
|
|
49
|
-
$get: (string | (($filter: any) =>
|
|
50
|
-
(exp: any, interceptorFn: any): any;
|
|
51
|
-
$$getAst: (exp: string) => import("./ast").ASTNode;
|
|
52
|
-
}))[];
|
|
50
|
+
$get: (string | (($filter: (any: any) => any) => ParseService))[];
|
|
53
51
|
}
|
|
54
52
|
export function constantWatchDelegate(scope: any, listener: any, objectEquality: any, parsedExpression: any): any;
|
|
55
53
|
export type CompiledExpressionProps = {
|
|
@@ -63,6 +61,7 @@ export type CompiledExpressionProps = {
|
|
|
63
61
|
constant: boolean;
|
|
64
62
|
isPure: boolean;
|
|
65
63
|
oneTime: boolean;
|
|
64
|
+
$$watchDelegate: (arg0: import("../scope/scope").Scope, arg1: import("../scope/scope").WatchListener, arg2: boolean, arg3: CompiledExpression, arg4: string | ((scope: import("../scope/scope").Scope) => any)) => any;
|
|
66
65
|
inputs: any[];
|
|
67
66
|
/**
|
|
68
67
|
* - Assigns a value to a context. If value is not provided,
|
package/types/core/q/q.d.ts
CHANGED
|
@@ -18,10 +18,10 @@ export class $QProvider {
|
|
|
18
18
|
* This feature is enabled by default.
|
|
19
19
|
*
|
|
20
20
|
* @param {boolean=} value Whether to generate an error when a rejected promise is not handled.
|
|
21
|
-
* @returns {boolean
|
|
21
|
+
* @returns {boolean|$QProvider} Current value when called without a new value or self for
|
|
22
22
|
* chaining otherwise.
|
|
23
23
|
*/
|
|
24
|
-
errorOnUnhandledRejections: (value?: boolean | undefined) => boolean |
|
|
24
|
+
errorOnUnhandledRejections: (value?: boolean | undefined) => boolean | $QProvider;
|
|
25
25
|
}
|
|
26
26
|
export function $$QProvider(): void;
|
|
27
27
|
export class $$QProvider {
|
|
@@ -22,10 +22,10 @@ export class SanitizeUriProvider {
|
|
|
22
22
|
* to the DOM it is inactive and potentially malicious code will not be executed.
|
|
23
23
|
*
|
|
24
24
|
* @param {RegExp=} regexp New regexp to trust urls with.
|
|
25
|
-
* @returns {RegExp|
|
|
25
|
+
* @returns {RegExp|SanitizeUriProvider} Current RegExp if called without value or self for
|
|
26
26
|
* chaining otherwise.
|
|
27
27
|
*/
|
|
28
|
-
aHrefSanitizationTrustedUrlList: (regexp?: RegExp | undefined) => RegExp |
|
|
28
|
+
aHrefSanitizationTrustedUrlList: (regexp?: RegExp | undefined) => RegExp | SanitizeUriProvider;
|
|
29
29
|
/**
|
|
30
30
|
* @description
|
|
31
31
|
* Retrieves or overrides the default regular expression that is used for determining trusted safe
|
|
@@ -45,9 +45,8 @@ export class SanitizeUriProvider {
|
|
|
45
45
|
* to the DOM it is inactive and potentially malicious code will not be executed.
|
|
46
46
|
*
|
|
47
47
|
* @param {RegExp=} regexp New regexp to trust urls with.
|
|
48
|
-
* @returns {RegExp|
|
|
49
|
-
* chaining otherwise.
|
|
48
|
+
* @returns {RegExp|SanitizeUriProvider} Current RegExp if called without value or self for chaining otherwise.
|
|
50
49
|
*/
|
|
51
|
-
imgSrcSanitizationTrustedUrlList: (regexp?: RegExp | undefined) => RegExp |
|
|
50
|
+
imgSrcSanitizationTrustedUrlList: (regexp?: RegExp | undefined) => RegExp | SanitizeUriProvider;
|
|
52
51
|
$get: () => (uri: any, isMediaUrl: any) => any;
|
|
53
52
|
}
|
|
@@ -31,6 +31,18 @@ export type TTL = number;
|
|
|
31
31
|
* @property {Function} fn
|
|
32
32
|
* @property {Object} locals
|
|
33
33
|
*/
|
|
34
|
+
/**
|
|
35
|
+
* @typedef {function(any, any, Scope): any} WatchListener
|
|
36
|
+
* Callback function triggered whenever the value of `watchExpression` changes.
|
|
37
|
+
*
|
|
38
|
+
* @param {any} newVal - The current value of the `watchExpression`.
|
|
39
|
+
* @param {any} oldVal - The previous value of the `watchExpression`.
|
|
40
|
+
* @param {Scope} scope - The current scope in which the `watchExpression` is evaluated.
|
|
41
|
+
*
|
|
42
|
+
*/
|
|
43
|
+
/**
|
|
44
|
+
* @typedef {string | ((scope: Scope) => any)} WatchExpression
|
|
45
|
+
*/
|
|
34
46
|
/**
|
|
35
47
|
*
|
|
36
48
|
* The default number of `$digest` iterations the scope should attempt to execute before giving up and
|
|
@@ -272,17 +284,12 @@ export class Scope {
|
|
|
272
284
|
*
|
|
273
285
|
* - `string`: Evaluated as {@link guide/expression expression}
|
|
274
286
|
* - `function(scope)`: called with current `scope` as a parameter.
|
|
275
|
-
* @param {
|
|
276
|
-
* of `watchExpression` changes.
|
|
277
|
-
*
|
|
278
|
-
* - `newVal` contains the current value of the `watchExpression`
|
|
279
|
-
* - `oldVal` contains the previous value of the `watchExpression`
|
|
280
|
-
* - `scope` refers to the current scope
|
|
287
|
+
* @param {WatchListener} listener
|
|
281
288
|
* @param {boolean=} [objectEquality=false] Compare for object equality using {@link angular.equals} instead of
|
|
282
289
|
* comparing for reference equality.
|
|
283
290
|
* @returns {function()} Returns a deregistration function for this listener.
|
|
284
291
|
*/
|
|
285
|
-
$watch(watchExp: string | ((scope: Scope) => any), listener:
|
|
292
|
+
$watch(watchExp: string | ((scope: Scope) => any), listener: WatchListener, objectEquality?: boolean | undefined): () => any;
|
|
286
293
|
/**
|
|
287
294
|
* @ngdoc method
|
|
288
295
|
* @name $rootScope.Scope#$watchGroup
|
|
@@ -732,3 +739,8 @@ export type AsyncQueueTask = {
|
|
|
732
739
|
fn: Function;
|
|
733
740
|
locals: any;
|
|
734
741
|
};
|
|
742
|
+
/**
|
|
743
|
+
* Callback function triggered whenever the value of `watchExpression` changes.
|
|
744
|
+
*/
|
|
745
|
+
export type WatchListener = (arg0: any, arg1: any, arg2: Scope) => any;
|
|
746
|
+
export type WatchExpression = string | ((scope: Scope) => any);
|
package/types/loader.d.ts
CHANGED
|
@@ -303,10 +303,6 @@ export class Angular {
|
|
|
303
303
|
*/
|
|
304
304
|
injector(modules: any[], strictDi: boolean | null): angular.auto.IInjectorService;
|
|
305
305
|
/**
|
|
306
|
-
* @ngdoc function
|
|
307
|
-
* @name angular.module
|
|
308
|
-
* @module ng
|
|
309
|
-
* @description
|
|
310
306
|
*
|
|
311
307
|
* The `angular.module` is a global place for creating, registering and retrieving AngularJS
|
|
312
308
|
* modules.
|
|
@@ -124,7 +124,6 @@ export namespace UrlRuleFactory {
|
|
|
124
124
|
* A base rule which calls `match`
|
|
125
125
|
*
|
|
126
126
|
* The value from the `match` function is passed through to the `handler`.
|
|
127
|
-
* @type {angular.BaseUrlRule}
|
|
128
127
|
*/
|
|
129
128
|
export class BaseUrlRule {
|
|
130
129
|
constructor(match: any, handler: any);
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
export class UrlService {
|
|
5
5
|
static $inject: string[];
|
|
6
6
|
/**
|
|
7
|
-
* @param {
|
|
7
|
+
* @param {import("../../core/location/location").$LocationProvider} $locationProvider
|
|
8
8
|
*/
|
|
9
|
-
constructor($locationProvider:
|
|
9
|
+
constructor($locationProvider: import("../../core/location/location").$LocationProvider, stateService: any, globals: any, urlConfigProvider: any);
|
|
10
10
|
stateService: any;
|
|
11
|
-
$locationProvider:
|
|
11
|
+
$locationProvider: import("../../core/location/location").$LocationProvider;
|
|
12
12
|
$location: any;
|
|
13
13
|
$browser: any;
|
|
14
14
|
/** @type {boolean} */
|
|
@@ -26,9 +26,9 @@ export class UrlService {
|
|
|
26
26
|
* The nested [[UrlConfig]] API to configure the URL and retrieve URL information
|
|
27
27
|
*
|
|
28
28
|
* See: [[UrlConfig]] for details
|
|
29
|
-
* @type {
|
|
29
|
+
* @type {import("./url-config").UrlConfigProvider}
|
|
30
30
|
*/
|
|
31
|
-
config:
|
|
31
|
+
config: import("./url-config").UrlConfigProvider;
|
|
32
32
|
/** Creates a new [[Param]] for a given location (DefType) */
|
|
33
33
|
paramFactory: ParamFactory;
|
|
34
34
|
/**
|
|
@@ -214,9 +214,9 @@ export class UrlService {
|
|
|
214
214
|
*
|
|
215
215
|
* Given a URL (as a [[UrlParts]] object), check all rules and determine the best matching rule.
|
|
216
216
|
* Return the result as a [[MatchResult]].
|
|
217
|
-
* @returns {
|
|
217
|
+
* @returns {any}
|
|
218
218
|
*/
|
|
219
|
-
match(url: any):
|
|
219
|
+
match(url: any): any;
|
|
220
220
|
update(read: any): void;
|
|
221
221
|
location: any;
|
|
222
222
|
/**
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @ngdoc provider
|
|
3
|
-
* @name $templateRequestProvider
|
|
4
|
-
* @this
|
|
5
|
-
*
|
|
6
|
-
* @description
|
|
7
2
|
* Used to configure the options passed to the {@link $http} service when making a template request.
|
|
8
3
|
*
|
|
9
4
|
* For example, it can be used for specifying the "Accept" header that is sent to the server, when
|
|
10
5
|
* requesting a template.
|
|
11
6
|
*/
|
|
12
|
-
export function TemplateRequestProvider(
|
|
7
|
+
export function TemplateRequestProvider(): void;
|
|
13
8
|
export class TemplateRequestProvider {
|
|
14
9
|
/**
|
|
15
10
|
* @ngdoc method
|
|
@@ -21,10 +16,10 @@ export class TemplateRequestProvider {
|
|
|
21
16
|
* The {@link $templateRequest} will set the `cache` and the `transformResponse` properties of the
|
|
22
17
|
* options if not overridden here.
|
|
23
18
|
*
|
|
24
|
-
* @param {string=}
|
|
25
|
-
* @returns {string|
|
|
19
|
+
* @param {string=} val new value for the {@link $http} options.
|
|
20
|
+
* @returns {string|TemplateRequestProvider} Returns the {@link $http} options when used as getter and self if used as setter.
|
|
26
21
|
*/
|
|
27
|
-
httpOptions: (val
|
|
22
|
+
httpOptions: (val?: string | undefined) => string | TemplateRequestProvider;
|
|
28
23
|
/**
|
|
29
24
|
* @ngdoc service
|
|
30
25
|
* @name $templateRequest
|
package/types/types.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export type CloneAttachFunction = (clonedElement?: import("./shared/jqlite/jqlit
|
|
|
29
29
|
* https://docs.angularjs.org/api/ng/service/$compile#-controller-
|
|
30
30
|
* http://teropa.info/blog/2015/06/09/transclusion.html
|
|
31
31
|
*/
|
|
32
|
-
export type
|
|
32
|
+
export type TranscludeFunctionObject = {
|
|
33
33
|
transcludeWithScope: (arg0: TScope, arg1: CloneAttachFunction, arg2: import("./shared/jqlite/jqlite").JQLite | undefined, arg3: string | undefined) => import("./shared/jqlite/jqlite").JQLite;
|
|
34
34
|
transcludeWithoutScope: (arg0: CloneAttachFunction | undefined, arg1: import("./shared/jqlite/jqlite").JQLite | undefined, arg2: string | undefined) => import("./shared/jqlite/jqlite").JQLite;
|
|
35
35
|
/**
|
|
@@ -37,6 +37,7 @@ export type TranscludeFunction = {
|
|
|
37
37
|
*/
|
|
38
38
|
isSlotFilled: (arg0: string) => boolean;
|
|
39
39
|
};
|
|
40
|
+
export type TranscludeFunction = (arg0: TScope, arg1: CloneAttachFunction, arg2: import("./shared/jqlite/jqlite").JQLite | undefined, arg3: string | undefined) => import("./shared/jqlite/jqlite").JQLite;
|
|
40
41
|
export type transcludeWithScope = (arg0: TScope, arg1: CloneAttachFunction, arg2: import("./shared/jqlite/jqlite").JQLite | undefined, arg3: string | undefined) => import("./shared/jqlite/jqlite").JQLite;
|
|
41
42
|
export type transcludeWithoutScope = (arg0: CloneAttachFunction | undefined, arg1: import("./shared/jqlite/jqlite").JQLite | undefined, arg2: string | undefined) => import("./shared/jqlite/jqlite").JQLite;
|
|
42
43
|
/**
|
|
@@ -128,6 +129,10 @@ export type Directive = {
|
|
|
128
129
|
transclude?: boolean | "element" | {
|
|
129
130
|
[slot: string]: string;
|
|
130
131
|
} | undefined;
|
|
132
|
+
/**
|
|
133
|
+
* Hidden properties added by router
|
|
134
|
+
*/
|
|
135
|
+
$$addStateInfo?: (...args: any[]) => any;
|
|
131
136
|
};
|
|
132
137
|
/**
|
|
133
138
|
* Factory function for creating directives.
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { test, expect } from "@playwright/test";
|
|
2
|
-
|
|
3
|
-
const TEST_URL = "src/core/parser/parse.html";
|
|
4
|
-
|
|
5
|
-
test("unit tests contain no errors", async ({ page }) => {
|
|
6
|
-
await page.goto(TEST_URL);
|
|
7
|
-
await page.content();
|
|
8
|
-
await page.waitForTimeout(100);
|
|
9
|
-
await expect(page.locator(".jasmine-overall-result")).toHaveText(
|
|
10
|
-
/0 failures/,
|
|
11
|
-
);
|
|
12
|
-
});
|
package/types-back/README.md
DELETED