@angular-wave/angular.ts 0.15.0 → 0.15.1

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 (59) hide show
  1. package/@types/angular.d.ts +1 -1
  2. package/@types/core/compile/attributes.d.ts +28 -4
  3. package/@types/core/compile/inteface.d.ts +5 -1
  4. package/@types/core/di/inteface.d.ts +11 -0
  5. package/@types/core/parse/ast/ast-node.d.ts +2 -0
  6. package/@types/core/parse/parse.d.ts +4 -1
  7. package/@types/core/scope/interface.d.ts +26 -0
  8. package/@types/directive/bind/bind.d.ts +5 -7
  9. package/@types/directive/form/form.d.ts +12 -9
  10. package/@types/directive/init/init.d.ts +2 -2
  11. package/@types/directive/input/input.d.ts +16 -0
  12. package/@types/directive/listener/listener.d.ts +4 -0
  13. package/@types/directive/model/interface.d.ts +18 -0
  14. package/@types/directive/model/model.d.ts +20 -18
  15. package/@types/directive/non-bindable/non-bindable.d.ts +2 -2
  16. package/@types/directive/select/select.d.ts +2 -2
  17. package/@types/directive/setter/setter.d.ts +2 -2
  18. package/@types/directive/show-hide/show-hide.d.ts +2 -4
  19. package/@types/directive/switch/switch.d.ts +4 -4
  20. package/@types/interface.d.ts +22 -1
  21. package/@types/namespace.d.ts +9 -1
  22. package/@types/router/router.d.ts +5 -3
  23. package/@types/router/scroll/interface.d.ts +1 -1
  24. package/@types/router/state/interface.d.ts +5 -0
  25. package/@types/router/state/state-builder.d.ts +10 -6
  26. package/@types/router/state/state-matcher.d.ts +11 -3
  27. package/@types/router/state/state-object.d.ts +3 -5
  28. package/@types/router/state/state-queue-manager.d.ts +14 -8
  29. package/@types/router/state/state-registry.d.ts +12 -3
  30. package/@types/router/state/state-service.d.ts +8 -2
  31. package/@types/router/transition/hook-registry.d.ts +15 -5
  32. package/@types/router/transition/transition.d.ts +4 -2
  33. package/@types/router/url/url-rules.d.ts +3 -84
  34. package/@types/router/url/url-service.d.ts +9 -8
  35. package/@types/services/cookie/cookie.d.ts +3 -11
  36. package/@types/services/http/http.d.ts +6 -31
  37. package/@types/services/http/interface.d.ts +22 -0
  38. package/@types/services/location/location.d.ts +14 -13
  39. package/@types/services/sce/interface.d.ts +25 -0
  40. package/@types/services/sse/interface.d.ts +8 -1
  41. package/@types/services/sse/sse.d.ts +10 -18
  42. package/@types/services/storage/storage.d.ts +6 -6
  43. package/@types/services/stream/interface.d.ts +1 -1
  44. package/@types/services/stream/stream.d.ts +98 -0
  45. package/@types/shared/common.d.ts +2 -2
  46. package/@types/shared/dom.d.ts +21 -42
  47. package/@types/shared/hof.d.ts +27 -37
  48. package/@types/shared/noderef.d.ts +2 -2
  49. package/@types/shared/strings.d.ts +13 -4
  50. package/@types/shared/utils.d.ts +123 -66
  51. package/@types/shared/validate.d.ts +7 -0
  52. package/dist/angular-ts.esm.js +980 -812
  53. package/dist/angular-ts.umd.js +980 -812
  54. package/dist/angular-ts.umd.min.js +1 -1
  55. package/dist/angular-ts.umd.min.js.gz +0 -0
  56. package/dist/angular-ts.umd.min.js.map +1 -1
  57. package/package.json +1 -1
  58. package/@types/router/state-filters.d.ts +0 -39
  59. package/@types/shared/cache.d.ts +0 -7
@@ -1,4 +1,3 @@
1
- /** @typedef {import('./interface.ts').StateDeclaration} StateDeclaration */
2
1
  /**
3
2
  * Internal representation of a ng-router state.
4
3
  *
@@ -8,9 +7,9 @@
8
7
  *
9
8
  * This class prototypally inherits from the corresponding [[StateDeclaration]].
10
9
  * Each of its own properties (i.e., `hasOwnProperty`) are built using builders from the [[StateBuilder]].
11
- * @implements {StateDeclaration}
10
+ * @implements {ng.StateDeclaration}
12
11
  */
13
- export class StateObject implements StateDeclaration {
12
+ export class StateObject implements ng.StateDeclaration {
14
13
  /**
15
14
  * @param {import('./interface.ts').StateDeclaration} config
16
15
  */
@@ -27,7 +26,7 @@ export class StateObject implements StateDeclaration {
27
26
  * @type {ng.StateDeclaration|ng.BuiltStateDeclaration}
28
27
  */
29
28
  self: ng.StateDeclaration | ng.BuiltStateDeclaration;
30
- __stateObjectCache: {
29
+ _stateObjectCache: {
31
30
  nameGlob: Glob;
32
31
  };
33
32
  /**
@@ -79,5 +78,4 @@ export namespace StateObject {
79
78
  /** Predicate which returns true if the object is an internal [[StateObject]] object */
80
79
  function isState(obj: any): boolean;
81
80
  }
82
- export type StateDeclaration = import("./interface.ts").StateDeclaration;
83
81
  import { Glob } from "../glob/glob.js";
@@ -1,21 +1,22 @@
1
1
  export class StateQueueManager {
2
2
  /**
3
3
  * @param {import("./state-registry.js").StateRegistryProvider} stateRegistry
4
- * @param {*} urlServiceRules
5
- * @param {Record<string, ng.StateObject>} states
4
+ * @param {import("../url/url-rules.js").UrlRules} urlServiceRules
5
+ * @param {import("./interface.ts").StateStore} states
6
6
  * @param {*} builder
7
7
  * @param {*} listeners
8
8
  */
9
9
  constructor(
10
10
  stateRegistry: import("./state-registry.js").StateRegistryProvider,
11
- urlServiceRules: any,
12
- states: Record<string, ng.StateObject>,
11
+ urlServiceRules: import("../url/url-rules.js").UrlRules,
12
+ states: import("./interface.ts").StateStore,
13
13
  builder: any,
14
14
  listeners: any,
15
15
  );
16
16
  stateRegistry: import("./state-registry.js").StateRegistryProvider;
17
- urlServiceRules: any;
18
- states: Record<string, StateObject>;
17
+ /** @type {import("../url/url-rules.js").UrlRules} */
18
+ urlServiceRules: import("../url/url-rules.js").UrlRules;
19
+ states: import("./interface.ts").StateStore;
19
20
  builder: any;
20
21
  listeners: any;
21
22
  /**
@@ -23,7 +24,12 @@ export class StateQueueManager {
23
24
  */
24
25
  queue: Array<StateObject>;
25
26
  register(stateDecl: any): StateObject;
26
- flush(): Record<string, StateObject>;
27
- attachRoute(state: any): void;
27
+ flush(): import("./interface.ts").StateStore;
28
+ /**
29
+ *
30
+ * @param {ng.StateDeclaration} state
31
+ * @returns {() => void} a function that deregisters the rule
32
+ */
33
+ attachRoute(state: ng.StateDeclaration): () => void;
28
34
  }
29
35
  import { StateObject } from "./state-object.js";
@@ -19,8 +19,8 @@ export class StateRegistryProvider {
19
19
  globals: ng.RouterService,
20
20
  viewService: ng.ViewService,
21
21
  );
22
- /** @type {Record<string, import("./state-object.js").StateObject>} */
23
- states: Record<string, import("./state-object.js").StateObject>;
22
+ /** @type {import("./interface.ts").StateStore} */
23
+ states: import("./interface.ts").StateStore;
24
24
  urlService: import("../url/url-service.js").UrlService;
25
25
  urlServiceRules: import("../url/url-rules.js").UrlRules;
26
26
  $injector: any;
@@ -115,7 +115,16 @@ export class StateRegistryProvider {
115
115
  * @return {ng.BuiltStateDeclaration[]}
116
116
  */
117
117
  getAll(): ng.BuiltStateDeclaration[];
118
- get(stateOrName: any, base: any, ...args: any[]): any;
118
+ get(
119
+ stateOrName: any,
120
+ base: any,
121
+ ...args: any[]
122
+ ):
123
+ | import("./interface.ts").StateDeclaration
124
+ | (
125
+ | import("./interface.ts").StateDeclaration
126
+ | import("./interface.ts").BuiltStateDeclaration
127
+ )[];
119
128
  /**
120
129
  * Registers a [[BuilderFunction]] for a specific [[StateObject]] property (e.g., `parent`, `url`, or `path`).
121
130
  * More than one BuilderFunction can be registered for a given property.
@@ -34,8 +34,14 @@ export class StateProvider {
34
34
  * @deprecated This is a passthrough through to [[Router.$current]]
35
35
  */
36
36
  get $current(): import("./state-object.js").StateObject;
37
- globals: import("../router.js").RouterProvider;
38
- transitionService: import("../transition/transition-service.js").TransitionProvider;
37
+ /**
38
+ * @type {ng.RouterProvider}
39
+ */
40
+ globals: ng.RouterProvider;
41
+ /**
42
+ * @type {ng.TransitionProvider}
43
+ */
44
+ transitionService: ng.TransitionProvider;
39
45
  stateRegistry: any;
40
46
  /** @type {ng.UrlService} */
41
47
  urlService: ng.UrlService;
@@ -16,12 +16,22 @@ export function matchState(
16
16
  criterion: any,
17
17
  transition: any,
18
18
  ): boolean;
19
- /** Return a registration function of the requested type. */
19
+ /**
20
+ * Return a registration function of the requested type.
21
+ * @param {ng.TransitionProvider| import("./transition.js").Transition} hookSource
22
+ * @param {ng.TransitionProvider} transitionService
23
+ * @param {import("./transition-event-type.js").TransitionEventType} eventType
24
+ * @returns {( matchObject: any, callback: Function, options?: Record<string, any> ) => () => void }
25
+ */
20
26
  export function makeEvent(
21
- registry: any,
22
- transitionService: any,
23
- eventType: any,
24
- ): (matchObject: any, callback: any, options?: {}) => any;
27
+ hookSource: ng.TransitionProvider | import("./transition.js").Transition,
28
+ transitionService: ng.TransitionProvider,
29
+ eventType: import("./transition-event-type.js").TransitionEventType,
30
+ ): (
31
+ matchObject: any,
32
+ callback: Function,
33
+ options?: Record<string, any>,
34
+ ) => () => void;
25
35
  /**
26
36
  * The registration data for a registered transition hook
27
37
  */
@@ -29,8 +29,10 @@ export class Transition implements HookRegistry {
29
29
  * @type {import('../router.js').RouterProvider}
30
30
  */
31
31
  _globals: import("../router.js").RouterProvider;
32
- _transitionService: import("./transition-service.js").TransitionProvider;
33
- _deferred: any;
32
+ /** @type {ng.TransitionProvider} */
33
+ _transitionProvider: ng.TransitionProvider;
34
+ /** @type {PromiseWithResolvers<any>} */
35
+ _deferred: PromiseWithResolvers<any>;
34
36
  /**
35
37
  * This promise is resolved or rejected based on the outcome of the Transition.
36
38
  *
@@ -14,89 +14,7 @@ export class UrlRules {
14
14
  _sortFn: typeof defaultRuleSortFn;
15
15
  _rules: any[];
16
16
  _id: number;
17
- urlRuleFactory: UrlRuleFactory;
18
- /**
19
- * Defines the initial state, path, or behavior to use when the app starts.
20
- *
21
- * This rule defines the initial/starting state for the application.
22
- *
23
- * This rule is triggered the first time the URL is checked (when the app initially loads).
24
- * The rule is triggered only when the url matches either `""` or `"/"`.
25
- *
26
- * Note: The rule is intended to be used when the root of the application is directly linked to.
27
- * When the URL is *not* `""` or `"/"` and doesn't match other rules, the [[otherwise]] rule is triggered.
28
- * This allows 404-like behavior when an unknown URL is deep-linked.
29
- *
30
- * #### Example:
31
- * Start app at `home` state.
32
- * ```js
33
- * .initial({ state: 'home' });
34
- * ```
35
- *
36
- * #### Example:
37
- * Start app at `/home` (by url)
38
- * ```js
39
- * .initial('/home');
40
- * ```
41
- *
42
- * #### Example:
43
- * When no other url rule matches, go to `home` state
44
- * ```js
45
- * .initial((matchValue, url, router) => {
46
- * console.log('initial state');
47
- * return { state: 'home' };
48
- * })
49
- * ```
50
- *
51
- * @param handler The initial state or url path, or a function which returns the state or url path (or performs custom logic).
52
- */
53
- initial(handler: any): void;
54
- /**
55
- * Defines the state, url, or behavior to use when no other rule matches the URL.
56
- *
57
- * This rule is matched when *no other rule* matches.
58
- * It is generally used to handle unknown URLs (similar to "404" behavior, but on the client side).
59
- *
60
- * - If `handler` a string, it is treated as a url redirect
61
- *
62
- * #### Example:
63
- * When no other url rule matches, redirect to `/index`
64
- * ```js
65
- * .otherwise('/index');
66
- * ```
67
- *
68
- * - If `handler` is an object with a `state` property, the state is activated.
69
- *
70
- * #### Example:
71
- * When no other url rule matches, redirect to `home` and provide a `dashboard` parameter value.
72
- * ```js
73
- * .otherwise({ state: 'home', params: { dashboard: 'default' } });
74
- * ```
75
- *
76
- * - If `handler` is a function, the function receives the current url ([[UrlParts]]) and the [[UIRouter]] object.
77
- * The function can perform actions, and/or return a value.
78
- *
79
- * #### Example:
80
- * When no other url rule matches, manually trigger a transition to the `home` state
81
- * ```js
82
- * .otherwise((matchValue, urlParts, router) => {
83
- * router.stateService.go('home');
84
- * });
85
- * ```
86
- *
87
- * #### Example:
88
- * When no other url rule matches, go to `home` state
89
- * ```js
90
- * .otherwise((matchValue, urlParts, router) => {
91
- * return { state: 'home' };
92
- * });
93
- * ```
94
- *
95
- * @param handler The url path to redirect to, or a function which returns the url path (or performs custom logic).
96
- */
97
- otherwise(handler: any): void;
98
- _otherwiseFn: import("./url-rule.js").BaseUrlRule;
99
- _sorted: boolean;
17
+ _urlRuleFactory: UrlRuleFactory;
100
18
  /**
101
19
  * Remove a rule previously registered
102
20
  *
@@ -113,9 +31,10 @@ export class UrlRules {
113
31
  * A rule should have a `match` function which returns truthy if the rule matched.
114
32
  * It should also have a `handler` function which is invoked if the rule is the best match.
115
33
  *
116
- * @return a function that deregisters the rule
34
+ * @returns {() => void } a function that deregisters the rule
117
35
  */
118
36
  rule(rule: any): () => void;
37
+ _sorted: boolean;
119
38
  /**
120
39
  * Gets all registered rules
121
40
  *
@@ -5,13 +5,13 @@ export class UrlService {
5
5
  static $inject: string[];
6
6
  /**
7
7
  * @param {ng.LocationProvider} $locationProvider
8
- * @param {import("../../router/state/state-service.js").StateProvider} stateService
8
+ * @param {import("../../router/state/state-service.js").StateProvider} stateProvider
9
9
  * @param {import("../router.js").RouterProvider} globals
10
10
  * @param {import("../../router/url/url-config.js").UrlConfigProvider} urlConfigProvider
11
11
  */
12
12
  constructor(
13
13
  $locationProvider: ng.LocationProvider,
14
- stateService: import("../../router/state/state-service.js").StateProvider,
14
+ stateProvider: import("../../router/state/state-service.js").StateProvider,
15
15
  globals: import("../router.js").RouterProvider,
16
16
  urlConfigProvider: import("../../router/url/url-config.js").UrlConfigProvider,
17
17
  );
@@ -20,20 +20,21 @@ export class UrlService {
20
20
  /** @private */
21
21
  private _locationProvider;
22
22
  stateService: import("../../router/state/state-service.js").StateProvider;
23
- /** Provides services related to the URL */
24
- urlRuleFactory: UrlRuleFactory;
23
+ /** @type {UrlRuleFactory} Provides services related to the URL */
24
+ _urlRuleFactory: UrlRuleFactory;
25
25
  /**
26
26
  * The nested [[UrlRules]] API for managing URL rules and rewrites
27
+ * @ignore
27
28
  * @type {UrlRules}
28
29
  */
29
- rules: UrlRules;
30
+ _rules: UrlRules;
30
31
  /**
31
32
  * The nested [[UrlConfig]] API to configure the URL and retrieve URL information
32
33
  * @type {import("./url-config.js").UrlConfigProvider}
33
34
  */
34
- config: import("./url-config.js").UrlConfigProvider;
35
- /** Creates a new [[Param]] for a given location (DefType) */
36
- paramFactory: ParamFactory;
35
+ _config: import("./url-config.js").UrlConfigProvider;
36
+ /** @type {ParamFactory} Creates a new [[Param]] for a given location (DefType) */
37
+ _paramFactory: ParamFactory;
37
38
  _urlListeners: any[];
38
39
  /**
39
40
  * Gets the path part of the current url
@@ -5,10 +5,7 @@
5
5
  export class CookieProvider {
6
6
  /** @type {ng.CookieOptions} */
7
7
  defaults: ng.CookieOptions;
8
- $get: (
9
- | string
10
- | (($exceptionHandler: ng.ExceptionHandlerService) => CookieService)
11
- )[];
8
+ $get: () => CookieService;
12
9
  }
13
10
  /**
14
11
  *
@@ -21,16 +18,10 @@ export class CookieService {
21
18
  /**
22
19
  * @param {ng.CookieOptions} defaults
23
20
  * Default cookie attributes defined by `$cookiesProvider.defaults`.
24
- * @param {ng.ExceptionHandlerService} $exceptionHandler
25
21
  */
26
- constructor(
27
- defaults: ng.CookieOptions,
28
- $exceptionHandler: ng.ExceptionHandlerService,
29
- );
22
+ constructor(defaults: ng.CookieOptions);
30
23
  /** @private @type {ng.CookieOptions} */
31
24
  private _defaults;
32
- /** @private @type {ng.ExceptionHandlerService} */
33
- private _$exceptionHandler;
34
25
  /**
35
26
  * Retrieves a raw cookie value.
36
27
  *
@@ -61,6 +52,7 @@ export class CookieService {
61
52
  * @param {string} key
62
53
  * @param {string} value
63
54
  * @param {ng.CookieOptions} [options]
55
+ * @throws {URIError} if key or value cannot be encoded
64
56
  */
65
57
  put(key: string, value: string, options?: ng.CookieOptions): void;
66
58
  /**
@@ -23,21 +23,7 @@ export function defaultHttpResponseTransform(data: any, headers: any): any;
23
23
  */
24
24
  export function HttpProvider(): void;
25
25
  export class HttpProvider {
26
- defaults: {
27
- transformResponse: (typeof defaultHttpResponseTransform)[];
28
- transformRequest: ((data: any) => any)[];
29
- headers: {
30
- common: {
31
- Accept: string;
32
- };
33
- post: any;
34
- put: any;
35
- patch: any;
36
- };
37
- xsrfCookieName: string;
38
- xsrfHeaderName: string;
39
- paramSerializer: string;
40
- };
26
+ defaults: import("./interface.ts").HttpProviderDefaults;
41
27
  /**
42
28
  * Configure $http service to combine processing of multiple http responses received at around
43
29
  * the same time via {@link ng.$rootScope.Scope#$applyAsync $rootScope.$applyAsync}. This can result in
@@ -62,8 +48,11 @@ export class HttpProvider {
62
48
  * array, on request, but reverse order, on response.
63
49
  *
64
50
  * {@link ng.$http#interceptors Interceptors detailed info}
51
+ * @type {Array<string | ng.Injectable<import("./interface.ts").HttpInterceptorFactory>>}
65
52
  */
66
- interceptors: any[];
53
+ interceptors: Array<
54
+ string | ng.Injectable<import("./interface.ts").HttpInterceptorFactory>
55
+ >;
67
56
  /**
68
57
  * Array containing URLs whose origins are trusted to receive the XSRF token. See the
69
58
  * {@link ng.$http#security-considerations Security Considerations} sections for more details on
@@ -118,21 +107,7 @@ export class HttpProvider {
118
107
  *
119
108
  * See "Setting HTTP Headers" and "Transforming Requests and Responses" sections above.
120
109
  */
121
- defaults: {
122
- transformResponse: (typeof defaultHttpResponseTransform)[];
123
- transformRequest: ((data: any) => any)[];
124
- headers: {
125
- common: {
126
- Accept: string;
127
- };
128
- post: any;
129
- put: any;
130
- patch: any;
131
- };
132
- xsrfCookieName: string;
133
- xsrfHeaderName: string;
134
- paramSerializer: string;
135
- };
110
+ defaults: import("./interface.ts").HttpProviderDefaults;
136
111
  })
137
112
  )[];
138
113
  }
@@ -4,6 +4,14 @@ export interface HttpHeadersGetter {
4
4
  };
5
5
  (headerName: string): string;
6
6
  }
7
+ export interface HttpPromiseCallback<T> {
8
+ (
9
+ data: T,
10
+ status: number,
11
+ headers: HttpHeadersGetter,
12
+ config: RequestConfig,
13
+ ): void;
14
+ }
7
15
  export interface HttpRequestConfigHeaders {
8
16
  [requestType: string]: any;
9
17
  common?: any;
@@ -18,6 +26,9 @@ export interface HttpRequestTransformer {
18
26
  export interface HttpResponseTransformer {
19
27
  (data: any, headersGetter: HttpHeadersGetter, status: number): any;
20
28
  }
29
+ export interface HttpHeaderType {
30
+ [requestType: string]: string | ((config: RequestConfig) => string);
31
+ }
21
32
  /**
22
33
  * Object that controls the defaults for $http provider. Not all fields of RequestShortcutConfig can be configured
23
34
  * via defaults and the docs do not say which. The following is based on the inspection of the source code.
@@ -228,3 +239,14 @@ export type HttpParams = Record<
228
239
  * A function that serializes an object into a URL-encoded query string.
229
240
  */
230
241
  export type HttpParamSerializer = (params?: HttpParams) => string;
242
+ export interface HttpInterceptor {
243
+ request?(config: RequestConfig): RequestConfig | Promise<RequestConfig>;
244
+ requestError?(rejection: any): RequestConfig | Promise<RequestConfig>;
245
+ response?<T>(
246
+ response: HttpResponse<T>,
247
+ ): Promise<HttpResponse<T>> | HttpResponse<T>;
248
+ responseError?<T>(rejection: any): Promise<HttpResponse<T>> | HttpResponse<T>;
249
+ }
250
+ export interface HttpInterceptorFactory {
251
+ (...args: any[]): HttpInterceptor;
252
+ }
@@ -182,13 +182,13 @@ export class Location {
182
182
  * Current url
183
183
  * @type {string}
184
184
  */
185
- $$url: string;
185
+ _url: string;
186
186
  /**
187
187
  * @ignore
188
188
  * Callback to update browser url
189
- * @type {Function}
189
+ * @type {Function | undefined}
190
190
  */
191
- $$updateBrowser: Function;
191
+ _updateBrowser: Function | undefined;
192
192
  /**
193
193
  * Change path, search and hash, when called with parameter and return `$location`.
194
194
  *
@@ -249,7 +249,7 @@ export class Location {
249
249
  * @private
250
250
  * Compose url and update `url` and `absUrl` property
251
251
  */
252
- private $$compose;
252
+ private _compose;
253
253
  /**
254
254
  * Change the history state object when called with one parameter and return `$location`.
255
255
  * The state object is later passed to `pushState` or `replaceState`.
@@ -285,15 +285,16 @@ export class LocationProvider {
285
285
  hashPrefixConf: string;
286
286
  /** @type {import("./interface.ts").Html5Mode} */
287
287
  html5ModeConf: import("./interface.ts").Html5Mode;
288
- /** @type {Array<import("./interface.ts").UrlChangeListener>} */
289
- urlChangeListeners: Array<import("./interface.ts").UrlChangeListener>;
290
- urlChangeInit: boolean;
291
- /** @type {History['state']} */
292
- cachedState: History["state"];
293
- /** @type {History['state']} */
294
- lastHistoryState: History["state"];
295
- /** @type {string} */
296
- lastBrowserUrl: string;
288
+ /** @private @type {Array<import("./interface.ts").UrlChangeListener>} */
289
+ private _urlChangeListeners;
290
+ /** @private */
291
+ private _urlChangeInit;
292
+ /** @private @type {History['state']} */
293
+ private _cachedState;
294
+ /** @private @type {History['state']} */
295
+ private _lastHistoryState;
296
+ /** @private @type {string} */
297
+ private _lastBrowserUrl;
297
298
  /**
298
299
  * Updates the browser's current URL and history state.
299
300
  *
@@ -0,0 +1,25 @@
1
+ export interface SCEService {
2
+ getTrusted(type: string, mayBeTrusted: any): any;
3
+ getTrustedCss(value: any): any;
4
+ getTrustedHtml(value: any): any;
5
+ getTrustedJs(value: any): any;
6
+ getTrustedResourceUrl(value: any): any;
7
+ getTrustedUrl(value: any): any;
8
+ parse(type: string, expression: string): (context: any, locals: any) => any;
9
+ parseAsCss(expression: string): (context: any, locals: any) => any;
10
+ parseAsHtml(expression: string): (context: any, locals: any) => any;
11
+ parseAsJs(expression: string): (context: any, locals: any) => any;
12
+ parseAsResourceUrl(expression: string): (context: any, locals: any) => any;
13
+ parseAsUrl(expression: string): (context: any, locals: any) => any;
14
+ trustAs(type: string, value: any): any;
15
+ trustAsHtml(value: any): any;
16
+ trustAsJs(value: any): any;
17
+ trustAsResourceUrl(value: any): any;
18
+ trustAsUrl(value: any): any;
19
+ isEnabled(): boolean;
20
+ }
21
+ export interface SCEDelegateService {
22
+ getTrusted(type: string, mayBeTrusted: any): any;
23
+ trustAs(type: string, value: any): any;
24
+ valueOf(value: any): any;
25
+ }
@@ -32,11 +32,18 @@ export interface SseConfig {
32
32
  export interface SseConnection {
33
33
  /** Manually close the SSE connection and stop all reconnect attempts */
34
34
  close(): void;
35
- /** Manually restart the SSE connection */
35
+ /**
36
+ * Manually restart the SSE connection.
37
+ * @remarks
38
+ * Any previous event listeners are preserved; reconnects use the original configuration.
39
+ */
36
40
  connect(): void;
37
41
  }
38
42
  /**
39
43
  * $sse service type
40
44
  * Returns a managed SSE connection that automatically reconnects when needed.
45
+ * @param url - The endpoint to connect to
46
+ * @param config - Optional configuration object
47
+ * @throws {URIError} If the URL is invalid
41
48
  */
42
49
  export type SseService = (url: string, config?: SseConfig) => SseConnection;
@@ -1,23 +1,15 @@
1
- /**
2
- * SSE Provider
3
- *
4
- * Usage:
5
- * const source = $sse('/events', {
6
- * onMessage: (data) => console.log(data),
7
- * onError: (err) => console.error(err),
8
- * retryDelay: 2000,
9
- * heartbeatTimeout: 10000,
10
- * });
11
- *
12
- * source.close();
13
- */
14
1
  export class SseProvider {
15
- /**
16
- * Optional provider-level defaults
17
- * @type {ng.SseConfig}
18
- */
2
+ /** @type {ng.SseConfig} */
19
3
  defaults: ng.SseConfig;
20
- $get: (string | ((log: ng.LogService) => ng.SseService))[];
4
+ $get: (
5
+ | string
6
+ | ((
7
+ log: ng.LogService,
8
+ ) => (
9
+ url: string,
10
+ config?: import("./interface.ts").SseConfig,
11
+ ) => import("./interface.ts").SseConnection)
12
+ )[];
21
13
  _$log: import("../log/interface.ts").LogService;
22
14
  #private;
23
15
  }
@@ -2,18 +2,18 @@
2
2
  * Creates a proxy that automatically persists an object's state
3
3
  * into a storage backend whenever a property is set.
4
4
  *
5
- * @param {object} target - The object to wrap
5
+ * @param {Record<PropertyKey, any>} target - The object to wrap
6
6
  * @param {string} key - The storage key
7
- * @param {object} storage - Any storage-like object with getItem/setItem/removeItem
7
+ * @param {import("../../core/di/inteface").StorageLike & import("../../core/di/inteface").PersistentStoreConfig} storage - Any storage-like object with getItem/setItem/removeItem
8
8
  * @param {{serialize?: function, deserialize?: function}} [options] - Optional custom (de)serialization
9
- * @returns {Proxy}
9
+ * @returns {Record<PropertyKey, any>}
10
10
  */
11
11
  export function createPersistentProxy(
12
- target: object,
12
+ target: Record<PropertyKey, any>,
13
13
  key: string,
14
- storage: object,
14
+ storage: any & any,
15
15
  options?: {
16
16
  serialize?: Function;
17
17
  deserialize?: Function;
18
18
  },
19
- ): ProxyConstructor;
19
+ ): Record<PropertyKey, any>;
@@ -2,7 +2,7 @@ export interface StreamConnectionConfig {
2
2
  /** Called when the connection opens */
3
3
  onOpen?: (event: Event) => void;
4
4
  /** Called when a message is received */
5
- onMessage?: (data: any, event: Event) => void;
5
+ onMessage?: (data: any, event: Event | MessageEvent) => void;
6
6
  /** Called when an error occurs */
7
7
  onError?: (err: any) => void;
8
8
  /** Called when a reconnect attempt happens */