UNPKG

@open-formulieren/formio-builder

Version:

An opinionated Formio webform builder for Open Forms

60 lines (59 loc) 2.67 kB
import { SupportedLocales } from '@open-formulieren/types'; import { default as React } from 'react'; import { PrefillAttributeOption, PrefillPluginOption } from './components/builder/prefill/types'; import { RegistrationAttributeOption } from './components/builder/registration/registration-attribute'; import { ColorOption } from './components/builder/rich-text'; import { ValidatorOption } from './components/builder/validate/validator-select'; import { ReferenceListsServiceOption, ReferenceListsTable, ReferenceListsTableItem } from './components/builder/values/reference-lists/types'; import { AuthPluginOption } from './registry/cosignV1/edit'; import { AnyComponentSchema } from './types'; export interface SelectOption { value: string; label: string; } export interface DocumentTypeOption { backendLabel: string; catalogueLabel: string; url: string; description: string; } export interface MapTileLayer { identifier: string; url: string; label: string; } export interface MapOverlayTileLayer { name: string; type: 'wms' | 'wfs'; uuid: string; url: string; } export type FormType = 'regular' | 'appointment' | 'single_step'; export interface BuilderContextType { uniquifyKey: (key: string) => string; supportedLanguageCodes: SupportedLocales[]; richTextColors: ColorOption[]; theme: 'light' | 'dark'; formType: FormType; getFormComponents: () => AnyComponentSchema[]; getValidatorPlugins: (componentType: string) => Promise<ValidatorOption[]>; getRegistrationAttributes: (componentType: string) => Promise<RegistrationAttributeOption[]>; getServices: (type: string) => Promise<ReferenceListsServiceOption[]>; getReferenceListsTables: (service: string) => Promise<ReferenceListsTable[]>; getReferenceListsTableItems: (service: string, tableCode: string) => Promise<ReferenceListsTableItem[]>; getPrefillPlugins: (componentType: string) => Promise<PrefillPluginOption[]>; getPrefillAttributes: (plugin: string) => Promise<PrefillAttributeOption[]>; getFileTypes: () => Promise<SelectOption[]>; serverUploadLimit: string; getDocumentTypes: () => Promise<Array<DocumentTypeOption>>; getConfidentialityLevels: () => Promise<SelectOption[]>; getAuthPlugins: () => Promise<AuthPluginOption[]>; getMapTileLayers: () => Promise<MapTileLayer[]>; getMapOverlayTileLayers: () => Promise<MapOverlayTileLayer[]>; } declare const BuilderContext: React.Context<BuilderContextType>; export interface RenderContextType { bareInput: boolean; } declare const RenderContext: React.Context<RenderContextType>; export { BuilderContext, RenderContext };