You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-08 21:42:24 +03:00
Switch to a discriminated unions
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
@@ -16,15 +16,15 @@ limitations under the License.
|
||||
|
||||
import DocumentOffset from "./offset";
|
||||
import EditorModel from "./model";
|
||||
import {BasePart} from "./parts";
|
||||
import {Part} from "./parts";
|
||||
|
||||
export interface IPosition {
|
||||
index: number;
|
||||
offset: number;
|
||||
}
|
||||
|
||||
type Callback = (part: BasePart, startIdx: number, endIdx: number) => void;
|
||||
type Predicate = (index: number, offset: number, part: BasePart) => boolean;
|
||||
type Callback = (part: Part, startIdx: number, endIdx: number) => void;
|
||||
type Predicate = (index: number, offset: number, part: Part) => boolean;
|
||||
|
||||
export default class DocumentPosition implements IPosition {
|
||||
constructor(public readonly index: number, public readonly offset: number) {
|
||||
|
||||
Reference in New Issue
Block a user