From cb5ca0c0845b87bfdd953202473ced7eb16425ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Ku=CC=88hn?= Date: Tue, 10 Nov 2020 21:18:22 +0100 Subject: [PATCH] refactoring --- packages/core/src/extensions/commands.ts | 2 +- packages/core/src/extensions/editable.ts | 2 +- packages/core/src/extensions/focusEvents.ts | 2 +- packages/core/src/extensions/keymap.ts | 2 +- packages/core/src/index.ts | 7 ++++++- packages/extension-blockquote/src/index.ts | 2 +- packages/extension-bold/src/index.ts | 2 +- packages/extension-bullet-list/src/index.ts | 2 +- packages/extension-code-block/src/index.ts | 2 +- packages/extension-code/src/index.ts | 2 +- packages/extension-collaboration-cursor/src/index.ts | 2 +- packages/extension-collaboration/src/index.ts | 2 +- packages/extension-document/src/index.ts | 2 +- packages/extension-dropcursor/src/index.ts | 2 +- packages/extension-focus/src/index.ts | 2 +- packages/extension-font-family/src/index.ts | 2 +- packages/extension-gapcursor/src/index.ts | 2 +- packages/extension-hard-break/src/index.ts | 2 +- packages/extension-heading/src/index.ts | 2 +- packages/extension-highlight/src/index.ts | 2 +- packages/extension-history/src/index.ts | 2 +- packages/extension-horizontal-rule/src/index.ts | 2 +- packages/extension-image/src/index.ts | 2 +- packages/extension-italic/src/index.ts | 2 +- packages/extension-link/src/index.ts | 2 +- packages/extension-list-item/src/index.ts | 2 +- packages/extension-ordered-list/src/index.ts | 2 +- packages/extension-paragraph/src/index.ts | 2 +- packages/extension-strike/src/index.ts | 2 +- packages/extension-task-item/src/index.ts | 2 +- packages/extension-task-list/src/index.ts | 2 +- packages/extension-text-align/src/index.ts | 2 +- packages/extension-text-style/src/index.ts | 2 +- packages/extension-text/src/index.ts | 2 +- packages/extension-typography/src/index.ts | 2 +- packages/extension-underline/src/index.ts | 2 +- 36 files changed, 41 insertions(+), 36 deletions(-) diff --git a/packages/core/src/extensions/commands.ts b/packages/core/src/extensions/commands.ts index 9991a88e1..98d4c3ab2 100644 --- a/packages/core/src/extensions/commands.ts +++ b/packages/core/src/extensions/commands.ts @@ -63,7 +63,7 @@ export const Commands = createExtension({ }, }) -declare module '../Editor' { +declare module '@tiptap/core' { interface AllExtensions { Commands: typeof Commands, } diff --git a/packages/core/src/extensions/editable.ts b/packages/core/src/extensions/editable.ts index 431bc7748..2efe4a033 100644 --- a/packages/core/src/extensions/editable.ts +++ b/packages/core/src/extensions/editable.ts @@ -15,7 +15,7 @@ export const Editable = createExtension({ }) // TODO: Editable circularly references itself!? -// declare module '../Editor' { +// declare module '@tiptap/core' { // interface AllExtensions { // Editable: typeof Editable, // } diff --git a/packages/core/src/extensions/focusEvents.ts b/packages/core/src/extensions/focusEvents.ts index ab58347e9..c0d770fc2 100644 --- a/packages/core/src/extensions/focusEvents.ts +++ b/packages/core/src/extensions/focusEvents.ts @@ -36,7 +36,7 @@ export const FocusEvents = createExtension({ }, }) -declare module '../Editor' { +declare module '@tiptap/core' { interface AllExtensions { FocusEvents: typeof FocusEvents, } diff --git a/packages/core/src/extensions/keymap.ts b/packages/core/src/extensions/keymap.ts index 64739e237..68b589361 100644 --- a/packages/core/src/extensions/keymap.ts +++ b/packages/core/src/extensions/keymap.ts @@ -45,7 +45,7 @@ export const Keymap = createExtension({ }, }) -declare module '../Editor' { +declare module '@tiptap/core' { interface AllExtensions { Keymap: typeof Keymap, } diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 302244ee0..76199f78d 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -1,4 +1,9 @@ -export { Editor, Command, CommandsSpec } from './Editor' +export { + Editor, + Command, + CommandsSpec, + AllExtensions, +} from './Editor' export * from './Extension' export * from './NodeExtension' diff --git a/packages/extension-blockquote/src/index.ts b/packages/extension-blockquote/src/index.ts index dc6d5a019..2f9dc1373 100644 --- a/packages/extension-blockquote/src/index.ts +++ b/packages/extension-blockquote/src/index.ts @@ -45,7 +45,7 @@ const Blockquote = createNode({ export default Blockquote -declare module '@tiptap/core/src/Editor' { +declare module '@tiptap/core' { interface AllExtensions { Blockquote: typeof Blockquote, } diff --git a/packages/extension-bold/src/index.ts b/packages/extension-bold/src/index.ts index 21f8c58c5..2f42f747c 100644 --- a/packages/extension-bold/src/index.ts +++ b/packages/extension-bold/src/index.ts @@ -64,7 +64,7 @@ const Bold = createMark({ export default Bold -declare module '@tiptap/core/src/Editor' { +declare module '@tiptap/core' { interface AllExtensions { Bold: typeof Bold, } diff --git a/packages/extension-bullet-list/src/index.ts b/packages/extension-bullet-list/src/index.ts index ef2b77013..4b4bbc87e 100644 --- a/packages/extension-bullet-list/src/index.ts +++ b/packages/extension-bullet-list/src/index.ts @@ -43,7 +43,7 @@ const BulletList = createNode({ export default BulletList -declare module '@tiptap/core/src/Editor' { +declare module '@tiptap/core' { interface AllExtensions { BulletList: typeof BulletList, } diff --git a/packages/extension-code-block/src/index.ts b/packages/extension-code-block/src/index.ts index 8f0980fce..8b7c1fc4f 100644 --- a/packages/extension-code-block/src/index.ts +++ b/packages/extension-code-block/src/index.ts @@ -92,7 +92,7 @@ const CodeBlock = createNode({ export default CodeBlock -declare module '@tiptap/core/src/Editor' { +declare module '@tiptap/core' { interface AllExtensions { CodeBlock: typeof CodeBlock, } diff --git a/packages/extension-code/src/index.ts b/packages/extension-code/src/index.ts index 7dcc8f5de..655e4d109 100644 --- a/packages/extension-code/src/index.ts +++ b/packages/extension-code/src/index.ts @@ -49,7 +49,7 @@ const Code = createMark({ export default Code -declare module '@tiptap/core/src/Editor' { +declare module '@tiptap/core' { interface AllExtensions { Code: typeof Code, } diff --git a/packages/extension-collaboration-cursor/src/index.ts b/packages/extension-collaboration-cursor/src/index.ts index c969fa95f..cc2a46273 100644 --- a/packages/extension-collaboration-cursor/src/index.ts +++ b/packages/extension-collaboration-cursor/src/index.ts @@ -61,7 +61,7 @@ const CollaborationCursor = createExtension({ export default CollaborationCursor -declare module '@tiptap/core/src/Editor' { +declare module '@tiptap/core' { interface AllExtensions { CollaborationCursor: typeof CollaborationCursor, } diff --git a/packages/extension-collaboration/src/index.ts b/packages/extension-collaboration/src/index.ts index d4427f14a..c85fd16b5 100644 --- a/packages/extension-collaboration/src/index.ts +++ b/packages/extension-collaboration/src/index.ts @@ -32,7 +32,7 @@ const Collaboration = createExtension({ export default Collaboration -declare module '@tiptap/core/src/Editor' { +declare module '@tiptap/core' { interface AllExtensions { Collaboration: typeof Collaboration, } diff --git a/packages/extension-document/src/index.ts b/packages/extension-document/src/index.ts index d569b12f9..f743b3d12 100644 --- a/packages/extension-document/src/index.ts +++ b/packages/extension-document/src/index.ts @@ -8,7 +8,7 @@ const Document = createNode({ export default Document -declare module '@tiptap/core/src/Editor' { +declare module '@tiptap/core' { interface AllExtensions { Document: typeof Document, } diff --git a/packages/extension-dropcursor/src/index.ts b/packages/extension-dropcursor/src/index.ts index ab6ba960d..4d457f104 100644 --- a/packages/extension-dropcursor/src/index.ts +++ b/packages/extension-dropcursor/src/index.ts @@ -11,7 +11,7 @@ const Dropcursor = createExtension({ export default Dropcursor -declare module '@tiptap/core/src/Editor' { +declare module '@tiptap/core' { interface AllExtensions { Dropcursor: typeof Dropcursor, } diff --git a/packages/extension-focus/src/index.ts b/packages/extension-focus/src/index.ts index a1a18329b..a6a59b894 100644 --- a/packages/extension-focus/src/index.ts +++ b/packages/extension-focus/src/index.ts @@ -50,7 +50,7 @@ const FocusClasses = createExtension({ export default FocusClasses -declare module '@tiptap/core/src/Editor' { +declare module '@tiptap/core' { interface AllExtensions { FocusClasses: typeof FocusClasses, } diff --git a/packages/extension-font-family/src/index.ts b/packages/extension-font-family/src/index.ts index 750f5f04e..8d1bacbc7 100644 --- a/packages/extension-font-family/src/index.ts +++ b/packages/extension-font-family/src/index.ts @@ -49,7 +49,7 @@ const FontFamily = createExtension({ export default FontFamily -declare module '@tiptap/core/src/Editor' { +declare module '@tiptap/core' { interface AllExtensions { FontFamily: typeof FontFamily, } diff --git a/packages/extension-gapcursor/src/index.ts b/packages/extension-gapcursor/src/index.ts index f7c267a10..8ed452f4b 100644 --- a/packages/extension-gapcursor/src/index.ts +++ b/packages/extension-gapcursor/src/index.ts @@ -11,7 +11,7 @@ const Gapcursor = createExtension({ export default Gapcursor -declare module '@tiptap/core/src/Editor' { +declare module '@tiptap/core' { interface AllExtensions { Gapcursor: typeof Gapcursor, } diff --git a/packages/extension-hard-break/src/index.ts b/packages/extension-hard-break/src/index.ts index 6d804df12..2112c1952 100644 --- a/packages/extension-hard-break/src/index.ts +++ b/packages/extension-hard-break/src/index.ts @@ -47,7 +47,7 @@ const HardBreak = createNode({ export default HardBreak -declare module '@tiptap/core/src/Editor' { +declare module '@tiptap/core' { interface AllExtensions { HardBreak: typeof HardBreak, } diff --git a/packages/extension-heading/src/index.ts b/packages/extension-heading/src/index.ts index 223e67179..e7ab75629 100644 --- a/packages/extension-heading/src/index.ts +++ b/packages/extension-heading/src/index.ts @@ -70,7 +70,7 @@ const Heading = createNode({ export default Heading -declare module '@tiptap/core/src/Editor' { +declare module '@tiptap/core' { interface AllExtensions { Heading: typeof Heading, } diff --git a/packages/extension-highlight/src/index.ts b/packages/extension-highlight/src/index.ts index 94e87460d..d0a6370df 100644 --- a/packages/extension-highlight/src/index.ts +++ b/packages/extension-highlight/src/index.ts @@ -75,7 +75,7 @@ const Highlight = createMark({ export default Highlight -declare module '@tiptap/core/src/Editor' { +declare module '@tiptap/core' { interface AllExtensions { Highlight: typeof Highlight, } diff --git a/packages/extension-history/src/index.ts b/packages/extension-history/src/index.ts index b9ff706b7..c41705034 100644 --- a/packages/extension-history/src/index.ts +++ b/packages/extension-history/src/index.ts @@ -40,7 +40,7 @@ const History = createExtension({ export default History -declare module '@tiptap/core/src/Editor' { +declare module '@tiptap/core' { interface AllExtensions { History: typeof History, } diff --git a/packages/extension-horizontal-rule/src/index.ts b/packages/extension-horizontal-rule/src/index.ts index 73f5b7d2e..a4dd2ca1c 100644 --- a/packages/extension-horizontal-rule/src/index.ts +++ b/packages/extension-horizontal-rule/src/index.ts @@ -34,7 +34,7 @@ const HorizontalRule = createNode({ export default HorizontalRule -declare module '@tiptap/core/src/Editor' { +declare module '@tiptap/core' { interface AllExtensions { HorizontalRule: typeof HorizontalRule, } diff --git a/packages/extension-image/src/index.ts b/packages/extension-image/src/index.ts index 67e9c04aa..09ee1318a 100644 --- a/packages/extension-image/src/index.ts +++ b/packages/extension-image/src/index.ts @@ -75,7 +75,7 @@ const Image = createNode({ export default Image -declare module '@tiptap/core/src/Editor' { +declare module '@tiptap/core' { interface AllExtensions { Image: typeof Image, } diff --git a/packages/extension-italic/src/index.ts b/packages/extension-italic/src/index.ts index 4e1cafc92..9847378d4 100644 --- a/packages/extension-italic/src/index.ts +++ b/packages/extension-italic/src/index.ts @@ -60,7 +60,7 @@ const Italic = createMark({ export default Italic -declare module '@tiptap/core/src/Editor' { +declare module '@tiptap/core' { interface AllExtensions { Italic: typeof Italic, } diff --git a/packages/extension-link/src/index.ts b/packages/extension-link/src/index.ts index d31faa3b3..44108da32 100644 --- a/packages/extension-link/src/index.ts +++ b/packages/extension-link/src/index.ts @@ -89,7 +89,7 @@ const Link = createMark({ export default Link -declare module '@tiptap/core/src/Editor' { +declare module '@tiptap/core' { interface AllExtensions { Link: typeof Link, } diff --git a/packages/extension-list-item/src/index.ts b/packages/extension-list-item/src/index.ts index f3c932bc3..d40414dc2 100644 --- a/packages/extension-list-item/src/index.ts +++ b/packages/extension-list-item/src/index.ts @@ -30,7 +30,7 @@ const ListItem = createNode({ export default ListItem -declare module '@tiptap/core/src/Editor' { +declare module '@tiptap/core' { interface AllExtensions { ListItem: typeof ListItem, } diff --git a/packages/extension-ordered-list/src/index.ts b/packages/extension-ordered-list/src/index.ts index ce47c143b..931c0c08e 100644 --- a/packages/extension-ordered-list/src/index.ts +++ b/packages/extension-ordered-list/src/index.ts @@ -67,7 +67,7 @@ const OrderedList = createNode({ export default OrderedList -declare module '@tiptap/core/src/Editor' { +declare module '@tiptap/core' { interface AllExtensions { OrderedList: typeof OrderedList, } diff --git a/packages/extension-paragraph/src/index.ts b/packages/extension-paragraph/src/index.ts index 59706d64c..8704dc927 100644 --- a/packages/extension-paragraph/src/index.ts +++ b/packages/extension-paragraph/src/index.ts @@ -35,7 +35,7 @@ const Paragraph = createNode({ export default Paragraph -declare module '@tiptap/core/src/Editor' { +declare module '@tiptap/core' { interface AllExtensions { Paragraph: typeof Paragraph, } diff --git a/packages/extension-strike/src/index.ts b/packages/extension-strike/src/index.ts index 1e31a8a01..a8b3e57af 100644 --- a/packages/extension-strike/src/index.ts +++ b/packages/extension-strike/src/index.ts @@ -58,7 +58,7 @@ const Strike = createMark({ export default Strike -declare module '@tiptap/core/src/Editor' { +declare module '@tiptap/core' { interface AllExtensions { Strike: typeof Strike, } diff --git a/packages/extension-task-item/src/index.ts b/packages/extension-task-item/src/index.ts index 248164c4a..ec8fc80b7 100644 --- a/packages/extension-task-item/src/index.ts +++ b/packages/extension-task-item/src/index.ts @@ -121,7 +121,7 @@ const TaskItem = createNode({ export default TaskItem -declare module '@tiptap/core/src/Editor' { +declare module '@tiptap/core' { interface AllExtensions { TaskItem: typeof TaskItem, } diff --git a/packages/extension-task-list/src/index.ts b/packages/extension-task-list/src/index.ts index 21fc7545a..7f3173d38 100644 --- a/packages/extension-task-list/src/index.ts +++ b/packages/extension-task-list/src/index.ts @@ -31,7 +31,7 @@ const TaskList = createNode({ export default TaskList -declare module '@tiptap/core/src/Editor' { +declare module '@tiptap/core' { interface AllExtensions { TaskList: typeof TaskList, } diff --git a/packages/extension-text-align/src/index.ts b/packages/extension-text-align/src/index.ts index a237d470d..6f79df2fa 100644 --- a/packages/extension-text-align/src/index.ts +++ b/packages/extension-text-align/src/index.ts @@ -62,7 +62,7 @@ const TextAlign = createExtension({ export default TextAlign -declare module '@tiptap/core/src/Editor' { +declare module '@tiptap/core' { interface AllExtensions { TextAlign: typeof TextAlign, } diff --git a/packages/extension-text-style/src/index.ts b/packages/extension-text-style/src/index.ts index fb23f0286..73f35981e 100644 --- a/packages/extension-text-style/src/index.ts +++ b/packages/extension-text-style/src/index.ts @@ -43,7 +43,7 @@ const TextStyle = createMark({ export default TextStyle -declare module '@tiptap/core/src/Editor' { +declare module '@tiptap/core' { interface AllExtensions { TextStyle: typeof TextStyle, } diff --git a/packages/extension-text/src/index.ts b/packages/extension-text/src/index.ts index 26c1609fe..b670bed45 100644 --- a/packages/extension-text/src/index.ts +++ b/packages/extension-text/src/index.ts @@ -7,7 +7,7 @@ const Text = createNode({ export default Text -declare module '@tiptap/core/src/Editor' { +declare module '@tiptap/core' { interface AllExtensions { Text: typeof Text, } diff --git a/packages/extension-typography/src/index.ts b/packages/extension-typography/src/index.ts index f62b1cc4b..805902836 100644 --- a/packages/extension-typography/src/index.ts +++ b/packages/extension-typography/src/index.ts @@ -45,7 +45,7 @@ const Typography = createExtension({ export default Typography -declare module '@tiptap/core/src/Editor' { +declare module '@tiptap/core' { interface AllExtensions { Typography: typeof Typography, } diff --git a/packages/extension-underline/src/index.ts b/packages/extension-underline/src/index.ts index 91d342c69..004dbd26c 100644 --- a/packages/extension-underline/src/index.ts +++ b/packages/extension-underline/src/index.ts @@ -35,7 +35,7 @@ const Underline = createMark({ export default Underline -declare module '@tiptap/core/src/Editor' { +declare module '@tiptap/core' { interface AllExtensions { Underline: typeof Underline, }