@angular-wave/angular.ts 0.0.38 → 0.0.39
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 +6 -5
- package/dist/angular-ts.esm.js +2 -1
- package/dist/angular-ts.umd.js +1 -1
- package/package.json +2 -4
- package/rollup.config.js +5 -1
- package/src/core/scope/scope.js +4 -7
- package/src/index.js +307 -1
- package/src/loader.js +13 -6
- package/src/public.js +7 -2
- 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 +8 -23
- 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 +1 -1
- 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 +31 -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 +29 -29
- package/types/core/timeout/timeout.d.ts +20 -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} +256 -279
- 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 +117 -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 +122 -130
- package/types/services/cache-factory.d.ts +25 -25
- package/types/services/cookie-reader.d.ts +2 -2
- package/types/services/document.d.ts +2 -2
- 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 +49 -49
- package/types/services/template-request.d.ts +44 -53
- package/types/shared/common.d.ts +4 -19
- 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} +11 -11
- package/types/shared/test-utils.d.ts +11 -0
- package/types/shared/utils.d.ts +7 -24
- package/types-back/global.d.ts +3 -1
- package/types-back/index.d.ts +2 -221
- 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/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/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;
|
package/types/core/q.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @ngdoc provider
|
|
3
|
-
* @name $qProvider
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* @description
|
|
7
|
-
*/
|
|
8
|
-
export function $QProvider(): void;
|
|
9
|
-
export class $QProvider {
|
|
10
|
-
$get: (string | (($rootScope: any, $exceptionHandler: any) => any))[];
|
|
11
|
-
/**
|
|
12
|
-
* @ngdoc method
|
|
13
|
-
* @name $qProvider#errorOnUnhandledRejections
|
|
14
|
-
* @kind function
|
|
15
|
-
*
|
|
16
|
-
* @description
|
|
17
|
-
* Retrieves or overrides whether to generate an error when a rejected promise is not handled.
|
|
18
|
-
* This feature is enabled by default.
|
|
19
|
-
*
|
|
20
|
-
* @param {boolean=} value Whether to generate an error when a rejected promise is not handled.
|
|
21
|
-
* @returns {boolean|ng.$qProvider} Current value when called without a new value or self for
|
|
22
|
-
* chaining otherwise.
|
|
23
|
-
*/
|
|
24
|
-
errorOnUnhandledRejections: (
|
|
25
|
-
value?: boolean | undefined,
|
|
26
|
-
) => boolean | ng.$qProvider;
|
|
27
|
-
}
|
|
28
|
-
export function $$QProvider(): void;
|
|
29
|
-
export class $$QProvider {
|
|
30
|
-
$get: (string | (($browser: any, $exceptionHandler: any) => any))[];
|
|
31
|
-
errorOnUnhandledRejections: (value: any) => boolean | this;
|
|
32
|
-
}
|
|
33
|
-
export function markQExceptionHandled(q: any): void;
|