@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.
- package/@types/animations/interface.d.ts +4 -0
- package/@types/animations/runner/animate-runner.d.ts +2 -1
- package/@types/animations/shared.d.ts +100 -44
- package/@types/core/compile/attributes.d.ts +34 -18
- package/@types/core/compile/compile.d.ts +4 -5
- package/@types/core/controller/interface.d.ts +1 -1
- package/@types/core/di/di.d.ts +0 -10
- package/@types/core/di/interface.d.ts +28 -0
- package/@types/core/di/internal-injector.d.ts +28 -19
- package/@types/core/di/ng-module/ng-module.d.ts +35 -4
- package/@types/core/interpolate/interpolate.d.ts +1 -1
- package/@types/core/parse/ast/ast.d.ts +6 -12
- package/@types/core/parse/ast-type.d.ts +1 -1
- package/@types/core/parse/interface.d.ts +8 -40
- package/@types/core/parse/interpreter.d.ts +4 -3
- package/@types/core/parse/lexer/lexer.d.ts +2 -30
- package/@types/core/parse/parse.d.ts +1 -34
- package/@types/core/parse/parser/parser.d.ts +2 -13
- package/@types/core/sanitize/sanitize-uri.d.ts +2 -2
- package/@types/core/scope/interface.d.ts +1 -0
- package/@types/core/scope/scope.d.ts +10 -5
- package/@types/directive/form/form.d.ts +8 -40
- package/@types/directive/model/model.d.ts +34 -30
- package/@types/directive/model-options/model-options.d.ts +1 -2
- package/@types/directive/validators/validators.d.ts +5 -7
- package/@types/filters/order-by.d.ts +2 -1
- package/@types/interface.d.ts +3 -2
- package/@types/namespace.d.ts +18 -2
- package/@types/router/state/state-object.d.ts +2 -2
- package/@types/router/state/state-service.d.ts +1 -0
- package/@types/router/template-factory.d.ts +4 -5
- package/@types/router/transition/reject-factory.d.ts +32 -9
- package/@types/router/transition/transition-event-type.d.ts +2 -2
- package/@types/router/transition/transition-hook.d.ts +5 -2
- package/@types/router/transition/transition-service.d.ts +2 -2
- package/@types/router/transition/transition.d.ts +2 -2
- package/@types/router/view/view.d.ts +4 -4
- package/@types/services/http/http.d.ts +1 -1
- package/@types/services/pubsub/pubsub.d.ts +2 -2
- package/@types/services/sce/interface.d.ts +8 -0
- package/@types/services/sce/sce.d.ts +10 -7
- package/@types/services/sse/interface.d.ts +5 -20
- package/@types/services/storage/storage.d.ts +2 -2
- package/@types/services/stream/interface.d.ts +1 -0
- package/@types/services/stream/stream.d.ts +1 -1
- package/@types/services/template-request/template-request.d.ts +0 -1
- package/@types/services/websocket/interface.d.ts +16 -0
- package/@types/services/websocket/websocket.d.ts +20 -0
- package/@types/shared/common.d.ts +48 -27
- package/@types/shared/constants.d.ts +2 -8
- package/@types/shared/dom.d.ts +33 -19
- package/@types/shared/utils.d.ts +8 -8
- package/README.md +15 -7
- package/dist/angular-ts.esm.js +4257 -4325
- package/dist/angular-ts.umd.js +4257 -4325
- package/dist/angular-ts.umd.min.js +1 -1
- package/dist/angular-ts.umd.min.js.gz +0 -0
- package/dist/angular-ts.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/@types/core/di/inteface.d.ts +0 -11
- /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
|
-
|
|
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:
|
|
38
|
-
message:
|
|
54
|
+
type: number;
|
|
55
|
+
message: string;
|
|
39
56
|
detail: any;
|
|
40
57
|
redirected: boolean;
|
|
58
|
+
/** @returns {string} */
|
|
41
59
|
toString(): string;
|
|
42
|
-
|
|
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) =>
|
|
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) =>
|
|
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) =>
|
|
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
|
-
|
|
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) =>
|
|
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
|
-
* @
|
|
8
|
+
* @extends {HookRegistry}
|
|
9
9
|
*/
|
|
10
|
-
export class Transition
|
|
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
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Configurable provider for an injectable event bus
|
|
3
|
-
* @
|
|
3
|
+
* @extends {ng.ServiceProvider}
|
|
4
4
|
*/
|
|
5
|
-
export class PubSubProvider
|
|
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
|
-
*
|
|
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: (
|
|
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
|
-
*
|
|
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
|
-
/**
|
|
20
|
-
|
|
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/
|
|
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:
|
|
14
|
+
storage: import("../../core/di/interface.ts").StorageLike & any,
|
|
15
15
|
options?: {
|
|
16
16
|
serialize?: Function;
|
|
17
17
|
deserialize?: Function;
|
|
@@ -23,7 +23,7 @@ export class StreamConnection {
|
|
|
23
23
|
retryDelay: number;
|
|
24
24
|
maxRetries: number;
|
|
25
25
|
heartbeatTimeout: number;
|
|
26
|
-
transformMessage: (data:
|
|
26
|
+
transformMessage: (data: any) => any;
|
|
27
27
|
};
|
|
28
28
|
_log: import("../log/interface.ts").LogService;
|
|
29
29
|
_retryCount: number;
|
|
@@ -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
|
-
|
|
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
|
|
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(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
*
|
|
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
|
-
|
|
12
|
-
|
|
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>;
|
package/@types/shared/dom.d.ts
CHANGED
|
@@ -11,24 +11,24 @@ export function kebabToCamel(name: string): string;
|
|
|
11
11
|
*/
|
|
12
12
|
export function snakeToCamel(name: string): string;
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
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(
|
|
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(
|
|
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
|
|
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,
|
|
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:
|
|
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 {
|
|
153
|
-
* @returns {
|
|
161
|
+
* @param {Node[]} nodes
|
|
162
|
+
* @returns {Node[]}
|
|
154
163
|
*/
|
|
155
|
-
export function getBlockNodes(nodes:
|
|
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
|
package/@types/shared/utils.d.ts
CHANGED
|
@@ -23,14 +23,14 @@ export function deProxy<T>(
|
|
|
23
23
|
export function nextUid(): number;
|
|
24
24
|
/**
|
|
25
25
|
*
|
|
26
|
-
*
|
|
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
|
-
*
|
|
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 {
|
|
136
|
+
* @returns {value is Date} True if `value` is a `Date`.
|
|
137
137
|
*/
|
|
138
|
-
export function isDate(value: any):
|
|
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 {
|
|
151
|
+
* @returns {value is Function} True if `value` is a `Function`.
|
|
152
152
|
*/
|
|
153
|
-
export function isFunction(value: any):
|
|
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 {
|
|
158
|
+
* @returns {value is RegExp} True if `value` is a `RegExp`.
|
|
159
159
|
*/
|
|
160
|
-
export function isRegExp(value: any):
|
|
160
|
+
export function isRegExp(value: any): value is RegExp;
|
|
161
161
|
/**
|
|
162
162
|
* Checks if `obj` is a window object.
|
|
163
163
|
*
|