1// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0.
2// See the LICENCE file in the repository root for full licence text.
3
4import { BeatmapReviewDiscussionType } from 'interfaces/beatmap-discussion-review';
5import { BaseEditor } from 'slate';
6import { HistoryEditor } from 'slate-history';
7import { ReactEditor } from 'slate-react';
8
9interface CustomText {
10 bold?: boolean;
11 italic?: boolean;
12 text: string;
13 timestamp?: string; // added by decorateTimestamp
14}
15
16interface EmbedElement {
17 beatmapId?: number | null;
18 children: CustomText[];
19 discussionId?: number;
20 discussionType: BeatmapReviewDiscussionType;
21 // TODO: timestamp should imply/require beatmapId
22 timestamp?: string;
23 type: 'embed';
24}
25
26interface ParagraphElement {
27 children: CustomText[];
28 type: 'paragraph';
29}
30
31type CustomEditor = BaseEditor & ReactEditor & HistoryEditor;
32type CustomElement = EmbedElement | ParagraphElement;
33declare module 'slate' {
34 interface CustomTypes {
35 Editor: CustomEditor;
36 Element: CustomElement;
37 Text: CustomText;
38 }
39}