Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

NodePos

class NodePos {
constructor(
editor: Editor,
isBlock?: boolean,
node?: Node | null,
);
private currentNode;
private editor;
private isBlock;
private get name();
private resolvedPos;
actualDepth: number | null;
get node(): Node;
get element(): HTMLElement;
get depth(): number;
get pos(): number;
get content(): Fragment;
set content(content: Content);
get attributes(): {
[key: string]: any;
}
;
get textContent(): string;
get size(): number;
get from(): number;
get range(): Range;
get to(): number;
get parent(): NodePos | null;
get before(): NodePos | null;
get after(): NodePos | null;
get children(): NodePos[];
get firstChild(): NodePos | null;
get lastChild(): NodePos | null;
 
closest(selector: string, attributes?: {
[key: string]: any;
}
): NodePos | null;
querySelector(selector: string, attributes?: {
[key: string]: any;
}
): NodePos | null;
querySelectorAll(
selector: string,
attributes?: {
[key: string]: any;
}
,
firstItemOnly?: boolean,
): NodePos[];
setAttribute(attributes: {
[key: string]: any;
}
): void;
}

§Constructors

§
new NodePos(pos: ResolvedPos, editor: Editor, isBlock?: boolean, node?: Node | null)
[src]

§Properties

§
currentNode
[src]
§
editor
[src]
§
isBlock
[src]
§
name private readonly
[src]
§
resolvedPos
[src]
§
actualDepth: number | null
[src]
§
node: Node readonly
[src]
§
element: HTMLElement readonly
[src]
§
depth: number readonly
[src]
§
pos: number readonly
[src]
§
attributes: {
[key: string]: any;
}
readonly
[src]
§
textContent: string readonly
[src]
§
size: number readonly
[src]
§
from: number readonly
[src]
§
range: Range readonly
[src]
§
to: number readonly
[src]
§
parent: NodePos | null readonly
[src]
§
before: NodePos | null readonly
[src]
§
after: NodePos | null readonly
[src]
§
children: NodePos[] readonly
[src]
§
firstChild: NodePos | null readonly
[src]
§
lastChild: NodePos | null readonly
[src]

§Methods

§
closest(selector: string, attributes?: {
[key: string]: any;
}
): NodePos | null
[src]
§
querySelector(selector: string, attributes?: {
[key: string]: any;
}
): NodePos | null
[src]
§
querySelectorAll(selector: string, attributes?: {
[key: string]: any;
}
, firstItemOnly?: boolean): NodePos[]
[src]
§
setAttribute(attributes: {
[key: string]: any;
}
): void
[src]