Skip to main content

index

@prismatic-io/spectral"index"

Index

Functions

Functions

Const action

actionTInputs, TAllowsBranching, TReturn›(definition: ActionDefinition‹TInputs, TAllowsBranching, TReturn›): ActionDefinition‹TInputs, TAllowsBranching, TReturn›

Defined in packages/spectral/src/index.ts:43

This function creates an action object that can be referenced by a custom component. It helps ensure that the shape of the action object conforms to what the Prismatic API expects. For information on writing custom component actions, see https://prismatic.io/docs/custom-components/writing-custom-components/#writing-actions.

Type parameters:

TInputs: Inputs

TAllowsBranching: boolean

TReturn: ActionPerformReturn‹TAllowsBranching, unknown›

Parameters:

NameTypeDescription
definitionActionDefinition‹TInputs, TAllowsBranching, TReturn›An ActionDefinition type object that includes UI display information, a function to perform when the action is invoked, and a an object containing inputs for the perform function.

Returns: ActionDefinition‹TInputs, TAllowsBranching, TReturn›

This function validates the shape of the definition object provided, and returns the same action object.


Const component

componentTPublic, TKey›(definition: ComponentDefinition‹TPublic, TKey›): ReturnType‹typeof convertComponent›

Defined in packages/spectral/src/index.ts:30

This function creates a component object that can be imported into the Prismatic API. For information on using this function to write custom components, see https://prismatic.io/docs/custom-components/writing-custom-components/#exporting-a-component.

Type parameters:

TPublic: boolean

TKey: string

Parameters:

NameTypeDescription
definitionComponentDefinition‹TPublic, TKey›A ComponentDefinition type object, including display information, unique key, and a set of actions the component implements.

Returns: ReturnType‹typeof convertComponent›

This function returns a component object that has the shape the Prismatic API expects.


Const connection

connectionT›(definition: T): T

Defined in packages/spectral/src/index.ts:100

For information on writing custom component connections, see https://prismatic.io/docs/custom-components/writing-custom-components/#adding-connections.

Type parameters:

T: DefaultConnectionDefinition

Parameters:

NameTypeDescription
definitionTA DefaultConnectionDefinition object that describes the type of a connection for a custom component action or trigger, and information on how it should be displayed in the Prismatic WebApp.

Returns: T

This functions validates the shape of the definition object provided and returns the same connection object.


Const dataSource

dataSourceTInputs, TDataSourceType›(definition: DataSourceDefinition‹TInputs, TDataSourceType›): DataSourceDefinition‹TInputs, TDataSourceType›

Defined in packages/spectral/src/index.ts:77

This function creates a data source object that can be referenced by a custom component. It helps ensure that the shape of the data source object conforms to what the Prismatic API expects. For information on writing custom component data sources, see https://prismatic.io/docs/custom-components/writing-custom-components/#writing-data-sources.

Type parameters:

TInputs: Inputs

TDataSourceType: DataSourceType

Parameters:

NameTypeDescription
definitionDataSourceDefinition‹TInputs, TDataSourceType›A DataSourceDefinition type object that includes UI display information, a function to perform when the data source is invoked, and a an object containing inputs for the perform function.

Returns: DataSourceDefinition‹TInputs, TDataSourceType›

This function validates the shape of the definition object provided, and returns the same data source object.


Const input

inputT›(definition: T): T

Defined in packages/spectral/src/index.ts:91

For information and examples on how to write inputs for custom component actions and triggers, see https://prismatic.io/docs/custom-components/writing-custom-components/#adding-inputs.

Type parameters:

T: InputFieldDefinition

Parameters:

NameTypeDescription
definitionTAn InputFieldDefinition object that describes the type of an input for a custom component action or trigger, and information on how it should be displayed in the Prismatic WebApp.

Returns: T

This function validates the shape of the definition object provided, and returns the same input object.


Const oauth2Connection

oauth2ConnectionT›(definition: T): T

Defined in packages/spectral/src/index.ts:110

For information on writing custom component connections, see https://prismatic.io/docs/custom-components/writing-custom-components/#adding-connections.

Type parameters:

T: OAuth2ConnectionDefinition

Parameters:

NameTypeDescription
definitionTAn OAuth2ConnectionDefinition object that describes the type of a connection for a custom component action or trigger, and information on how it should be displayed in the Prismatic WebApp.

Returns: T

This functions validates the shape of the definition object provided and returns the same connection object.


Const trigger

triggerTInputs, TAllowsBranching, TResult›(definition: TriggerDefinition‹TInputs, TAllowsBranching, TResult›): TriggerDefinition‹TInputs, TAllowsBranching, TResult›

Defined in packages/spectral/src/index.ts:60

This function creates a trigger object that can be referenced by a custom component. It helps ensure that the shape of the trigger object conforms to what the Prismatic API expects. For information on writing custom component triggers, see https://prismatic.io/docs/custom-components/writing-custom-components/#writing-triggers.

Type parameters:

TInputs: Inputs

TAllowsBranching: boolean

TResult: TriggerResult‹TAllowsBranching›

Parameters:

NameTypeDescription
definitionTriggerDefinition‹TInputs, TAllowsBranching, TResult›A TriggerDefinition type object that includes UI display information, a function to perform when the trigger is invoked, and a an object containing inputs for the perform function.

Returns: TriggerDefinition‹TInputs, TAllowsBranching, TResult›

This function validates the shape of the definition object provided, and returns the same trigger object.