# EditorCommand

Source: /tuil/docs/reference/packages/editor/api/editor-command
Locale: en

interface exported by @mwillbanks/tuil-editor.



{/* Generated by tooling/docs/generate-reference.ts. */}

## interface [#interface]

Public interface exported by `@mwillbanks/tuil-editor`.

```ts
export interface EditorCommand {
  readonly id: string;
  readonly title: string;
  execute(
    session: EditorSession,
    argument?: unknown,
  ): boolean | Promise<boolean>;
}
```

## Members [#members]

| Member    | Type                                                                          | Required | Description                                                                                                           | Related types                                                         |
| --------- | ----------------------------------------------------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------- |
| `id`      | `string`                                                                      | Yes      | The `id` member uses the `string` contract.                                                                           | —                                                                     |
| `title`   | `string`                                                                      | Yes      | The `title` member uses the `string` contract.                                                                        | —                                                                     |
| `execute` | `(session: EditorSession, argument?: unknown) => boolean \| Promise<boolean>` | Yes      | The `execute` member uses the `(session: EditorSession, argument?: unknown) => boolean \| Promise<boolean>` contract. | [`EditorSession`](/tuil/docs/reference/packages/editor/api/editor-session) |

## Parameters [#parameters]

This declaration has no public members.

## Returns [#returns]

This declaration does not return a value.

## Throws [#throws]

No thrown errors are documented for this declaration.

## Related types [#related-types]

* [`EditorSession`](/tuil/docs/reference/packages/editor/api/editor-session)

## Source [#source]

[View the secondary source reference](https://github.com/mwillbanks/tuil/blob/main/packages/editor/src/index.ts)

## Package [#package]

[@mwillbanks/tuil-editor](/tuil/docs/reference/packages/editor)
