lexical-remark
Version:
This package contains Markdown helpers and functionality for Lexical using remark-parse.
38 lines (37 loc) • 1.61 kB
TypeScript
/// <reference types="react" />
import lexicalDecoratorBlockNode, { type SerializedDecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js';
import type { DOMConversionMap, DOMExportOutput, EditorConfig, ElementFormatType, LexicalEditor, LexicalNode, NodeKey, Spread } from 'lexical';
export type SerializedYouTubeNode = Spread<{
videoID: string;
}, SerializedDecoratorBlockNode>;
/**
* A Lexical node to represent an embedded YouTube video
*/
export declare class YouTubeNode extends lexicalDecoratorBlockNode.DecoratorBlockNode {
__id: string;
static getType(): string;
static clone(node: YouTubeNode): YouTubeNode;
static importJSON(serializedNode: SerializedYouTubeNode): YouTubeNode;
exportJSON(): SerializedYouTubeNode;
constructor(id: string, format?: ElementFormatType, key?: NodeKey);
exportDOM(): DOMExportOutput;
static importDOM(): DOMConversionMap | null;
updateDOM(): false;
getId(): string;
getTextContent(_includeInert?: boolean | undefined, _includeDirectionless?: false | undefined): string;
decorate(_editor: LexicalEditor, config: EditorConfig): JSX.Element;
}
/**
* Creates a YouTube node from a video id
*
* @param videoID The YouTube video id
* @returns A YouTube node
*/
export declare function $createYouTubeNode(videoID: string): YouTubeNode;
/**
* A typeguard function to assert on a YouTube node
*
* @param node A Lexical node
* @returns true if the node is a YouTube node, otherwise false
*/
export declare function $isYouTubeNode(node: YouTubeNode | LexicalNode | null | undefined): node is YouTubeNode;