import type { Snippet } from 'svelte'; import type { Options } from '../../utils/options.js'; export type Primitive = string | number | boolean | Date; export type ItemBase = { id: string | number; }; export type TableField = (TableFieldCommon & TableFieldPrimitve) | (TableFieldCommon & TableFieldSelect); type TableFieldCommon = { key: string; label: string; options?: Options; hint?: string; locked?: boolean; visible?: boolean; sortable?: boolean; /** Internal usage */ _visible?: boolean; cell: ((item: Item) => Snippet<[Item]>) | ((item: Item) => null | undefined | Primitive | Primitive[]); head?: Snippet<[Item]>; }; type TableFieldPrimitve = { type?: 'string' | 'textarea' | 'number' | 'boolean' | 'date'; }; type TableFieldSelect = { type: 'select' | 'multiselect'; options: Options; }; /** * Initialise fields from url query */ export declare function syncFieldsWithParams(tablekey: string, fields: TableField[]): ({ _visible: boolean; key: string; label: string; options?: Options; hint?: string; locked?: boolean; visible?: boolean; sortable?: boolean; cell: ((item: Item) => Snippet<[Item]>) | ((item: Item) => null | undefined | Primitive | Primitive[]); head?: Snippet<[Item]> | undefined; type?: "string" | "textarea" | "number" | "boolean" | "date"; } | { _visible: boolean; key: string; label: string; options: (Options | undefined) & Options; hint?: string; locked?: boolean; visible?: boolean; sortable?: boolean; cell: ((item: Item) => Snippet<[Item]>) | ((item: Item) => null | undefined | Primitive | Primitive[]); head?: Snippet<[Item]> | undefined; type: "select" | "multiselect"; })[]; export {};