UNPKG

@airplane/views

Version:

A React library for building Airplane views. Views components are optimized in style and functionality to produce internal apps that are easy to build and maintain.

88 lines (87 loc) 4.13 kB
/// <reference types="react" /> import { MultiInputState } from "../../state/components/multiInput/state"; import { BooleanState } from "../components/boolean/state"; import { ButtonState } from "../components/button/state"; import { ChartState } from "../components/chart/state"; import { DatePickerState } from "../components/datepicker/state"; import { DialogState } from "../components/dialog/state"; import { FileInputState } from "../components/file-input/state"; import { FormState } from "../components/form/state"; import { MultiSelectState } from "../components/multiselect/state"; import { NumberInputState } from "../components/number-input/state"; import { RadioGroupState } from "../components/radio-group/state"; import { SelectState } from "../components/select/state"; import { TableState } from "../components/table/state"; import { TabsState } from "../components/tabs/state"; import { TextInputState } from "../components/text-input/state"; export declare enum ComponentType { Table = "Table", NumberInput = "NumberInput", Slider = "Slider", TextInput = "TextInput", Textarea = "Textarea", CodeInput = "CodeInput", Select = "Select", MultiSelect = "MultiSelect", Button = "Button", DatePicker = "DatePicker", DateTimePicker = "DateTimePicker", FileInput = "FileInput", Dialog = "Dialog", Form = "Form", RadioGroup = "RadioGroup", Chart = "Chart", Tabs = "Tabs", Checkbox = "Checkbox", Switch = "Switch", MultiInput = "MultiInput" } export type ComponentState = TableState | NumberInputState | TextInputState | SelectState | MultiSelectState | BooleanState | ButtonState | DialogState | DatePickerState | FileInputState | FormState | RadioGroupState | ChartState | TabsState | MultiInputState<unknown>; export type InputComponentState = SelectState | MultiSelectState | BooleanState | NumberInputState | TextInputState | DatePickerState | FileInputState | RadioGroupState; export declare const DefaultComponentState: { value: import("../components/tabs/state").TabsValue; setValue: (value: import("../components/tabs/state").TabsValue) => void; changeSelection: (value: import("../components/chart/state").SelectedPoint[]) => void; clearSelection: () => void; selectedPoints: import("../components/chart/state").SelectedPoint[]; disabled: boolean; setDisabled: (disabled?: boolean | undefined) => void; setShowErrors: (showErrors: boolean) => void; reset: () => void; errors: string[]; showErrors: boolean; values?: import("../components/form/state").InputValues | undefined; open: () => void; opened: boolean; close: () => void; result: import("../tasks/useRunbookMutation").RunbookMutationState | import("../tasks/useTaskMutation").MutationState<any> | null; setResult: (result: import("../tasks/useRunbookMutation").RunbookMutationState | import("../tasks/useTaskMutation").MutationState<any>) => void; checked: boolean; setChecked: (checked: boolean) => void; focus: () => void; selectedRows: any[]; selectedRow?: any; changeRowSelection: (rows: any[]) => void; rowActionResult: { output?: any; loading?: boolean | undefined; error?: import("../../components/query").ExecuteError | undefined; runID?: string | undefined; } | null; setRowActionResult: (mutation: { output?: any; loading?: boolean | undefined; error?: import("../../components/query").ExecuteError | undefined; runID?: string | undefined; }) => void; }; export type ComponentStateContextType = { components: Record<string, ComponentState>; updateComponent: <TState extends ComponentState>(id: string, state: TState) => void; removeComponent: (id: string) => void; }; export declare const ComponentStateContext: import("react").Context<ComponentStateContextType>; /** * useSyncComponentState keeps component state in sync with the global component state store */ export declare const useSyncComponentState: <TState extends ComponentState>(id: string, state: TState) => void;