Skip to content

๐Ÿงฐ Functions โ€‹

โš™๏ธ string2Yjs โ€‹

FunctionType
string2Yjs(xmlString: string) => Uint8Array

๐Ÿ”— Source

โš™๏ธ yjs2string โ€‹

FunctionType
yjs2string(doc: Doc) => string

๐Ÿ”— Source

โš™๏ธ getDefaultData โ€‹

FunctionType
getDefaultData() => string

๐Ÿ”— Source

โš™๏ธ isMac โ€‹

ๅˆคๆ–ญๆ˜ฏๅฆๆ˜ฏmac็Žฏๅขƒ

FunctionType
isMac() => boolean

๐Ÿ”— Source

โš™๏ธ isWin โ€‹

FunctionType
isWin() => boolean

๐Ÿ”— Source

โš™๏ธ getPadding โ€‹

FunctionType
getPadding(value: IFourNumber) => [number, number, number, number]

๐Ÿ”— Source

โš™๏ธ keydownHandler โ€‹

FunctionType
keydownHandler(bindings: { [key: string]: Command; }, board: Board<any>) => (event: IKeyEvent) => boolean

๐Ÿ”— Source

โš™๏ธ registerTextEditor โ€‹

ๆ™ฎ้€š็š„ๆ–‡ๆœฌ็ผ–่พ‘ๅ™จ

FunctionType
registerTextEditor(editor: Editor, leafer: ILeafer) => void

๐Ÿ”— Source

๐Ÿ”ง Constants โ€‹

โš™๏ธ VIEW_KEY โ€‹

ConstantType
VIEW_KEY"__Y_MINDMAP_VIEW__"

๐Ÿ”— Source

โš™๏ธ theme โ€‹

ConstantType
themeTheme

๐Ÿ”— Source

โš™๏ธ attrList โ€‹

ConstantType
attrListEditorAttrs[]

๐Ÿ”— Source

๐Ÿญ Schema โ€‹

๐Ÿ”— Source

Methods โ€‹

โš™๏ธ registerNode โ€‹

MethodType
registerNode(node: NodeType<NodeSpec<any>>) => void

๐Ÿ”— Source

โš™๏ธ parseNode โ€‹

parseNode from xmlElement

MethodType
parseNode(xml: YXmlElement<{ [key: string]: string; }> or YXmlText) => Node<any> or null

๐Ÿ”— Source

โš™๏ธ createNode โ€‹

createNode

MethodType
createNode(type: string or NodeType<NodeSpec<any>>, attrs: IAttrs, content: INodeContent) => Node<any>

๐Ÿ”— Source

๐Ÿญ NodeType โ€‹

๐Ÿ”— Source

Methods โ€‹

โš™๏ธ setSchema โ€‹

MethodType
setSchema(schema: Schema) => void

๐Ÿ”— Source

โš™๏ธ create โ€‹

MethodType
create(attrs?: IAttrs, content?: INodeContent, initYFragment?: YXmlElement<{ [key: string]: string; }> or YXmlText or null) => Node<any>

๐Ÿ”— Source

โš™๏ธ parse โ€‹

MethodType
parse(xml: YXmlElement<{ [key: string]: string; }> or YXmlText) => Node<any>

๐Ÿ”— Source

โš™๏ธ createNode โ€‹

MethodType
createNode<T extends NodeSpec<any>>(options: { name: string; } and T) => NodeType<T>

๐Ÿ”— Source

๐Ÿญ Node โ€‹

ไธ€ไธชๅŸบ็ก€็š„node ไฝœไธบๅฎšไน‰่ฝฌไธบyjs็š„ไปฃ็†

๐Ÿ”— Source

Methods โ€‹

โš™๏ธ appendChild โ€‹

MethodType
appendChild(node: Node<any>, reference?: Node<any> or undefined) => void

๐Ÿ”— Source

โš™๏ธ removeChild โ€‹

MethodType
removeChild(node: Node<any>) => void

๐Ÿ”— Source

๐Ÿญ State โ€‹

๐Ÿ”— Source

Methods โ€‹

โš™๏ธ create โ€‹

MethodType
create(data: Doc or Uint8Array or undefined, config: Omit<StateConfig, "doc" or "undoManager">) => State

๐Ÿ”— Source

๐Ÿญ View โ€‹

๐Ÿ”— Source

Methods โ€‹

โš™๏ธ pointFromPos โ€‹

MethodType
pointFromPos(pos: number, preferBefore: boolean) => { object: UI or null; offset: number; }

๐Ÿ”— Source

โš™๏ธ destroy โ€‹

MethodType
destroy() => void

๐Ÿ”— Source

โš™๏ธ nodeAt โ€‹

MethodType
nodeAt(node: Node<any>) => View<UI> or undefined

๐Ÿ”— Source

๐Ÿญ TextView โ€‹

๐Ÿ”— Source

Methods โ€‹

โš™๏ธ pointFromPos โ€‹

MethodType
pointFromPos(pos: number) => { object: Text or null; offset: number; }

๐Ÿ”— Source

๐Ÿญ NodeView โ€‹

๐Ÿ”— Source

Methods โ€‹

โš™๏ธ createChildView โ€‹

MethodType
createChildView(yFragment: YXmlElement<{ [key: string]: string; }> or YXmlText, index?: number) => void

๐Ÿ”— Source

โš™๏ธ removeChildView โ€‹

็งป้™คๅญ่Š‚็‚น

MethodType
removeChildView(index: number, size: number) => void

๐Ÿ”— Source

โš™๏ธ getMatrix โ€‹

MethodType
getMatrix(inner?: boolean or undefined) => Matrix

๐Ÿ”— Source

๐Ÿญ BoardView โ€‹

๐Ÿ”— Source

Methods โ€‹

โš™๏ธ setTheme โ€‹

MethodType
setTheme(theme: Theme) => void

๐Ÿ”— Source

โš™๏ธ toDataUrl โ€‹

MethodType
toDataUrl(type?: "jpg" or "png" or "webp", quality?: number or undefined) => string or Promise<string>

๐Ÿ”— Source

โš™๏ธ toSvg โ€‹

่ฝฌไธบsvg็š„ๆ–นๆณ•

MethodType
toSvg() => string or Promise<any>

๐Ÿ”— Source

โš™๏ธ destroy โ€‹

MethodType
destroy() => void

๐Ÿ”— Source

โš™๏ธ create โ€‹

MethodType
create(state: State, theme: Theme, options?: ViewOptions or undefined) => BoardView

๐Ÿ”— Source

๐Ÿญ CommandManager โ€‹

๐Ÿ”— Source

Methods โ€‹

โš™๏ธ registerCommands โ€‹

MethodType
registerCommands(rawCommands: RawCommands) => void

๐Ÿ”— Source

๐Ÿญ Extension โ€‹

๐Ÿ”— Source

Methods โ€‹

โš™๏ธ create โ€‹

MethodType
create(options: IExtensionOptions, boardOptions: Record<string, any>) => Extension<Record<string, any>, Record<string, any>>

๐Ÿ”— Source

๐Ÿญ ExtensionManager โ€‹

๐Ÿ”— Source

Methods โ€‹

โš™๏ธ invokeUpdate โ€‹

MethodType
invokeUpdate() => void

๐Ÿ”— Source

โš™๏ธ invokeCreate โ€‹

MethodType
invokeCreate() => void

๐Ÿ”— Source

โš™๏ธ invokeDestroy โ€‹

MethodType
invokeDestroy() => void

๐Ÿ”— Source

โš™๏ธ registerExtension โ€‹

MethodType
registerExtension(extensions: Record<string, IExtensionConfig<any, any>>, defaultOptions: Record<string, any>) => void

๐Ÿ”— Source

๐Ÿญ Board โ€‹

๐Ÿ”— Source

Methods โ€‹

โš™๏ธ init โ€‹

MethodType
init(data?: string or Doc or Uint8Array or undefined) => void

๐Ÿ”— Source

โš™๏ธ undo โ€‹

MethodType
undo() => void

๐Ÿ”— Source

โš™๏ธ redo โ€‹

MethodType
redo() => void

๐Ÿ”— Source

โš™๏ธ toDataUrl โ€‹

MethodType
toDataUrl(type?: "jpg" or "png" or "webp", quality?: number or undefined) => string or Promise<string>

๐Ÿ”— Source

โš™๏ธ toSvg โ€‹

่ฝฌไธบsvg็š„ๆ–นๆณ•

MethodType
toSvg() => string or Promise<any> or null

๐Ÿ”— Source

โš™๏ธ getData โ€‹

MethodType
getData() => string

๐Ÿ”— Source

โš™๏ธ toString โ€‹

MethodType
toString() => string

๐Ÿ”— Source

โš™๏ธ destroy โ€‹

้”€ๆฏ็š„ๅŠžๆณ•

MethodType
destroy() => void

๐Ÿ”— Source

๐Ÿญ TextEditor โ€‹

๐Ÿ”— Source

Methods โ€‹

โš™๏ธ calculateDomStyle โ€‹

MethodType
calculateDomStyle() => void

๐Ÿ”— Source

โš™๏ธ destroy โ€‹

MethodType
destroy() => void

๐Ÿ”— Source

๐Ÿญ Mindmap โ€‹

็ฝ‘้กต็‰ˆ็š„mindmap ๆ”ฏๆŒไบ‹ไปถไธŠ็š„็ผฉๆ”พ๏ผŒๅขžๅŠ ไบ‹ไปถๅ›ž่ฐƒ ๅŒๆ—ถๅฆ‚ๆžœ่Žทๅ–ไบ†canvas็š„dom๏ผŒๅฐฑ้œ€่ฆๅˆๅง‹ๅŒ–ไธ€ไธชquill editor

๐Ÿ”— Source

Methods โ€‹

โš™๏ธ init โ€‹

MethodType
init(data: any) => void

๐Ÿ”— Source

โš™๏ธ initEditor โ€‹

MethodType
initEditor() => void

๐Ÿ”— Source

โš™๏ธ setEditable โ€‹

MethodType
setEditable(value?: boolean) => void

๐Ÿ”— Source

โš™๏ธ destroy โ€‹

้”€ๆฏ็š„ๅŠžๆณ•

MethodType
destroy() => void

๐Ÿ”— Source

๐Ÿน Interfaces โ€‹

โš™๏ธ NodeSpec โ€‹

PropertyTypeDescription
contentstring or undefined
groupstring or undefined
attrs{ [key in keyof K]: IAttrSpec; } or undefined
selectableboolean or undefined
draggableboolean or undefined
toCanvas((node: Node<K>, context: NodeToCanvasContext) => UI) or undefined

โš™๏ธ ISchemaSpec โ€‹

PropertyTypeDescription
nodes{ [key: string]: NodeType<NodeSpec<any>>; }
topNodeTypeNodeType<NodeSpec<any>>

โš™๏ธ StateConfig โ€‹

PropertyTypeDescription
schemaSchema
docDoc
undoManagerUndoManager
pluginsunknown[] or undefined
selectedNode<any>[] or undefined
pluginStateRecord<string, any> or undefined

โš™๏ธ IExtensionConfig โ€‹

PropertyTypeDescription
addCommands((this: Extension<IOptions, IStorage>, extension: Extension<IOptions, IStorage>) => RawCommands) or undefined
addNodes((this: Board<any>) => Record<string, NodeType<NodeSpec<any>>>) or undefined
addOptions((this: Extension<IOptions, IStorage>) => IOptions) or undefined
addStorage((this: Extension<IOptions, IStorage>) => IStorage) or undefined
addKeymap((this: Extension<IOptions, IStorage>) => Record<string, Command>) or undefined
onBeforeCreate((this: Extension<IOptions, IStorage>, board: Board<any>) => void) or undefined
onCreate((this: Extension<IOptions, IStorage>, board: Board<any>) => void) or undefined
onDestroy((this: Extension<IOptions, IStorage>, board: Board<any>) => void) or undefined
onUpdate((this: Extension<IOptions, IStorage>, board: Board<any>) => void) or undefined

๐Ÿธ Types โ€‹

โš™๏ธ NodeToCanvasContext โ€‹

TypeType
NodeToCanvasContext`{
theme: Theme;
render: Leafer;

}` |

๐Ÿ”— Source

โš™๏ธ INodeContent โ€‹

TypeType
INodeContentArray<XmlElement or XmlText or Node> or XmlElement or XmlText or string or null

๐Ÿ”— Source

โš™๏ธ ViewOptions โ€‹

TypeType
ViewOptions`{
width?: number,
height?: number,
debug?: boolean,
container?: any

}` |

๐Ÿ”— Source

โš™๏ธ IExtensionOptions โ€‹

TypeType
IExtensionOptions`IExtensionConfig and {
name: string,
board: Board

}` |

๐Ÿ”— Source

โš™๏ธ Options โ€‹

TypeType
Options`{
data?: string or Uint8Array;
width?: number;
height?: number;
theme?: string;
themeList?: { [key: string]: Theme };
options?: Record<string, any>;
extensions?: Record<string, IExtensionConfig>
container?: any

} and { schema?: Schema; debug?: boolean; }` |

๐Ÿ”— Source