Skip to content

Overview / Plugin

Plugin<T, S>

Type Parameters

Type ParameterDefault type
T extends Record<string, z.ZodType>Record<string, z.ZodType>
S extends z.infer<z.ZodObject<T>>z.infer<z.ZodObject<T>>

Properties

PropertyModifierTypeDefault value
formspublicForm<Record<string, ZodType<any, ZodTypeDef, any>>, object>[][]
pathpublicstringundefined
toolspublicTool[][]

Accessors

active

get active(): boolean

set active(active): void

Parameters

ParameterType
activeboolean

Returns

boolean


hooks

get hooks(): Hook[]

Returns

Hook[]


id

get id(): string

Returns

string


info

get info(): object

Returns

object

NameTypeDefault value
activeboolean-
formsobject[]-
hooksobject[]-
idstring-
manifestobject-
manifest.authorNamestring-
manifest.authorUrl?string-
manifest.descriptionstring-
manifest.namestring-
manifest.pluginUrl?string-
manifest.tagsstring[]-
manifest.thumb?string-
manifest.versionstring-
toolsobject[]-
upgradablebooleanfalse

manifest

get manifest(): object

Returns

object

NameType
authorNamestring
authorUrl?string
descriptionstring
namestring
pluginUrl?string
tagsstring[]
thumb?string
versionstring

reloading

get reloading(): boolean

Returns

boolean


schema

get schema(): ZodObject<T, UnknownKeysParam, ZodTypeAny, { [k in string | number | symbol]: addQuestionMarks<baseObjectOutputType<T>, any>[k] }, { [k in string | number | symbol]: baseObjectInputType<T>[k] }>

Returns

ZodObject<T, UnknownKeysParam, ZodTypeAny, { [k in string | number | symbol]: addQuestionMarks<baseObjectOutputType<T>, any>[k] }, { [k in string | number | symbol]: baseObjectInputType<T>[k] }>


settings

get settings(): S

set settings(settings): void

Parameters

ParameterType
settingsS

Returns

S

Methods

reload()

reload(): Promise<void>

Returns

Promise<void>


remove()

remove(): Promise<void>

Asynchronously removes the current plugin. This method performs the following actions:

  1. Triggers the 'removed' event.
  2. Revokes all object URLs stored.
  3. If any dependencies are found in the plugin's package.json file, they are uninstalled.
  4. Deletes the plugin's directory and its contents.

Returns

Promise<void>


triggerEvent()

triggerEvent(event): void

Triggers the specified event.

Parameters

ParameterTypeDescription
eventkeyof PluginEventsThe name of the event to trigger.

Returns

void


new()

static new(path): Promise<Plugin<Record<string, ZodType<any, ZodTypeDef, any>>, object>>

Parameters

ParameterType
pathstring

Returns

Promise<Plugin<Record<string, ZodType<any, ZodTypeDef, any>>, object>>

Released under the GPL-3.0 License.