@dereekb/dbx-core 11.0.1 → 11.0.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/esm2022/lib/action/action.handler.mjs +6 -3
- package/esm2022/lib/action/action.holder.mjs +8 -5
- package/esm2022/lib/action/action.machine.mjs +9 -6
- package/esm2022/lib/action/action.store.mjs +6 -6
- package/esm2022/lib/action/action.store.source.mjs +6 -3
- package/esm2022/lib/action/directive/map/action.map.directive.mjs +12 -6
- package/esm2022/lib/action/directive/state/action.handler.instance.mjs +6 -5
- package/esm2022/lib/injection/injection.instance.mjs +5 -4
- package/esm2022/lib/router/router/util/route.default.mjs +1 -1
- package/esm2022/lib/storage/storage.accessor.simple.mjs +25 -19
- package/esm2022/lib/storage/storage.accessor.string.mjs +3 -3
- package/esm2022/lib/storage/storage.object.localstorage.mjs +3 -3
- package/fesm2022/dereekb-dbx-core.mjs +79 -53
- package/fesm2022/dereekb-dbx-core.mjs.map +1 -1
- package/lib/action/action.handler.d.ts +2 -1
- package/lib/action/action.holder.d.ts +2 -1
- package/lib/action/action.machine.d.ts +4 -3
- package/lib/action/action.store.source.d.ts +2 -1
- package/lib/action/directive/map/action.map.directive.d.ts +4 -2
- package/lib/action/directive/state/action.handler.instance.d.ts +5 -5
- package/lib/injection/injection.instance.d.ts +6 -6
- package/lib/router/router/util/route.default.d.ts +4 -4
- package/lib/storage/storage.accessor.simple.d.ts +9 -7
- package/lib/storage/storage.accessor.string.d.ts +1 -1
- package/lib/storage/storage.object.localstorage.d.ts +2 -2
- package/package.json +1 -1
|
@@ -6,8 +6,9 @@ import { Observable } from 'rxjs';
|
|
|
6
6
|
* WorkInstanceDelegate implementation using an DbxActionContextStoreSourceInstance.
|
|
7
7
|
*/
|
|
8
8
|
export declare class DbxActionWorkInstanceDelegate<T = unknown, O = unknown> implements WorkInstanceDelegate<O> {
|
|
9
|
-
|
|
9
|
+
private _source;
|
|
10
10
|
constructor(source: DbxActionContextStoreSourceInstance<T, O>);
|
|
11
|
+
get source(): DbxActionContextStoreSourceInstance<T, O>;
|
|
11
12
|
startWorking(): void;
|
|
12
13
|
success(result: O): void;
|
|
13
14
|
reject(error: Maybe<ReadableError | Observable<ReadableError>>): void;
|
|
@@ -8,7 +8,7 @@ import { DbxActionDisabledKey } from './action';
|
|
|
8
8
|
* Abstract class that can either use SecondaryActionContextStoreSource or create it's own.
|
|
9
9
|
*/
|
|
10
10
|
export declare abstract class DbxActionContextBaseSource<T = unknown, O = unknown> implements ActionContextStoreSource<T, O>, Destroyable {
|
|
11
|
-
readonly
|
|
11
|
+
private readonly _inputSource;
|
|
12
12
|
private readonly _store?;
|
|
13
13
|
private readonly _store$;
|
|
14
14
|
private readonly _instance;
|
|
@@ -17,6 +17,7 @@ export declare abstract class DbxActionContextBaseSource<T = unknown, O = unknow
|
|
|
17
17
|
readonly success$: Observable<Maybe<O>>;
|
|
18
18
|
constructor(inputSource?: Maybe<SecondaryActionContextStoreSource<T, O>>);
|
|
19
19
|
destroy(): void;
|
|
20
|
+
get inputSource(): Maybe<SecondaryActionContextStoreSource<T, O>>;
|
|
20
21
|
get lockSet(): LockSet;
|
|
21
22
|
get sourceInstance(): DbxActionContextStoreSourceInstance<T, O>;
|
|
22
23
|
get store$(): Observable<ActionContextStore<T, O>>;
|
|
@@ -30,12 +30,13 @@ export interface DbxActionContextMachineConfig<T = unknown, O = unknown> {
|
|
|
30
30
|
* It can be configured to activate only once before cleaning itself up. It can be used directly as a DbxActionContextSourceReference in cases where it is created as a one-off action.
|
|
31
31
|
*/
|
|
32
32
|
export declare class DbxActionContextMachine<T = unknown, O = unknown> extends DbxActionContextBaseSource<T, O> implements DbxActionContextSourceReference<T, O>, Destroyable {
|
|
33
|
-
readonly config: DbxActionContextMachineConfig<T, O>;
|
|
34
33
|
private _isShutdown;
|
|
35
|
-
private
|
|
36
|
-
private
|
|
34
|
+
private readonly _config;
|
|
35
|
+
private readonly _handleValueReadySub;
|
|
36
|
+
private readonly _successSub;
|
|
37
37
|
constructor(config: DbxActionContextMachineConfig<T, O>, source?: ActionContextStoreSource<T, O>);
|
|
38
38
|
destroy(): void;
|
|
39
|
+
get config(): DbxActionContextMachineConfig<T, O>;
|
|
39
40
|
get isShutdown(): boolean;
|
|
40
41
|
}
|
|
41
42
|
/**
|
|
@@ -31,9 +31,10 @@ export declare function useActionStore<T = unknown, O = unknown>(source: ActionC
|
|
|
31
31
|
* Service that wraps a ActionContextStoreSource.
|
|
32
32
|
*/
|
|
33
33
|
export declare class DbxActionContextStoreSourceInstance<T = unknown, O = unknown> implements ActionContextStoreSource<T, O>, Destroyable {
|
|
34
|
-
readonly source: ActionContextStoreSource<T, O>;
|
|
35
34
|
readonly lockSet: LockSet;
|
|
35
|
+
private readonly _source;
|
|
36
36
|
constructor(source: ActionContextStoreSource<T, O>);
|
|
37
|
+
get source(): ActionContextStoreSource<T, O>;
|
|
37
38
|
destroy(): void;
|
|
38
39
|
get store$(): Observable<ActionContextStore<T, O>>;
|
|
39
40
|
pipeStore<R>(pipeFn: PipeActionStoreFunction<R, T, O>): Observable<R>;
|
|
@@ -25,8 +25,10 @@ export declare class DbxActionContextMapDirective implements ActionContextStoreS
|
|
|
25
25
|
static ɵdir: i0.ɵɵDirectiveDeclaration<DbxActionContextMapDirective, "[dbxActionContextMap]", ["actionMap"], {}, {}, never, never, false, never>;
|
|
26
26
|
}
|
|
27
27
|
export declare class DbxActionContextMapDirectiveSourceInstance implements ActionContextStoreSource {
|
|
28
|
-
private readonly
|
|
29
|
-
readonly
|
|
28
|
+
private readonly _parent;
|
|
29
|
+
private readonly _key;
|
|
30
30
|
readonly store$: Observable<ActionContextStore>;
|
|
31
31
|
constructor(parent: DbxActionContextMapDirective, key: ActionKey);
|
|
32
|
+
get parent(): DbxActionContextMapDirective;
|
|
33
|
+
get key(): string;
|
|
32
34
|
}
|
|
@@ -6,17 +6,17 @@ export declare const DBX_ACTION_HANDLER_LOCK_KEY = "dbxActionHandler";
|
|
|
6
6
|
* Context used for defining a function that performs an action using the input function to handle valueReady$ events from an action context.
|
|
7
7
|
*/
|
|
8
8
|
export declare class DbxActionHandlerInstance<T = unknown, O = unknown> implements Initialized, Destroyable {
|
|
9
|
-
readonly
|
|
10
|
-
private _sub;
|
|
11
|
-
private _handlerFunction;
|
|
12
|
-
private _handlerValue;
|
|
9
|
+
private readonly _delegate;
|
|
10
|
+
private readonly _sub;
|
|
11
|
+
private readonly _handlerFunction;
|
|
12
|
+
private readonly _handlerValue;
|
|
13
13
|
readonly handlerFunction$: import("rxjs").Observable<Work<T, O>>;
|
|
14
14
|
get handlerFunction(): Maybe<Work<T, O>>;
|
|
15
15
|
set handlerFunction(handlerFunction: Maybe<Work<T, O>>);
|
|
16
16
|
get handlerValue(): Maybe<GetterOrValue<O> | FactoryWithInput<O, T>>;
|
|
17
17
|
set handlerValue(handlerValue: Maybe<GetterOrValue<O> | FactoryWithInput<O, T>>);
|
|
18
|
-
private _delegate;
|
|
19
18
|
constructor(source: DbxActionContextStoreSourceInstance<T, O>);
|
|
19
|
+
get source(): DbxActionContextStoreSourceInstance<T, O>;
|
|
20
20
|
init(): void;
|
|
21
21
|
destroy(): void;
|
|
22
22
|
}
|
|
@@ -5,12 +5,12 @@ import { Initialized, Destroyable, Maybe } from '@dereekb/util';
|
|
|
5
5
|
* Instance used by components to inject content based on the configuration into the view.
|
|
6
6
|
*/
|
|
7
7
|
export declare class DbxInjectionInstance<T> implements Initialized, Destroyable {
|
|
8
|
+
private readonly _subscriptionObject;
|
|
9
|
+
private readonly _config;
|
|
10
|
+
private readonly _template;
|
|
11
|
+
private readonly _content;
|
|
12
|
+
private readonly _componentRef;
|
|
8
13
|
private readonly _injector;
|
|
9
|
-
private _subscriptionObject;
|
|
10
|
-
private _config;
|
|
11
|
-
private _template;
|
|
12
|
-
private _content;
|
|
13
|
-
private _componentRef;
|
|
14
14
|
readonly config$: import("rxjs").Observable<Maybe<DbxInjectionComponentConfig<T>>>;
|
|
15
15
|
readonly template$: import("rxjs").Observable<Maybe<DbxInjectionTemplateConfig<T>>>;
|
|
16
16
|
readonly content$: import("rxjs").Observable<ViewContainerRef>;
|
|
@@ -22,7 +22,7 @@ export declare class DbxInjectionInstance<T> implements Initialized, Destroyable
|
|
|
22
22
|
set content(content: Maybe<Maybe<ViewContainerRef>>);
|
|
23
23
|
get componentRef(): Maybe<ComponentRef<T>>;
|
|
24
24
|
set componentRef(componentRef: Maybe<ComponentRef<T>>);
|
|
25
|
-
constructor(
|
|
25
|
+
constructor(injector: Injector);
|
|
26
26
|
init(): void;
|
|
27
27
|
destroy(): void;
|
|
28
28
|
private _initComponent;
|
|
@@ -5,10 +5,10 @@ import { SwitchMapToDefaultFilterFunction } from '@dereekb/rxjs';
|
|
|
5
5
|
* Utility class used in conjuction with a DbxRouteParamReaderInstance to redirect when the default param is not valid.
|
|
6
6
|
*/
|
|
7
7
|
export declare class DbxRouteParamDefaultRedirectInstance<T> implements Initialized, Destroyable {
|
|
8
|
-
readonly instance
|
|
9
|
-
private _enabled;
|
|
10
|
-
private _useDefaultFilter;
|
|
11
|
-
private _sub;
|
|
8
|
+
private readonly instance;
|
|
9
|
+
private readonly _enabled;
|
|
10
|
+
private readonly _useDefaultFilter;
|
|
11
|
+
private readonly _sub;
|
|
12
12
|
constructor(instance: DbxRouteParamReaderInstance<T>);
|
|
13
13
|
init(): void;
|
|
14
14
|
destroy(): void;
|
|
@@ -21,9 +21,9 @@ export declare class StringifySimpleStorageAccessorConverter<T> implements Simpl
|
|
|
21
21
|
parseValue(data: StoredDataString): T;
|
|
22
22
|
}
|
|
23
23
|
export declare class WrapperSimpleStorageAccessorDelegate<T> implements SimpleStorageAccessorDelegate<T> {
|
|
24
|
-
private _delegate;
|
|
25
|
-
private _converter;
|
|
26
|
-
constructor(
|
|
24
|
+
private readonly _delegate;
|
|
25
|
+
private readonly _converter;
|
|
26
|
+
constructor(delegate: StorageAccessor<StoredDataString>, converter: SimpleStorageAccessorConverter<T>);
|
|
27
27
|
get(key: string): Observable<Maybe<StoredDataString>>;
|
|
28
28
|
set(key: string, value: StoredDataString): Observable<void>;
|
|
29
29
|
remove(key: string): Observable<void>;
|
|
@@ -51,14 +51,18 @@ interface ConfiguredSimpleStorageAccessorConfig extends SimpleStorageAccessorCon
|
|
|
51
51
|
readonly prefixSplitter: string;
|
|
52
52
|
readonly fullPrefix: string;
|
|
53
53
|
}
|
|
54
|
+
export declare function assertValidStorageKeyPrefix(prefix: string, prefixSplitter: string): void;
|
|
55
|
+
export declare function isValidStorageKeyPrefix(prefix: string, prefixSpltter: string): boolean;
|
|
54
56
|
/**
|
|
55
57
|
* LimitedStorageAccessor implementation that uses a Delegate
|
|
56
58
|
*/
|
|
57
59
|
export declare class SimpleStorageAccessor<T> implements StorageAccessor<T> {
|
|
58
|
-
private readonly _delegate;
|
|
59
60
|
static readonly PREFIX_SPLITTER = "::";
|
|
61
|
+
private readonly _delegate;
|
|
60
62
|
protected readonly _config: ConfiguredSimpleStorageAccessorConfig;
|
|
61
|
-
constructor(
|
|
63
|
+
constructor(delegate: SimpleStorageAccessorDelegate<T>, config: SimpleStorageAccessorConfig);
|
|
64
|
+
get delegate(): SimpleStorageAccessorDelegate<T>;
|
|
65
|
+
get config(): ConfiguredSimpleStorageAccessorConfig;
|
|
62
66
|
get(inputKey: string): Observable<T>;
|
|
63
67
|
set(inputKey: string, inputValue: T): Observable<void>;
|
|
64
68
|
remove(key: string): Observable<void>;
|
|
@@ -68,8 +72,6 @@ export declare class SimpleStorageAccessor<T> implements StorageAccessor<T> {
|
|
|
68
72
|
protected readStoredData(storedDataString: StoredDataString): ReadStoredData<T>;
|
|
69
73
|
protected buildStoredData(value: T): StoredData;
|
|
70
74
|
protected isExpiredStoredData(storeData: StoredData): boolean;
|
|
71
|
-
protected assertValidStorageKeyPrefix(prefix: string, prefixSplitter: string): void;
|
|
72
|
-
protected isValidStorageKeyPrefix(prefix: string, prefixSpltter: string): boolean;
|
|
73
75
|
protected makeStorageKey(key: string): StoredDataStorageKey;
|
|
74
76
|
protected isKeyOfAccessor(storageKey: StoredDataStorageKey): boolean;
|
|
75
77
|
protected decodeStorageKey(storageKey: StoredDataStorageKey): string;
|
|
@@ -6,7 +6,7 @@ import { StorageAccessor } from './storage.accessor';
|
|
|
6
6
|
*/
|
|
7
7
|
export declare class StringStorageAccessor implements StorageAccessor<StoredDataString> {
|
|
8
8
|
private readonly _storage;
|
|
9
|
-
constructor(
|
|
9
|
+
constructor(storage: FullStorageObject);
|
|
10
10
|
get(key: string): Observable<Maybe<StoredDataString>>;
|
|
11
11
|
set(key: string, value: StoredDataString): Observable<void>;
|
|
12
12
|
remove(key: string): Observable<void>;
|
|
@@ -3,8 +3,8 @@ import { FullStorageObject, Maybe, StorageObject, StoredDataStorageKey } from '@
|
|
|
3
3
|
* StorageObject using LocalStorage.
|
|
4
4
|
*/
|
|
5
5
|
export declare class FullLocalStorageObject implements FullStorageObject {
|
|
6
|
-
private _localStorage;
|
|
7
|
-
constructor(
|
|
6
|
+
private readonly _localStorage;
|
|
7
|
+
constructor(localStorage: StorageObject);
|
|
8
8
|
get isPersistant(): boolean;
|
|
9
9
|
get isAvailable(): boolean;
|
|
10
10
|
get length(): number;
|