From 592f62ed0ef438d6b1c05b6491f260a71592386a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Ku=CC=88hn?= Date: Fri, 4 Jun 2021 22:40:36 +0200 Subject: [PATCH] docs: update content --- .../extension/collaboration-annotation.ts | 10 +++++----- docs/src/demos/Experiments/Details/details.ts | 10 +++++----- docs/src/demos/Experiments/Embeds/iframe.ts | 6 +++--- docs/src/demos/Experiments/Figure/figure.ts | 9 ++++----- docs/src/demos/Experiments/WordBreak/word-break.ts | 6 +++--- docs/src/docPages/guide/typescript.md | 6 +++--- 6 files changed, 23 insertions(+), 24 deletions(-) diff --git a/docs/src/demos/Experiments/CollaborationAnnotation/extension/collaboration-annotation.ts b/docs/src/demos/Experiments/CollaborationAnnotation/extension/collaboration-annotation.ts index 5e918a5f..9c5c7a20 100644 --- a/docs/src/demos/Experiments/CollaborationAnnotation/extension/collaboration-annotation.ts +++ b/docs/src/demos/Experiments/CollaborationAnnotation/extension/collaboration-annotation.ts @@ -1,5 +1,5 @@ import * as Y from 'yjs' -import { Extension, Command } from '@tiptap/core' +import { Extension } from '@tiptap/core' import { AnnotationPlugin, AnnotationPluginKey } from './AnnotationPlugin' export interface AddAnnotationAction { @@ -50,11 +50,11 @@ function getMapFromOptions(options: AnnotationOptions): Y.Map { } declare module '@tiptap/core' { - interface Commands { + interface Commands { annotation: { - addAnnotation: (data: any) => Command, - updateAnnotation: (id: string, data: any) => Command, - deleteAnnotation: (id: string) => Command, + addAnnotation: (data: any) => ReturnType, + updateAnnotation: (id: string, data: any) => ReturnType, + deleteAnnotation: (id: string) => ReturnType, } } } diff --git a/docs/src/demos/Experiments/Details/details.ts b/docs/src/demos/Experiments/Details/details.ts index 6885a9d9..bf43ccbc 100644 --- a/docs/src/demos/Experiments/Details/details.ts +++ b/docs/src/demos/Experiments/Details/details.ts @@ -1,4 +1,4 @@ -import { Node, mergeAttributes, Command } from '@tiptap/core' +import { Node, mergeAttributes } from '@tiptap/core' export interface DetailsOptions { HTMLAttributes: { @@ -7,20 +7,20 @@ export interface DetailsOptions { } declare module '@tiptap/core' { - interface Commands { + interface Commands { details: { /** * Set a details node */ - setDetails: () => Command, + setDetails: () => ReturnType, /** * Toggle a details node */ - toggleDetails: () => Command, + toggleDetails: () => ReturnType, /** * Unset a details node */ - unsetDetails: () => Command, + unsetDetails: () => ReturnType, } } } diff --git a/docs/src/demos/Experiments/Embeds/iframe.ts b/docs/src/demos/Experiments/Embeds/iframe.ts index a2074492..a57ac904 100644 --- a/docs/src/demos/Experiments/Embeds/iframe.ts +++ b/docs/src/demos/Experiments/Embeds/iframe.ts @@ -1,4 +1,4 @@ -import { Node, Command } from '@tiptap/core' +import { Node } from '@tiptap/core' export interface IframeOptions { allowFullscreen: boolean, @@ -8,12 +8,12 @@ export interface IframeOptions { } declare module '@tiptap/core' { - interface Commands { + interface Commands { iframe: { /** * Add an iframe */ - setIframe: (options: { src: string }) => Command, + setIframe: (options: { src: string }) => ReturnType, } } } diff --git a/docs/src/demos/Experiments/Figure/figure.ts b/docs/src/demos/Experiments/Figure/figure.ts index b2cb1857..262885f5 100644 --- a/docs/src/demos/Experiments/Figure/figure.ts +++ b/docs/src/demos/Experiments/Figure/figure.ts @@ -1,5 +1,4 @@ import { - Command, Node, nodeInputRule, mergeAttributes, @@ -11,7 +10,7 @@ export interface FigureOptions { } declare module '@tiptap/core' { - interface Commands { + interface Commands { figure: { /** * Add a figure element @@ -21,17 +20,17 @@ declare module '@tiptap/core' { alt?: string, title?: string, caption?: string, - }) => Command, + }) => ReturnType, /** * Converts an image to a figure */ - imageToFigure: () => Command, + imageToFigure: () => ReturnType, /** * Converts a figure to an image */ - figureToImage: () => Command, + figureToImage: () => ReturnType, } } } diff --git a/docs/src/demos/Experiments/WordBreak/word-break.ts b/docs/src/demos/Experiments/WordBreak/word-break.ts index 692ebe04..29b858e3 100644 --- a/docs/src/demos/Experiments/WordBreak/word-break.ts +++ b/docs/src/demos/Experiments/WordBreak/word-break.ts @@ -1,4 +1,4 @@ -import { Command, Node, mergeAttributes } from '@tiptap/core' +import { Node, mergeAttributes } from '@tiptap/core' import { exitCode } from 'prosemirror-commands' export interface WordBreakOptions { @@ -8,12 +8,12 @@ export interface WordBreakOptions { } declare module '@tiptap/core' { - interface Commands { + interface Commands { wordBreak: { /** * Add a hard break */ - setWordBreak: () => Command, + setWordBreak: () => ReturnType, } } } diff --git a/docs/src/docPages/guide/typescript.md b/docs/src/docPages/guide/typescript.md index c0b2c00e..31692454 100644 --- a/docs/src/docPages/guide/typescript.md +++ b/docs/src/docPages/guide/typescript.md @@ -34,15 +34,15 @@ const CustomExtension = Extension.create({ The core package also exports a `Command` type, which needs to be added to all commands that you specify in your code. Here is an example: ```ts -import { Command, Extension } from '@tiptap/core' +import { Extension } from '@tiptap/core' declare module '@tiptap/core' { - interface Commands { + interface Commands { customExtension: { /** * Comments will be added to the autocomplete. */ - yourCommand: (someProp: any) => Command, + yourCommand: (someProp: any) => ReturnType, } } }