File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ /*
2+ Copyright 2026 Element Creations Ltd.
3+
4+ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
5+ Please see LICENSE files in the repository root for full details.
6+ */
7+
8+ import { type ComposerApi as ModuleComposerApi } from "@element-hq/element-web-module-api" ;
9+
10+ import defaultDispatcher from "../dispatcher/dispatcher" ;
11+ import { Action } from "../dispatcher/actions" ;
12+ import type { ComposerInsertPayload } from "../dispatcher/payloads/ComposerInsertPayload" ;
13+ import { TimelineRenderingType } from "../contexts/RoomContext" ;
14+
15+ export class ComposerApi implements ModuleComposerApi {
16+ public insertTextIntoComposer ( text : string ) : void {
17+ defaultDispatcher . dispatch ( {
18+ action : Action . ComposerInsert ,
19+ text,
20+ timelineRenderingType : TimelineRenderingType . Room ,
21+ } satisfies ComposerInsertPayload ) ;
22+ }
23+ }
You can’t perform that action at this time.
0 commit comments