diff --git a/packages/frontend-core/src/components/grid/stores/columns.ts b/packages/frontend-core/src/components/grid/stores/columns.ts index b5897769cd..219f604c9b 100644 --- a/packages/frontend-core/src/components/grid/stores/columns.ts +++ b/packages/frontend-core/src/components/grid/stores/columns.ts @@ -3,11 +3,11 @@ import { DefaultColumnWidth, GutterWidth } from "../lib/constants" import { CalculationType, FieldSchema, FieldType } from "@budibase/types" import { Store as StoreContext } from "." -export interface Store { +interface ColumnStore { columns: Writable } -export interface DerivedStore { +interface DerivedColumnStore { tableColumns: Readable displayColumn: Readable columnLookupMap: Readable> @@ -16,6 +16,8 @@ export interface DerivedStore { hasNonAutoColumn: Readable } +export type Store = ColumnStore & DerivedColumnStore + type Column = FieldSchema & { label: string readonly: boolean @@ -34,7 +36,7 @@ type Column = FieldSchema & { calculationType: CalculationType } -export const createStores = (): Store => { +export const createStores = (): ColumnStore => { const columns = writable([]) // Enrich columns with metadata about their display position @@ -63,7 +65,7 @@ export const createStores = (): Store => { } } -export const deriveStores = (context: StoreContext): DerivedStore => { +export const deriveStores = (context: StoreContext): DerivedColumnStore => { const { columns } = context // Derive a lookup map for all columns by name diff --git a/packages/frontend-core/src/components/grid/stores/index.ts b/packages/frontend-core/src/components/grid/stores/index.ts index 602dfa969a..56ad5b9b48 100644 --- a/packages/frontend-core/src/components/grid/stores/index.ts +++ b/packages/frontend-core/src/components/grid/stores/index.ts @@ -50,14 +50,13 @@ const DependencyOrderedStores = [ Cache, ] -export type Store = Columns.Store & - Columns.DerivedStore & { - // TODO while typing the rest of stores - datasource: any - definition: Writable - displayColumn: Writable - enrichedSchema: any - } +export type Store = Columns.Store & { + // TODO while typing the rest of stores + datasource: any + definition: Writable + displayColumn: Writable + enrichedSchema: any +} export const attachStores = (context): Store => { // Atomic store creation