From 9d1d4d0abf06699658538b80b2eb731c8f5ef192 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 30 Dec 2024 12:47:09 +0100 Subject: [PATCH] Cleanup types --- .../src/components/grid/stores/config.ts | 17 ++--------------- .../src/components/grid/stores/index.ts | 12 ++++++------ 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/packages/frontend-core/src/components/grid/stores/config.ts b/packages/frontend-core/src/components/grid/stores/config.ts index c6a3f86386..e334b58495 100644 --- a/packages/frontend-core/src/components/grid/stores/config.ts +++ b/packages/frontend-core/src/components/grid/stores/config.ts @@ -3,21 +3,8 @@ import { derived, Readable } from "svelte/store" import { ViewV2Type } from "@budibase/types" import { BaseStoreProps, Store as StoreContext } from "." -interface ConfigStore { - datasource: Readable - initialSortColumn: Readable - initialSortOrder: Readable - initialFilter: Readable - fixedRowHeight: Readable - schemaOverrides: Readable - notifySuccess: Readable - notifyError: Readable - canAddRows?: Readable - canEditRows?: Readable - canDeleteRows?: Readable - canEditColumns?: Readable - canExpandRows?: Readable - canSaveSchema?: Readable +type ConfigStore = { + [key in keyof BaseStoreProps]: Readable } interface ConfigDerivedStore { diff --git a/packages/frontend-core/src/components/grid/stores/index.ts b/packages/frontend-core/src/components/grid/stores/index.ts index d4c589fcf7..30a1a923f2 100644 --- a/packages/frontend-core/src/components/grid/stores/index.ts +++ b/packages/frontend-core/src/components/grid/stores/index.ts @@ -67,12 +67,12 @@ export interface BaseStoreProps { > | null notifySuccess: (message: string) => void notifyError: (message: string) => void - canAddRows: boolean - canEditRows: boolean - canDeleteRows: boolean - canEditColumns: boolean - canExpandRows: boolean - canSaveSchema: boolean + canAddRows?: boolean + canEditRows?: boolean + canDeleteRows?: boolean + canEditColumns?: boolean + canExpandRows?: boolean + canSaveSchema?: boolean } export interface BaseStore {