Skip to content

Commit dde3731

Browse files
committed
Spec composer API
1 parent c02b970 commit dde3731

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* API to alter the message composer.
3+
* @alpha Likely to change
4+
*/
5+
export interface ComposerApi {
6+
/**
7+
* Insert plaintext into the current composer.
8+
* @param text - The plain text to insert
9+
* @returns Returns immediately, does not await action.
10+
* @alpha Likely to change
11+
*/
12+
insertTextIntoComposer(text: string): void;
13+
}

packages/module-api/src/api/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import { type ClientApi } from "./client.ts";
2323
import { type WidgetLifecycleApi } from "./widget-lifecycle.ts";
2424
import { type WidgetApi } from "./widget.ts";
2525
import { type CustomisationsApi } from "./customisations.ts";
26+
import { type ComposerApi } from "./composer.ts";
2627

2728
/**
2829
* Module interface for modules to implement.
@@ -159,6 +160,12 @@ export interface Api
159160
*/
160161
readonly customisations: CustomisationsApi;
161162

163+
/**
164+
* Allows modules to customise the message composer.
165+
* @alpha Subject to change.
166+
*/
167+
readonly composer: ComposerApi;
168+
162169
/**
163170
* Create a ReactDOM root for rendering React components.
164171
* Exposed to allow modules to avoid needing to bundle their own ReactDOM.

0 commit comments

Comments
 (0)