UNPKG

@fluent-form/core

Version:

An Angular dynamic forms library powered by Fluent API and JSON.

20 lines (19 loc) 878 B
import type { Provider, Type } from '@angular/core'; import type { SafeAny } from '@ngify/core'; import type { SchemaConfig } from '../interfaces'; import { type SchemaPatchFn } from '../patcher'; import type { AbstractSchema } from '../schemas'; import { AbstractWidget } from '../widgets'; interface DefaultExport<T> { default: T; } type MaybeDefaultExport<T> = T | DefaultExport<T>; export interface FluentFormWidgetConfig<S extends AbstractSchema> extends SchemaConfig<S> { kind: S['kind']; widget?: Type<AbstractWidget<unknown>>; loadWidget?: () => Promise<MaybeDefaultExport<Type<AbstractWidget<unknown>>>>; /** Patch the schema, called when normalizing the schema. */ patch?: SchemaPatchFn<S>; } export declare function provideWidgetConfigs(configs: (FluentFormWidgetConfig<SafeAny> | FluentFormWidgetConfig<SafeAny>[])[]): Provider[]; export {};