@rentman/rm-core 8.2.0 → 8.2.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.
Files changed (106) hide show
  1. package/changelog.md +938 -931
  2. package/dist/rm-core.js +700 -693
  3. package/dist/rm-core.min.js +1 -1
  4. package/dist/types/classes/ApiFormatter.d.ts +73 -73
  5. package/dist/types/classes/ApiRequestService.d.ts +18 -18
  6. package/dist/types/classes/ApiResponseProcessor.d.ts +29 -29
  7. package/dist/types/classes/CacheSyncer.d.ts +36 -36
  8. package/dist/types/classes/ChangesCompilation.d.ts +33 -33
  9. package/dist/types/classes/ChangesDelta.d.ts +61 -61
  10. package/dist/types/classes/ChangesDeltaBase.d.ts +76 -76
  11. package/dist/types/classes/ChangesProcessor.d.ts +40 -40
  12. package/dist/types/classes/CollectionEntryService.d.ts +23 -23
  13. package/dist/types/classes/CollectionResourceService.d.ts +6 -6
  14. package/dist/types/classes/ColumnCache.d.ts +21 -21
  15. package/dist/types/classes/ColumnExpansion.d.ts +21 -21
  16. package/dist/types/classes/ColumnHandler.d.ts +20 -20
  17. package/dist/types/classes/ColumnInfo.d.ts +14 -14
  18. package/dist/types/classes/ColumnSet.d.ts +37 -37
  19. package/dist/types/classes/ColumnSubsetCache.d.ts +14 -14
  20. package/dist/types/classes/ColumnUtil.d.ts +100 -100
  21. package/dist/types/classes/ConversionMapService.d.ts +25 -25
  22. package/dist/types/classes/CreateRequest.d.ts +17 -17
  23. package/dist/types/classes/CreatedChangesDelta.d.ts +17 -17
  24. package/dist/types/classes/InternalChangesDelta.d.ts +47 -47
  25. package/dist/types/classes/ItemCache.d.ts +27 -27
  26. package/dist/types/classes/ItemCreateService.d.ts +18 -18
  27. package/dist/types/classes/ItemEntryService.d.ts +32 -32
  28. package/dist/types/classes/KeyService.d.ts +18 -18
  29. package/dist/types/classes/LockService.d.ts +29 -29
  30. package/dist/types/classes/ModuleChangesCompilation.d.ts +18 -18
  31. package/dist/types/classes/ParentChangesDelta.d.ts +39 -39
  32. package/dist/types/classes/QueryColumnExtractor.d.ts +18 -18
  33. package/dist/types/classes/QueryContainsLocalIdParser.d.ts +15 -15
  34. package/dist/types/classes/QueryLinkedToParser.d.ts +15 -15
  35. package/dist/types/classes/QueryLocallyMatchableParser.d.ts +18 -18
  36. package/dist/types/classes/QueryMatcher.d.ts +18 -18
  37. package/dist/types/classes/QueryParser.d.ts +25 -25
  38. package/dist/types/classes/QueryParserBase.d.ts +20 -20
  39. package/dist/types/classes/QueryParserIdUpdater.d.ts +15 -15
  40. package/dist/types/classes/QueryService.d.ts +12 -12
  41. package/dist/types/classes/RequestBuffer.d.ts +24 -24
  42. package/dist/types/classes/RequestBufferManager.d.ts +20 -20
  43. package/dist/types/classes/RequestColumnExpansion.d.ts +15 -15
  44. package/dist/types/classes/SocketMessageHandler.d.ts +34 -34
  45. package/dist/types/classes/TemplateCache.d.ts +62 -63
  46. package/dist/types/classes/Util.d.ts +28 -28
  47. package/dist/types/classes/cache/AbstractCache.d.ts +95 -95
  48. package/dist/types/classes/cache/CachedQueryHandlerBase.d.ts +68 -68
  49. package/dist/types/classes/cache/ItemHandlerBase.d.ts +95 -95
  50. package/dist/types/classes/cache/server/ServerCache.d.ts +82 -82
  51. package/dist/types/classes/cache/server/ServerCachedQueryHandler.d.ts +25 -25
  52. package/dist/types/classes/cache/server/ServerItemHandler.d.ts +44 -44
  53. package/dist/types/classes/cache/transaction/TransactionCache.d.ts +319 -319
  54. package/dist/types/classes/cache/transaction/TransactionCachedQueryHandler.d.ts +31 -31
  55. package/dist/types/classes/cache/transaction/TransactionCollectionHandler.d.ts +24 -24
  56. package/dist/types/classes/cache/transaction/TransactionEventHandler.d.ts +21 -21
  57. package/dist/types/classes/cache/transaction/TransactionItemHandler.d.ts +89 -89
  58. package/dist/types/classes/cache/transaction/TransactionValidator.d.ts +33 -33
  59. package/dist/types/constants.d.ts +7 -7
  60. package/dist/types/core.d.ts +45 -45
  61. package/dist/types/factories/ApiResponseProcessorFactory.d.ts +6 -6
  62. package/dist/types/factories/CacheSyncerFactory.d.ts +10 -10
  63. package/dist/types/factories/ChangesCompilationFactory.d.ts +5 -5
  64. package/dist/types/factories/ChangesDeltaFactory.d.ts +13 -13
  65. package/dist/types/factories/ChangesProcessorFactory.d.ts +13 -13
  66. package/dist/types/factories/CollectionEntryFactory.d.ts +11 -11
  67. package/dist/types/factories/CollectionResourceFactory.d.ts +18 -18
  68. package/dist/types/factories/ColumnExpansionFactory.d.ts +7 -7
  69. package/dist/types/factories/ColumnInfoFactory.d.ts +7 -7
  70. package/dist/types/factories/ColumnSetFactory.d.ts +18 -18
  71. package/dist/types/factories/ColumnSubsetCacheFactory.d.ts +8 -8
  72. package/dist/types/factories/CreateRequestFactory.d.ts +9 -9
  73. package/dist/types/factories/ItemCacheFactory.d.ts +6 -6
  74. package/dist/types/factories/ItemEntryFactory.d.ts +12 -12
  75. package/dist/types/factories/ItemResourceFactory.d.ts +11 -11
  76. package/dist/types/factories/ModuleChangesCompilationFactory.d.ts +4 -4
  77. package/dist/types/factories/QueryMatcherFactory.d.ts +7 -7
  78. package/dist/types/factories/QueryParserFactory.d.ts +5 -5
  79. package/dist/types/factories/RequestColumnExpansionFactory.d.ts +8 -8
  80. package/dist/types/factories/TemplateFactory.d.ts +8 -8
  81. package/dist/types/factories/TransactionCacheFactory.d.ts +13 -13
  82. package/dist/types/index.d.ts +1 -1
  83. package/dist/types/interfaces/AbstractCacheDependencyInterface.d.ts +36 -36
  84. package/dist/types/interfaces/ApiRequestServiceInterface.d.ts +12 -12
  85. package/dist/types/interfaces/AuthInterface.d.ts +10 -10
  86. package/dist/types/interfaces/ErrorHandlerInterface.d.ts +5 -5
  87. package/dist/types/interfaces/ExceptionHandlerInterface.d.ts +3 -3
  88. package/dist/types/interfaces/LinkTreeServiceInterface.d.ts +4 -4
  89. package/dist/types/interfaces/PromiseLibraryInterface.d.ts +25 -25
  90. package/dist/types/interfaces/ServerCacheDependencyInterface.d.ts +5 -5
  91. package/dist/types/interfaces/SocketMessageInterface.d.ts +3 -3
  92. package/dist/types/interfaces/TransactionCollectionHandlerDependencyInterface.d.ts +17 -17
  93. package/dist/types/interfaces/TransactionItemHandlerDependencyInterface.d.ts +22 -22
  94. package/dist/types/internal.d.ts +104 -104
  95. package/dist/types/models/CachedQueryItem.d.ts +19 -19
  96. package/dist/types/models/CollectionEntry.d.ts +21 -21
  97. package/dist/types/models/CollectionOptions.d.ts +42 -42
  98. package/dist/types/models/CollectionResource.d.ts +87 -87
  99. package/dist/types/models/ItemEntry.d.ts +18 -18
  100. package/dist/types/models/ItemEntryOptions.d.ts +8 -8
  101. package/dist/types/models/ItemResource.d.ts +90 -90
  102. package/dist/types/models/Template.d.ts +11 -11
  103. package/dist/types/types/ItemTypesCollection.d.ts +343 -343
  104. package/dist/types/types/PromiseInterface.d.ts +2 -2
  105. package/package.json +48 -48
  106. package/readme.md +15 -15
@@ -1,319 +1,319 @@
1
- import { ApiEnumItemType, ApiFields, ItemId } from '@rentman/backend-types';
2
- import { AbstractCache, AbstractCacheDependencyInterface, ApiQuery, ApiRequestColumn, ApiRequestColumns, CachedQueryItem, CachedQueryItemTree, ChangesDelta, ChangesDeltaResult, ChildCollectionOptions, ChildCollectionResources, ChildCollectionResourcesNull, CollectionDefinition, CollectionOptionsInterface, CollectionQuery, CollectionResource, CollectionResourceParentIdMap, ConversionMap, CreateRequestParameterMap, DeregFunction, EntryParentNull, FieldChangeCallback, FieldMap, InternalChangesDelta, ItemEntry, ItemEntryOptions, ItemIdConversionMap, ItemOptionsInterface, ItemResource, ItemResourcesItemTypeMap, ItemTypeMap, LinkCollectionDefinition, ModuleChangesCompilationResult, OnAfterCreateCallback, ParentChangesDelta, ParentItemMap, PromiseInterface, RmCore, ServerCache, TransactionCacheCallbackCondition, TransactionCacheCallbackType, TransactionCachedQueryHandler, TransactionCollectionHandler, TransactionEventHandler, TransactionItemEntryChanges, TransactionItemHandler, TransactionOptions, TransactionValidatorFactory } from '../../../internal';
3
- declare type ItemResourceLinks<ItemTypeType extends ApiEnumItemType> = {
4
- main: ItemResource<ItemTypeType>;
5
- linked: ItemResourcesItemTypeMap;
6
- };
7
- export declare enum TransactionErrorLevel {
8
- warning = "warning",
9
- error = "error"
10
- }
11
- export declare type UndoFunction = () => PromiseInterface<ChangesDeltaResult>;
12
- /**
13
- * @description
14
- * The {@link TransactionCache TransactionCache} is responsible for keeping track of newly created {@link ItemEntry ItemEntries}
15
- * and {@link CollectionEntry CollectionEntries}, and the changes of existing ItemEntries and CollectionEntries.
16
- *
17
- * The TransactionCache is also responsible for creating {@link ItemResource ItemResources}, which is a combination of an {@link ItemEntry ItemEntry} and the current transaction's changes on this ItemEntry
18
- */
19
- export declare class TransactionCache extends AbstractCache {
20
- /**
21
- * @description
22
- * For debugging purposes
23
- */
24
- id?: string | undefined;
25
- /**
26
- * @description
27
- * A map of all item errors, can be populated using {@link TransactionValidator.setGlobalError TransactionValidator.setGlobalError} and {@link TransactionValidator.setItemError TransactionValidator.setItemError}.
28
- * Contains a translation and level for every error
29
- */
30
- errors: {
31
- item: {
32
- [itemEntryId: string]: {
33
- [columnId: string]: {
34
- [errorKey: string]: {
35
- fieldString: string;
36
- string: string;
37
- level: TransactionErrorLevel;
38
- };
39
- };
40
- };
41
- };
42
- global: {
43
- [key: string]: {
44
- string: string;
45
- level: TransactionErrorLevel;
46
- };
47
- };
48
- };
49
- get isValid(): boolean;
50
- /**
51
- * @description
52
- * Stores the 'root' {@link ItemEntry ItemEntry}, this {@link ItemEntry ItemEntry} can be used as request parent to store the whole transaction at once
53
- */
54
- rootItem: ItemEntry | undefined;
55
- /**
56
- * @description
57
- * Stores additional request parameters for when the transaction is stored to the server
58
- */
59
- tabRequestParameters: {};
60
- /**
61
- * @description
62
- * Is true while the {@link TransactionCache TransactionCache} is applying changes to the parent (can either be through a merge or an Api save)
63
- */
64
- isSaving: boolean;
65
- /**
66
- * @description
67
- * Is true when the current transaction has:
68
- * - Newly created items
69
- * - Removed items (from collections)
70
- * - Changes on existing items
71
- */
72
- hasChanges: boolean;
73
- /**
74
- * @description
75
- * The transaction's parent
76
- */
77
- readonly parent: AbstractCache;
78
- readonly itemHandler: TransactionItemHandler;
79
- readonly cachedQueryHandler: TransactionCachedQueryHandler;
80
- readonly collectionHandler: TransactionCollectionHandler;
81
- readonly eventHandler: TransactionEventHandler;
82
- private readonly validator?;
83
- private readonly options;
84
- private _isValid;
85
- private historyStep;
86
- private undoDeltas;
87
- private appliedDeltas;
88
- constructor(dependencies: AbstractCacheDependencyInterface, core: RmCore, parent: AbstractCache,
89
- /**
90
- * @description
91
- * For debugging purposes
92
- */
93
- id?: string | undefined, validatorFactory?: TransactionValidatorFactory, options?: Partial<TransactionOptions>);
94
- undo(): ReturnType<UndoFunction>;
95
- redo(): ReturnType<TransactionCache['applyChangesDelta']>;
96
- createChild(id?: string, validatorFactory?: TransactionValidatorFactory, options?: TransactionOptions): TransactionCache;
97
- destroy(): void;
98
- expandCollectionResource(collectionResource: CollectionResource, newColumns: ApiRequestColumns): PromiseInterface<void>;
99
- /**
100
- * @description
101
- * Expands the collection with the new request columns, assumes that all collections have the same itemType
102
- */
103
- expandCollectionResources<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, collections: CollectionResourceParentIdMap<ItemTypeType>, newColumns: ApiRequestColumn[]): PromiseInterface<CollectionResourceParentIdMap>;
104
- registerFieldChangeCallback<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, itemId: ItemId, callback: FieldChangeCallback<ItemTypeType>): DeregFunction;
105
- createChangesDelta(): ChangesDelta;
106
- getFirstErrorString(): undefined | string;
107
- /**
108
- * @description
109
- * Should only be called by {@link TransactionValidator TransactionValidator}
110
- * @internal
111
- */
112
- _setGlobalError(key: string, isInvalid: boolean, saveButtonErrorTranslationFn: () => string, level: TransactionErrorLevel): void;
113
- /**
114
- * @description
115
- * Should only be called by {@link TransactionValidator TransactionValidator}
116
- * @internal
117
- */
118
- _setItemError(itemEntryId: ItemEntry['id'], columnId: string, errorKey: string, isInvalid: boolean, fieldErrorTranslationFn: () => string, saveButtonErrorTranslationFn: () => string, level: TransactionErrorLevel): void;
119
- /**
120
- * @internal
121
- */
122
- _setIsValid(): void;
123
- /**
124
- * @description
125
- * Merges the passed changes from the parent Transaction into this Transaction's own changes and then propagates
126
- * them to all child Transactions, this assumes that an action is already handled in a parent, so it does't handle created entries
127
- * and removes entries that were in {@link TransactionItemHandler.deletedItems deletedItems} since they are already deleted
128
- *
129
- * ------------------
130
- *
131
- * The difference between {@link TransactionCache.applyChangesFromParent} and {@link TransactionCache.applyChangesDelta} is that applyChangesFromParent assumes
132
- * the change has already been processed, and applyChangesDelta will process the changes once you save the transaction
133
- *
134
- * ------------------
135
- * Use {@link TransactionCache.applyChangesDelta applyChangesDelta} if you want to apply changes from outside the core
136
- */
137
- applyChangesFromParent(parentChangesDelta: ParentChangesDelta, isCalledAfterSocketUpdate?: boolean, conversionMap?: ItemIdConversionMap): PromiseInterface<void>;
138
- /**
139
- * @description
140
- * Applies changes to this transaction and its children
141
- *
142
- * ------------------
143
- *
144
- * The difference between {@link TransactionCache.applyChangesFromParent} and {@link TransactionCache.applyChangesDelta} is that applyChangesFromParent assumes
145
- * the change has already been processed, and applyChangesDelta will process the changes itself (result vs cause)
146
- */
147
- applyChangesDelta(changesDelta: ChangesDelta | InternalChangesDelta): PromiseInterface<ChangesDeltaResult>;
148
- getServerCache(): ServerCache;
149
- /**
150
- * @description
151
- * Gets the entry's parent from the closest transaction
152
- *
153
- * @param itemEntry The entry to get the parent from
154
- * @param fromInitial If `true` the parent values will be read from {@link TransactionItemEntryChanges.initial initial} (Useful for when you've moved an entry)
155
- * @param providedFields Use the provided fields instead of the cached fields, used by {@link CollectionResource.getParent CollectionResource.getParent}
156
- *
157
- * @remark
158
- * Use {@link CollectionResource.getParent CollectionResource.getParent} instead of {@link TransactionCache.getParent TransactionCache.getParent} if you're getting the parent in the onRemove callback
159
- */
160
- getParent<ItemTypeType extends ApiEnumItemType = any>(itemEntry: ItemEntry<ItemTypeType>, fromInitial?: boolean, providedFields?: FieldMap<ItemTypeType>): EntryParentNull;
161
- getCollectionChangesRecursively<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, parsedQuery: CollectionQuery): CachedQueryItem<ItemTypeType> | undefined;
162
- /**
163
- * @description
164
- * Traverses the transaction chain and returns the changes of the item on the first transaction
165
- *
166
- * @param copyFields If set, will call {@link ApiFormatter.copyFields ApiFormatter.copyFields}, otherwise just returns the object
167
- */
168
- getItemChangesRecursively(itemEntryId: ItemEntry['id'], copyFields?: boolean): FieldMap;
169
- /**
170
- * @description
171
- * Removes the {@link CollectionResource CollectionResource} from the transaction, preventing the {@link CollectionResource.options.onAdd onAdd} and {@link CollectionResource.options.onRemove onRemove} callbacks from being called.
172
- * You should call this function when the resource is no longer needed
173
- *
174
- * @remark
175
- * Does not remove cached queries
176
- */
177
- clearCollectionResource(resource: CollectionResource): void;
178
- /**
179
- * @description
180
- * Returns whether or not the {@link TransactionCache.rootItem rootItem} is uses locks
181
- */
182
- isLockable(): boolean;
183
- /**
184
- * @description
185
- * Saves the transaction, this has a different effect depending on the transaction's parent.
186
- *
187
- * - If the parent is another {@link TransactionCache TransactionCache} it will merge the changes of the child transaction in the the parent transaction
188
- * - If the parent is the {@link ServerCache ServerCache} it will save the changes to the APi
189
- */
190
- save(closeTab?: boolean, parameters?: CreateRequestParameterMap, breakUpByParent?: boolean, onAfterCreateCallback?: OnAfterCreateCallback): PromiseInterface<void>;
191
- /**
192
- * Rejects when another user is holding the lock, as opposed to {@link LockService.fetchLock}.
193
- */
194
- fetchLock(): PromiseInterface<void>;
195
- detectChanges(force?: boolean): boolean;
196
- /**
197
- * @description
198
- * Removes an {@link ItemEntry ItemEntry} through an {@link ItemResource ItemResource} from the {@link TransactionCache TransactionCache} which means that changes on this entry will no longer be tracked.
199
- */
200
- clearItem(itemResource: ItemResource<any>): void;
201
- /**
202
- * @description
203
- * Removes an {@link ItemEntry ItemEntry} from the {@link TransactionCache TransactionCache} which means that changes on this entry will no longer be tracked.
204
- */
205
- clearItemEntry(itemEntry: ItemEntry<any>): void;
206
- /**
207
- * @description
208
- * Adds a callback that will fire before the transaction is saved, rejecting this callback will prevent the transaction from saving
209
- */
210
- onBeforeSave(key: string, callback: TransactionCacheCallbackType['onBeforeSave'], condition?: TransactionCacheCallbackCondition, priority?: number): () => void;
211
- /**
212
- * @description
213
- * Adds a callback that will fire when the transaction is saved successfully
214
- */
215
- onSaveSuccess(key: string, callback: TransactionCacheCallbackType['onSaveSuccess'], condition?: TransactionCacheCallbackCondition, priority?: number): () => void;
216
- /**
217
- * @description
218
- * Returns a {@link ModuleChangesCompilationResult ModuleChangesCompilationResult} for the transaction
219
- */
220
- getModuleChanges(): ModuleChangesCompilationResult;
221
- /**
222
- * @description
223
- * Updates the passed map with the new {@link ConversionMap CconversionMap} values
224
- */
225
- updateItemIdMap(collectionMap: {
226
- [itemId: number]: any;
227
- }, conversionMap: ConversionMap): void;
228
- getAllLinkCollections<ItemTypeType extends ApiEnumItemType>(linkType: ApiEnumItemType, itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType>): PromiseInterface<CollectionResourceParentIdMap<ItemTypeType>>;
229
- getLinkCollectionsFromDef<ItemTypeType extends ApiEnumItemType>(linkType: ApiEnumItemType, linkIdArray: ItemId[], definition: LinkCollectionDefinition<ItemTypeType>): PromiseInterface<CollectionResourceParentIdMap<ItemTypeType>>;
230
- /**
231
- * @deprecated Use the `children` collection option instead.
232
- */
233
- getLinkCollections<ItemTypeType extends ApiEnumItemType>(linkType: ApiEnumItemType, linkIdArray: ItemId[], itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType>): PromiseInterface<CollectionResourceParentIdMap<ItemTypeType>>;
234
- getCollectionFromDef<ItemTypeType extends ApiEnumItemType>(definition: CollectionDefinition<ItemTypeType>): PromiseInterface<CollectionResource<ItemTypeType>>;
235
- getCollection<ItemTypeType extends ApiEnumItemType, ColumnIds extends Array<keyof ApiFields[ItemTypeType]> = Array<keyof ApiFields[ItemTypeType]>>(itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType>): PromiseInterface<CollectionResource<ItemTypeType, ColumnIds>>;
236
- getCollectionDef<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType>): CollectionDefinition<ItemTypeType>;
237
- getLinkCollectionsDef<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, linkField: string, options: CollectionOptionsInterface<ItemTypeType>): LinkCollectionDefinition<ItemTypeType>;
238
- /**
239
- * @deprecated
240
- * Use getItemById/getNewResourceWithId
241
- *
242
- * @remarks
243
- * stateKey can be a keyword or a local id (in case of a refresh)
244
- */
245
- getItemByState<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, stateKey: ItemId | string, options?: ItemOptionsInterface, isRoot?: boolean): PromiseInterface<ItemResource<ItemTypeType>>;
246
- getDuplicateById<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, duplicateId: ItemId, options: ItemOptionsInterface, returnLinks: true, isRoot?: boolean): PromiseInterface<ItemResourceLinks<ItemTypeType>>;
247
- getDuplicateById<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, duplicateId: ItemId, options: ItemOptionsInterface, returnLinks?: boolean, isRoot?: boolean): PromiseInterface<ItemResource<ItemTypeType>>;
248
- getNewResourceWithId<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, itemId: ItemId, options: Partial<ItemEntryOptions>, returnLinks: true, isRoot?: boolean): PromiseInterface<ItemResourceLinks<ItemTypeType>>;
249
- getNewResourceWithId<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, itemId: ItemId, options: Partial<ItemEntryOptions>, returnLinks?: boolean, isRoot?: boolean): PromiseInterface<ItemResource<ItemTypeType>>;
250
- getNewResource<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, options: ItemOptionsInterface, returnLinks: true, isRoot?: boolean): PromiseInterface<ItemResourceLinks<ItemTypeType>>;
251
- getNewResource<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, options: ItemOptionsInterface, returnLinks?: boolean, isRoot?: boolean): PromiseInterface<ItemResource<ItemTypeType>>;
252
- /**
253
- * @description
254
- * Fetches multiple items with their respective changes of the current {@link TransactionCache transaction}
255
- */
256
- getItemsByQuery<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, query: ApiQuery, options?: Partial<ItemEntryOptions>): PromiseInterface<Array<ItemResource<ItemTypeType>>>;
257
- /**
258
- * @description
259
- * Fetches multiple items with their respective changes of the current {@link TransactionCache transaction}
260
- */
261
- getItemsById<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, itemIds: ItemId[], options?: Partial<ItemEntryOptions>): PromiseInterface<Array<ItemResource<ItemTypeType>>>;
262
- /**
263
- * @description
264
- * Fetches the item with the changes of the current {@link TransactionCache transaction}
265
- *
266
- * @param isRoot Sets the item as the root item of the transaction, new items will be linked to this item (if there's a connection in the LinkTree)
267
- */
268
- getItemById<ItemTypeType extends ApiEnumItemType, ColumnIds extends Array<keyof ApiFields[ItemTypeType]> = Array<keyof ApiFields[ItemTypeType]>>(itemType: ItemTypeType, itemId: ItemId, options?: Partial<ItemEntryOptions>, isRoot?: boolean): PromiseInterface<ItemResource<ItemTypeType, ColumnIds>>;
269
- /**
270
- * @description
271
- * Fetches the title of an item, does not create an {@link ItemResource ItemResource}
272
- */
273
- fetchTitle(itemType: ApiEnumItemType, itemId: ItemId): PromiseInterface<string>;
274
- /**
275
- * @description
276
- * Merges the passed child Transaction into this transaction and then propagates them to the other child transactions
277
- */
278
- applyChangesFromChild(childTransaction: TransactionCache, _breakUpByParent?: boolean, _onAfterCreateCallback?: OnAfterCreateCallback): PromiseInterface<ItemIdConversionMap>;
279
- /**
280
- * @description
281
- * Gets an already cached {@link ItemEntry ItemEntry} and the changes of this specific transaction for that entry
282
- */
283
- getLocalItemEntryChangesTuple(itemEntryId: ItemEntry['id']): {
284
- entry: ItemEntry;
285
- changes: TransactionItemEntryChanges;
286
- };
287
- /**
288
- * @description
289
- * Gets an ItemEntry from the cache, doesn't do a API request, used for saving
290
- */
291
- getLocalItemEntry(itemEntryId: ItemEntry['id']): ItemEntry | undefined;
292
- /**
293
- * @description
294
- * Gets an ItemEntry from the cache by ItemId
295
- */
296
- getLocalItemEntryByItemId(itemType: ApiEnumItemType, itemId: ItemEntry['itemId']): ItemEntry | undefined;
297
- /**
298
- * @description
299
- * Returns the complete {@link InternalChangesDelta InternalChangesDelta} of the TransactionCache, this only takes into account the end result (initial is compared to changes), so changing something and reverting it
300
- * won't be included
301
- */
302
- getDelta(): InternalChangesDelta;
303
- createItemResource<ItemTypeType extends ApiEnumItemType>(itemEntry: ItemEntry<ItemTypeType>, childCollectionMap?: ChildCollectionResourcesNull, isNew?: boolean): ItemResource<ItemTypeType>;
304
- createItemResources<ItemTypeType extends ApiEnumItemType, ColumnIds extends Array<keyof ApiFields[ItemTypeType]>>(itemEntries: Array<ItemEntry<ItemTypeType>>, childCollectionResourceMap?: ChildCollectionResourcesNull): Array<ItemResource<ItemTypeType, ColumnIds>>;
305
- processLinkedItems<ItemTypeType extends ApiEnumItemType>(linkedEntries: ItemTypeMap<ItemEntry[]>): ItemResourcesItemTypeMap<ItemResource<ItemTypeType>>;
306
- createCollectionResource<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType>, initialEntries: Array<ItemEntry<ItemTypeType>>, childCollectionResourceMap?: ParentItemMap<CollectionResource> | null): CollectionResource<ItemTypeType>;
307
- createChildCollectionResources(parentType: ApiEnumItemType, options: ChildCollectionOptions, cachedQueryItems: ParentItemMap<CachedQueryItemTree>): ChildCollectionResources;
308
- private createChildCollectionResource;
309
- getChangesFromItemChanges<ItemTypeType extends ApiEnumItemType = any>(changesObject: TransactionItemEntryChanges<FieldMap<ItemTypeType>>): FieldMap<ItemTypeType>;
310
- /**
311
- * @description
312
- * Fetches all required columns to match/fit in collections
313
- */
314
- private expandItemsFromDelta;
315
- private clearGlobalError;
316
- clearItemError(itemEntryId?: ItemEntry['id'], columnId?: string, errorKey?: string): void;
317
- private handleRemovedItemEntry;
318
- }
319
- export {};
1
+ import { ApiEnumItemType, ApiFields, ItemId } from '@rentman/backend-types';
2
+ import { AbstractCache, AbstractCacheDependencyInterface, ApiQuery, ApiRequestColumn, ApiRequestColumns, CachedQueryItem, CachedQueryItemTree, ChangesDelta, ChangesDeltaResult, ChildCollectionOptions, ChildCollectionResources, ChildCollectionResourcesNull, CollectionDefinition, CollectionOptionsInterface, CollectionQuery, CollectionResource, CollectionResourceParentIdMap, ConversionMap, CreateRequestParameterMap, DeregFunction, EntryParentNull, FieldChangeCallback, FieldMap, InternalChangesDelta, ItemEntry, ItemEntryOptions, ItemIdConversionMap, ItemOptionsInterface, ItemResource, ItemResourcesItemTypeMap, ItemTypeMap, LinkCollectionDefinition, ModuleChangesCompilationResult, OnAfterCreateCallback, ParentChangesDelta, ParentItemMap, PromiseInterface, RmCore, ServerCache, TransactionCacheCallbackCondition, TransactionCacheCallbackType, TransactionCachedQueryHandler, TransactionCollectionHandler, TransactionEventHandler, TransactionItemEntryChanges, TransactionItemHandler, TransactionOptions, TransactionValidatorFactory } from '../../../internal';
3
+ declare type ItemResourceLinks<ItemTypeType extends ApiEnumItemType> = {
4
+ main: ItemResource<ItemTypeType>;
5
+ linked: ItemResourcesItemTypeMap;
6
+ };
7
+ export declare enum TransactionErrorLevel {
8
+ warning = "warning",
9
+ error = "error"
10
+ }
11
+ export declare type UndoFunction = () => PromiseInterface<ChangesDeltaResult>;
12
+ /**
13
+ * @description
14
+ * The {@link TransactionCache TransactionCache} is responsible for keeping track of newly created {@link ItemEntry ItemEntries}
15
+ * and {@link CollectionEntry CollectionEntries}, and the changes of existing ItemEntries and CollectionEntries.
16
+ *
17
+ * The TransactionCache is also responsible for creating {@link ItemResource ItemResources}, which is a combination of an {@link ItemEntry ItemEntry} and the current transaction's changes on this ItemEntry
18
+ */
19
+ export declare class TransactionCache extends AbstractCache {
20
+ /**
21
+ * @description
22
+ * For debugging purposes
23
+ */
24
+ id?: string | undefined;
25
+ /**
26
+ * @description
27
+ * A map of all item errors, can be populated using {@link TransactionValidator.setGlobalError TransactionValidator.setGlobalError} and {@link TransactionValidator.setItemError TransactionValidator.setItemError}.
28
+ * Contains a translation and level for every error
29
+ */
30
+ errors: {
31
+ item: {
32
+ [itemEntryId: string]: {
33
+ [columnId: string]: {
34
+ [errorKey: string]: {
35
+ fieldString: string;
36
+ string: string;
37
+ level: TransactionErrorLevel;
38
+ };
39
+ };
40
+ };
41
+ };
42
+ global: {
43
+ [key: string]: {
44
+ string: string;
45
+ level: TransactionErrorLevel;
46
+ };
47
+ };
48
+ };
49
+ get isValid(): boolean;
50
+ /**
51
+ * @description
52
+ * Stores the 'root' {@link ItemEntry ItemEntry}, this {@link ItemEntry ItemEntry} can be used as request parent to store the whole transaction at once
53
+ */
54
+ rootItem: ItemEntry | undefined;
55
+ /**
56
+ * @description
57
+ * Stores additional request parameters for when the transaction is stored to the server
58
+ */
59
+ tabRequestParameters: {};
60
+ /**
61
+ * @description
62
+ * Is true while the {@link TransactionCache TransactionCache} is applying changes to the parent (can either be through a merge or an Api save)
63
+ */
64
+ isSaving: boolean;
65
+ /**
66
+ * @description
67
+ * Is true when the current transaction has:
68
+ * - Newly created items
69
+ * - Removed items (from collections)
70
+ * - Changes on existing items
71
+ */
72
+ hasChanges: boolean;
73
+ /**
74
+ * @description
75
+ * The transaction's parent
76
+ */
77
+ readonly parent: AbstractCache;
78
+ readonly itemHandler: TransactionItemHandler;
79
+ readonly cachedQueryHandler: TransactionCachedQueryHandler;
80
+ readonly collectionHandler: TransactionCollectionHandler;
81
+ readonly eventHandler: TransactionEventHandler;
82
+ private readonly validator?;
83
+ private readonly options;
84
+ private _isValid;
85
+ private historyStep;
86
+ private undoDeltas;
87
+ private appliedDeltas;
88
+ constructor(dependencies: AbstractCacheDependencyInterface, core: RmCore, parent: AbstractCache,
89
+ /**
90
+ * @description
91
+ * For debugging purposes
92
+ */
93
+ id?: string | undefined, validatorFactory?: TransactionValidatorFactory, options?: Partial<TransactionOptions>);
94
+ undo(): ReturnType<UndoFunction>;
95
+ redo(): ReturnType<TransactionCache['applyChangesDelta']>;
96
+ createChild(id?: string, validatorFactory?: TransactionValidatorFactory, options?: TransactionOptions): TransactionCache;
97
+ destroy(): void;
98
+ expandCollectionResource(collectionResource: CollectionResource, newColumns: ApiRequestColumns): PromiseInterface<void>;
99
+ /**
100
+ * @description
101
+ * Expands the collection with the new request columns, assumes that all collections have the same itemType
102
+ */
103
+ expandCollectionResources<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, collections: CollectionResourceParentIdMap<ItemTypeType>, newColumns: ApiRequestColumn[]): PromiseInterface<CollectionResourceParentIdMap>;
104
+ registerFieldChangeCallback<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, itemId: ItemId, callback: FieldChangeCallback<ItemTypeType>): DeregFunction;
105
+ createChangesDelta(): ChangesDelta;
106
+ getFirstErrorString(): undefined | string;
107
+ /**
108
+ * @description
109
+ * Should only be called by {@link TransactionValidator TransactionValidator}
110
+ * @internal
111
+ */
112
+ _setGlobalError(key: string, isInvalid: boolean, saveButtonErrorTranslationFn: () => string, level: TransactionErrorLevel): void;
113
+ /**
114
+ * @description
115
+ * Should only be called by {@link TransactionValidator TransactionValidator}
116
+ * @internal
117
+ */
118
+ _setItemError(itemEntryId: ItemEntry['id'], columnId: string, errorKey: string, isInvalid: boolean, fieldErrorTranslationFn: () => string, saveButtonErrorTranslationFn: () => string, level: TransactionErrorLevel): void;
119
+ /**
120
+ * @internal
121
+ */
122
+ _setIsValid(): void;
123
+ /**
124
+ * @description
125
+ * Merges the passed changes from the parent Transaction into this Transaction's own changes and then propagates
126
+ * them to all child Transactions, this assumes that an action is already handled in a parent, so it does't handle created entries
127
+ * and removes entries that were in {@link TransactionItemHandler.deletedItems deletedItems} since they are already deleted
128
+ *
129
+ * ------------------
130
+ *
131
+ * The difference between {@link TransactionCache.applyChangesFromParent} and {@link TransactionCache.applyChangesDelta} is that applyChangesFromParent assumes
132
+ * the change has already been processed, and applyChangesDelta will process the changes once you save the transaction
133
+ *
134
+ * ------------------
135
+ * Use {@link TransactionCache.applyChangesDelta applyChangesDelta} if you want to apply changes from outside the core
136
+ */
137
+ applyChangesFromParent(parentChangesDelta: ParentChangesDelta, isCalledAfterSocketUpdate?: boolean, conversionMap?: ItemIdConversionMap): PromiseInterface<void>;
138
+ /**
139
+ * @description
140
+ * Applies changes to this transaction and its children
141
+ *
142
+ * ------------------
143
+ *
144
+ * The difference between {@link TransactionCache.applyChangesFromParent} and {@link TransactionCache.applyChangesDelta} is that applyChangesFromParent assumes
145
+ * the change has already been processed, and applyChangesDelta will process the changes itself (result vs cause)
146
+ */
147
+ applyChangesDelta(changesDelta: ChangesDelta | InternalChangesDelta): PromiseInterface<ChangesDeltaResult>;
148
+ getServerCache(): ServerCache;
149
+ /**
150
+ * @description
151
+ * Gets the entry's parent from the closest transaction
152
+ *
153
+ * @param itemEntry The entry to get the parent from
154
+ * @param fromInitial If `true` the parent values will be read from {@link TransactionItemEntryChanges.initial initial} (Useful for when you've moved an entry)
155
+ * @param providedFields Use the provided fields instead of the cached fields, used by {@link CollectionResource.getParent CollectionResource.getParent}
156
+ *
157
+ * @remark
158
+ * Use {@link CollectionResource.getParent CollectionResource.getParent} instead of {@link TransactionCache.getParent TransactionCache.getParent} if you're getting the parent in the onRemove callback
159
+ */
160
+ getParent<ItemTypeType extends ApiEnumItemType = any>(itemEntry: ItemEntry<ItemTypeType>, fromInitial?: boolean, providedFields?: FieldMap<ItemTypeType>): EntryParentNull;
161
+ getCollectionChangesRecursively<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, parsedQuery: CollectionQuery): CachedQueryItem<ItemTypeType> | undefined;
162
+ /**
163
+ * @description
164
+ * Traverses the transaction chain and returns the changes of the item on the first transaction
165
+ *
166
+ * @param copyFields If set, will call {@link ApiFormatter.copyFields ApiFormatter.copyFields}, otherwise just returns the object
167
+ */
168
+ getItemChangesRecursively(itemEntryId: ItemEntry['id'], copyFields?: boolean): FieldMap;
169
+ /**
170
+ * @description
171
+ * Removes the {@link CollectionResource CollectionResource} from the transaction, preventing the {@link CollectionResource.options.onAdd onAdd} and {@link CollectionResource.options.onRemove onRemove} callbacks from being called.
172
+ * You should call this function when the resource is no longer needed
173
+ *
174
+ * @remark
175
+ * Does not remove cached queries
176
+ */
177
+ clearCollectionResource(resource: CollectionResource): void;
178
+ /**
179
+ * @description
180
+ * Returns whether or not the {@link TransactionCache.rootItem rootItem} is uses locks
181
+ */
182
+ isLockable(): boolean;
183
+ /**
184
+ * @description
185
+ * Saves the transaction, this has a different effect depending on the transaction's parent.
186
+ *
187
+ * - If the parent is another {@link TransactionCache TransactionCache} it will merge the changes of the child transaction in the the parent transaction
188
+ * - If the parent is the {@link ServerCache ServerCache} it will save the changes to the APi
189
+ */
190
+ save(closeTab?: boolean, parameters?: CreateRequestParameterMap, breakUpByParent?: boolean, onAfterCreateCallback?: OnAfterCreateCallback): PromiseInterface<void>;
191
+ /**
192
+ * Rejects when another user is holding the lock, as opposed to {@link LockService.fetchLock}.
193
+ */
194
+ fetchLock(): PromiseInterface<void>;
195
+ detectChanges(force?: boolean): boolean;
196
+ /**
197
+ * @description
198
+ * Removes an {@link ItemEntry ItemEntry} through an {@link ItemResource ItemResource} from the {@link TransactionCache TransactionCache} which means that changes on this entry will no longer be tracked.
199
+ */
200
+ clearItem(itemResource: ItemResource<any>): void;
201
+ /**
202
+ * @description
203
+ * Removes an {@link ItemEntry ItemEntry} from the {@link TransactionCache TransactionCache} which means that changes on this entry will no longer be tracked.
204
+ */
205
+ clearItemEntry(itemEntry: ItemEntry<any>): void;
206
+ /**
207
+ * @description
208
+ * Adds a callback that will fire before the transaction is saved, rejecting this callback will prevent the transaction from saving
209
+ */
210
+ onBeforeSave(key: string, callback: TransactionCacheCallbackType['onBeforeSave'], condition?: TransactionCacheCallbackCondition, priority?: number): () => void;
211
+ /**
212
+ * @description
213
+ * Adds a callback that will fire when the transaction is saved successfully
214
+ */
215
+ onSaveSuccess(key: string, callback: TransactionCacheCallbackType['onSaveSuccess'], condition?: TransactionCacheCallbackCondition, priority?: number): () => void;
216
+ /**
217
+ * @description
218
+ * Returns a {@link ModuleChangesCompilationResult ModuleChangesCompilationResult} for the transaction
219
+ */
220
+ getModuleChanges(): ModuleChangesCompilationResult;
221
+ /**
222
+ * @description
223
+ * Updates the passed map with the new {@link ConversionMap CconversionMap} values
224
+ */
225
+ updateItemIdMap(collectionMap: {
226
+ [itemId: number]: any;
227
+ }, conversionMap: ConversionMap): void;
228
+ getAllLinkCollections<ItemTypeType extends ApiEnumItemType>(linkType: ApiEnumItemType, itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType>): PromiseInterface<CollectionResourceParentIdMap<ItemTypeType>>;
229
+ getLinkCollectionsFromDef<ItemTypeType extends ApiEnumItemType>(linkType: ApiEnumItemType, linkIdArray: ItemId[], definition: LinkCollectionDefinition<ItemTypeType>): PromiseInterface<CollectionResourceParentIdMap<ItemTypeType>>;
230
+ /**
231
+ * @deprecated Use the `children` collection option instead.
232
+ */
233
+ getLinkCollections<ItemTypeType extends ApiEnumItemType>(linkType: ApiEnumItemType, linkIdArray: ItemId[], itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType>): PromiseInterface<CollectionResourceParentIdMap<ItemTypeType>>;
234
+ getCollectionFromDef<ItemTypeType extends ApiEnumItemType>(definition: CollectionDefinition<ItemTypeType>): PromiseInterface<CollectionResource<ItemTypeType>>;
235
+ getCollection<ItemTypeType extends ApiEnumItemType, ColumnIds extends Array<keyof ApiFields[ItemTypeType]> = Array<keyof ApiFields[ItemTypeType]>>(itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType>): PromiseInterface<CollectionResource<ItemTypeType, ColumnIds>>;
236
+ getCollectionDef<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType>): CollectionDefinition<ItemTypeType>;
237
+ getLinkCollectionsDef<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, linkField: string, options: CollectionOptionsInterface<ItemTypeType>): LinkCollectionDefinition<ItemTypeType>;
238
+ /**
239
+ * @deprecated
240
+ * Use getItemById/getNewResourceWithId
241
+ *
242
+ * @remarks
243
+ * stateKey can be a keyword or a local id (in case of a refresh)
244
+ */
245
+ getItemByState<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, stateKey: ItemId | string, options?: ItemOptionsInterface, isRoot?: boolean): PromiseInterface<ItemResource<ItemTypeType>>;
246
+ getDuplicateById<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, duplicateId: ItemId, options: ItemOptionsInterface, returnLinks: true, isRoot?: boolean): PromiseInterface<ItemResourceLinks<ItemTypeType>>;
247
+ getDuplicateById<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, duplicateId: ItemId, options: ItemOptionsInterface, returnLinks?: boolean, isRoot?: boolean): PromiseInterface<ItemResource<ItemTypeType>>;
248
+ getNewResourceWithId<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, itemId: ItemId, options: Partial<ItemEntryOptions>, returnLinks: true, isRoot?: boolean): PromiseInterface<ItemResourceLinks<ItemTypeType>>;
249
+ getNewResourceWithId<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, itemId: ItemId, options: Partial<ItemEntryOptions>, returnLinks?: boolean, isRoot?: boolean): PromiseInterface<ItemResource<ItemTypeType>>;
250
+ getNewResource<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, options: ItemOptionsInterface, returnLinks: true, isRoot?: boolean): PromiseInterface<ItemResourceLinks<ItemTypeType>>;
251
+ getNewResource<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, options: ItemOptionsInterface, returnLinks?: boolean, isRoot?: boolean): PromiseInterface<ItemResource<ItemTypeType>>;
252
+ /**
253
+ * @description
254
+ * Fetches multiple items with their respective changes of the current {@link TransactionCache transaction}
255
+ */
256
+ getItemsByQuery<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, query: ApiQuery, options?: Partial<ItemEntryOptions>): PromiseInterface<Array<ItemResource<ItemTypeType>>>;
257
+ /**
258
+ * @description
259
+ * Fetches multiple items with their respective changes of the current {@link TransactionCache transaction}
260
+ */
261
+ getItemsById<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, itemIds: ItemId[], options?: Partial<ItemEntryOptions>): PromiseInterface<Array<ItemResource<ItemTypeType>>>;
262
+ /**
263
+ * @description
264
+ * Fetches the item with the changes of the current {@link TransactionCache transaction}
265
+ *
266
+ * @param isRoot Sets the item as the root item of the transaction, new items will be linked to this item (if there's a connection in the LinkTree)
267
+ */
268
+ getItemById<ItemTypeType extends ApiEnumItemType, ColumnIds extends Array<keyof ApiFields[ItemTypeType]> = Array<keyof ApiFields[ItemTypeType]>>(itemType: ItemTypeType, itemId: ItemId, options?: Partial<ItemEntryOptions>, isRoot?: boolean): PromiseInterface<ItemResource<ItemTypeType, ColumnIds>>;
269
+ /**
270
+ * @description
271
+ * Fetches the title of an item, does not create an {@link ItemResource ItemResource}
272
+ */
273
+ fetchTitle(itemType: ApiEnumItemType, itemId: ItemId): PromiseInterface<string>;
274
+ /**
275
+ * @description
276
+ * Merges the passed child Transaction into this transaction and then propagates them to the other child transactions
277
+ */
278
+ applyChangesFromChild(childTransaction: TransactionCache, _breakUpByParent?: boolean, _onAfterCreateCallback?: OnAfterCreateCallback): PromiseInterface<ItemIdConversionMap>;
279
+ /**
280
+ * @description
281
+ * Gets an already cached {@link ItemEntry ItemEntry} and the changes of this specific transaction for that entry
282
+ */
283
+ getLocalItemEntryChangesTuple(itemEntryId: ItemEntry['id']): {
284
+ entry: ItemEntry;
285
+ changes: TransactionItemEntryChanges;
286
+ };
287
+ /**
288
+ * @description
289
+ * Gets an ItemEntry from the cache, doesn't do a API request, used for saving
290
+ */
291
+ getLocalItemEntry(itemEntryId: ItemEntry['id']): ItemEntry | undefined;
292
+ /**
293
+ * @description
294
+ * Gets an ItemEntry from the cache by ItemId
295
+ */
296
+ getLocalItemEntryByItemId(itemType: ApiEnumItemType, itemId: ItemEntry['itemId']): ItemEntry | undefined;
297
+ /**
298
+ * @description
299
+ * Returns the complete {@link InternalChangesDelta InternalChangesDelta} of the TransactionCache, this only takes into account the end result (initial is compared to changes), so changing something and reverting it
300
+ * won't be included
301
+ */
302
+ getDelta(): InternalChangesDelta;
303
+ createItemResource<ItemTypeType extends ApiEnumItemType>(itemEntry: ItemEntry<ItemTypeType>, childCollectionMap?: ChildCollectionResourcesNull, isNew?: boolean): ItemResource<ItemTypeType>;
304
+ createItemResources<ItemTypeType extends ApiEnumItemType, ColumnIds extends Array<keyof ApiFields[ItemTypeType]>>(itemEntries: Array<ItemEntry<ItemTypeType>>, childCollectionResourceMap?: ChildCollectionResourcesNull): Array<ItemResource<ItemTypeType, ColumnIds>>;
305
+ processLinkedItems<ItemTypeType extends ApiEnumItemType>(linkedEntries: ItemTypeMap<ItemEntry[]>): ItemResourcesItemTypeMap<ItemResource<ItemTypeType>>;
306
+ createCollectionResource<ItemTypeType extends ApiEnumItemType>(itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType>, initialEntries: Array<ItemEntry<ItemTypeType>>, childCollectionResourceMap?: ParentItemMap<CollectionResource> | null): CollectionResource<ItemTypeType>;
307
+ createChildCollectionResources(parentType: ApiEnumItemType, options: ChildCollectionOptions, cachedQueryItems: ParentItemMap<CachedQueryItemTree>): ChildCollectionResources;
308
+ private createChildCollectionResource;
309
+ getChangesFromItemChanges<ItemTypeType extends ApiEnumItemType = any>(changesObject: TransactionItemEntryChanges<FieldMap<ItemTypeType>>): FieldMap<ItemTypeType>;
310
+ /**
311
+ * @description
312
+ * Fetches all required columns to match/fit in collections
313
+ */
314
+ private expandItemsFromDelta;
315
+ private clearGlobalError;
316
+ clearItemError(itemEntryId?: ItemEntry['id'], columnId?: string, errorKey?: string): void;
317
+ private handleRemovedItemEntry;
318
+ }
319
+ export {};