/** * This file was automatically generated by json-schema-to-typescript. * DO NOT MODIFY IT BY HAND. Instead, modify python types, then run * `fastui generate `. */ export type FastProps = | Text | Paragraph | PageTitle | Div | Page | Heading | Markdown | Code | Json | Button | Link | LinkList | Navbar | Footer | Modal | ServerLoad | Image | Iframe | Video | FireEvent | Error | Spinner | Custom | Table | Pagination | Display | Details | Form | FormFieldInput | FormFieldTextarea | FormFieldBoolean | FormFieldFile | FormFieldSelect | FormFieldSelectSearch | ModelForm | Toast export type ClassName = | string | ClassName[] | { [k: string]: boolean } export type JsonData = | string | number | boolean | null | JsonData[] | { [k: string]: JsonData } export type AnyEvent = PageEvent | GoToEvent | BackEvent | AuthEvent /** * Display mode for a value. */ export type DisplayMode = | 'auto' | 'plain' | 'datetime' | 'date' | 'duration' | 'as_title' | 'markdown' | 'json' | 'inline_code' | 'currency' /** * Display mode for a value. */ export type DisplayMode1 = | 'auto' | 'plain' | 'datetime' | 'date' | 'duration' | 'as_title' | 'markdown' | 'json' | 'inline_code' | 'currency' export type SelectOptions = SelectOption[] | SelectGroup[] /** * Text component that displays a string. */ export interface Text { text: string type: 'Text' } /** * Paragraph component that displays a string as a paragraph. */ export interface Paragraph { text: string className?: | string | ClassName[] | { [k: string]: boolean } type: 'Paragraph' } /** * Sets the title of the HTML page via the `document.title` property. */ export interface PageTitle { text: string type: 'PageTitle' } /** * A generic container component. */ export interface Div { components: FastProps[] className?: | string | ClassName[] | { [k: string]: boolean } type: 'Div' } /** * Similar to `container` in many UI frameworks, this acts as a root component for most pages. */ export interface Page { components: FastProps[] className?: | string | ClassName[] | { [k: string]: boolean } type: 'Page' } /** * Heading component. */ export interface Heading { text: string level: 1 | 2 | 3 | 4 | 5 | 6 htmlId?: string className?: | string | ClassName[] | { [k: string]: boolean } type: 'Heading' } /** * Markdown component that renders markdown text. */ export interface Markdown { text: string codeStyle?: string className?: | string | ClassName[] | { [k: string]: boolean } type: 'Markdown' } /** * Code component that renders code with syntax highlighting. */ export interface Code { text: string language?: string codeStyle?: string className?: | string | ClassName[] | { [k: string]: boolean } type: 'Code' } /** * JSON component that renders JSON data. */ export interface Json { value: JsonData className?: | string | ClassName[] | { [k: string]: boolean } type: 'JSON' } /** * Button component. */ export interface Button { text: string onClick?: PageEvent | GoToEvent | BackEvent | AuthEvent htmlType?: 'button' | 'reset' | 'submit' namedStyle?: 'primary' | 'secondary' | 'warning' className?: | string | ClassName[] | { [k: string]: boolean } type: 'Button' } export interface PageEvent { name: string pushPath?: string context?: ContextType clear?: boolean nextEvent?: PageEvent | GoToEvent | BackEvent | AuthEvent type: 'page' } export interface ContextType { [k: string]: string | number } export interface GoToEvent { url?: string query?: { [k: string]: string | number } target?: '_blank' type: 'go-to' } export interface BackEvent { type: 'back' } export interface AuthEvent { token: string | false url?: string type: 'auth' } /** * Link component. */ export interface Link { components: FastProps[] onClick?: PageEvent | GoToEvent | BackEvent | AuthEvent mode?: 'navbar' | 'footer' | 'tabs' | 'vertical' | 'pagination' active?: string | boolean locked?: boolean className?: | string | ClassName[] | { [k: string]: boolean } type: 'Link' } /** * List of Link components. */ export interface LinkList { links: Link[] mode?: 'tabs' | 'vertical' | 'pagination' className?: | string | ClassName[] | { [k: string]: boolean } type: 'LinkList' } /** * Navbar component used for moving between pages. */ export interface Navbar { title?: string titleEvent?: PageEvent | GoToEvent | BackEvent | AuthEvent startLinks: Link[] endLinks: Link[] className?: | string | ClassName[] | { [k: string]: boolean } type: 'Navbar' } /** * Footer component. */ export interface Footer { links: Link[] extraText?: string className?: | string | ClassName[] | { [k: string]: boolean } type: 'Footer' } /** * Modal component that displays a modal dialog. */ export interface Modal { title: string body: FastProps[] footer?: FastProps[] openTrigger?: PageEvent1 openContext?: ContextType1 className?: | string | ClassName[] | { [k: string]: boolean } type: 'Modal' } export interface PageEvent1 { name: string pushPath?: string context?: ContextType clear?: boolean nextEvent?: PageEvent | GoToEvent | BackEvent | AuthEvent type: 'page' } export interface ContextType1 { [k: string]: string | number } /** * A component that will be replaced by the server with the component returned by the given URL. */ export interface ServerLoad { path: string loadTrigger?: PageEvent2 components?: FastProps[] sse?: boolean sseRetry?: number method?: 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE' type: 'ServerLoad' } export interface PageEvent2 { name: string pushPath?: string context?: ContextType clear?: boolean nextEvent?: PageEvent | GoToEvent | BackEvent | AuthEvent type: 'page' } /** * Image container component. */ export interface Image { src: string alt?: string width?: string | number height?: string | number referrerPolicy?: | 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url' loading?: 'eager' | 'lazy' onClick?: PageEvent | GoToEvent | BackEvent | AuthEvent className?: | string | ClassName[] | { [k: string]: boolean } type: 'Image' } /** * Iframe component that displays content from a URL. */ export interface Iframe { src: string title?: string width?: string | number height?: string | number className?: | string | ClassName[] | { [k: string]: boolean } srcdoc?: string sandbox?: string type: 'Iframe' } /** * Video component that displays a video or multiple videos. */ export interface Video { sources: string[] autoplay?: boolean controls?: boolean loop?: boolean muted?: boolean poster?: string width?: string | number height?: string | number className?: | string | ClassName[] | { [k: string]: boolean } type: 'Video' } /** * Fire an event. */ export interface FireEvent { event: AnyEvent message?: string type: 'FireEvent' } /** * Utility component used to display an error. */ export interface Error { title: string description: string statusCode?: number className?: | string | ClassName[] | { [k: string]: boolean } type: 'Error' children?: ReactNode } /** * Spinner component that displays a loading spinner. */ export interface Spinner { text?: string className?: | string | ClassName[] | { [k: string]: boolean } type: 'Spinner' } /** * Custom component that allows for special data to be rendered. */ export interface Custom { data: JsonData subType: string library?: string className?: | string | ClassName[] | { [k: string]: boolean } type: 'Custom' } /** * Table component. */ export interface Table { data: DataModel[] columns: DisplayLookup[] noDataMessage?: string className?: | string | ClassName[] | { [k: string]: boolean } type: 'Table' } export interface DataModel { [k: string]: JsonData } /** * Description of how to display a value looked up from data, either in a table or detail view. */ export interface DisplayLookup { mode?: DisplayMode title?: string onClick?: PageEvent | GoToEvent | BackEvent | AuthEvent field: string tableWidthPercent?: number } /** * Pagination component to use with tables. */ export interface Pagination { page: number pageSize: number total: number pageQueryParam?: string className?: | string | ClassName[] | { [k: string]: boolean } type: 'Pagination' pageCount: number } /** * Description of how to display a value, either in a table or detail view. */ export interface Display { mode?: DisplayMode1 title?: string onClick?: PageEvent | GoToEvent | BackEvent | AuthEvent value: JsonData type: 'Display' } /** * Details associated with displaying a data model. */ export interface Details { data: DataModel fields: (DisplayLookup | Display)[] className?: | string | ClassName[] | { [k: string]: boolean } type: 'Details' } /** * Form component. */ export interface Form { submitUrl: string initial?: { [k: string]: JsonData } method?: 'POST' | 'GOTO' | 'GET' displayMode?: 'default' | 'page' | 'inline' submitOnChange?: boolean submitTrigger?: PageEvent3 loading?: FastProps[] footer?: FastProps[] className?: | string | ClassName[] | { [k: string]: boolean } formFields: ( | FormFieldInput | FormFieldTextarea | FormFieldBoolean | FormFieldFile | FormFieldSelect | FormFieldSelectSearch )[] type: 'Form' } export interface PageEvent3 { name: string pushPath?: string context?: ContextType clear?: boolean nextEvent?: PageEvent | GoToEvent | BackEvent | AuthEvent type: 'page' } /** * Form field for basic input. */ export interface FormFieldInput { name: string title: string[] | string required?: boolean error?: string locked?: boolean description?: string displayMode?: 'default' | 'inline' className?: | string | ClassName[] | { [k: string]: boolean } htmlType?: 'text' | 'date' | 'datetime-local' | 'time' | 'email' | 'url' | 'number' | 'password' | 'hidden' initial?: string | number placeholder?: string autocomplete?: string type: 'FormFieldInput' } /** * Form field for text area input. */ export interface FormFieldTextarea { name: string title: string[] | string required?: boolean error?: string locked?: boolean description?: string displayMode?: 'default' | 'inline' className?: | string | ClassName[] | { [k: string]: boolean } rows?: number cols?: number initial?: string placeholder?: string autocomplete?: string type: 'FormFieldTextarea' } /** * Form field for boolean input. */ export interface FormFieldBoolean { name: string title: string[] | string required?: boolean error?: string locked?: boolean description?: string displayMode?: 'default' | 'inline' className?: | string | ClassName[] | { [k: string]: boolean } initial?: boolean mode?: 'checkbox' | 'switch' type: 'FormFieldBoolean' } /** * Form field for file input. */ export interface FormFieldFile { name: string title: string[] | string required?: boolean error?: string locked?: boolean description?: string displayMode?: 'default' | 'inline' className?: | string | ClassName[] | { [k: string]: boolean } multiple?: boolean accept?: string type: 'FormFieldFile' } /** * Form field for select input. */ export interface FormFieldSelect { name: string title: string[] | string required?: boolean error?: string locked?: boolean description?: string displayMode?: 'default' | 'inline' className?: | string | ClassName[] | { [k: string]: boolean } options: SelectOptions multiple?: boolean initial?: string[] | string vanilla?: boolean placeholder?: string autocomplete?: string type: 'FormFieldSelect' } export interface SelectOption { value: string label: string } export interface SelectGroup { label: string options: SelectOption[] } /** * Form field for searchable select input. */ export interface FormFieldSelectSearch { name: string title: string[] | string required?: boolean error?: string locked?: boolean description?: string displayMode?: 'default' | 'inline' className?: | string | ClassName[] | { [k: string]: boolean } searchUrl: string multiple?: boolean initial?: SelectOption1 debounce?: number placeholder?: string type: 'FormFieldSelectSearch' } export interface SelectOption1 { value: string label: string } /** * Form component generated from a Pydantic model. */ export interface ModelForm { submitUrl: string initial?: { [k: string]: JsonData } method?: 'POST' | 'GOTO' | 'GET' displayMode?: 'default' | 'page' | 'inline' submitOnChange?: boolean submitTrigger?: PageEvent4 loading?: FastProps[] footer?: FastProps[] className?: | string | ClassName[] | { [k: string]: boolean } type: 'ModelForm' formFields: ( | FormFieldInput | FormFieldTextarea | FormFieldBoolean | FormFieldFile | FormFieldSelect | FormFieldSelectSearch )[] } export interface PageEvent4 { name: string pushPath?: string context?: ContextType clear?: boolean nextEvent?: PageEvent | GoToEvent | BackEvent | AuthEvent type: 'page' } /** * Toast component that displays a toast message (small temporary message). */ export interface Toast { title: string body: FastProps[] position?: | 'top-start' | 'top-center' | 'top-end' | 'middle-start' | 'middle-center' | 'middle-end' | 'bottom-start' | 'bottom-center' | 'bottom-end' openTrigger?: PageEvent5 openContext?: ContextType2 className?: | string | ClassName[] | { [k: string]: boolean } type: 'Toast' } export interface PageEvent5 { name: string pushPath?: string context?: ContextType clear?: boolean nextEvent?: PageEvent | GoToEvent | BackEvent | AuthEvent type: 'page' } export interface ContextType2 { [k: string]: string | number }