Skip to content

@morph-mapper/source


@morph-mapper/source / usePlugins

Function: usePlugins() ​

usePlugins(): object

Defined in: hooks/use-plugins.ts:17

Returns ​

bootstrap ​

bootstrap: (__namedParameters) => Promise<boolean>

Parameters ​

__namedParameters ​

BootStrapBindParams

Returns ​

Promise<boolean>

config ​

config: (plugins, domain, fileType) => void

Public methods which are defined by a plugin implementation.

Parameters ​

plugins ​

Plugin[]

domain ​

string

fileType ​

SchemaVariant

Returns ​

void

fieldSuggestions ​

fieldSuggestions: (__namedParameters) => Promise<(void | Omit<FieldSuggestion, "source">)[]>

Parameters ​

__namedParameters ​

FieldSuggestionsBindParams

Returns ​

Promise<(void | Omit<FieldSuggestion, "source">)[]>

hydrate ​

hydrate: (plugins) => void

Private methods which are used by the plugin framework to connect to the application. These methods should be hidden from the plugin implementations.

Parameters ​

plugins ​

any[]

Returns ​

void

postRender ​

postRender: (__namedParameters) => any

Parameters ​

__namedParameters ​

PostRenderBindParams

Returns ​

any

preConfig ​

preConfig: (templateId) => Promise<{ plugins: object[]; }>

Parameters ​

templateId ​

string

Returns ​

Promise<{ plugins: object[]; }>

preRender ​

preRender: (__namedParameters) => Promise<boolean>

Parameters ​

__namedParameters ​

PreRenderBindParams

Returns ​

Promise<boolean>

serialize ​

serialize: (id?) => object

Parameters ​

id? ​

string

Returns ​

object

global ​

global: object = persistedGlobalState

global.bootstrapped ​

bootstrapped: object

If the current save file has been bootstrapped, without this check bootstrap would happen on every load.

global.bootstrapped.anchorExtract? ​

optional anchorExtract?: boolean

global.bootstrapped.Checking? ​

optional Checking?: boolean

global.bootstrapped.declareItems? ​

optional declareItems?: boolean

global.bootstrapped.discardOnUpdate? ​

optional discardOnUpdate?: boolean

global.bootstrapped.iterator? ​

optional iterator?: boolean

global.bootstrapped.numberHandling? ​

optional numberHandling?: boolean

global.bootstrapped.Selector? ​

optional Selector?: boolean

global.bootstrapped.sortSuggestions? ​

optional sortSuggestions?: boolean

global.domain ​

domain: string

global.fileIndex ​

fileIndex: number

0-based index of the file currently being processed in a multi-file session.

global.fileType ​

fileType: SchemaVariant

global.lastFile ​

lastFile: string

global.logs ​

logs: LogEntry[]

global.plugins ​

plugins: Plugin[]

Currently active plugins.

global.progress ​

progress: Record<string, ProgressEntry>

global.settings ​

settings: object

global.settings.anchorExtract? ​

optional anchorExtract?: Setting[]

global.settings.Checking? ​

optional Checking?: Setting[]

global.settings.declareItems? ​

optional declareItems?: Setting[]

global.settings.discardOnUpdate? ​

optional discardOnUpdate?: Setting[]

global.settings.iterator? ​

optional iterator?: Setting[]

global.settings.numberHandling? ​

optional numberHandling?: Setting[]

global.settings.Selector? ​

optional Selector?: Setting[]

global.settings.sortSuggestions? ​

optional sortSuggestions?: Setting[]

global.skipSameLastFile ​

skipSameLastFile: boolean

global.totalFiles ​

totalFiles: number

Total number of files in the current multi-file session.

global.versions ​

versions: object

Version of the loaded plugins.

global.versions.anchorExtract? ​

optional anchorExtract?: string

global.versions.Checking? ​

optional Checking?: string

global.versions.declareItems? ​

optional declareItems?: string

global.versions.discardOnUpdate? ​

optional discardOnUpdate?: string

global.versions.iterator? ​

optional iterator?: string

global.versions.numberHandling? ​

optional numberHandling?: string

global.versions.Selector? ​

optional Selector?: string

global.versions.sortSuggestions? ​

optional sortSuggestions?: string

registered ​

registered: object

setContext ​

setContext: (domain, fileType) => void

Parameters ​

domain ​

string

fileType ​

SchemaVariant

Returns ​

void

shouldRender ​

shouldRender: (__namedParameters) => boolean

Parameters ​

__namedParameters ​

ShouldRenderBindParams

Returns ​

boolean