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