Skip to main content

Introducing Workflow Engine, try for FREE workflowengine.io.

Class: Definer<T>

The builder class to define the metadata of the form builder component.

Type Parameters

T extends object

React component property type.

Properties

data

data: DefinerData<T>

Definer class data.

Template

React component property type.

Methods

actions()

actions(fn): Definer<T>

Adds the metadata of the component's actions. Internal use only.

Parameters

fn: ActionsInitializer

the function that initializes an actions on a component.

Returns

Definer<T>

the modified Definer class instance.


build()

build(): BuilderComponent

Creates component metadata for the form builder and form viewer.

Returns

BuilderComponent

component metadata for the form builder and form viewer.


category()

category(category): Definer<T>

Sets the category of the component.

Parameters

category: string

the component category.

Returns

Definer<T>

the modified Definer class instance.


css()

css(css): Definer<T>

Sets the component CSS metadata.

Parameters

css: Annotations<CSSObject>

the component CSS metadata.

Returns

Definer<T>

the modified Definer class instance.


getType()

getType(): string

Returns

string

the component type name.


icon()

icon(icon): Definer<T>

Sets the icon of the component.

Parameters

icon: ComponentType

the component icon.

Returns

Definer<T>

the modified Definer class instance.


kind()

kind(kind): Definer<T>

Sets the kind of the component.

Parameters

kind: ComponentKind

the component kind.

Returns

Definer<T>

the modified Definer class instance.


name()

name(name): Definer<T>

Sets the name of the component.

Parameters

name: string

the component name.

Returns

Definer<T>

the modified Definer class instance.


preview()

preview(customPreview): Definer<T>

Adds the custom component to be displayed in the component list. Internal use only.

Parameters

customPreview: ReactNode

the custom component.

Returns

Definer<T>

the modified Definer class instance.


props()

props(properties): Definer<T>

Sets the metadata of the component's properties.

Parameters

properties: Annotations<T>

the metadata of the component's properties.

Returns

Definer<T>

the modified Definer class instance.


type()

type(type): Definer<T>

Sets the type of the component.

Parameters

type: string

the component type.

Returns

Definer<T>

the modified Definer class instance.


define()

static define<T>(component, displayName?): Definer<T>

Static method to create an instance of the component's metadata builder class.

Type Parameters

T extends object

Parameters

component: ComponentType<T>

the React component.

displayName?: string

the display name for the anonymous component.

Returns

Definer<T>

the instance of the Definer class.