import { Util } from "./"; /** * TODO: Some collection-only structures not included. * * This is what Notion uses to represent a rich text string. * * For example, an HTML string `HelloWorld` * can be translated into * * ```javascript * [ * ["Hello", [["b"], ["i"]]], // A SemanticString * ["World"] // Another SemanticString * ] * ``` */ export declare type SemanticString = SemanticString.BasicString | SemanticString.InlineMentionUser | SemanticString.InlineMentionPage | SemanticString.InlineMentionDate; export declare namespace SemanticString { /** * A structure to represent a reminder alarm before the start of * {@link DateTime}. * * e.g. `value` is `30`, `unit` is `minute` * -> 30 minutes before. * * e.g. `value` is `1`, `unit` is `day`, `time` is `09:00` * -> 1 day before at 9 a.m. */ type Reminder = { value: number; unit: "minute" | "hour" | "day" | "week"; /** e.g. "09:00" */ time?: string; }; /** * A structure to represent date and time. */ type DateTime = { type: "date" | "daterange" | "datetime" | "datetimerange"; /** e.g. "2019-05-27" */ start_date: string; /** e.g. "2019-05-27" */ end_date?: string; /** e.g. "15:00" */ start_time?: string; /** e.g. "15:00" */ end_time?: string; reminder?: Reminder; date_format: "relative" | "MM/DD/YYYY" | "MMM DD, YYYY" | "DD/MM/YYYY" | "YYYY/MM/DD"; /** 12h ("h:mm A") or 24h ("H:mm") */ time_format?: "h:mm A" | "H:mm"; time_zone?: Util.TimeZone; }; type Bold = ["b"]; type Italic = ["i"]; type Strike = ["s"]; /** `string` is an URL. */ type Link = ["a", string]; type InlineCode = ["c"]; /** Color or background color. */ type Colored = ["h", Util.NotionColor]; type Commented = ["m"]; type BasicStringFormatting = Bold | Italic | Strike | Link | InlineCode | Colored | Commented; type BasicString = [string, BasicStringFormatting[]?]; /** * Mention an user by ID. */ type InlineMentionUser = ["‣", [["u", Util.UUID]]]; /** * Mention a page by ID. */ type InlineMentionPage = ["‣", [["p", Util.UUID]]]; /** * Mention a date only or a date with reminder. */ type InlineMentionDate = ["‣", [["d", DateTime]]]; } //# sourceMappingURL=semantic_string.d.ts.map