mirror of
https://github.com/vector-im/element-web.git
synced 2026-05-16 09:56:15 +02:00
Adjust
This commit is contained in:
parent
681cd15ad9
commit
c0011589e6
@ -14,10 +14,10 @@ import type { ComposerInsertPayload } from "../dispatcher/payloads/ComposerInser
|
||||
export class ComposerApi implements ModuleComposerApi {
|
||||
public constructor(private readonly dispatcher: MatrixDispatcher) {}
|
||||
|
||||
public insertTextIntoComposer(text: string): void {
|
||||
public insertPlaintextIntoComposer(plaintext: string): void {
|
||||
this.dispatcher.dispatch({
|
||||
action: Action.ComposerInsert,
|
||||
text,
|
||||
text: plaintext,
|
||||
} satisfies ComposerInsertPayload);
|
||||
}
|
||||
}
|
||||
|
||||
@ -15,7 +15,7 @@ describe("ComposerApi", () => {
|
||||
dispatch: jest.fn(),
|
||||
} as unknown as MatrixDispatcher;
|
||||
const api = new ComposerApi(dispatcher);
|
||||
api.insertTextIntoComposer("Hello world");
|
||||
api.insertPlaintextIntoComposer("Hello world");
|
||||
expect(dispatcher.dispatch).toHaveBeenCalledWith({
|
||||
action: Action.ComposerInsert,
|
||||
text: "Hello world",
|
||||
|
||||
@ -101,7 +101,7 @@ export interface ComponentVisibilityCustomisations {
|
||||
|
||||
// @alpha
|
||||
export interface ComposerApi {
|
||||
insertTextIntoComposer(text: string): void;
|
||||
insertPlaintextIntoComposer(plaintext: string): void;
|
||||
}
|
||||
|
||||
// @public
|
||||
|
||||
@ -6,15 +6,15 @@ Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
/**
|
||||
* API to alter the message composer.
|
||||
* API to interact with the message composer.
|
||||
* @alpha Likely to change
|
||||
*/
|
||||
export interface ComposerApi {
|
||||
/**
|
||||
* Insert plaintext into the current composer.
|
||||
* @param text - The plain text to insert
|
||||
* @param plaintext - The plain text to insert
|
||||
* @returns Returns immediately, does not await action.
|
||||
* @alpha Likely to change
|
||||
*/
|
||||
insertTextIntoComposer(text: string): void;
|
||||
insertPlaintextIntoComposer(plaintext: string): void;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user