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

    Class ActionAbstract

    Hierarchy (View Summary)

    Index

    Constructors

    • Creates a new Action instance from JSON data. Initializes styles and labels; concrete subclasses handle type-specific logic.

      Parameters

      • data: ActionJson

        Action JSON including name, type, plugin, index, parents, styles, and labels.

      Returns Action

    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

    • Returns the styles container for this action.

      Returns ActionStyles

    • 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

    • Returns the labels container for this action.

      Returns ActionLabels

    • 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

    • Serialises this action to a plain JSON-compatible object.

      Returns ActionJson

    • Executes the action logic. Implemented by each concrete subclass.

      Returns Promise<unknown>

    Properties

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