๐ง Constants โ
โ๏ธ VIEW_KEY โ
Constant | Type |
---|---|
VIEW_KEY | "__Y_MINDMAP_VIEW__" |
โ๏ธ theme โ
Constant | Type |
---|---|
theme | Theme |
๐ญ Schema โ
Methods โ
โ๏ธ registerNode โ
Method | Type |
---|---|
registerNode | (node: NodeType<NodeSpec<any>>) => void |
โ๏ธ parseNode โ
parseNode from xmlElement
Method | Type |
---|---|
parseNode | (xml: YXmlElement<{ [key: string]: string; }> or YXmlText) => Node<any> or null |
โ๏ธ createNode โ
createNode
Method | Type |
---|---|
createNode | (type: string or NodeType<NodeSpec<any>>, attrs: IAttrs, content: INodeContent) => Node<any> |
๐ญ NodeType โ
Methods โ
โ๏ธ setSchema โ
Method | Type |
---|---|
setSchema | (schema: Schema) => void |
โ๏ธ create โ
Method | Type |
---|---|
create | (attrs?: IAttrs, content?: INodeContent, initYFragment?: YXmlElement<{ [key: string]: string; }> or YXmlText or null) => Node<any> |
โ๏ธ parse โ
Method | Type |
---|---|
parse | (xml: YXmlElement<{ [key: string]: string; }> or YXmlText) => Node<any> |
โ๏ธ createNode โ
Method | Type |
---|---|
createNode | <T extends NodeSpec<any>>(options: { name: string; } and T) => NodeType<T> |
๐ญ Node โ
ไธไธชๅบ็ก็node ไฝไธบๅฎไน่ฝฌไธบyjs็ไปฃ็
Methods โ
โ๏ธ appendChild โ
Method | Type |
---|---|
appendChild | (node: Node<any>, reference?: Node<any> or undefined) => void |
โ๏ธ removeChild โ
Method | Type |
---|---|
removeChild | (node: Node<any>) => void |
๐ญ View โ
Methods โ
โ๏ธ pointFromPos โ
Method | Type |
---|---|
pointFromPos | (pos: number, preferBefore: boolean) => { object: UI or null; offset: number; } |
โ๏ธ destroy โ
Method | Type |
---|---|
destroy | () => void |
โ๏ธ nodeAt โ
Method | Type |
---|---|
nodeAt | (node: Node<any>) => View<UI> or undefined |
๐ญ TextView โ
Methods โ
โ๏ธ pointFromPos โ
Method | Type |
---|---|
pointFromPos | (pos: number) => { object: Text or null; offset: number; } |
๐ญ NodeView โ
Methods โ
โ๏ธ createChildView โ
Method | Type |
---|---|
createChildView | (yFragment: YXmlElement<{ [key: string]: string; }> or YXmlText, index?: number) => void |
โ๏ธ removeChildView โ
็งป้คๅญ่็น
Method | Type |
---|---|
removeChildView | (index: number, size: number) => void |
โ๏ธ getMatrix โ
Method | Type |
---|---|
getMatrix | (inner?: boolean or undefined) => Matrix |
๐ญ State โ
Methods โ
โ๏ธ create โ
Method | Type |
---|---|
create | (data: Doc or Uint8Array or undefined, config: Omit<StateConfig, "doc" or "undoManager">) => State |
๐ญ BoardView โ
Methods โ
โ๏ธ setTheme โ
Method | Type |
---|---|
setTheme | (theme: Theme) => void |
โ๏ธ toDataUrl โ
Method | Type |
---|---|
toDataUrl | (type?: "jpg" or "png" or "webp", quality?: number or undefined) => string or Promise<string> |
โ๏ธ toSvg โ
่ฝฌไธบsvg็ๆนๆณ
Method | Type |
---|---|
toSvg | () => string or Promise<any> |
โ๏ธ destroy โ
Method | Type |
---|---|
destroy | () => void |
โ๏ธ create โ
Method | Type |
---|---|
create | (state: State, theme: Theme, options?: ViewOptions or undefined) => BoardView |
๐น Interfaces โ
โ๏ธ NodeSpec โ
Property | Type | Description |
---|---|---|
content | string or undefined | |
group | string or undefined | |
attrs | { [key in keyof K]: IAttrSpec; } or undefined | |
selectable | boolean or undefined | |
draggable | boolean or undefined | |
toCanvas | ((node: Node<K>, context: NodeToCanvasContext) => UI) or undefined |
โ๏ธ ISchemaSpec โ
Property | Type | Description |
---|---|---|
nodes | { [key: string]: NodeType<NodeSpec<any>>; } | |
topNodeType | NodeType<NodeSpec<any>> |
โ๏ธ StateConfig โ
Property | Type | Description |
---|---|---|
schema | Schema | |
doc | Doc | |
undoManager | UndoManager | |
plugins | unknown[] or undefined | |
selected | Node<any>[] or undefined | |
pluginState | Record<string, any> or undefined |
๐ธ Types โ
โ๏ธ NodeToCanvasContext โ
Type | Type |
---|---|
NodeToCanvasContext | `{ |
theme: Theme;
render: Leafer;
}` |
โ๏ธ INodeContent โ
Type | Type |
---|---|
INodeContent | Array<XmlElement or XmlText or Node> or XmlElement or XmlText or string or null |
โ๏ธ ViewOptions โ
Type | Type |
---|---|
ViewOptions | `{ |
width?: number,
height?: number,
debug?: boolean,
container?: any
}` |