From bec5ad6c95c6c626bae951acc934ff91903e3283 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 20 Dec 2024 12:38:57 +0100 Subject: [PATCH] More typing --- .../frontend-core/src/components/grid/stores/columns.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/frontend-core/src/components/grid/stores/columns.ts b/packages/frontend-core/src/components/grid/stores/columns.ts index 9a85918d6d..a457ca0caf 100644 --- a/packages/frontend-core/src/components/grid/stores/columns.ts +++ b/packages/frontend-core/src/components/grid/stores/columns.ts @@ -1,6 +1,6 @@ import { derived, get, Readable, Writable, writable } from "svelte/store" import { DefaultColumnWidth, GutterWidth } from "../lib/constants" -import { CalculationType, FieldSchema } from "@budibase/types" +import { CalculationType, FieldSchema, FieldType } from "@budibase/types" import { Store as StoreContext } from "." export interface Store { @@ -26,6 +26,9 @@ type Column = FieldSchema & { } primaryDisplay?: boolean schema?: { + disabled: boolean + type: FieldType + readonly: boolean autocolumn: boolean } calculationType: CalculationType @@ -112,7 +115,7 @@ export const createActions = (context: StoreContext) => { const { columns, datasource } = context // Updates the width of all columns - const changeAllColumnWidths = async width => { + const changeAllColumnWidths = async (width: number) => { const $columns = get(columns) $columns.forEach(column => { const { related } = column @@ -131,7 +134,7 @@ export const createActions = (context: StoreContext) => { } // Checks if a column is readonly - const isReadonly = column => { + const isReadonly = (column: Column) => { if (!column?.schema) { return false }