import type { Snippet } from "svelte"; import type { SchemaValue } from "../core/index.js"; import type { ComponentProps, ComponentType, Config, FieldErrors, FoundationalComponentType, UiOption } from "../form/index.js"; export interface TemplateCommonProps { type: "template"; value: V | null | undefined; config: Config; uiOption: UiOption; errors: FieldErrors; children: Snippet; } export type TemplateType = keyof { [T in ComponentType as ComponentProps[T] extends TemplateCommonProps ? T : never]: T; }; declare module "../form/index.js" { interface FoundationalComponents { fieldTemplate: {}; } interface ComponentProps { fieldTemplate: TemplateCommonProps & { showTitle: boolean; useLabel: boolean; widgetType: FoundationalComponentType; action?: Snippet; }; } interface ComponentBindings { fieldTemplate: ""; } }