@angular-wave/angular.ts 0.0.38 → 0.0.40
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/Makefile +8 -5
- package/README.md +1 -1
- package/dist/angular-ts.esm.js +2 -1
- package/dist/angular-ts.umd.js +2 -1
- package/package.json +2 -4
- package/rollup.config.js +11 -2
- package/src/angular.spec.js +25 -26
- package/src/animations/animate-css-driver.js +3 -3
- package/src/animations/animate-queue.js +7 -7
- package/src/animations/animation.js +2 -2
- package/src/animations/shared.js +6 -6
- package/src/binding.spec.js +7 -7
- package/src/core/animate/animate.js +5 -5
- package/src/core/animate/animate.spec.js +31 -31
- package/src/core/cache/cache-factory.html +18 -0
- package/src/core/cache/{cache-factor.test.js → cache-factory.test.js} +1 -1
- package/src/core/compile/compile.js +31 -25
- package/src/core/compile/compile.md +2 -2
- package/src/core/cookie-reader.spec.js +2 -2
- package/src/core/core.html +22 -0
- package/src/core/core.test.js +12 -0
- package/src/core/document.spec.js +4 -4
- package/src/core/exception-handler.js +30 -23
- package/src/core/interpolate/interpolate.js +7 -0
- package/src/core/{cache/cache-factor.html → location/location.html} +1 -1
- package/src/core/location/location.js +2 -2
- package/src/core/location/location.spec.js +17 -17
- package/src/core/location/location.test.js +12 -0
- package/src/core/on.spec.js +3 -3
- package/src/core/parser/parse.html +18 -0
- package/src/core/parser/parse.spec.js +1 -1
- package/src/core/parser/parse.test.js +12 -0
- package/src/core/prop.spec.js +3 -4
- package/src/core/pubsub/pubsub.html +18 -0
- package/src/core/pubsub/pubsub.spec.js +1 -1
- package/src/core/pubsub/pubsub.test.js +12 -0
- package/src/core/q/q.html +18 -0
- package/src/core/q/q.js +33 -0
- package/src/core/q/q.test.js +0 -0
- package/src/core/root-element.spec.js +4 -4
- package/src/core/sanitize/sanitize-uri.spec.js +1 -1
- package/src/core/sanitize/sanitize-uri.test.js +12 -0
- package/src/core/sanitize/sanitize.html +21 -0
- package/src/core/sce/sce.html +18 -0
- package/src/core/sce/sce.spec.js +2 -1
- package/src/core/sce/sce.test.js +12 -0
- package/src/core/scope/scope.html +18 -0
- package/src/core/scope/scope.js +5 -8
- package/src/core/scope/scope.spec.js +1 -1
- package/src/core/scope/scope.test.js +12 -0
- package/src/core/task-tracker-factory.js +9 -11
- package/src/core/timeout/timeout.html +18 -0
- package/src/core/timeout/timeout.js +9 -0
- package/src/core/timeout/timeout.spec.js +2 -2
- package/src/core/timeout/timout.test.js +12 -0
- package/src/core/url-utils/url-utils.html +18 -0
- package/src/core/url-utils/url-utils.spec.js +4 -2
- package/src/core/url-utils/url-utils.test.js +12 -0
- package/src/directive/attrs/attrs.spec.js +1 -2
- package/src/directive/attrs/boolean.spec.js +1 -2
- package/src/directive/attrs/element-style.spec.js +6 -7
- package/src/directive/attrs/src.spec.js +1 -2
- package/src/directive/bind/bind.spec.js +1 -2
- package/src/directive/class/class.spec.js +15 -16
- package/src/directive/cloak/cloak.spec.js +3 -4
- package/src/directive/controller/controller.spec.js +4 -5
- package/src/directive/events/click.spec.js +1 -2
- package/src/directive/events/event.spec.js +1 -1
- package/src/directive/events/events.js +7 -0
- package/src/directive/form/form.spec.js +17 -17
- package/src/directive/if/if.spec.js +2 -2
- package/src/directive/include/include.js +2 -2
- package/src/directive/include/include.spec.js +32 -32
- package/src/directive/init/init.spec.js +2 -3
- package/src/directive/input/input.spec.js +3 -3
- package/src/directive/list/list.spec.js +1 -2
- package/src/directive/model/model.js +13 -0
- package/src/directive/model/model.spec.js +4 -5
- package/src/directive/model-options/model-options.spec.js +3 -3
- package/src/directive/non-bindable/non-bindable.spec.js +1 -2
- package/src/directive/options/options.js +5 -5
- package/src/directive/options/options.spec.js +13 -13
- package/src/directive/ref/href.spec.js +1 -2
- package/src/directive/repeat/repeat.spec.js +12 -12
- package/src/directive/script/script.spec.js +2 -3
- package/src/directive/select/select.js +6 -6
- package/src/directive/select/select.spec.js +5 -5
- package/src/directive/show-hide/show-hide.spec.js +12 -13
- package/src/directive/style/style.spec.js +3 -4
- package/src/directive/switch/switch.spec.js +2 -3
- package/src/directive/validators/validators.spec.js +1 -1
- package/src/exts/aria/aria.spec.js +1 -2
- package/src/exts/messages/messages.spec.js +5 -5
- package/src/filters/filter.spec.js +5 -5
- package/src/filters/filters.html +21 -0
- package/src/filters/filters.spec.js +3 -3
- package/src/filters/filters.test.js +12 -0
- package/src/filters/limit-to.md +1 -1
- package/src/filters/limit-to.spec.js +4 -4
- package/src/filters/order-by.spec.js +2 -2
- package/src/index.js +462 -1
- package/src/loader.js +62 -17
- package/src/public.js +6 -2
- package/src/router/directives/state-directives.spec.js +90 -90
- package/src/router/directives/view-directive.js +2 -2
- package/src/router/directives/view-directive.spec.js +9 -9
- package/src/router/state/state.spec.js +2 -4
- package/src/router/template-factory.spec.js +2 -2
- package/src/router/transition/hook-registry.js +2 -2
- package/src/router/view/view.spec.js +1 -1
- package/src/services/browser.js +56 -39
- package/src/services/document.js +16 -13
- package/src/services/log.js +39 -43
- package/src/services/template-request.js +9 -0
- package/src/shared/common.js +0 -3
- package/src/shared/jqlite/jqlite.js +83 -89
- package/src/shared/jqlite/jqlite.spec.js +218 -222
- package/src/shared/strings.js +2 -2
- package/src/shared/test-utils.js +2 -2
- package/src/shared/utils.js +8 -11
- package/src/src.test.js +10 -0
- package/tsconfig.json +1 -1
- package/tsconfig.types.json +11 -0
- package/types/animations/animate-cache.d.ts +7 -7
- package/types/animations/animate-children-directive.d.ts +3 -6
- package/types/animations/animate-swap.d.ts +7 -16
- package/types/animations/animation.d.ts +2 -11
- package/types/animations/raf-scheduler.d.ts +3 -3
- package/types/animations/shared.d.ts +9 -24
- package/types/core/{animate-css.d.ts → animate/animate-css.d.ts} +2 -8
- package/types/core/{cache.d.ts → cache/cache.d.ts} +5 -5
- package/types/core/compile/compile.d.ts +173 -0
- package/types/core/controller/controller.d.ts +32 -0
- package/types/core/exception-handler.d.ts +9 -42
- package/types/core/filter/filter.d.ts +9 -0
- package/types/core/{interpolate.d.ts → interpolate/interpolate.d.ts} +23 -39
- package/types/core/interval/interval-factory.d.ts +4 -0
- package/types/core/{interval.d.ts → interval/interval.d.ts} +1 -1
- package/types/core/location/location.d.ts +209 -0
- package/types/core/pubsub/pubsub.d.ts +156 -0
- package/types/core/q/q.d.ts +65 -0
- package/types/core/sanitize/sanitize-uri.d.ts +53 -0
- package/types/core/{sce.d.ts → sce/sce.d.ts} +80 -86
- package/types/core/scope/scope.d.ts +727 -0
- package/types/core/task-tracker-factory.d.ts +45 -38
- package/types/core/timeout/timeout.d.ts +29 -0
- package/types/core/{urlUtils.d.ts → url-utils/url-utils.d.ts} +2 -7
- package/types/directive/{bind.d.ts → bind/bind.d.ts} +4 -10
- package/types/directive/{class.d.ts → class/class.d.ts} +12 -21
- package/types/directive/controller/controller.d.ts +6 -0
- package/types/directive/events/events.d.ts +5 -0
- package/types/directive/form/form.d.ts +200 -0
- package/types/directive/if/if.d.ts +8 -0
- package/types/directive/include/include.d.ts +14 -0
- package/types/directive/{input.d.ts → input/input.d.ts} +20 -69
- package/types/directive/{model.d.ts → model/model.d.ts} +281 -280
- package/types/directive/options/options.d.ts +9 -0
- package/types/directive/ref/ref.d.ts +5 -0
- package/types/directive/repeat/repeat.d.ts +8 -0
- package/types/directive/{script.d.ts → script/script.d.ts} +5 -8
- package/types/directive/{show-hide.d.ts → show-hide/show-hide.d.ts} +10 -16
- package/types/directive/switch/switch.d.ts +17 -0
- package/types/directive/transclude/transclude.d.ts +4 -0
- package/types/directive/{validators.d.ts → validators/validators.d.ts} +20 -35
- package/types/filters/filters.d.ts +10 -16
- package/types/filters/order-by.d.ts +2 -4
- package/types/index.d.ts +702 -0
- package/types/injector.d.ts +12 -0
- package/types/public.d.ts +5 -0
- package/types/router/common/coreservices.d.ts +2 -2
- package/types/router/common/glob.d.ts +9 -9
- package/types/router/common/queue.d.ts +13 -13
- package/types/router/common/trace.d.ts +43 -43
- package/types/router/directives/view-directive.d.ts +13 -32
- package/types/router/globals.d.ts +20 -20
- package/types/router/hooks/lazy-load.d.ts +2 -11
- package/types/router/hooks/redirect-to.d.ts +1 -4
- package/types/router/hooks/url.d.ts +1 -5
- package/types/router/hooks/views.d.ts +1 -4
- package/types/router/params/param-factory.d.ts +5 -5
- package/types/router/params/param-type.d.ts +35 -35
- package/types/router/params/param-types.d.ts +11 -11
- package/types/router/params/param.d.ts +38 -38
- package/types/router/params/state-params.d.ts +10 -10
- package/types/router/path/path-node.d.ts +34 -34
- package/types/router/path/path-utils.d.ts +73 -77
- package/types/router/resolve/resolvable.d.ts +32 -32
- package/types/router/resolve/resolve-context.d.ts +84 -84
- package/types/router/services.d.ts +4 -9
- package/types/router/state/state-builder.d.ts +27 -27
- package/types/router/state/state-matcher.d.ts +5 -5
- package/types/router/state/state-object.d.ts +58 -58
- package/types/router/state/state-queue-manager.d.ts +10 -16
- package/types/router/state/state-registry.d.ts +100 -107
- package/types/router/state/state-service.d.ts +411 -411
- package/types/router/state/target-state.d.ts +64 -69
- package/types/router/state/views.d.ts +31 -37
- package/types/router/state-filters.d.ts +7 -7
- package/types/router/state-provider.d.ts +105 -105
- package/types/router/template-factory.d.ts +83 -112
- package/types/router/transition/hook-builder.d.ts +25 -25
- package/types/router/transition/hook-registry.d.ts +68 -83
- package/types/router/transition/interface.d.ts +7 -7
- package/types/router/transition/reject-factory.d.ts +34 -34
- package/types/router/transition/transition-event-type.d.ts +9 -18
- package/types/router/transition/transition-hook.d.ts +77 -82
- package/types/router/transition/transition-service.d.ts +82 -99
- package/types/router/transition/transition.d.ts +369 -377
- package/types/router/url/url-config.d.ts +84 -84
- package/types/router/url/url-matcher.d.ts +115 -119
- package/types/router/url/url-rule.d.ts +114 -124
- package/types/router/url/url-rules.d.ts +217 -217
- package/types/router/url/url-service.d.ts +264 -269
- package/types/router/view/view.d.ts +114 -117
- package/types/router/view-scroll.d.ts +2 -2
- package/types/services/anchor-scroll.d.ts +2 -8
- package/types/services/browser.d.ts +157 -135
- package/types/services/cache-factory.d.ts +25 -25
- package/types/services/cookie-reader.d.ts +2 -2
- package/types/services/document.d.ts +13 -9
- package/types/services/http/http.d.ts +145 -0
- package/types/services/{http-backend.d.ts → http-backend/http-backend.d.ts} +3 -35
- package/types/services/log.d.ts +55 -52
- package/types/services/template-request.d.ts +44 -53
- package/types/shared/common.d.ts +4 -20
- package/types/{constants.d.ts → shared/constants.d.ts} +6 -6
- package/types/shared/hof.d.ts +1 -1
- package/types/{jqLite.d.ts → shared/jqlite/jqlite.d.ts} +16 -17
- package/types/shared/test-utils.d.ts +11 -0
- package/types/shared/utils.d.ts +29 -46
- package/types-back/global.d.ts +3 -1
- package/types-back/index.d.ts +3 -296
- package/types/core/compile.d.ts +0 -206
- package/types/core/controller.d.ts +0 -42
- package/types/core/filter.d.ts +0 -9
- package/types/core/interval-factory.d.ts +0 -21
- package/types/core/location.d.ts +0 -234
- package/types/core/pubsub.d.ts +0 -164
- package/types/core/q.d.ts +0 -33
- package/types/core/root-scope.d.ts +0 -754
- package/types/core/sanitize-uri.d.ts +0 -57
- package/types/core/timeout.d.ts +0 -31
- package/types/directive/controller.d.ts +0 -6
- package/types/directive/events.d.ts +0 -12
- package/types/directive/form.d.ts +0 -230
- package/types/directive/if.d.ts +0 -17
- package/types/directive/include.d.ts +0 -33
- package/types/directive/options.d.ts +0 -16
- package/types/directive/ref.d.ts +0 -11
- package/types/directive/repeat.d.ts +0 -23
- package/types/directive/switch.d.ts +0 -23
- package/types/directive/transclude.d.ts +0 -15
- package/types/services/http.d.ts +0 -157
- /package/src/core/cache/{cache-factor.spec.js → cache-factory.spec.js} +0 -0
- /package/types/directive/{attrs.d.ts → attrs/attrs.d.ts} +0 -0
- /package/types/directive/{change.d.ts → change/change.d.ts} +0 -0
- /package/types/directive/{cloak.d.ts → cloak/cloak.d.ts} +0 -0
- /package/types/directive/{init.d.ts → init/init.d.ts} +0 -0
- /package/types/directive/{list.d.ts → list/list.d.ts} +0 -0
- /package/types/directive/{non-bindable.d.ts → non-bindable/non-bindable.d.ts} +0 -0
- /package/types/directive/{style.d.ts → style/style.d.ts} +0 -0
- /package/types/exts/{aria.d.ts → aria/aria.d.ts} +0 -0
- /package/types/exts/{messages.d.ts → messages/messages.d.ts} +0 -0
package/types/core/compile.d.ts
DELETED
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
export function $CompileProvider(
|
|
2
|
-
$provide: any,
|
|
3
|
-
$$sanitizeUriProvider: any,
|
|
4
|
-
): void;
|
|
5
|
-
export class $CompileProvider {
|
|
6
|
-
constructor($provide: any, $$sanitizeUriProvider: any);
|
|
7
|
-
/**
|
|
8
|
-
* @ngdoc method
|
|
9
|
-
* @name $compileProvider#directive
|
|
10
|
-
* @kind function
|
|
11
|
-
*
|
|
12
|
-
* @description
|
|
13
|
-
* Register a new directive with the compiler.
|
|
14
|
-
*
|
|
15
|
-
* @param {string|Object} name Name of the directive in camel-case (i.e. `ngBind` which will match
|
|
16
|
-
* as `ng-bind`), or an object map of directives where the keys are the names and the values
|
|
17
|
-
* are the factories.
|
|
18
|
-
* @param {Function|Array} directiveFactory An injectable directive factory function. See the
|
|
19
|
-
* {@link guide/directive directive guide} and the {@link $compile compile API} for more info.
|
|
20
|
-
* @returns {ng.ICompileProvider} Self for chaining.
|
|
21
|
-
*/
|
|
22
|
-
directive: (
|
|
23
|
-
name: string | any,
|
|
24
|
-
directiveFactory: Function | any[],
|
|
25
|
-
) => ng.ICompileProvider;
|
|
26
|
-
/**
|
|
27
|
-
* @ngdoc method
|
|
28
|
-
* @name $compileProvider#component
|
|
29
|
-
* @module ng
|
|
30
|
-
* @param {string|Object} name Name of the component in camelCase (i.e. `myComp` which will match `<my-comp>`),
|
|
31
|
-
* or an object map of components where the keys are the names and the values are the component definition objects.
|
|
32
|
-
* @param {Object} options Component definition object (a simplified
|
|
33
|
-
* {@link ng.$compile#directive-definition-object directive definition object}),
|
|
34
|
-
* with the following properties (all optional):
|
|
35
|
-
*
|
|
36
|
-
* - `controller` – `{(string|function()=}` – controller constructor function that should be
|
|
37
|
-
* associated with newly created scope or the name of a {@link ng.$compile#-controller-
|
|
38
|
-
* registered controller} if passed as a string. An empty `noop` function by default.
|
|
39
|
-
* - `controllerAs` – `{string=}` – identifier name for to reference the controller in the component's scope.
|
|
40
|
-
* If present, the controller will be published to scope under the `controllerAs` name.
|
|
41
|
-
* If not present, this will default to be `$ctrl`.
|
|
42
|
-
* - `template` – `{string=|function()=}` – html template as a string or a function that
|
|
43
|
-
* returns an html template as a string which should be used as the contents of this component.
|
|
44
|
-
* Empty string by default.
|
|
45
|
-
*
|
|
46
|
-
* If `template` is a function, then it is {@link auto.$injector#invoke injected} with
|
|
47
|
-
* the following locals:
|
|
48
|
-
*
|
|
49
|
-
* - `$element` - Current element
|
|
50
|
-
* - `$attrs` - Current attributes object for the element
|
|
51
|
-
*
|
|
52
|
-
* - `templateUrl` – `{string=|function()=}` – path or function that returns a path to an html
|
|
53
|
-
* template that should be used as the contents of this component.
|
|
54
|
-
*
|
|
55
|
-
* If `templateUrl` is a function, then it is {@link auto.$injector#invoke injected} with
|
|
56
|
-
* the following locals:
|
|
57
|
-
*
|
|
58
|
-
* - `$element` - Current element
|
|
59
|
-
* - `$attrs` - Current attributes object for the element
|
|
60
|
-
*
|
|
61
|
-
* - `bindings` – `{object=}` – defines bindings between DOM attributes and component properties.
|
|
62
|
-
* Component properties are always bound to the component controller and not to the scope.
|
|
63
|
-
* See {@link ng.$compile#-bindtocontroller- `bindToController`}.
|
|
64
|
-
* - `transclude` – `{boolean=}` – whether {@link $compile#transclusion content transclusion} is enabled.
|
|
65
|
-
* Disabled by default.
|
|
66
|
-
* - `require` - `{Object<string, string>=}` - requires the controllers of other directives and binds them to
|
|
67
|
-
* this component's controller. The object keys specify the property names under which the required
|
|
68
|
-
* controllers (object values) will be bound. See {@link ng.$compile#-require- `require`}.
|
|
69
|
-
* - `$...` – additional properties to attach to the directive factory function and the controller
|
|
70
|
-
* constructor function. (This is used by the component router to annotate)
|
|
71
|
-
*
|
|
72
|
-
* @returns {ng.$compileProvider} the compile provider itself, for chaining of function calls.
|
|
73
|
-
* @description
|
|
74
|
-
* Register a **component definition** with the compiler. This is a shorthand for registering a special
|
|
75
|
-
* type of directive, which represents a self-contained UI component in your application. Such components
|
|
76
|
-
* are always isolated (i.e. `scope: {}`) and are always restricted to elements (i.e. `restrict: 'E'`).
|
|
77
|
-
*
|
|
78
|
-
* Component definitions are very simple and do not require as much configuration as defining general
|
|
79
|
-
* directives. Component definitions usually consist only of a template and a controller backing it.
|
|
80
|
-
*
|
|
81
|
-
* In order to make the definition easier, components enforce best practices like use of `controllerAs`,
|
|
82
|
-
* `bindToController`. They always have **isolate scope** and are restricted to elements.
|
|
83
|
-
*
|
|
84
|
-
* Here are a few examples of how you would usually define components:
|
|
85
|
-
*
|
|
86
|
-
* ```js
|
|
87
|
-
* let myMod = angular.module(...);
|
|
88
|
-
* myMod.component('myComp', {
|
|
89
|
-
* template: '<div>My name is {{$ctrl.name}}</div>',
|
|
90
|
-
* controller: function() {
|
|
91
|
-
* this.name = 'shahar';
|
|
92
|
-
* }
|
|
93
|
-
* });
|
|
94
|
-
*
|
|
95
|
-
* myMod.component('myComp', {
|
|
96
|
-
* template: '<div>My name is {{$ctrl.name}}</div>',
|
|
97
|
-
* bindings: {name: '@'}
|
|
98
|
-
* });
|
|
99
|
-
*
|
|
100
|
-
* myMod.component('myComp', {
|
|
101
|
-
* templateUrl: 'views/my-comp.html',
|
|
102
|
-
* controller: 'MyCtrl',
|
|
103
|
-
* controllerAs: 'ctrl',
|
|
104
|
-
* bindings: {name: '@'}
|
|
105
|
-
* });
|
|
106
|
-
*
|
|
107
|
-
* ```
|
|
108
|
-
* For more examples, and an in-depth guide, see the {@link guide/component component guide}.
|
|
109
|
-
*
|
|
110
|
-
* <br />
|
|
111
|
-
* See also {@link ng.$compileProvider#directive $compileProvider.directive()}.
|
|
112
|
-
*/
|
|
113
|
-
component: (name: string | any, options: any) => ng.$compileProvider;
|
|
114
|
-
/**
|
|
115
|
-
* @ngdoc method
|
|
116
|
-
* @name $compileProvider#aHrefSanitizationTrustedUrlList
|
|
117
|
-
* @kind function
|
|
118
|
-
*
|
|
119
|
-
* @description
|
|
120
|
-
* Retrieves or overrides the default regular expression that is used for determining trusted safe
|
|
121
|
-
* urls during a[href] sanitization.
|
|
122
|
-
*
|
|
123
|
-
* The sanitization is a security measure aimed at preventing XSS attacks via html links.
|
|
124
|
-
*
|
|
125
|
-
* Any url about to be assigned to a[href] via data-binding is first normalized and turned into
|
|
126
|
-
* an absolute url. Afterwards, the url is matched against the `aHrefSanitizationTrustedUrlList`
|
|
127
|
-
* regular expression. If a match is found, the original url is written into the dom. Otherwise,
|
|
128
|
-
* the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM.
|
|
129
|
-
*
|
|
130
|
-
* @param {RegExp=} regexp New regexp to trust urls with.
|
|
131
|
-
* @returns {RegExp|ng.ICompileProvider} Current RegExp if called without value or self for
|
|
132
|
-
* chaining otherwise.
|
|
133
|
-
*/
|
|
134
|
-
aHrefSanitizationTrustedUrlList: (
|
|
135
|
-
regexp?: RegExp | undefined,
|
|
136
|
-
) => RegExp | ng.ICompileProvider;
|
|
137
|
-
/**
|
|
138
|
-
* @ngdoc method
|
|
139
|
-
* @name $compileProvider#imgSrcSanitizationTrustedUrlList
|
|
140
|
-
* @kind function
|
|
141
|
-
*
|
|
142
|
-
* @description
|
|
143
|
-
* Retrieves or overrides the default regular expression that is used for determining trusted safe
|
|
144
|
-
* urls during img[src] sanitization.
|
|
145
|
-
*
|
|
146
|
-
* The sanitization is a security measure aimed at prevent XSS attacks via html links.
|
|
147
|
-
*
|
|
148
|
-
* Any url about to be assigned to img[src] via data-binding is first normalized and turned into
|
|
149
|
-
* an absolute url. Afterwards, the url is matched against the `imgSrcSanitizationTrustedUrlList`
|
|
150
|
-
* regular expression. If a match is found, the original url is written into the dom. Otherwise,
|
|
151
|
-
* the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM.
|
|
152
|
-
*
|
|
153
|
-
* @param {RegExp=} regexp New regexp to trust urls with.
|
|
154
|
-
* @returns {RegExp|ng.ICompileProvider} Current RegExp if called without value or self for
|
|
155
|
-
* chaining otherwise.
|
|
156
|
-
*/
|
|
157
|
-
imgSrcSanitizationTrustedUrlList: (
|
|
158
|
-
regexp?: RegExp | undefined,
|
|
159
|
-
) => RegExp | ng.ICompileProvider;
|
|
160
|
-
debugInfoEnabled: (enabled: any) => boolean | this;
|
|
161
|
-
strictComponentBindingsEnabled: (enabled: any) => boolean | this;
|
|
162
|
-
/**
|
|
163
|
-
* @ngdoc method
|
|
164
|
-
* @name $compileProvider#addPropertySecurityContext
|
|
165
|
-
* @description
|
|
166
|
-
*
|
|
167
|
-
* Defines the security context for DOM properties bound by ng-prop-*.
|
|
168
|
-
*
|
|
169
|
-
* @param {string} elementName The element name or '*' to match any element.
|
|
170
|
-
* @param {string} propertyName The DOM property name.
|
|
171
|
-
* @param {string} ctx The {@link $sce} security context in which this value is safe for use, e.g. `$sce.URL`
|
|
172
|
-
* @returns {object} `this` for chaining
|
|
173
|
-
*/
|
|
174
|
-
addPropertySecurityContext: (
|
|
175
|
-
elementName: string,
|
|
176
|
-
propertyName: string,
|
|
177
|
-
ctx: string,
|
|
178
|
-
) => object;
|
|
179
|
-
$get: (
|
|
180
|
-
| string
|
|
181
|
-
| ((
|
|
182
|
-
$injector: any,
|
|
183
|
-
$interpolate: any,
|
|
184
|
-
$exceptionHandler: any,
|
|
185
|
-
$templateRequest: any,
|
|
186
|
-
$parse: any,
|
|
187
|
-
$controller: any,
|
|
188
|
-
$rootScope: any,
|
|
189
|
-
$sce: any,
|
|
190
|
-
$animate: any,
|
|
191
|
-
) => (
|
|
192
|
-
$compileNodes: string | NodeList,
|
|
193
|
-
transcludeFn: any,
|
|
194
|
-
maxPriority: any,
|
|
195
|
-
ignoreDirective: any,
|
|
196
|
-
previousCompileContext: any,
|
|
197
|
-
) => (scope: any, cloneConnectFn: any, options: any) => any)
|
|
198
|
-
)[];
|
|
199
|
-
}
|
|
200
|
-
export namespace $CompileProvider {
|
|
201
|
-
let $inject: string[];
|
|
202
|
-
}
|
|
203
|
-
/**
|
|
204
|
-
* Function that aggregates all linking fns for a compilation root (nodeList)
|
|
205
|
-
*/
|
|
206
|
-
export type CompositeLinkFn = Function;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
export function identifierForController(controller: any, ident: any): any;
|
|
2
|
-
/**
|
|
3
|
-
* @ngdoc provider
|
|
4
|
-
* @name $controllerProvider
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* @description
|
|
8
|
-
* The {@link ng.$controller $controller service} is used by AngularJS to create new
|
|
9
|
-
* controllers.
|
|
10
|
-
*
|
|
11
|
-
* This provider allows controller registration via the
|
|
12
|
-
* {@link ng.$controllerProvider#register register} method.
|
|
13
|
-
*/
|
|
14
|
-
export function $ControllerProvider(): void;
|
|
15
|
-
export class $ControllerProvider {
|
|
16
|
-
/**
|
|
17
|
-
* @ngdoc method
|
|
18
|
-
* @name $controllerProvider#has
|
|
19
|
-
* @param {string} name Controller name to check.
|
|
20
|
-
*/
|
|
21
|
-
has: (name: string) => any;
|
|
22
|
-
/**
|
|
23
|
-
* @ngdoc method
|
|
24
|
-
* @name $controllerProvider#register
|
|
25
|
-
* @param {string|Object} name Controller name, or an object map of controllers where the keys are
|
|
26
|
-
* the names and the values are the constructors.
|
|
27
|
-
* @param {Function|Array} constructor Controller constructor fn (optionally decorated with DI
|
|
28
|
-
* annotations in the array notation).
|
|
29
|
-
*/
|
|
30
|
-
register: (name: string | any, constructor: Function | any[]) => void;
|
|
31
|
-
$get: (
|
|
32
|
-
| string
|
|
33
|
-
| ((
|
|
34
|
-
$injector: any,
|
|
35
|
-
) => (
|
|
36
|
-
expression: Function | string,
|
|
37
|
-
locals: any,
|
|
38
|
-
later: any,
|
|
39
|
-
ident: any,
|
|
40
|
-
) => any)
|
|
41
|
-
)[];
|
|
42
|
-
}
|
package/types/core/filter.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export function $FilterProvider($provide: any): void;
|
|
2
|
-
export class $FilterProvider {
|
|
3
|
-
constructor($provide: any);
|
|
4
|
-
register: (name: any, factory: any) => any;
|
|
5
|
-
$get: (string | (($injector: any) => (name: any) => any))[];
|
|
6
|
-
}
|
|
7
|
-
export namespace $FilterProvider {
|
|
8
|
-
let $inject: string[];
|
|
9
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export function $$IntervalFactoryProvider(): void;
|
|
2
|
-
export class $$IntervalFactoryProvider {
|
|
3
|
-
$get: (
|
|
4
|
-
| string
|
|
5
|
-
| ((
|
|
6
|
-
$browser: any,
|
|
7
|
-
$q: any,
|
|
8
|
-
$$q: any,
|
|
9
|
-
$rootScope: any,
|
|
10
|
-
) => (
|
|
11
|
-
setIntervalFn: any,
|
|
12
|
-
clearIntervalFn: any,
|
|
13
|
-
) => (
|
|
14
|
-
fn: any,
|
|
15
|
-
delay: any,
|
|
16
|
-
count: any,
|
|
17
|
-
invokeApply: any,
|
|
18
|
-
...args: any[]
|
|
19
|
-
) => any)
|
|
20
|
-
)[];
|
|
21
|
-
}
|
package/types/core/location.d.ts
DELETED
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* @param {string} base
|
|
4
|
-
* @param {string} url
|
|
5
|
-
* @returns {string} returns text from `url` after `base` or `undefined` if it does not begin with
|
|
6
|
-
* the expected string.
|
|
7
|
-
*/
|
|
8
|
-
export function stripBaseUrl(base: string, url: string): string;
|
|
9
|
-
export function stripHash(url: any): any;
|
|
10
|
-
export function stripFile(url: any): any;
|
|
11
|
-
export function serverBase(url: any): any;
|
|
12
|
-
/**
|
|
13
|
-
* LocationHtml5Url represents a URL
|
|
14
|
-
* This object is exposed as $location service when HTML5 mode is enabled and supported
|
|
15
|
-
*
|
|
16
|
-
* @constructor
|
|
17
|
-
* @param {string} appBase application base URL
|
|
18
|
-
* @param {string} appBaseNoFile application base URL stripped of any filename
|
|
19
|
-
* @param {string} basePrefix URL path prefix
|
|
20
|
-
*/
|
|
21
|
-
export function LocationHtml5Url(
|
|
22
|
-
appBase: string,
|
|
23
|
-
appBaseNoFile: string,
|
|
24
|
-
basePrefix: string,
|
|
25
|
-
): void;
|
|
26
|
-
export class LocationHtml5Url {
|
|
27
|
-
/**
|
|
28
|
-
* LocationHtml5Url represents a URL
|
|
29
|
-
* This object is exposed as $location service when HTML5 mode is enabled and supported
|
|
30
|
-
*
|
|
31
|
-
* @constructor
|
|
32
|
-
* @param {string} appBase application base URL
|
|
33
|
-
* @param {string} appBaseNoFile application base URL stripped of any filename
|
|
34
|
-
* @param {string} basePrefix URL path prefix
|
|
35
|
-
*/
|
|
36
|
-
constructor(appBase: string, appBaseNoFile: string, basePrefix: string);
|
|
37
|
-
$$html5: boolean;
|
|
38
|
-
/**
|
|
39
|
-
* Parse given HTML5 (regular) URL string into properties
|
|
40
|
-
* @param {string} url HTML5 URL
|
|
41
|
-
* @private
|
|
42
|
-
*/
|
|
43
|
-
private $$parse;
|
|
44
|
-
$$normalizeUrl: (url: any) => string;
|
|
45
|
-
$$parseLinkUrl: (url: any, relHref: any) => boolean;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* LocationHashbangUrl represents URL
|
|
49
|
-
* This object is exposed as $location service when developer doesn't opt into html5 mode.
|
|
50
|
-
* It also serves as the base class for html5 mode fallback on legacy browsers.
|
|
51
|
-
*
|
|
52
|
-
* @constructor
|
|
53
|
-
* @param {string} appBase application base URL
|
|
54
|
-
* @param {string} appBaseNoFile application base URL stripped of any filename
|
|
55
|
-
* @param {string} hashPrefix hashbang prefix
|
|
56
|
-
*/
|
|
57
|
-
export function LocationHashbangUrl(
|
|
58
|
-
appBase: string,
|
|
59
|
-
appBaseNoFile: string,
|
|
60
|
-
hashPrefix: string,
|
|
61
|
-
): void;
|
|
62
|
-
export class LocationHashbangUrl {
|
|
63
|
-
/**
|
|
64
|
-
* LocationHashbangUrl represents URL
|
|
65
|
-
* This object is exposed as $location service when developer doesn't opt into html5 mode.
|
|
66
|
-
* It also serves as the base class for html5 mode fallback on legacy browsers.
|
|
67
|
-
*
|
|
68
|
-
* @constructor
|
|
69
|
-
* @param {string} appBase application base URL
|
|
70
|
-
* @param {string} appBaseNoFile application base URL stripped of any filename
|
|
71
|
-
* @param {string} hashPrefix hashbang prefix
|
|
72
|
-
*/
|
|
73
|
-
constructor(appBase: string, appBaseNoFile: string, hashPrefix: string);
|
|
74
|
-
/**
|
|
75
|
-
* Parse given hashbang URL into properties
|
|
76
|
-
* @param {string} url Hashbang URL
|
|
77
|
-
* @private
|
|
78
|
-
*/
|
|
79
|
-
private $$parse;
|
|
80
|
-
$$normalizeUrl: (url: any) => string;
|
|
81
|
-
$$parseLinkUrl: (url: any) => boolean;
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* LocationHashbangUrl represents URL
|
|
85
|
-
* This object is exposed as $location service when html5 history api is enabled but the browser
|
|
86
|
-
* does not support it.
|
|
87
|
-
*
|
|
88
|
-
* @constructor
|
|
89
|
-
* @param {string} appBase application base URL
|
|
90
|
-
* @param {string} appBaseNoFile application base URL stripped of any filename
|
|
91
|
-
* @param {string} hashPrefix hashbang prefix
|
|
92
|
-
*/
|
|
93
|
-
export function LocationHashbangInHtml5Url(
|
|
94
|
-
appBase: string,
|
|
95
|
-
appBaseNoFile: string,
|
|
96
|
-
hashPrefix: string,
|
|
97
|
-
...args: any[]
|
|
98
|
-
): void;
|
|
99
|
-
export class LocationHashbangInHtml5Url {
|
|
100
|
-
/**
|
|
101
|
-
* LocationHashbangUrl represents URL
|
|
102
|
-
* This object is exposed as $location service when html5 history api is enabled but the browser
|
|
103
|
-
* does not support it.
|
|
104
|
-
*
|
|
105
|
-
* @constructor
|
|
106
|
-
* @param {string} appBase application base URL
|
|
107
|
-
* @param {string} appBaseNoFile application base URL stripped of any filename
|
|
108
|
-
* @param {string} hashPrefix hashbang prefix
|
|
109
|
-
*/
|
|
110
|
-
constructor(
|
|
111
|
-
appBase: string,
|
|
112
|
-
appBaseNoFile: string,
|
|
113
|
-
hashPrefix: string,
|
|
114
|
-
...args: any[]
|
|
115
|
-
);
|
|
116
|
-
$$html5: boolean;
|
|
117
|
-
$$parseLinkUrl: (url: any, relHref: any) => boolean;
|
|
118
|
-
$$normalizeUrl: (url: any) => string;
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* @ngdoc service
|
|
122
|
-
* @name $location
|
|
123
|
-
*
|
|
124
|
-
* @requires $rootElement
|
|
125
|
-
*
|
|
126
|
-
* @description
|
|
127
|
-
* The $location service parses the URL in the browser address bar (based on the
|
|
128
|
-
* [window.location](https://developer.mozilla.org/en/window.location)) and makes the URL
|
|
129
|
-
* available to your application. Changes to the URL in the address bar are reflected into
|
|
130
|
-
* $location service and changes to $location are reflected into the browser address bar.
|
|
131
|
-
*
|
|
132
|
-
* **The $location service:**
|
|
133
|
-
*
|
|
134
|
-
* - Exposes the current URL in the browser address bar, so you can
|
|
135
|
-
* - Watch and observe the URL.
|
|
136
|
-
* - Change the URL.
|
|
137
|
-
* - Synchronizes the URL with the browser when the user
|
|
138
|
-
* - Changes the address bar.
|
|
139
|
-
* - Clicks the back or forward button (or clicks a History link).
|
|
140
|
-
* - Clicks on a link.
|
|
141
|
-
* - Represents the URL object as a set of methods (protocol, host, port, path, search, hash).
|
|
142
|
-
*
|
|
143
|
-
* For more information see {@link guide/$location Developer Guide: Using $location}
|
|
144
|
-
*/
|
|
145
|
-
/**
|
|
146
|
-
* @ngdoc provider
|
|
147
|
-
* @name $locationProvider
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
* @description
|
|
151
|
-
* Use the `$locationProvider` to configure how the application deep linking paths are stored.
|
|
152
|
-
*/
|
|
153
|
-
export function $LocationProvider(): void;
|
|
154
|
-
export class $LocationProvider {
|
|
155
|
-
/**
|
|
156
|
-
* @ngdoc method
|
|
157
|
-
* @name $locationProvider#hashPrefix
|
|
158
|
-
* @description
|
|
159
|
-
* The default value for the prefix is `'!'`.
|
|
160
|
-
* @param {string=} prefix Prefix for hash part (containing path and search)
|
|
161
|
-
* @returns {*} current value if used as getter or itself (chaining) if used as setter
|
|
162
|
-
*/
|
|
163
|
-
hashPrefix: (prefix?: string | undefined) => any;
|
|
164
|
-
/**
|
|
165
|
-
* @ngdoc method
|
|
166
|
-
* @name $locationProvider#html5Mode
|
|
167
|
-
* @description
|
|
168
|
-
* @param {(boolean|Object)=} mode If boolean, sets `html5Mode.enabled` to value.
|
|
169
|
-
* If object, sets `enabled`, `requireBase` and `rewriteLinks` to respective values. Supported
|
|
170
|
-
* properties:
|
|
171
|
-
* - **enabled** – `{boolean}` – (default: false) If true, will rely on `history.pushState` to
|
|
172
|
-
* change urls where supported. Will fall back to hash-prefixed paths in browsers that do not
|
|
173
|
-
* support `pushState`.
|
|
174
|
-
* - **requireBase** - `{boolean}` - (default: `true`) When html5Mode is enabled, specifies
|
|
175
|
-
* whether or not a <base> tag is required to be present. If `enabled` and `requireBase` are
|
|
176
|
-
* true, and a base tag is not present, an error will be thrown when `$location` is injected.
|
|
177
|
-
* See the {@link guide/$location $location guide for more information}
|
|
178
|
-
* - **rewriteLinks** - `{boolean|string}` - (default: `true`) When html5Mode is enabled,
|
|
179
|
-
* enables/disables URL rewriting for relative links. If set to a string, URL rewriting will
|
|
180
|
-
* only happen on links with an attribute that matches the given string. For example, if set
|
|
181
|
-
* to `'internal-link'`, then the URL will only be rewritten for `<a internal-link>` links.
|
|
182
|
-
* Note that [attribute name normalization](guide/directive#normalization) does not apply
|
|
183
|
-
* here, so `'internalLink'` will **not** match `'internal-link'`.
|
|
184
|
-
*
|
|
185
|
-
* @returns {Object} html5Mode object if used as getter or itself (chaining) if used as setter
|
|
186
|
-
*/
|
|
187
|
-
html5Mode: (mode?: (boolean | any) | undefined) => any;
|
|
188
|
-
/**
|
|
189
|
-
* @ngdoc event
|
|
190
|
-
* @name $location#$locationChangeStart
|
|
191
|
-
* @eventType broadcast on root scope
|
|
192
|
-
* @description
|
|
193
|
-
* Broadcasted before a URL will change.
|
|
194
|
-
*
|
|
195
|
-
* This change can be prevented by calling
|
|
196
|
-
* `preventDefault` method of the event. See {@link ng.$rootScope.Scope#$on} for more
|
|
197
|
-
* details about event object. Upon successful change
|
|
198
|
-
* {@link ng.$location#$locationChangeSuccess $locationChangeSuccess} is fired.
|
|
199
|
-
*
|
|
200
|
-
* The `newState` and `oldState` parameters may be defined only in HTML5 mode and when
|
|
201
|
-
* the browser supports the HTML5 History API.
|
|
202
|
-
*
|
|
203
|
-
* @param {Object} angularEvent Synthetic event object.
|
|
204
|
-
* @param {string} newUrl New URL
|
|
205
|
-
* @param {string=} oldUrl URL that was before it was changed.
|
|
206
|
-
* @param {string=} newState New history state object
|
|
207
|
-
* @param {string=} oldState History state object that was before it was changed.
|
|
208
|
-
*/
|
|
209
|
-
/**
|
|
210
|
-
* @ngdoc event
|
|
211
|
-
* @name $location#$locationChangeSuccess
|
|
212
|
-
* @eventType broadcast on root scope
|
|
213
|
-
* @description
|
|
214
|
-
* Broadcasted after a URL was changed.
|
|
215
|
-
*
|
|
216
|
-
* The `newState` and `oldState` parameters may be defined only in HTML5 mode and when
|
|
217
|
-
* the browser supports the HTML5 History API.
|
|
218
|
-
*
|
|
219
|
-
* @param {Object} angularEvent Synthetic event object.
|
|
220
|
-
* @param {string} newUrl New URL
|
|
221
|
-
* @param {string=} oldUrl URL that was before it was changed.
|
|
222
|
-
* @param {string=} newState New history state object
|
|
223
|
-
* @param {string=} oldState History state object that was before it was changed.
|
|
224
|
-
*/
|
|
225
|
-
$get: (
|
|
226
|
-
| string
|
|
227
|
-
| ((
|
|
228
|
-
$rootScope: any,
|
|
229
|
-
$browser: any,
|
|
230
|
-
$rootElement: any,
|
|
231
|
-
) => LocationHtml5Url | LocationHashbangUrl)
|
|
232
|
-
)[];
|
|
233
|
-
}
|
|
234
|
-
export const PATH_MATCH: RegExp;
|
package/types/core/pubsub.d.ts
DELETED
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
export class PubSub {
|
|
2
|
-
/**
|
|
3
|
-
* Runs a function asynchronously.
|
|
4
|
-
*
|
|
5
|
-
* @private
|
|
6
|
-
* @param {Function} fn Function to run.
|
|
7
|
-
* @param {Object} context Context in which to run the function.
|
|
8
|
-
* @param {Array} args Arguments to pass to the function.
|
|
9
|
-
*/
|
|
10
|
-
private static runAsync_;
|
|
11
|
-
/**
|
|
12
|
-
* Topic-based publish/subscribe channel. Maintains a map of topics to
|
|
13
|
-
* subscriptions. When a message is published to a topic, all functions
|
|
14
|
-
* subscribed to that topic are invoked in the order they were added.
|
|
15
|
-
* Uncaught errors abort publishing.
|
|
16
|
-
*
|
|
17
|
-
* Topics may be identified by any nonempty string, <strong>except</strong>
|
|
18
|
-
* strings corresponding to native Object properties, e.g. "constructor",
|
|
19
|
-
* "toString", "hasOwnProperty", etc.
|
|
20
|
-
*
|
|
21
|
-
* @param {boolean=} opt_async Enable asynchronous behavior. Recommended for
|
|
22
|
-
* new code. See notes on the publish() method.
|
|
23
|
-
*/
|
|
24
|
-
constructor(opt_async?: boolean | undefined);
|
|
25
|
-
disposed: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* The next available subscription key. Internally, this is an index into the
|
|
28
|
-
* sparse array of subscriptions.
|
|
29
|
-
*
|
|
30
|
-
* @private {number}
|
|
31
|
-
*/
|
|
32
|
-
private key;
|
|
33
|
-
/**
|
|
34
|
-
* Array of subscription keys pending removal once publishing is done.
|
|
35
|
-
*
|
|
36
|
-
* @private {!Array<number>}
|
|
37
|
-
* @const
|
|
38
|
-
*/
|
|
39
|
-
private pendingKeys;
|
|
40
|
-
/**
|
|
41
|
-
* Lock to prevent the removal of subscriptions during publishing. Incremented
|
|
42
|
-
* at the beginning of {@link #publish}, and decremented at the end.
|
|
43
|
-
*
|
|
44
|
-
* @private {number}
|
|
45
|
-
*/
|
|
46
|
-
private publishDepth;
|
|
47
|
-
/**
|
|
48
|
-
* Sparse array of subscriptions. Each subscription is represented by a tuple
|
|
49
|
-
* comprising a topic identifier, a function, and an optional context object.
|
|
50
|
-
* Each tuple occupies three consecutive positions in the array, with the
|
|
51
|
-
* topic identifier at index n, the function at index (n + 1), the context
|
|
52
|
-
* object at index (n + 2), the next topic at index (n + 3), etc. (This
|
|
53
|
-
* representation minimizes the number of object allocations and has been
|
|
54
|
-
* shown to be faster than an array of objects with three key-value pairs or
|
|
55
|
-
* three parallel arrays, especially on IE.) Once a subscription is removed
|
|
56
|
-
* via {@link #unsubscribe} or {@link #unsubscribeByKey}, the three
|
|
57
|
-
* corresponding array elements are deleted, and never reused. This means the
|
|
58
|
-
* total number of subscriptions during the lifetime of the pubsub channel is
|
|
59
|
-
* limited by the maximum length of a JavaScript array to (2^32 - 1) / 3 =
|
|
60
|
-
* 1,431,655,765 subscriptions, which should suffice for most applications.
|
|
61
|
-
*
|
|
62
|
-
* @private {!Array<?>}
|
|
63
|
-
* @const
|
|
64
|
-
*/
|
|
65
|
-
private subscriptions;
|
|
66
|
-
/**
|
|
67
|
-
* Map of topics to arrays of subscription keys.
|
|
68
|
-
*
|
|
69
|
-
* @private {!Object<!Array<number>>}
|
|
70
|
-
*/
|
|
71
|
-
private topics;
|
|
72
|
-
/**
|
|
73
|
-
* @private @const {boolean}
|
|
74
|
-
*/
|
|
75
|
-
private async_;
|
|
76
|
-
/**
|
|
77
|
-
* Subscribes a function to a topic. The function is invoked as a method on
|
|
78
|
-
* the given `opt_context` object, or in the global scope if no context
|
|
79
|
-
* is specified. Subscribing the same function to the same topic multiple
|
|
80
|
-
* times will result in multiple function invocations while publishing.
|
|
81
|
-
* Returns a subscription key that can be used to unsubscribe the function from
|
|
82
|
-
* the topic via {@link #unsubscribeByKey}.
|
|
83
|
-
*
|
|
84
|
-
* @param {string} topic Topic to subscribe to.
|
|
85
|
-
* @param {Function} fn Function to be invoked when a message is published to
|
|
86
|
-
* the given topic.
|
|
87
|
-
* @param {Object=} opt_context Object in whose context the function is to be
|
|
88
|
-
* called (the global scope if none).
|
|
89
|
-
* @return {number} Subscription key.
|
|
90
|
-
*/
|
|
91
|
-
subscribe(topic: string, fn: Function, opt_context?: any | undefined): number;
|
|
92
|
-
/**
|
|
93
|
-
* Subscribes a single-use function to a topic. The function is invoked as a
|
|
94
|
-
* method on the given `opt_context` object, or in the global scope if
|
|
95
|
-
* no context is specified, and is then unsubscribed. Returns a subscription
|
|
96
|
-
* key that can be used to unsubscribe the function from the topic via
|
|
97
|
-
* {@link #unsubscribeByKey}.
|
|
98
|
-
*
|
|
99
|
-
* @param {string} topic Topic to subscribe to.
|
|
100
|
-
* @param {Function} fn Function to be invoked once and then unsubscribed when
|
|
101
|
-
* a message is published to the given topic.
|
|
102
|
-
* @param {Object=} opt_context Object in whose context the function is to be
|
|
103
|
-
* called (the global scope if none).
|
|
104
|
-
* @return {number} Subscription key.
|
|
105
|
-
*/
|
|
106
|
-
subscribeOnce(
|
|
107
|
-
topic: string,
|
|
108
|
-
fn: Function,
|
|
109
|
-
opt_context?: any | undefined,
|
|
110
|
-
): number;
|
|
111
|
-
/**
|
|
112
|
-
* Unsubscribes a function from a topic. Only deletes the first match found.
|
|
113
|
-
* Returns a Boolean indicating whether a subscription was removed.
|
|
114
|
-
*
|
|
115
|
-
* @param {string} topic Topic to unsubscribe from.
|
|
116
|
-
* @param {Function} fn Function to unsubscribe.
|
|
117
|
-
* @param {Object=} opt_context Object in whose context the function was to be
|
|
118
|
-
* called (the global scope if none).
|
|
119
|
-
* @return {boolean} Whether a matching subscription was removed.
|
|
120
|
-
*/
|
|
121
|
-
unsubscribe(
|
|
122
|
-
topic: string,
|
|
123
|
-
fn: Function,
|
|
124
|
-
opt_context?: any | undefined,
|
|
125
|
-
): boolean;
|
|
126
|
-
/**
|
|
127
|
-
* Removes a subscription based on the key returned by {@link #subscribe}.
|
|
128
|
-
* No-op if no matching subscription is found. Returns a Boolean indicating
|
|
129
|
-
* whether a subscription was removed.
|
|
130
|
-
*
|
|
131
|
-
* @param {number} key Subscription key.
|
|
132
|
-
* @return {boolean} Whether a matching subscription was removed.
|
|
133
|
-
*/
|
|
134
|
-
unsubscribeByKey(key: number): boolean;
|
|
135
|
-
/**
|
|
136
|
-
* Publishes a message to a topic. Calls functions subscribed to the topic in
|
|
137
|
-
* the order in which they were added, passing all arguments along.
|
|
138
|
-
*
|
|
139
|
-
* If this object was created with async=true, subscribed functions are called
|
|
140
|
-
* via setTimeout(). Otherwise, the functions are called directly, and if
|
|
141
|
-
* any of them throw an uncaught error, publishing is aborted.
|
|
142
|
-
*
|
|
143
|
-
* @param {string} topic Topic to publish to.
|
|
144
|
-
* @param {...*} var_args Arguments that are applied to each subscription
|
|
145
|
-
* function.
|
|
146
|
-
* @return {boolean} Whether any subscriptions were called.
|
|
147
|
-
*/
|
|
148
|
-
publish(topic: string, ...var_args: any[]): boolean;
|
|
149
|
-
/**
|
|
150
|
-
* Clears the subscription list for a topic, or all topics if unspecified.
|
|
151
|
-
* @param {string=} opt_topic Topic to clear (all topics if unspecified).
|
|
152
|
-
*/
|
|
153
|
-
clear(opt_topic?: string | undefined): void;
|
|
154
|
-
/**
|
|
155
|
-
* Returns the number of subscriptions to the given topic (or all topics if
|
|
156
|
-
* unspecified). This number will not change while publishing any messages.
|
|
157
|
-
* @param {string=} opt_topic The topic (all topics if unspecified).
|
|
158
|
-
* @return {number} Number of subscriptions to the topic.
|
|
159
|
-
*/
|
|
160
|
-
getCount(opt_topic?: string | undefined): number;
|
|
161
|
-
isDisposed(): boolean;
|
|
162
|
-
dispose(): void;
|
|
163
|
-
}
|
|
164
|
-
export const EventBus: PubSub;
|