@meowdown/core 0.65.2 → 0.65.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +69 -68
- package/dist/index.js +644 -185
- package/package.json +4 -2
package/dist/index.d.ts
CHANGED
|
@@ -14,11 +14,12 @@ import { VirtualElement } from "@floating-ui/dom";
|
|
|
14
14
|
/**
|
|
15
15
|
* How faithfully markdown survives a parse-then-serialize round trip:
|
|
16
16
|
* - `exact`: byte-identical (modulo the trailing newline).
|
|
17
|
-
* - `normalizing`: bytes differ, but only as layout the parser
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* - `lossy`: content changed - a
|
|
17
|
+
* - `normalizing`: bytes differ, but only as layout the parser reads back
|
|
18
|
+
* through - every content line survives and the output re-parses to the same
|
|
19
|
+
* document (e.g. a lazy continuation re-indented, or `>>>>>>> x` respaced to
|
|
20
|
+
* the seven blockquotes it already meant).
|
|
21
|
+
* - `lossy`: content changed - a content line differs or disappeared, or the
|
|
22
|
+
* output re-parses to a different document.
|
|
22
23
|
*/
|
|
23
24
|
type RoundTripFidelity = 'exact' | 'normalizing' | 'lossy';
|
|
24
25
|
/**
|
|
@@ -33,7 +34,7 @@ interface CheckRoundTripOptions {
|
|
|
33
34
|
/**
|
|
34
35
|
* Classify how `markdown` survives the editor's parse-then-serialize round trip.
|
|
35
36
|
*/
|
|
36
|
-
declare function checkRoundTrip(markdown: string, options?: CheckRoundTripOptions): RoundTripFidelity;
|
|
37
|
+
export declare function checkRoundTrip(markdown: string, options?: CheckRoundTripOptions): RoundTripFidelity;
|
|
37
38
|
//#endregion
|
|
38
39
|
//#region src/extensions/frontmatter.d.ts
|
|
39
40
|
/**
|
|
@@ -99,7 +100,7 @@ type TableHeaderCellAlignExtension = Extension<{
|
|
|
99
100
|
* undefined when the selection is outside a table or the column has no
|
|
100
101
|
* alignment.
|
|
101
102
|
*/
|
|
102
|
-
declare function getTableColumnAlign(state: EditorState): TableColumnAlign | undefined;
|
|
103
|
+
export declare function getTableColumnAlign(state: EditorState): TableColumnAlign | undefined;
|
|
103
104
|
type TableColumnAlignCommandsExtension = Extension<{
|
|
104
105
|
Commands: {
|
|
105
106
|
setTableColumnAlign: [align: TableColumnAlign | null];
|
|
@@ -173,7 +174,7 @@ type HTMLCommentExtension = Extension<{
|
|
|
173
174
|
* The node is `atom` (no editable content) and not selectable: it is an opaque,
|
|
174
175
|
* invisible marker the cursor steps over rather than a block the user edits.
|
|
175
176
|
*/
|
|
176
|
-
declare function defineHTMLComment(): HTMLCommentExtension;
|
|
177
|
+
export declare function defineHTMLComment(): HTMLCommentExtension;
|
|
177
178
|
//#endregion
|
|
178
179
|
//#region src/extensions/inline-marks.d.ts
|
|
179
180
|
/**
|
|
@@ -357,7 +358,7 @@ type LinkUnit = (LinkUnitBase & {
|
|
|
357
358
|
* `mdPack` unit gives the shape and carries the `href`/`title` in its `data`, and
|
|
358
359
|
* the `mdLinkUri` run locates the `( )` body.
|
|
359
360
|
*/
|
|
360
|
-
declare function getLinkUnitAt(state: EditorState, pos: number): LinkUnit | undefined;
|
|
361
|
+
export declare function getLinkUnitAt(state: EditorState, pos: number): LinkUnit | undefined;
|
|
361
362
|
//#endregion
|
|
362
363
|
//#region src/extensions/link-commands.d.ts
|
|
363
364
|
interface LinkAttrs {
|
|
@@ -369,16 +370,16 @@ interface InsertLinkOptions {
|
|
|
369
370
|
title?: string;
|
|
370
371
|
wrapText?: boolean;
|
|
371
372
|
}
|
|
372
|
-
declare function insertLink({ href, title, wrapText }?: InsertLinkOptions): Command;
|
|
373
|
+
export declare function insertLink({ href, title, wrapText }?: InsertLinkOptions): Command;
|
|
373
374
|
/**
|
|
374
375
|
* Rewrite the `( ... )` of the link at the caret/selection.
|
|
375
376
|
*/
|
|
376
|
-
declare function updateLink(attrs: LinkAttrs): Command;
|
|
377
|
+
export declare function updateLink(attrs: LinkAttrs): Command;
|
|
377
378
|
/**
|
|
378
379
|
* Unwrap the link at the caret: keep the label text, drop the syntax.
|
|
379
380
|
*/
|
|
380
|
-
declare function removeLink(): Command;
|
|
381
|
-
declare function defineLinkCommands(): Extension<{
|
|
381
|
+
export declare function removeLink(): Command;
|
|
382
|
+
export declare function defineLinkCommands(): Extension<{
|
|
382
383
|
Commands: {
|
|
383
384
|
insertLink: [options?: InsertLinkOptions];
|
|
384
385
|
updateLink: [attrs: LinkAttrs];
|
|
@@ -391,7 +392,7 @@ interface LinkEditOptions {
|
|
|
391
392
|
link: LinkUnit | undefined;
|
|
392
393
|
}
|
|
393
394
|
type LinkEditHandler = (options: LinkEditOptions) => void;
|
|
394
|
-
declare function defineLinkEditKeymap(onLinkEdit: LinkEditHandler): PlainExtension;
|
|
395
|
+
export declare function defineLinkEditKeymap(onLinkEdit: LinkEditHandler): PlainExtension;
|
|
395
396
|
//#endregion
|
|
396
397
|
//#region src/extensions/pending-replacement.d.ts
|
|
397
398
|
/**
|
|
@@ -428,7 +429,7 @@ interface PendingReplacement {
|
|
|
428
429
|
/**
|
|
429
430
|
* The active pending replacement, or null when there is none.
|
|
430
431
|
*/
|
|
431
|
-
declare function getPendingReplacement(state: EditorState): PendingReplacement | null;
|
|
432
|
+
export declare function getPendingReplacement(state: EditorState): PendingReplacement | null;
|
|
432
433
|
/**
|
|
433
434
|
* Options for the `startPendingReplacement` command.
|
|
434
435
|
*/
|
|
@@ -460,7 +461,7 @@ type PendingReplacementHandler = (event: PendingReplacementEvent) => void;
|
|
|
460
461
|
* Watches pending-replacement state and reports changes, so a UI layer can
|
|
461
462
|
* render the preview and know whether the stage was accepted or discarded.
|
|
462
463
|
*/
|
|
463
|
-
declare function definePendingReplacementHandler(handler: PendingReplacementHandler): PlainExtension;
|
|
464
|
+
export declare function definePendingReplacementHandler(handler: PendingReplacementHandler): PlainExtension;
|
|
464
465
|
//#endregion
|
|
465
466
|
//#region src/extensions/mark-chunk.d.ts
|
|
466
467
|
/**
|
|
@@ -479,7 +480,7 @@ interface ReferenceDefinitionIndex {
|
|
|
479
480
|
definitions: ReferenceDefinitions;
|
|
480
481
|
nodes: ReadonlySet<EditorNode>;
|
|
481
482
|
}
|
|
482
|
-
declare function collectReferenceDefinitions(doc: EditorNode): ReferenceDefinitionIndex;
|
|
483
|
+
export declare function collectReferenceDefinitions(doc: EditorNode): ReferenceDefinitionIndex;
|
|
483
484
|
//#endregion
|
|
484
485
|
//#region src/extensions/wiki-embed.d.ts
|
|
485
486
|
/**
|
|
@@ -556,15 +557,15 @@ interface WikiEmbedOptions {
|
|
|
556
557
|
/**
|
|
557
558
|
* Parse `![[target]]`, `![[target|alias]]`, `![[target|width]]`, or `![[target|widthxheight]]`.
|
|
558
559
|
*/
|
|
559
|
-
declare function parseWikiEmbed(source: string): ParsedWikiEmbed;
|
|
560
|
+
export declare function parseWikiEmbed(source: string): ParsedWikiEmbed;
|
|
560
561
|
/**
|
|
561
562
|
* Rewrite a wiki image embed with a persisted display size.
|
|
562
563
|
*/
|
|
563
|
-
declare function formatSizedWikiEmbed(target: string, width: number, height: number): string;
|
|
564
|
+
export declare function formatSizedWikiEmbed(target: string, width: number, height: number): string;
|
|
564
565
|
/**
|
|
565
566
|
* Last path component of a target, with a note heading/block fragment removed.
|
|
566
567
|
*/
|
|
567
|
-
declare function wikiEmbedBasename(target: string): string;
|
|
568
|
+
export declare function wikiEmbedBasename(target: string): string;
|
|
568
569
|
//#endregion
|
|
569
570
|
//#region src/extensions/inline-text-to-mark-chunks.d.ts
|
|
570
571
|
/**
|
|
@@ -625,7 +626,7 @@ interface InlineMarkContext {
|
|
|
625
626
|
* with positions relative to the start of `text` (i.e. zero-based).
|
|
626
627
|
* Callers shift the chunks into the document's coordinate space.
|
|
627
628
|
*/
|
|
628
|
-
declare function inlineTextToMarkChunks(
|
|
629
|
+
export declare function inlineTextToMarkChunks(
|
|
629
630
|
/**
|
|
630
631
|
* Typed mark builders bound to the target schema.
|
|
631
632
|
*/
|
|
@@ -638,7 +639,7 @@ text: string,
|
|
|
638
639
|
* Host options; omit for the default parse.
|
|
639
640
|
*/
|
|
640
641
|
options?: InlineMarkOptions): MarkChunk[];
|
|
641
|
-
declare function inlineTextToMarkChunksWithContext(marks: TypedMarkBuilders, text: string, options?: InlineMarkOptions, context?: InlineMarkContext): MarkChunk[];
|
|
642
|
+
export declare function inlineTextToMarkChunksWithContext(marks: TypedMarkBuilders, text: string, options?: InlineMarkOptions, context?: InlineMarkContext): MarkChunk[];
|
|
642
643
|
//#endregion
|
|
643
644
|
//#region src/extensions/mark-mode.d.ts
|
|
644
645
|
/**
|
|
@@ -841,7 +842,7 @@ type EditorExtensionOptions = InlineMarkOptions & {
|
|
|
841
842
|
*/
|
|
842
843
|
markMode?: MarkMode;
|
|
843
844
|
};
|
|
844
|
-
declare function defineEditorExtension(options?: EditorExtensionOptions): EditorExtension;
|
|
845
|
+
export declare function defineEditorExtension(options?: EditorExtensionOptions): EditorExtension;
|
|
845
846
|
type TypedEditor = Editor<EditorExtension>;
|
|
846
847
|
//#endregion
|
|
847
848
|
//#region src/extensions/schema.d.ts
|
|
@@ -850,7 +851,7 @@ type TypedMarkBuilders = ExtractMarkBuilders<EditorExtension>;
|
|
|
850
851
|
/**
|
|
851
852
|
* Typed mark builders bound to the shared schema.
|
|
852
853
|
*/
|
|
853
|
-
declare const getMarkBuilders: () => TypedMarkBuilders;
|
|
854
|
+
export declare const getMarkBuilders: () => TypedMarkBuilders;
|
|
854
855
|
//#endregion
|
|
855
856
|
//#region src/converters/md-to-pm.d.ts
|
|
856
857
|
/**
|
|
@@ -880,7 +881,7 @@ interface MarkdownToDocOptions {
|
|
|
880
881
|
* inline marks because the markdown stays literal text - emphasis / link /
|
|
881
882
|
* inline-code characters survive verbatim.
|
|
882
883
|
*/
|
|
883
|
-
declare function markdownToDoc(markdown: string, options?: MarkdownToDocOptions): ProseMirrorNode;
|
|
884
|
+
export declare function markdownToDoc(markdown: string, options?: MarkdownToDocOptions): ProseMirrorNode;
|
|
884
885
|
//#endregion
|
|
885
886
|
//#region src/converters/pm-to-md.d.ts
|
|
886
887
|
/**
|
|
@@ -907,7 +908,7 @@ interface DocToMarkdownOptions {
|
|
|
907
908
|
* - Backtick fence width and cell escaping use single linear loops, no
|
|
908
909
|
* regex on the hot path.
|
|
909
910
|
*/
|
|
910
|
-
declare function docToMarkdown(node: ProseMirrorNode, options?: DocToMarkdownOptions): string;
|
|
911
|
+
export declare function docToMarkdown(node: ProseMirrorNode, options?: DocToMarkdownOptions): string;
|
|
911
912
|
//#endregion
|
|
912
913
|
//#region src/extensions/bullet-after-heading.d.ts
|
|
913
914
|
/**
|
|
@@ -915,7 +916,7 @@ declare function docToMarkdown(node: ProseMirrorNode, options?: DocToMarkdownOpt
|
|
|
915
916
|
* pressing Enter at the end of the document's first heading (the title line)
|
|
916
917
|
* drops the caret into a fresh empty bullet instead of a plain paragraph.
|
|
917
918
|
*/
|
|
918
|
-
declare function defineBulletAfterHeading(): PlainExtension;
|
|
919
|
+
export declare function defineBulletAfterHeading(): PlainExtension;
|
|
919
920
|
//#endregion
|
|
920
921
|
//#region src/extensions/code-block-highlight.d.ts
|
|
921
922
|
/**
|
|
@@ -924,7 +925,7 @@ declare function defineBulletAfterHeading(): PlainExtension;
|
|
|
924
925
|
* `@codemirror/language-data`). Tokens are tagged with `@lezer/highlight`
|
|
925
926
|
* `tok-*` classes; the default theme colors them per color scheme.
|
|
926
927
|
*/
|
|
927
|
-
declare function defineCodeBlockSyntaxHighlight(): Extension;
|
|
928
|
+
export declare function defineCodeBlockSyntaxHighlight(): Extension;
|
|
928
929
|
/**
|
|
929
930
|
* A highlighted span of code: `[from, to)` carries the `@lezer/highlight` classes.
|
|
930
931
|
*/
|
|
@@ -935,7 +936,7 @@ type CodeToken = readonly [from: number, to: number, classes: string];
|
|
|
935
936
|
* loaded (the common path, no render flash), and a `Promise` only when a grammar
|
|
936
937
|
* must load on demand. Returns `[]` for an empty or unsupported language.
|
|
937
938
|
*/
|
|
938
|
-
declare function getCodeTokens(code: string, language: string): CodeToken[] | Promise<CodeToken[]>;
|
|
939
|
+
export declare function getCodeTokens(code: string, language: string): CodeToken[] | Promise<CodeToken[]>;
|
|
939
940
|
//#endregion
|
|
940
941
|
//#region src/extensions/code-block-languages.d.ts
|
|
941
942
|
type LanguageItem = {
|
|
@@ -945,7 +946,7 @@ type LanguageItem = {
|
|
|
945
946
|
/**
|
|
946
947
|
* A list of languages for code block syntax-highlight.
|
|
947
948
|
*/
|
|
948
|
-
declare const codeBlockLanguages: ReadonlyArray<LanguageItem>;
|
|
949
|
+
export declare const codeBlockLanguages: ReadonlyArray<LanguageItem>;
|
|
949
950
|
//#endregion
|
|
950
951
|
//#region src/extensions/embed-paste.d.ts
|
|
951
952
|
/**
|
|
@@ -954,7 +955,7 @@ declare const codeBlockLanguages: ReadonlyArray<LanguageItem>;
|
|
|
954
955
|
* renders as a rich embed. Not part of `defineEditorExtension`; the React
|
|
955
956
|
* package applies it via the `embedPaste` prop (on by default).
|
|
956
957
|
*/
|
|
957
|
-
declare function defineEmbedPaste(): PlainExtension;
|
|
958
|
+
export declare function defineEmbedPaste(): PlainExtension;
|
|
958
959
|
//#endregion
|
|
959
960
|
//#region src/extensions/embed-types.d.ts
|
|
960
961
|
/**
|
|
@@ -1004,13 +1005,13 @@ interface EmbedDescriptor {
|
|
|
1004
1005
|
* the editor's DOM mark view (which has no destroy hook) is covered, while a
|
|
1005
1006
|
* React caller can call it on unmount.
|
|
1006
1007
|
*/
|
|
1007
|
-
declare function listenForTweetHeight(iframe: HTMLIFrameElement, onHeight?: (height: number) => void): () => void;
|
|
1008
|
+
export declare function listenForTweetHeight(iframe: HTMLIFrameElement, onHeight?: (height: number) => void): () => void;
|
|
1008
1009
|
//#endregion
|
|
1009
1010
|
//#region src/extensions/embed.d.ts
|
|
1010
1011
|
/**
|
|
1011
1012
|
* Detect a tweet/YouTube embed in an image `src`, or `undefined` for a plain image.
|
|
1012
1013
|
*/
|
|
1013
|
-
declare function matchEmbed(src: string): EmbedDescriptor | undefined;
|
|
1014
|
+
export declare function matchEmbed(src: string): EmbedDescriptor | undefined;
|
|
1014
1015
|
//#endregion
|
|
1015
1016
|
//#region src/extensions/exit-boundary.d.ts
|
|
1016
1017
|
/**
|
|
@@ -1035,7 +1036,7 @@ type ExitBoundaryHandler = (options: ExitBoundaryOptions) => boolean | void;
|
|
|
1035
1036
|
/**
|
|
1036
1037
|
* Call `onExitBoundary` when an arrow key press would leave the document boundary.
|
|
1037
1038
|
*/
|
|
1038
|
-
declare function defineExitBoundaryHandler(onExitBoundary: ExitBoundaryHandler): PlainExtension;
|
|
1039
|
+
export declare function defineExitBoundaryHandler(onExitBoundary: ExitBoundaryHandler): PlainExtension;
|
|
1039
1040
|
//#endregion
|
|
1040
1041
|
//#region src/extensions/file-click.d.ts
|
|
1041
1042
|
/**
|
|
@@ -1067,7 +1068,7 @@ type FileClickHandler = (payload: FileClickPayload) => void;
|
|
|
1067
1068
|
* `href`, `name`, and the originating `MouseEvent`. The host decides what a
|
|
1068
1069
|
* click does (e.g. open the file in the OS default app).
|
|
1069
1070
|
*/
|
|
1070
|
-
declare function defineFileClickHandler(onClick: FileClickHandler): PlainExtension;
|
|
1071
|
+
export declare function defineFileClickHandler(onClick: FileClickHandler): PlainExtension;
|
|
1071
1072
|
//#endregion
|
|
1072
1073
|
//#region src/extensions/file-paste.d.ts
|
|
1073
1074
|
type FilePasteHandler = (file: File) => string | undefined | Promise<string | undefined>;
|
|
@@ -1095,7 +1096,7 @@ interface FilePasteOptions {
|
|
|
1095
1096
|
* name. Exported so a host command that inserts file links itself (e.g. an
|
|
1096
1097
|
* attach-file picker) produces markdown byte-identical to a paste/drop.
|
|
1097
1098
|
*/
|
|
1098
|
-
declare function buildFileMarkdown(file: {
|
|
1099
|
+
export declare function buildFileMarkdown(file: {
|
|
1099
1100
|
name: string;
|
|
1100
1101
|
type?: string;
|
|
1101
1102
|
}, destination: string): string;
|
|
@@ -1104,7 +1105,7 @@ declare function buildFileMarkdown(file: {
|
|
|
1104
1105
|
* markdown destination: `` for an image, a `[name](src)` link for any
|
|
1105
1106
|
* other file. Multiple files insert one link per line, in DataTransfer order.
|
|
1106
1107
|
*/
|
|
1107
|
-
declare function defineFilePaste(options?: FilePasteOptions): PlainExtension;
|
|
1108
|
+
export declare function defineFilePaste(options?: FilePasteOptions): PlainExtension;
|
|
1108
1109
|
//#endregion
|
|
1109
1110
|
//#region src/extensions/file-view.d.ts
|
|
1110
1111
|
/**
|
|
@@ -1136,14 +1137,14 @@ interface FileViewOptions {
|
|
|
1136
1137
|
/**
|
|
1137
1138
|
* Classify a file destination for the pill's `data-file-kind` attribute.
|
|
1138
1139
|
*/
|
|
1139
|
-
declare function getFileKind(href: string): string;
|
|
1140
|
+
export declare function getFileKind(href: string): string;
|
|
1140
1141
|
/**
|
|
1141
1142
|
* Render a claimed file link or wiki embed (the `mdFile` mark) as an inline
|
|
1142
1143
|
* pill: a file-kind icon, the file name, and the size once
|
|
1143
1144
|
* `resolveFileInfo` supplies it. The pill never loads the file's content;
|
|
1144
1145
|
* clicks are reported through `defineFileClickHandler`.
|
|
1145
1146
|
*/
|
|
1146
|
-
declare function defineFileView(options?: FileViewOptions): PlainExtension;
|
|
1147
|
+
export declare function defineFileView(options?: FileViewOptions): PlainExtension;
|
|
1147
1148
|
//#endregion
|
|
1148
1149
|
//#region src/extensions/image-click.d.ts
|
|
1149
1150
|
/**
|
|
@@ -1182,7 +1183,7 @@ type ImageClickHandler = (payload: ImageClickPayload) => void;
|
|
|
1182
1183
|
* raises the software keyboard before the handler opens its own surface
|
|
1183
1184
|
* (such as a lightbox).
|
|
1184
1185
|
*/
|
|
1185
|
-
declare function defineImageClickHandler(onClick: ImageClickHandler): PlainExtension;
|
|
1186
|
+
export declare function defineImageClickHandler(onClick: ImageClickHandler): PlainExtension;
|
|
1186
1187
|
//#endregion
|
|
1187
1188
|
//#region src/extensions/link-click.d.ts
|
|
1188
1189
|
interface LinkClickPayload {
|
|
@@ -1207,7 +1208,7 @@ type LinkCopyHandler = (payload: LinkCopyPayload) => void;
|
|
|
1207
1208
|
* (`[text](url)`), or presses `Mod-Enter` with the caret on one. The `event`
|
|
1208
1209
|
* is the originating `MouseEvent` or `KeyboardEvent`.
|
|
1209
1210
|
*/
|
|
1210
|
-
declare function defineLinkClickHandler(onClick: LinkClickHandler): PlainExtension;
|
|
1211
|
+
export declare function defineLinkClickHandler(onClick: LinkClickHandler): PlainExtension;
|
|
1211
1212
|
//#endregion
|
|
1212
1213
|
//#region src/extensions/tag-click.d.ts
|
|
1213
1214
|
interface TagClickPayload {
|
|
@@ -1232,7 +1233,7 @@ type TagClickHandler = (payload: TagClickPayload) => void;
|
|
|
1232
1233
|
* `Mod-Enter` with the caret on one. The `tag` is read from the rendered text
|
|
1233
1234
|
* without the leading `#`.
|
|
1234
1235
|
*/
|
|
1235
|
-
declare function defineTagClickHandler(onClick: TagClickHandler): PlainExtension;
|
|
1236
|
+
export declare function defineTagClickHandler(onClick: TagClickHandler): PlainExtension;
|
|
1236
1237
|
//#endregion
|
|
1237
1238
|
//#region src/extensions/wikilink-click.d.ts
|
|
1238
1239
|
interface WikilinkHit {
|
|
@@ -1258,7 +1259,7 @@ type WikilinkClickHandler = (payload: WikilinkClickPayload) => void;
|
|
|
1258
1259
|
* `Mod-Enter` with the caret on one. The `event` is the originating
|
|
1259
1260
|
* `MouseEvent` or `KeyboardEvent`.
|
|
1260
1261
|
*/
|
|
1261
|
-
declare function defineWikilinkClickHandler(onClick: WikilinkClickHandler): PlainExtension;
|
|
1262
|
+
export declare function defineWikilinkClickHandler(onClick: WikilinkClickHandler): PlainExtension;
|
|
1262
1263
|
//#endregion
|
|
1263
1264
|
//#region src/extensions/follow-link.d.ts
|
|
1264
1265
|
interface FollowLinkHandlers {
|
|
@@ -1283,7 +1284,7 @@ interface FollowLinkHandlers {
|
|
|
1283
1284
|
* a caret follow always reports `mod: false`, its mod key being the trigger
|
|
1284
1285
|
* itself.
|
|
1285
1286
|
*/
|
|
1286
|
-
declare function defineFollowLinkHandler(handlers: FollowLinkHandlers): PlainExtension;
|
|
1287
|
+
export declare function defineFollowLinkHandler(handlers: FollowLinkHandlers): PlainExtension;
|
|
1287
1288
|
//#endregion
|
|
1288
1289
|
//#region src/extensions/image.d.ts
|
|
1289
1290
|
type ImageUrlResolver = (src: string) => string | undefined;
|
|
@@ -1307,7 +1308,7 @@ interface ImageOptions {
|
|
|
1307
1308
|
/**
|
|
1308
1309
|
* Show an `src` as-is when it is an http(s) URL, otherwise skip rendering it.
|
|
1309
1310
|
*/
|
|
1310
|
-
declare function defaultResolveImageUrl(src: string): string | undefined;
|
|
1311
|
+
export declare function defaultResolveImageUrl(src: string): string | undefined;
|
|
1311
1312
|
/**
|
|
1312
1313
|
* Inline image/embed rendering: a mark view on the `mdImage` mark. Images
|
|
1313
1314
|
* render in place from their literal Markdown source. Drag a rendered image's
|
|
@@ -1315,13 +1316,13 @@ declare function defaultResolveImageUrl(src: string): string | undefined;
|
|
|
1315
1316
|
* `<!-- {"width":320,"height":240} -->`, which round-trips as
|
|
1316
1317
|
* plain Markdown.
|
|
1317
1318
|
*/
|
|
1318
|
-
declare function defineImage(options?: ImageOptions): PlainExtension;
|
|
1319
|
+
export declare function defineImage(options?: ImageOptions): PlainExtension;
|
|
1319
1320
|
//#endregion
|
|
1320
1321
|
//#region src/extensions/key-bindings.d.ts
|
|
1321
1322
|
/**
|
|
1322
1323
|
* Human-readable descriptions of the editor's formatting and heading shortcuts.
|
|
1323
1324
|
*/
|
|
1324
|
-
declare const EDITOR_KEY_BINDINGS: {
|
|
1325
|
+
export declare const EDITOR_KEY_BINDINGS: {
|
|
1325
1326
|
readonly 'Mod-b': "Bold";
|
|
1326
1327
|
readonly 'Mod-i': "Italic";
|
|
1327
1328
|
readonly 'Mod-e': "Inline code";
|
|
@@ -1358,7 +1359,7 @@ interface MarkHoverHit<Payload> {
|
|
|
1358
1359
|
//#endregion
|
|
1359
1360
|
//#region src/extensions/link-hover.d.ts
|
|
1360
1361
|
type LinkHoverHandler = (hit: MarkHoverHit<LinkUnit> | undefined) => void;
|
|
1361
|
-
declare function defineLinkHoverHandler(onHoverChange: LinkHoverHandler): PlainExtension;
|
|
1362
|
+
export declare function defineLinkHoverHandler(onHoverChange: LinkHoverHandler): PlainExtension;
|
|
1362
1363
|
//#endregion
|
|
1363
1364
|
//#region src/extensions/link-paste.d.ts
|
|
1364
1365
|
/**
|
|
@@ -1374,18 +1375,18 @@ declare function defineLinkHoverHandler(onHoverChange: LinkHoverHandler): PlainE
|
|
|
1374
1375
|
* embed. Not part of `defineEditorExtension`; the React package applies it via
|
|
1375
1376
|
* the `linkPaste` prop (on by default).
|
|
1376
1377
|
*/
|
|
1377
|
-
declare function defineLinkPaste(): PlainExtension;
|
|
1378
|
+
export declare function defineLinkPaste(): PlainExtension;
|
|
1378
1379
|
//#endregion
|
|
1379
1380
|
//#region src/extensions/mark-names.d.ts
|
|
1380
1381
|
declare const MARK_NAMES: readonly ["mdWikilink", "mdImage", "mdFile", "mdMath", "mdMark", "mdEm", "mdStrong", "mdCode", "mdLinkText", "mdLinkUri", "mdLinkTitle", "mdDel", "mdHighlight", "mdTag", "mdPack"];
|
|
1381
1382
|
type MarkName = (typeof MARK_NAMES)[number];
|
|
1382
|
-
declare function isMarkOfType(mark: Mark, name: MarkName): boolean;
|
|
1383
|
+
export declare function isMarkOfType(mark: Mark, name: MarkName): boolean;
|
|
1383
1384
|
//#endregion
|
|
1384
1385
|
//#region src/extensions/math.d.ts
|
|
1385
1386
|
/**
|
|
1386
1387
|
* Inline math rendering: a KaTeX preview on the `mdMath` mark.
|
|
1387
1388
|
*/
|
|
1388
|
-
declare function defineMath(): PlainExtension;
|
|
1389
|
+
export declare function defineMath(): PlainExtension;
|
|
1389
1390
|
//#endregion
|
|
1390
1391
|
//#region src/extensions/node-names.d.ts
|
|
1391
1392
|
/**
|
|
@@ -1393,26 +1394,26 @@ declare function defineMath(): PlainExtension;
|
|
|
1393
1394
|
*/
|
|
1394
1395
|
declare const NODE_NAMES: readonly ["doc", "text", "paragraph", "heading", "blockquote", "list", "codeBlock", "horizontalRule", "htmlComment", "table", "tableRow", "tableCell", "tableHeaderCell"];
|
|
1395
1396
|
type NodeName = (typeof NODE_NAMES)[number];
|
|
1396
|
-
declare function isNodeOfType(node: ProseMirrorNode, name: NodeName): boolean;
|
|
1397
|
+
export declare function isNodeOfType(node: ProseMirrorNode, name: NodeName): boolean;
|
|
1397
1398
|
//#endregion
|
|
1398
1399
|
//#region src/extensions/spell-check.d.ts
|
|
1399
1400
|
/**
|
|
1400
1401
|
* @deprecated This will be removed in future versions.
|
|
1401
1402
|
*/
|
|
1402
|
-
declare function defineSpellCheckPlugin(spellCheck: boolean): PlainExtension;
|
|
1403
|
+
export declare function defineSpellCheckPlugin(spellCheck: boolean): PlainExtension;
|
|
1403
1404
|
//#endregion
|
|
1404
1405
|
//#region src/extensions/substitution.d.ts
|
|
1405
1406
|
/**
|
|
1406
1407
|
* Apply the editor's automatic plain-text substitutions.
|
|
1407
1408
|
*/
|
|
1408
|
-
declare function defineSubstitution(): PlainExtension;
|
|
1409
|
+
export declare function defineSubstitution(): PlainExtension;
|
|
1409
1410
|
//#endregion
|
|
1410
1411
|
//#region src/extensions/table.d.ts
|
|
1411
1412
|
/**
|
|
1412
1413
|
* Whether the selection sits inside a table cell (data or header). Useful for
|
|
1413
1414
|
* gating block-creating UI, since cells hold inline content only.
|
|
1414
1415
|
*/
|
|
1415
|
-
declare function isSelectionInTableCell(state: EditorState): boolean;
|
|
1416
|
+
export declare function isSelectionInTableCell(state: EditorState): boolean;
|
|
1416
1417
|
//#endregion
|
|
1417
1418
|
//#region src/extensions/view-attributes.d.ts
|
|
1418
1419
|
/**
|
|
@@ -1420,7 +1421,7 @@ declare function isSelectionInTableCell(state: EditorState): boolean;
|
|
|
1420
1421
|
* every such extension are combined, so applying this more than once adds
|
|
1421
1422
|
* classes instead of replacing them.
|
|
1422
1423
|
*/
|
|
1423
|
-
declare function defineViewAttributes(attributes: {
|
|
1424
|
+
export declare function defineViewAttributes(attributes: {
|
|
1424
1425
|
[name: string]: string;
|
|
1425
1426
|
} | ((state: EditorState) => {
|
|
1426
1427
|
[name: string]: string;
|
|
@@ -1443,7 +1444,7 @@ declare function defineViewAttributes(attributes: {
|
|
|
1443
1444
|
* it must live outside the contenteditable and scroll together with the
|
|
1444
1445
|
* content.
|
|
1445
1446
|
*/
|
|
1446
|
-
declare function defineVirtualCaret(layer: HTMLElement): PlainExtension;
|
|
1447
|
+
export declare function defineVirtualCaret(layer: HTMLElement): PlainExtension;
|
|
1447
1448
|
//#endregion
|
|
1448
1449
|
//#region src/extensions/wikilink-hover.d.ts
|
|
1449
1450
|
/**
|
|
@@ -1466,37 +1467,37 @@ type WikilinkHoverHandler = (hit: WikilinkHoverHit | undefined) => void;
|
|
|
1466
1467
|
* when the hovered link is deleted, replaced, or changes target. Moving among
|
|
1467
1468
|
* descendants of one label is de-duplicated.
|
|
1468
1469
|
*/
|
|
1469
|
-
declare function defineWikilinkHoverHandler(onHoverChange: WikilinkHoverHandler): PlainExtension;
|
|
1470
|
+
export declare function defineWikilinkHoverHandler(onHoverChange: WikilinkHoverHandler): PlainExtension;
|
|
1470
1471
|
//#endregion
|
|
1471
1472
|
//#region src/extensions/wikilink-trigger.d.ts
|
|
1472
1473
|
/**
|
|
1473
1474
|
* Binds `Mod-Shift-k` to open the wikilink menu, and `[` to wrap a selected
|
|
1474
1475
|
* phrase into an open wikilink (`[[phrase`) with the menu searching it.
|
|
1475
1476
|
*/
|
|
1476
|
-
declare function defineWikilinkTrigger(): PlainExtension;
|
|
1477
|
+
export declare function defineWikilinkTrigger(): PlainExtension;
|
|
1477
1478
|
//#endregion
|
|
1478
1479
|
//#region src/utils/composition.d.ts
|
|
1479
|
-
declare function getIsComposing(): boolean;
|
|
1480
|
+
export declare function getIsComposing(): boolean;
|
|
1480
1481
|
//#endregion
|
|
1481
1482
|
//#region src/utils/display-text.d.ts
|
|
1482
1483
|
/**
|
|
1483
1484
|
* The textblock as its live-preview marks display it: syntax runs are
|
|
1484
1485
|
* omitted and each atom unit is replaced by its display text.
|
|
1485
1486
|
*/
|
|
1486
|
-
declare function getTextblockDisplayText(textblock: ProseMirrorNode): string;
|
|
1487
|
+
export declare function getTextblockDisplayText(textblock: ProseMirrorNode): string;
|
|
1487
1488
|
//#endregion
|
|
1488
1489
|
//#region src/utils/format-file-size.d.ts
|
|
1489
1490
|
/**
|
|
1490
1491
|
* Format a byte count for display on a file pill: decimal units (1 KB =
|
|
1491
1492
|
* 1000 B, matching macOS Finder), one decimal below 10, integers otherwise.
|
|
1492
1493
|
*/
|
|
1493
|
-
declare function formatFileSize(bytes: number): string;
|
|
1494
|
+
export declare function formatFileSize(bytes: number): string;
|
|
1494
1495
|
//#endregion
|
|
1495
1496
|
//#region src/utils/is-mod-event.d.ts
|
|
1496
1497
|
/**
|
|
1497
1498
|
* Whether the platform's mod key is held on `event`: `Command` on Apple, `Ctrl` elsewhere.
|
|
1498
1499
|
*/
|
|
1499
|
-
declare function isModEvent(event: MouseEvent | KeyboardEvent | TouchEvent | {
|
|
1500
|
+
export declare function isModEvent(event: MouseEvent | KeyboardEvent | TouchEvent | {
|
|
1500
1501
|
metaKey: boolean;
|
|
1501
1502
|
ctrlKey: boolean;
|
|
1502
1503
|
}): boolean;
|
|
@@ -1509,14 +1510,14 @@ type KaTeXRender = typeof render;
|
|
|
1509
1510
|
* Load KaTeX's render function on first use and cache it. Most documents
|
|
1510
1511
|
* contain no math, so the library stays out of the initial bundle.
|
|
1511
1512
|
*/
|
|
1512
|
-
declare function loadKaTeX(): Promise<KaTeXRender>;
|
|
1513
|
+
export declare function loadKaTeX(): Promise<KaTeXRender>;
|
|
1513
1514
|
/**
|
|
1514
1515
|
* Render TeX into `element` as native MathML (no KaTeX stylesheet or fonts
|
|
1515
1516
|
* required). `throwOnError: false` renders parse errors as red text; the
|
|
1516
1517
|
* catch covers the rare non-parse error so a bad formula can never crash a
|
|
1517
1518
|
* render.
|
|
1518
1519
|
*/
|
|
1519
|
-
declare function renderMathInto(katexRender: KaTeXRender, element: HTMLElement, formula: string, displayMode: boolean): void;
|
|
1520
|
+
export declare function renderMathInto(katexRender: KaTeXRender, element: HTMLElement, formula: string, displayMode: boolean): void;
|
|
1520
1521
|
//#endregion
|
|
1521
1522
|
//#region src/utils/selected-text.d.ts
|
|
1522
1523
|
/**
|
|
@@ -1526,7 +1527,7 @@ declare function renderMathInto(katexRender: KaTeXRender, element: HTMLElement,
|
|
|
1526
1527
|
* bare text; a multi-block selection keeps its block markers, so downstream
|
|
1527
1528
|
* consumers (e.g. an AI prompt) see the same Markdown the user would.
|
|
1528
1529
|
*/
|
|
1529
|
-
declare function getSelectedText(state: EditorState): string;
|
|
1530
|
+
export declare function getSelectedText(state: EditorState): string;
|
|
1530
1531
|
//#endregion
|
|
1531
1532
|
//#region src/utils/virtual-element.d.ts
|
|
1532
1533
|
/**
|
|
@@ -1536,6 +1537,6 @@ declare function getSelectedText(state: EditorState): string;
|
|
|
1536
1537
|
* frames), so a measurement can fire after the view is destroyed or the range
|
|
1537
1538
|
* no longer resolves; those return the last known rect instead of throwing.
|
|
1538
1539
|
*/
|
|
1539
|
-
declare function getVirtualElementFromRange(view: EditorView, range: PositionRange): VirtualElement;
|
|
1540
|
+
export declare function getVirtualElementFromRange(view: EditorView, range: PositionRange): VirtualElement;
|
|
1540
1541
|
//#endregion
|
|
1541
|
-
export { type AcceptPendingReplacementOptions, type CheckRoundTripOptions, type CodeBlockAttrs, type CodeBlockFenceStyle, type CodeToken, type DocToMarkdownOptions,
|
|
1542
|
+
export { type AcceptPendingReplacementOptions, type CheckRoundTripOptions, type CodeBlockAttrs, type CodeBlockFenceStyle, type CodeToken, type DocToMarkdownOptions, type EditorExtension, type EditorExtensionOptions, type EmbedDescriptor, type ExitBoundaryHandler, type ExitBoundaryOptions, type FileClickHandler, type FileClickPayload, type FileInfo, type FileInfoResolver, type FileLinkOptions, type FileLinkPayload, type FileLinkResolver, type FilePasteHandler, type FilePasteOptions, type FileSaveErrorHandler, type FileViewOptions, type FollowLinkHandlers, type ImageClickHandler, type ImageClickPayload, type ImageOptions, type InlineMarkContext, type InlineMarkOptions, type KaTeXRender, type LanguageItem, type LinkAttrs, type LinkClickHandler, type LinkClickPayload, type LinkCopyHandler, type LinkCopyPayload, type LinkEditHandler, type LinkEditOptions, type LinkHoverHandler, type LinkUnit, type ListMarker, type MarkChunk, type MarkMode, type MarkName, type MarkdownToDocOptions, type MdFileAttrs, type MdImageAttrs, type MdLinkTextAttrs, type MdMathAttrs, type MdWikilinkAttrs, type MeowdownCodeBlockAttrs, type MeowdownHTMLCommentAttrs, type MeowdownListAttrs, type MeowdownTableCellAttrs, type NodeName, type ParsedWikiEmbed, type PendingReplacement, type PendingReplacementEvent, type PendingReplacementHandler, type PendingReplacementMode, type PendingReplacementOutcome, type PlaceholderOptions, type PositionRange, Priority, type ReferenceDefinition, type ReferenceDefinitionIndex, type ReferenceDefinitions, type RoundTripFidelity, type SearchStatus, type SearchStatusHandler, type StartPendingReplacementOptions, type TableColumnAlign, type TagClickHandler, type TagClickPayload, type TypedEditor, type TypedMarkBuilders, type VirtualElement, type WikiEmbedOptions, type WikiEmbedResolution, type WikiEmbedResolver, type WikilinkClickHandler, type WikilinkClickPayload, type WikilinkHoverHandler, type WikilinkHoverHit, defineCodeBlockPreviewPlugin, definePlaceholder, defineReadonly, defineSearchStatusHandler, getSearchStatus, isCodeBlockPreviewHiddenDecoration, withPriority };
|