Type datasource table

This commit is contained in:
Adria Navarro 2024-12-20 14:06:42 +01:00
parent 546f193af7
commit 23478cc8f3
2 changed files with 17 additions and 5 deletions

View File

@ -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,

View File

@ -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<any>
definition: Writable<any>
enrichedSchema: any
enrichedSchema: Writable<any>
fetch: Writable<any>
filter: Writable<any>
inlineFilters: Writable<any>
allFilters: Writable<any>
sort: Writable<any>
table: Writable<any> & { actions: any }
initialFilter: Writable<any>
initialSortColumn: Writable<any>
initialSortOrder: Writable<any>
}
export const attachStores = (context: Store): Store => {