@devisfuture/mega-collection 2.4.3 → 2.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-BJZg_1dI.mjs +183 -0
- package/dist/chunk-BURK5sks.mjs +505 -0
- package/dist/chunk-C5Zpu_ol.mjs +18 -0
- package/dist/filter/index.d.mts +4 -110
- package/dist/filter/index.mjs +891 -1
- package/dist/index.d.mts +4 -2
- package/dist/index.mjs +2 -1
- package/dist/merge/index.d.mts +4 -127
- package/dist/merge/index.mjs +2 -1
- package/dist/search/index.d.mts +4 -189
- package/dist/search/index.mjs +1010 -5
- package/dist/sort/index.d.mts +4 -54
- package/dist/sort/index.mjs +416 -1
- package/package.json +19 -8
- package/dist/State-2vKzwNrQ.d.mts +0 -44
- package/dist/chunk-IZXO22NQ.mjs +0 -1
- package/dist/chunk-MB56OSRQ.mjs +0 -1
- package/dist/types-DONld7xY.d.mts +0 -74
package/dist/filter/index.d.mts
CHANGED
|
@@ -1,110 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
|
|
5
|
-
interface FilterEngineChain<T extends CollectionItem> {
|
|
6
|
-
filter(criteria: FilterCriterion<T>[]): T[] & FilterEngineChain<T>;
|
|
7
|
-
filter(data: T[], criteria: FilterCriterion<T>[]): T[] & FilterEngineChain<T>;
|
|
8
|
-
getOriginData(): T[];
|
|
9
|
-
add(items: T[]): FilterEngine<T>;
|
|
10
|
-
update(descriptor: UpdateDescriptor<T>): FilterEngine<T>;
|
|
11
|
-
data(data: T[]): FilterEngine<T>;
|
|
12
|
-
clearIndexes(): FilterEngine<T>;
|
|
13
|
-
clearData(): FilterEngine<T>;
|
|
14
|
-
resetFilterState(): FilterEngine<T>;
|
|
15
|
-
}
|
|
16
|
-
interface FilterEngineOptions<T extends CollectionItem = CollectionItem> {
|
|
17
|
-
data?: T[];
|
|
18
|
-
mutableExcludeField?: keyof T & string;
|
|
19
|
-
fields?: (keyof T & string)[];
|
|
20
|
-
nestedFields?: string[];
|
|
21
|
-
filterByPreviousResult?: boolean;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* FilterEngine class for filtering collections by multiple criteria,
|
|
26
|
-
* supporting indexed lookups and linear scans for large datasets.
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
declare class FilterEngine<T extends CollectionItem> {
|
|
30
|
-
private readonly indexer;
|
|
31
|
-
private readonly filterByPreviousResult;
|
|
32
|
-
private readonly mutableExcludeField;
|
|
33
|
-
private readonly state;
|
|
34
|
-
private readonly namespace;
|
|
35
|
-
private readonly nestedCollection;
|
|
36
|
-
private readonly chainBuilder;
|
|
37
|
-
/**
|
|
38
|
-
* Creates a new FilterEngine with optional data and fields to index.
|
|
39
|
-
*/
|
|
40
|
-
constructor(options?: FilterEngineOptions<T> & {
|
|
41
|
-
state?: State<T>;
|
|
42
|
-
});
|
|
43
|
-
private get dataset();
|
|
44
|
-
private get runtime();
|
|
45
|
-
private get mutableExcludeState();
|
|
46
|
-
private get indexedFields();
|
|
47
|
-
private get sequentialCache();
|
|
48
|
-
private shouldDeferMutationIndexUpdates;
|
|
49
|
-
private markDeferredMutationState;
|
|
50
|
-
private ensureRuntimeReady;
|
|
51
|
-
private rebuildConfiguredIndexes;
|
|
52
|
-
/**
|
|
53
|
-
* Builds an index for the given field.
|
|
54
|
-
*/
|
|
55
|
-
private buildIndex;
|
|
56
|
-
clearIndexes(): this;
|
|
57
|
-
resetFilterState(): this;
|
|
58
|
-
clearData(): this;
|
|
59
|
-
data(data: T[]): this;
|
|
60
|
-
add(items: T[]): this;
|
|
61
|
-
update(descriptor: UpdateDescriptor<T>): this;
|
|
62
|
-
private applyAddedItems;
|
|
63
|
-
getOriginData(): T[];
|
|
64
|
-
/**
|
|
65
|
-
* Filters the data based on the given criteria.
|
|
66
|
-
*/
|
|
67
|
-
filter(criteria: FilterCriterion<T>[]): T[] & FilterEngineChain<T>;
|
|
68
|
-
filter(data: T[], criteria: FilterCriterion<T>[]): T[] & FilterEngineChain<T>;
|
|
69
|
-
rawFilter(criteria: FilterCriterion<T>[]): T[];
|
|
70
|
-
rawFilter(data: T[], criteria: FilterCriterion<T>[]): T[];
|
|
71
|
-
private resolveWithSequentialCache;
|
|
72
|
-
private withChain;
|
|
73
|
-
private handleStateMutation;
|
|
74
|
-
private rebuildMutableExcludeState;
|
|
75
|
-
private updateMutableExcludeStateForAddedItems;
|
|
76
|
-
private applyMutableExclude;
|
|
77
|
-
private applyUpdatedItem;
|
|
78
|
-
private applyRemovedItem;
|
|
79
|
-
private applyRemovedItems;
|
|
80
|
-
private updateMutableExcludeStateForUpdatedItem;
|
|
81
|
-
private clearMutableExcludeState;
|
|
82
|
-
private registerMutableExcludeValue;
|
|
83
|
-
private unregisterMutableExcludeValue;
|
|
84
|
-
/**
|
|
85
|
-
* Filters data linearly without index.
|
|
86
|
-
*/
|
|
87
|
-
private linearFilter;
|
|
88
|
-
/**
|
|
89
|
-
* Filters data using the index.
|
|
90
|
-
*/
|
|
91
|
-
private filterViaIndex;
|
|
92
|
-
/**
|
|
93
|
-
* Estimates the size of the index for a criterion.
|
|
94
|
-
*/
|
|
95
|
-
private estimateIndexSize;
|
|
96
|
-
private applyIndexedExclusions;
|
|
97
|
-
private createEmptyResult;
|
|
98
|
-
private storePreviousResult;
|
|
99
|
-
private createCriteriaCacheKey;
|
|
100
|
-
private createSequentialCacheEntry;
|
|
101
|
-
private createSequentialExecutionCriteria;
|
|
102
|
-
private hasCriteriaBacktrack;
|
|
103
|
-
private canApplySequentiallyToEmptyResult;
|
|
104
|
-
private createCriteriaStateMap;
|
|
105
|
-
private isCriterionBacktracked;
|
|
106
|
-
private isSubset;
|
|
107
|
-
private areSetsEqual;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
export { CollectionItem, FilterCriterion, FilterEngine, type FilterEngineChain, type FilterEngineOptions };
|
|
1
|
+
export { FilterEngine } from "./filter";
|
|
2
|
+
export type { FilterEngineOptions, FilterEngineChain } from "./types";
|
|
3
|
+
export type { CollectionItem, IndexableKey, FilterCriterion } from "../types";
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|