@termun/core - v0.0.0
    Preparing search index...

    Class ActionFunction

    Hierarchy (View Summary)

    Index

    Constructors

    Methods

    • Returns the action's unique name.

      Returns string

    • Returns the action type: "function" or "goto".

      Returns "function" | "goto"

    • Returns the plugin namespace this action belongs to, or undefined for the default plugin.

      Returns string | undefined

    • Sets the plugin namespace for this action.

      Parameters

      • plugin: string | undefined

        Plugin name string.

      Returns this

    • Returns the display order index, or undefined if not set.

      Returns number | undefined

    • Sets the display order index.

      Parameters

      • index: number | undefined

        Numeric sort position.

      Returns this

    • Returns all registered parent names as a flat array.

      Returns string[]

    • Returns the parent entry matching the given name, or undefined.

      Parameters

      • name: string

        Parent name to look up.

      Returns string | undefined

    • Registers a parent menu name.

      Parameters

      • name: string

        Parent name to add.

      Returns this

    • Returns true when this action is accessible from every menu.

      Returns boolean

    • Sets the styles for this action from an instance or a plain JSON object.

      Parameters

      • styles: ActionStyles

        ActionStyles instance or compatible JSON.

      Returns this

    • Sets the styles for this action from an instance or a plain JSON object.

      Parameters

      Returns this

    • Sets the labels for this action from an instance or a plain JSON object.

      Parameters

      • labels: ActionLabels

        ActionLabels instance or compatible JSON.

      Returns this

    • Sets the labels for this action from an instance or a plain JSON object.

      Parameters

      Returns this

    • Invokes and returns the result of the stored callback.

      Returns Promise<void>

    • Replaces the stored callback function.

      Parameters

      • callback: () => Promise<void>

        Async function executed when the action runs.

      Returns this

    • Executes the action by invoking the stored async callback.

      Returns Promise<void>

    Properties

    name: string
    plugin?: string
    index?: number
    parents: Record<string, Exclude<ActionJson["parents"], undefined>[number]> = {}
    global: boolean = false
    styles: ActionStyles
    labels: ActionLabels
    type: "function"
    callback: () => Promise<void>