diff --git a/packages/frontend-core/src/components/grid/stores/filter.ts b/packages/frontend-core/src/components/grid/stores/filter.ts index 5eb67b6e7e..4061ee04d7 100644 --- a/packages/frontend-core/src/components/grid/stores/filter.ts +++ b/packages/frontend-core/src/components/grid/stores/filter.ts @@ -1,9 +1,20 @@ -import { get, derived } from "svelte/store" +import { get, derived, Writable } from "svelte/store" import { FieldType, UILogicalOperator } from "@budibase/types" import { Store as StoreContext } from "." import { memo } from "../../../utils/memo" -export const createStores = (context: StoreContext) => { +export interface FilterStore { + filter: Writable + inlineFilters: Writable +} + +export interface FilterDerivedStore { + allFilters: Writable +} + +export type Store = FilterStore & FilterDerivedStore + +export const createStores = (context: StoreContext): FilterStore => { const { props } = context // Initialise to default props diff --git a/packages/frontend-core/src/components/grid/stores/index.ts b/packages/frontend-core/src/components/grid/stores/index.ts index 59293f579b..659f45d56a 100644 --- a/packages/frontend-core/src/components/grid/stores/index.ts +++ b/packages/frontend-core/src/components/grid/stores/index.ts @@ -63,12 +63,10 @@ export type Store = BaseStore & Datasource.Store & Validation.Store & Users.Store & - Menu.Store & { + Menu.Store & + Filter.Store & { // TODO while typing the rest of stores fetch: Writable - filter: Writable - inlineFilters: Writable - allFilters: Writable sort: Writable initialFilter: Writable initialSortColumn: Writable