@angular-wave/angular.ts 0.14.0 → 0.14.2
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/core/compile/inteface.d.ts +13 -9
- package/@types/core/di/ng-module/ng-module.d.ts +2 -2
- package/@types/namespace.d.ts +4 -13
- package/@types/services/pubsub/pubsub.d.ts +45 -150
- package/@types/shared/utils.d.ts +13 -3
- package/dist/angular-ts.esm.js +176 -315
- package/dist/angular-ts.umd.js +176 -315
- package/dist/angular-ts.umd.min.js +1 -1
- package/package.json +1 -1
|
@@ -7,10 +7,10 @@ import type { NodeRef } from "../../shared/noderef.js";
|
|
|
7
7
|
*
|
|
8
8
|
* The function returns the DOM content to be injected (transcluded) into the directive.
|
|
9
9
|
*/
|
|
10
|
-
export type TranscludeFn =
|
|
11
|
-
clone?: Element | Node | ChildNode | NodeList | Node[],
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
export type TranscludeFn = {
|
|
11
|
+
(clone?: Element | Node | ChildNode | NodeList | Node[], scope?: Scope): void;
|
|
12
|
+
$$slots?: any;
|
|
13
|
+
};
|
|
14
14
|
/**
|
|
15
15
|
* A specialized version of `TranscludeFn` with the scope argument already bound.
|
|
16
16
|
* This function requires no parameters and returns the same result as `TranscludeFn`.
|
|
@@ -26,11 +26,15 @@ export interface SimpleChange {
|
|
|
26
26
|
/**
|
|
27
27
|
* A function returned by the `$compile` service that links a compiled template to a scope.
|
|
28
28
|
*/
|
|
29
|
-
export type PublicLinkFn =
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
export type PublicLinkFn = {
|
|
30
|
+
(
|
|
31
|
+
scope: Scope,
|
|
32
|
+
cloneConnectFn?: TranscludeFn,
|
|
33
|
+
options?: any,
|
|
34
|
+
): Element | Node | ChildNode | Node[];
|
|
35
|
+
pre?: any;
|
|
36
|
+
post?: any;
|
|
37
|
+
};
|
|
34
38
|
/**
|
|
35
39
|
* Entry point for the `$compile` service.
|
|
36
40
|
*/
|
|
@@ -165,14 +165,14 @@ export class NgModule {
|
|
|
165
165
|
): NgModule;
|
|
166
166
|
/**
|
|
167
167
|
* @param {string} name
|
|
168
|
-
* @param {Function} ctor
|
|
168
|
+
* @param {Function|Object} ctor - A regular function, an arrow function or an object
|
|
169
169
|
* @param {ng.StorageType} type
|
|
170
170
|
* @param {ng.StorageBackend} [backendOrConfig]
|
|
171
171
|
* @returns {NgModule}
|
|
172
172
|
*/
|
|
173
173
|
store(
|
|
174
174
|
name: string,
|
|
175
|
-
ctor: Function,
|
|
175
|
+
ctor: Function | any,
|
|
176
176
|
type: ng.StorageType,
|
|
177
177
|
backendOrConfig?: ng.StorageBackend,
|
|
178
178
|
): NgModule;
|
package/@types/namespace.d.ts
CHANGED
|
@@ -108,15 +108,10 @@ declare global {
|
|
|
108
108
|
type NgModule = TNgModule;
|
|
109
109
|
type PubSubProvider = TPubSubProvider;
|
|
110
110
|
type CompositeLinkFn = TCompositeLinkFn;
|
|
111
|
-
type PublicLinkFn = TPublicLinkFn
|
|
112
|
-
pre: any;
|
|
113
|
-
post: any;
|
|
114
|
-
};
|
|
111
|
+
type PublicLinkFn = TPublicLinkFn;
|
|
115
112
|
type NodeLinkFn = TNodeLinkFn;
|
|
116
113
|
type NodeLinkFnCtx = TNodeLinkFnCtx;
|
|
117
|
-
type TranscludeFn = TTranscludeFn
|
|
118
|
-
$$slots: any;
|
|
119
|
-
};
|
|
114
|
+
type TranscludeFn = TTranscludeFn;
|
|
120
115
|
type BoundTranscludeFn = TBoundTranscludeFn;
|
|
121
116
|
type LinkFnMapping = TLinkFnMapping;
|
|
122
117
|
type AnchorScrollProvider = TAnchorScrollProvider;
|
|
@@ -132,9 +127,7 @@ declare global {
|
|
|
132
127
|
type CookieService = TCookieService;
|
|
133
128
|
type ExceptionHandlerService = TExceptionHandler;
|
|
134
129
|
type FilterFn = TFilterFn;
|
|
135
|
-
type FilterFactory = TFilterFactory
|
|
136
|
-
$$moduleName: string;
|
|
137
|
-
};
|
|
130
|
+
type FilterFactory = TFilterFactory;
|
|
138
131
|
type FilterService = TFilterService;
|
|
139
132
|
type HttpParamSerializerSerService = THttpParamSerializer;
|
|
140
133
|
type HttpService = THttpService;
|
|
@@ -163,9 +156,7 @@ declare global {
|
|
|
163
156
|
T extends
|
|
164
157
|
| ((...args: any[]) => any)
|
|
165
158
|
| (abstract new (...args: any[]) => any),
|
|
166
|
-
> = TInjectable<T
|
|
167
|
-
$$moduleName: string;
|
|
168
|
-
};
|
|
159
|
+
> = TInjectable<T>;
|
|
169
160
|
type StorageBackend = TStorageBackend;
|
|
170
161
|
type StorageType = TStorageType;
|
|
171
162
|
type StreamConnectionConfig = TStreamConnectionConfig;
|
|
@@ -9,174 +9,69 @@ export class PubSubProvider {
|
|
|
9
9
|
* @type {PubSub}
|
|
10
10
|
*/
|
|
11
11
|
eventBus: PubSub;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
*/
|
|
15
|
-
$get: () => PubSub;
|
|
12
|
+
$get: any[];
|
|
13
|
+
$exceptionHandler: import("../exception/interface.ts").ExceptionHandler;
|
|
16
14
|
}
|
|
17
15
|
export class PubSub {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
* @param {Object} context Context in which to run the function.
|
|
25
|
-
* @param {Array} args Arguments to pass to the function.
|
|
26
|
-
*/
|
|
27
|
-
private static runAsync_;
|
|
28
|
-
/**
|
|
29
|
-
* Topic-based publish/subscribe channel. Maintains a map of topics to
|
|
30
|
-
* subscriptions. When a message is published to a topic, all functions
|
|
31
|
-
* subscribed to that topic are invoked in the order they were added.
|
|
32
|
-
* Uncaught errors abort publishing.
|
|
33
|
-
*
|
|
34
|
-
* Topics may be identified by any nonempty string, <strong>except</strong>
|
|
35
|
-
* strings corresponding to native Object properties, e.g. "constructor",
|
|
36
|
-
* "toString", "hasOwnProperty", etc.
|
|
37
|
-
*
|
|
38
|
-
* @param {boolean=} async Enable asynchronous behavior. Recommended for
|
|
39
|
-
* new code. See notes on the publish() method.
|
|
40
|
-
*/
|
|
41
|
-
constructor(async?: boolean | undefined);
|
|
42
|
-
disposed: boolean;
|
|
43
|
-
/**
|
|
44
|
-
* The next available subscription key. Internally, this is an index into the
|
|
45
|
-
* sparse array of subscriptions.
|
|
46
|
-
*
|
|
47
|
-
* @private {number}
|
|
48
|
-
*/
|
|
49
|
-
private key;
|
|
50
|
-
/**
|
|
51
|
-
* Array of subscription keys pending removal once publishing is done.
|
|
52
|
-
*
|
|
53
|
-
* @private {!Array<number>}
|
|
54
|
-
* @const
|
|
55
|
-
*/
|
|
56
|
-
private pendingKeys;
|
|
16
|
+
/** @private {Object<string, Array<{fn: Function, context: any}>>} */
|
|
17
|
+
private _topics;
|
|
18
|
+
/** @private */
|
|
19
|
+
private _disposed;
|
|
20
|
+
/** @type {ng.ExceptionHandlerService} */
|
|
21
|
+
$exceptionHandler: ng.ExceptionHandlerService;
|
|
57
22
|
/**
|
|
58
|
-
*
|
|
59
|
-
* at the beginning of {@link #publish}, and decremented at the end.
|
|
60
|
-
*
|
|
61
|
-
* @private {number}
|
|
23
|
+
* Set instance to initial state
|
|
62
24
|
*/
|
|
63
|
-
|
|
25
|
+
reset(): void;
|
|
64
26
|
/**
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
* Each tuple occupies three consecutive positions in the array, with the
|
|
68
|
-
* topic identifier at index n, the function at index (n + 1), the context
|
|
69
|
-
* object at index (n + 2), the next topic at index (n + 3), etc. (This
|
|
70
|
-
* representation minimizes the number of object allocations and has been
|
|
71
|
-
* shown to be faster than an array of objects with three key-value pairs or
|
|
72
|
-
* three parallel arrays, especially on IE.) Once a subscription is removed
|
|
73
|
-
* via {@link unsubscribe} or {@link unsubscribeByKey}, the three
|
|
74
|
-
* corresponding array elements are deleted, and never reused. This means the
|
|
75
|
-
* total number of subscriptions during the lifetime of the pubsub channel is
|
|
76
|
-
* limited by the maximum length of a JavaScript array to (2^32 - 1) / 3 =
|
|
77
|
-
* 1,431,655,765 subscriptions, which should suffice for most applications.
|
|
78
|
-
*
|
|
79
|
-
* @private {!Array<?>}
|
|
80
|
-
* @const
|
|
27
|
+
* Checks if instance has been disposed.
|
|
28
|
+
* @returns {boolean} True if disposed.
|
|
81
29
|
*/
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Map of topics to arrays of subscription keys.
|
|
85
|
-
*
|
|
86
|
-
* @private {!Object<!Array<number>>}
|
|
87
|
-
*/
|
|
88
|
-
private topics;
|
|
89
|
-
/**
|
|
90
|
-
* @private @const {boolean}
|
|
91
|
-
*/
|
|
92
|
-
private async_;
|
|
93
|
-
/**
|
|
94
|
-
* Subscribes a function to a topic. The function is invoked as a method on
|
|
95
|
-
* the given `opt_context` object, or in the global scope if no context
|
|
96
|
-
* is specified. Subscribing the same function to the same topic multiple
|
|
97
|
-
* times will result in multiple function invocations while publishing.
|
|
98
|
-
* Returns a subscription key that can be used to unsubscribe the function from
|
|
99
|
-
* the topic via {@link unsubscribeByKey}.
|
|
100
|
-
*
|
|
101
|
-
* @param {string} topic Topic to subscribe to.
|
|
102
|
-
* @param {Function} fn Function to be invoked when a message is published to
|
|
103
|
-
* the given topic.
|
|
104
|
-
* @param {Object=} opt_context Object in whose context the function is to be
|
|
105
|
-
* called (the global scope if none).
|
|
106
|
-
* @return {number} Subscription key.
|
|
107
|
-
*/
|
|
108
|
-
subscribe(topic: string, fn: Function, opt_context?: any | undefined): number;
|
|
30
|
+
isDisposed(): boolean;
|
|
109
31
|
/**
|
|
110
|
-
*
|
|
111
|
-
* method on the given `opt_context` object, or in the global scope if
|
|
112
|
-
* no context is specified, and is then unsubscribed. Returns a subscription
|
|
113
|
-
* key that can be used to unsubscribe the function from the topic via
|
|
114
|
-
* {@link unsubscribeByKey}.
|
|
115
|
-
*
|
|
116
|
-
* @param {string} topic Topic to subscribe to.
|
|
117
|
-
* @param {Function} fn Function to be invoked once and then unsubscribed when
|
|
118
|
-
* a message is published to the given topic.
|
|
119
|
-
* @param {Object=} opt_context Object in whose context the function is to be
|
|
120
|
-
* called (the global scope if none).
|
|
121
|
-
* @return {number} Subscription key.
|
|
32
|
+
* Dispose the instance, removing all topics and listeners.
|
|
122
33
|
*/
|
|
123
|
-
|
|
124
|
-
topic: string,
|
|
125
|
-
fn: Function,
|
|
126
|
-
opt_context?: any | undefined,
|
|
127
|
-
): number;
|
|
34
|
+
dispose(): void;
|
|
128
35
|
/**
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
* @param {
|
|
133
|
-
* @
|
|
134
|
-
* @param {Object=} opt_context Object in whose context the function was to be
|
|
135
|
-
* called (the global scope if none).
|
|
136
|
-
* @return {boolean} Whether a matching subscription was removed.
|
|
36
|
+
* Subscribe a function to a topic.
|
|
37
|
+
* @param {string} topic - The topic to subscribe to.
|
|
38
|
+
* @param {Function} fn - The callback function to invoke when published.
|
|
39
|
+
* @param {*} [context] - Optional `this` context for the callback.
|
|
40
|
+
* @returns {() => boolean} A function that unsubscribes this listener.
|
|
137
41
|
*/
|
|
138
|
-
|
|
139
|
-
topic: string,
|
|
140
|
-
fn: Function,
|
|
141
|
-
opt_context?: any | undefined,
|
|
142
|
-
): boolean;
|
|
42
|
+
subscribe(topic: string, fn: Function, context?: any): () => boolean;
|
|
143
43
|
/**
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
* @param {
|
|
149
|
-
* @
|
|
44
|
+
* Subscribe a function to a topic only once.
|
|
45
|
+
* Listener is removed before the first invocation.
|
|
46
|
+
* @param {string} topic - The topic to subscribe to.
|
|
47
|
+
* @param {Function} fn - The callback function.
|
|
48
|
+
* @param {*} [context] - Optional `this` context for the callback.
|
|
49
|
+
* @returns {() => boolean} A function that unsubscribes this listener.
|
|
150
50
|
*/
|
|
151
|
-
|
|
51
|
+
subscribeOnce(topic: string, fn: Function, context?: any): () => boolean;
|
|
152
52
|
/**
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
* @param {string} topic Topic to publish to.
|
|
161
|
-
* @param {...*} var_args Arguments that are applied to each subscription
|
|
162
|
-
* function.
|
|
163
|
-
* @return {boolean} Whether any subscriptions were called.
|
|
53
|
+
* Unsubscribe a specific function from a topic.
|
|
54
|
+
* Matches by function reference and optional context.
|
|
55
|
+
* @param {string} topic - The topic to unsubscribe from.
|
|
56
|
+
* @param {Function} fn - The listener function.
|
|
57
|
+
* @param {*} [context] - Optional `this` context.
|
|
58
|
+
* @returns {boolean} True if the listener was found and removed.
|
|
164
59
|
*/
|
|
165
|
-
|
|
60
|
+
unsubscribe(topic: string, fn: Function, context?: any): boolean;
|
|
166
61
|
/**
|
|
167
|
-
*
|
|
168
|
-
* @param {string
|
|
62
|
+
* Get the number of subscribers for a topic.
|
|
63
|
+
* @param {string} topic
|
|
64
|
+
* @returns {number}
|
|
169
65
|
*/
|
|
170
|
-
|
|
66
|
+
getCount(topic: string): number;
|
|
171
67
|
/**
|
|
172
|
-
*
|
|
173
|
-
*
|
|
174
|
-
* @param {string
|
|
175
|
-
* @
|
|
68
|
+
* Publish a value to a topic asynchronously.
|
|
69
|
+
* All listeners are invoked in the order they were added.
|
|
70
|
+
* @param {string} topic - The topic to publish.
|
|
71
|
+
* @param {...*} args - Arguments to pass to listeners.
|
|
72
|
+
* @returns {boolean} True if any listeners exist for this topic.
|
|
176
73
|
*/
|
|
177
|
-
|
|
178
|
-
isDisposed(): boolean;
|
|
179
|
-
dispose(): void;
|
|
74
|
+
publish(topic: string, ...args: any[]): boolean;
|
|
180
75
|
}
|
|
181
76
|
export const EventBus: PubSub;
|
|
182
77
|
/**
|
package/@types/shared/utils.d.ts
CHANGED
|
@@ -93,10 +93,7 @@ export function notNullOrUndefined(obj: any): boolean;
|
|
|
93
93
|
*/
|
|
94
94
|
export function isNumber(value: any): boolean;
|
|
95
95
|
/**
|
|
96
|
-
* @module angular
|
|
97
|
-
* @function isDate
|
|
98
96
|
*
|
|
99
|
-
* @description
|
|
100
97
|
* Determines if a value is a date.
|
|
101
98
|
*
|
|
102
99
|
* @param {*} value Reference to check.
|
|
@@ -437,6 +434,7 @@ export function assert(argument: boolean, errorMsg?: string): void;
|
|
|
437
434
|
/**
|
|
438
435
|
* Validate a value using a predicate function.
|
|
439
436
|
* Throws if the predicate returns false.
|
|
437
|
+
* IMPORTANT: use this function only for developper errors and not for user/data errors
|
|
440
438
|
*
|
|
441
439
|
* @param {ng.Validator} fn - Predicate validator function.
|
|
442
440
|
* @param {*} arg - The value to validate.
|
|
@@ -459,6 +457,13 @@ export function validateRequired(arg: any, name: string): any;
|
|
|
459
457
|
* @throws {TypeError} If the value does not satisfy the validator.
|
|
460
458
|
*/
|
|
461
459
|
export function validateArray(arg: any, name: string): any;
|
|
460
|
+
/**
|
|
461
|
+
* @param {*} arg - The value to validate.
|
|
462
|
+
* @param {string} name - Parameter name (included in error message).
|
|
463
|
+
* @returns {*} The validated value.
|
|
464
|
+
* @throws {TypeError} If the value does not satisfy the validator.
|
|
465
|
+
*/
|
|
466
|
+
export function validateIsString(arg: any, name: string): any;
|
|
462
467
|
/**
|
|
463
468
|
* Throw error if the argument is falsy.
|
|
464
469
|
*/
|
|
@@ -626,6 +631,11 @@ export function instantiateWasm(
|
|
|
626
631
|
exports: WebAssembly.Exports;
|
|
627
632
|
module: WebAssembly.Module;
|
|
628
633
|
}>;
|
|
634
|
+
/**
|
|
635
|
+
* @param {*} fn
|
|
636
|
+
* @returns {boolean}
|
|
637
|
+
*/
|
|
638
|
+
export function isArrowFunction(fn: any): boolean;
|
|
629
639
|
export const isProxySymbol: unique symbol;
|
|
630
640
|
export const BADARG: "badarg";
|
|
631
641
|
export const BADARGKEY: "badarg: key";
|