@rs-x/core 0.4.4
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/LICENSE +21 -0
- package/dist/index.d.ts +616 -0
- package/dist/index.js +2222 -0
- package/package.json +65 -0
- package/readme.md +1184 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 robert-sanders-software-ontwikkeling
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,616 @@
|
|
|
1
|
+
import { Container, Newable, ServiceIdentifier, BindToFluentSyntax, ContainerModuleLoadOptions, ContainerModule } from 'inversify';
|
|
2
|
+
export { BindToFluentSyntax, Container, ContainerModule, ContainerModuleLoadOptions, inject as Inject, injectable as Injectable, multiInject as MultiInject, Newable, preDestroy as PreDestroy, ServiceIdentifier, unmanaged as Unmanaged } from 'inversify';
|
|
3
|
+
import { Observable, Subject } from 'rxjs';
|
|
4
|
+
|
|
5
|
+
interface IDeepCloneValueGetter {
|
|
6
|
+
get(source: unknown): unknown;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
interface IResolvedValueCache {
|
|
10
|
+
set(source: WeakKey, value: unknown): void;
|
|
11
|
+
get(source: WeakKey): unknown;
|
|
12
|
+
delete(source: WeakKey): void;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
declare class DeepCloneValueGetter implements IDeepCloneValueGetter {
|
|
16
|
+
private readonly _resolvedValueCache;
|
|
17
|
+
constructor(_resolvedValueCache: IResolvedValueCache);
|
|
18
|
+
get(source: unknown): unknown;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
declare const InjectionContainer: Container;
|
|
22
|
+
|
|
23
|
+
interface IMultiInjectTokens {
|
|
24
|
+
serviceToken?: symbol;
|
|
25
|
+
multiInjectToken: symbol;
|
|
26
|
+
}
|
|
27
|
+
interface IMultiInjectService {
|
|
28
|
+
target: Newable<unknown>;
|
|
29
|
+
token: symbol;
|
|
30
|
+
}
|
|
31
|
+
type BindMethod = <T>(serviceIdentifier: ServiceIdentifier<T>) => BindToFluentSyntax<T>;
|
|
32
|
+
declare function registerMultiInjectService(container: Container | ContainerModuleLoadOptions, target: Newable<unknown>, options: IMultiInjectTokens): void;
|
|
33
|
+
declare function registerMultiInjectServices(container: Container | ContainerModuleLoadOptions, multiInjectToken: symbol, services: readonly IMultiInjectService[]): void;
|
|
34
|
+
declare function overrideMultiInjectServices(container: Container | ContainerModuleLoadOptions, multiInjectToken: symbol, services: readonly IMultiInjectService[]): void;
|
|
35
|
+
|
|
36
|
+
interface IDeepClone {
|
|
37
|
+
readonly priority: number;
|
|
38
|
+
clone(source: unknown): unknown;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
declare function DeepClone(serviceToken?: symbol): (target: Newable<IDeepClone>) => void;
|
|
42
|
+
|
|
43
|
+
declare class DefaultDeepClone implements IDeepClone {
|
|
44
|
+
private readonly _deepCloneList;
|
|
45
|
+
private readonly _deepCloneValueGetter;
|
|
46
|
+
readonly priority = 0;
|
|
47
|
+
constructor(_deepCloneList: readonly IDeepClone[], _deepCloneValueGetter: IDeepCloneValueGetter);
|
|
48
|
+
clone(source: unknown): unknown;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
declare class LodashDeepClone implements IDeepClone {
|
|
52
|
+
readonly priority = 1;
|
|
53
|
+
clone(source: unknown): unknown;
|
|
54
|
+
private cloneExceptPredicate;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
declare class StructuredDeepClone implements IDeepClone {
|
|
58
|
+
readonly priority = 2;
|
|
59
|
+
clone(source: unknown): unknown;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
interface IEqualityService {
|
|
63
|
+
isEqual(a: unknown, b: unknown): boolean;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
declare class EqualityService implements IEqualityService {
|
|
67
|
+
isEqual: <A, B>(a: A, b: B) => boolean;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
interface IError {
|
|
71
|
+
readonly message?: string;
|
|
72
|
+
readonly code?: number;
|
|
73
|
+
readonly exception?: Error;
|
|
74
|
+
readonly context: unknown;
|
|
75
|
+
readonly fatal?: boolean;
|
|
76
|
+
readonly data?: unknown;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
interface IErrorLog {
|
|
80
|
+
readonly error: Observable<IError>;
|
|
81
|
+
add(error: IError): void;
|
|
82
|
+
clear(): void;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
declare class ErrorLog implements IErrorLog {
|
|
86
|
+
private readonly _error;
|
|
87
|
+
constructor();
|
|
88
|
+
get error(): Observable<IError>;
|
|
89
|
+
add(error: IError): void;
|
|
90
|
+
clear(): void;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
declare class PrettyPrinter {
|
|
94
|
+
private readonly indent;
|
|
95
|
+
private readonly handlers;
|
|
96
|
+
constructor(indent?: number);
|
|
97
|
+
toString(value: unknown, quoteStrings?: boolean): string;
|
|
98
|
+
toLines(value: unknown, level?: number, quoteStrings?: boolean): string[];
|
|
99
|
+
private formatPrimitive;
|
|
100
|
+
private formatKey;
|
|
101
|
+
private spaces;
|
|
102
|
+
private isCustomToString;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
declare function printValue(value: unknown): void;
|
|
106
|
+
|
|
107
|
+
declare class ArgumentException extends Error {
|
|
108
|
+
constructor(message: string);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
declare enum PropertyDescriptorType {
|
|
112
|
+
Function = "Function",
|
|
113
|
+
ReadonlyProperty = "ReadonlyProperty",
|
|
114
|
+
Property = "Property",
|
|
115
|
+
Field = "Field"
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
interface IPropertyDescriptor {
|
|
119
|
+
type: PropertyDescriptorType;
|
|
120
|
+
descriptor: PropertyDescriptor;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
type CheckValidKey<T, U extends keyof T> = U;
|
|
124
|
+
type GetFunction<T> = () => T;
|
|
125
|
+
type SetFunction<T> = (value: T) => void;
|
|
126
|
+
declare const emptyValue: unique symbol;
|
|
127
|
+
type AnyFunction = (...args: unknown[]) => unknown;
|
|
128
|
+
declare const emptyFunction: () => void;
|
|
129
|
+
declare const truePredicate: () => boolean;
|
|
130
|
+
declare const echo: <T = unknown>(value: T) => T;
|
|
131
|
+
declare class Type {
|
|
132
|
+
static isPositiveIntegerString(value: unknown): boolean;
|
|
133
|
+
static isPositiveInteger(value: unknown): boolean;
|
|
134
|
+
static walkObjectTopToBottom(object: object, visit: (parent: object, key: string, value: unknown) => void, recursive: boolean): void;
|
|
135
|
+
static walkObjectBottomToTop(object: object, visit: (parent: object, key: string, value: unknown) => void, recursive: boolean): void;
|
|
136
|
+
static cast<T>(instance: unknown): T;
|
|
137
|
+
static isFunction(value: unknown): value is AnyFunction;
|
|
138
|
+
static isMethod(value: unknown): boolean;
|
|
139
|
+
static isArrowFunction(object: unknown): object is (...args: unknown[]) => unknown;
|
|
140
|
+
static isString(value: unknown): value is string;
|
|
141
|
+
static isNullOrUndefined(value: unknown): boolean;
|
|
142
|
+
static isEmpty(value: unknown): boolean;
|
|
143
|
+
static isPlainObject(object: unknown): boolean;
|
|
144
|
+
static hasProperty(root: unknown, name: string): boolean;
|
|
145
|
+
static hasOwnPropertyInPrototypeChain(target: unknown, key: PropertyKey): boolean;
|
|
146
|
+
static getPropertyDescriptorType(propertyDescriptor: PropertyDescriptor): PropertyDescriptorType;
|
|
147
|
+
static getPropertyDescriptor<T>(root: unknown, name: keyof T): IPropertyDescriptor;
|
|
148
|
+
static toObject(context: unknown): Record<string, unknown> | undefined;
|
|
149
|
+
static getConstructorName(value: unknown): string;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
declare class Assertion {
|
|
153
|
+
private constructor();
|
|
154
|
+
static assertIsFunction(value: unknown, name: string | number): asserts value is AnyFunction;
|
|
155
|
+
static assertNotNullOrUndefined(value: unknown, argumentName: string): void;
|
|
156
|
+
static assertNotNullOrEmpty(value: unknown, argumentName: string): void;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
declare class InvalidCastException extends Error {
|
|
160
|
+
constructor(message: string);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
declare class InvalidOperationException extends Error {
|
|
164
|
+
constructor(message: string);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
declare class NullOrEmptyException extends Error {
|
|
168
|
+
constructor(argumentName: string);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
declare class NullOrUndefinedException extends Error {
|
|
172
|
+
constructor(argumentName: string);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
declare class ParserException extends Error {
|
|
176
|
+
readonly expression: string;
|
|
177
|
+
readonly position?: number | undefined;
|
|
178
|
+
constructor(expression: string, message: string, position?: number | undefined);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
declare class UnexpectedException extends Error {
|
|
182
|
+
constructor(message: string);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
declare class UnsupportedException extends Error {
|
|
186
|
+
constructor(message: string);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
type ConstructorType<T = unknown> = new (...args: unknown[]) => T;
|
|
190
|
+
|
|
191
|
+
interface IDisposable {
|
|
192
|
+
dispose(): void;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
interface IChainPart {
|
|
196
|
+
object: unknown;
|
|
197
|
+
id: unknown;
|
|
198
|
+
}
|
|
199
|
+
interface IPropertyChange {
|
|
200
|
+
chain?: IChainPart[];
|
|
201
|
+
target: unknown;
|
|
202
|
+
id?: unknown;
|
|
203
|
+
newValue?: unknown;
|
|
204
|
+
arguments?: unknown[];
|
|
205
|
+
setValue?: (value: unknown) => void;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
declare function replaceSetItemAt<T = unknown>(set: Set<T>, oldValue: T, newValue: T): Set<T>;
|
|
209
|
+
|
|
210
|
+
declare function utCDate(year: number, month?: number, date?: number, hours?: number, minutes?: number, seconds?: number, millisecond?: number): Date;
|
|
211
|
+
|
|
212
|
+
interface IISequenceWithIdData {
|
|
213
|
+
sequence: readonly unknown[];
|
|
214
|
+
readonly id: string;
|
|
215
|
+
}
|
|
216
|
+
interface ISequenceWithId extends IISequenceWithIdData, IDisposable {
|
|
217
|
+
}
|
|
218
|
+
interface ISequenceIdFactory {
|
|
219
|
+
create(context: unknown, sequence: unknown[]): ISequenceWithId;
|
|
220
|
+
release(context: unknown, id: string): void;
|
|
221
|
+
get(context: unknown, sequence: unknown[]): ISequenceWithId | undefined;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
interface ISingletonFactory<TId = unknown, TData = unknown, TInstance = unknown, TIdData = TData> extends IDisposable {
|
|
225
|
+
readonly isEmpty: boolean;
|
|
226
|
+
create(data: TData): {
|
|
227
|
+
referenceCount: number;
|
|
228
|
+
instance: TInstance;
|
|
229
|
+
id: TId;
|
|
230
|
+
};
|
|
231
|
+
release(id: TId, force?: boolean): {
|
|
232
|
+
referenceCount: number;
|
|
233
|
+
instance: TInstance | null;
|
|
234
|
+
};
|
|
235
|
+
ids(): MapIterator<TId>;
|
|
236
|
+
getOrCreate(data: TData): TInstance;
|
|
237
|
+
getFromId(id: TId): TInstance | undefined;
|
|
238
|
+
has(id: TId): boolean;
|
|
239
|
+
getFromData(data: TIdData): TInstance | undefined;
|
|
240
|
+
getId(data: TIdData): TId | undefined;
|
|
241
|
+
exists(instance: TInstance): boolean;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
declare abstract class SingletonFactory<TId, TData extends TIdData, TInstance, TIdData = TData> implements ISingletonFactory<TId, TData, TInstance, TIdData> {
|
|
245
|
+
private readonly _instances;
|
|
246
|
+
private readonly _referenceCounts;
|
|
247
|
+
protected constructor();
|
|
248
|
+
exists(target: TInstance): boolean;
|
|
249
|
+
toLines(indent?: number, level?: number): string[];
|
|
250
|
+
toString(indent?: number, level?: number): string;
|
|
251
|
+
get isEmpty(): boolean;
|
|
252
|
+
ids(): MapIterator<TId>;
|
|
253
|
+
getFromId(id: TId): TInstance | undefined;
|
|
254
|
+
has(id: TId): boolean;
|
|
255
|
+
getFromData(data: TIdData): TInstance | undefined;
|
|
256
|
+
abstract getId(data: TIdData): TId | undefined;
|
|
257
|
+
dispose(): void;
|
|
258
|
+
getOrCreate(data: TData): TInstance;
|
|
259
|
+
create(data: TData): {
|
|
260
|
+
referenceCount: number;
|
|
261
|
+
instance: TInstance;
|
|
262
|
+
id: TId;
|
|
263
|
+
};
|
|
264
|
+
release(id: TId, force?: boolean): {
|
|
265
|
+
referenceCount: number;
|
|
266
|
+
instance: TInstance | null;
|
|
267
|
+
};
|
|
268
|
+
protected get keys(): TId[];
|
|
269
|
+
protected onDisposeInstance: (id: TId, dispose: () => void) => boolean;
|
|
270
|
+
protected abstract createInstance(data: TData, id: TId): TInstance;
|
|
271
|
+
protected abstract createId(data: TIdData): TId;
|
|
272
|
+
protected onDipose(): void;
|
|
273
|
+
protected onReleased(): void;
|
|
274
|
+
protected releaseInstance(_instance: TInstance, _id: TId): void;
|
|
275
|
+
protected onInstanceCreated(_instance: TInstance, _data: TData): void;
|
|
276
|
+
protected getOrCreateId(data: TIdData): TId;
|
|
277
|
+
protected getReferenceCount(id: TId): number;
|
|
278
|
+
protected updateReferenceCount(id: TId, change: 1 | -1, instance: TInstance, forceRelease?: boolean): number;
|
|
279
|
+
private getOrCreateInstance;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
interface IFunctionCallIndexData {
|
|
283
|
+
readonly context: unknown;
|
|
284
|
+
readonly functionName: string;
|
|
285
|
+
readonly arguments: unknown[];
|
|
286
|
+
}
|
|
287
|
+
interface IFunctionCallIndex {
|
|
288
|
+
readonly context: unknown;
|
|
289
|
+
readonly functionName: string;
|
|
290
|
+
readonly argumentsId: IISequenceWithIdData;
|
|
291
|
+
readonly id: string;
|
|
292
|
+
}
|
|
293
|
+
interface IDisposableFunctionCallIndex extends IFunctionCallIndex, IDisposable {
|
|
294
|
+
readonly context: unknown;
|
|
295
|
+
readonly functionName: string;
|
|
296
|
+
readonly argumentsId: IISequenceWithIdData;
|
|
297
|
+
readonly id: string;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
declare class FunctionCallIndexFactory extends SingletonFactory<IISequenceWithIdData, IFunctionCallIndexData, IDisposableFunctionCallIndex> {
|
|
301
|
+
private readonly _sequenceIdFactory;
|
|
302
|
+
constructor(_sequenceIdFactory: ISequenceIdFactory);
|
|
303
|
+
getId(data: IFunctionCallIndexData): IISequenceWithIdData;
|
|
304
|
+
protected createInstance(data: IFunctionCallIndexData, id: ISequenceWithId): IDisposableFunctionCallIndex;
|
|
305
|
+
protected createId(data: IFunctionCallIndexData): ISequenceWithId;
|
|
306
|
+
protected releaseInstance(_: IDisposableFunctionCallIndex, id: ISequenceWithId): void;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
interface IGuidFactory {
|
|
310
|
+
create(): string;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
interface IDisposableOwner {
|
|
314
|
+
canDispose?(): boolean;
|
|
315
|
+
release(): void;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
interface ISingletonFactoryWithIdGeneration<TId, TData extends TIdData, TInstance, TIdData = TData> extends ISingletonFactory<TId, TData, TInstance, TIdData> {
|
|
319
|
+
isGroupRegistered(groupId: unknown): boolean;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
declare class GuidFactory implements IGuidFactory {
|
|
323
|
+
create(): string;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
declare abstract class SingletonFactoryWithIdGeneration<TId, TData extends TIdData, TInstance, TIdData = TData> extends SingletonFactory<TId, TData, TInstance, TIdData> implements ISingletonFactoryWithIdGeneration<TId, TData, TInstance, TIdData> {
|
|
327
|
+
private readonly _groupedData;
|
|
328
|
+
getId(data: TIdData): TId | undefined;
|
|
329
|
+
isGroupRegistered(groupId: unknown): boolean;
|
|
330
|
+
protected abstract getGroupId(data: TIdData): unknown;
|
|
331
|
+
protected abstract getGroupMemberId(data: TIdData): unknown;
|
|
332
|
+
protected abstract createUniqueId(data: TIdData): TId;
|
|
333
|
+
protected createId(data: TData): TId;
|
|
334
|
+
protected releaseInstance(_instance: TInstance, id: TId): void;
|
|
335
|
+
private findGroupMemberId;
|
|
336
|
+
}
|
|
337
|
+
declare abstract class SingletonFactoryWithGuid<TData extends TIdData, TInstance, TIdData = TData> extends SingletonFactoryWithIdGeneration<string, TData, TInstance, TIdData> {
|
|
338
|
+
private readonly _guidFactory;
|
|
339
|
+
protected constructor(_guidFactory: IGuidFactory);
|
|
340
|
+
protected createUniqueId(_data: TData): string;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
declare class SequenceWithId implements ISequenceWithId {
|
|
344
|
+
readonly id: string;
|
|
345
|
+
readonly sequence: readonly unknown[];
|
|
346
|
+
private readonly _owner;
|
|
347
|
+
private _isDisposed;
|
|
348
|
+
constructor(id: string, sequence: readonly unknown[], _owner: IDisposableOwner);
|
|
349
|
+
dispose(): void;
|
|
350
|
+
}
|
|
351
|
+
declare class SequenceIdFactory implements ISequenceIdFactory {
|
|
352
|
+
private readonly _valueSequenceIdRegistryManager;
|
|
353
|
+
constructor(guidFactory: IGuidFactory);
|
|
354
|
+
dispose(): void;
|
|
355
|
+
create(context: unknown, sequence: unknown[]): ISequenceWithId;
|
|
356
|
+
release(context: unknown, id: string): void;
|
|
357
|
+
get(context: unknown, sequence: unknown[]): ISequenceWithId | undefined;
|
|
358
|
+
has(context: unknown, id: string): boolean;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
type IFunctionCallIndexFactory = ISingletonFactory<IISequenceWithIdData, IFunctionCallIndexData, IDisposableFunctionCallIndex>;
|
|
362
|
+
|
|
363
|
+
declare class FunctionCallIndex implements IDisposableFunctionCallIndex {
|
|
364
|
+
readonly context: unknown;
|
|
365
|
+
readonly functionName: string;
|
|
366
|
+
private readonly _sequenceWithId;
|
|
367
|
+
private readonly _owner;
|
|
368
|
+
private _isDisposed;
|
|
369
|
+
private _id;
|
|
370
|
+
constructor(context: unknown, functionName: string, _sequenceWithId: ISequenceWithId, _owner: IDisposableOwner);
|
|
371
|
+
get id(): string;
|
|
372
|
+
get argumentsId(): IISequenceWithIdData;
|
|
373
|
+
dispose(): void;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
interface IFunctionCallResultIdInfo {
|
|
377
|
+
arguments: unknown[];
|
|
378
|
+
functionName: string;
|
|
379
|
+
}
|
|
380
|
+
interface IFunctionCallResult extends IFunctionCallResultIdInfo {
|
|
381
|
+
result: unknown;
|
|
382
|
+
}
|
|
383
|
+
interface IFunctionCallResultCache extends IDisposable {
|
|
384
|
+
readonly index: IFunctionCallIndex;
|
|
385
|
+
readonly result: unknown;
|
|
386
|
+
}
|
|
387
|
+
interface IFunctionCallResultCacheFactory {
|
|
388
|
+
create(context: unknown, result: IFunctionCallResult): IFunctionCallResultCache;
|
|
389
|
+
has(context: unknown, index: IFunctionCallIndex): boolean;
|
|
390
|
+
get(context: unknown, index: IFunctionCallIndex): IFunctionCallResultCache | undefined;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
declare class FunctionCallResultCacheFactory implements IFunctionCallResultCacheFactory {
|
|
394
|
+
private readonly _functionCallResultCacheManager;
|
|
395
|
+
constructor(functionCallIndexFactory: IFunctionCallIndexFactory);
|
|
396
|
+
create(context: unknown, result: IFunctionCallResult): IFunctionCallResultCache;
|
|
397
|
+
has(context: unknown, index: IDisposableFunctionCallIndex): boolean;
|
|
398
|
+
get(context: unknown, index: IDisposableFunctionCallIndex): IFunctionCallResultCache | undefined;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
interface IIndexValueAccessor<TContext = unknown, TIndex = unknown> {
|
|
402
|
+
readonly priority: number;
|
|
403
|
+
isAsync(context: TContext, index: TIndex): boolean;
|
|
404
|
+
getResolvedValue(context: TContext, index: TIndex): unknown;
|
|
405
|
+
hasValue(context: TContext, index: TIndex): boolean;
|
|
406
|
+
getValue(context: TContext, index: TIndex): unknown;
|
|
407
|
+
setValue(context: TContext, index: TIndex, value: unknown): void;
|
|
408
|
+
getIndexes(context: TContext, index?: TIndex): IterableIterator<TIndex>;
|
|
409
|
+
applies(context: unknown, index: TIndex): boolean;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
type IArrayIndexAccessor = IIndexValueAccessor<unknown[], number>;
|
|
413
|
+
|
|
414
|
+
declare class ArrayIndexAccessor implements IArrayIndexAccessor {
|
|
415
|
+
readonly priority = 5;
|
|
416
|
+
isAsync(): boolean;
|
|
417
|
+
getIndexes(array: unknown[]): IterableIterator<number>;
|
|
418
|
+
hasValue(array: unknown[], index: number): boolean;
|
|
419
|
+
getResolvedValue(array: unknown[], index: number): unknown;
|
|
420
|
+
getValue(array: unknown[], index: number): unknown;
|
|
421
|
+
setValue(array: unknown[], index: number, value: unknown): void;
|
|
422
|
+
applies(array: unknown): boolean;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
type DateProperty = 'year' | 'utcYear' | 'month' | 'utcMonth' | 'date' | 'utcDate' | 'hours' | 'utcHours' | 'minutes' | 'utcMinutes' | 'seconds' | 'utcSeconds' | 'milliseconds' | 'utcMilliseconds' | 'time';
|
|
426
|
+
declare const dataProperties: readonly DateProperty[];
|
|
427
|
+
type IDatePropertyAccessor = IIndexValueAccessor<Date, DateProperty>;
|
|
428
|
+
|
|
429
|
+
declare class DatePropertyAccessor implements IDatePropertyAccessor {
|
|
430
|
+
readonly priority = 0;
|
|
431
|
+
private readonly _setter;
|
|
432
|
+
private readonly _getters;
|
|
433
|
+
isAsync(): boolean;
|
|
434
|
+
getIndexes(): IterableIterator<DateProperty>;
|
|
435
|
+
hasValue(context: Date, index: DateProperty): boolean;
|
|
436
|
+
getResolvedValue(context: Date, index: DateProperty): unknown;
|
|
437
|
+
getValue(date: Date, index: DateProperty): unknown;
|
|
438
|
+
setValue(date: Date, index: DateProperty, value: number): void;
|
|
439
|
+
applies(context: unknown, index: DateProperty): boolean;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
declare class IndexValueAccessor implements IIndexValueAccessor {
|
|
443
|
+
readonly priority = 0;
|
|
444
|
+
private readonly _accessors;
|
|
445
|
+
constructor(accessors: readonly IIndexValueAccessor[]);
|
|
446
|
+
getIndexes(context: unknown, index: unknown): IterableIterator<unknown>;
|
|
447
|
+
isAsync(context: unknown, index: unknown): boolean;
|
|
448
|
+
hasValue(context: unknown, index: unknown): boolean;
|
|
449
|
+
getResolvedValue(context: unknown, index: unknown): unknown;
|
|
450
|
+
getValue(context: unknown, index: unknown): unknown;
|
|
451
|
+
setValue(context: unknown, index: unknown, value: unknown): void;
|
|
452
|
+
applies(context: unknown, index: unknown): boolean;
|
|
453
|
+
private getIndexAccessor;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
type IMapKeyAccessor = IIndexValueAccessor<Map<unknown, unknown>, unknown>;
|
|
457
|
+
|
|
458
|
+
declare class MapKeyAccessor implements IMapKeyAccessor {
|
|
459
|
+
readonly priority = 4;
|
|
460
|
+
getIndexes(map: Map<unknown, unknown>): IterableIterator<unknown, unknown, unknown>;
|
|
461
|
+
isAsync(): boolean;
|
|
462
|
+
hasValue(map: Map<unknown, unknown>, key: unknown): boolean;
|
|
463
|
+
getResolvedValue(map: Map<unknown, unknown>, key: unknown): unknown;
|
|
464
|
+
getValue(map: Map<unknown, unknown>, key: unknown): unknown;
|
|
465
|
+
setValue(map: Map<unknown, unknown>, key: unknown, value: unknown): void;
|
|
466
|
+
applies(map: unknown): boolean;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
type IMethodAccessor = IIndexValueAccessor<object, IDisposableFunctionCallIndex>;
|
|
470
|
+
|
|
471
|
+
declare class MethodAccessor implements IMethodAccessor {
|
|
472
|
+
private readonly _functionCallResultCacheFactory;
|
|
473
|
+
readonly priority = 6;
|
|
474
|
+
constructor(_functionCallResultCacheFactory: IFunctionCallResultCacheFactory);
|
|
475
|
+
getIndexes(): IterableIterator<IDisposableFunctionCallIndex>;
|
|
476
|
+
isAsync(): boolean;
|
|
477
|
+
hasValue(context: object, index: IFunctionCallIndex): boolean;
|
|
478
|
+
getResolvedValue(context: object, index: IFunctionCallIndex): unknown;
|
|
479
|
+
getValue(context: unknown, index: IFunctionCallIndex): unknown;
|
|
480
|
+
setValue(_: object, index: IFunctionCallIndex): void;
|
|
481
|
+
applies(context: unknown, index: IFunctionCallIndex): boolean;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
type LastValuObservable = Subject<unknown> | Observable<unknown>;
|
|
485
|
+
interface IObservableAccessor extends IIndexValueAccessor<LastValuObservable, unknown> {
|
|
486
|
+
setLastValue(observable: LastValuObservable, value: unknown): void;
|
|
487
|
+
clearLastValue(observable: LastValuObservable): void;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
declare class ObservableAccessor implements IObservableAccessor {
|
|
491
|
+
private readonly _resolvedValueCache;
|
|
492
|
+
readonly priority = 2;
|
|
493
|
+
constructor(_resolvedValueCache: IResolvedValueCache);
|
|
494
|
+
getIndexes(): IterableIterator<string>;
|
|
495
|
+
isAsync(): boolean;
|
|
496
|
+
getResolvedValue(context: unknown, index: string): unknown;
|
|
497
|
+
hasValue(context: unknown, index: string): boolean;
|
|
498
|
+
getValue(context: unknown, index: string): unknown;
|
|
499
|
+
setValue(context: unknown, index: string, value: unknown): void;
|
|
500
|
+
applies(context: unknown, index: string): boolean;
|
|
501
|
+
setLastValue(observable: LastValuObservable, value: unknown): void;
|
|
502
|
+
clearLastValue(observable: LastValuObservable): void;
|
|
503
|
+
private getIndexedValue;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
declare const PENDING: unique symbol;
|
|
507
|
+
|
|
508
|
+
interface IPromiseAccessor extends IIndexValueAccessor<Promise<unknown>, unknown> {
|
|
509
|
+
setLastValue(promise: Promise<unknown>, value: unknown): void;
|
|
510
|
+
clearLastValue(promise: Promise<unknown>): void;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
declare class PromiseAccessor implements IPromiseAccessor {
|
|
514
|
+
private readonly _resolvedValueCache;
|
|
515
|
+
readonly priority = 1;
|
|
516
|
+
constructor(_resolvedValueCache: IResolvedValueCache);
|
|
517
|
+
getIndexes(): IterableIterator<string>;
|
|
518
|
+
isAsync(): boolean;
|
|
519
|
+
hasValue(context: unknown, index: string): boolean;
|
|
520
|
+
getResolvedValue(context: unknown, index: string): unknown;
|
|
521
|
+
getValue(context: unknown, index: string): unknown;
|
|
522
|
+
setValue(): void;
|
|
523
|
+
applies(context: unknown, index: string): boolean;
|
|
524
|
+
setLastValue(promise: Promise<unknown>, value: unknown): void;
|
|
525
|
+
clearLastValue(promise: Promise<unknown>): void;
|
|
526
|
+
private getIndexedValue;
|
|
527
|
+
private isCacheable;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
type IPropertyValueAccessor = IIndexValueAccessor<object, string>;
|
|
531
|
+
|
|
532
|
+
declare class PropertyValueAccessor implements IPropertyValueAccessor {
|
|
533
|
+
readonly priority = 7;
|
|
534
|
+
isAsync(): boolean;
|
|
535
|
+
getIndexes(context: unknown): IterableIterator<string>;
|
|
536
|
+
hasValue(context: unknown, index: string): boolean;
|
|
537
|
+
getResolvedValue(context: unknown, index: string): unknown;
|
|
538
|
+
getValue(context: unknown, index: string): unknown;
|
|
539
|
+
setValue(context: unknown, index: string, value: unknown): void;
|
|
540
|
+
applies(context: unknown, index: string): boolean;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
declare class ResolvedValueCache implements IResolvedValueCache {
|
|
544
|
+
private readonly _resolvedValues;
|
|
545
|
+
set(source: WeakKey, value: unknown): void;
|
|
546
|
+
get(source: WeakKey): unknown;
|
|
547
|
+
delete(source: WeakKey): void;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
type ISetKeyAccessor = IIndexValueAccessor<Set<unknown>, unknown>;
|
|
551
|
+
|
|
552
|
+
declare class SetKeyAccessor implements ISetKeyAccessor {
|
|
553
|
+
readonly priority = 3;
|
|
554
|
+
getIndexes(set: Set<unknown>): IterableIterator<unknown>;
|
|
555
|
+
isAsync(): boolean;
|
|
556
|
+
hasValue(set: Set<unknown>, key: unknown): boolean;
|
|
557
|
+
getResolvedValue(set: Set<unknown>, key: unknown): unknown;
|
|
558
|
+
getValue(set: Set<unknown>, key: unknown): unknown;
|
|
559
|
+
setValue(set: Set<unknown>, key: unknown, value: unknown): void;
|
|
560
|
+
applies(map: unknown): boolean;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
declare const RsXCoreInjectionTokens: {
|
|
564
|
+
IInjectionContainer: symbol;
|
|
565
|
+
IErrorLog: symbol;
|
|
566
|
+
IIndexValueAccessor: symbol;
|
|
567
|
+
IMapKeyAccessor: symbol;
|
|
568
|
+
ISetKeyAccessor: symbol;
|
|
569
|
+
IArrayIndexAccessor: symbol;
|
|
570
|
+
IPropertyValueAccessor: symbol;
|
|
571
|
+
IMethodAccessor: symbol;
|
|
572
|
+
IDatePropertyAccessor: symbol;
|
|
573
|
+
IDeepClone: symbol;
|
|
574
|
+
IEqualityService: symbol;
|
|
575
|
+
IObservableAccessor: symbol;
|
|
576
|
+
IPromiseAccessor: symbol;
|
|
577
|
+
IIndexValueAccessorList: symbol;
|
|
578
|
+
ISequenceIdFactory: symbol;
|
|
579
|
+
IFunctionCallIndexFactory: symbol;
|
|
580
|
+
IFunctionCallResultCacheFactory: symbol;
|
|
581
|
+
IGuidFactory: symbol;
|
|
582
|
+
IStructuredDeepClone: symbol;
|
|
583
|
+
ILodashDeepClone: symbol;
|
|
584
|
+
IDeepCloneList: symbol;
|
|
585
|
+
IResolvedValueCache: symbol;
|
|
586
|
+
IDeepCloneValueGetter: symbol;
|
|
587
|
+
DefaultDeepCloneValueGetter: symbol;
|
|
588
|
+
};
|
|
589
|
+
|
|
590
|
+
declare const defaultIndexValueAccessorList: readonly IMultiInjectService[];
|
|
591
|
+
declare const defaultDeeoCloneList: readonly IMultiInjectService[];
|
|
592
|
+
declare const RsXCoreModule: ContainerModule;
|
|
593
|
+
|
|
594
|
+
interface WaitOptions<T extends {
|
|
595
|
+
[K in E]: Observable<R>;
|
|
596
|
+
}, E extends keyof T, R> {
|
|
597
|
+
count?: number;
|
|
598
|
+
timeout?: number;
|
|
599
|
+
ignoreInitialValue?: boolean;
|
|
600
|
+
}
|
|
601
|
+
declare class WaitForEvent<T extends {
|
|
602
|
+
[K in E]: Observable<R>;
|
|
603
|
+
}, E extends keyof T, R> {
|
|
604
|
+
private readonly _target;
|
|
605
|
+
private readonly _eventName;
|
|
606
|
+
private readonly _options;
|
|
607
|
+
constructor(_target: T, _eventName: E, options?: WaitOptions<T, E, R>);
|
|
608
|
+
wait(trigger: () => void | Promise<unknown> | Observable<unknown>): Promise<R | null>;
|
|
609
|
+
private subscribeToEvent;
|
|
610
|
+
private runTrigger;
|
|
611
|
+
private finish;
|
|
612
|
+
private cleanup;
|
|
613
|
+
private unsubscribeEvent;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
export { type AnyFunction, ArgumentException, ArrayIndexAccessor, Assertion, type BindMethod, type CheckValidKey, type ConstructorType, type DateProperty, DatePropertyAccessor, DeepClone, DeepCloneValueGetter, DefaultDeepClone, EqualityService, ErrorLog, FunctionCallIndex, FunctionCallIndexFactory, FunctionCallResultCacheFactory, type GetFunction, GuidFactory, type IArrayIndexAccessor, type IChainPart, type IDatePropertyAccessor, type IDeepClone, type IDeepCloneValueGetter, type IDisposable, type IDisposableFunctionCallIndex, type IDisposableOwner, type IEqualityService, type IError, type IErrorLog, type IFunctionCallIndex, type IFunctionCallIndexData, type IFunctionCallIndexFactory, type IFunctionCallResult, type IFunctionCallResultCache, type IFunctionCallResultCacheFactory, type IFunctionCallResultIdInfo, type IGuidFactory, type IISequenceWithIdData, type IIndexValueAccessor, type IMapKeyAccessor, type IMethodAccessor, type IMultiInjectService, type IMultiInjectTokens, type IObservableAccessor, type IPromiseAccessor, type IPropertyChange, type IPropertyDescriptor, type IPropertyValueAccessor, type IResolvedValueCache, type ISequenceIdFactory, type ISequenceWithId, type ISetKeyAccessor, type ISingletonFactory, type ISingletonFactoryWithIdGeneration, IndexValueAccessor, InjectionContainer, InvalidCastException, InvalidOperationException, type LastValuObservable, LodashDeepClone, MapKeyAccessor, MethodAccessor, NullOrEmptyException, NullOrUndefinedException, ObservableAccessor, PENDING, ParserException, PrettyPrinter, PromiseAccessor, PropertyDescriptorType, PropertyValueAccessor, ResolvedValueCache, RsXCoreInjectionTokens, RsXCoreModule, SequenceIdFactory, SequenceWithId, type SetFunction, SetKeyAccessor, SingletonFactory, SingletonFactoryWithGuid, SingletonFactoryWithIdGeneration, StructuredDeepClone, Type, UnexpectedException, UnsupportedException, WaitForEvent, dataProperties, defaultDeeoCloneList, defaultIndexValueAccessorList, echo, emptyFunction, emptyValue, overrideMultiInjectServices, printValue, registerMultiInjectService, registerMultiInjectServices, replaceSetItemAt, truePredicate, utCDate };
|