lexical 0.1.21 → 0.2.0

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/Lexical.d.ts CHANGED
@@ -551,104 +551,6 @@ export function $getPreviousSelection():
551
551
  | NodeSelection
552
552
  | GridSelection;
553
553
 
554
- /**
555
- * Decorator State
556
- */
557
- export type DecoratorStateValue =
558
- | DecoratorMap
559
- | DecoratorEditor
560
- | DecoratorArray
561
- | null
562
- | boolean
563
- | number
564
- | string;
565
- export declare class DecoratorEditor {
566
- id: string;
567
- editorState: null | EditorState | string;
568
- editor: null | LexicalEditor;
569
- constructor(id?: string, editorState?: string | EditorState);
570
- init(editor: LexicalEditor): void;
571
- set(editor: LexicalEditor): void;
572
- toJSON(): $ReadOnly<{
573
- id: string;
574
- type: 'editor';
575
- editorState: null | string;
576
- }>;
577
- isEmpty(): boolean;
578
- }
579
- export type DecoratorMapObserver = (
580
- key: string,
581
- value: DecoratorStateValue,
582
- ) => void;
583
- export type DecoratorArrayObserver = (
584
- index: number,
585
- delCont: number,
586
- value: void | DecoratorStateValue,
587
- ) => void;
588
- export declare class DecoratorMap {
589
- _editor: LexicalEditor;
590
- _map: Map<string, DecoratorStateValue>;
591
- constructor(editor: LexicalEditor, map?: Map<string, DecoratorStateValue>);
592
- get(key: string): void | DecoratorStateValue;
593
- has(key: string): boolean;
594
- set(key: string, value: DecoratorStateValue): void;
595
- observe(observer: DecoratorMapObserver): () => void;
596
- destroy(): void;
597
- toJSON(): {
598
- type: 'map';
599
- map: Array<[string, DecoratorStateValue]>;
600
- };
601
- }
602
- export function createDecoratorEditor(
603
- id?: string,
604
- editorState?: string | EditorState,
605
- ): DecoratorEditor;
606
- export function isDecoratorEditor(obj: unknown | null | undefined): boolean;
607
- export function createDecoratorMap(
608
- editor: LexicalEditor,
609
- map?: Map<string, DecoratorStateValue>,
610
- ): DecoratorMap;
611
- export function isDecoratorMap(obj: unknown | null | undefined): boolean;
612
- export declare class DecoratorArray {
613
- _editor: LexicalEditor;
614
- _observers: Set<DecoratorArrayObserver>;
615
- _array: Array<DecoratorStateValue>;
616
- constructor(editor: LexicalEditor, array?: Array<DecoratorStateValue>);
617
- observe(observer: DecoratorArrayObserver): () => void;
618
- map<V>(
619
- fn: (
620
- arg0: DecoratorStateValue,
621
- arg1: number,
622
- arg2: Array<DecoratorStateValue>,
623
- ) => V,
624
- ): Array<V>;
625
- reduce(
626
- fn: (
627
- arg0: DecoratorStateValue,
628
- arg1: DecoratorStateValue,
629
- ) => DecoratorStateValue,
630
- initial?: DecoratorStateValue,
631
- ): DecoratorStateValue | void;
632
- push(value: DecoratorStateValue): void;
633
- getLength(): number;
634
- splice(
635
- insertIndex: number,
636
- delCount: number,
637
- value?: DecoratorStateValue,
638
- ): void;
639
- indexOf(value: DecoratorStateValue): number;
640
- destroy(): void;
641
- toJSON(): {
642
- type: 'array';
643
- array: Array<DecoratorStateValue>;
644
- };
645
- }
646
- export function createDecoratorArray(
647
- editor: LexicalEditor,
648
- list?: Array<DecoratorStateValue>,
649
- ): DecoratorArray;
650
- export function isDecoratorArray(x?: unknown): boolean;
651
-
652
554
  /**
653
555
  * LexicalTextNode
654
556
  */
@@ -811,8 +713,7 @@ export function $isElementNode(node: LexicalNode | null | undefined): boolean;
811
713
  * LexicalDecoratorNode
812
714
  */
813
715
  export declare class DecoratorNode<X> extends LexicalNode {
814
- __state: DecoratorMap;
815
- constructor(state?: DecoratorMap, key?: NodeKey);
716
+ constructor(key?: NodeKey);
816
717
  decorate(editor: LexicalEditor): X;
817
718
  isIsolated(): boolean;
818
719
  }