diff --git a/packages/frontend-core/src/components/grid/stores/datasources/table.js b/packages/frontend-core/src/components/grid/stores/datasources/table.ts similarity index 94% rename from packages/frontend-core/src/components/grid/stores/datasources/table.js rename to packages/frontend-core/src/components/grid/stores/datasources/table.ts index bb7bf0835e..5bf28f67e2 100644 --- a/packages/frontend-core/src/components/grid/stores/datasources/table.js +++ b/packages/frontend-core/src/components/grid/stores/datasources/table.ts @@ -1,9 +1,10 @@ import { SortOrder } from "@budibase/types" import { get } from "svelte/store" +import { Store as StoreContext } from ".." const SuppressErrors = true -export const createActions = context => { +export const createActions = (context: StoreContext) => { const { API, datasource, columns } = context const saveDefinition = async newDefinition => { @@ -58,7 +59,7 @@ export const createActions = context => { } } -export const initialise = context => { +export const initialise = (context: StoreContext) => { const { datasource, fetch, diff --git a/packages/frontend-core/src/components/grid/stores/index.ts b/packages/frontend-core/src/components/grid/stores/index.ts index 763a33c398..60f93b25fe 100644 --- a/packages/frontend-core/src/components/grid/stores/index.ts +++ b/packages/frontend-core/src/components/grid/stores/index.ts @@ -50,14 +50,25 @@ const DependencyOrderedStores = [ Cache, ] -export interface BaseStore {} +export interface BaseStore { + API: any +} export type Store = BaseStore & Columns.Store & { // TODO while typing the rest of stores - datasource: any + datasource: Writable definition: Writable - enrichedSchema: any + enrichedSchema: Writable + fetch: Writable + filter: Writable + inlineFilters: Writable + allFilters: Writable + sort: Writable + table: Writable & { actions: any } + initialFilter: Writable + initialSortColumn: Writable + initialSortOrder: Writable } export const attachStores = (context: Store): Store => {