@rentman/rm-core 1.9.0 → 2.0.1
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/changelog.md +7 -0
- package/dist/rm-core.js +7445 -6441
- package/dist/rm-core.min.js +1 -1
- package/dist/src/classes/ApiFormatter.d.ts +25 -8
- package/dist/src/classes/ApiResponseProcessor.d.ts +10 -20
- package/dist/src/classes/ChangesCompilation.d.ts +14 -31
- package/dist/src/classes/ChangesDelta.d.ts +42 -0
- package/dist/src/classes/ChangesDeltaBase.d.ts +33 -0
- package/dist/src/classes/ChangesProcessor.d.ts +30 -16
- package/dist/src/classes/CollectionCache.d.ts +7 -2
- package/dist/src/classes/CollectionEntryService.d.ts +3 -0
- package/dist/src/classes/CollectionMatcher.d.ts +8 -41
- package/dist/src/classes/CollectionMatcherBase.d.ts +26 -0
- package/dist/src/classes/ColumnExpansion.d.ts +4 -0
- package/dist/src/classes/ColumnHandler.d.ts +3 -3
- package/dist/src/classes/ColumnUtil.d.ts +12 -1
- package/dist/src/classes/CreateRequest.d.ts +7 -8
- package/dist/src/classes/InternalChangesDelta.d.ts +38 -0
- package/dist/src/classes/ItemCache.d.ts +7 -1
- package/dist/src/classes/ItemEntryService.d.ts +23 -5
- package/dist/src/classes/LockService.d.ts +9 -9
- package/dist/src/classes/ModuleChangesCompilation.d.ts +4 -7
- package/dist/src/classes/QueryColumnExtractor.d.ts +20 -0
- package/dist/src/classes/QueryParser.d.ts +18 -27
- package/dist/src/classes/QueryParserBase.d.ts +29 -0
- package/dist/src/classes/QueryService.d.ts +1 -1
- package/dist/src/classes/RequestBuffer.d.ts +25 -0
- package/dist/src/classes/RequestBufferManager.d.ts +31 -0
- package/dist/src/classes/RequestColumnExpansion.d.ts +1 -0
- package/dist/src/classes/SocketMessageHandler.d.ts +19 -30
- package/dist/src/classes/TemplateCache.d.ts +63 -0
- package/dist/src/classes/cache/AbstractCache.d.ts +122 -0
- package/dist/src/classes/cache/CollectionHandlerBase.d.ts +64 -0
- package/dist/src/classes/cache/CollectionMatcherCacheProcessor.d.ts +26 -0
- package/dist/src/classes/cache/ItemHandlerBase.d.ts +86 -0
- package/dist/src/classes/cache/server/ServerCache.d.ts +87 -0
- package/dist/src/classes/cache/server/ServerCollectionHandler.d.ts +43 -0
- package/dist/src/classes/cache/server/ServerItemHandler.d.ts +49 -0
- package/dist/src/classes/cache/transaction/TransactionCache.d.ts +423 -0
- package/dist/src/classes/cache/transaction/TransactionCollectionHandler.d.ts +72 -0
- package/dist/src/classes/cache/transaction/TransactionEventHandler.d.ts +19 -0
- package/dist/src/classes/cache/transaction/TransactionItemHandler.d.ts +113 -0
- package/dist/src/classes/index.d.ts +13 -7
- package/dist/src/constants.d.ts +0 -11
- package/dist/src/core.d.ts +12 -11
- package/dist/src/factories/ChangesCompilationFactory.d.ts +4 -8
- package/dist/src/factories/ChangesDeltaFactory.d.ts +9 -0
- package/dist/src/factories/ChangesProcessorFactory.d.ts +22 -0
- package/dist/src/factories/CollectionCacheFactory.d.ts +2 -1
- package/dist/src/factories/CollectionEntryFactory.d.ts +6 -18
- package/dist/src/factories/CollectionMatcherFactory.d.ts +3 -2
- package/dist/src/factories/CollectionResourceFactory.d.ts +11 -9
- package/dist/src/factories/ColumnSetFactory.d.ts +2 -0
- package/dist/src/factories/CreateRequestFactory.d.ts +7 -7
- package/dist/src/factories/ItemCacheFactory.d.ts +2 -1
- package/dist/src/factories/ItemEntryFactory.d.ts +3 -7
- package/dist/src/factories/ItemResourceFactory.d.ts +14 -10
- package/dist/src/factories/ModuleChangesCompilationFactory.d.ts +3 -4
- package/dist/src/factories/TransactionCacheFactory.d.ts +55 -0
- package/dist/src/factories/index.d.ts +3 -2
- package/dist/src/interfaces/LinkTreeServiceInterface.d.ts +4 -0
- package/dist/src/interfaces/index.d.ts +1 -1
- package/dist/src/models/CollectionEditResource.d.ts +34 -11
- package/dist/src/models/CollectionEntry.d.ts +10 -70
- package/dist/src/models/CollectionEntryOptions.d.ts +1 -0
- package/dist/src/models/CollectionResource.d.ts +14 -14
- package/dist/src/models/CollectionResourceOptions.d.ts +6 -2
- package/dist/src/models/CollectionViewResource.d.ts +2 -2
- package/dist/src/models/EditResource.d.ts +8 -10
- package/dist/src/models/ItemEntry.d.ts +1 -58
- package/dist/src/models/ItemEntryOptions.d.ts +0 -1
- package/dist/src/models/ItemResource.d.ts +49 -16
- package/dist/src/models/LocalViewResource.d.ts +2 -2
- package/dist/src/models/RemoteViewResource.d.ts +2 -2
- package/dist/src/models/ViewResource.d.ts +2 -2
- package/dist/src/types/ItemTypesCollection.d.ts +81 -22
- package/package.json +1 -1
- package/dist/src/classes/BatchStatus.d.ts +0 -28
- package/dist/src/classes/CollectionHandler.d.ts +0 -54
- package/dist/src/classes/ItemAdministrator.d.ts +0 -228
- package/dist/src/classes/ItemHandler.d.ts +0 -60
- package/dist/src/classes/ItemRequestService.d.ts +0 -23
- package/dist/src/classes/LocalCache.d.ts +0 -112
- package/dist/src/classes/LocalCacheEventHandler.d.ts +0 -19
- package/dist/src/factories/BatchStatusFactory.d.ts +0 -9
- package/dist/src/factories/LocalCacheFactory.d.ts +0 -16
- package/dist/src/interfaces/LocalCacheManagerInterface.d.ts +0 -5
|
@@ -1,87 +1,27 @@
|
|
|
1
|
-
import { ColumnExpansion, ColumnInfo, ColumnSet,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { ApiRequestColumns, CollectionQuery, ConversionMap, EntryParentNull, FieldMap, ItemId, ItemIdConversionMap, ItemType, PromiseInterface, QueryCallback } from '../types';
|
|
1
|
+
import { CollectionEntryService, ColumnExpansion, ColumnInfo, ColumnSet, KeyService } from '../classes';
|
|
2
|
+
import { ColumnSetFactory } from '../factories';
|
|
3
|
+
import { CollectionEntryOptions } from '../models';
|
|
4
|
+
import { ApiQuery, ApiRequestColumns, CollectionQuery, EntryParentNull, ItemId, ItemIdConversionMap, ItemType, PromiseInterface, QueryCallback } from '../types';
|
|
6
5
|
export declare class CollectionEntry<ItemTypeType extends ItemType = any> {
|
|
7
|
-
private
|
|
6
|
+
private collectionEntryService;
|
|
7
|
+
private columnSetFactory;
|
|
8
|
+
private keyService;
|
|
8
9
|
itemType: ItemTypeType;
|
|
9
10
|
options: CollectionEntryOptions;
|
|
10
11
|
id: number;
|
|
11
12
|
parent: EntryParentNull;
|
|
12
13
|
query: CollectionQuery;
|
|
13
14
|
columns: ColumnSet<ItemTypeType>;
|
|
14
|
-
initial: Array<ItemEntry<ItemTypeType>>;
|
|
15
|
-
items: Array<ItemEntry<ItemTypeType>>;
|
|
16
|
-
resources: Array<CollectionResource<ItemTypeType>>;
|
|
17
|
-
deferred?: Deferred<this>;
|
|
18
|
-
promise: PromiseInterface<this>;
|
|
19
15
|
reloadQueued: boolean;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
private templateColumns;
|
|
23
|
-
constructor(factory: CollectionEntryFactory, itemType: ItemTypeType, options: CollectionEntryOptions);
|
|
24
|
-
clearResource(resource: CollectionResource): void;
|
|
25
|
-
clearResources(): void;
|
|
26
|
-
defer(): this;
|
|
27
|
-
isDeferred(): boolean;
|
|
28
|
-
_resolve(): this;
|
|
29
|
-
resolve(itemEntryCompound: {
|
|
30
|
-
columns: ColumnSet<ItemTypeType>;
|
|
31
|
-
initial: Array<ItemEntry<ItemTypeType>>;
|
|
32
|
-
modified?: Array<ItemEntry<ItemTypeType>>;
|
|
33
|
-
}): this;
|
|
16
|
+
promise: PromiseInterface<this>;
|
|
17
|
+
constructor(collectionEntryService: CollectionEntryService, columnSetFactory: ColumnSetFactory, keyService: KeyService, itemType: ItemTypeType, options: CollectionEntryOptions);
|
|
34
18
|
isLocal(): boolean;
|
|
35
19
|
matchParent(itemType: ItemType, itemId: ItemId): boolean;
|
|
36
|
-
|
|
37
|
-
getItemById(itemId: ItemId): this['items'][0] | undefined;
|
|
38
|
-
getIdArray(accumulator?: ItemId[]): ItemId[];
|
|
39
|
-
createItems(valuesArray: Array<FieldMap<ItemTypeType>>): PromiseInterface<Array<ItemEntry<ItemTypeType>>>;
|
|
40
|
-
resolveDerivedValues(itemEntries: Array<ItemEntry<ItemTypeType>>, localItemCache: ItemCache): PromiseInterface<Array<ItemEntry<ItemTypeType>>>;
|
|
41
|
-
addItems<U extends CollectionResource<ItemTypeType>>(itemEntries: Array<ItemEntry<ItemTypeType>>, resultResource: U, updateInitial?: boolean, callOnAdd?: boolean, callOnActivate?: boolean): U['items'];
|
|
42
|
-
addItems(itemEntries: Array<ItemEntry<ItemTypeType>>, resultResource?: null, updateInitial?: boolean, callOnAdd?: boolean, callOnActivate?: boolean): null;
|
|
43
|
-
addItems<U extends CollectionResource<ItemTypeType>>(itemEntries: Array<ItemEntry<ItemTypeType>>, resultResource?: U | null, updateInitial?: boolean, callOnAdd?: boolean, callOnActivate?: boolean): U['items'] | null;
|
|
44
|
-
private handleAddedItemCallbacks;
|
|
45
|
-
removeItems<U extends CollectionResource<ItemTypeType>>(idArray: ItemId[], resultResource: U, updateInitial?: boolean, callOnRemove?: boolean): U['items'];
|
|
46
|
-
removeItems(idArray: ItemId[], resultResource?: null, updateInitial?: boolean, callOnRemove?: boolean): null;
|
|
47
|
-
removeItems<U extends CollectionResource<ItemTypeType>>(idArray: ItemId[], resultResource?: U | null, updateInitial?: boolean, callOnRemove?: boolean): U['items'] | null;
|
|
48
|
-
clear<U extends CollectionResource<ItemTypeType>>(resultResource: U, updateInitial?: boolean, callOnRemove?: boolean): U['items'];
|
|
49
|
-
clear(resultResource?: null, updateInitial?: boolean, callOnRemove?: boolean): null;
|
|
50
|
-
handleRemovedItems<U extends CollectionResource<ItemTypeType>>(filterFunction: (itemEntry: this['items'][0]) => boolean, resultResource: U, updateInitial?: boolean, callOnRemove?: boolean): U['items'];
|
|
51
|
-
handleRemovedItems(filterFunction: (itemEntry: this['items'][0]) => boolean, resultResource?: null, updateInitial?: boolean, callOnRemove?: boolean): null;
|
|
52
|
-
handleRemovedItems<U extends CollectionResource<ItemTypeType>>(filterFunction: (itemEntry: this['items'][0]) => boolean, resultResource?: U | null, updateInitial?: boolean, callOnRemove?: boolean): U['items'] | null;
|
|
53
|
-
private handleRemovedItemCallbacks;
|
|
54
|
-
private createBatchStatus;
|
|
55
|
-
private expandLocal;
|
|
56
|
-
private expandRemote;
|
|
57
|
-
expand(newColumns: ApiRequestColumns, localItemCache: ItemCache): PromiseInterface<this>;
|
|
58
|
-
extendQuery(callback?: QueryCallback): CollectionQuery;
|
|
59
|
-
extend<U extends CollectionResource<ItemTypeType>>(queryCallback: QueryCallback, collectionResource?: U, callOnAdd?: boolean): PromiseInterface<U['items']>;
|
|
60
|
-
extend(queryCallback: QueryCallback, collectionResource?: null, callOnAdd?: boolean): PromiseInterface<null>;
|
|
20
|
+
extendQuery(callback?: QueryCallback): ApiQuery;
|
|
61
21
|
queueReload(): void;
|
|
62
22
|
expandColumns(columnExpansion: ColumnExpansion<ItemTypeType>): void;
|
|
63
23
|
expandRequestColumns(requestColumns: ApiRequestColumns): void;
|
|
64
|
-
getAddedItems(returnItemIds: true): ItemId[];
|
|
65
|
-
getAddedItems(returnItemIds?: boolean): Array<ItemEntry<ItemTypeType>>;
|
|
66
|
-
getRemovedItems(returnItemIds: true): ItemId[];
|
|
67
|
-
getRemovedItems(returnItemIds?: boolean): Array<ItemEntry<ItemTypeType>>;
|
|
68
|
-
getUpdatedItems(): Array<ItemEntry<ItemTypeType>>;
|
|
69
|
-
hasAddedItems(): boolean;
|
|
70
|
-
hasRemovedItems(): boolean;
|
|
71
|
-
hasUpdatedItems(): boolean;
|
|
72
|
-
/**
|
|
73
|
-
* @description
|
|
74
|
-
* Reverts added and removed items
|
|
75
|
-
*
|
|
76
|
-
* @remarks
|
|
77
|
-
* - Doesn't revert changes on the items themselves
|
|
78
|
-
*/
|
|
79
|
-
revertChanges(): void;
|
|
80
|
-
onItemsCreated(conversionMap: ConversionMap): void;
|
|
81
|
-
private onAddInitial;
|
|
82
|
-
private onRemoveInitial;
|
|
83
24
|
getUpdatedItemColumns(conversionMap: ItemIdConversionMap): {
|
|
84
25
|
[columnId: string]: ColumnInfo<ItemTypeType>;
|
|
85
26
|
};
|
|
86
|
-
clone(parent: EntryParentNull, conversionMap?: ItemIdConversionMap): CollectionEntry<ItemTypeType>;
|
|
87
27
|
}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TransactionCache } from '../classes/cache/transaction/TransactionCache';
|
|
2
2
|
import { CollectionResourceFactory } from '../factories';
|
|
3
3
|
import { CollectionEntry, CollectionResourceOptions, ItemEntry, ItemResource, LocalViewResource } from '../models';
|
|
4
|
-
import { ItemResourceItemIdMap, ItemType, PromiseInterface, QueryCallback, ResponseColumnItemTypeMap } from '../types';
|
|
4
|
+
import { ItemId, ItemResourceItemIdMap, ItemType, PromiseInterface, QueryCallback, ResponseColumnItemTypeMap } from '../types';
|
|
5
5
|
export declare abstract class CollectionResource<ItemTypeType extends ItemType = any, T extends ItemResource<ItemTypeType> = LocalViewResource<ItemTypeType>> {
|
|
6
6
|
protected factory: CollectionResourceFactory;
|
|
7
7
|
entry: CollectionEntry<ItemTypeType>;
|
|
8
8
|
options: CollectionResourceOptions<ItemTypeType>;
|
|
9
|
-
|
|
9
|
+
transaction: TransactionCache;
|
|
10
10
|
items: T[];
|
|
11
11
|
columns: ResponseColumnItemTypeMap;
|
|
12
12
|
protected itemIdMap: ItemResourceItemIdMap<T>;
|
|
13
13
|
private readonly onChange;
|
|
14
|
-
protected constructor(factory: CollectionResourceFactory, entry: CollectionEntry<ItemTypeType>, options: CollectionResourceOptions<ItemTypeType>,
|
|
14
|
+
protected constructor(factory: CollectionResourceFactory, entry: CollectionEntry<ItemTypeType>, options: CollectionResourceOptions<ItemTypeType>, transaction: TransactionCache);
|
|
15
15
|
onConstruct(): void;
|
|
16
|
+
getIdArray(): ItemId[];
|
|
16
17
|
getItemById(itemId: number): T;
|
|
17
|
-
|
|
18
|
-
addItemResources(itemEntries: Array<ItemEntry<ItemTypeType>>): T[];
|
|
18
|
+
addItemResources(itemEntries: Array<ItemEntry<ItemTypeType>>, _isInitialCall?: boolean): T[];
|
|
19
19
|
/**
|
|
20
20
|
* @description
|
|
21
21
|
* Returns the {@link ItemResource ItemResources} that where removed from the {@link CollectionResource collection}.
|
|
22
22
|
* Filters on {@link ItemResource ItemResource}.{@link ItemEntry entry} === {@link ItemEntry entry}
|
|
23
23
|
*/
|
|
24
24
|
removeItemResources(itemEntries: Array<ItemEntry<ItemTypeType>>): T[];
|
|
25
|
-
callOnAdd(itemResources: T[]): void;
|
|
25
|
+
callOnAdd(itemResources: T[], isInitialCall?: boolean): void;
|
|
26
26
|
callOnRemove(itemResources: T[]): void;
|
|
27
27
|
forEach(callback: (itemResource: T) => void): void;
|
|
28
28
|
filter(callback: (itemResource: T) => boolean): T[];
|
|
@@ -33,20 +33,20 @@ export declare abstract class CollectionResource<ItemTypeType extends ItemType =
|
|
|
33
33
|
};
|
|
34
34
|
map<U>(argument: string | ((itemResource: T) => U)): U[];
|
|
35
35
|
reduce<U>(callback: (itemResource: T, value: U) => U, value: U): U;
|
|
36
|
-
extend(queryCallback: QueryCallback, returnAllItems?: boolean, callOnAdd?: boolean): PromiseInterface<T[]>;
|
|
37
36
|
/**
|
|
38
37
|
* @description
|
|
39
|
-
*
|
|
38
|
+
* Fetches new items and adds them to the collection
|
|
40
39
|
*
|
|
41
40
|
* @remarks
|
|
42
|
-
* -
|
|
41
|
+
* - Used to return {@link ItemResource ItemResources}, but you should the {@link CollectionResource.onAdd onAdd) instead
|
|
43
42
|
*/
|
|
44
|
-
|
|
43
|
+
extend(queryCallback: QueryCallback): PromiseInterface<CollectionEntry<ItemTypeType>>;
|
|
45
44
|
/**
|
|
46
|
-
* @
|
|
45
|
+
* @description
|
|
46
|
+
* Removes the reference to the {@link CollectionResource CollectionResource} from the {@link CollectionEntry CollectionEntry}
|
|
47
47
|
*
|
|
48
48
|
* @remarks
|
|
49
|
-
* -
|
|
49
|
+
* - Doesn't revert changes on the items themselves
|
|
50
50
|
*/
|
|
51
|
-
|
|
51
|
+
clearResource(clearItems?: boolean): void;
|
|
52
52
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CollectionEntry, CollectionResource, ItemEntry, ItemResource } from '../models';
|
|
2
2
|
import { ConversionMap, ItemType, OnChangeFunction } from '../types';
|
|
3
3
|
export declare type CollectionResourceCallback<ItemTypeType extends ItemType> = (itemResources: Array<ItemResource<ItemTypeType>>, collectionResource: CollectionResource<ItemTypeType>) => void;
|
|
4
|
+
export declare type CollectionResourceOnAddCallback<ItemTypeType extends ItemType> = (itemResources: Array<ItemResource<ItemTypeType>>, collectionResource: CollectionResource<ItemTypeType>, isInitialCall: boolean) => void;
|
|
4
5
|
export declare type CollectionResourceInitialCallback<ItemTypeType extends ItemType> = (itemEntries: Array<ItemEntry<ItemTypeType>>, collectionEntry: CollectionEntry<ItemTypeType>) => void;
|
|
5
6
|
export declare type OnItemsCreatedCallback = (conversionMap: ConversionMap) => void;
|
|
6
7
|
export declare type CollectionResourceOptionsInterface<ItemTypeType extends ItemType> = Partial<CollectionResourceOptions<ItemTypeType>>;
|
|
@@ -8,11 +9,14 @@ export declare class CollectionResourceOptions<ItemTypeType extends ItemType> {
|
|
|
8
9
|
editItems: boolean;
|
|
9
10
|
remoteItems: boolean;
|
|
10
11
|
editCollection: boolean;
|
|
11
|
-
modInstant: boolean;
|
|
12
12
|
enableSave: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated
|
|
15
|
+
* You should use itemResource.onChange and compare previous.id with fields.id
|
|
16
|
+
*/
|
|
13
17
|
onItemsCreated: OnItemsCreatedCallback;
|
|
14
18
|
onChange: OnChangeFunction;
|
|
15
|
-
onAdd:
|
|
19
|
+
onAdd: CollectionResourceOnAddCallback<ItemTypeType>;
|
|
16
20
|
onRemove: CollectionResourceCallback<ItemTypeType>;
|
|
17
21
|
onAddInitial: CollectionResourceInitialCallback<ItemTypeType>;
|
|
18
22
|
onRemoveInitial: CollectionResourceInitialCallback<ItemTypeType>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TransactionCache } from '../classes/cache/transaction/TransactionCache';
|
|
2
2
|
import { CollectionResourceFactory } from '../factories';
|
|
3
3
|
import { CollectionEntry, CollectionResource, CollectionResourceOptions, ItemResource, LocalViewResource } from '../models';
|
|
4
4
|
import { ItemType } from '../types';
|
|
5
5
|
export declare class CollectionViewResource<ItemTypeType extends ItemType = any, T extends ItemResource<ItemTypeType> = LocalViewResource<ItemTypeType>> extends CollectionResource<ItemTypeType, T> {
|
|
6
|
-
constructor(collectionResourceFactory: CollectionResourceFactory, collectionEntry: CollectionEntry<ItemTypeType>, options: CollectionResourceOptions<ItemTypeType>,
|
|
6
|
+
constructor(collectionResourceFactory: CollectionResourceFactory, collectionEntry: CollectionEntry<ItemTypeType>, options: CollectionResourceOptions<ItemTypeType>, transactionCache: TransactionCache);
|
|
7
7
|
}
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TransactionCache } from '../classes/cache/transaction/TransactionCache';
|
|
2
2
|
import { ItemResourceFactory } from '../factories';
|
|
3
3
|
import { ItemEntry, ItemResource, ItemResourceOptions } from '../models';
|
|
4
4
|
import { FieldMap, ItemType, PromiseInterface } from '../types';
|
|
5
5
|
export declare class EditResource<ItemTypeType extends ItemType = any> extends ItemResource<ItemTypeType> {
|
|
6
6
|
protected localCopies: Array<FieldMap<ItemTypeType>>;
|
|
7
|
-
|
|
8
|
-
constructor(factory: ItemResourceFactory, entry: ItemEntry<ItemTypeType>, options: ItemResourceOptions, isNew: boolean,
|
|
7
|
+
fields: FieldMap<ItemTypeType>;
|
|
8
|
+
constructor(factory: ItemResourceFactory, entry: ItemEntry<ItemTypeType>, options: ItemResourceOptions, isNew: boolean, transaction: TransactionCache);
|
|
9
9
|
isNew(): boolean;
|
|
10
|
-
start(): this;
|
|
11
|
-
rollback(): this;
|
|
12
|
-
commit(callOnChange?: boolean): this;
|
|
13
|
-
getLocalCopy(): FieldMap<ItemTypeType> | null;
|
|
14
10
|
copyFields(destination?: FieldMap<ItemTypeType>): FieldMap<ItemTypeType>;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
/**
|
|
12
|
+
* @description
|
|
13
|
+
* Updates the fields of the item and calls onChange, when updating many fields of many items it's better to create a {@link ChangesDelta ChangesDelta} yourself so all changes can be applied at once
|
|
14
|
+
*/
|
|
15
|
+
setFields(values: FieldMap<ItemTypeType>): PromiseInterface<this>;
|
|
18
16
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { ColumnSet } from '../classes';
|
|
2
2
|
import { ItemEntryFactory } from '../factories';
|
|
3
|
-
import {
|
|
4
|
-
import { ItemResource } from '../models';
|
|
5
|
-
import { ColumnExpansionResult, EntryParentNull, FieldMap, ItemError, ItemId, ItemIdConversionMap, ItemType, PromiseInterface } from '../types';
|
|
3
|
+
import { ItemId, ItemType } from '../types';
|
|
6
4
|
export declare class ItemEntry<ItemTypeType extends ItemType = any> {
|
|
7
5
|
private factory;
|
|
8
6
|
itemType: ItemTypeType;
|
|
@@ -10,67 +8,12 @@ export declare class ItemEntry<ItemTypeType extends ItemType = any> {
|
|
|
10
8
|
columns: ColumnSet<ItemTypeType>;
|
|
11
9
|
id: number;
|
|
12
10
|
reloadQueued: boolean;
|
|
13
|
-
deferRequest: boolean;
|
|
14
|
-
deferred?: Deferred<this>;
|
|
15
|
-
parent: EntryParentNull;
|
|
16
|
-
initial: FieldMap<ItemTypeType>;
|
|
17
|
-
modified: FieldMap<ItemTypeType>;
|
|
18
|
-
derived: FieldMap<ItemTypeType>;
|
|
19
|
-
resources: Array<ItemResource<ItemTypeType>>;
|
|
20
11
|
constructor(factory: ItemEntryFactory, itemType: ItemTypeType, itemId: ItemId, columns: ColumnSet<ItemTypeType>);
|
|
21
12
|
queueReload(): this;
|
|
22
|
-
clearResource(resource: ItemResource): void;
|
|
23
|
-
clearResources(): void;
|
|
24
|
-
defer(deferRequest?: boolean): this;
|
|
25
|
-
getPromise(): PromiseInterface<this>;
|
|
26
|
-
resolve(): this;
|
|
27
|
-
resolveDeferred(initial: FieldMap, derived: FieldMap, columns: ColumnSet<ItemTypeType>): this;
|
|
28
|
-
isDeferred(): boolean;
|
|
29
|
-
reject(error?: ItemError): this;
|
|
30
|
-
setFields(initial: FieldMap<ItemTypeType>, derived: FieldMap): this;
|
|
31
|
-
setLocalFields(initialValues: FieldMap, conversionMap: ItemIdConversionMap, columns?: ColumnSet<ItemTypeType>): this;
|
|
32
|
-
clone(conversionMap?: ItemIdConversionMap): ItemEntry<ItemTypeType>;
|
|
33
|
-
resetDerived(columnIds: string[]): this;
|
|
34
|
-
getFields(): FieldMap<ItemTypeType>;
|
|
35
|
-
expand(main: FieldMap, derived: FieldMap, columnExpansionResult: ColumnExpansionResult<ItemTypeType>): this;
|
|
36
|
-
expandLocal(columnExpansionResult: ColumnExpansionResult<ItemTypeType>): this;
|
|
37
|
-
private setLocalValues;
|
|
38
|
-
/**
|
|
39
|
-
* @description
|
|
40
|
-
* Updates the {@link ItemEntry.initial initial}, {@link ItemEntry.modified modified} and {@link ItemEntry.derived derived} properties in-place to preserve references in existing {@link ItemResource ItemResources}.
|
|
41
|
-
*
|
|
42
|
-
* @remarks
|
|
43
|
-
* - Assumes the {@link ItemEntry.initial initial}, {@link ItemEntry.modified modified} and {@link ItemEntry.derived derived} properties are already set.
|
|
44
|
-
*/
|
|
45
|
-
updateFields(fields: FieldMap<ItemTypeType>, derived?: FieldMap | null, overwrite?: boolean): this;
|
|
46
|
-
private updateItemValues;
|
|
47
|
-
updateItemFields(conversionMap: ItemIdConversionMap, columns?: ColumnSet<ItemTypeType>): this;
|
|
48
|
-
formatRequest(): FieldMap<ItemTypeType>;
|
|
49
|
-
setDisplayName(): this;
|
|
50
|
-
getDisplayName(): string;
|
|
51
|
-
/**
|
|
52
|
-
* @param returnAll Returns all initial values if true
|
|
53
|
-
*/
|
|
54
|
-
getChanges(returnAll?: boolean): FieldMap<any>;
|
|
55
13
|
isLocal(): boolean;
|
|
56
14
|
isLockable(): boolean;
|
|
57
|
-
hasChanges(): boolean;
|
|
58
|
-
resetModified(): this;
|
|
59
|
-
setInitial(values: FieldMap, enableCallbacks?: boolean): this;
|
|
60
|
-
/**
|
|
61
|
-
* @remarks
|
|
62
|
-
* - Does a shallow copy of values!
|
|
63
|
-
*/
|
|
64
|
-
setModified(values?: FieldMap<ItemTypeType>): this;
|
|
65
|
-
setDerived(values: FieldMap): this;
|
|
66
|
-
setParent(parentType: ItemType, parentId: ItemId): this;
|
|
67
|
-
callOnChange(previous?: FieldMap<ItemTypeType>): this;
|
|
68
15
|
toJSON(): {
|
|
69
16
|
id: number;
|
|
70
|
-
parent: EntryParentNull;
|
|
71
|
-
initial: FieldMap<ItemTypeType>;
|
|
72
|
-
modified: FieldMap<ItemTypeType>;
|
|
73
|
-
derived: FieldMap<ItemTypeType>;
|
|
74
17
|
columns: ColumnSet<ItemTypeType>;
|
|
75
18
|
};
|
|
76
19
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TransactionCache } from '../classes';
|
|
2
2
|
import { ItemResourceFactory } from '../factories';
|
|
3
3
|
import { ItemEntry, ItemResourceOptions } from '../models';
|
|
4
4
|
import { FieldMap, ItemType, ResponseColumn } from '../types';
|
|
@@ -7,14 +7,38 @@ export declare abstract class ItemResource<ItemTypeType extends ItemType = any>
|
|
|
7
7
|
readonly entry: ItemEntry<ItemTypeType>;
|
|
8
8
|
readonly options: ItemResourceOptions<ItemResource<ItemTypeType>>;
|
|
9
9
|
protected readonly _isNew: boolean;
|
|
10
|
-
protected readonly
|
|
10
|
+
protected readonly transaction: TransactionCache;
|
|
11
11
|
columns: {
|
|
12
12
|
[columnId: string]: ResponseColumn;
|
|
13
13
|
};
|
|
14
|
-
fields: FieldMap<ItemTypeType
|
|
15
|
-
|
|
16
|
-
protected constructor(factory: ItemResourceFactory, entry: ItemEntry<ItemTypeType>, options: ItemResourceOptions<ItemResource<ItemTypeType>>, _isNew: boolean,
|
|
14
|
+
fields: Readonly<FieldMap<ItemTypeType>>;
|
|
15
|
+
initial: Readonly<FieldMap<ItemTypeType>>;
|
|
16
|
+
protected constructor(factory: ItemResourceFactory, entry: ItemEntry<ItemTypeType>, options: ItemResourceOptions<ItemResource<ItemTypeType>>, _isNew: boolean, transaction: TransactionCache);
|
|
17
17
|
onConstruct(): void;
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated
|
|
20
|
+
* Use {@link TransactionCache.applyChangesDelta transaction.applyChangesDelta} instead
|
|
21
|
+
*/
|
|
22
|
+
callOnChange(previous: FieldMap<ItemTypeType>): void;
|
|
23
|
+
/**
|
|
24
|
+
* @description
|
|
25
|
+
* Utility function to easily check if a field is changed.
|
|
26
|
+
* Will return `false` if the field is changed
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* onChange: (
|
|
30
|
+
* itemResource,
|
|
31
|
+
* previous,
|
|
32
|
+
* compareItemField
|
|
33
|
+
* ) {
|
|
34
|
+
* if (!compareItemField('columnId')) {
|
|
35
|
+
* processItem(itemResource);
|
|
36
|
+
* }
|
|
37
|
+
* }
|
|
38
|
+
*/
|
|
39
|
+
compareItemField(columnId: keyof FieldMap<ItemTypeType>, previous: FieldMap<ItemTypeType>): boolean;
|
|
40
|
+
hasChanges(): boolean;
|
|
41
|
+
setTransactionParameters(parameters: any): void;
|
|
18
42
|
/**
|
|
19
43
|
* @description
|
|
20
44
|
* 'isNew' means that the {@link ItemEntry ItemEntry} is a local item and that this resource was created when the {@link ItemEntry ItemEntry} was first created
|
|
@@ -23,23 +47,32 @@ export declare abstract class ItemResource<ItemTypeType extends ItemType = any>
|
|
|
23
47
|
isLocal(): boolean;
|
|
24
48
|
/**
|
|
25
49
|
* @description
|
|
26
|
-
* Removes the reference to the {@link ItemResource ItemResource} from the {@link
|
|
50
|
+
* Removes the reference to the {@link ItemResource ItemResource} from the {@link TransactionCache TransactionCache}, so that the OnChange callback won't be called anymore.
|
|
27
51
|
*
|
|
28
52
|
* Warning:
|
|
29
|
-
* This doesn't revert any changes made to the item, in order to revert the changes you should use {@link
|
|
53
|
+
* This doesn't revert any changes made to the item, in order to revert the changes you should use {@link TransactionItemHandler.clearItemEntry TransactionItemHandler.clearItemEntry}
|
|
30
54
|
*/
|
|
31
55
|
clearResource(): void;
|
|
32
|
-
/**
|
|
33
|
-
* @deprecated
|
|
34
|
-
*
|
|
35
|
-
* @remarks
|
|
36
|
-
* - Does *not* clear resources
|
|
37
|
-
*/
|
|
38
|
-
deactivate(): void;
|
|
39
56
|
toJSON(): {
|
|
40
57
|
columns: string[];
|
|
41
|
-
fields: FieldMap<ItemTypeType
|
|
42
|
-
derived: FieldMap<ItemTypeType>;
|
|
58
|
+
fields: Readonly<FieldMap<ItemTypeType>>;
|
|
43
59
|
entry: ItemEntry<ItemTypeType>;
|
|
44
60
|
};
|
|
61
|
+
/**
|
|
62
|
+
* @description
|
|
63
|
+
* Returns the value of the columnPath, or undefined when the path couldn't be traversed
|
|
64
|
+
*
|
|
65
|
+
* @param columnPath Can either be an array of columnIds (['column', 'column2']) or a config column string ('column>column2')
|
|
66
|
+
*/
|
|
67
|
+
getDerivedValue<T extends any = any>(columnPath: string[] | string): T | undefined;
|
|
68
|
+
/**
|
|
69
|
+
* @description
|
|
70
|
+
* Traverses the column path and returns the fields of the derived item, returns undefined if the item isn't found
|
|
71
|
+
*
|
|
72
|
+
* ---------------------
|
|
73
|
+
*
|
|
74
|
+
* @remark
|
|
75
|
+
* Assumes the derived item's values are already cached
|
|
76
|
+
*/
|
|
77
|
+
getDerivedValues(columnPath: string[]): Readonly<FieldMap> | undefined;
|
|
45
78
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TransactionCache } from '../classes/cache/transaction/TransactionCache';
|
|
2
2
|
import { ItemResourceFactory } from '../factories';
|
|
3
3
|
import { ItemEntry, ItemResourceOptions, ViewResource } from '../models';
|
|
4
4
|
import { ItemType } from '../types';
|
|
5
5
|
export declare class LocalViewResource<ItemTypeType extends ItemType = any> extends ViewResource<ItemTypeType> {
|
|
6
|
-
constructor(factory: ItemResourceFactory, entry: ItemEntry<ItemTypeType>, options: ItemResourceOptions, isNew: boolean,
|
|
6
|
+
constructor(factory: ItemResourceFactory, entry: ItemEntry<ItemTypeType>, options: ItemResourceOptions, isNew: boolean, transaction: TransactionCache);
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TransactionCache } from '../classes/cache/transaction/TransactionCache';
|
|
2
2
|
import { ItemResourceFactory } from '../factories';
|
|
3
3
|
import { ItemEntry, ItemResourceOptions, ViewResource } from '../models';
|
|
4
4
|
import { ItemType } from '../types';
|
|
5
5
|
export declare class RemoteViewResource<ItemTypeType extends ItemType = any> extends ViewResource<ItemTypeType> {
|
|
6
|
-
constructor(factory: ItemResourceFactory, entry: ItemEntry<ItemTypeType>, options: ItemResourceOptions<RemoteViewResource<ItemTypeType>>, isNew: boolean,
|
|
6
|
+
constructor(factory: ItemResourceFactory, entry: ItemEntry<ItemTypeType>, options: ItemResourceOptions<RemoteViewResource<ItemTypeType>>, isNew: boolean, transaction: TransactionCache);
|
|
7
7
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TransactionCache } from '../classes/cache/transaction/TransactionCache';
|
|
2
2
|
import { ItemResourceFactory } from '../factories';
|
|
3
3
|
import { ItemEntry, ItemResource, ItemResourceOptions } from '../models';
|
|
4
4
|
import { FieldMap, ItemType } from '../types';
|
|
5
5
|
export declare abstract class ViewResource<ItemTypeType extends ItemType = any> extends ItemResource<ItemTypeType> {
|
|
6
6
|
fields: Readonly<FieldMap<ItemTypeType>>;
|
|
7
|
-
protected constructor(factory: ItemResourceFactory, entry: ItemEntry<ItemTypeType>, options: ItemResourceOptions<ViewResource<ItemTypeType>>, isNew: boolean,
|
|
7
|
+
protected constructor(factory: ItemResourceFactory, entry: ItemEntry<ItemTypeType>, options: ItemResourceOptions<ViewResource<ItemTypeType>>, isNew: boolean, transaction: TransactionCache);
|
|
8
8
|
}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { ApiResponseProcessor, CollectionMatcher, ColumnSet, RequestColumnExpansion } from '../classes';
|
|
2
|
-
import { ENTRY_STATUS } from '../constants';
|
|
3
2
|
import { CollectionEntry, CollectionEntryOptions, CollectionEntryOptionsInterface, CollectionResource, CollectionResourceOptions, CollectionResourceOptionsInterface, ItemEntry, ItemEntryOptionsInterface, ItemResource, ItemResourceOptionsInterface } from '../models';
|
|
4
3
|
export declare type EntryParent = {
|
|
5
4
|
itemType: string;
|
|
6
5
|
itemId: number;
|
|
7
6
|
};
|
|
8
7
|
export declare type EntryParentNull = EntryParent | null;
|
|
8
|
+
/**
|
|
9
|
+
* @description
|
|
10
|
+
* Used for fields that belong to a specific itemType
|
|
11
|
+
*/
|
|
9
12
|
export declare type FieldMap<_ItemTypeType extends ItemType = any> = {
|
|
10
13
|
[key: string]: any;
|
|
11
14
|
};
|
|
@@ -21,7 +24,12 @@ export interface CollectionDefinition<ItemTypeType extends ItemType = any> {
|
|
|
21
24
|
export interface LinkCollectionDefinition<ItemTypeType extends ItemType = any> extends CollectionDefinition<ItemTypeType> {
|
|
22
25
|
linkField: string;
|
|
23
26
|
}
|
|
24
|
-
export declare type OnChangeFunction<ItemResourceType extends ItemResource<any> = ItemResource<any>> = (itemResource: ItemResourceType, previous
|
|
27
|
+
export declare type OnChangeFunction<ItemResourceType extends ItemResource<any> = ItemResource<any>> = (itemResource: ItemResourceType, previous: FieldMap<ItemResourceType['entry']['itemType']>,
|
|
28
|
+
/**
|
|
29
|
+
* @description
|
|
30
|
+
* Returns 'true' if the field changed
|
|
31
|
+
*/
|
|
32
|
+
compareField: (field: keyof FieldMap<ItemResourceType['entry']['itemType']>) => boolean) => void;
|
|
25
33
|
export declare const enum StateKeyType {
|
|
26
34
|
New = "new",
|
|
27
35
|
Duplicate = "duplicate"
|
|
@@ -55,6 +63,58 @@ export interface SocketMessage {
|
|
|
55
63
|
body: any;
|
|
56
64
|
messageType: SocketMessageType;
|
|
57
65
|
}
|
|
66
|
+
export interface SocketMessageCreate extends SocketMessage {
|
|
67
|
+
body: {
|
|
68
|
+
eventType: 'create';
|
|
69
|
+
columns: ResponseColumnItemTypeMap;
|
|
70
|
+
itemType: ItemType;
|
|
71
|
+
items: {
|
|
72
|
+
[itemType: string]: {
|
|
73
|
+
[itemId: number]: {
|
|
74
|
+
parent: null | EntryParent;
|
|
75
|
+
values: FieldMap;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
export interface SocketMessageUpdate extends SocketMessage {
|
|
82
|
+
body: {
|
|
83
|
+
eventType: 'update';
|
|
84
|
+
columns: ResponseColumnItemTypeMap;
|
|
85
|
+
itemType: ItemType;
|
|
86
|
+
items: {
|
|
87
|
+
[itemType: string]: {
|
|
88
|
+
[itemId: number]: {
|
|
89
|
+
parent: null | EntryParent;
|
|
90
|
+
values: FieldMap;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
export interface SocketMessageLinkTo extends SocketMessage {
|
|
97
|
+
body: {
|
|
98
|
+
eventType: 'linkto';
|
|
99
|
+
columns: ResponseColumnItemTypeMap;
|
|
100
|
+
itemType: ItemType;
|
|
101
|
+
items: {
|
|
102
|
+
[itemType: string]: {
|
|
103
|
+
[itemId: number]: {
|
|
104
|
+
parent: null | EntryParent;
|
|
105
|
+
values: FieldMap;
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
export interface SocketMessageDelete extends SocketMessage {
|
|
112
|
+
body: {
|
|
113
|
+
eventType: 'delete';
|
|
114
|
+
itemType: ItemType;
|
|
115
|
+
items: ItemId[];
|
|
116
|
+
};
|
|
117
|
+
}
|
|
58
118
|
export interface FunctionChangesResolveSocketMessage extends SocketMessage {
|
|
59
119
|
body: {
|
|
60
120
|
itemType: 'FunctionChangesResolve';
|
|
@@ -75,14 +135,6 @@ export declare type ItemMap<T> = {
|
|
|
75
135
|
};
|
|
76
136
|
};
|
|
77
137
|
export declare type ItemEntryMap<ItemTypeType extends ItemType> = ItemMap<ItemEntry<ItemTypeType>>;
|
|
78
|
-
export declare type LinkedItemEntryMap<ItemTypeType extends ItemType = any> = {
|
|
79
|
-
itemType: ItemTypeType;
|
|
80
|
-
itemEntries: Array<ItemEntry<ItemTypeType>>;
|
|
81
|
-
columnSet: ColumnSet<ItemTypeType>;
|
|
82
|
-
};
|
|
83
|
-
export declare type EntryStatusMap<T> = {
|
|
84
|
-
[entryStatus: string]: T[];
|
|
85
|
-
};
|
|
86
138
|
export declare type ItemEntryParentIdMap<ItemTypeType extends ItemType> = {
|
|
87
139
|
[parentId: number]: Array<ItemEntry<ItemTypeType>>;
|
|
88
140
|
};
|
|
@@ -126,7 +178,7 @@ export declare type ResponseColumnMap = {
|
|
|
126
178
|
export declare type ResponseColumnItemTypeMap = {
|
|
127
179
|
[itemType: string]: ResponseColumnMap;
|
|
128
180
|
};
|
|
129
|
-
export declare type ColumnExpansionResult<ItemTypeType extends ItemType> = {
|
|
181
|
+
export declare type ColumnExpansionResult<ItemTypeType extends ItemType = any> = {
|
|
130
182
|
merged: ColumnSet<ItemTypeType>;
|
|
131
183
|
difference: ColumnSet<ItemTypeType>;
|
|
132
184
|
};
|
|
@@ -141,16 +193,8 @@ export declare type TemplateItemResourceMap<T extends ItemResource<any>> = {
|
|
|
141
193
|
main: T;
|
|
142
194
|
linked: ItemResourcesItemTypeMap;
|
|
143
195
|
};
|
|
144
|
-
export declare type
|
|
145
|
-
|
|
146
|
-
linked: Array<LinkedItemEntryMap<ItemType>>;
|
|
147
|
-
};
|
|
148
|
-
export declare type ItemTypeMap = {
|
|
149
|
-
[itemType: string]: any;
|
|
150
|
-
};
|
|
151
|
-
export declare type EntryStatus<T> = {
|
|
152
|
-
entry: T;
|
|
153
|
-
status: ENTRY_STATUS;
|
|
196
|
+
export declare type ItemTypeMap<T = any> = {
|
|
197
|
+
[itemType: string]: T;
|
|
154
198
|
};
|
|
155
199
|
export declare type ApiQuery = any;
|
|
156
200
|
export declare type ApiRequestItemValues = {
|
|
@@ -193,5 +237,20 @@ export declare type CreateRequestEntry<ItemTypeType extends ItemType> = {
|
|
|
193
237
|
};
|
|
194
238
|
columns: RequestColumnExpansion;
|
|
195
239
|
items: ItemEntryMap<ItemTypeType>;
|
|
196
|
-
collections: CollectionMatcher
|
|
240
|
+
collections: CollectionMatcher;
|
|
241
|
+
};
|
|
242
|
+
export declare enum ApiLinkTreeType {
|
|
243
|
+
ITEMTABLE = "itemtable",
|
|
244
|
+
DIRECT = "direct"
|
|
245
|
+
}
|
|
246
|
+
export declare type ApiLinkTreeEntry = {
|
|
247
|
+
type: ApiLinkTreeType.ITEMTABLE;
|
|
248
|
+
} | {
|
|
249
|
+
type: ApiLinkTreeType.DIRECT;
|
|
250
|
+
field: string;
|
|
251
|
+
};
|
|
252
|
+
export declare type ApiLinkTree = {
|
|
253
|
+
[itemType: string]: {
|
|
254
|
+
[childType: string]: ApiLinkTreeEntry;
|
|
255
|
+
};
|
|
197
256
|
};
|
package/package.json
CHANGED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { ENTRY_STATUS } from '../constants';
|
|
2
|
-
import { PromiseLibraryInterface } from '../interfaces';
|
|
3
|
-
import { CollectionEntry, ItemEntry } from '../models';
|
|
4
|
-
import { EntryStatus, EntryStatusMap, ItemId, ItemType, PromiseInterface } from '../types';
|
|
5
|
-
export declare class BatchStatus<ItemTypeType extends ItemType, T extends ItemEntry<ItemTypeType> | CollectionEntry<ItemTypeType>> {
|
|
6
|
-
private promiseService;
|
|
7
|
-
itemType: ItemTypeType;
|
|
8
|
-
getItemId: (itemEntry: T) => ItemId;
|
|
9
|
-
getPromise: (itemEntry: T) => PromiseInterface<T>;
|
|
10
|
-
readonly requestStatus: ENTRY_STATUS[];
|
|
11
|
-
readonly remoteExpandStatus: ENTRY_STATUS[];
|
|
12
|
-
readonly localExpandStatus: ENTRY_STATUS[];
|
|
13
|
-
entries: EntryStatusMap<T>;
|
|
14
|
-
constructor(promiseService: PromiseLibraryInterface, itemType: ItemTypeType, getItemId: (itemEntry: T) => ItemId, getPromise: (itemEntry: T) => PromiseInterface<T>);
|
|
15
|
-
add(entryStatus: EntryStatus<T>): void;
|
|
16
|
-
hasEntries(statusArray: ENTRY_STATUS[]): boolean;
|
|
17
|
-
hasRequests(): boolean;
|
|
18
|
-
forEachEntry(statusArray: ENTRY_STATUS[], callback: (entry: T, itemId: ItemId) => void): void;
|
|
19
|
-
reduceEntries<U>(statusArray: ENTRY_STATUS[], callback: (entry: T, itemId: ItemId, destination: U) => void, destination: U): U;
|
|
20
|
-
reduceAllEntries<U>(callback: (entry: T, itemId: ItemId, destination: U) => void, destination: U): U;
|
|
21
|
-
getPromises(): PromiseInterface<T[]>;
|
|
22
|
-
getItemIds(statusArray: ENTRY_STATUS[]): ItemId[];
|
|
23
|
-
getRequestIds(): ItemId[];
|
|
24
|
-
getArray(statusArray?: ENTRY_STATUS[]): T[];
|
|
25
|
-
getMap(): {
|
|
26
|
-
[itemId: string]: T;
|
|
27
|
-
};
|
|
28
|
-
}
|