@qwanyx/stack 0.2.52 → 0.2.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ImageNode.d.ts +35 -0
- package/dist/index.cjs.js +30 -30
- package/dist/index.esm.js +1569 -1476
- package/package.json +1 -1
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ImageNode for Lexical
|
|
3
|
+
* Allows embedding images in the rich text editor
|
|
4
|
+
*/
|
|
5
|
+
import { DecoratorNode, DOMConversionMap, DOMExportOutput, LexicalNode, NodeKey, SerializedLexicalNode, Spread } from 'lexical';
|
|
6
|
+
export interface ImagePayload {
|
|
7
|
+
src: string;
|
|
8
|
+
altText?: string;
|
|
9
|
+
width?: number;
|
|
10
|
+
height?: number;
|
|
11
|
+
}
|
|
12
|
+
export type SerializedImageNode = Spread<{
|
|
13
|
+
src: string;
|
|
14
|
+
altText?: string;
|
|
15
|
+
width?: number;
|
|
16
|
+
height?: number;
|
|
17
|
+
}, SerializedLexicalNode>;
|
|
18
|
+
export declare class ImageNode extends DecoratorNode<JSX.Element> {
|
|
19
|
+
__src: string;
|
|
20
|
+
__altText: string;
|
|
21
|
+
__width?: number;
|
|
22
|
+
__height?: number;
|
|
23
|
+
static getType(): string;
|
|
24
|
+
static clone(node: ImageNode): ImageNode;
|
|
25
|
+
constructor(src: string, altText?: string, width?: number, height?: number, key?: NodeKey);
|
|
26
|
+
static importJSON(serializedNode: SerializedImageNode): ImageNode;
|
|
27
|
+
exportJSON(): SerializedImageNode;
|
|
28
|
+
static importDOM(): DOMConversionMap | null;
|
|
29
|
+
exportDOM(): DOMExportOutput;
|
|
30
|
+
createDOM(): HTMLElement;
|
|
31
|
+
updateDOM(): false;
|
|
32
|
+
decorate(): JSX.Element;
|
|
33
|
+
}
|
|
34
|
+
export declare function $createImageNode(payload: ImagePayload): ImageNode;
|
|
35
|
+
export declare function $isImageNode(node: LexicalNode | null | undefined): node is ImageNode;
|