@types/slate-react
Advanced tools
Comparing version 0.22.4 to 0.22.5
@@ -13,2 +13,3 @@ // Type definitions for slate-react 0.22 | ||
// Benjamin Evenson <https://github.com/benjiro> | ||
// Kay Delaney <https://github.com/kaydelaney> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
@@ -20,9 +21,8 @@ // TypeScript Version: 2.8 | ||
Mark, | ||
Node, | ||
Node as SlateNode, | ||
Block, | ||
Inline, | ||
Operations, | ||
Operation, | ||
SchemaProperties, | ||
Value, | ||
Operation, | ||
MarkProperties, | ||
@@ -34,8 +34,17 @@ BlockProperties, | ||
NodeProperties, | ||
Range, | ||
Controller, | ||
Plugin as CorePlugin | ||
} from "slate"; | ||
import * as Immutable from "immutable"; | ||
import * as React from "react"; | ||
Plugin as CorePlugin, | ||
Range as SlateRange, | ||
Selection as SlateSelection, | ||
RangeType, | ||
Annotation, | ||
Decoration, | ||
PointProperties, | ||
PointJSON, | ||
Point, | ||
RangeTypeJSON, | ||
RangeTypeProperties, | ||
} from 'slate'; | ||
import * as Immutable from 'immutable'; | ||
import * as React from 'react'; | ||
@@ -47,9 +56,9 @@ // Values prefixed with "data-..." (Used for spellchecking according to docs) | ||
export interface RenderMarkProps { | ||
export interface RenderProps { | ||
attributes: RenderAttributes; | ||
children: React.ReactNode; | ||
editor: Editor; | ||
mark: Mark; | ||
marks: Immutable.Set<Mark>; | ||
node: Node; | ||
annotations: Immutable.List<Annotation> | ReadonlyArray<Annotation>; | ||
decorations: Immutable.List<Decoration> | ReadonlyArray<Annotation>; | ||
node: SlateNode; | ||
offset: number; | ||
@@ -59,2 +68,17 @@ text: string; | ||
export interface RenderMarkProps extends RenderProps { | ||
mark: Mark; | ||
children: React.ReactNode; | ||
} | ||
export interface RenderAnnotationProps extends RenderProps { | ||
annotation: Annotation; | ||
children: React.ReactNode; | ||
} | ||
export interface RenderDecorationProps extends RenderProps { | ||
decoration: Decoration; | ||
children: React.ReactNode; | ||
} | ||
export interface RenderNodeProps { | ||
@@ -67,3 +91,3 @@ attributes: RenderAttributes; | ||
key: string; | ||
parent: Node; | ||
parent: SlateNode; | ||
readOnly: boolean; | ||
@@ -84,17 +108,21 @@ } | ||
export type EventHook = ( | ||
event: Event, | ||
editor: CoreEditor, | ||
next: () => any | ||
) => any; | ||
export type EventHook = (event: Event, editor: CoreEditor, next: () => any) => any; | ||
export interface Plugin extends CorePlugin { | ||
decorateNode?: (node: Node, editor: CoreEditor, next: () => any) => any; | ||
renderEditor?: (props: EditorProps, editor: CoreEditor, next: () => any) => any; | ||
renderMark?: (props: RenderMarkProps, editor: CoreEditor, next: () => any) => any; | ||
decorateNode?: (node: SlateNode, editor: CoreEditor, next: () => any) => any; | ||
renderAnnotation?: (props: RenderAnnotationProps, editor: CoreEditor, next: () => any) => any; | ||
renderBlock?: (props: RenderBlockProps, editor: CoreEditor, next: () => any) => any; | ||
renderDecoration?: (props: RenderDecorationProps, editor: CoreEditor, next: () => any) => any; | ||
renderDocument?: (props: RenderDocumentProps, editor: CoreEditor, next: () => any) => any; | ||
renderEditor?: (props: EditorProps, editor: CoreEditor, next: () => any) => any; | ||
renderInline?: (props: RenderInlineProps, editor: CoreEditor, next: () => any) => any; | ||
shouldNodeComponentUpdate?: (previousProps: RenderNodeProps, props: RenderNodeProps, editor: CoreEditor, next: () => any) => any; | ||
renderMark?: (props: RenderMarkProps, editor: CoreEditor, next: () => any) => any; | ||
shouldNodeComponentUpdate?: ( | ||
previousProps: RenderNodeProps, | ||
props: RenderNodeProps, | ||
editor: CoreEditor, | ||
next: () => any | ||
) => any; | ||
onBeforeInput?: EventHook; | ||
@@ -164,6 +192,14 @@ onBlur?: EventHook; | ||
// Controller | ||
addAnnotation: CoreEditor['addAnnotation']; | ||
addMark: CoreEditor['addMark']; | ||
addMarks: CoreEditor['addMarks']; | ||
delete: CoreEditor['delete']; | ||
deleteBackward: CoreEditor['deleteBackward']; | ||
deleteCharBackward: CoreEditor['deleteCharBackward']; | ||
deleteCharForward: CoreEditor['deleteCharForward']; | ||
deleteForward: CoreEditor['deleteForward']; | ||
deleteLineBackward: CoreEditor['deleteLineBackward']; | ||
deleteLineForward: CoreEditor['deleteLineForward']; | ||
deleteWordBackward: CoreEditor['deleteWordBackward']; | ||
deleteWordForward: CoreEditor['deleteWordForward']; | ||
insertBlock: CoreEditor['insertBlock']; | ||
@@ -173,4 +209,10 @@ insertFragment: CoreEditor['insertFragment']; | ||
insertText: CoreEditor['insertText']; | ||
setAnchor: CoreEditor['setAnchor']; | ||
setAnnotation: CoreEditor['setAnnotation']; | ||
setBlocks: CoreEditor['setBlocks']; | ||
setData: CoreEditor['setData']; | ||
setEnd: CoreEditor['setEnd']; | ||
setFocus: CoreEditor['setFocus']; | ||
setInlines: CoreEditor['setInlines']; | ||
setStart: CoreEditor['setStart']; | ||
splitBlock: CoreEditor['splitBlock']; | ||
@@ -190,2 +232,3 @@ splitInline: CoreEditor['splitInline']; | ||
focus: CoreEditor['focus']; | ||
moveAnchorBackward: CoreEditor['moveAnchorBackward']; | ||
@@ -200,3 +243,3 @@ moveAnchorForward: CoreEditor['moveAnchorForward']; | ||
moveAnchorToEndOfNextText: CoreEditor['moveAnchorToEndOfNextText']; | ||
moveAnchorEndOfNode: CoreEditor['moveAnchorEndOfNode']; | ||
moveAnchorToEndOfNode: CoreEditor['moveAnchorToEndOfNode']; | ||
moveAnchorToEndOfPreviousBlock: CoreEditor['moveAnchorToEndOfPreviousBlock']; | ||
@@ -217,2 +260,5 @@ moveAnchorToEndOfPreviousInline: CoreEditor['moveAnchorToEndOfPreviousInline']; | ||
moveAnchorToStartOfText: CoreEditor['moveAnchorToStartOfText']; | ||
moveAnchorWordBackward: CoreEditor['moveAnchorWordBackward']; | ||
moveAnchorWordForward: CoreEditor['moveAnchorWordForward']; | ||
moveBackward: CoreEditor['moveBackward']; | ||
moveEndBackward: CoreEditor['moveEndBackward']; | ||
@@ -243,2 +289,4 @@ moveEndForward: CoreEditor['moveEndForward']; | ||
moveEndToStartOfText: CoreEditor['moveEndToStartOfText']; | ||
moveEndWordBackward: CoreEditor['moveEndWordBackward']; | ||
moveEndWordForward: CoreEditor['moveEndWordForward']; | ||
moveFocusBackward: CoreEditor['moveFocusBackward']; | ||
@@ -269,2 +317,5 @@ moveFocusForward: CoreEditor['moveFocusForward']; | ||
moveFocusToStartOfText: CoreEditor['moveFocusToStartOfText']; | ||
moveFocusWordBackward: CoreEditor['moveFocusWordBackward']; | ||
moveFocusWordForward: CoreEditor['moveFocusWordForward']; | ||
moveForward: CoreEditor['moveForward']; | ||
moveStartForward: CoreEditor['moveStartForward']; | ||
@@ -295,8 +346,6 @@ moveStartBackward: CoreEditor['moveStartBackward']; | ||
moveStartToStartOfText: CoreEditor['moveStartToStartOfText']; | ||
moveBackward: CoreEditor['moveBackward']; | ||
moveForward: CoreEditor['moveForward']; | ||
moveStartWordBackward: CoreEditor['moveStartWordBackward']; | ||
moveStartWordForward: CoreEditor['moveStartWordForward']; | ||
moveTo: CoreEditor['moveTo']; | ||
moveToAnchor: CoreEditor['moveToAnchor']; | ||
moveToFocus: CoreEditor['moveToFocus']; | ||
moveToStart: CoreEditor['moveToStart']; | ||
moveToEnd: CoreEditor['moveToEnd']; | ||
@@ -314,2 +363,6 @@ moveToEndOfBlock: CoreEditor['moveToEndOfBlock']; | ||
moveToEndOfText: CoreEditor['moveToEndOfText']; | ||
moveToFocus: CoreEditor['moveToFocus']; | ||
moveToRangeOfDocument: CoreEditor['moveToRangeOfDocument']; | ||
moveToRangeOfNode: CoreEditor['moveToRangeOfNode']; | ||
moveToStart: CoreEditor['moveToStart']; | ||
moveToStartOfBlock: CoreEditor['moveToStartOfBlock']; | ||
@@ -326,15 +379,18 @@ moveToStartOfDocument: CoreEditor['moveToStartOfDocument']; | ||
moveToStartOfText: CoreEditor['moveToStartOfText']; | ||
moveToRangeOfDocument: CoreEditor['moveToRangeOfDocument']; | ||
moveToRangeOfNode: CoreEditor['moveToRangeOfNode']; | ||
moveWordBackward: CoreEditor['moveWordBackward']; | ||
moveWordForward: CoreEditor['moveWordForward']; | ||
save: CoreEditor['save']; | ||
select: CoreEditor['select']; | ||
addMarkAtRange: CoreEditor['addMarkAtRange']; | ||
addMarksAtRange: CoreEditor['addMarksAtRange']; | ||
deleteAtRange: CoreEditor['deleteAtRange']; | ||
deleteBackwardAtRange: CoreEditor['deleteBackwardAtRange']; | ||
deleteCharBackwardAtRange: CoreEditor['deleteCharBackwardAtRange']; | ||
deleteCharForwardAtRange: CoreEditor['deleteCharForwardAtRange']; | ||
deleteForwardAtRange: CoreEditor['deleteForwardAtRange']; | ||
deleteLineBackwardAtRange: CoreEditor['deleteLineBackwardAtRange']; | ||
deleteLineForwardAtRange: CoreEditor['deleteLineForwardAtRange']; | ||
deleteWordBackwardAtRange: CoreEditor['deleteWordBackwardAtRange']; | ||
deleteBackwardAtRange: CoreEditor['deleteBackwardAtRange']; | ||
deleteCharForwardAtRange: CoreEditor['deleteCharForwardAtRange']; | ||
deleteLineForwardAtRange: CoreEditor['deleteLineForwardAtRange']; | ||
deleteWordForwardAtRange: CoreEditor['deleteWordForwardAtRange']; | ||
deleteForwardAtRange: CoreEditor['deleteForwardAtRange']; | ||
insertBlockAtRange: CoreEditor['insertBlockAtRange']; | ||
@@ -344,2 +400,3 @@ insertFragmentAtRange: CoreEditor['insertFragmentAtRange']; | ||
insertTextAtRange: CoreEditor['insertTextAtRange']; | ||
removeMarkAtRange: CoreEditor['removeMarkAtRange']; | ||
setBlocksAtRange: CoreEditor['setBlocksAtRange']; | ||
@@ -349,3 +406,2 @@ setInlinesAtRange: CoreEditor['setInlinesAtRange']; | ||
splitInlineAtRange: CoreEditor['splitInlineAtRange']; | ||
removeMarkAtRange: CoreEditor['removeMarkAtRange']; | ||
toggleMarkAtRange: CoreEditor['toggleMarkAtRange']; | ||
@@ -357,4 +413,6 @@ unwrapBlockAtRange: CoreEditor['unwrapBlockAtRange']; | ||
wrapTextAtRange: CoreEditor['wrapTextAtRange']; | ||
addMarkByKey: CoreEditor['addMarkByKey']; | ||
addMarkByPath: CoreEditor['addMarkByPath']; | ||
addMarksByPath: CoreEditor['addMarksByPath']; | ||
insertNodeByKey: CoreEditor['insertNodeByKey']; | ||
@@ -370,29 +428,40 @@ insertNodeByPath: CoreEditor['insertNodeByPath']; | ||
moveNodeByPath: CoreEditor['moveNodeByPath']; | ||
removeAllMarksByKey: CoreEditor['removeAllMarksByKey']; | ||
removeAllMarksByPath: CoreEditor['removeAllMarksByPath']; | ||
removeMarkByKey: CoreEditor['removeMarkByKey']; | ||
removeMarkByPath: CoreEditor['removeMarkByPath']; | ||
removeMarksByPath: CoreEditor['removeMarksByPath']; | ||
removeNodeByKey: CoreEditor['removeNodeByKey']; | ||
removeNodeByPath: CoreEditor['removeNodeByPath']; | ||
removeTextByKey: CoreEditor['removeTextByKey']; | ||
removeTextByPath: CoreEditor['removeTextByPath']; | ||
replaceNodeByKey: CoreEditor['replaceNodeByKey']; | ||
replaceNodeByPath: CoreEditor['replaceNodeByPath']; | ||
removeTextByKey: CoreEditor['removeTextByKey']; | ||
removeTextByPath: CoreEditor['removeTextByPath']; | ||
setDecorations: CoreEditor['setDecorations']; | ||
replaceTextByKey: CoreEditor['replaceTextByKey']; | ||
replaceTextByPath: CoreEditor['replaceTextByPath']; | ||
setMarkByKey: CoreEditor['setMarkByKey']; | ||
setMarksByPath: CoreEditor['setMarksByPath']; | ||
setMarkByPath: CoreEditor['setMarkByPath']; | ||
setNodeByKey: CoreEditor['setNodeByKey']; | ||
setNodeByPath: CoreEditor['setNodeByPath']; | ||
setTextByKey: CoreEditor['setTextByKey']; | ||
setTextByPath: CoreEditor['setTextByPath']; | ||
splitDescendantsByKey: CoreEditor['splitDescendantsByKey']; | ||
splitDescendantsByPath: CoreEditor['splitDescendantsByPath']; | ||
splitNodeByKey: CoreEditor['splitNodeByKey']; | ||
splitNodeByPath: CoreEditor['splitNodeByPath']; | ||
unwrapBlockByKey: CoreEditor['unwrapBlockByKey']; | ||
unwrapBlockByPath: CoreEditor['unwrapBlockByPath']; | ||
unwrapChildrenByKey: CoreEditor['unwrapChildrenByKey']; | ||
unwrapChildrenByPath: CoreEditor['unwrapChildrenByPath']; | ||
unwrapInlineByKey: CoreEditor['unwrapInlineByKey']; | ||
unwrapInlineByPath: CoreEditor['unwrapInlineByPath']; | ||
unwrapBlockByKey: CoreEditor['unwrapBlockByKey']; | ||
unwrapBlockByPath: CoreEditor['unwrapBlockByPath']; | ||
unwrapNodeByKey: CoreEditor['unwrapNodeByKey']; | ||
unwrapNodeByPath: CoreEditor['unwrapNodeByPath']; | ||
wrapBlockByKey: CoreEditor['wrapBlockByKey']; | ||
wrapBlockByPath: CoreEditor['wrapBlockByPath']; | ||
wrapInlineByKey: CoreEditor['wrapInlineByKey']; | ||
wrapInlineByPath: CoreEditor['wrapInlineByPath']; | ||
wrapBlockByKey: CoreEditor['wrapBlockByKey']; | ||
wrapBlockByPath: CoreEditor['wrapBlockByPath']; | ||
wrapNodeByKey: CoreEditor['wrapNodeByKey']; | ||
wrapNodeByPath: CoreEditor['wrapNodeByPath']; | ||
normalize: CoreEditor['normalize']; | ||
@@ -411,19 +480,30 @@ withoutNormalizing: CoreEditor['withoutNormalizing']; | ||
run: CoreEditor['run']; | ||
removeAnnotation: CoreEditor['removeAnnotation']; | ||
findDOMNode: (path: Immutable.List<number> | number[]) => React.ReactNode | null; | ||
findDOMPoint: (point: PointProperties | PointJSON | Point) => { node: Node; offset: number } | null; | ||
findDOMRange: (range: RangeTypeProperties | RangeTypeJSON | RangeType) => Range | null; | ||
findNode: (element: Element) => SlateNode | null; | ||
findEventRange: (event: Event | React.SyntheticEvent) => SlateRange | null; | ||
findPath: (element: Element) => Immutable.List<number> | null; | ||
findPoint: (nativeNode: Element, nativeOffset: number) => Point | null; | ||
findRange: (domRange: Range | Selection) => SlateRange | null; | ||
findSelection: (domSelection: Selection) => SlateSelection | null; | ||
} | ||
export type SlateType = | ||
| "fragment" | ||
| "html" | ||
| "node" | ||
| "rich" | ||
| "text" | ||
| "files"; | ||
export type SlateType = 'fragment' | 'html' | 'node' | 'rich' | 'text' | 'files'; | ||
// Utilities | ||
export function cloneFragment(event: Event | React.SyntheticEvent, editor: CoreEditor, callback?: () => void): void; | ||
export function findDOMNode(node: Node, win?: Window): Element; | ||
export function findDOMRange(range: Range, win?: Window): Range; | ||
export function findNode(element: Element, editor: CoreEditor): Node; | ||
export function findRange(selection: Selection | Range, editor: CoreEditor): Range; | ||
export function getEventRange(event: Event | React.SyntheticEvent, editor: CoreEditor): Range; | ||
export function getEventTransfer(event: Event | React.SyntheticEvent): { type: SlateType; node: Node }; | ||
export function getEventTransfer(event: Event | React.SyntheticEvent): { type: SlateType; node: SlateNode }; | ||
export function setEventTransfer(event: Event | React.SyntheticEvent, type: SlateType, data: any): void; | ||
// Deprecated | ||
export function findDOMNode(node: SlateNode | string, win?: Window): Element; | ||
export function findDOMPoint(point: Point, win?: Window): { node: Node; offset: number } | null; | ||
export function findDOMRange(range: RangeTypeProperties | RangeTypeJSON | RangeType, win?: Window): Range | null; | ||
export function findNode(element: Element, editor: CoreEditor): SlateNode; | ||
export function findPath(element: Element, editor: CoreEditor): Immutable.List<number> | null; | ||
export function findPoint(nativeNode: Element, nativeOffset: number, editor: CoreEditor): Point | null; | ||
export function findRange(domRange: Range | Selection, editor: CoreEditor): SlateRange | null; | ||
export function getEventRange(event: Event | React.SyntheticEvent, editor: CoreEditor): SlateRange | null; |
{ | ||
"name": "@types/slate-react", | ||
"version": "0.22.4", | ||
"version": "0.22.5", | ||
"description": "TypeScript definitions for slate-react", | ||
@@ -56,2 +56,7 @@ "license": "MIT", | ||
"githubUsername": "benjiro" | ||
}, | ||
{ | ||
"name": "Kay Delaney", | ||
"url": "https://github.com/kaydelaney", | ||
"githubUsername": "kaydelaney" | ||
} | ||
@@ -72,4 +77,4 @@ ], | ||
}, | ||
"typesPublisherContentHash": "17dd45c1f5ab81be4370c4df48f13ccd1c271dc0c72ab67a725418be559665c0", | ||
"typesPublisherContentHash": "0061e3da657601c855d62acbb2e0a9518b4e7e3acdb2bf12e9864a50065c0e00", | ||
"typeScriptVersion": "2.8" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
Additional Details | ||
* Last updated: Thu, 18 Jul 2019 18:40:11 GMT | ||
* Last updated: Fri, 02 Aug 2019 18:02:53 GMT | ||
* Dependencies: @types/slate, @types/immutable, @types/react | ||
@@ -17,2 +17,2 @@ * Global values: none | ||
# Credits | ||
These definitions were written by Andy Kent <https://github.com/andykent>, Jamie Talbot <https://github.com/majelbstoat>, Jan Löbel <https://github.com/JanLoebel>, Patrick Sachs <https://github.com/PatrickSachs>, Brandon Shelton <https://github.com/YangusKhan>, Irwan Fario Subastian <https://github.com/isubasti>, Hanna Greaves <https://github.com/sgreav>, Francesco Agnoletto <https://github.com/Kornil>, Jack Allen <https://github.com/jackall3n>, and Benjamin Evenson <https://github.com/benjiro>. | ||
These definitions were written by Andy Kent <https://github.com/andykent>, Jamie Talbot <https://github.com/majelbstoat>, Jan Löbel <https://github.com/JanLoebel>, Patrick Sachs <https://github.com/PatrickSachs>, Brandon Shelton <https://github.com/YangusKhan>, Irwan Fario Subastian <https://github.com/isubasti>, Hanna Greaves <https://github.com/sgreav>, Francesco Agnoletto <https://github.com/Kornil>, Jack Allen <https://github.com/jackall3n>, Benjamin Evenson <https://github.com/benjiro>, and Kay Delaney <https://github.com/kaydelaney>. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27833
457