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

    Class MenuAbstract

    Hierarchy (View Summary)

    Index

    Constructors

    • Creates a new Menu instance from JSON data. Initializes styles and labels with translation key defaults; concrete subclasses handle type-specific logic.

      Parameters

      • data: MenuJson

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

      Returns Menu

    Methods

    • Returns the menu's unique name.

      Returns string

    • Returns the menu type: "choice", "input", "field", or "editor".

      Returns "input" | "field" | "choice" | "editor"

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

      Returns string | undefined

    • Sets the plugin namespace for this menu.

      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 menu is accessible from every context.

      Returns boolean

    • Returns true when this menu is the anchor point of a wizard/flow. Global actions that target this menu will be hidden in this menu and in all its descendants, resolved through the regular parents chain.

      Returns boolean

    • Returns the styles container for this menu.

      Returns MenuStyles

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

      Parameters

      • styles: MenuStyles

        MenuStyles instance or compatible JSON.

      Returns this

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

      Parameters

      Returns this

    • Returns the labels container for this menu.

      Returns MenuLabels

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

      Parameters

      • labels: MenuLabels

        MenuLabels instance or compatible JSON.

      Returns this

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

      Parameters

      Returns this

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

      Returns MenuJson

    • Executes the menu interaction. Implemented by each concrete subclass.

      Returns Promise<unknown>

    Properties

    name: string
    type: "input" | "field" | "choice" | "editor"
    plugin?: string
    parents: Record<string, Exclude<MenuJson["parents"], undefined>[number]> = {}
    index: number | undefined
    global: boolean
    anchorGlobal: boolean
    styles: MenuStyles
    labels: MenuLabels