From edabd802ee9e2a8da785ab15263761ed249cdb4e Mon Sep 17 00:00:00 2001 From: Francesco Agnoletto Date: Thu, 1 Nov 2018 00:23:24 +0100 Subject: [PATCH] Fix RenderNodeProps to only accept Block | Inline as node https://github.com/ianstormtaylor/slate/blob/8dd919dc3457c62ea2aa72f31b83faf42cbaba72/packages/slate-react/src/plugins/react.js#L73 --- types/slate-react/index.d.ts | 5 +++-- types/slate-react/slate-react-tests.tsx | 2 -- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/types/slate-react/index.d.ts b/types/slate-react/index.d.ts index c79b945a5b..48dc0db0be 100644 --- a/types/slate-react/index.d.ts +++ b/types/slate-react/index.d.ts @@ -5,9 +5,10 @@ // Jan Löbel // Patrick Sachs // Brandon Shelton +// Francesco Agnoletto // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 -import { Mark, Node, Block, Change, Schema, Value, Stack } from 'slate'; +import { Mark, Node, Block, Inline, Change, Schema, Value, Stack } from 'slate'; import * as Immutable from 'immutable'; import * as React from 'react'; @@ -33,7 +34,7 @@ export interface RenderNodeProps { editor: Editor; isSelected: boolean; key: string; - node: Node; + node: Block | Inline; parent: Node; } diff --git a/types/slate-react/slate-react-tests.tsx b/types/slate-react/slate-react-tests.tsx index d8c8ea0073..4b6e6429c0 100644 --- a/types/slate-react/slate-react-tests.tsx +++ b/types/slate-react/slate-react-tests.tsx @@ -11,8 +11,6 @@ class MyPlugin implements Plugin { return
; case "inline": return Hello world; - case "text": - return

Hello world

; default: return undefined; }