@budibase/shared-core 3.5.0 → 3.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/filters.d.ts +5 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +9 -9
- package/dist/index.js.map +3 -3
- package/package.json +2 -2
package/dist/filters.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Datasource, BBReferenceFieldSubType, FieldType, FormulaType, LegacyFilter, SearchFilters, SearchQueryFields, SortType, FieldConstraints, SortOrder,
|
|
1
|
+
import { Datasource, BBReferenceFieldSubType, FieldType, FormulaType, LegacyFilter, SearchFilters, SearchQueryFields, SortType, FieldConstraints, SortOrder, EmptyFilterOption, SearchResponse, Table, UISearchFilter, SearchFilter, WithRequired, SearchParams } from "@budibase/types";
|
|
2
2
|
/**
|
|
3
3
|
* Returns the valid operator options for a certain data type
|
|
4
4
|
*/
|
|
@@ -74,7 +74,9 @@ export declare function splitFiltersArray(filters: LegacyFilter[]): LegacyFilter
|
|
|
74
74
|
*/
|
|
75
75
|
export declare function buildQuery(filter?: UISearchFilter | LegacyFilter[]): SearchFilters;
|
|
76
76
|
export declare function fixupFilterArrays(filters: SearchFilters): SearchFilters;
|
|
77
|
-
|
|
77
|
+
type SearchQuery = WithRequired<Pick<SearchParams, "query" | "sort" | "sortOrder" | "sortType" | "limit" | "countRows">, "query">;
|
|
78
|
+
export type InMemorySearchQuery = SearchQuery;
|
|
79
|
+
export declare function search<T extends Record<string, any>>(docs: T[], query: SearchQuery): SearchResponse<T>;
|
|
78
80
|
/**
|
|
79
81
|
* Performs a client-side search on an array of data
|
|
80
82
|
* @param docs the data
|
|
@@ -98,3 +100,4 @@ export declare function sort<T extends Record<string, any>>(docs: T[], sort: key
|
|
|
98
100
|
*/
|
|
99
101
|
export declare function limit<T>(docs: T[], limit: string | number): T[];
|
|
100
102
|
export declare const hasFilters: (query?: SearchFilters) => boolean;
|
|
103
|
+
export {};
|