clide-js
    Preparing search index...

    Class State<TData, TOptions>

    Execution state management.

    The State is responsible for managing the state of command execution. It provides mechanisms to progress through command execution, handle state transitions, and manage the lifecycle of command data.

    Type Parameters

    Index

    Accessors

    • get i(): number

      The current step/command index within the command chain.

      Returns number

    • get params(): Params

      Resolved route parameters from parameterized filenames, e.g., id from commands/get/[id].ts.

      Returns Params

    Constructors

    Methods

    • End execution, skipping any remaining steps, and return the current or provided data.

      Parameters

      • data: unknown = ...

        The data to return. Defaults to the current data.

      Returns Promise<unknown>

      The data from the last command.

    • Continue to the next step in the command chain or end the steps if there are no more steps.

      Parameters

      • data: unknown = ...

        The data to pass to the next step. If not provided, the current data will be used.

      Returns Promise<unknown>

      The data from the last command.

    • Start the steps.

      Parameters

      • initialData: unknown = ...

      Returns Promise<void>

      A promise that resolves when the steps are done.

      If the steps have already started.