node_modules ignore

This commit is contained in:
2025-05-08 23:43:47 +02:00
parent e19d52f172
commit 4574544c9f
65041 changed files with 10593536 additions and 0 deletions

498
server/node_modules/slate/dist/interfaces/editor.d.ts generated vendored Normal file
View File

@@ -0,0 +1,498 @@
import { Ancestor, Descendant, Element, ExtendedType, Location, Node, NodeEntry, Operation, Path, PathRef, Point, PointRef, Range, RangeRef, Span, Text, Transforms } from '..';
import { LeafEdge, MaximizeMode, RangeDirection, SelectionMode, TextDirection, TextUnit, TextUnitAdjustment } from '../types/types';
import { OmitFirstArg } from '../utils/types';
import { TextInsertFragmentOptions, TextInsertTextOptions } from './transforms/text';
import { NodeInsertNodesOptions } from './transforms/node';
/**
* The `Editor` interface stores all the state of a Slate editor. It is extended
* by plugins that wish to add their own helpers and implement new behaviors.
*/
export interface BaseEditor {
children: Descendant[];
selection: Selection;
operations: Operation[];
marks: EditorMarks | null;
apply: (operation: Operation) => void;
getDirtyPaths: (operation: Operation) => Path[];
getFragment: () => Descendant[];
isElementReadOnly: (element: Element) => boolean;
isSelectable: (element: Element) => boolean;
markableVoid: (element: Element) => boolean;
normalizeNode: (entry: NodeEntry, options?: {
operation?: Operation;
}) => void;
onChange: (options?: {
operation?: Operation;
}) => void;
shouldNormalize: ({ iteration, dirtyPaths, operation, }: {
iteration: number;
initialDirtyPathsLength: number;
dirtyPaths: Path[];
operation?: Operation;
}) => boolean;
addMark: OmitFirstArg<typeof Editor.addMark>;
collapse: OmitFirstArg<typeof Transforms.collapse>;
delete: OmitFirstArg<typeof Transforms.delete>;
deleteBackward: (unit: TextUnit) => void;
deleteForward: (unit: TextUnit) => void;
deleteFragment: OmitFirstArg<typeof Editor.deleteFragment>;
deselect: OmitFirstArg<typeof Transforms.deselect>;
insertBreak: OmitFirstArg<typeof Editor.insertBreak>;
insertFragment: OmitFirstArg<typeof Transforms.insertFragment>;
insertNode: OmitFirstArg<typeof Editor.insertNode>;
insertNodes: OmitFirstArg<typeof Transforms.insertNodes>;
insertSoftBreak: OmitFirstArg<typeof Editor.insertSoftBreak>;
insertText: OmitFirstArg<typeof Transforms.insertText>;
liftNodes: OmitFirstArg<typeof Transforms.liftNodes>;
mergeNodes: OmitFirstArg<typeof Transforms.mergeNodes>;
move: OmitFirstArg<typeof Transforms.move>;
moveNodes: OmitFirstArg<typeof Transforms.moveNodes>;
normalize: OmitFirstArg<typeof Editor.normalize>;
removeMark: OmitFirstArg<typeof Editor.removeMark>;
removeNodes: OmitFirstArg<typeof Transforms.removeNodes>;
select: OmitFirstArg<typeof Transforms.select>;
setNodes: <T extends Node>(props: Partial<T>, options?: {
at?: Location;
match?: NodeMatch<T>;
mode?: MaximizeMode;
hanging?: boolean;
split?: boolean;
voids?: boolean;
compare?: PropsCompare;
merge?: PropsMerge;
}) => void;
setNormalizing: OmitFirstArg<typeof Editor.setNormalizing>;
setPoint: OmitFirstArg<typeof Transforms.setPoint>;
setSelection: OmitFirstArg<typeof Transforms.setSelection>;
splitNodes: OmitFirstArg<typeof Transforms.splitNodes>;
unsetNodes: OmitFirstArg<typeof Transforms.unsetNodes>;
unwrapNodes: OmitFirstArg<typeof Transforms.unwrapNodes>;
withoutNormalizing: OmitFirstArg<typeof Editor.withoutNormalizing>;
wrapNodes: OmitFirstArg<typeof Transforms.wrapNodes>;
above: <T extends Ancestor>(options?: EditorAboveOptions<T>) => NodeEntry<T> | undefined;
after: OmitFirstArg<typeof Editor.after>;
before: OmitFirstArg<typeof Editor.before>;
edges: OmitFirstArg<typeof Editor.edges>;
elementReadOnly: OmitFirstArg<typeof Editor.elementReadOnly>;
end: OmitFirstArg<typeof Editor.end>;
first: OmitFirstArg<typeof Editor.first>;
fragment: OmitFirstArg<typeof Editor.fragment>;
getMarks: OmitFirstArg<typeof Editor.marks>;
hasBlocks: OmitFirstArg<typeof Editor.hasBlocks>;
hasInlines: OmitFirstArg<typeof Editor.hasInlines>;
hasPath: OmitFirstArg<typeof Editor.hasPath>;
hasTexts: OmitFirstArg<typeof Editor.hasTexts>;
isBlock: OmitFirstArg<typeof Editor.isBlock>;
isEdge: OmitFirstArg<typeof Editor.isEdge>;
isEmpty: OmitFirstArg<typeof Editor.isEmpty>;
isEnd: OmitFirstArg<typeof Editor.isEnd>;
isInline: OmitFirstArg<typeof Editor.isInline>;
isNormalizing: OmitFirstArg<typeof Editor.isNormalizing>;
isStart: OmitFirstArg<typeof Editor.isStart>;
isVoid: OmitFirstArg<typeof Editor.isVoid>;
last: OmitFirstArg<typeof Editor.last>;
leaf: OmitFirstArg<typeof Editor.leaf>;
levels: <T extends Node>(options?: EditorLevelsOptions<T>) => Generator<NodeEntry<T>, void, undefined>;
next: <T extends Descendant>(options?: EditorNextOptions<T>) => NodeEntry<T> | undefined;
node: OmitFirstArg<typeof Editor.node>;
nodes: <T extends Node>(options?: EditorNodesOptions<T>) => Generator<NodeEntry<T>, void, undefined>;
parent: OmitFirstArg<typeof Editor.parent>;
path: OmitFirstArg<typeof Editor.path>;
pathRef: OmitFirstArg<typeof Editor.pathRef>;
pathRefs: OmitFirstArg<typeof Editor.pathRefs>;
point: OmitFirstArg<typeof Editor.point>;
pointRef: OmitFirstArg<typeof Editor.pointRef>;
pointRefs: OmitFirstArg<typeof Editor.pointRefs>;
positions: OmitFirstArg<typeof Editor.positions>;
previous: <T extends Node>(options?: EditorPreviousOptions<T>) => NodeEntry<T> | undefined;
range: OmitFirstArg<typeof Editor.range>;
rangeRef: OmitFirstArg<typeof Editor.rangeRef>;
rangeRefs: OmitFirstArg<typeof Editor.rangeRefs>;
start: OmitFirstArg<typeof Editor.start>;
string: OmitFirstArg<typeof Editor.string>;
unhangRange: OmitFirstArg<typeof Editor.unhangRange>;
void: OmitFirstArg<typeof Editor.void>;
}
export declare type Editor = ExtendedType<'Editor', BaseEditor>;
export declare type BaseSelection = Range | null;
export declare type Selection = ExtendedType<'Selection', BaseSelection>;
export declare type EditorMarks = Omit<Text, 'text'>;
export interface EditorAboveOptions<T extends Ancestor> {
at?: Location;
match?: NodeMatch<T>;
mode?: MaximizeMode;
voids?: boolean;
}
export interface EditorAfterOptions {
distance?: number;
unit?: TextUnitAdjustment;
voids?: boolean;
}
export interface EditorBeforeOptions {
distance?: number;
unit?: TextUnitAdjustment;
voids?: boolean;
}
export interface EditorDirectedDeletionOptions {
unit?: TextUnit;
}
export interface EditorElementReadOnlyOptions {
at?: Location;
mode?: MaximizeMode;
voids?: boolean;
}
export interface EditorFragmentDeletionOptions {
direction?: TextDirection;
}
export interface EditorLeafOptions {
depth?: number;
edge?: LeafEdge;
}
export interface EditorLevelsOptions<T extends Node> {
at?: Location;
match?: NodeMatch<T>;
reverse?: boolean;
voids?: boolean;
}
export interface EditorNextOptions<T extends Descendant> {
at?: Location;
match?: NodeMatch<T>;
mode?: SelectionMode;
voids?: boolean;
}
export interface EditorNodeOptions {
depth?: number;
edge?: LeafEdge;
}
export interface EditorNodesOptions<T extends Node> {
at?: Location | Span;
match?: NodeMatch<T>;
mode?: SelectionMode;
universal?: boolean;
reverse?: boolean;
voids?: boolean;
ignoreNonSelectable?: boolean;
}
export interface EditorNormalizeOptions {
force?: boolean;
operation?: Operation;
}
export interface EditorParentOptions {
depth?: number;
edge?: LeafEdge;
}
export interface EditorPathOptions {
depth?: number;
edge?: LeafEdge;
}
export interface EditorPathRefOptions {
affinity?: TextDirection | null;
}
export interface EditorPointOptions {
edge?: LeafEdge;
}
export interface EditorPointRefOptions {
affinity?: TextDirection | null;
}
export interface EditorPositionsOptions {
at?: Location;
unit?: TextUnitAdjustment;
reverse?: boolean;
voids?: boolean;
ignoreNonSelectable?: boolean;
}
export interface EditorPreviousOptions<T extends Node> {
at?: Location;
match?: NodeMatch<T>;
mode?: SelectionMode;
voids?: boolean;
}
export interface EditorRangeRefOptions {
affinity?: RangeDirection | null;
}
export interface EditorStringOptions {
voids?: boolean;
}
export interface EditorUnhangRangeOptions {
voids?: boolean;
}
export interface EditorVoidOptions {
at?: Location;
mode?: MaximizeMode;
voids?: boolean;
}
export interface EditorInterface {
/**
* Get the ancestor above a location in the document.
*/
above: <T extends Ancestor>(editor: Editor, options?: EditorAboveOptions<T>) => NodeEntry<T> | undefined;
/**
* Add a custom property to the leaf text nodes in the current selection.
*
* If the selection is currently collapsed, the marks will be added to the
* `editor.marks` property instead, and applied when text is inserted next.
*/
addMark: (editor: Editor, key: string, value: any) => void;
/**
* Get the point after a location.
*/
after: (editor: Editor, at: Location, options?: EditorAfterOptions) => Point | undefined;
/**
* Get the point before a location.
*/
before: (editor: Editor, at: Location, options?: EditorBeforeOptions) => Point | undefined;
/**
* Delete content in the editor backward from the current selection.
*/
deleteBackward: (editor: Editor, options?: EditorDirectedDeletionOptions) => void;
/**
* Delete content in the editor forward from the current selection.
*/
deleteForward: (editor: Editor, options?: EditorDirectedDeletionOptions) => void;
/**
* Delete the content in the current selection.
*/
deleteFragment: (editor: Editor, options?: EditorFragmentDeletionOptions) => void;
/**
* Get the start and end points of a location.
*/
edges: (editor: Editor, at: Location) => [Point, Point];
/**
* Match a read-only element in the current branch of the editor.
*/
elementReadOnly: (editor: Editor, options?: EditorElementReadOnlyOptions) => NodeEntry<Element> | undefined;
/**
* Get the end point of a location.
*/
end: (editor: Editor, at: Location) => Point;
/**
* Get the first node at a location.
*/
first: (editor: Editor, at: Location) => NodeEntry;
/**
* Get the fragment at a location.
*/
fragment: (editor: Editor, at: Location) => Descendant[];
/**
* Check if a node has block children.
*/
hasBlocks: (editor: Editor, element: Element) => boolean;
/**
* Check if a node has inline and text children.
*/
hasInlines: (editor: Editor, element: Element) => boolean;
hasPath: (editor: Editor, path: Path) => boolean;
/**
* Check if a node has text children.
*/
hasTexts: (editor: Editor, element: Element) => boolean;
/**
* Insert a block break at the current selection.
*
* If the selection is currently expanded, it will be deleted first.
*/
insertBreak: (editor: Editor) => void;
/**
* Inserts a fragment
* at the specified location or (if not defined) the current selection or (if not defined) the end of the document.
*/
insertFragment: (editor: Editor, fragment: Node[], options?: TextInsertFragmentOptions) => void;
/**
* Atomically inserts `nodes`
* at the specified location or (if not defined) the current selection or (if not defined) the end of the document.
*/
insertNode: <T extends Node>(editor: Editor, node: Node, options?: NodeInsertNodesOptions<T>) => void;
/**
* Insert a soft break at the current selection.
*
* If the selection is currently expanded, it will be deleted first.
*/
insertSoftBreak: (editor: Editor) => void;
/**
* Insert a string of text
* at the specified location or (if not defined) the current selection or (if not defined) the end of the document.
*/
insertText: (editor: Editor, text: string, options?: TextInsertTextOptions) => void;
/**
* Check if a value is a block `Element` object.
*/
isBlock: (editor: Editor, value: Element) => boolean;
/**
* Check if a point is an edge of a location.
*/
isEdge: (editor: Editor, point: Point, at: Location) => boolean;
/**
* Check if a value is an `Editor` object.
*/
isEditor: (value: any) => value is Editor;
/**
* Check if a value is a read-only `Element` object.
*/
isElementReadOnly: (editor: Editor, element: Element) => boolean;
/**
* Check if an element is empty, accounting for void nodes.
*/
isEmpty: (editor: Editor, element: Element) => boolean;
/**
* Check if a point is the end point of a location.
*/
isEnd: (editor: Editor, point: Point, at: Location) => boolean;
/**
* Check if a value is an inline `Element` object.
*/
isInline: (editor: Editor, value: Element) => boolean;
/**
* Check if the editor is currently normalizing after each operation.
*/
isNormalizing: (editor: Editor) => boolean;
/**
* Check if a value is a selectable `Element` object.
*/
isSelectable: (editor: Editor, element: Element) => boolean;
/**
* Check if a point is the start point of a location.
*/
isStart: (editor: Editor, point: Point, at: Location) => boolean;
/**
* Check if a value is a void `Element` object.
*/
isVoid: (editor: Editor, value: Element) => boolean;
/**
* Get the last node at a location.
*/
last: (editor: Editor, at: Location) => NodeEntry;
/**
* Get the leaf text node at a location.
*/
leaf: (editor: Editor, at: Location, options?: EditorLeafOptions) => NodeEntry<Text>;
/**
* Iterate through all of the levels at a location.
*/
levels: <T extends Node>(editor: Editor, options?: EditorLevelsOptions<T>) => Generator<NodeEntry<T>, void, undefined>;
/**
* Get the marks that would be added to text at the current selection.
*/
marks: (editor: Editor) => Omit<Text, 'text'> | null;
/**
* Get the matching node in the branch of the document after a location.
*/
next: <T extends Descendant>(editor: Editor, options?: EditorNextOptions<T>) => NodeEntry<T> | undefined;
/**
* Get the node at a location.
*/
node: (editor: Editor, at: Location, options?: EditorNodeOptions) => NodeEntry;
/**
* Iterate through all of the nodes in the Editor.
*/
nodes: <T extends Node>(editor: Editor, options?: EditorNodesOptions<T>) => Generator<NodeEntry<T>, void, undefined>;
/**
* Normalize any dirty objects in the editor.
*/
normalize: (editor: Editor, options?: EditorNormalizeOptions) => void;
/**
* Get the parent node of a location.
*/
parent: (editor: Editor, at: Location, options?: EditorParentOptions) => NodeEntry<Ancestor>;
/**
* Get the path of a location.
*/
path: (editor: Editor, at: Location, options?: EditorPathOptions) => Path;
/**
* Create a mutable ref for a `Path` object, which will stay in sync as new
* operations are applied to the editor.
*/
pathRef: (editor: Editor, path: Path, options?: EditorPathRefOptions) => PathRef;
/**
* Get the set of currently tracked path refs of the editor.
*/
pathRefs: (editor: Editor) => Set<PathRef>;
/**
* Get the start or end point of a location.
*/
point: (editor: Editor, at: Location, options?: EditorPointOptions) => Point;
/**
* Create a mutable ref for a `Point` object, which will stay in sync as new
* operations are applied to the editor.
*/
pointRef: (editor: Editor, point: Point, options?: EditorPointRefOptions) => PointRef;
/**
* Get the set of currently tracked point refs of the editor.
*/
pointRefs: (editor: Editor) => Set<PointRef>;
/**
* Return all the positions in `at` range where a `Point` can be placed.
*
* By default, moves forward by individual offsets at a time, but
* the `unit` option can be used to to move by character, word, line, or block.
*
* The `reverse` option can be used to change iteration direction.
*
* Note: By default void nodes are treated as a single point and iteration
* will not happen inside their content unless you pass in true for the
* `voids` option, then iteration will occur.
*/
positions: (editor: Editor, options?: EditorPositionsOptions) => Generator<Point, void, undefined>;
/**
* Get the matching node in the branch of the document before a location.
*/
previous: <T extends Node>(editor: Editor, options?: EditorPreviousOptions<T>) => NodeEntry<T> | undefined;
/**
* Get a range of a location.
*/
range: (editor: Editor, at: Location, to?: Location) => Range;
/**
* Create a mutable ref for a `Range` object, which will stay in sync as new
* operations are applied to the editor.
*/
rangeRef: (editor: Editor, range: Range, options?: EditorRangeRefOptions) => RangeRef;
/**
* Get the set of currently tracked range refs of the editor.
*/
rangeRefs: (editor: Editor) => Set<RangeRef>;
/**
* Remove a custom property from all of the leaf text nodes in the current
* selection.
*
* If the selection is currently collapsed, the removal will be stored on
* `editor.marks` and applied to the text inserted next.
*/
removeMark: (editor: Editor, key: string) => void;
/**
* Manually set if the editor should currently be normalizing.
*
* Note: Using this incorrectly can leave the editor in an invalid state.
*
*/
setNormalizing: (editor: Editor, isNormalizing: boolean) => void;
/**
* Get the start point of a location.
*/
start: (editor: Editor, at: Location) => Point;
/**
* Get the text string content of a location.
*
* Note: by default the text of void nodes is considered to be an empty
* string, regardless of content, unless you pass in true for the voids option
*/
string: (editor: Editor, at: Location, options?: EditorStringOptions) => string;
/**
* Convert a range into a non-hanging one.
*/
unhangRange: (editor: Editor, range: Range, options?: EditorUnhangRangeOptions) => Range;
/**
* Match a void node in the current branch of the editor.
*/
void: (editor: Editor, options?: EditorVoidOptions) => NodeEntry<Element> | undefined;
/**
* Call a function, deferring normalization until after it completes.
*/
withoutNormalizing: (editor: Editor, fn: () => void) => void;
}
export declare const Editor: EditorInterface;
/**
* A helper type for narrowing matched nodes with a predicate.
*/
export declare type NodeMatch<T extends Node> = ((node: Node, path: Path) => node is T) | ((node: Node, path: Path) => boolean);
export declare type PropsCompare = (prop: Partial<Node>, node: Partial<Node>) => boolean;
export declare type PropsMerge = (prop: Partial<Node>, node: Partial<Node>) => object;
//# sourceMappingURL=editor.d.ts.map

File diff suppressed because one or more lines are too long

47
server/node_modules/slate/dist/interfaces/element.d.ts generated vendored Normal file
View File

@@ -0,0 +1,47 @@
import { Ancestor, Descendant, ExtendedType, Path } from '..';
/**
* `Element` objects are a type of node in a Slate document that contain other
* element nodes or text nodes. They can be either "blocks" or "inlines"
* depending on the Slate editor's configuration.
*/
export interface BaseElement {
children: Descendant[];
}
export declare type Element = ExtendedType<'Element', BaseElement>;
export interface ElementInterface {
/**
* Check if a value implements the 'Ancestor' interface.
*/
isAncestor: (value: any) => value is Ancestor;
/**
* Check if a value implements the `Element` interface.
*/
isElement: (value: any) => value is Element;
/**
* Check if a value is an array of `Element` objects.
*/
isElementList: (value: any) => value is Element[];
/**
* Check if a set of props is a partial of Element.
*/
isElementProps: (props: any) => props is Partial<Element>;
/**
* Check if a value implements the `Element` interface and has elementKey with selected value.
* Default it check to `type` key value
*/
isElementType: <T extends Element>(value: any, elementVal: string, elementKey?: string) => value is T;
/**
* Check if an element matches set of properties.
*
* Note: this checks custom properties, and it does not ensure that any
* children are equivalent.
*/
matches: (element: Element, props: Partial<Element>) => boolean;
}
export declare const Element: ElementInterface;
/**
* `ElementEntry` objects refer to an `Element` and the `Path` where it can be
* found inside a root node.
*/
export declare type ElementEntry = [Element, Path];
//# sourceMappingURL=element.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../packages/slate/src/interfaces/element.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAU,YAAY,EAAQ,IAAI,EAAE,MAAM,IAAI,CAAA;AAE3E;;;;GAIG;AAEH,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,UAAU,EAAE,CAAA;CACvB;AAED,oBAAY,OAAO,GAAG,YAAY,CAAC,SAAS,EAAE,WAAW,CAAC,CAAA;AAE1D,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,UAAU,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,KAAK,IAAI,QAAQ,CAAA;IAE7C;;OAEG;IACH,SAAS,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,KAAK,IAAI,OAAO,CAAA;IAE3C;;OAEG;IACH,aAAa,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,KAAK,IAAI,OAAO,EAAE,CAAA;IAEjD;;OAEG;IACH,cAAc,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,KAAK,IAAI,OAAO,CAAC,OAAO,CAAC,CAAA;IAEzD;;;OAGG;IACH,aAAa,EAAE,CAAC,CAAC,SAAS,OAAO,EAC/B,KAAK,EAAE,GAAG,EACV,UAAU,EAAE,MAAM,EAClB,UAAU,CAAC,EAAE,MAAM,KAChB,KAAK,IAAI,CAAC,CAAA;IAEf;;;;;OAKG;IACH,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,OAAO,CAAA;CAChE;AAcD,eAAO,MAAM,OAAO,EAAE,gBAoCrB,CAAA;AAED;;;GAGG;AACH,oBAAY,YAAY,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA"}

15
server/node_modules/slate/dist/interfaces/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,15 @@
export * from './editor';
export * from './element';
export * from './location';
export * from './node';
export * from './operation';
export * from './path-ref';
export * from './path';
export * from './point-ref';
export * from './point';
export * from './range-ref';
export * from './range';
export * from './scrubber';
export * from './text';
export * from './transforms/index';
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../packages/slate/src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,QAAQ,CAAA;AACtB,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,QAAQ,CAAA;AACtB,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,QAAQ,CAAA;AACtB,cAAc,oBAAoB,CAAA"}

View File

@@ -0,0 +1,30 @@
import { Path, Point, Range } from '..';
/**
* The `Location` interface is a union of the ways to refer to a specific
* location in a Slate document: paths, points or ranges.
*
* Methods will often accept a `Location` instead of requiring only a `Path`,
* `Point` or `Range`. This eliminates the need for developers to manage
* converting between the different interfaces in their own code base.
*/
export declare type Location = Path | Point | Range;
export interface LocationInterface {
/**
* Check if a value implements the `Location` interface.
*/
isLocation: (value: any) => value is Location;
}
export declare const Location: LocationInterface;
/**
* The `Span` interface is a low-level way to refer to locations in nodes
* without using `Point` which requires leaf text nodes to be present.
*/
export declare type Span = [Path, Path];
export interface SpanInterface {
/**
* Check if a value implements the `Span` interface.
*/
isSpan: (value: any) => value is Span;
}
export declare const Span: SpanInterface;
//# sourceMappingURL=location.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"location.d.ts","sourceRoot":"","sources":["../packages/slate/src/interfaces/location.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,IAAI,CAAA;AAEvC;;;;;;;GAOG;AAEH,oBAAY,QAAQ,GAAG,IAAI,GAAG,KAAK,GAAG,KAAK,CAAA;AAE3C,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,UAAU,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,KAAK,IAAI,QAAQ,CAAA;CAC9C;AAGD,eAAO,MAAM,QAAQ,EAAE,iBAItB,CAAA;AAED;;;GAGG;AAEH,oBAAY,IAAI,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;AAE/B,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,MAAM,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,KAAK,IAAI,IAAI,CAAA;CACtC;AAGD,eAAO,MAAM,IAAI,EAAE,aAMlB,CAAA"}

174
server/node_modules/slate/dist/interfaces/node.d.ts generated vendored Normal file
View File

@@ -0,0 +1,174 @@
import { Editor, Path, Range, Text } from '..';
import { Element, ElementEntry } from './element';
/**
* The `Node` union type represents all of the different types of nodes that
* occur in a Slate document tree.
*/
export declare type BaseNode = Editor | Element | Text;
export declare type Node = Editor | Element | Text;
export interface NodeAncestorsOptions {
reverse?: boolean;
}
export interface NodeChildrenOptions {
reverse?: boolean;
}
export interface NodeDescendantsOptions {
from?: Path;
to?: Path;
reverse?: boolean;
pass?: (node: NodeEntry) => boolean;
}
export interface NodeElementsOptions {
from?: Path;
to?: Path;
reverse?: boolean;
pass?: (node: NodeEntry) => boolean;
}
export interface NodeLevelsOptions {
reverse?: boolean;
}
export interface NodeNodesOptions {
from?: Path;
to?: Path;
reverse?: boolean;
pass?: (entry: NodeEntry) => boolean;
}
export interface NodeTextsOptions {
from?: Path;
to?: Path;
reverse?: boolean;
pass?: (node: NodeEntry) => boolean;
}
export interface NodeInterface {
/**
* Get the node at a specific path, asserting that it's an ancestor node.
*/
ancestor: (root: Node, path: Path) => Ancestor;
/**
* Return a generator of all the ancestor nodes above a specific path.
*
* By default the order is top-down, from highest to lowest ancestor in
* the tree, but you can pass the `reverse: true` option to go bottom-up.
*/
ancestors: (root: Node, path: Path, options?: NodeAncestorsOptions) => Generator<NodeEntry<Ancestor>, void, undefined>;
/**
* Get the child of a node at a specific index.
*/
child: (root: Node, index: number) => Descendant;
/**
* Iterate over the children of a node at a specific path.
*/
children: (root: Node, path: Path, options?: NodeChildrenOptions) => Generator<NodeEntry<Descendant>, void, undefined>;
/**
* Get an entry for the common ancesetor node of two paths.
*/
common: (root: Node, path: Path, another: Path) => NodeEntry;
/**
* Get the node at a specific path, asserting that it's a descendant node.
*/
descendant: (root: Node, path: Path) => Descendant;
/**
* Return a generator of all the descendant node entries inside a root node.
*/
descendants: (root: Node, options?: NodeDescendantsOptions) => Generator<NodeEntry<Descendant>, void, undefined>;
/**
* Return a generator of all the element nodes inside a root node. Each iteration
* will return an `ElementEntry` tuple consisting of `[Element, Path]`. If the
* root node is an element it will be included in the iteration as well.
*/
elements: (root: Node, options?: NodeElementsOptions) => Generator<ElementEntry, void, undefined>;
/**
* Extract props from a Node.
*/
extractProps: (node: Node) => NodeProps;
/**
* Get the first node entry in a root node from a path.
*/
first: (root: Node, path: Path) => NodeEntry;
/**
* Get the sliced fragment represented by a range inside a root node.
*/
fragment: (root: Node, range: Range) => Descendant[];
/**
* Get the descendant node referred to by a specific path. If the path is an
* empty array, it refers to the root node itself.
*/
get: (root: Node, path: Path) => Node;
/**
* Check if a descendant node exists at a specific path.
*/
has: (root: Node, path: Path) => boolean;
/**
* Check if a value implements the `Node` interface.
*/
isNode: (value: any) => value is Node;
/**
* Check if a value is a list of `Node` objects.
*/
isNodeList: (value: any) => value is Node[];
/**
* Get the last node entry in a root node from a path.
*/
last: (root: Node, path: Path) => NodeEntry;
/**
* Get the node at a specific path, ensuring it's a leaf text node.
*/
leaf: (root: Node, path: Path) => Text;
/**
* Return a generator of the in a branch of the tree, from a specific path.
*
* By default the order is top-down, from highest to lowest node in the tree,
* but you can pass the `reverse: true` option to go bottom-up.
*/
levels: (root: Node, path: Path, options?: NodeLevelsOptions) => Generator<NodeEntry, void, undefined>;
/**
* Check if a node matches a set of props.
*/
matches: (node: Node, props: Partial<Node>) => boolean;
/**
* Return a generator of all the node entries of a root node. Each entry is
* returned as a `[Node, Path]` tuple, with the path referring to the node's
* position inside the root node.
*/
nodes: (root: Node, options?: NodeNodesOptions) => Generator<NodeEntry, void, undefined>;
/**
* Get the parent of a node at a specific path.
*/
parent: (root: Node, path: Path) => Ancestor;
/**
* Get the concatenated text string of a node's content.
*
* Note that this will not include spaces or line breaks between block nodes.
* It is not a user-facing string, but a string for performing offset-related
* computations for a node.
*/
string: (node: Node) => string;
/**
* Return a generator of all leaf text nodes in a root node.
*/
texts: (root: Node, options?: NodeTextsOptions) => Generator<NodeEntry<Text>, void, undefined>;
}
export declare const Node: NodeInterface;
/**
* The `Descendant` union type represents nodes that are descendants in the
* tree. It is returned as a convenience in certain cases to narrow a value
* further than the more generic `Node` union.
*/
export declare type Descendant = Element | Text;
/**
* The `Ancestor` union type represents nodes that are ancestors in the tree.
* It is returned as a convenience in certain cases to narrow a value further
* than the more generic `Node` union.
*/
export declare type Ancestor = Editor | Element;
/**
* `NodeEntry` objects are returned when iterating over the nodes in a Slate
* document tree. They consist of the node and its `Path` relative to the root
* node in the document.
*/
export declare type NodeEntry<T extends Node = Node> = [T, Path];
/**
* Convenience type for returning the props of a node.
*/
export declare type NodeProps = Omit<Editor, 'children'> | Omit<Element, 'children'> | Omit<Text, 'text'>;
//# sourceMappingURL=node.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../packages/slate/src/interfaces/node.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAY,IAAI,EAAE,MAAM,IAAI,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAEjD;;;GAGG;AAEH,oBAAY,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAA;AAC9C,oBAAY,IAAI,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAA;AAE1C,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,EAAE,CAAC,EAAE,IAAI,CAAA;IACT,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,OAAO,CAAA;CACpC;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,EAAE,CAAC,EAAE,IAAI,CAAA;IACT,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,OAAO,CAAA;CACpC;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,EAAE,CAAC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,CAAC,CAAA;IAE1C;;OAEG;IACH,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,OAAO,CAAA;IAEtD;;;;OAIG;IACH,KAAK,EAAE,CACL,IAAI,EAAE,IAAI,EACV,OAAO,CAAC,EAAE,gBAAgB,KACvB,SAAS,CAAC,SAAS,EAAE,IAAI,EAAE,SAAS,CAAC,CAAA;IAE1C;;OAEG;IACH,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,KAAK,QAAQ,CAAA;IAE5C;;;;;;OAMG;IACH,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,MAAM,CAAA;IAE9B;;OAEG;IACH,KAAK,EAAE,CACL,IAAI,EAAE,IAAI,EACV,OAAO,CAAC,EAAE,gBAAgB,KACvB,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC,CAAA;CACjD;AAKD,eAAO,MAAM,IAAI,EAAE,aAmYlB,CAAA;AAED;;;;GAIG;AAEH,oBAAY,UAAU,GAAG,OAAO,GAAG,IAAI,CAAA;AAEvC;;;;GAIG;AAEH,oBAAY,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAA;AAEvC;;;;GAIG;AAEH,oBAAY,SAAS,CAAC,CAAC,SAAS,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;AAExD;;GAEG;AACH,oBAAY,SAAS,GACjB,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,GACxB,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,GACzB,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA"}

View File

@@ -0,0 +1,108 @@
import { ExtendedType, Node, Path, Range } from '..';
export declare type BaseInsertNodeOperation = {
type: 'insert_node';
path: Path;
node: Node;
};
export declare type InsertNodeOperation = ExtendedType<'InsertNodeOperation', BaseInsertNodeOperation>;
export declare type BaseInsertTextOperation = {
type: 'insert_text';
path: Path;
offset: number;
text: string;
};
export declare type InsertTextOperation = ExtendedType<'InsertTextOperation', BaseInsertTextOperation>;
export declare type BaseMergeNodeOperation = {
type: 'merge_node';
path: Path;
position: number;
properties: Partial<Node>;
};
export declare type MergeNodeOperation = ExtendedType<'MergeNodeOperation', BaseMergeNodeOperation>;
export declare type BaseMoveNodeOperation = {
type: 'move_node';
path: Path;
newPath: Path;
};
export declare type MoveNodeOperation = ExtendedType<'MoveNodeOperation', BaseMoveNodeOperation>;
export declare type BaseRemoveNodeOperation = {
type: 'remove_node';
path: Path;
node: Node;
};
export declare type RemoveNodeOperation = ExtendedType<'RemoveNodeOperation', BaseRemoveNodeOperation>;
export declare type BaseRemoveTextOperation = {
type: 'remove_text';
path: Path;
offset: number;
text: string;
};
export declare type RemoveTextOperation = ExtendedType<'RemoveTextOperation', BaseRemoveTextOperation>;
export declare type BaseSetNodeOperation = {
type: 'set_node';
path: Path;
properties: Partial<Node>;
newProperties: Partial<Node>;
};
export declare type SetNodeOperation = ExtendedType<'SetNodeOperation', BaseSetNodeOperation>;
export declare type BaseSetSelectionOperation = {
type: 'set_selection';
properties: null;
newProperties: Range;
} | {
type: 'set_selection';
properties: Partial<Range>;
newProperties: Partial<Range>;
} | {
type: 'set_selection';
properties: Range;
newProperties: null;
};
export declare type SetSelectionOperation = ExtendedType<'SetSelectionOperation', BaseSetSelectionOperation>;
export declare type BaseSplitNodeOperation = {
type: 'split_node';
path: Path;
position: number;
properties: Partial<Node>;
};
export declare type SplitNodeOperation = ExtendedType<'SplitNodeOperation', BaseSplitNodeOperation>;
export declare type NodeOperation = InsertNodeOperation | MergeNodeOperation | MoveNodeOperation | RemoveNodeOperation | SetNodeOperation | SplitNodeOperation;
export declare type SelectionOperation = SetSelectionOperation;
export declare type TextOperation = InsertTextOperation | RemoveTextOperation;
/**
* `Operation` objects define the low-level instructions that Slate editors use
* to apply changes to their internal state. Representing all changes as
* operations is what allows Slate editors to easily implement history,
* collaboration, and other features.
*/
export declare type BaseOperation = NodeOperation | SelectionOperation | TextOperation;
export declare type Operation = ExtendedType<'Operation', BaseOperation>;
export interface OperationInterface {
/**
* Check if a value is a `NodeOperation` object.
*/
isNodeOperation: (value: any) => value is NodeOperation;
/**
* Check if a value is an `Operation` object.
*/
isOperation: (value: any) => value is Operation;
/**
* Check if a value is a list of `Operation` objects.
*/
isOperationList: (value: any) => value is Operation[];
/**
* Check if a value is a `SelectionOperation` object.
*/
isSelectionOperation: (value: any) => value is SelectionOperation;
/**
* Check if a value is a `TextOperation` object.
*/
isTextOperation: (value: any) => value is TextOperation;
/**
* Invert an operation, returning a new operation that will exactly undo the
* original when applied.
*/
inverse: (op: Operation) => Operation;
}
export declare const Operation: OperationInterface;
//# sourceMappingURL=operation.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../packages/slate/src/interfaces/operation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,IAAI,CAAA;AAGpD,oBAAY,uBAAuB,GAAG;IACpC,IAAI,EAAE,aAAa,CAAA;IACnB,IAAI,EAAE,IAAI,CAAA;IACV,IAAI,EAAE,IAAI,CAAA;CACX,CAAA;AAED,oBAAY,mBAAmB,GAAG,YAAY,CAC5C,qBAAqB,EACrB,uBAAuB,CACxB,CAAA;AAED,oBAAY,uBAAuB,GAAG;IACpC,IAAI,EAAE,aAAa,CAAA;IACnB,IAAI,EAAE,IAAI,CAAA;IACV,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,oBAAY,mBAAmB,GAAG,YAAY,CAC5C,qBAAqB,EACrB,uBAAuB,CACxB,CAAA;AAED,oBAAY,sBAAsB,GAAG;IACnC,IAAI,EAAE,YAAY,CAAA;IAClB,IAAI,EAAE,IAAI,CAAA;IACV,QAAQ,EAAE,MAAM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AkB,CAAA;IAEjE;;OAEG;IACH,eAAe,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,KAAK,IAAI,aAAa,CAAA;IAEvD;;;OAGG;IACH,OAAO,EAAE,CAAC,EAAE,EAAE,SAAS,KAAK,SAAS,CAAA;CACtC;AAGD,eAAO,MAAM,SAAS,EAAE,kBAsJvB,CAAA"}

View File

@@ -0,0 +1,19 @@
import { Operation, Path } from '..';
/**
* `PathRef` objects keep a specific path in a document synced over time as new
* operations are applied to the editor. You can access their `current` property
* at any time for the up-to-date path value.
*/
export interface PathRef {
current: Path | null;
affinity: 'forward' | 'backward' | null;
unref(): Path | null;
}
export interface PathRefInterface {
/**
* Transform the path ref's current value by an operation.
*/
transform: (ref: PathRef, op: Operation) => void;
}
export declare const PathRef: PathRefInterface;
//# sourceMappingURL=path-ref.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"path-ref.d.ts","sourceRoot":"","sources":["../packages/slate/src/interfaces/path-ref.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,IAAI,CAAA;AAEpC;;;;GAIG;AAEH,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,IAAI,GAAG,IAAI,CAAA;IACpB,QAAQ,EAAE,SAAS,GAAG,UAAU,GAAG,IAAI,CAAA;IACvC,KAAK,IAAI,IAAI,GAAG,IAAI,CAAA;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,SAAS,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,KAAK,IAAI,CAAA;CACjD;AAGD,eAAO,MAAM,OAAO,EAAE,gBAerB,CAAA"}

133
server/node_modules/slate/dist/interfaces/path.d.ts generated vendored Normal file
View File

@@ -0,0 +1,133 @@
import { InsertNodeOperation, MergeNodeOperation, MoveNodeOperation, Operation, RemoveNodeOperation, SplitNodeOperation } from '..';
import { TextDirection } from '../types/types';
/**
* `Path` arrays are a list of indexes that describe a node's exact position in
* a Slate node tree. Although they are usually relative to the root `Editor`
* object, they can be relative to any `Node` object.
*/
export declare type Path = number[];
export interface PathAncestorsOptions {
reverse?: boolean;
}
export interface PathLevelsOptions {
reverse?: boolean;
}
export interface PathTransformOptions {
affinity?: TextDirection | null;
}
export interface PathInterface {
/**
* Get a list of ancestor paths for a given path.
*
* The paths are sorted from shallowest to deepest ancestor. However, if the
* `reverse: true` option is passed, they are reversed.
*/
ancestors: (path: Path, options?: PathAncestorsOptions) => Path[];
/**
* Get the common ancestor path of two paths.
*/
common: (path: Path, another: Path) => Path;
/**
* Compare a path to another, returning an integer indicating whether the path
* was before, at, or after the other.
*
* Note: Two paths of unequal length can still receive a `0` result if one is
* directly above or below the other. If you want exact matching, use
* [[Path.equals]] instead.
*/
compare: (path: Path, another: Path) => -1 | 0 | 1;
/**
* Check if a path ends after one of the indexes in another.
*/
endsAfter: (path: Path, another: Path) => boolean;
/**
* Check if a path ends at one of the indexes in another.
*/
endsAt: (path: Path, another: Path) => boolean;
/**
* Check if a path ends before one of the indexes in another.
*/
endsBefore: (path: Path, another: Path) => boolean;
/**
* Check if a path is exactly equal to another.
*/
equals: (path: Path, another: Path) => boolean;
/**
* Check if the path of previous sibling node exists
*/
hasPrevious: (path: Path) => boolean;
/**
* Check if a path is after another.
*/
isAfter: (path: Path, another: Path) => boolean;
/**
* Check if a path is an ancestor of another.
*/
isAncestor: (path: Path, another: Path) => boolean;
/**
* Check if a path is before another.
*/
isBefore: (path: Path, another: Path) => boolean;
/**
* Check if a path is a child of another.
*/
isChild: (path: Path, another: Path) => boolean;
/**
* Check if a path is equal to or an ancestor of another.
*/
isCommon: (path: Path, another: Path) => boolean;
/**
* Check if a path is a descendant of another.
*/
isDescendant: (path: Path, another: Path) => boolean;
/**
* Check if a path is the parent of another.
*/
isParent: (path: Path, another: Path) => boolean;
/**
* Check is a value implements the `Path` interface.
*/
isPath: (value: any) => value is Path;
/**
* Check if a path is a sibling of another.
*/
isSibling: (path: Path, another: Path) => boolean;
/**
* Get a list of paths at every level down to a path. Note: this is the same
* as `Path.ancestors`, but including the path itself.
*
* The paths are sorted from shallowest to deepest. However, if the `reverse:
* true` option is passed, they are reversed.
*/
levels: (path: Path, options?: PathLevelsOptions) => Path[];
/**
* Given a path, get the path to the next sibling node.
*/
next: (path: Path) => Path;
/**
* Returns whether this operation can affect paths or not. Used as an
* optimization when updating dirty paths during normalization
*
* NOTE: This *must* be kept in sync with the implementation of 'transform'
* below
*/
operationCanTransformPath: (operation: Operation) => operation is InsertNodeOperation | RemoveNodeOperation | MergeNodeOperation | SplitNodeOperation | MoveNodeOperation;
/**
* Given a path, return a new path referring to the parent node above it.
*/
parent: (path: Path) => Path;
/**
* Given a path, get the path to the previous sibling node.
*/
previous: (path: Path) => Path;
/**
* Get a path relative to an ancestor.
*/
relative: (path: Path, ancestor: Path) => Path;
/**
* Transform a path by an operation.
*/
transform: (path: Path, operation: Operation, options?: PathTransformOptions) => Path | null;
}
export declare const Path: PathInterface;
//# sourceMappingURL=path.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../packages/slate/src/interfaces/path.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,SAAS,EACT,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,IAAI,CAAA;AACX,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAE9C;;;;GAIG;AAEH,oBAAY,IAAI,GAAG,MAAM,EAAE,CAAA;AAE3B,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,aAAa,GAAG,IAAI,CAAA;CAChC;AAED,MAAM,WAAW,aAAa;IAC5B;;;;;OAKG;IACH,SAAS,EA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import { TextDirection } from '../types/types';
/**
* `PointRef` objects keep a specific point in a document synced over time as new
* operations are applied to the editor. You can access their `current` property
* at any time for the up-to-date point value.
*/
export interface PointRef {
current: Point | null;
affinity: TextDirection | null;
unref(): Point | null;
}
export interface PointRefInterface {
/**
* Transform the point ref's current value by an operation.
*/
transform: (ref: PointRef, op: Operation) => void;
}
export declare const PointRef: PointRefInterface;
//# sourceMappingURL=point-ref.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"point-ref.d.ts","sourceRoot":"","sources":["../packages/slate/src/interfaces/point-ref.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,IAAI,CAAA;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAE9C;;;;GAIG;AAEH,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,KAAK,GAAG,IAAI,CAAA;IACrB,QAAQ,EAAE,aAAa,GAAG,IAAI,CAAA;IAC9B,KAAK,IAAI,KAAK,GAAG,IAAI,CAAA;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,SAAS,EAAE,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,KAAK,IAAI,CAAA;CAClD;AAGD,eAAO,MAAM,QAAQ,EAAE,iBAetB,CAAA"}

50
server/node_modules/slate/dist/interfaces/point.d.ts generated vendored Normal file
View File

@@ -0,0 +1,50 @@
import { ExtendedType, Operation, Path } from '..';
import { TextDirection } from '../types/types';
/**
* `Point` objects refer to a specific location in a text node in a Slate
* document. Its path refers to the location of the node in the tree, and its
* offset refers to the distance into the node's string of text. Points can
* only refer to `Text` nodes.
*/
export interface BasePoint {
path: Path;
offset: number;
}
export declare type Point = ExtendedType<'Point', BasePoint>;
export interface PointTransformOptions {
affinity?: TextDirection | null;
}
export interface PointInterface {
/**
* Compare a point to another, returning an integer indicating whether the
* point was before, at, or after the other.
*/
compare: (point: Point, another: Point) => -1 | 0 | 1;
/**
* Check if a point is after another.
*/
isAfter: (point: Point, another: Point) => boolean;
/**
* Check if a point is before another.
*/
isBefore: (point: Point, another: Point) => boolean;
/**
* Check if a point is exactly equal to another.
*/
equals: (point: Point, another: Point) => boolean;
/**
* Check if a value implements the `Point` interface.
*/
isPoint: (value: any) => value is Point;
/**
* Transform a point by an operation.
*/
transform: (point: Point, op: Operation, options?: PointTransformOptions) => Point | null;
}
export declare const Point: PointInterface;
/**
* `PointEntry` objects are returned when iterating over `Point` objects that
* belong to a range.
*/
export declare type PointEntry = [Point, 'anchor' | 'focus'];
//# sourceMappingURL=point.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"point.d.ts","sourceRoot":"","sources":["../packages/slate/src/interfaces/point.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,IAAI,CAAA;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAE9C;;;;;GAKG;AAEH,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,IAAI,CAAA;IACV,MAAM,EAAE,MAAM,CAAA;CACf;AAED,oBAAY,KAAK,GAAG,YAAY,CAAC,OAAO,EAAE,SAAS,CAAC,CAAA;AAEpD,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,EAAE,aAAa,GAAG,IAAI,CAAA;CAChC;AAED,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,KAAK,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IAErD;;OAEG;IACH,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,KAAK,OAAO,CAAA;IAElD;;OAEG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,KAAK,OAAO,CAAA;IAEnD;;OAEG;IACH,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,KAAK,OAAO,CAAA;IAEjD;;OAEG;IACH,OAAO,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,KAAK,IAAI,KAAK,CAAA;IAEvC;;OAEG;IACH,SAAS,EAAE,CACT,KAAK,EAAE,KAAK,EACZ,EAAE,EAAE,SAAS,EACb,OAAO,CAAC,EAAE,qBAAqB,KAC5B,KAAK,GAAG,IAAI,CAAA;CAClB;AAGD,eAAO,MAAM,KAAK,EAAE,cAqHnB,CAAA;AAED;;;GAGG;AAEH,oBAAY,UAAU,GAAG,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAC,CAAA"}

View File

@@ -0,0 +1,19 @@
import { Operation, Range } from '..';
/**
* `RangeRef` objects keep a specific range in a document synced over time as new
* operations are applied to the editor. You can access their `current` property
* at any time for the up-to-date range value.
*/
export interface RangeRef {
current: Range | null;
affinity: 'forward' | 'backward' | 'outward' | 'inward' | null;
unref(): Range | null;
}
export interface RangeRefInterface {
/**
* Transform the range ref's current value by an operation.
*/
transform: (ref: RangeRef, op: Operation) => void;
}
export declare const RangeRef: RangeRefInterface;
//# sourceMappingURL=range-ref.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"range-ref.d.ts","sourceRoot":"","sources":["../packages/slate/src/interfaces/range-ref.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,IAAI,CAAA;AAErC;;;;GAIG;AAEH,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,KAAK,GAAG,IAAI,CAAA;IACrB,QAAQ,EAAE,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,IAAI,CAAA;IAC9D,KAAK,IAAI,KAAK,GAAG,IAAI,CAAA;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,SAAS,EAAE,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,KAAK,IAAI,CAAA;CAClD;AAGD,eAAO,MAAM,QAAQ,EAAE,iBAetB,CAAA"}

81
server/node_modules/slate/dist/interfaces/range.d.ts generated vendored Normal file
View File

@@ -0,0 +1,81 @@
import { ExtendedType, Operation, Path, Point, PointEntry } from '..';
import { RangeDirection } from '../types/types';
/**
* `Range` objects are a set of points that refer to a specific span of a Slate
* document. They can define a span inside a single node or a can span across
* multiple nodes.
*/
export interface BaseRange {
anchor: Point;
focus: Point;
}
export declare type Range = ExtendedType<'Range', BaseRange>;
export interface RangeEdgesOptions {
reverse?: boolean;
}
export interface RangeTransformOptions {
affinity?: RangeDirection | null;
}
export interface RangeInterface {
/**
* Get the start and end points of a range, in the order in which they appear
* in the document.
*/
edges: (range: Range, options?: RangeEdgesOptions) => [Point, Point];
/**
* Get the end point of a range.
*/
end: (range: Range) => Point;
/**
* Check if a range is exactly equal to another.
*/
equals: (range: Range, another: Range) => boolean;
/**
* Check if a range includes a path, a point or part of another range.
*/
includes: (range: Range, target: Path | Point | Range) => boolean;
/**
* Get the intersection of a range with another.
*/
intersection: (range: Range, another: Range) => Range | null;
/**
* Check if a range is backward, meaning that its anchor point appears in the
* document _after_ its focus point.
*/
isBackward: (range: Range) => boolean;
/**
* Check if a range is collapsed, meaning that both its anchor and focus
* points refer to the exact same position in the document.
*/
isCollapsed: (range: Range) => boolean;
/**
* Check if a range is expanded.
*
* This is the opposite of [[Range.isCollapsed]] and is provided for legibility.
*/
isExpanded: (range: Range) => boolean;
/**
* Check if a range is forward.
*
* This is the opposite of [[Range.isBackward]] and is provided for legibility.
*/
isForward: (range: Range) => boolean;
/**
* Check if a value implements the [[Range]] interface.
*/
isRange: (value: any) => value is Range;
/**
* Iterate through all of the point entries in a range.
*/
points: (range: Range) => Generator<PointEntry, void, undefined>;
/**
* Get the start point of a range.
*/
start: (range: Range) => Point;
/**
* Transform a range by an operation.
*/
transform: (range: Range, op: Operation, options?: RangeTransformOptions) => Range | null;
}
export declare const Range: RangeInterface;
//# sourceMappingURL=range.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"range.d.ts","sourceRoot":"","sources":["../packages/slate/src/interfaces/range.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,IAAI,CAAA;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAE/C;;;;GAIG;AAEH,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,KAAK,CAAA;IACb,KAAK,EAAE,KAAK,CAAA;CACb;AAED,oBAAY,KAAK,GAAG,YAAY,CAAC,OAAO,EAAE,SAAS,CAAC,CAAA;AAEpD,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,EAAE,cAAc,GAAG,IAAI,CAAA;CACjC;AAED,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,KAAK,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,iBAAiB,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;IAEpE;;OAEG;IACH,GAAG,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,KAAK,CAAA;IAE5B;;OAEG;IACH,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,KAAK,OAAO,CAAA;IAEjD;;OAEG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,GAAG,KAAK,GAAG,KAAK,KAAK,OAAO,CAAA;IAEjE;;OAEG;IACH,YAAY,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,KAAK,KAAK,GAAG,IAAI,CAAA;IAE5D;;;OAGG;IACH,UAAU,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,OAAO,CAAA;IAErC;;;OAGG;IACH,WAAW,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,OAAO,CAAA;IAEtC;;;;OAIG;IACH,UAAU,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,OAAO,CAAA;IAErC;;;;OAIG;IACH,SAAS,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,OAAO,CAAA;IAEpC;;OAEG;IACH,OAAO,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,KAAK,IAAI,KAAK,CAAA;IAEvC;;OAEG;IACH,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,SAAS,CAAC,UAAU,EAAE,IAAI,EAAE,SAAS,CAAC,CAAA;IAEhE;;OAEG;IACH,KAAK,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,KAAK,CAAA;IAE9B;;OAEG;IACH,SAAS,EAAE,CACT,KAAK,EAAE,KAAK,EACZ,EAAE,EAAE,SAAS,EACb,OAAO,CAAC,EAAE,qBAAqB,KAC5B,KAAK,GAAG,IAAI,CAAA;CAClB;AAGD,eAAO,MAAM,KAAK,EAAE,cAoJnB,CAAA"}

View File

@@ -0,0 +1,22 @@
export declare type Scrubber = (key: string, value: unknown) => unknown;
export interface ScrubberInterface {
setScrubber(scrubber: Scrubber | undefined): void;
stringify(value: any): string;
}
/**
* This interface implements a stringify() function, which is used by Slate
* internally when generating exceptions containing end user data. Developers
* using Slate may call Scrubber.setScrubber() to alter the behavior of this
* stringify() function.
*
* For example, to prevent the cleartext logging of 'text' fields within Nodes:
*
* import { Scrubber } from 'slate';
* Scrubber.setScrubber((key, val) => {
* if (key === 'text') return '...scrubbed...'
* return val
* });
*
*/
export declare const Scrubber: ScrubberInterface;
//# sourceMappingURL=scrubber.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"scrubber.d.ts","sourceRoot":"","sources":["../packages/slate/src/interfaces/scrubber.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,OAAO,CAAA;AAE/D,MAAM,WAAW,iBAAiB;IAChC,WAAW,CAAC,QAAQ,EAAE,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAA;IACjD,SAAS,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM,CAAA;CAC9B;AAID;;;;;;;;;;;;;;GAcG;AAEH,eAAO,MAAM,QAAQ,EAAE,iBAQtB,CAAA"}

48
server/node_modules/slate/dist/interfaces/text.d.ts generated vendored Normal file
View File

@@ -0,0 +1,48 @@
import { Range } from '..';
import { ExtendedType } from '../types/custom-types';
/**
* `Text` objects represent the nodes that contain the actual text content of a
* Slate document along with any formatting properties. They are always leaf
* nodes in the document tree as they cannot contain any children.
*/
export interface BaseText {
text: string;
}
export declare type Text = ExtendedType<'Text', BaseText>;
export interface TextEqualsOptions {
loose?: boolean;
}
export interface TextInterface {
/**
* Check if two text nodes are equal.
*
* When loose is set, the text is not compared. This is
* used to check whether sibling text nodes can be merged.
*/
equals: (text: Text, another: Text, options?: TextEqualsOptions) => boolean;
/**
* Check if a value implements the `Text` interface.
*/
isText: (value: any) => value is Text;
/**
* Check if a value is a list of `Text` objects.
*/
isTextList: (value: any) => value is Text[];
/**
* Check if some props are a partial of Text.
*/
isTextProps: (props: any) => props is Partial<Text>;
/**
* Check if an text matches set of properties.
*
* Note: this is for matching custom properties, and it does not ensure that
* the `text` property are two nodes equal.
*/
matches: (text: Text, props: Partial<Text>) => boolean;
/**
* Get the leaves for a text node given decorations.
*/
decorations: (node: Text, decorations: Range[]) => Text[];
}
export declare const Text: TextInterface;
//# sourceMappingURL=text.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../packages/slate/src/interfaces/text.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,IAAI,CAAA;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAGpD;;;;GAIG;AAEH,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAA;CACb;AAED,oBAAY,IAAI,GAAG,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;AAEjD,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B;;;;;OAKG;IACH,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,iBAAiB,KAAK,OAAO,CAAA;IAE3E;;OAEG;IACH,MAAM,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,KAAK,IAAI,IAAI,CAAA;IAErC;;OAEG;IACH,UAAU,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,KAAK,IAAI,IAAI,EAAE,CAAA;IAE3C;;OAEG;IACH,WAAW,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IAEnD;;;;;OAKG;IACH,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,OAAO,CAAA;IAEtD;;OAEG;IACH,WAAW,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,IAAI,EAAE,CAAA;CAC1D;AAGD,eAAO,MAAM,IAAI,EAAE,aAkHlB,CAAA"}

View File

@@ -0,0 +1,9 @@
import { Editor, Operation } from '../../index';
export interface GeneralTransforms {
/**
* Transform the editor by an operation.
*/
transform: (editor: Editor, op: Operation) => void;
}
export declare const GeneralTransforms: GeneralTransforms;
//# sourceMappingURL=general.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../packages/slate/src/interfaces/transforms/general.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,MAAM,EAIN,SAAS,EAOV,MAAM,aAAa,CAAA;AAEpB,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,KAAK,IAAI,CAAA;CACnD;AAySD,eAAO,MAAM,iBAAiB,EAAE,iBAmB/B,CAAA"}

View File

@@ -0,0 +1,6 @@
import { GeneralTransforms } from './general';
import { NodeTransforms } from './node';
import { SelectionTransforms } from './selection';
import { TextTransforms } from './text';
export declare const Transforms: GeneralTransforms & NodeTransforms & SelectionTransforms & TextTransforms;
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/slate/src/interfaces/transforms/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAA;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAA;AAEvC,eAAO,MAAM,UAAU,EAAE,iBAAiB,GACxC,cAAc,GACd,mBAAmB,GACnB,cAKD,CAAA"}

View File

@@ -0,0 +1,118 @@
import { Editor, Element, Location, Node, Path } from '../../index';
import { NodeMatch, PropsCompare, PropsMerge } from '../editor';
import { MaximizeMode, RangeMode } from '../../types/types';
export interface NodeInsertNodesOptions<T extends Node> {
at?: Location;
match?: NodeMatch<T>;
mode?: RangeMode;
hanging?: boolean;
select?: boolean;
voids?: boolean;
}
export interface NodeTransforms {
/**
* Insert nodes in the editor
* at the specified location or (if not defined) the current selection or (if not defined) the end of the document.
*/
insertNodes: <T extends Node>(editor: Editor, nodes: Node | Node[], options?: NodeInsertNodesOptions<T>) => void;
/**
* Lift nodes at a specific location upwards in the document tree, splitting
* their parent in two if necessary.
*/
liftNodes: <T extends Node>(editor: Editor, options?: {
at?: Location;
match?: NodeMatch<T>;
mode?: MaximizeMode;
voids?: boolean;
}) => void;
/**
* Merge a node at a location with the previous node of the same depth,
* removing any empty containing nodes after the merge if necessary.
*/
mergeNodes: <T extends Node>(editor: Editor, options?: {
at?: Location;
match?: NodeMatch<T>;
mode?: RangeMode;
hanging?: boolean;
voids?: boolean;
}) => void;
/**
* Move the nodes at a location to a new location.
*/
moveNodes: <T extends Node>(editor: Editor, options: {
at?: Location;
match?: NodeMatch<T>;
mode?: MaximizeMode;
to: Path;
voids?: boolean;
}) => void;
/**
* Remove the nodes at a specific location in the document.
*/
removeNodes: <T extends Node>(editor: Editor, options?: {
at?: Location;
match?: NodeMatch<T>;
mode?: RangeMode;
hanging?: boolean;
voids?: boolean;
}) => void;
/**
* Set new properties on the nodes at a location.
*/
setNodes: <T extends Node>(editor: Editor, props: Partial<T>, options?: {
at?: Location;
match?: NodeMatch<T>;
mode?: MaximizeMode;
hanging?: boolean;
split?: boolean;
voids?: boolean;
compare?: PropsCompare;
merge?: PropsMerge;
}) => void;
/**
* Split the nodes at a specific location.
*/
splitNodes: <T extends Node>(editor: Editor, options?: {
at?: Location;
match?: NodeMatch<T>;
mode?: RangeMode;
always?: boolean;
height?: number;
voids?: boolean;
}) => void;
/**
* Unset properties on the nodes at a location.
*/
unsetNodes: <T extends Node>(editor: Editor, props: string | string[], options?: {
at?: Location;
match?: NodeMatch<T>;
mode?: MaximizeMode;
hanging?: boolean;
split?: boolean;
voids?: boolean;
}) => void;
/**
* Unwrap the nodes at a location from a parent node, splitting the parent if
* necessary to ensure that only the content in the range is unwrapped.
*/
unwrapNodes: <T extends Node>(editor: Editor, options?: {
at?: Location;
match?: NodeMatch<T>;
mode?: MaximizeMode;
split?: boolean;
voids?: boolean;
}) => void;
/**
* Wrap the nodes at a location in a new container node, splitting the edges
* of the range first to ensure that only the content in the range is wrapped.
*/
wrapNodes: <T extends Node>(editor: Editor, element: Element, options?: {
at?: Location;
match?: NodeMatch<T>;
mode?: MaximizeMode;
split?: boolean;
voids?: boolean;
}) => void;
}
export declare const NodeTransforms: NodeTransforms;
//# sourceMappingURL=node.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../packages/slate/src/interfaces/transforms/node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AACnE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAC/D,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAE3D,MAAM,WAAW,sBAAsB,CAAC,CAAC,SAAS,IAAI;IACpD,EAAE,CAAC,EAAE,QAAQ,CAAA;IACb,KAAK,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAA;IACpB,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AAED,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,WAAW,EAAE,CAAC,CAAC,SAAS,IAAI,EAC1B,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,IAAI,GAAG,IAAI,EAAE,EACpB,OAAO,CAAC,EAAE,sBAAsB,CAAC,CAAC,CAAC,KAChC,IAAI,CAAA;IAET;;;OAGG;IACH,SAAS,EAAE,CAAC,CAAC,SAAS,IAAI,EACxB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE;QACR,EAAE,CAAC,EAAE,QAAQ,CAAA;QACb,KAAK,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAA;QACpB,IAAI,CAAC,EAAE,YAAY,CAAA;QACnB,KAAK,CAAC,EAAE,OAAO,CAAA;KAChB,KACE,IAAI,CAAA;IAET;;;OAGG;IACH,UAAU,EAAE,CAAC,CAAC,SAAS,IAAI,EACzB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC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EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE;QACR,EAAE,CAAC,EAAE,QAAQ,CAAA;QACb,KAAK,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAA;QACpB,IAAI,CAAC,EAAE,YAAY,CAAA;QACnB,KAAK,CAAC,EAAE,OAAO,CAAA;QACf,KAAK,CAAC,EAAE,OAAO,CAAA;KAChB,KACE,IAAI,CAAA;CACV;AAGD,eAAO,MAAM,cAAc,EAAE,cA+B5B,CAAA"}

View File

@@ -0,0 +1,42 @@
import { Editor, Location, Point, Range } from '../../index';
import { MoveUnit, SelectionEdge } from '../../types/types';
export interface SelectionCollapseOptions {
edge?: SelectionEdge;
}
export interface SelectionMoveOptions {
distance?: number;
unit?: MoveUnit;
reverse?: boolean;
edge?: SelectionEdge;
}
export interface SelectionSetPointOptions {
edge?: SelectionEdge;
}
export interface SelectionTransforms {
/**
* Collapse the selection.
*/
collapse: (editor: Editor, options?: SelectionCollapseOptions) => void;
/**
* Unset the selection.
*/
deselect: (editor: Editor) => void;
/**
* Move the selection's point forward or backward.
*/
move: (editor: Editor, options?: SelectionMoveOptions) => void;
/**
* Set the selection to a new value.
*/
select: (editor: Editor, target: Location) => void;
/**
* Set new properties on one of the selection's points.
*/
setPoint: (editor: Editor, props: Partial<Point>, options?: SelectionSetPointOptions) => void;
/**
* Set new properties on the selection.
*/
setSelection: (editor: Editor, props: Partial<Range>) => void;
}
export declare const SelectionTransforms: SelectionTransforms;
//# sourceMappingURL=selection.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"selection.d.ts","sourceRoot":"","sources":["../../packages/slate/src/interfaces/transforms/selection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAC5D,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAE3D,MAAM,WAAW,wBAAwB;IACvC,IAAI,CAAC,EAAE,aAAa,CAAA;CACrB;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,CAAC,EAAE,aAAa,CAAA;CACrB;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,CAAC,EAAE,aAAa,CAAA;CACrB;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,wBAAwB,KAAK,IAAI,CAAA;IAEtE;;OAEG;IACH,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IAElC;;OAEG;IACH,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,oBAAoB,KAAK,IAAI,CAAA;IAE9D;;OAEG;IACH,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,KAAK,IAAI,CAAA;IAElD;;OAEG;IACH,QAAQ,EAAE,CACR,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,EACrB,OAAO,CAAC,EAAE,wBAAwB,KAC/B,IAAI,CAAA;IAET;;OAEG;IACH,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,KAAK,IAAI,CAAA;CAC9D;AAGD,eAAO,MAAM,mBAAmB,EAAE,mBAmBjC,CAAA"}

View File

@@ -0,0 +1,37 @@
import { Editor, Location, Node } from '../../index';
import { TextUnit } from '../../types/types';
export interface TextDeleteOptions {
at?: Location;
distance?: number;
unit?: TextUnit;
reverse?: boolean;
hanging?: boolean;
voids?: boolean;
}
export interface TextInsertFragmentOptions {
at?: Location;
hanging?: boolean;
voids?: boolean;
}
export interface TextInsertTextOptions {
at?: Location;
voids?: boolean;
}
export interface TextTransforms {
/**
* Delete content in the editor.
*/
delete: (editor: Editor, options?: TextDeleteOptions) => void;
/**
* Insert a fragment in the editor
* at the specified location or (if not defined) the current selection or (if not defined) the end of the document.
*/
insertFragment: (editor: Editor, fragment: Node[], options?: TextInsertFragmentOptions) => void;
/**
* Insert a string of text in the editor
* at the specified location or (if not defined) the current selection or (if not defined) the end of the document.
*/
insertText: (editor: Editor, text: string, options?: TextInsertTextOptions) => void;
}
export declare const TextTransforms: TextTransforms;
//# sourceMappingURL=text.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../packages/slate/src/interfaces/transforms/text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAA2B,MAAM,aAAa,CAAA;AAC7E,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAG5C,MAAM,WAAW,iBAAiB;IAChC,EAAE,CAAC,EAAE,QAAQ,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AAED,MAAM,WAAW,yBAAyB;IACxC,EAAE,CAAC,EAAE,QAAQ,CAAA;IACb,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AAED,MAAM,WAAW,qBAAqB;IACpC,EAAE,CAAC,EAAE,QAAQ,CAAA;IACb,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AAED,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,KAAK,IAAI,CAAA;IAE7D;;;OAGG;IACH,cAAc,EAAE,CACd,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,IAAI,EAAE,EAChB,OAAO,CAAC,EAAE,yBAAyB,KAChC,IAAI,CAAA;IAET;;;OAGG;IACH,UAAU,EAAE,CACV,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,qBAAqB,KAC5B,IAAI,CAAA;CACV;AAGD,eAAO,MAAM,cAAc,EAAE,cAoD5B,CAAA"}