@vestra-player/sdk - v1.11.3
    Preparing search index...

    Interface WireCommandExperimental

    A command registered with WireCommands.register: its id, its registration and explicit state updates. Experimental: the wire protocol is not semver; this member changes with versions.

    Its state changes only through WireCommand.update; nothing is evaluated in the update passes. Disposing it (or its scope) removes it from the menu and the binding table. The player sends a pick as commands.execute; the SDK calls run, and Wire.on hears the event too.

    The command shows busy while its export runs and normal again after. Each update is one request, numbered by the SDK.

    const command = plugin.wire.commands.register({
    id: "export",
    declaration,
    run: async () => {
    await command.update({ busy: true }); // one commands.update each
    await exportAll().finally(() => command.update({ busy: false }));
    },
    });

    1.7.0

    interface WireCommand {
        dispose(): Promise<void>;
        id: string;
        ready: Promise<void>;
        update(state: WireCommandState, when?: Json): Promise<void>;
    }

    Hierarchy (View Summary)

    Index
    • Experimental

      Release the resource. Resolves once the player confirmed the release (or immediately for purely local resources). Never rejects.

      Returns Promise<void>

      Never.

      A "Turn feature off" item removes the feature's own menu item at once, before the plugin stops. dispose takes the command out of the menu and the binding table and resolves once the player confirmed it; the id can be added again later.

      const extra = plugin.commands.add({ id: "extra", path: ["Tools", "Extra"], run() {} });
      plugin.commands.add({
      id: "extra-off",
      path: ["Tools", "Turn extra off"],
      run: () => extra.dispose(), // never rejects
      });

      1.0.0

    • Experimental

      Send a new state, merged into the last one sent.

      Parameters

      • state: WireCommandState

        The fields to change.

      • Optionalwhen: Json

        The player's conditions, in wire form.

      Returns Promise<void>

      Once the player took the new state.

      Experimental: the wire protocol is not semver; this member changes with versions. One commands.update with the next revision, after the registration; several calls are sent in order, the newest last. when replaces the conditions (omitted: the last ones sent stay).

      invalid (rejects) The player refused the state.

      missing (rejects) The command is not registered (refused, or disposed).

      The plugin turns its grid on and shows the check mark in the menu once the player took the state.

      await grid.update({ checked: true });
      

      1.7.0

    id: string

    The local id given in WireCommandOptions.id.

    ready: Promise<void>

    Resolves once the player registered it.

    invalid (rejects) The player refused the declaration.

    conflict (rejects) Another command has this menu path.

    limit (rejects) Too many commands in this plugin or the player.