@angular-wave/angular.ts 0.10.0 → 0.12.0

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 (62) hide show
  1. package/@types/angular.d.ts +84 -58
  2. package/@types/animations/animate-css-driver.d.ts +0 -1
  3. package/@types/animations/animate-css.d.ts +0 -1
  4. package/@types/animations/animate-js-driver.d.ts +1 -7
  5. package/@types/animations/animate-js.d.ts +1 -4
  6. package/@types/animations/animate.d.ts +5 -355
  7. package/@types/animations/animation.d.ts +4 -4
  8. package/@types/animations/interface.d.ts +84 -0
  9. package/@types/animations/queue/animate-queue.d.ts +21 -0
  10. package/@types/animations/queue/interface.d.ts +50 -0
  11. package/@types/animations/runner/animate-runner.d.ts +99 -0
  12. package/@types/core/compile/attributes.d.ts +5 -5
  13. package/@types/core/compile/compile.d.ts +4 -4
  14. package/@types/core/controller/controller.d.ts +1 -1
  15. package/@types/core/di/di.d.ts +26 -0
  16. package/@types/core/di/injector.d.ts +0 -11
  17. package/@types/core/di/internal-injector.d.ts +2 -2
  18. package/@types/core/di/ng-module/ng-module.d.ts +197 -0
  19. package/@types/core/filter/filter.d.ts +2 -2
  20. package/@types/core/sanitize/interface.d.ts +8 -0
  21. package/@types/core/sanitize/sanitize-uri.d.ts +5 -2
  22. package/@types/core/scope/interface.d.ts +2 -2
  23. package/@types/core/scope/scope.d.ts +10 -2
  24. package/@types/directive/class/class.d.ts +3 -3
  25. package/@types/directive/form/form.d.ts +7 -7
  26. package/@types/directive/if/if.d.ts +2 -2
  27. package/@types/directive/include/include.d.ts +4 -4
  28. package/@types/directive/inject/inject.d.ts +2 -2
  29. package/@types/directive/input/input.d.ts +10 -10
  30. package/@types/directive/messages/messages.d.ts +19 -23
  31. package/@types/directive/model/model.d.ts +3 -3
  32. package/@types/directive/scope/scope.d.ts +4 -0
  33. package/@types/directive/show-hide/show-hide.d.ts +3 -4
  34. package/@types/directive/switch/switch.d.ts +3 -5
  35. package/@types/directive/wasm/wasm.d.ts +4 -0
  36. package/@types/{services → directive}/worker/interface.d.ts +1 -0
  37. package/@types/directive/worker/worker.d.ts +18 -8
  38. package/@types/interface.d.ts +49 -21
  39. package/@types/namespace.d.ts +29 -4
  40. package/@types/ng.d.ts +3 -5
  41. package/@types/router/params/interface.d.ts +0 -25
  42. package/@types/router/state/interface.d.ts +0 -9
  43. package/@types/router/template-factory.d.ts +1 -1
  44. package/@types/router/transition/interface.d.ts +0 -33
  45. package/@types/services/log/log.d.ts +2 -2
  46. package/@types/services/sce/sce.d.ts +4 -82
  47. package/@types/services/sse/sse.d.ts +1 -5
  48. package/@types/services/storage/interface.d.ts +5 -0
  49. package/@types/services/storage/storage.d.ts +19 -0
  50. package/@types/services/stream/interface.d.ts +18 -0
  51. package/@types/shared/dom.d.ts +25 -10
  52. package/@types/shared/strings.d.ts +0 -6
  53. package/@types/shared/utils.d.ts +24 -14
  54. package/dist/angular-ts.esm.js +1867 -1506
  55. package/dist/angular-ts.umd.js +1867 -1506
  56. package/dist/angular-ts.umd.min.js +1 -1
  57. package/dist/angular.css +1 -1
  58. package/package.json +1 -2
  59. package/@types/animations/animate-queue.d.ts +0 -27
  60. package/@types/animations/animate-runner.d.ts +0 -31
  61. package/@types/core/di/ng-module.d.ts +0 -156
  62. package/@types/services/worker/worker.d.ts +0 -31
@@ -75,16 +75,16 @@ export class FormController {
75
75
  static $inject: string[];
76
76
  /**
77
77
  * @param {Element} $element
78
- * @param {import("../../core/compile/attributes.js").Attributes} $attrs
79
- * @param {import("../../core/scope/scope.js").Scope} $scope
80
- * @param {*} $animate
78
+ * @param {ng.Attributes} $attrs
79
+ * @param {ng.Scope} $scope
80
+ * @param {ng.AnimateService} $animate
81
81
  * @param {*} $interpolate
82
82
  */
83
83
  constructor(
84
84
  $element: Element,
85
- $attrs: import("../../core/compile/attributes.js").Attributes,
86
- $scope: import("../../core/scope/scope.js").Scope,
87
- $animate: any,
85
+ $attrs: ng.Attributes,
86
+ $scope: ng.Scope,
87
+ $animate: ng.AnimateService,
88
88
  $interpolate: any,
89
89
  );
90
90
  $$controls: any[];
@@ -103,7 +103,7 @@ export class FormController {
103
103
  /** @type {FormController|Object} */
104
104
  $$parentForm: FormController | any;
105
105
  $$element: Element;
106
- $$animate: any;
106
+ $$animate: import("../../interface.ts").AnimateService;
107
107
  $error: {};
108
108
  $$success: {};
109
109
  $pending: any;
@@ -1,8 +1,8 @@
1
1
  /**
2
- * @param {*} $animate
2
+ * @param {ng.AnimateService} $animate
3
3
  * @returns {ng.Directive}
4
4
  */
5
- export function ngIfDirective($animate: any): ng.Directive;
5
+ export function ngIfDirective($animate: ng.AnimateService): ng.Directive;
6
6
  export namespace ngIfDirective {
7
7
  let $inject: string[];
8
8
  }
@@ -1,15 +1,15 @@
1
1
  /**
2
2
  *
3
- * @param {*} $templateRequest
3
+ * @param {ng.TemplateRequestService} $templateRequest
4
4
  * @param {import("../../services/anchor-scroll/anchor-scroll.js").AnchorScrollFunction} $anchorScroll
5
- * @param {*} $animate
5
+ * @param {ng.AnimateService} $animate
6
6
  * @param {import('../../services/exception/interface.ts').ErrorHandler} $exceptionHandler
7
7
  * @returns {import('../../interface.ts').Directive}
8
8
  */
9
9
  export function ngIncludeDirective(
10
- $templateRequest: any,
10
+ $templateRequest: ng.TemplateRequestService,
11
11
  $anchorScroll: import("../../services/anchor-scroll/anchor-scroll.js").AnchorScrollFunction,
12
- $animate: any,
12
+ $animate: ng.AnimateService,
13
13
  $exceptionHandler: import("../../services/exception/interface.ts").ErrorHandler,
14
14
  ): import("../../interface.ts").Directive;
15
15
  export namespace ngIncludeDirective {
@@ -1,12 +1,12 @@
1
1
  /**
2
2
  * @param {ng.LogService} $log
3
3
  * @param {ng.InjectorService} $injector
4
- * @returns {import('interface.ts').Directive}
4
+ * @returns {ng.Directive}
5
5
  */
6
6
  export function ngInjectDirective(
7
7
  $log: ng.LogService,
8
8
  $injector: ng.InjectorService,
9
- ): any;
9
+ ): ng.Directive;
10
10
  export namespace ngInjectDirective {
11
11
  let $inject: string[];
12
12
  }
@@ -45,25 +45,25 @@ export function rangeInputType(
45
45
  ctrl: any,
46
46
  ): void;
47
47
  /**
48
- * @param {*} $filter
49
- * @param {*} $parse
50
- * @returns {import('../../interface.ts').Directive}
48
+ * @param {ng.FilterService} $filter
49
+ * @param {ng.ParseService} $parse
50
+ * @returns {ng.Directive}
51
51
  */
52
52
  export function inputDirective(
53
- $filter: any,
54
- $parse: any,
55
- ): import("../../interface.ts").Directive;
53
+ $filter: ng.FilterService,
54
+ $parse: ng.ParseService,
55
+ ): ng.Directive;
56
56
  export namespace inputDirective {
57
57
  let $inject: string[];
58
58
  }
59
59
  /**
60
- * @returns {import('../../interface.ts').Directive}
60
+ * @returns {ng.Directive}
61
61
  */
62
- export function hiddenInputBrowserCacheDirective(): import("../../interface.ts").Directive;
62
+ export function hiddenInputBrowserCacheDirective(): ng.Directive;
63
63
  /**
64
- * @returns {import('../../interface.ts').Directive}
64
+ * @returns {ng.Directive}
65
65
  */
66
- export function ngValueDirective(): import("../../interface.ts").Directive;
66
+ export function ngValueDirective(): ng.Directive;
67
67
  export const ISO_DATE_REGEXP: RegExp;
68
68
  export const URL_REGEXP: RegExp;
69
69
  export const EMAIL_REGEXP: RegExp;
@@ -1,8 +1,10 @@
1
- export function ngMessagesDirective($animate: any): {
2
- require: string;
3
- restrict: string;
4
- controller: ($element: any, $scope: any, $attrs: any) => NgMessageCtrl;
5
- };
1
+ /**
2
+ * @param {ng.AnimateService} $animate
3
+ * @returns {ng.Directive<NgMessageCtrl>}
4
+ */
5
+ export function ngMessagesDirective(
6
+ $animate: ng.AnimateService,
7
+ ): ng.Directive<NgMessageCtrl>;
6
8
  export namespace ngMessagesDirective {
7
9
  let $inject: string[];
8
10
  }
@@ -18,32 +20,26 @@ export namespace ngMessagesIncludeDirective {
18
20
  let $inject_1: string[];
19
21
  export { $inject_1 as $inject };
20
22
  }
21
- export const ngMessageDirective: (
22
- any: any,
23
- ) => import("../../interface.ts").Directive;
24
- export const ngMessageExpDirective: (
25
- any: any,
26
- ) => import("../../interface.ts").Directive;
27
- export const ngMessageDefaultDirective: (
28
- any: any,
29
- ) => import("../../interface.ts").Directive;
23
+ export const ngMessageDirective: (any: any) => ng.Directive;
24
+ export const ngMessageExpDirective: (any: any) => ng.Directive;
25
+ export const ngMessageDefaultDirective: (any: any) => ng.Directive;
30
26
  declare class NgMessageCtrl {
31
27
  /**
32
28
  * @param {Element} $element
33
- * @param {import('../../core/scope/scope.js').Scope} $scope
34
- * @param {import('../../core/compile/attributes').Attributes} $attrs
35
- * @param {*} $animate
29
+ * @param {ng.Scope} $scope
30
+ * @param {ng.Attributes} $attrs
31
+ * @param {ng.AnimateService} $animate
36
32
  */
37
33
  constructor(
38
34
  $element: Element,
39
- $scope: import("../../core/scope/scope.js").Scope,
40
- $attrs: any,
41
- $animate: any,
35
+ $scope: ng.Scope,
36
+ $attrs: ng.Attributes,
37
+ $animate: ng.AnimateService,
42
38
  );
43
39
  $element: Element;
44
- $scope: import("../../core/scope/scope.js").Scope;
45
- $attrs: any;
46
- $animate: any;
40
+ $scope: import("../../interface.ts").Scope;
41
+ $attrs: ng.Attributes;
42
+ $animate: import("../../interface.ts").AnimateService;
47
43
  latestKey: number;
48
44
  nextAttachId: number;
49
45
  messages: {};
@@ -54,7 +54,7 @@ export class NgModelController {
54
54
  * @param {import('../../core/compile/attributes.js').Attributes} $attr
55
55
  * @param {Element} $element
56
56
  * @param {import("../../core/parse/interface.ts").ParseService} $parse
57
- * @param {*} $animate
57
+ * @param {ng.AnimateService} $animate
58
58
  * @param {*} $interpolate
59
59
  */
60
60
  constructor(
@@ -63,7 +63,7 @@ export class NgModelController {
63
63
  $attr: import("../../core/compile/attributes.js").Attributes,
64
64
  $element: Element,
65
65
  $parse: import("../../core/parse/interface.ts").ParseService,
66
- $animate: any,
66
+ $animate: ng.AnimateService,
67
67
  $interpolate: any,
68
68
  );
69
69
  /** @type {any} The actual value from the control's view */
@@ -139,7 +139,7 @@ export class NgModelController {
139
139
  $$scope: import("../../core/scope/scope.js").Scope;
140
140
  $$attr: import("../../core/compile/attributes.js").Attributes;
141
141
  $$element: Element;
142
- $$animate: any;
142
+ $$animate: import("../../interface.ts").AnimateService;
143
143
  $$parse: import("../../core/parse/interface.ts").ParseService;
144
144
  $$exceptionHandler: import("../../services/exception/interface.ts").ErrorHandler;
145
145
  $$hasNativeValidators: boolean;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * @return {ng.Directive}
3
+ */
4
+ export function ngScopeDirective(): ng.Directive;
@@ -1,9 +1,8 @@
1
1
  /**
2
- * @returns {import('../../interface.ts').Directive}
2
+ * @param {ng.AnimateService} $animate
3
+ * @returns {ng.Directive}
3
4
  */
4
- export function ngShowDirective(
5
- $animate: any,
6
- ): import("../../interface.ts").Directive;
5
+ export function ngShowDirective($animate: ng.AnimateService): ng.Directive;
7
6
  export namespace ngShowDirective {
8
7
  let $inject: string[];
9
8
  }
@@ -1,10 +1,8 @@
1
1
  /**
2
- * @param {*} $animate
3
- * @returns {import('../../interface.ts').Directive}
2
+ * @param {ng.AnimateService} $animate
3
+ * @returns {ng.Directive}
4
4
  */
5
- export function ngSwitchDirective(
6
- $animate: any,
7
- ): import("../../interface.ts").Directive;
5
+ export function ngSwitchDirective($animate: ng.AnimateService): ng.Directive;
8
6
  export namespace ngSwitchDirective {
9
7
  let $inject: string[];
10
8
  }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * @return {ng.Directive}
3
+ */
4
+ export function ngWasmDirective(): ng.Directive;
@@ -9,4 +9,5 @@ export interface WorkerConnection {
9
9
  post(data: any): void;
10
10
  terminate(): void;
11
11
  restart(): void;
12
+ config: WorkerConfig;
12
13
  }
@@ -1,15 +1,25 @@
1
1
  /**
2
- * ngWorker directive factory
3
2
  * Usage: <div ng-worker="workerName" data-params="{{ expression }}" data-on-result="callback($result)"></div>
3
+ *
4
+ * @param {ng.ParseService} $parse
5
+ * @param {ng.LogService} $log
6
+ * @returns {ng.Directive}
4
7
  */
5
8
  export function ngWorkerDirective(
6
- $worker: any,
7
- $parse: any,
8
- $log: any,
9
- ): {
10
- restrict: string;
11
- link(scope: any, element: any, attrs: any): void;
12
- };
9
+ $parse: ng.ParseService,
10
+ $log: ng.LogService,
11
+ ): ng.Directive;
13
12
  export namespace ngWorkerDirective {
14
13
  let $inject: string[];
15
14
  }
15
+ /**
16
+ * Creates a managed Web Worker connection.
17
+ *
18
+ * @param {string | URL} scriptPath
19
+ * @param {ng.WorkerConfig} [config]
20
+ * @returns {ng.WorkerConnection}
21
+ */
22
+ export function createWorkerConnection(
23
+ scriptPath: string | URL,
24
+ config?: ng.WorkerConfig,
25
+ ): ng.WorkerConnection;
@@ -1,3 +1,4 @@
1
+ export * from "./animations/interface.ts";
1
2
  export * from "./services/http/interface.ts";
2
3
  export * from "./services/log/interface.ts";
3
4
  export * from "./services/log/log.js";
@@ -6,6 +7,9 @@ export * from "./services/location/location.js";
6
7
  export * from "./services/pubsub/pubsub.js";
7
8
  export * from "./services/template-cache/template-cache.js";
8
9
  export * from "./index.js";
10
+ export * from "./angular.js";
11
+ export * from "./core/di/internal-injector.js";
12
+ export * from "./core/scope/scope.js";
9
13
  import { Attributes } from "./core/compile/attributes.js";
10
14
  import { Scope } from "./core/scope/scope.js";
11
15
  /**
@@ -60,14 +64,13 @@ export type InjectableClass<TInstance = any> = new (...args: any) => TInstance;
60
64
  *
61
65
  * Parentheses are required around constructor types when used in unions.
62
66
  */
67
+ type FactoryFunction<T> = T extends abstract new (...args: any[]) => any
68
+ ? (...args: ConstructorParameters<T>) => InstanceType<T>
69
+ : T;
63
70
  export type Injectable<
64
71
  T extends ((...args: any[]) => any) | (abstract new (...args: any[]) => any),
65
72
  > =
66
- | AnnotatedFactory<
67
- T extends abstract new (...args: any[]) => any
68
- ? (...args: ConstructorParameters<T>) => InstanceType<T>
69
- : T
70
- >
73
+ | AnnotatedFactory<FactoryFunction<T>>
71
74
  | (T extends abstract new (...args: any[]) => any
72
75
  ? InjectableClass<InstanceType<T>>
73
76
  : never)
@@ -129,7 +132,7 @@ export interface Provider {
129
132
  */
130
133
  value(name: string, val: any): Provider;
131
134
  /**
132
- * Register a constant value (available during config).
135
+ * Register a constant service, such as a string, a number, an array, an object or a function, with the $injector. Unlike value it can be injected into a module configuration function (see config) and it cannot be overridden by an Angular decorator.
133
136
  * @param name - The name of the constant.
134
137
  * @param val - The constant value.
135
138
  */
@@ -144,7 +147,9 @@ export interface Provider {
144
147
  /**
145
148
  * A controller constructor function used in AngularTS.
146
149
  */
147
- export type ControllerConstructor = (...args: any[]) => void | Controller;
150
+ export type ControllerConstructor =
151
+ | (new (...args: any[]) => Controller)
152
+ | ((...args: any[]) => void | Controller);
148
153
  /**
149
154
  * Describes the changes in component bindings during `$onChanges`.
150
155
  */
@@ -160,17 +165,41 @@ export interface ChangesObject<T = any> {
160
165
  export type OnChangesObject = Record<string, ChangesObject>;
161
166
  /**
162
167
  * AngularTS component lifecycle interface.
168
+ * Directive controllers have a well-defined lifecycle. Each controller can implement "lifecycle hooks". These are methods that
169
+ * will be called by Angular at certain points in the life cycle of the directive.
170
+ * https://docs.angularjs.org/api/ng/service/$compile#life-cycle-hooks
171
+ * https://docs.angularjs.org/guide/component
163
172
  */
164
173
  export interface Controller {
174
+ [s: string]: any;
165
175
  /** Optional controller name (used in debugging) */
166
176
  name?: string;
167
- /** Called when the controller is initialized */
177
+ /**
178
+ * Called on each controller after all the controllers on an element have been constructed and had their bindings
179
+ * initialized (and before the pre & post linking functions for the directives on this element). This is a good
180
+ * place to put initialization code for your controller.
181
+ */
168
182
  $onInit?: () => void;
169
- /** Called when one-way bindings are updated */
183
+ /**
184
+ * Called whenever one-way bindings are updated. The onChangesObj is a hash whose keys are the names of the bound
185
+ * properties that have changed, and the values are an {@link IChangesObject} object of the form
186
+ * { currentValue, previousValue, isFirstChange() }. Use this hook to trigger updates within a component such as
187
+ * cloning the bound value to prevent accidental mutation of the outer value.
188
+ */
170
189
  $onChanges?: (changes: OnChangesObject) => void;
171
- /** Called before the controller is destroyed */
190
+ /**
191
+ * Called on a controller when its containing scope is destroyed. Use this hook for releasing external resources,
192
+ * watches and event handlers.
193
+ */
172
194
  $onDestroy?: () => void;
173
- /** Called after the component is linked */
195
+ /**
196
+ * Called after this controller's element and its children have been linked. Similar to the post-link function this
197
+ * hook can be used to set up DOM event handlers and do direct DOM manipulation. Note that child elements that contain
198
+ * templateUrl directives will not have been compiled and linked since they are waiting for their template to load
199
+ * asynchronously and their own compilation and linking has been suspended until that occurs. This hook can be considered
200
+ * analogous to the ngAfterViewInit and ngAfterContentInit hooks in Angular 2. Since the compilation process is rather
201
+ * different in Angular 1 there is no direct mapping and care should be taken when upgrading.
202
+ */
174
203
  $postLink?: () => void;
175
204
  }
176
205
  /**
@@ -242,22 +271,22 @@ export type DirectiveController =
242
271
  /**
243
272
  * Represents a controller used within directive link functions.
244
273
  */
245
- export type TController = DirectiveController | NgModelController;
274
+ export type TController<T> = DirectiveController | NgModelController | T;
246
275
  /**
247
276
  * Defines optional pre/post link functions in directive compile phase.
248
277
  */
249
278
  export interface DirectivePrePost {
250
- pre?: DirectiveLinkFn;
251
- post?: DirectiveLinkFn;
279
+ pre?: DirectiveLinkFn<any>;
280
+ post?: DirectiveLinkFn<any>;
252
281
  }
253
282
  /**
254
283
  * A link function executed during directive linking.
255
284
  */
256
- export type DirectiveLinkFn = (
285
+ export type DirectiveLinkFn<T> = (
257
286
  scope: Scope,
258
287
  element: HTMLElement,
259
288
  attrs: Attributes & Record<string, any>,
260
- controller?: TController,
289
+ controller?: TController<T>,
261
290
  transclude?: (...args: any[]) => any,
262
291
  ) => void;
263
292
  /**
@@ -267,12 +296,11 @@ export type DirectiveCompileFn = (
267
296
  templateElement?: HTMLElement,
268
297
  templateAttributes?: Attributes & Record<string, any>,
269
298
  transclude?: (...args: any[]) => any,
270
- ) => void | DirectiveLinkFn | DirectivePrePost;
299
+ ) => void | DirectiveLinkFn<any> | DirectivePrePost;
271
300
  /**
272
301
  * Defines the structure of an AngularTS directive.
273
- * @typedef {Object} Directive
274
302
  */
275
- export interface Directive {
303
+ export interface Directive<TController = any> {
276
304
  /** Optional name (usually inferred) */
277
305
  name?: string;
278
306
  /** Restrict option: 'A' and/or 'E'. Defaults to 'EA' if not defined */
@@ -286,7 +314,7 @@ export interface Directive {
286
314
  /** Whether to bind scope to controller */
287
315
  bindToController?: boolean | Record<string, string>;
288
316
  /** Link function(s) executed during linking */
289
- link?: DirectiveLinkFn | DirectivePrePost;
317
+ link?: DirectiveLinkFn<TController> | DirectivePrePost;
290
318
  /** Priority of the directive */
291
319
  priority?: number;
292
320
  /** Stops further directive processing if true */
@@ -311,7 +339,7 @@ export interface Directive {
311
339
  }
312
340
  export type DirectiveFactoryFn = (
313
341
  ...args: any[]
314
- ) => Directive | DirectiveLinkFn;
342
+ ) => Directive | DirectiveLinkFn<any>;
315
343
  export type AnnotatedDirectiveFactory = Array<string | DirectiveFactoryFn>;
316
344
  export type DirectiveFactory = DirectiveFactoryFn | AnnotatedDirectiveFactory;
317
345
  /**
@@ -2,7 +2,11 @@ export { angular } from "./index.js";
2
2
  import { Angular as TAngular } from "./angular.js";
3
3
  import { Attributes as TAttributes } from "./core/compile/attributes.js";
4
4
  import { Scope as TScope } from "./core/scope/scope.js";
5
- import { NgModule as TNgModule } from "./core/di/ng-module.js";
5
+ import {
6
+ ListenerFn as TListenerFn,
7
+ Listener as TListener,
8
+ } from "./core/scope/interface.ts";
9
+ import { NgModule as TNgModule } from "./core/di/ng-module/ng-module.js";
6
10
  import { InjectorService as TInjectorService } from "./core/di/internal-injector.js";
7
11
  import {
8
12
  AnchorScrollProvider as TAnchorScrollProvider,
@@ -36,6 +40,7 @@ import {
36
40
  DirectiveFactory as TDirectiveFactory,
37
41
  Component as TComponent,
38
42
  Controller as TController,
43
+ Injectable as TInjectable,
39
44
  } from "./interface.ts";
40
45
  import {
41
46
  SseService as TSseService,
@@ -55,15 +60,23 @@ import {
55
60
  import {
56
61
  WorkerConnection as TWorkerConnection,
57
62
  WorkerConfig as TWorkerConfig,
58
- } from "./services/worker/interface.ts";
63
+ } from "./directive/worker/interface.ts";
64
+ import { Provider as TProvideService } from "./interface.ts";
65
+ import { Location as TLocationService } from "./services/location/location.js";
66
+ import { AnimateService as TAnimateService } from "./animations/interface.ts";
67
+ import { StorageBackend as TStorageBackend } from "./services/storage/interface.ts";
68
+ import { StreamConnectionConfig as TStreamConnectionConfig } from "./services/stream/interface.ts";
59
69
  declare global {
60
70
  interface Function {
61
71
  $inject?: readonly string[] | undefined;
62
72
  }
73
+ interface Window {
74
+ angular: TAngular;
75
+ }
63
76
  export namespace ng {
64
77
  type Angular = TAngular;
65
78
  type Attributes = TAttributes & Record<string, any>;
66
- type Directive = TDirective;
79
+ type Directive<TController = any> = TDirective<TController>;
67
80
  type DirectiveFactory = TDirectiveFactory;
68
81
  type Component = TComponent;
69
82
  type Controller = TController;
@@ -84,6 +97,7 @@ declare global {
84
97
  type SceProvider = TSceProvider;
85
98
  type SceDelegateProvider = TSceDelegateProvider;
86
99
  type AnchorScrollService = TAnchorScrollService;
100
+ type AnimateService = TAnimateService;
87
101
  type CompileService = TCompileFn;
88
102
  type ControllerService = TControllerService;
89
103
  type ExceptionHandlerService = TErrorHandler;
@@ -92,8 +106,10 @@ declare global {
92
106
  type HttpService = THttpService;
93
107
  type InterpolateService = TInterpolateService;
94
108
  type InjectorService = TInjectorService;
109
+ type LocationService = TLocationService;
95
110
  type LogService = TLogService;
96
111
  type ParseService = TParseService;
112
+ type ProvideService = TProvideService;
97
113
  type PubSubService = TPubSub;
98
114
  type RootElementService = Element;
99
115
  type RootScopeService = TScope;
@@ -103,9 +119,18 @@ declare global {
103
119
  type TemplateCacheService = Map<string, string>;
104
120
  type TemplateRequestService = TTemplateRequestService;
105
121
  type ErrorHandlingConfig = TErrorHandlingConfig;
106
- type WindowService = Window;
122
+ type ListenerFn = TListenerFn;
123
+ type Listener = TListener;
107
124
  type DocumentService = Document;
125
+ type WindowService = Window;
108
126
  type WorkerConfig = TWorkerConfig;
109
127
  type WorkerConnection = TWorkerConnection;
128
+ type Injectable<
129
+ T extends
130
+ | ((...args: any[]) => any)
131
+ | (abstract new (...args: any[]) => any),
132
+ > = TInjectable<T>;
133
+ type StorageBackend = TStorageBackend;
134
+ type StreamConnectionConfig = TStreamConnectionConfig;
110
135
  }
111
136
  }
package/@types/ng.d.ts CHANGED
@@ -1,8 +1,6 @@
1
1
  /**
2
2
  * Initializes core `ng` module.
3
- * @param {import('./angular.js').Angular} angular
4
- * @returns {import('./core/di/ng-module.js').NgModule} `ng` module
3
+ * @param {ng.Angular} angular
4
+ * @returns {ng.NgModule} `ng` module
5
5
  */
6
- export function registerNgModule(
7
- angular: import("./angular.js").Angular,
8
- ): import("./core/di/ng-module.js").NgModule;
6
+ export function registerNgModule(angular: ng.Angular): ng.NgModule;
@@ -211,31 +211,6 @@ export interface ParamDeclaration {
211
211
  * Default: If squash is not set, it uses the configured default squash policy. (See [[defaultSquashPolicy]]())
212
212
  */
213
213
  squash?: boolean | string;
214
- /**
215
- * @internal
216
- *
217
- * An array of [[Replace]] objects.
218
- *
219
- * When creating a Transition, defines how to handle certain special values, such as `undefined`, `null`,
220
- * or empty string `""`. If the transition is started, and the parameter value is equal to one of the "to"
221
- * values, then the parameter value is replaced with the "from" value.
222
- *
223
- * #### Example:
224
- * ```js
225
- * replace: [
226
- * { from: undefined, to: null },
227
- * { from: "", to: null }
228
- * ]
229
- * ```
230
- */
231
- replace?: Replace[];
232
- /**
233
- * @internal
234
- * @internal
235
- *
236
- * This is not part of the declaration; it is a calculated value depending on if a default value was specified or not.
237
- */
238
- isOptional?: boolean;
239
214
  /**
240
215
  * Dynamic flag
241
216
  *
@@ -385,15 +385,6 @@ export interface StateDeclaration {
385
385
  * ```
386
386
  */
387
387
  parent?: string | StateDeclaration;
388
- /**
389
- * Gets the internal State object API
390
- *
391
- * Gets the *internal API* for a registered state.
392
- *
393
- * Note: the internal [[StateObject]] API is subject to change without notice
394
- * @internal
395
- */
396
- $$state?: () => StateObject;
397
388
  /**
398
389
  * Resolve - a mechanism to asynchronously fetch data, participating in the Transition lifecycle
399
390
  *
@@ -21,7 +21,7 @@ export class TemplateFactoryProvider {
21
21
  $templateRequest: any;
22
22
  $http: import("../interface.ts").HttpService;
23
23
  $templateCache: ng.TemplateCacheService;
24
- $injector: import("../core/di/internal-injector.js").InjectorService;
24
+ $injector: import("../interface.ts").InjectorService;
25
25
  /**
26
26
  * Forces the provider to use $http service directly
27
27
  * @param {boolean} value
@@ -5,7 +5,6 @@ import { StateObject } from "../state/state-object.js";
5
5
  import { PathNode } from "../path/path-node.js";
6
6
  import { TargetState } from "../state/target-state.js";
7
7
  import { RegisteredHook } from "./hook-registry.js";
8
- import { TransitionHookScope } from "./transition-hook.js";
9
8
  /**
10
9
  * The TransitionOptions object can be used to change the behavior of a transition.
11
10
  *
@@ -79,16 +78,6 @@ export interface TransitionOptions {
79
78
  * @default `true`
80
79
  */
81
80
  supercede?: boolean;
82
- /** @internal */
83
- reloadState?: StateObject;
84
- /** @internal
85
- * If this transition is a redirect, this property should be the original Transition (which was redirected to this one)
86
- */
87
- redirectedFrom?: Transition;
88
- /** @internal */
89
- current?: () => Transition;
90
- /** @internal */
91
- source?: "sref" | "url" | "redirect" | "otherwise" | "unknown";
92
81
  }
93
82
  export interface TransitionHookOptions {
94
83
  current?: () => Transition;
@@ -299,10 +288,6 @@ export interface HookRegOptions {
299
288
  * Note: the Transition object only allows hooks to be registered before the Transition is started.
300
289
  */
301
290
  export interface IHookRegistry {
302
- /** @internal place to store the hooks */
303
- _registeredHooks: {
304
- [key: string]: RegisteredHook[];
305
- };
306
291
  /**
307
292
  * Registers a [[TransitionHookFn]], called *before a transition starts*.
308
293
  *
@@ -838,24 +823,6 @@ export interface IMatchingNodes {
838
823
  retained: PathNode[];
839
824
  entering: PathNode[];
840
825
  }
841
- /** @internal */
842
- export interface RegisteredHooks {
843
- [key: string]: RegisteredHook[];
844
- }
845
- /** @internal */
846
- export interface PathTypes {
847
- [key: string]: PathType;
848
- to: PathType;
849
- from: PathType;
850
- exiting: PathType;
851
- retained: PathType;
852
- entering: PathType;
853
- }
854
- /** @internal */
855
- export interface PathType {
856
- name: string;
857
- scope: TransitionHookScope;
858
- }
859
826
  /**
860
827
  * Hook Criterion used to match a transition.
861
828
  *