@rentman/rm-core 2.0.9 → 2.0.11

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 (107) hide show
  1. package/changelog.md +595 -588
  2. package/dist/rm-core.js +9342 -9315
  3. package/dist/rm-core.min.js +1 -1
  4. package/dist/src/classes/ApiFormatter.d.ts +55 -55
  5. package/dist/src/classes/ApiRequestService.d.ts +20 -20
  6. package/dist/src/classes/ApiResponseProcessor.d.ts +29 -29
  7. package/dist/src/classes/ChangesCompilation.d.ts +34 -34
  8. package/dist/src/classes/ChangesDelta.d.ts +42 -42
  9. package/dist/src/classes/ChangesDeltaBase.d.ts +33 -33
  10. package/dist/src/classes/ChangesProcessor.d.ts +47 -47
  11. package/dist/src/classes/CollectionCache.d.ts +37 -37
  12. package/dist/src/classes/CollectionEntryService.d.ts +25 -25
  13. package/dist/src/classes/CollectionMatcher.d.ts +9 -9
  14. package/dist/src/classes/CollectionMatcherBase.d.ts +26 -26
  15. package/dist/src/classes/CollectionResourceService.d.ts +6 -6
  16. package/dist/src/classes/ColumnCache.d.ts +21 -21
  17. package/dist/src/classes/ColumnExpansion.d.ts +22 -22
  18. package/dist/src/classes/ColumnHandler.d.ts +21 -21
  19. package/dist/src/classes/ColumnInfo.d.ts +14 -14
  20. package/dist/src/classes/ColumnSet.d.ts +39 -39
  21. package/dist/src/classes/ColumnSubsetCache.d.ts +8 -8
  22. package/dist/src/classes/ColumnUtil.d.ts +99 -99
  23. package/dist/src/classes/CreateRequest.d.ts +19 -19
  24. package/dist/src/classes/InternalChangesDelta.d.ts +38 -38
  25. package/dist/src/classes/ItemCache.d.ts +29 -29
  26. package/dist/src/classes/ItemEntryService.d.ts +41 -41
  27. package/dist/src/classes/KeyService.d.ts +16 -16
  28. package/dist/src/classes/LockService.d.ts +32 -32
  29. package/dist/src/classes/ModuleChangesCompilation.d.ts +18 -18
  30. package/dist/src/classes/QueryColumnExtractor.d.ts +20 -20
  31. package/dist/src/classes/QueryMatcher.d.ts +14 -14
  32. package/dist/src/classes/QueryParser.d.ts +25 -25
  33. package/dist/src/classes/QueryParserBase.d.ts +29 -29
  34. package/dist/src/classes/QueryService.d.ts +14 -14
  35. package/dist/src/classes/RequestBuffer.d.ts +25 -25
  36. package/dist/src/classes/RequestBufferManager.d.ts +31 -31
  37. package/dist/src/classes/RequestColumnExpansion.d.ts +15 -15
  38. package/dist/src/classes/SocketMessageHandler.d.ts +31 -31
  39. package/dist/src/classes/TemplateCache.d.ts +63 -63
  40. package/dist/src/classes/Util.d.ts +28 -28
  41. package/dist/src/classes/cache/AbstractCache.d.ts +140 -135
  42. package/dist/src/classes/cache/CollectionHandlerBase.d.ts +64 -64
  43. package/dist/src/classes/cache/CollectionMatcherCacheProcessor.d.ts +26 -26
  44. package/dist/src/classes/cache/ItemHandlerBase.d.ts +95 -93
  45. package/dist/src/classes/cache/server/ServerCache.d.ts +98 -98
  46. package/dist/src/classes/cache/server/ServerCollectionHandler.d.ts +43 -43
  47. package/dist/src/classes/cache/server/ServerItemHandler.d.ts +50 -50
  48. package/dist/src/classes/cache/transaction/TransactionCache.d.ts +412 -417
  49. package/dist/src/classes/cache/transaction/TransactionCollectionHandler.d.ts +72 -72
  50. package/dist/src/classes/cache/transaction/TransactionEventHandler.d.ts +19 -19
  51. package/dist/src/classes/cache/transaction/TransactionItemHandler.d.ts +114 -114
  52. package/dist/src/classes/index.d.ts +41 -41
  53. package/dist/src/constants.d.ts +7 -7
  54. package/dist/src/core.d.ts +49 -49
  55. package/dist/src/factories/ApiResponseProcessorFactory.d.ts +6 -6
  56. package/dist/src/factories/ChangesCompilationFactory.d.ts +6 -6
  57. package/dist/src/factories/ChangesDeltaFactory.d.ts +9 -9
  58. package/dist/src/factories/ChangesProcessorFactory.d.ts +22 -22
  59. package/dist/src/factories/CollectionCacheFactory.d.ts +8 -8
  60. package/dist/src/factories/CollectionEntryFactory.d.ts +11 -11
  61. package/dist/src/factories/CollectionMatcherFactory.d.ts +9 -9
  62. package/dist/src/factories/CollectionResourceFactory.d.ts +34 -34
  63. package/dist/src/factories/ColumnExpansionFactory.d.ts +8 -8
  64. package/dist/src/factories/ColumnInfoFactory.d.ts +7 -7
  65. package/dist/src/factories/ColumnSetFactory.d.ts +19 -19
  66. package/dist/src/factories/ColumnSubsetCacheFactory.d.ts +6 -6
  67. package/dist/src/factories/CreateRequestFactory.d.ts +11 -11
  68. package/dist/src/factories/ItemCacheFactory.d.ts +8 -8
  69. package/dist/src/factories/ItemEntryFactory.d.ts +17 -17
  70. package/dist/src/factories/ItemResourceFactory.d.ts +32 -32
  71. package/dist/src/factories/ModuleChangesCompilationFactory.d.ts +5 -5
  72. package/dist/src/factories/QueryMatcherFactory.d.ts +7 -7
  73. package/dist/src/factories/QueryParserFactory.d.ts +6 -6
  74. package/dist/src/factories/RequestColumnExpansionFactory.d.ts +6 -6
  75. package/dist/src/factories/TemplateFactory.d.ts +10 -10
  76. package/dist/src/factories/TransactionCacheFactory.d.ts +55 -55
  77. package/dist/src/factories/index.d.ts +22 -22
  78. package/dist/src/index.d.ts +7 -7
  79. package/dist/src/interfaces/ApiRequestServiceInterface.d.ts +11 -11
  80. package/dist/src/interfaces/AuthInterface.d.ts +9 -9
  81. package/dist/src/interfaces/ErrorHandlerInterface.d.ts +5 -5
  82. package/dist/src/interfaces/ExceptionHandlerInterface.d.ts +3 -3
  83. package/dist/src/interfaces/LinkTreeServiceInterface.d.ts +4 -4
  84. package/dist/src/interfaces/PromiseLibraryInterface.d.ts +25 -25
  85. package/dist/src/interfaces/SocketMessageInterface.d.ts +3 -3
  86. package/dist/src/interfaces/index.d.ts +7 -7
  87. package/dist/src/models/CollectionEditResource.d.ts +17 -17
  88. package/dist/src/models/CollectionEntry.d.ts +27 -27
  89. package/dist/src/models/CollectionEntryOptions.d.ts +13 -13
  90. package/dist/src/models/CollectionResource.d.ts +52 -52
  91. package/dist/src/models/CollectionResourceOptions.d.ts +27 -27
  92. package/dist/src/models/CollectionViewResource.d.ts +7 -7
  93. package/dist/src/models/EditResource.d.ts +16 -16
  94. package/dist/src/models/ItemEntry.d.ts +19 -19
  95. package/dist/src/models/ItemEntryOptions.d.ts +9 -9
  96. package/dist/src/models/ItemResource.d.ts +87 -87
  97. package/dist/src/models/ItemResourceOptions.d.ts +9 -9
  98. package/dist/src/models/LocalViewResource.d.ts +7 -7
  99. package/dist/src/models/RemoteViewResource.d.ts +7 -7
  100. package/dist/src/models/Template.d.ts +11 -11
  101. package/dist/src/models/ViewResource.d.ts +8 -8
  102. package/dist/src/models/index.d.ts +15 -15
  103. package/dist/src/types/ItemTypesCollection.d.ts +262 -262
  104. package/dist/src/types/PromiseInterface.d.ts +2 -2
  105. package/dist/src/types/index.d.ts +2 -2
  106. package/package.json +36 -36
  107. package/readme.md +15 -15
@@ -1,417 +1,412 @@
1
- import { RmCore } from '../../../core';
2
- import { CollectionCacheFactory, CollectionEntryFactory, CollectionMatcherFactory, CollectionResourceFactory, ColumnExpansionFactory, ColumnSetFactory, ColumnSubsetCacheFactory, ItemCacheFactory, ItemEntryFactory, ItemResourceFactory, ModuleChangesCompilationFactory, QueryMatcherFactory, QueryParserFactory, RequestColumnExpansionFactory } from '../../../factories';
3
- import { ChangesDeltaFactory } from '../../../factories/ChangesDeltaFactory';
4
- import { AuthInterface, ErrorHandlerInterface, ExceptionHandlerInterface, PromiseLibraryInterface } from '../../../interfaces';
5
- import { LinkTreeServiceInterface } from '../../../interfaces/LinkTreeServiceInterface';
6
- import { CollectionEditResource, CollectionEntry, CollectionResource, CollectionResourceOptionsInterface, CollectionViewResource, EditResource, ItemEntry, ItemResource, LocalViewResource, RemoteViewResource } from '../../../models';
7
- import { ApiQuery, CollectionDefinition, CollectionOptionsInterface, CollectionResourceParentIdMap, ConversionMap, CreateRequestParameterMap, EntryParentNull, FieldMap, ItemId, ItemIdConversionMap, ItemOptionsInterface, ItemResourcesItemTypeMap, ItemType, ItemTypeMap, LinkCollectionDefinition, PromiseInterface } from '../../../types';
8
- import { ChangesDelta } from '../../ChangesDelta';
9
- import { ChangesDeltaResult } from '../../ChangesDeltaBase';
10
- import { CollectionEntryService } from '../../CollectionEntryService';
11
- import { ColumnHandler } from '../../ColumnHandler';
12
- import { ColumnUtil } from '../../ColumnUtil';
13
- import { ApiFormatter, ApiRequestService, ColumnCache, LockService, ModuleChangesCompilationResult, OnAfterCreateCallback, RequestBufferManager, TransactionCacheCallbackCondition, TransactionCacheCallbackType, TransactionCollectionHandler, TransactionItemEntryChanges, TransactionItemHandler } from '../../index';
14
- import { InternalChangesDelta } from '../../InternalChangesDelta';
15
- import { ItemEntryService } from '../../ItemEntryService';
16
- import { KeyService } from '../../KeyService';
17
- import { QueryService } from '../../QueryService';
18
- import { TemplateCache } from '../../TemplateCache';
19
- import { AbstractCache } from '../AbstractCache';
20
- import { ServerCache } from '../server/ServerCache';
21
- declare type EditResourceLinks<ItemTypeType extends ItemType> = {
22
- main: EditResource<ItemTypeType>;
23
- linked: ItemResourcesItemTypeMap;
24
- };
25
- /**
26
- * @description
27
- * The {@link TransactionCache TransactionCache} is responsible for keeping track of newly created {@link ItemEntry ItemEntries}
28
- * and {@link CollectionEntry CollectionEntries}, and the changes of existing ItemEntries and CollectionEntries.
29
- *
30
- * 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
31
- */
32
- export declare class TransactionCache extends AbstractCache {
33
- /**
34
- * @description
35
- * For debugging purposes
36
- */
37
- id?: string | undefined;
38
- /**
39
- * @description
40
- * Stores the 'root' {@link ItemEntry ItemEntry}, this {@link ItemEntry ItemEntry} can be used as request parent to store the whole transaction at once
41
- */
42
- rootItem: ItemEntry<any> | undefined;
43
- /**
44
- * @description
45
- * Stores additional request parameters for when the transaction is stored to the server
46
- */
47
- tabRequestParameters: {};
48
- /**
49
- * @description
50
- * Is true while the {@link TransactionCache TransactionCache} is applying changes to the parent (can either be through a merge or an Api save)
51
- */
52
- isSaving: boolean;
53
- /**
54
- * @description
55
- * Is true when the current transaction has:
56
- * - Newly created items
57
- * - Removed items (from collections)
58
- * - Changes on existing items
59
- */
60
- hasChanges: boolean;
61
- /**
62
- * @description
63
- * The transaction's parent
64
- */
65
- readonly parent: AbstractCache;
66
- readonly itemHandler: TransactionItemHandler;
67
- readonly collectionHandler: TransactionCollectionHandler;
68
- private readonly eventHandler;
69
- private changesInterval;
70
- constructor(core: RmCore, columnCache: ColumnCache, requestBufferManager: RequestBufferManager, requestColumnExpansionFactory: RequestColumnExpansionFactory, queryMatcherFactory: QueryMatcherFactory, authInterface: AuthInterface, changesDeltaFactory: ChangesDeltaFactory, lockService: LockService, moduleChangesCompilationFactory: ModuleChangesCompilationFactory, collectionResourceFactory: CollectionResourceFactory, itemResourceFactory: ItemResourceFactory, templateCache: TemplateCache, itemCacheFactory: ItemCacheFactory, collectionCacheFactory: CollectionCacheFactory, errorHandler: ErrorHandlerInterface, exceptionHandler: ExceptionHandlerInterface, promiseService: PromiseLibraryInterface, apiRequestService: ApiRequestService, columnExpansionFactory: ColumnExpansionFactory, columnHandler: ColumnHandler, columnSetFactory: ColumnSetFactory, columnSubsetCacheFactory: ColumnSubsetCacheFactory, columnUtil: ColumnUtil, itemEntryFactory: ItemEntryFactory, itemEntryService: ItemEntryService, keyService: KeyService, collectionEntryFactory: CollectionEntryFactory, collectionEntryService: CollectionEntryService, collectionMatcherFactory: CollectionMatcherFactory, queryParserFactory: QueryParserFactory, queryService: QueryService, apiFormatter: ApiFormatter, linkTreeService: LinkTreeServiceInterface, parent: AbstractCache,
71
- /**
72
- * @description
73
- * For debugging purposes
74
- */
75
- id?: string | undefined);
76
- destroy(): void;
77
- createChangesDelta(): ChangesDelta;
78
- /**
79
- * @description
80
- * Merges the passed changes from the parent Transaction into this Transaction's own changes and then propagates
81
- * them to all child Transactions, this assumes that an action is already handled in a parent, so it does't handle created entries
82
- * and removes entries that were in {@link TransactionItemHandler.deletedItems deletedItems} since they are already deleted
83
- *
84
- * ------------------
85
- *
86
- * The difference between {@link TransactionCache.applyChangesFromParent} and {@link TransactionCache.applyChangesDelta} is that applyChangesFromParent assumes
87
- * the change has already been processed, and applyChangesDelta will process the changes once you save the transaction
88
- *
89
- * ------------------
90
- * Use {@link TransactionCache.applyChangesDelta applyChangesDelta} if you want to apply changes from outside the core
91
- *
92
- * @param internalChangesDelta Changes to be applied
93
- * @param isCalledAfterApiSave If 'isCalledAfterApiSave' is true local changes will always be overwritten (instead of only when there are no changes)
94
- */
95
- applyChangesFromParent(internalChangesDelta: InternalChangesDelta, isCalledAfterApiSave?: boolean, isCalledAfterSocketUpdate?: boolean): void;
96
- /**
97
- * @description
98
- * Applies changes to this transaction and its children
99
- *
100
- * ------------------
101
- *
102
- * The difference between {@link TransactionCache.applyChangesFromParent} and {@link TransactionCache.applyChangesDelta} is that applyChangesFromParent assumes
103
- * the change has already been processed, and applyChangesDelta will process the changes itself (result vs cause)
104
- *
105
- * ------------------
106
- *
107
- * Differs from {@link ServerCache.applyChangesDelta ServerCache.applyChangesDelta} in the handling of deleted entries and the applyChangesFromParent call
108
- */
109
- applyChangesDelta(changesDelta: ChangesDelta): PromiseInterface<ChangesDeltaResult>;
110
- getServerCache(): ServerCache;
111
- /**
112
- * @description
113
- * Gets the entry's parent from the closest transaction
114
- *
115
- * @param itemEntry The entry to get the parent from
116
- * @param fromInitial If `true` the parent values will be read from {@link TransactionItemEntryChanges.initial initial} (Useful for when you've moved an entry)
117
- * @param providedFields Use the provided fields instead of the cached fields, used by {@link CollectionResource.getParent CollectionResource.getParent}
118
- *
119
- * @remark
120
- * Use {@link CollectionResource.getParent CollectionResource.getParent} instead of {@link TransactionCache.getParent TransactionCache.getParent} if you're getting the parent in the onRemove callback
121
- */
122
- getParent<ItemTypeType extends ItemType>(itemEntry: ItemEntry<ItemTypeType>, fromInitial?: boolean, providedFields?: FieldMap<ItemTypeType>): EntryParentNull;
123
- /**
124
- * @description
125
- * Traverses the transaction chain and returns the changes of the item on the first transaction
126
- *
127
- * @param copyFields If set, will call {@link ApiFormatter.copyFields ApiFormatter.copyFields}, otherwise just returns the object
128
- */
129
- getItemChangesRecursively(itemEntryId: ItemEntry['id'], copyFields?: boolean): FieldMap;
130
- /**
131
- * @description
132
- * Removes the {@link ItemResource ItemResource} from the transaction, preventing the {@link ItemResource.options.onChange the onChange callback} from being called.
133
- * You should call this function when the resource is no longer needed
134
- *
135
- * @remark
136
- * Does not remove changes
137
- */
138
- clearItemResource(resource: ItemResource): void;
139
- /**
140
- * @description
141
- * 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.
142
- * You should call this function when the resource is no longer needed
143
- *
144
- * @remark
145
- * Does not remove changes
146
- */
147
- clearCollectionResource(resource: CollectionResource): void;
148
- /**
149
- * @description
150
- * Returns whether or not the {@link TransactionCache.rootItem rootItem} is uses locks
151
- */
152
- isLockable(): boolean;
153
- /**
154
- * @description
155
- * Disables the transaction's changes watcher, the transaction will no longer automatically detect changes on items
156
- */
157
- disableChangesWatcher(): void;
158
- /**
159
- * @description
160
- * Enables the transaction's changes watcher, the transaction will now automatically detect changes on items
161
- */
162
- enableChangesWatcher(): void;
163
- /**
164
- * @description
165
- * Saves the transaction, this has a different effect depending on the transaction's parent.
166
- *
167
- * - If the parent is another {@link TransactionCache TransactionCache} it will merge the changes of the child transaction in the the parent transaction
168
- * - If the parent is the {@link ServerCache ServerCache} it will save the changes to the APi
169
- */
170
- save(closeTab?: boolean, parameters?: CreateRequestParameterMap, breakUpByParent?: boolean, onAfterCreateCallback?: OnAfterCreateCallback): PromiseInterface<void>;
171
- detectChanges(): boolean;
172
- /**
173
- * @description
174
- * 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.
175
- */
176
- clearItem(itemResource: ItemResource<any>): void;
177
- /**
178
- * @description
179
- * Removes an {@link ItemEntry ItemEntry} from the {@link TransactionCache TransactionCache} which means that changes on this entry will no longer be tracked.
180
- */
181
- clearItemEntry(itemEntry: ItemEntry<any>): void;
182
- /**
183
- * @description
184
- * Removes a {@link CollectionEntry CollectionEntry} through a {@link CollectionResource CollectionResource} from the {@link TransactionCache TransactionCache} which means that changes on this collection will no longer be tracked.
185
- */
186
- clearCollection(collectionResource: CollectionResource<any>): void;
187
- /**
188
- * @description
189
- * Adds a callback that will fire before the transaction is saved, rejecting this callback will prevent the transaction from saving
190
- */
191
- onBeforeSave(key: string, callback: TransactionCacheCallbackType['onBeforeSave'], condition?: TransactionCacheCallbackCondition, priority?: number): () => void;
192
- /**
193
- * @description
194
- * Adds a callback that will fire when the transaction is saved successfully
195
- */
196
- onSaveSuccess(key: string, callback: TransactionCacheCallbackType['onSaveSuccess'], condition?: TransactionCacheCallbackCondition, priority?: number): () => void;
197
- /**
198
- * @description
199
- * Returns a {@link ModuleChangesCompilationResult ModuleChangesCompilationResult} for the transaction
200
- */
201
- getModuleChanges(): ModuleChangesCompilationResult;
202
- /**
203
- * @description
204
- * Updates the passed map with the new {@link ConversionMap CconversionMap} values
205
- */
206
- updateItemIdMap(collectionMap: {
207
- [itemId: number]: any;
208
- }, conversionMap: ConversionMap): void;
209
- cloneCollection<ItemTypeType extends ItemType>(collectionResource: CollectionResource<ItemTypeType>, options: CollectionOptionsInterface<ItemTypeType> & {
210
- editItems: true;
211
- editCollection: true;
212
- }, conversionMap: ItemIdConversionMap): CollectionEditResource<ItemTypeType, EditResource<ItemTypeType>>;
213
- cloneCollection<ItemTypeType extends ItemType>(collectionResource: CollectionResource<ItemTypeType>, options: CollectionOptionsInterface<ItemTypeType> & {
214
- remoteItems: true;
215
- editCollection: true;
216
- }, conversionMap: ItemIdConversionMap): CollectionEditResource<ItemTypeType, RemoteViewResource<ItemTypeType>>;
217
- cloneCollection<ItemTypeType extends ItemType>(collectionResource: CollectionResource<ItemTypeType>, options: CollectionOptionsInterface<ItemTypeType> & {
218
- editItems: true;
219
- }, conversionMap: ItemIdConversionMap): CollectionViewResource<ItemTypeType, EditResource<ItemTypeType>>;
220
- cloneCollection<ItemTypeType extends ItemType>(collectionResource: CollectionResource<ItemTypeType>, options: CollectionOptionsInterface<ItemTypeType> & {
221
- remoteItems: true;
222
- }, conversionMap: ItemIdConversionMap): CollectionViewResource<ItemTypeType, RemoteViewResource<ItemTypeType>>;
223
- cloneCollection<ItemTypeType extends ItemType>(collectionResource: CollectionResource<ItemTypeType>, options: CollectionOptionsInterface<ItemTypeType> & {
224
- editCollection: true;
225
- }, conversionMap: ItemIdConversionMap): CollectionEditResource<ItemTypeType, LocalViewResource<ItemTypeType>>;
226
- cloneCollection<ItemTypeType extends ItemType>(collectionResource: CollectionResource<ItemTypeType>, options: CollectionOptionsInterface<ItemTypeType>, conversionMap: ItemIdConversionMap): CollectionViewResource<ItemTypeType, LocalViewResource<ItemTypeType>>;
227
- cloneItem<ItemTypeType extends ItemType>(itemResource: ItemResource<ItemTypeType>, options: ItemOptionsInterface & {
228
- edit: true;
229
- }): PromiseInterface<EditResource<ItemTypeType>>;
230
- cloneItem<ItemTypeType extends ItemType>(itemResource: ItemResource<ItemTypeType>, options: ItemOptionsInterface & {
231
- remote: true;
232
- }): PromiseInterface<RemoteViewResource<ItemTypeType>>;
233
- cloneItem<ItemTypeType extends ItemType>(itemResource: ItemResource<ItemTypeType>, options: ItemOptionsInterface): PromiseInterface<LocalViewResource<ItemTypeType>>;
234
- getAllLinkCollections<ItemTypeType extends ItemType>(linkType: ItemType, itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType> & {
235
- editItems: true;
236
- editCollection: true;
237
- }): PromiseInterface<CollectionResourceParentIdMap<CollectionEditResource<ItemTypeType, EditResource<ItemTypeType>>>>;
238
- getAllLinkCollections<ItemTypeType extends ItemType>(linkType: ItemType, itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType> & {
239
- remoteItems: true;
240
- editCollection: true;
241
- }): PromiseInterface<CollectionResourceParentIdMap<CollectionEditResource<ItemTypeType, RemoteViewResource<ItemTypeType>>>>;
242
- getAllLinkCollections<ItemTypeType extends ItemType>(linkType: ItemType, itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType> & {
243
- editCollection: true;
244
- }): PromiseInterface<CollectionResourceParentIdMap<CollectionEditResource<ItemTypeType, LocalViewResource<ItemTypeType>>>>;
245
- getAllLinkCollections<ItemTypeType extends ItemType>(linkType: ItemType, itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType> & {
246
- editItems: true;
247
- }): PromiseInterface<CollectionResourceParentIdMap<CollectionViewResource<ItemTypeType, EditResource<ItemTypeType>>>>;
248
- getAllLinkCollections<ItemTypeType extends ItemType>(linkType: ItemType, itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType> & {
249
- remoteItems: true;
250
- }): PromiseInterface<CollectionResourceParentIdMap<CollectionViewResource<ItemTypeType, RemoteViewResource<ItemTypeType>>>>;
251
- getAllLinkCollections<ItemTypeType extends ItemType>(linkType: ItemType, itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType>): PromiseInterface<CollectionResourceParentIdMap<CollectionViewResource<ItemTypeType, LocalViewResource<ItemTypeType>>>>;
252
- getLinkCollectionsFromDef<ItemTypeType extends ItemType>(linkType: ItemType, linkIdArray: ItemId[], definition: LinkCollectionDefinition<ItemTypeType>): PromiseInterface<CollectionResourceParentIdMap<CollectionResource<ItemTypeType>>>;
253
- getLinkCollections<ItemTypeType extends ItemType>(linkType: ItemType, linkIdArray: ItemId[], itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType> & {
254
- editItems: true;
255
- editCollection: true;
256
- }): PromiseInterface<CollectionResourceParentIdMap<CollectionEditResource<ItemTypeType, EditResource<ItemTypeType>>>>;
257
- getLinkCollections<ItemTypeType extends ItemType>(linkType: ItemType, linkIdArray: ItemId[], itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType> & {
258
- remoteItems: true;
259
- editCollection: true;
260
- }): PromiseInterface<CollectionResourceParentIdMap<CollectionEditResource<ItemTypeType, RemoteViewResource<ItemTypeType>>>>;
261
- getLinkCollections<ItemTypeType extends ItemType>(linkType: ItemType, linkIdArray: ItemId[], itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType> & {
262
- editCollection: true;
263
- }): PromiseInterface<CollectionResourceParentIdMap<CollectionEditResource<ItemTypeType, LocalViewResource<ItemTypeType>>>>;
264
- getLinkCollections<ItemTypeType extends ItemType>(linkType: ItemType, linkIdArray: ItemId[], itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType> & {
265
- editItems: true;
266
- }): PromiseInterface<CollectionResourceParentIdMap<CollectionViewResource<ItemTypeType, EditResource<ItemTypeType>>>>;
267
- getLinkCollections<ItemTypeType extends ItemType>(linkType: ItemType, linkIdArray: ItemId[], itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType> & {
268
- remoteItems: true;
269
- }): PromiseInterface<CollectionResourceParentIdMap<CollectionViewResource<ItemTypeType, RemoteViewResource<ItemTypeType>>>>;
270
- getLinkCollections<ItemTypeType extends ItemType>(linkType: ItemType, linkIdArray: ItemId[], itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType>): PromiseInterface<CollectionResourceParentIdMap<CollectionViewResource<ItemTypeType, LocalViewResource<ItemTypeType>>>>;
271
- getCollectionFromDef<ItemTypeType extends ItemType>(definition: CollectionDefinition<ItemTypeType>): PromiseInterface<CollectionResource<ItemTypeType>>;
272
- getCollection<ItemTypeType extends ItemType>(itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType> & {
273
- editCollection: true;
274
- editItems: true;
275
- }): PromiseInterface<CollectionEditResource<ItemTypeType, EditResource<ItemTypeType>>>;
276
- getCollection<ItemTypeType extends ItemType>(itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType> & {
277
- editItems: true;
278
- }): PromiseInterface<CollectionViewResource<ItemTypeType, EditResource<ItemTypeType>>>;
279
- getCollection<ItemTypeType extends ItemType>(itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType> & {
280
- editCollection: true;
281
- remoteItems: true;
282
- }): PromiseInterface<CollectionEditResource<ItemTypeType, RemoteViewResource<ItemTypeType>>>;
283
- getCollection<ItemTypeType extends ItemType>(itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType> & {
284
- remoteItems: true;
285
- }): PromiseInterface<CollectionViewResource<ItemTypeType, RemoteViewResource<ItemTypeType>>>;
286
- getCollection<ItemTypeType extends ItemType>(itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType> & {
287
- editCollection: true;
288
- }): PromiseInterface<CollectionEditResource<ItemTypeType, LocalViewResource<ItemTypeType>>>;
289
- getCollection<ItemTypeType extends ItemType>(itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType>): PromiseInterface<CollectionViewResource<ItemTypeType, LocalViewResource<ItemTypeType>>>;
290
- getCollectionDef<ItemTypeType extends ItemType>(itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType>): CollectionDefinition<ItemTypeType>;
291
- getLinkCollectionsDef<ItemTypeType extends ItemType>(itemType: ItemTypeType, linkField: string, options: CollectionOptionsInterface<ItemTypeType>): LinkCollectionDefinition<ItemTypeType>;
292
- getItemByState<ItemTypeType extends ItemType>(itemType: ItemTypeType, stateKey: ItemId | string, options: ItemOptionsInterface & {
293
- edit: true;
294
- }, isRoot?: boolean): PromiseInterface<EditResource<ItemTypeType>>;
295
- getItemByState<ItemTypeType extends ItemType>(itemType: ItemTypeType, stateKey: ItemId | string, options: ItemOptionsInterface & {
296
- remote: true;
297
- }, isRoot?: boolean): PromiseInterface<RemoteViewResource<ItemTypeType>>;
298
- getItemByState<ItemTypeType extends ItemType>(itemType: ItemTypeType, stateKey: ItemId | string, options: ItemOptionsInterface, isRoot?: boolean): PromiseInterface<LocalViewResource<ItemTypeType>>;
299
- getDuplicateById<ItemTypeType extends ItemType>(itemType: ItemTypeType, duplicateId: ItemId, options: ItemOptionsInterface, returnLinks: true, isRoot?: boolean): PromiseInterface<EditResourceLinks<ItemTypeType>>;
300
- getDuplicateById<ItemTypeType extends ItemType>(itemType: ItemTypeType, duplicateId: ItemId, options: ItemOptionsInterface, returnLinks?: boolean, isRoot?: boolean): PromiseInterface<EditResource<ItemTypeType>>;
301
- getNewResourceWithId<ItemTypeType extends ItemType>(itemType: ItemTypeType, itemId: ItemId, options: ItemOptionsInterface, returnLinks: true, isRoot?: boolean): PromiseInterface<EditResourceLinks<ItemTypeType>>;
302
- getNewResourceWithId<ItemTypeType extends ItemType>(itemType: ItemTypeType, itemId: ItemId, options: ItemOptionsInterface, returnLinks?: boolean, isRoot?: boolean): PromiseInterface<EditResource<ItemTypeType>>;
303
- getNewResource<ItemTypeType extends ItemType>(itemType: ItemTypeType, options: ItemOptionsInterface, returnLinks: true, isRoot?: boolean): PromiseInterface<EditResourceLinks<ItemTypeType>>;
304
- getNewResource<ItemTypeType extends ItemType>(itemType: ItemTypeType, options: ItemOptionsInterface, returnLinks?: boolean, isRoot?: boolean): PromiseInterface<EditResource<ItemTypeType>>;
305
- getItemsByQuery<ItemTypeType extends ItemType>(itemType: ItemTypeType, query: ApiQuery, options: ItemOptionsInterface & {
306
- edit: true;
307
- }): PromiseInterface<Array<EditResource<ItemTypeType>>>;
308
- getItemsByQuery<ItemTypeType extends ItemType>(itemType: ItemTypeType, query: ApiQuery, options: ItemOptionsInterface & {
309
- remote: true;
310
- }): PromiseInterface<Array<RemoteViewResource<ItemTypeType>>>;
311
- getItemsByQuery<ItemTypeType extends ItemType>(itemType: ItemTypeType, query: ApiQuery, options: ItemOptionsInterface): PromiseInterface<Array<LocalViewResource<ItemTypeType>>>;
312
- getItemsById<ItemTypeType extends ItemType>(itemType: ItemTypeType, itemIds: ItemId[], options: ItemOptionsInterface & {
313
- edit: true;
314
- }): PromiseInterface<Array<EditResource<ItemTypeType>>>;
315
- getItemsById<ItemTypeType extends ItemType>(itemType: ItemTypeType, itemIds: ItemId[], options: ItemOptionsInterface & {
316
- remote: true;
317
- }): PromiseInterface<Array<RemoteViewResource<ItemTypeType>>>;
318
- getItemsById<ItemTypeType extends ItemType>(itemType: ItemTypeType, itemIds: ItemId[], options: ItemOptionsInterface): PromiseInterface<Array<LocalViewResource<ItemTypeType>>>;
319
- getItemById<ItemTypeType extends ItemType>(itemType: ItemTypeType, itemId: ItemId, options: ItemOptionsInterface & {
320
- edit: true;
321
- }, isRoot?: boolean): PromiseInterface<EditResource<ItemTypeType>>;
322
- getItemById<ItemTypeType extends ItemType>(itemType: ItemTypeType, itemId: ItemId, options: ItemOptionsInterface & {
323
- remote: true;
324
- }, isRoot?: boolean): PromiseInterface<RemoteViewResource<ItemTypeType>>;
325
- getItemById<ItemTypeType extends ItemType>(itemType: ItemTypeType, itemId: ItemId, options: ItemOptionsInterface, isRoot?: boolean): PromiseInterface<LocalViewResource<ItemTypeType>>;
326
- /**
327
- * @description
328
- * Fetches the title of an item, does not create an {@link ItemResource ItemResource}
329
- */
330
- fetchTitle(itemType: ItemType, itemId: ItemId): PromiseInterface<string>;
331
- /**
332
- * @description
333
- * Merges the passed child Transaction into this transaction and then propagates them to the other child transactions
334
- */
335
- applyChangesFromChild(childTransaction: TransactionCache, _breakUpByParent?: boolean, _onAfterCreateCallback?: OnAfterCreateCallback): PromiseInterface<ItemIdConversionMap>;
336
- /**
337
- * @description
338
- * Gets an already cached {@link ItemEntry ItemEntry} and the changes of this specific transaction for that entry
339
- */
340
- getLocalItemEntryChangesTuple(itemEntryId: ItemEntry['id']): {
341
- entry: ItemEntry;
342
- changes: TransactionItemEntryChanges;
343
- };
344
- /**
345
- * @description
346
- * Gets an ItemEntry from the cache, doesn't do a API request, used for saving
347
- */
348
- getLocalItemEntry(itemEntryId: ItemEntry['id']): ItemEntry | undefined;
349
- /**
350
- * @description
351
- * Gets an ItemEntry from the cache by ItemId
352
- */
353
- getLocalItemEntryByItemId(itemType: ItemType, itemId: ItemEntry['itemId']): ItemEntry | undefined;
354
- /**
355
- * @description
356
- * Gets an CollectionEntry from the cache, doesn't do a API request, used for saving
357
- */
358
- getLocalCollectionEntry(collectionEntryId: CollectionEntry['id']): CollectionEntry | undefined;
359
- /**
360
- * @description
361
- * 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
362
- * won't be included
363
- */
364
- getDelta(): InternalChangesDelta;
365
- createItemResource<ItemTypeType extends ItemType>(itemEntry: ItemEntry<ItemTypeType>, options: ItemOptionsInterface<EditResource<ItemTypeType>> & {
366
- edit: true;
367
- }, isRoot?: boolean, isNew?: boolean): EditResource<ItemTypeType>;
368
- createItemResource<ItemTypeType extends ItemType>(itemEntry: ItemEntry<ItemTypeType>, options: ItemOptionsInterface<RemoteViewResource<ItemTypeType>> & {
369
- remote: true;
370
- }, isRoot?: boolean, isNew?: boolean): RemoteViewResource<ItemTypeType>;
371
- createItemResource<ItemTypeType extends ItemType>(itemEntry: ItemEntry<ItemTypeType>, options: ItemOptionsInterface<LocalViewResource<ItemTypeType>>, isRoot?: boolean, isNew?: boolean): LocalViewResource<ItemTypeType>;
372
- createItemResources<ItemTypeType extends ItemType>(itemEntries: Array<ItemEntry<ItemTypeType>>, options: ItemOptionsInterface & {
373
- edit: true;
374
- }): Array<EditResource<ItemTypeType>>;
375
- createItemResources<ItemTypeType extends ItemType>(itemEntries: Array<ItemEntry<ItemTypeType>>, options: ItemOptionsInterface & {
376
- remote: true;
377
- }): Array<RemoteViewResource<ItemTypeType>>;
378
- createItemResources<ItemTypeType extends ItemType>(itemEntries: Array<ItemEntry<ItemTypeType>>, options: ItemOptionsInterface): Array<LocalViewResource<ItemTypeType>>;
379
- processLinkedItems<ItemTypeType extends ItemType>(linkedEntries: ItemTypeMap<ItemEntry[]>, options: ItemOptionsInterface & {
380
- edit: true;
381
- }): ItemResourcesItemTypeMap<EditResource<ItemTypeType>>;
382
- processLinkedItems<ItemTypeType extends ItemType>(linkedEntries: ItemTypeMap<ItemEntry[]>, options: ItemOptionsInterface & {
383
- remote: true;
384
- }): ItemResourcesItemTypeMap<RemoteViewResource<ItemTypeType>>;
385
- processLinkedItems<ItemTypeType extends ItemType>(linkedEntries: ItemTypeMap<ItemEntry[]>, options: ItemOptionsInterface): ItemResourcesItemTypeMap<LocalViewResource<ItemTypeType>>;
386
- createCollectionResource<ItemTypeType extends ItemType>(collectionEntry: CollectionEntry<ItemTypeType>, resourceOptions: CollectionResourceOptionsInterface<ItemTypeType> & {
387
- editItems: true;
388
- editCollection: true;
389
- }): CollectionEditResource<ItemTypeType, EditResource<ItemTypeType>>;
390
- createCollectionResource<ItemTypeType extends ItemType>(collectionEntry: CollectionEntry<ItemTypeType>, resourceOptions: CollectionResourceOptionsInterface<ItemTypeType> & {
391
- remoteItems: true;
392
- editCollection: true;
393
- }): CollectionEditResource<ItemTypeType, RemoteViewResource<ItemTypeType>>;
394
- createCollectionResource<ItemTypeType extends ItemType>(collectionEntry: CollectionEntry<ItemTypeType>, resourceOptions: CollectionResourceOptionsInterface<ItemTypeType> & {
395
- editCollection: true;
396
- }): CollectionEditResource<ItemTypeType, LocalViewResource<ItemTypeType>>;
397
- createCollectionResource<ItemTypeType extends ItemType>(collectionEntry: CollectionEntry<ItemTypeType>, resourceOptions: CollectionResourceOptionsInterface<ItemTypeType> & {
398
- editItems: true;
399
- }): CollectionViewResource<ItemTypeType, EditResource<ItemTypeType>>;
400
- createCollectionResource<ItemTypeType extends ItemType>(collectionEntry: CollectionEntry<ItemTypeType>, resourceOptions: CollectionResourceOptionsInterface<ItemTypeType> & {
401
- remoteItems: true;
402
- }): CollectionViewResource<ItemTypeType, RemoteViewResource<ItemTypeType>>;
403
- createCollectionResource<ItemTypeType extends ItemType>(collectionEntry: CollectionEntry<ItemTypeType>, resourceOptions: CollectionResourceOptionsInterface<ItemTypeType>): CollectionViewResource<ItemTypeType, LocalViewResource<ItemTypeType>>;
404
- /**
405
- * @description
406
- * Returns this transaction and all parents
407
- */
408
- getTransactionChain(): AbstractCache[];
409
- getChangesFromItemChanges<ItemTypeType extends ItemType = any>(changesObject: TransactionItemEntryChanges<ItemTypeType>): FieldMap<ItemTypeType>;
410
- private createCollectionResources;
411
- /**
412
- * @description
413
- * Fetches all required columns to match/fit in collections
414
- */
415
- private expandItemsFromDelta;
416
- }
417
- export {};
1
+ import { RmCore } from '../../../core';
2
+ import { CollectionCacheFactory, CollectionEntryFactory, CollectionMatcherFactory, CollectionResourceFactory, ColumnExpansionFactory, ColumnSetFactory, ColumnSubsetCacheFactory, ItemCacheFactory, ItemEntryFactory, ItemResourceFactory, ModuleChangesCompilationFactory, QueryMatcherFactory, QueryParserFactory, RequestColumnExpansionFactory } from '../../../factories';
3
+ import { ChangesDeltaFactory } from '../../../factories/ChangesDeltaFactory';
4
+ import { AuthInterface, ErrorHandlerInterface, ExceptionHandlerInterface, PromiseLibraryInterface } from '../../../interfaces';
5
+ import { LinkTreeServiceInterface } from '../../../interfaces/LinkTreeServiceInterface';
6
+ import { CollectionEditResource, CollectionEntry, CollectionResource, CollectionResourceOptionsInterface, CollectionViewResource, EditResource, ItemEntry, ItemResource, LocalViewResource, RemoteViewResource } from '../../../models';
7
+ import { ApiQuery, CollectionDefinition, CollectionOptionsInterface, CollectionResourceParentIdMap, ConversionMap, CreateRequestParameterMap, EntryParentNull, FieldMap, ItemId, ItemIdConversionMap, ItemOptionsInterface, ItemResourcesItemTypeMap, ItemType, ItemTypeMap, LinkCollectionDefinition, PromiseInterface } from '../../../types';
8
+ import { ChangesDelta } from '../../ChangesDelta';
9
+ import { ChangesDeltaResult } from '../../ChangesDeltaBase';
10
+ import { CollectionEntryService } from '../../CollectionEntryService';
11
+ import { ColumnHandler } from '../../ColumnHandler';
12
+ import { ColumnUtil } from '../../ColumnUtil';
13
+ import { ApiFormatter, ApiRequestService, ColumnCache, LockService, ModuleChangesCompilationResult, OnAfterCreateCallback, RequestBufferManager, TransactionCacheCallbackCondition, TransactionCacheCallbackType, TransactionCollectionHandler, TransactionItemEntryChanges, TransactionItemHandler } from '../../index';
14
+ import { InternalChangesDelta } from '../../InternalChangesDelta';
15
+ import { ItemEntryService } from '../../ItemEntryService';
16
+ import { KeyService } from '../../KeyService';
17
+ import { QueryService } from '../../QueryService';
18
+ import { TemplateCache } from '../../TemplateCache';
19
+ import { AbstractCache } from '../AbstractCache';
20
+ import { ServerCache } from '../server/ServerCache';
21
+ declare type EditResourceLinks<ItemTypeType extends ItemType> = {
22
+ main: EditResource<ItemTypeType>;
23
+ linked: ItemResourcesItemTypeMap;
24
+ };
25
+ /**
26
+ * @description
27
+ * The {@link TransactionCache TransactionCache} is responsible for keeping track of newly created {@link ItemEntry ItemEntries}
28
+ * and {@link CollectionEntry CollectionEntries}, and the changes of existing ItemEntries and CollectionEntries.
29
+ *
30
+ * 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
31
+ */
32
+ export declare class TransactionCache extends AbstractCache {
33
+ /**
34
+ * @description
35
+ * For debugging purposes
36
+ */
37
+ id?: string | undefined;
38
+ /**
39
+ * @description
40
+ * Stores the 'root' {@link ItemEntry ItemEntry}, this {@link ItemEntry ItemEntry} can be used as request parent to store the whole transaction at once
41
+ */
42
+ rootItem: ItemEntry<any> | undefined;
43
+ /**
44
+ * @description
45
+ * Stores additional request parameters for when the transaction is stored to the server
46
+ */
47
+ tabRequestParameters: {};
48
+ /**
49
+ * @description
50
+ * Is true while the {@link TransactionCache TransactionCache} is applying changes to the parent (can either be through a merge or an Api save)
51
+ */
52
+ isSaving: boolean;
53
+ /**
54
+ * @description
55
+ * Is true when the current transaction has:
56
+ * - Newly created items
57
+ * - Removed items (from collections)
58
+ * - Changes on existing items
59
+ */
60
+ hasChanges: boolean;
61
+ /**
62
+ * @description
63
+ * The transaction's parent
64
+ */
65
+ readonly parent: AbstractCache;
66
+ readonly itemHandler: TransactionItemHandler;
67
+ readonly collectionHandler: TransactionCollectionHandler;
68
+ private readonly eventHandler;
69
+ private changesInterval;
70
+ constructor(core: RmCore, columnCache: ColumnCache, requestBufferManager: RequestBufferManager, requestColumnExpansionFactory: RequestColumnExpansionFactory, queryMatcherFactory: QueryMatcherFactory, authInterface: AuthInterface, changesDeltaFactory: ChangesDeltaFactory, lockService: LockService, moduleChangesCompilationFactory: ModuleChangesCompilationFactory, collectionResourceFactory: CollectionResourceFactory, itemResourceFactory: ItemResourceFactory, templateCache: TemplateCache, itemCacheFactory: ItemCacheFactory, collectionCacheFactory: CollectionCacheFactory, errorHandler: ErrorHandlerInterface, exceptionHandler: ExceptionHandlerInterface, promiseService: PromiseLibraryInterface, apiRequestService: ApiRequestService, columnExpansionFactory: ColumnExpansionFactory, columnHandler: ColumnHandler, columnSetFactory: ColumnSetFactory, columnSubsetCacheFactory: ColumnSubsetCacheFactory, columnUtil: ColumnUtil, itemEntryFactory: ItemEntryFactory, itemEntryService: ItemEntryService, keyService: KeyService, collectionEntryFactory: CollectionEntryFactory, collectionEntryService: CollectionEntryService, collectionMatcherFactory: CollectionMatcherFactory, queryParserFactory: QueryParserFactory, queryService: QueryService, apiFormatter: ApiFormatter, linkTreeService: LinkTreeServiceInterface, parent: AbstractCache,
71
+ /**
72
+ * @description
73
+ * For debugging purposes
74
+ */
75
+ id?: string | undefined);
76
+ destroy(): void;
77
+ createChangesDelta(): ChangesDelta;
78
+ /**
79
+ * @description
80
+ * Merges the passed changes from the parent Transaction into this Transaction's own changes and then propagates
81
+ * them to all child Transactions, this assumes that an action is already handled in a parent, so it does't handle created entries
82
+ * and removes entries that were in {@link TransactionItemHandler.deletedItems deletedItems} since they are already deleted
83
+ *
84
+ * ------------------
85
+ *
86
+ * The difference between {@link TransactionCache.applyChangesFromParent} and {@link TransactionCache.applyChangesDelta} is that applyChangesFromParent assumes
87
+ * the change has already been processed, and applyChangesDelta will process the changes once you save the transaction
88
+ *
89
+ * ------------------
90
+ * Use {@link TransactionCache.applyChangesDelta applyChangesDelta} if you want to apply changes from outside the core
91
+ *
92
+ * @param internalChangesDelta Changes to be applied
93
+ * @param isCalledAfterApiSave If 'isCalledAfterApiSave' is true local changes will always be overwritten (instead of only when there are no changes)
94
+ */
95
+ applyChangesFromParent(internalChangesDelta: InternalChangesDelta, isCalledAfterApiSave?: boolean, isCalledAfterSocketUpdate?: boolean): void;
96
+ /**
97
+ * @description
98
+ * Applies changes to this transaction and its children
99
+ *
100
+ * ------------------
101
+ *
102
+ * The difference between {@link TransactionCache.applyChangesFromParent} and {@link TransactionCache.applyChangesDelta} is that applyChangesFromParent assumes
103
+ * the change has already been processed, and applyChangesDelta will process the changes itself (result vs cause)
104
+ *
105
+ * ------------------
106
+ *
107
+ * Differs from {@link ServerCache.applyChangesDelta ServerCache.applyChangesDelta} in the handling of deleted entries and the applyChangesFromParent call
108
+ */
109
+ applyChangesDelta(changesDelta: ChangesDelta): PromiseInterface<ChangesDeltaResult>;
110
+ getServerCache(): ServerCache;
111
+ /**
112
+ * @description
113
+ * Gets the entry's parent from the closest transaction
114
+ *
115
+ * @param itemEntry The entry to get the parent from
116
+ * @param fromInitial If `true` the parent values will be read from {@link TransactionItemEntryChanges.initial initial} (Useful for when you've moved an entry)
117
+ * @param providedFields Use the provided fields instead of the cached fields, used by {@link CollectionResource.getParent CollectionResource.getParent}
118
+ *
119
+ * @remark
120
+ * Use {@link CollectionResource.getParent CollectionResource.getParent} instead of {@link TransactionCache.getParent TransactionCache.getParent} if you're getting the parent in the onRemove callback
121
+ */
122
+ getParent<ItemTypeType extends ItemType>(itemEntry: ItemEntry<ItemTypeType>, fromInitial?: boolean, providedFields?: FieldMap<ItemTypeType>): EntryParentNull;
123
+ /**
124
+ * @description
125
+ * Traverses the transaction chain and returns the changes of the item on the first transaction
126
+ *
127
+ * @param copyFields If set, will call {@link ApiFormatter.copyFields ApiFormatter.copyFields}, otherwise just returns the object
128
+ */
129
+ getItemChangesRecursively(itemEntryId: ItemEntry['id'], copyFields?: boolean): FieldMap;
130
+ /**
131
+ * @description
132
+ * Removes the {@link ItemResource ItemResource} from the transaction, preventing the {@link ItemResource.options.onChange the onChange callback} from being called.
133
+ * You should call this function when the resource is no longer needed
134
+ *
135
+ * @remark
136
+ * Does not remove changes
137
+ */
138
+ clearItemResource(resource: ItemResource): void;
139
+ /**
140
+ * @description
141
+ * 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.
142
+ * You should call this function when the resource is no longer needed
143
+ *
144
+ * @remark
145
+ * Does not remove changes
146
+ */
147
+ clearCollectionResource(resource: CollectionResource): void;
148
+ /**
149
+ * @description
150
+ * Returns whether or not the {@link TransactionCache.rootItem rootItem} is uses locks
151
+ */
152
+ isLockable(): boolean;
153
+ /**
154
+ * @description
155
+ * Disables the transaction's changes watcher, the transaction will no longer automatically detect changes on items
156
+ */
157
+ disableChangesWatcher(): void;
158
+ /**
159
+ * @description
160
+ * Enables the transaction's changes watcher, the transaction will now automatically detect changes on items
161
+ */
162
+ enableChangesWatcher(): void;
163
+ /**
164
+ * @description
165
+ * Saves the transaction, this has a different effect depending on the transaction's parent.
166
+ *
167
+ * - If the parent is another {@link TransactionCache TransactionCache} it will merge the changes of the child transaction in the the parent transaction
168
+ * - If the parent is the {@link ServerCache ServerCache} it will save the changes to the APi
169
+ */
170
+ save(closeTab?: boolean, parameters?: CreateRequestParameterMap, breakUpByParent?: boolean, onAfterCreateCallback?: OnAfterCreateCallback): PromiseInterface<void>;
171
+ detectChanges(): boolean;
172
+ /**
173
+ * @description
174
+ * 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.
175
+ */
176
+ clearItem(itemResource: ItemResource<any>): void;
177
+ /**
178
+ * @description
179
+ * Removes an {@link ItemEntry ItemEntry} from the {@link TransactionCache TransactionCache} which means that changes on this entry will no longer be tracked.
180
+ */
181
+ clearItemEntry(itemEntry: ItemEntry<any>): void;
182
+ /**
183
+ * @description
184
+ * Removes a {@link CollectionEntry CollectionEntry} through a {@link CollectionResource CollectionResource} from the {@link TransactionCache TransactionCache} which means that changes on this collection will no longer be tracked.
185
+ */
186
+ clearCollection(collectionResource: CollectionResource<any>): void;
187
+ /**
188
+ * @description
189
+ * Adds a callback that will fire before the transaction is saved, rejecting this callback will prevent the transaction from saving
190
+ */
191
+ onBeforeSave(key: string, callback: TransactionCacheCallbackType['onBeforeSave'], condition?: TransactionCacheCallbackCondition, priority?: number): () => void;
192
+ /**
193
+ * @description
194
+ * Adds a callback that will fire when the transaction is saved successfully
195
+ */
196
+ onSaveSuccess(key: string, callback: TransactionCacheCallbackType['onSaveSuccess'], condition?: TransactionCacheCallbackCondition, priority?: number): () => void;
197
+ /**
198
+ * @description
199
+ * Returns a {@link ModuleChangesCompilationResult ModuleChangesCompilationResult} for the transaction
200
+ */
201
+ getModuleChanges(): ModuleChangesCompilationResult;
202
+ /**
203
+ * @description
204
+ * Updates the passed map with the new {@link ConversionMap CconversionMap} values
205
+ */
206
+ updateItemIdMap(collectionMap: {
207
+ [itemId: number]: any;
208
+ }, conversionMap: ConversionMap): void;
209
+ cloneCollection<ItemTypeType extends ItemType>(collectionResource: CollectionResource<ItemTypeType>, options: CollectionOptionsInterface<ItemTypeType> & {
210
+ editItems: true;
211
+ editCollection: true;
212
+ }, conversionMap: ItemIdConversionMap): CollectionEditResource<ItemTypeType, EditResource<ItemTypeType>>;
213
+ cloneCollection<ItemTypeType extends ItemType>(collectionResource: CollectionResource<ItemTypeType>, options: CollectionOptionsInterface<ItemTypeType> & {
214
+ remoteItems: true;
215
+ editCollection: true;
216
+ }, conversionMap: ItemIdConversionMap): CollectionEditResource<ItemTypeType, RemoteViewResource<ItemTypeType>>;
217
+ cloneCollection<ItemTypeType extends ItemType>(collectionResource: CollectionResource<ItemTypeType>, options: CollectionOptionsInterface<ItemTypeType> & {
218
+ editItems: true;
219
+ }, conversionMap: ItemIdConversionMap): CollectionViewResource<ItemTypeType, EditResource<ItemTypeType>>;
220
+ cloneCollection<ItemTypeType extends ItemType>(collectionResource: CollectionResource<ItemTypeType>, options: CollectionOptionsInterface<ItemTypeType> & {
221
+ remoteItems: true;
222
+ }, conversionMap: ItemIdConversionMap): CollectionViewResource<ItemTypeType, RemoteViewResource<ItemTypeType>>;
223
+ cloneCollection<ItemTypeType extends ItemType>(collectionResource: CollectionResource<ItemTypeType>, options: CollectionOptionsInterface<ItemTypeType> & {
224
+ editCollection: true;
225
+ }, conversionMap: ItemIdConversionMap): CollectionEditResource<ItemTypeType, LocalViewResource<ItemTypeType>>;
226
+ cloneCollection<ItemTypeType extends ItemType>(collectionResource: CollectionResource<ItemTypeType>, options: CollectionOptionsInterface<ItemTypeType>, conversionMap: ItemIdConversionMap): CollectionViewResource<ItemTypeType, LocalViewResource<ItemTypeType>>;
227
+ cloneItem<ItemTypeType extends ItemType>(itemResource: ItemResource<ItemTypeType>, options: ItemOptionsInterface & {
228
+ edit: true;
229
+ }): PromiseInterface<EditResource<ItemTypeType>>;
230
+ cloneItem<ItemTypeType extends ItemType>(itemResource: ItemResource<ItemTypeType>, options: ItemOptionsInterface & {
231
+ remote: true;
232
+ }): PromiseInterface<RemoteViewResource<ItemTypeType>>;
233
+ cloneItem<ItemTypeType extends ItemType>(itemResource: ItemResource<ItemTypeType>, options: ItemOptionsInterface): PromiseInterface<LocalViewResource<ItemTypeType>>;
234
+ getAllLinkCollections<ItemTypeType extends ItemType>(linkType: ItemType, itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType> & {
235
+ editItems: true;
236
+ editCollection: true;
237
+ }): PromiseInterface<CollectionResourceParentIdMap<CollectionEditResource<ItemTypeType, EditResource<ItemTypeType>>>>;
238
+ getAllLinkCollections<ItemTypeType extends ItemType>(linkType: ItemType, itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType> & {
239
+ remoteItems: true;
240
+ editCollection: true;
241
+ }): PromiseInterface<CollectionResourceParentIdMap<CollectionEditResource<ItemTypeType, RemoteViewResource<ItemTypeType>>>>;
242
+ getAllLinkCollections<ItemTypeType extends ItemType>(linkType: ItemType, itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType> & {
243
+ editCollection: true;
244
+ }): PromiseInterface<CollectionResourceParentIdMap<CollectionEditResource<ItemTypeType, LocalViewResource<ItemTypeType>>>>;
245
+ getAllLinkCollections<ItemTypeType extends ItemType>(linkType: ItemType, itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType> & {
246
+ editItems: true;
247
+ }): PromiseInterface<CollectionResourceParentIdMap<CollectionViewResource<ItemTypeType, EditResource<ItemTypeType>>>>;
248
+ getAllLinkCollections<ItemTypeType extends ItemType>(linkType: ItemType, itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType> & {
249
+ remoteItems: true;
250
+ }): PromiseInterface<CollectionResourceParentIdMap<CollectionViewResource<ItemTypeType, RemoteViewResource<ItemTypeType>>>>;
251
+ getAllLinkCollections<ItemTypeType extends ItemType>(linkType: ItemType, itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType>): PromiseInterface<CollectionResourceParentIdMap<CollectionViewResource<ItemTypeType, LocalViewResource<ItemTypeType>>>>;
252
+ getLinkCollectionsFromDef<ItemTypeType extends ItemType>(linkType: ItemType, linkIdArray: ItemId[], definition: LinkCollectionDefinition<ItemTypeType>): PromiseInterface<CollectionResourceParentIdMap<CollectionResource<ItemTypeType>>>;
253
+ getLinkCollections<ItemTypeType extends ItemType>(linkType: ItemType, linkIdArray: ItemId[], itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType> & {
254
+ editItems: true;
255
+ editCollection: true;
256
+ }): PromiseInterface<CollectionResourceParentIdMap<CollectionEditResource<ItemTypeType, EditResource<ItemTypeType>>>>;
257
+ getLinkCollections<ItemTypeType extends ItemType>(linkType: ItemType, linkIdArray: ItemId[], itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType> & {
258
+ remoteItems: true;
259
+ editCollection: true;
260
+ }): PromiseInterface<CollectionResourceParentIdMap<CollectionEditResource<ItemTypeType, RemoteViewResource<ItemTypeType>>>>;
261
+ getLinkCollections<ItemTypeType extends ItemType>(linkType: ItemType, linkIdArray: ItemId[], itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType> & {
262
+ editCollection: true;
263
+ }): PromiseInterface<CollectionResourceParentIdMap<CollectionEditResource<ItemTypeType, LocalViewResource<ItemTypeType>>>>;
264
+ getLinkCollections<ItemTypeType extends ItemType>(linkType: ItemType, linkIdArray: ItemId[], itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType> & {
265
+ editItems: true;
266
+ }): PromiseInterface<CollectionResourceParentIdMap<CollectionViewResource<ItemTypeType, EditResource<ItemTypeType>>>>;
267
+ getLinkCollections<ItemTypeType extends ItemType>(linkType: ItemType, linkIdArray: ItemId[], itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType> & {
268
+ remoteItems: true;
269
+ }): PromiseInterface<CollectionResourceParentIdMap<CollectionViewResource<ItemTypeType, RemoteViewResource<ItemTypeType>>>>;
270
+ getLinkCollections<ItemTypeType extends ItemType>(linkType: ItemType, linkIdArray: ItemId[], itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType>): PromiseInterface<CollectionResourceParentIdMap<CollectionViewResource<ItemTypeType, LocalViewResource<ItemTypeType>>>>;
271
+ getCollectionFromDef<ItemTypeType extends ItemType>(definition: CollectionDefinition<ItemTypeType>): PromiseInterface<CollectionResource<ItemTypeType>>;
272
+ getCollection<ItemTypeType extends ItemType>(itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType> & {
273
+ editCollection: true;
274
+ editItems: true;
275
+ }): PromiseInterface<CollectionEditResource<ItemTypeType, EditResource<ItemTypeType>>>;
276
+ getCollection<ItemTypeType extends ItemType>(itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType> & {
277
+ editItems: true;
278
+ }): PromiseInterface<CollectionViewResource<ItemTypeType, EditResource<ItemTypeType>>>;
279
+ getCollection<ItemTypeType extends ItemType>(itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType> & {
280
+ editCollection: true;
281
+ remoteItems: true;
282
+ }): PromiseInterface<CollectionEditResource<ItemTypeType, RemoteViewResource<ItemTypeType>>>;
283
+ getCollection<ItemTypeType extends ItemType>(itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType> & {
284
+ remoteItems: true;
285
+ }): PromiseInterface<CollectionViewResource<ItemTypeType, RemoteViewResource<ItemTypeType>>>;
286
+ getCollection<ItemTypeType extends ItemType>(itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType> & {
287
+ editCollection: true;
288
+ }): PromiseInterface<CollectionEditResource<ItemTypeType, LocalViewResource<ItemTypeType>>>;
289
+ getCollection<ItemTypeType extends ItemType>(itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType>): PromiseInterface<CollectionViewResource<ItemTypeType, LocalViewResource<ItemTypeType>>>;
290
+ getCollectionDef<ItemTypeType extends ItemType>(itemType: ItemTypeType, options: CollectionOptionsInterface<ItemTypeType>): CollectionDefinition<ItemTypeType>;
291
+ getLinkCollectionsDef<ItemTypeType extends ItemType>(itemType: ItemTypeType, linkField: string, options: CollectionOptionsInterface<ItemTypeType>): LinkCollectionDefinition<ItemTypeType>;
292
+ getItemByState<ItemTypeType extends ItemType>(itemType: ItemTypeType, stateKey: ItemId | string, options: ItemOptionsInterface & {
293
+ edit: true;
294
+ }, isRoot?: boolean): PromiseInterface<EditResource<ItemTypeType>>;
295
+ getItemByState<ItemTypeType extends ItemType>(itemType: ItemTypeType, stateKey: ItemId | string, options: ItemOptionsInterface & {
296
+ remote: true;
297
+ }, isRoot?: boolean): PromiseInterface<RemoteViewResource<ItemTypeType>>;
298
+ getItemByState<ItemTypeType extends ItemType>(itemType: ItemTypeType, stateKey: ItemId | string, options: ItemOptionsInterface, isRoot?: boolean): PromiseInterface<LocalViewResource<ItemTypeType>>;
299
+ getDuplicateById<ItemTypeType extends ItemType>(itemType: ItemTypeType, duplicateId: ItemId, options: ItemOptionsInterface, returnLinks: true, isRoot?: boolean): PromiseInterface<EditResourceLinks<ItemTypeType>>;
300
+ getDuplicateById<ItemTypeType extends ItemType>(itemType: ItemTypeType, duplicateId: ItemId, options: ItemOptionsInterface, returnLinks?: boolean, isRoot?: boolean): PromiseInterface<EditResource<ItemTypeType>>;
301
+ getNewResourceWithId<ItemTypeType extends ItemType>(itemType: ItemTypeType, itemId: ItemId, options: ItemOptionsInterface, returnLinks: true, isRoot?: boolean): PromiseInterface<EditResourceLinks<ItemTypeType>>;
302
+ getNewResourceWithId<ItemTypeType extends ItemType>(itemType: ItemTypeType, itemId: ItemId, options: ItemOptionsInterface, returnLinks?: boolean, isRoot?: boolean): PromiseInterface<EditResource<ItemTypeType>>;
303
+ getNewResource<ItemTypeType extends ItemType>(itemType: ItemTypeType, options: ItemOptionsInterface, returnLinks: true, isRoot?: boolean): PromiseInterface<EditResourceLinks<ItemTypeType>>;
304
+ getNewResource<ItemTypeType extends ItemType>(itemType: ItemTypeType, options: ItemOptionsInterface, returnLinks?: boolean, isRoot?: boolean): PromiseInterface<EditResource<ItemTypeType>>;
305
+ getItemsByQuery<ItemTypeType extends ItemType>(itemType: ItemTypeType, query: ApiQuery, options: ItemOptionsInterface & {
306
+ edit: true;
307
+ }): PromiseInterface<Array<EditResource<ItemTypeType>>>;
308
+ getItemsByQuery<ItemTypeType extends ItemType>(itemType: ItemTypeType, query: ApiQuery, options: ItemOptionsInterface & {
309
+ remote: true;
310
+ }): PromiseInterface<Array<RemoteViewResource<ItemTypeType>>>;
311
+ getItemsByQuery<ItemTypeType extends ItemType>(itemType: ItemTypeType, query: ApiQuery, options: ItemOptionsInterface): PromiseInterface<Array<LocalViewResource<ItemTypeType>>>;
312
+ getItemsById<ItemTypeType extends ItemType>(itemType: ItemTypeType, itemIds: ItemId[], options: ItemOptionsInterface & {
313
+ edit: true;
314
+ }): PromiseInterface<Array<EditResource<ItemTypeType>>>;
315
+ getItemsById<ItemTypeType extends ItemType>(itemType: ItemTypeType, itemIds: ItemId[], options: ItemOptionsInterface & {
316
+ remote: true;
317
+ }): PromiseInterface<Array<RemoteViewResource<ItemTypeType>>>;
318
+ getItemsById<ItemTypeType extends ItemType>(itemType: ItemTypeType, itemIds: ItemId[], options: ItemOptionsInterface): PromiseInterface<Array<LocalViewResource<ItemTypeType>>>;
319
+ getItemById<ItemTypeType extends ItemType>(itemType: ItemTypeType, itemId: ItemId, options: ItemOptionsInterface & {
320
+ edit: true;
321
+ }, isRoot?: boolean): PromiseInterface<EditResource<ItemTypeType>>;
322
+ getItemById<ItemTypeType extends ItemType>(itemType: ItemTypeType, itemId: ItemId, options: ItemOptionsInterface & {
323
+ remote: true;
324
+ }, isRoot?: boolean): PromiseInterface<RemoteViewResource<ItemTypeType>>;
325
+ getItemById<ItemTypeType extends ItemType>(itemType: ItemTypeType, itemId: ItemId, options: ItemOptionsInterface, isRoot?: boolean): PromiseInterface<LocalViewResource<ItemTypeType>>;
326
+ /**
327
+ * @description
328
+ * Fetches the title of an item, does not create an {@link ItemResource ItemResource}
329
+ */
330
+ fetchTitle(itemType: ItemType, itemId: ItemId): PromiseInterface<string>;
331
+ /**
332
+ * @description
333
+ * Merges the passed child Transaction into this transaction and then propagates them to the other child transactions
334
+ */
335
+ applyChangesFromChild(childTransaction: TransactionCache, _breakUpByParent?: boolean, _onAfterCreateCallback?: OnAfterCreateCallback): PromiseInterface<ItemIdConversionMap>;
336
+ /**
337
+ * @description
338
+ * Gets an already cached {@link ItemEntry ItemEntry} and the changes of this specific transaction for that entry
339
+ */
340
+ getLocalItemEntryChangesTuple(itemEntryId: ItemEntry['id']): {
341
+ entry: ItemEntry;
342
+ changes: TransactionItemEntryChanges;
343
+ };
344
+ /**
345
+ * @description
346
+ * Gets an ItemEntry from the cache, doesn't do a API request, used for saving
347
+ */
348
+ getLocalItemEntry(itemEntryId: ItemEntry['id']): ItemEntry | undefined;
349
+ /**
350
+ * @description
351
+ * Gets an ItemEntry from the cache by ItemId
352
+ */
353
+ getLocalItemEntryByItemId(itemType: ItemType, itemId: ItemEntry['itemId']): ItemEntry | undefined;
354
+ /**
355
+ * @description
356
+ * Gets an CollectionEntry from the cache, doesn't do a API request, used for saving
357
+ */
358
+ getLocalCollectionEntry(collectionEntryId: CollectionEntry['id']): CollectionEntry | undefined;
359
+ /**
360
+ * @description
361
+ * 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
362
+ * won't be included
363
+ */
364
+ getDelta(): InternalChangesDelta;
365
+ createItemResource<ItemTypeType extends ItemType>(itemEntry: ItemEntry<ItemTypeType>, options: ItemOptionsInterface<EditResource<ItemTypeType>> & {
366
+ edit: true;
367
+ }, isRoot?: boolean, isNew?: boolean): EditResource<ItemTypeType>;
368
+ createItemResource<ItemTypeType extends ItemType>(itemEntry: ItemEntry<ItemTypeType>, options: ItemOptionsInterface<RemoteViewResource<ItemTypeType>> & {
369
+ remote: true;
370
+ }, isRoot?: boolean, isNew?: boolean): RemoteViewResource<ItemTypeType>;
371
+ createItemResource<ItemTypeType extends ItemType>(itemEntry: ItemEntry<ItemTypeType>, options: ItemOptionsInterface<LocalViewResource<ItemTypeType>>, isRoot?: boolean, isNew?: boolean): LocalViewResource<ItemTypeType>;
372
+ createItemResources<ItemTypeType extends ItemType>(itemEntries: Array<ItemEntry<ItemTypeType>>, options: ItemOptionsInterface & {
373
+ edit: true;
374
+ }): Array<EditResource<ItemTypeType>>;
375
+ createItemResources<ItemTypeType extends ItemType>(itemEntries: Array<ItemEntry<ItemTypeType>>, options: ItemOptionsInterface & {
376
+ remote: true;
377
+ }): Array<RemoteViewResource<ItemTypeType>>;
378
+ createItemResources<ItemTypeType extends ItemType>(itemEntries: Array<ItemEntry<ItemTypeType>>, options: ItemOptionsInterface): Array<LocalViewResource<ItemTypeType>>;
379
+ processLinkedItems<ItemTypeType extends ItemType>(linkedEntries: ItemTypeMap<ItemEntry[]>, options: ItemOptionsInterface & {
380
+ edit: true;
381
+ }): ItemResourcesItemTypeMap<EditResource<ItemTypeType>>;
382
+ processLinkedItems<ItemTypeType extends ItemType>(linkedEntries: ItemTypeMap<ItemEntry[]>, options: ItemOptionsInterface & {
383
+ remote: true;
384
+ }): ItemResourcesItemTypeMap<RemoteViewResource<ItemTypeType>>;
385
+ processLinkedItems<ItemTypeType extends ItemType>(linkedEntries: ItemTypeMap<ItemEntry[]>, options: ItemOptionsInterface): ItemResourcesItemTypeMap<LocalViewResource<ItemTypeType>>;
386
+ createCollectionResource<ItemTypeType extends ItemType>(collectionEntry: CollectionEntry<ItemTypeType>, resourceOptions: CollectionResourceOptionsInterface<ItemTypeType> & {
387
+ editItems: true;
388
+ editCollection: true;
389
+ }): CollectionEditResource<ItemTypeType, EditResource<ItemTypeType>>;
390
+ createCollectionResource<ItemTypeType extends ItemType>(collectionEntry: CollectionEntry<ItemTypeType>, resourceOptions: CollectionResourceOptionsInterface<ItemTypeType> & {
391
+ remoteItems: true;
392
+ editCollection: true;
393
+ }): CollectionEditResource<ItemTypeType, RemoteViewResource<ItemTypeType>>;
394
+ createCollectionResource<ItemTypeType extends ItemType>(collectionEntry: CollectionEntry<ItemTypeType>, resourceOptions: CollectionResourceOptionsInterface<ItemTypeType> & {
395
+ editCollection: true;
396
+ }): CollectionEditResource<ItemTypeType, LocalViewResource<ItemTypeType>>;
397
+ createCollectionResource<ItemTypeType extends ItemType>(collectionEntry: CollectionEntry<ItemTypeType>, resourceOptions: CollectionResourceOptionsInterface<ItemTypeType> & {
398
+ editItems: true;
399
+ }): CollectionViewResource<ItemTypeType, EditResource<ItemTypeType>>;
400
+ createCollectionResource<ItemTypeType extends ItemType>(collectionEntry: CollectionEntry<ItemTypeType>, resourceOptions: CollectionResourceOptionsInterface<ItemTypeType> & {
401
+ remoteItems: true;
402
+ }): CollectionViewResource<ItemTypeType, RemoteViewResource<ItemTypeType>>;
403
+ createCollectionResource<ItemTypeType extends ItemType>(collectionEntry: CollectionEntry<ItemTypeType>, resourceOptions: CollectionResourceOptionsInterface<ItemTypeType>): CollectionViewResource<ItemTypeType, LocalViewResource<ItemTypeType>>;
404
+ getChangesFromItemChanges<ItemTypeType extends ItemType = any>(changesObject: TransactionItemEntryChanges<ItemTypeType>): FieldMap<ItemTypeType>;
405
+ private createCollectionResources;
406
+ /**
407
+ * @description
408
+ * Fetches all required columns to match/fit in collections
409
+ */
410
+ private expandItemsFromDelta;
411
+ }
412
+ export {};