Typescript conversion of Composer components and more
This commit is contained in:
@@ -17,7 +17,7 @@ limitations under the License.
|
||||
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
|
||||
|
||||
import { SerializedPart } from "../editor/parts";
|
||||
import { Caret } from "../editor/caret";
|
||||
import DocumentOffset from "../editor/offset";
|
||||
|
||||
/**
|
||||
* Used while editing, to pass the event, and to preserve editor state
|
||||
@@ -26,28 +26,28 @@ import { Caret } from "../editor/caret";
|
||||
*/
|
||||
export default class EditorStateTransfer {
|
||||
private serializedParts: SerializedPart[] = null;
|
||||
private caret: Caret = null;
|
||||
private caret: DocumentOffset = null;
|
||||
|
||||
constructor(private readonly event: MatrixEvent) {}
|
||||
|
||||
public setEditorState(caret: Caret, serializedParts: SerializedPart[]) {
|
||||
public setEditorState(caret: DocumentOffset, serializedParts: SerializedPart[]) {
|
||||
this.caret = caret;
|
||||
this.serializedParts = serializedParts;
|
||||
}
|
||||
|
||||
public hasEditorState() {
|
||||
public hasEditorState(): boolean {
|
||||
return !!this.serializedParts;
|
||||
}
|
||||
|
||||
public getSerializedParts() {
|
||||
public getSerializedParts(): SerializedPart[] {
|
||||
return this.serializedParts;
|
||||
}
|
||||
|
||||
public getCaret() {
|
||||
public getCaret(): DocumentOffset {
|
||||
return this.caret;
|
||||
}
|
||||
|
||||
public getEvent() {
|
||||
public getEvent(): MatrixEvent {
|
||||
return this.event;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user