@angular-wave/angular.ts 0.15.2 → 0.16.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 (61) hide show
  1. package/@types/animations/interface.d.ts +4 -0
  2. package/@types/animations/runner/animate-runner.d.ts +2 -1
  3. package/@types/animations/shared.d.ts +100 -44
  4. package/@types/core/compile/attributes.d.ts +34 -18
  5. package/@types/core/compile/compile.d.ts +4 -5
  6. package/@types/core/controller/interface.d.ts +1 -1
  7. package/@types/core/di/di.d.ts +0 -10
  8. package/@types/core/di/interface.d.ts +28 -0
  9. package/@types/core/di/internal-injector.d.ts +28 -19
  10. package/@types/core/di/ng-module/ng-module.d.ts +35 -4
  11. package/@types/core/interpolate/interpolate.d.ts +1 -1
  12. package/@types/core/parse/ast/ast.d.ts +6 -12
  13. package/@types/core/parse/ast-type.d.ts +1 -1
  14. package/@types/core/parse/interface.d.ts +8 -40
  15. package/@types/core/parse/interpreter.d.ts +4 -3
  16. package/@types/core/parse/lexer/lexer.d.ts +2 -30
  17. package/@types/core/parse/parse.d.ts +1 -34
  18. package/@types/core/parse/parser/parser.d.ts +2 -13
  19. package/@types/core/sanitize/sanitize-uri.d.ts +2 -2
  20. package/@types/core/scope/interface.d.ts +1 -0
  21. package/@types/core/scope/scope.d.ts +10 -5
  22. package/@types/directive/form/form.d.ts +8 -40
  23. package/@types/directive/model/model.d.ts +34 -30
  24. package/@types/directive/model-options/model-options.d.ts +1 -2
  25. package/@types/directive/validators/validators.d.ts +5 -7
  26. package/@types/filters/order-by.d.ts +2 -1
  27. package/@types/interface.d.ts +3 -2
  28. package/@types/namespace.d.ts +18 -2
  29. package/@types/router/state/state-object.d.ts +2 -2
  30. package/@types/router/state/state-service.d.ts +1 -0
  31. package/@types/router/template-factory.d.ts +4 -5
  32. package/@types/router/transition/reject-factory.d.ts +32 -9
  33. package/@types/router/transition/transition-event-type.d.ts +2 -2
  34. package/@types/router/transition/transition-hook.d.ts +5 -2
  35. package/@types/router/transition/transition-service.d.ts +2 -2
  36. package/@types/router/transition/transition.d.ts +2 -2
  37. package/@types/router/view/view.d.ts +4 -4
  38. package/@types/services/http/http.d.ts +1 -1
  39. package/@types/services/pubsub/pubsub.d.ts +2 -2
  40. package/@types/services/sce/interface.d.ts +8 -0
  41. package/@types/services/sce/sce.d.ts +10 -7
  42. package/@types/services/sse/interface.d.ts +5 -20
  43. package/@types/services/storage/storage.d.ts +2 -2
  44. package/@types/services/stream/interface.d.ts +1 -0
  45. package/@types/services/stream/stream.d.ts +1 -1
  46. package/@types/services/template-request/template-request.d.ts +0 -1
  47. package/@types/services/websocket/interface.d.ts +16 -0
  48. package/@types/services/websocket/websocket.d.ts +20 -0
  49. package/@types/shared/common.d.ts +48 -27
  50. package/@types/shared/constants.d.ts +2 -8
  51. package/@types/shared/dom.d.ts +33 -19
  52. package/@types/shared/utils.d.ts +8 -8
  53. package/README.md +15 -7
  54. package/dist/angular-ts.esm.js +4257 -4325
  55. package/dist/angular-ts.umd.js +4257 -4325
  56. package/dist/angular-ts.umd.min.js +1 -1
  57. package/dist/angular-ts.umd.min.js.gz +0 -0
  58. package/dist/angular-ts.umd.min.js.map +1 -1
  59. package/package.json +1 -1
  60. package/@types/core/di/inteface.d.ts +0 -11
  61. /package/@types/core/compile/{inteface.d.ts → interface.d.ts} +0 -0
@@ -12,15 +12,26 @@ export namespace RejectType {
12
12
  export class Rejection {
13
13
  /** Returns a Rejection due to transition superseded */
14
14
  static superseded(detail: any, options: any): Rejection;
15
- /** Returns a Rejection due to redirected transition */
15
+ /** Returns a Rejection due to redirected transition
16
+ * @param {any} detail @returns {Rejection}
17
+ */
16
18
  static redirected(detail: any): Rejection;
17
- /** Returns a Rejection due to invalid transition */
19
+ /** Returns a Rejection due to invalid transition
20
+ * @param {any} detail @returns {Rejection}
21
+ */
18
22
  static invalid(detail: any): Rejection;
19
- /** Returns a Rejection due to ignored transition */
23
+ /** Returns a Rejection due to ignored transition
24
+ * @param {any} detail @returns {Rejection}
25
+ */
20
26
  static ignored(detail: any): Rejection;
21
- /** Returns a Rejection due to aborted transition */
27
+ /** Returns a Rejection due to aborted transition
28
+ * @param {any} detail @returns {Rejection}
29
+ */
22
30
  static aborted(detail: any): Rejection;
23
- /** Returns a Rejection due to aborted transition */
31
+ /** Returns a Rejection due to aborted transition
32
+ * @param detail
33
+ * @returns {Rejection}
34
+ */
24
35
  static errored(detail: any): Rejection;
25
36
  /**
26
37
  * Returns a Rejection
@@ -32,12 +43,24 @@ export class Rejection {
32
43
  * @returns `detail` if it is already a `Rejection`, else returns an ERROR Rejection.
33
44
  */
34
45
  static normalize(detail: any): any;
35
- constructor(type: any, message: any, detail: any);
46
+ /**
47
+ * @param {number} type
48
+ * @param {string} message
49
+ * @param {any} detail
50
+ */
51
+ constructor(type: number, message: string, detail: any);
52
+ /** @type {number} */
36
53
  $id: number;
37
- type: any;
38
- message: any;
54
+ type: number;
55
+ message: string;
39
56
  detail: any;
40
57
  redirected: boolean;
58
+ /** @returns {string} */
41
59
  toString(): string;
42
- toPromise(): any;
60
+ /**
61
+ * @returns {Promise<any> & {_transitionRejection: Rejection}}
62
+ */
63
+ toPromise(): Promise<any> & {
64
+ _transitionRejection: Rejection;
65
+ };
43
66
  }
@@ -10,7 +10,7 @@ export class TransitionEventType {
10
10
  criteriaMatchPath: any,
11
11
  reverseSort?: boolean,
12
12
  getResultHandler?: (hook: any) => (result: any) => any,
13
- getErrorHandler?: () => (error: any) => any,
13
+ getErrorHandler?: () => (error: any) => Promise<never>,
14
14
  synchronous?: boolean,
15
15
  );
16
16
  name: any;
@@ -19,6 +19,6 @@ export class TransitionEventType {
19
19
  criteriaMatchPath: any;
20
20
  reverseSort: boolean;
21
21
  getResultHandler: (hook: any) => (result: any) => any;
22
- getErrorHandler: () => (error: any) => any;
22
+ getErrorHandler: () => (error: any) => Promise<never>;
23
23
  synchronous: boolean;
24
24
  }
@@ -92,7 +92,9 @@ export class TransitionHook {
92
92
  * Return a Rejection promise if the transition is no longer current due
93
93
  * a new transition has started and superseded this one.
94
94
  */
95
- getNotCurrentRejection(): any;
95
+ getNotCurrentRejection(): Promise<any> & {
96
+ _transitionRejection: Rejection;
97
+ };
96
98
  toString(): string;
97
99
  }
98
100
  export namespace TransitionHook {
@@ -111,6 +113,7 @@ export namespace TransitionHook {
111
113
  * Each HookType chooses a GetErrorHandler (See: [[TransitionService._defineCoreEvents]])
112
114
  */
113
115
  function LOG_ERROR(hook: any): (error: any) => any;
114
- function REJECT_ERROR(): (error: any) => any;
116
+ function REJECT_ERROR(): (error: any) => Promise<never>;
115
117
  function THROW_ERROR(): (error: any) => never;
116
118
  }
119
+ import { Rejection } from "./reject-factory.js";
@@ -43,7 +43,7 @@ export class TransitionProvider {
43
43
  $view: import("../view/view.js").ViewService;
44
44
  _deregisterHookFns: {};
45
45
  /** @type {ng.ExceptionHandlerService} */
46
- _$exceptionHandler: ng.ExceptionHandlerService;
46
+ _exceptionHandler: ng.ExceptionHandlerService;
47
47
  $get: (
48
48
  | string
49
49
  | ((
@@ -97,7 +97,7 @@ export class TransitionProvider {
97
97
  criteriaMatchPath: any,
98
98
  reverseSort?: boolean,
99
99
  getResultHandler?: (hook: any) => (result: any) => any,
100
- getErrorHandler?: () => (error: any) => any,
100
+ getErrorHandler?: () => (error: any) => Promise<never>,
101
101
  synchronous?: boolean,
102
102
  ): void;
103
103
  /**
@@ -5,9 +5,9 @@
5
5
  *
6
6
  * This object contains all contextual information about the to/from states, parameters, resolves.
7
7
  * It has information about all states being entered and exited as a result of the transition.
8
- * @implements {HookRegistry}
8
+ * @extends {HookRegistry}
9
9
  */
10
- export class Transition implements HookRegistry {
10
+ export class Transition {
11
11
  /**
12
12
  * Creates a new Transition object.
13
13
  *
@@ -51,15 +51,15 @@ export class ViewService {
51
51
  /**
52
52
  * Returns the list of views currently available on the page, by fully-qualified name.
53
53
  *
54
- * @return {Array} Returns an array of fully-qualified view names.
54
+ * @return {Array<any>} Returns an array of fully-qualified view names.
55
55
  */
56
- available(): any[];
56
+ available(): Array<any>;
57
57
  /**
58
58
  * Returns the list of views on the page containing loaded content.
59
59
  *
60
- * @return {Array} Returns an array of fully-qualified view names.
60
+ * @return {Array<any>} Returns an array of fully-qualified view names.
61
61
  */
62
- active(): any[];
62
+ active(): Array<any>;
63
63
  }
64
64
  export namespace ViewService {
65
65
  /**
@@ -96,7 +96,7 @@ export class HttpProvider {
96
96
  | string
97
97
  | ((
98
98
  $injector: ng.InjectorService,
99
- $sce: any,
99
+ $sce: ng.SCEService,
100
100
  $cookie: ng.CookieService,
101
101
  ) => {
102
102
  (requestConfig: any): Promise<any>;
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Configurable provider for an injectable event bus
3
- * @implements {ng.ServiceProvider}
3
+ * @extends {ng.ServiceProvider}
4
4
  */
5
- export class PubSubProvider implements ng.ServiceProvider {
5
+ export class PubSubProvider {
6
6
  static $inject: string[];
7
7
  /**
8
8
  * @param {ng.ExceptionHandlerProvider} $exceptionHandler
@@ -1,10 +1,17 @@
1
1
  export interface SCEService {
2
+ HTML: string;
3
+ CSS: string;
4
+ JS: string;
5
+ URL: string;
6
+ RESOURCE_URL: string;
7
+ MEDIA_URL: string;
2
8
  getTrusted(type: string, mayBeTrusted: any): any;
3
9
  getTrustedCss(value: any): any;
4
10
  getTrustedHtml(value: any): any;
5
11
  getTrustedJs(value: any): any;
6
12
  getTrustedResourceUrl(value: any): any;
7
13
  getTrustedUrl(value: any): any;
14
+ getTrustedMediaUrl(value: any): any;
8
15
  parse(type: string, expression: string): (context: any, locals: any) => any;
9
16
  parseAsCss(expression: string): (context: any, locals: any) => any;
10
17
  parseAsHtml(expression: string): (context: any, locals: any) => any;
@@ -17,6 +24,7 @@ export interface SCEService {
17
24
  trustAsResourceUrl(value: any): any;
18
25
  trustAsUrl(value: any): any;
19
26
  isEnabled(): boolean;
27
+ valueOf(value?: any): any;
20
28
  }
21
29
  export interface SCEDelegateService {
22
30
  getTrusted(type: string, mayBeTrusted: any): any;
@@ -14,7 +14,7 @@ export class SceProvider {
14
14
  * @param {boolean=} value If provided, then enables/disables SCE application-wide.
15
15
  * @return {boolean} True if SCE is enabled, false otherwise.
16
16
  *
17
- * @description
17
+ *
18
18
  * Enables/disables SCE and returns the current value.
19
19
  */
20
20
  enabled: (value?: boolean | undefined, ...args: any[]) => boolean;
@@ -115,9 +115,9 @@ export class SceDelegateProvider {
115
115
  * Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items
116
116
  * allowed in this array.
117
117
  *
118
- * @return {Array} The currently set trusted resource URL array.
118
+ * @return {Array<any>} The currently set trusted resource URL array.
119
+ *
119
120
  *
120
- * @description
121
121
  * Sets/Gets the list trusted of resource URLs.
122
122
  *
123
123
  * The **default value** when no `trustedResourceUrlList` has been explicitly set is `['self']`
@@ -128,7 +128,10 @@ export class SceDelegateProvider {
128
128
  * its origin with other apps! It is a good idea to limit it to only your application's directory.
129
129
  * </div>
130
130
  */
131
- trustedResourceUrlList: (value?: any[] | undefined, ...args: any[]) => any[];
131
+ trustedResourceUrlList: (
132
+ value?: any[] | undefined,
133
+ ...args: any[]
134
+ ) => Array<any>;
132
135
  /**
133
136
  *
134
137
  * @param {Array=} bannedResourceUrlList When provided, replaces the `bannedResourceUrlList` with
@@ -143,15 +146,15 @@ export class SceDelegateProvider {
143
146
  * Finally, **the banned resource URL list overrides the trusted resource URL list** and has
144
147
  * the final say.
145
148
  *
146
- * @return {Array} The currently set `bannedResourceUrlList` array.
149
+ * @return {Array<any>} The currently set `bannedResourceUrlList` array.
150
+ *
147
151
  *
148
- * @description
149
152
  * Sets/Gets the `bannedResourceUrlList` of trusted resource URLs.
150
153
  *
151
154
  * The **default value** when no trusted resource URL list has been explicitly set is the empty
152
155
  * array (i.e. there is no `bannedResourceUrlList`.)
153
156
  */
154
- bannedResourceUrlList: (value: any, ...args: any[]) => any[];
157
+ bannedResourceUrlList: (value: any, ...args: any[]) => Array<any>;
155
158
  $get: (
156
159
  | string
157
160
  | ((
@@ -1,29 +1,14 @@
1
+ import { StreamConnectionConfig } from "../stream/interface.ts";
1
2
  /**
2
- * Configuration object for SSE
3
+ * SSE-specific configuration
3
4
  */
4
- export interface SseConfig {
5
+ export interface SseConfig extends StreamConnectionConfig {
5
6
  /** Include cookies/credentials when connecting */
6
7
  withCredentials?: boolean;
7
- /** Custom headers (Note: EventSource doesn't natively support headers; handled at app level if needed) */
8
- headers?: Record<string, string>;
9
- /** Called when the connection is successfully opened */
10
- onOpen?: (event: Event) => void;
11
- /** Called when a message event is received */
12
- onMessage?: (data: any, event: MessageEvent) => void;
13
- /** Called on connection error */
14
- onError?: (err: Event) => void;
15
- /** Transform raw SSE message data (default: JSON.parse if possible) */
16
- transformMessage?: (data: string) => any;
17
8
  /** Optional query parameters appended to the URL */
18
9
  params?: Record<string, any>;
19
- /** Called when the connection is being re-established */
20
- onReconnect?: (attempt: number) => void;
21
- /** Delay in milliseconds before attempting to reconnect (default: 1000ms) */
22
- retryDelay?: number;
23
- /** Maximum number of reconnect attempts (default: Infinity) */
24
- maxRetries?: number;
25
- /** Heartbeat timeout in milliseconds; reconnect if no message within this time */
26
- heartbeatTimeout?: number;
10
+ /** Custom headers (EventSource doesn't natively support headers) */
11
+ headers?: Record<string, string>;
27
12
  }
28
13
  /**
29
14
  * Managed SSE connection object returned by $sse.
@@ -4,14 +4,14 @@
4
4
  *
5
5
  * @param {Record<PropertyKey, any>} target - The object to wrap
6
6
  * @param {string} key - The storage key
7
- * @param {import("../../core/di/inteface").StorageLike & import("../../core/di/inteface").PersistentStoreConfig} storage - Any storage-like object with getItem/setItem/removeItem
7
+ * @param {import("../../core/di/interface.ts").StorageLike & import("../../core/di/interface").PersistentStoreConfig} storage - Any storage-like object with getItem/setItem/removeItem
8
8
  * @param {{serialize?: function, deserialize?: function}} [options] - Optional custom (de)serialization
9
9
  * @returns {Record<PropertyKey, any>}
10
10
  */
11
11
  export function createPersistentProxy(
12
12
  target: Record<PropertyKey, any>,
13
13
  key: string,
14
- storage: any & any,
14
+ storage: import("../../core/di/interface.ts").StorageLike & any,
15
15
  options?: {
16
16
  serialize?: Function;
17
17
  deserialize?: Function;
@@ -15,4 +15,5 @@ export interface StreamConnectionConfig {
15
15
  heartbeatTimeout?: number;
16
16
  /** Function to transform incoming messages */
17
17
  transformMessage?: (data: any) => any;
18
+ [key: string]: any;
18
19
  }
@@ -23,7 +23,7 @@ export class StreamConnection {
23
23
  retryDelay: number;
24
24
  maxRetries: number;
25
25
  heartbeatTimeout: number;
26
- transformMessage: (data: string) => any;
26
+ transformMessage: (data: any) => any;
27
27
  };
28
28
  _log: import("../log/interface.ts").LogService;
29
29
  _retryCount: number;
@@ -8,7 +8,6 @@
8
8
  export class TemplateRequestProvider {
9
9
  /** @type {ng.RequestShortcutConfig|undefined} */
10
10
  httpOptions: ng.RequestShortcutConfig | undefined;
11
- /** @returns {Array} DI tokens for Angular.ts injection */
12
11
  $get: (
13
12
  | string
14
13
  | ((
@@ -0,0 +1,16 @@
1
+ import { StreamConnectionConfig } from "../stream/interface.ts";
2
+ import { StreamConnection } from "../stream/stream.js";
3
+ /**
4
+ * WebSocket-specific configuration
5
+ */
6
+ export interface WebSocketConfig extends StreamConnectionConfig {
7
+ /** Optional WebSocket subprotocols */
8
+ protocols?: string[];
9
+ /** Called when the WebSocket connection closes */
10
+ onClose?: (event: CloseEvent) => void;
11
+ }
12
+ export type WebSocketService = (
13
+ url: string,
14
+ protocols?: string[],
15
+ config?: WebSocketConfig,
16
+ ) => StreamConnection;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * WebSocketProvider
3
+ * Provides a pre-configured WebSocket connection as an injectable.
4
+ */
5
+ export class WebSocketProvider {
6
+ /** @type {ng.WebSocketConfig} */
7
+ defaults: ng.WebSocketConfig;
8
+ $get: (
9
+ | string
10
+ | ((
11
+ log: ng.LogService,
12
+ ) => (
13
+ url: string,
14
+ protocols?: string[],
15
+ config?: import("./interface.ts").WebSocketConfig,
16
+ ) => StreamConnection)
17
+ )[];
18
+ _$log: import("../log/interface.ts").LogService;
19
+ }
20
+ import { StreamConnection } from "../stream/stream.js";
@@ -1,4 +1,8 @@
1
- export function equals(o1: any, o2: any): boolean;
1
+ /**
2
+ * @param {unknown} o1
3
+ * @param {unknown} o2
4
+ */
5
+ export function equals(o1: unknown, o2: unknown): boolean;
2
6
  /**
3
7
  * prototypal inheritance helper.
4
8
  * Creates a new object which has `parent` object as its prototype, and then copies the properties from `extra` onto it
@@ -15,25 +19,46 @@ export function inherit(parent: any, extra?: any): any;
15
19
  /**
16
20
  * Given an array, and an item, if the item is found in the array, it removes it (in-place).
17
21
  * The same array is returned
18
- * @param {Array} array
22
+ * @param {Array<any>} array
19
23
  * @param {any} obj
20
- * @returns {Array}
24
+ * @returns {Array<any>}
21
25
  */
22
- export function removeFrom(array: any[], obj: any): any[];
26
+ export function removeFrom(array: Array<any>, obj: any): Array<any>;
23
27
  /**
24
28
  * Applies a set of defaults to an options object. The options object is filtered
25
29
  * to only those properties of the objects in the defaultsList.
26
30
  * Earlier objects in the defaultsList take precedence when applying defaults.
31
+ * @param {{}} opts
32
+ * @param {{ current?: (() => void) | (() => null); transition?: null; traceData?: {}; bind?: null; inherit?: boolean; matchingKeys?: null; state?: { params: {}; }; strict?: boolean; caseInsensitive?: boolean; relative?: import("../router/state/state-object.js").StateObject | null | undefined; location?: boolean; notify?: boolean; reload?: boolean; supercede?: boolean; custom?: {}; source?: string; lossy?: boolean; absolute?: boolean; }[]} defaultsList
27
33
  */
28
- export function defaults(opts: any, ...defaultsList: any[]): any;
29
- /**
30
- * Finds the common ancestor path between two states.
31
- *
32
- * @param {Object} first The first state.
33
- * @param {Object} second The second state.
34
- * @return {Array} Returns an array of state names in descending order, not including the root.
35
- */
36
- export function ancestors(first: any, second: any): any[];
34
+ export function defaults(
35
+ opts: {},
36
+ ...defaultsList: {
37
+ current?: (() => void) | (() => null);
38
+ transition?: null;
39
+ traceData?: {};
40
+ bind?: null;
41
+ inherit?: boolean;
42
+ matchingKeys?: null;
43
+ state?: {
44
+ params: {};
45
+ };
46
+ strict?: boolean;
47
+ caseInsensitive?: boolean;
48
+ relative?:
49
+ | import("../router/state/state-object.js").StateObject
50
+ | null
51
+ | undefined;
52
+ location?: boolean;
53
+ notify?: boolean;
54
+ reload?: boolean;
55
+ supercede?: boolean;
56
+ custom?: {};
57
+ source?: string;
58
+ lossy?: boolean;
59
+ absolute?: boolean;
60
+ }[]
61
+ ): any;
37
62
  /**
38
63
  * Return a copy of the object only containing the whitelisted properties.
39
64
  *
@@ -77,18 +102,17 @@ export function assertFn(
77
102
  /**
78
103
  * Given two or more parallel arrays, returns an array of tuples where
79
104
  * each tuple is composed of [ a[i], b[i], ... z[i] ]
80
- *
81
- * @example
82
- * ```
83
- *
84
- * let foo = [ 0, 2, 4, 6 ];
85
- * let bar = [ 1, 3, 5, 7 ];
86
- * let baz = [ 10, 30, 50, 70 ];
87
- * arrayTuples(foo, bar); // [ [0, 1], [2, 3], [4, 5], [6, 7] ]
88
- * arrayTuples(foo, bar, baz); // [ [0, 1, 10], [2, 3, 30], [4, 5, 50], [6, 7, 70] ]
89
- * ```
105
+ * @example ```
106
+
107
+ let foo = [ 0, 2, 4, 6 ];
108
+ let bar = [ 1, 3, 5, 7 ];
109
+ let baz = [ 10, 30, 50, 70 ];
110
+ arrayTuples(foo, bar); // [ [0, 1], [2, 3], [4, 5], [6, 7] ]
111
+ arrayTuples(foo, bar, baz); // [ [0, 1, 10], [2, 3, 30], [4, 5, 50], [6, 7, 70] ]
112
+ ```
113
+ * @param {any[][]} args
90
114
  */
91
- export function arrayTuples(...args: any[]): any[][];
115
+ export function arrayTuples(...args: any[][]): any[][];
92
116
  /**
93
117
  * Reduce function which builds an object from an array of [key, value] pairs.
94
118
  *
@@ -131,6 +155,3 @@ export function assertPredicate(
131
155
  predicateOrMap: any,
132
156
  errMsg?: string,
133
157
  ): (obj: any) => any;
134
- export function pairs(obj: any): any[][];
135
- export function silenceUncaughtInPromise(promise: any): any;
136
- export function silentRejection(error: any): any;
@@ -8,11 +8,5 @@ export const EMPTY_CLASS: "ng-empty";
8
8
  export const NOT_EMPTY_CLASS: "ng-not-empty";
9
9
  export const PREFIX_REGEXP: RegExp;
10
10
  export const SPECIAL_CHARS_REGEXP: RegExp;
11
- export namespace ALIASED_ATTR {
12
- let ngMinlength: string;
13
- let ngMaxlength: string;
14
- let ngMin: string;
15
- let ngMax: string;
16
- let ngPattern: string;
17
- let ngStep: string;
18
- }
11
+ /** @type {Record<string, string>} */
12
+ export const ALIASED_ATTR: Record<string, string>;
@@ -11,24 +11,24 @@ export function kebabToCamel(name: string): string;
11
11
  */
12
12
  export function snakeToCamel(name: string): string;
13
13
  /**
14
- * Removes expando data from this element. If key is provided, only
15
- * its field is removed. If data is empty, also removes `ExpandoStore`
16
- * from cache.
17
- * @param {Element} element
18
- * @param {string} [name] - key of field to remove
14
+ * @param {Element & Record<string, any>} element
15
+ * @param {string} [name]
19
16
  */
20
- export function removeElementData(element: Element, name?: string): void;
17
+ export function removeElementData(
18
+ element: Element & Record<string, any>,
19
+ name?: string,
20
+ ): void;
21
21
  /**
22
22
  * Stores data associated with an element inside the expando property of the DOM element.
23
23
  *
24
24
  * @see {@link https://developer.mozilla.org/en-US/docs/Glossary/Expando MDN Glossary: Expando}
25
25
  *
26
- * @param {Element} element
26
+ * @param {Element & Record<string, any> } element
27
27
  * @param {boolean} [createIfNecessary=false]
28
28
  * @returns {import("../interface.ts").ExpandoStore}
29
29
  */
30
30
  export function getExpando(
31
- element: Element,
31
+ element: Element & Record<string, any>,
32
32
  createIfNecessary?: boolean,
33
33
  ): import("../interface.ts").ExpandoStore;
34
34
  /**
@@ -38,22 +38,30 @@ export function getExpando(
38
38
  */
39
39
  export function isTextNode(html: string): boolean;
40
40
  /**
41
- * @param {Element} element
41
+ * @param {Element & Record<string, any>} element
42
+ * @param {Element & Record<string, any>} element
42
43
  * @param {boolean} [onlyDescendants]
43
44
  * @returns {void}
44
45
  */
45
- export function dealoc(element: Element, onlyDescendants?: boolean): void;
46
+ export function dealoc(
47
+ element: Element & Record<string, any>,
48
+ onlyDescendants?: boolean,
49
+ ): void;
46
50
  /**
47
51
  * Gets or sets cache data for a given element.
48
52
  *
49
53
  * @param {Element} element - The DOM element to get or set data on.
50
- * @param {string|Object} key - The key (as a string) to get/set or an object for mass-setting.
54
+ * @param {string|Object.<string, any>} key - The key to get/set or an object for mass-setting.
51
55
  * @param {*} [value] - The value to set. If not provided, the function acts as a getter.
52
- * @returns {*} - The retrieved data if acting as a getter. Otherwise, returns undefined.
56
+ * @returns {*} - The retrieved data if acting as a getter. Otherwise, undefined.
53
57
  */
54
58
  export function getOrSetCacheData(
55
59
  element: Element,
56
- key: string | any,
60
+ key:
61
+ | string
62
+ | {
63
+ [x: string]: any;
64
+ },
57
65
  value?: any,
58
66
  ): any;
59
67
  /**
@@ -128,10 +136,11 @@ export function getController(
128
136
  name?: string,
129
137
  ): ng.Scope | undefined;
130
138
  /**
139
+ * Walk up the DOM tree (including Shadow DOM) to get inherited data.
131
140
  *
132
- * @param {Node} element
133
- * @param {string} name
134
- * @returns
141
+ * @param {Node} element - The starting element (or document/document fragment)
142
+ * @param {string} name - The data key to look up
143
+ * @returns {any} - The found value, or undefined if not found
135
144
  */
136
145
  export function getInheritedData(element: Node, name: string): any;
137
146
  /**
@@ -149,10 +158,10 @@ export function removeElement(element: Element, keepData?: boolean): void;
149
158
  export function startingTag(elementOrStr: string | Element | Node): string;
150
159
  /**
151
160
  * Return the DOM siblings between the first and last node in the given array.
152
- * @param {Array<Node>} nodes An array-like object
153
- * @returns {*[]|Array<Node>} the inputted object or a JQLite collection containing the nodes
161
+ * @param {Node[]} nodes
162
+ * @returns {Node[]}
154
163
  */
155
- export function getBlockNodes(nodes: Array<Node>): any[] | Array<Node>;
164
+ export function getBlockNodes(nodes: Node[]): Node[];
156
165
  /**
157
166
  * Gets the name of a boolean attribute if it exists on a given element.
158
167
  *
@@ -230,6 +239,11 @@ export function animatedomInsert(
230
239
  * @returns {string} The base href.
231
240
  */
232
241
  export function getBaseHref(): string;
242
+ /**
243
+ * @param {NodeList|Node} element
244
+ * @returns {Node | undefined}
245
+ */
246
+ export function extractElementNode(element: NodeList | Node): Node | undefined;
233
247
  /**
234
248
  * Expando cache for adding properties to DOM nodes with JavaScript.
235
249
  * This used to be an Object in JQLite decorator, but swapped out for a Map
@@ -23,14 +23,14 @@ export function deProxy<T>(
23
23
  export function nextUid(): number;
24
24
  /**
25
25
  *
26
- * @description Converts the specified string to lowercase.
26
+ * Converts the specified string to lowercase.
27
27
  * @param {string} string String to be converted to lowercase.
28
28
  * @returns {string} Lowercased string.
29
29
  */
30
30
  export function lowercase(string: string): string;
31
31
  /**
32
32
  *
33
- * @description Converts the specified string to uppercase.
33
+ * Converts the specified string to uppercase.
34
34
  * @param {string} string String to be converted to uppercase.
35
35
  * @returns {string} Uppercased string.
36
36
  */
@@ -133,9 +133,9 @@ export function isNumber(value: unknown): value is number;
133
133
  * Determines if a value is a date.
134
134
  *
135
135
  * @param {*} value Reference to check.
136
- * @returns {boolean} True if `value` is a `Date`.
136
+ * @returns {value is Date} True if `value` is a `Date`.
137
137
  */
138
- export function isDate(value: any): boolean;
138
+ export function isDate(value: any): value is Date;
139
139
  /**
140
140
  * Determines if a reference is an `Error`.
141
141
  * Loosely based on https://www.npmjs.com/package/iserror
@@ -148,16 +148,16 @@ export function isError(value: any): value is Error;
148
148
  * Determines if a reference is a `Function`.
149
149
  *
150
150
  * @param {*} value Reference to check.
151
- * @returns {boolean} True if `value` is a `Function`.
151
+ * @returns {value is Function} True if `value` is a `Function`.
152
152
  */
153
- export function isFunction(value: any): boolean;
153
+ export function isFunction(value: any): value is Function;
154
154
  /**
155
155
  * Determines if a value is a regular expression object.
156
156
  *
157
157
  * @param {*} value Reference to check.
158
- * @returns {boolean} True if `value` is a `RegExp`.
158
+ * @returns {value is RegExp} True if `value` is a `RegExp`.
159
159
  */
160
- export function isRegExp(value: any): boolean;
160
+ export function isRegExp(value: any): value is RegExp;
161
161
  /**
162
162
  * Checks if `obj` is a window object.
163
163
  *