Comparing version 0.1.21 to 0.2.0
101
Lexical.d.ts
@@ -555,100 +555,2 @@ /** | ||
/** | ||
* Decorator State | ||
*/ | ||
export type DecoratorStateValue = | ||
| DecoratorMap | ||
| DecoratorEditor | ||
| DecoratorArray | ||
| null | ||
| boolean | ||
| number | ||
| string; | ||
export declare class DecoratorEditor { | ||
id: string; | ||
editorState: null | EditorState | string; | ||
editor: null | LexicalEditor; | ||
constructor(id?: string, editorState?: string | EditorState); | ||
init(editor: LexicalEditor): void; | ||
set(editor: LexicalEditor): void; | ||
toJSON(): $ReadOnly<{ | ||
id: string; | ||
type: 'editor'; | ||
editorState: null | string; | ||
}>; | ||
isEmpty(): boolean; | ||
} | ||
export type DecoratorMapObserver = ( | ||
key: string, | ||
value: DecoratorStateValue, | ||
) => void; | ||
export type DecoratorArrayObserver = ( | ||
index: number, | ||
delCont: number, | ||
value: void | DecoratorStateValue, | ||
) => void; | ||
export declare class DecoratorMap { | ||
_editor: LexicalEditor; | ||
_map: Map<string, DecoratorStateValue>; | ||
constructor(editor: LexicalEditor, map?: Map<string, DecoratorStateValue>); | ||
get(key: string): void | DecoratorStateValue; | ||
has(key: string): boolean; | ||
set(key: string, value: DecoratorStateValue): void; | ||
observe(observer: DecoratorMapObserver): () => void; | ||
destroy(): void; | ||
toJSON(): { | ||
type: 'map'; | ||
map: Array<[string, DecoratorStateValue]>; | ||
}; | ||
} | ||
export function createDecoratorEditor( | ||
id?: string, | ||
editorState?: string | EditorState, | ||
): DecoratorEditor; | ||
export function isDecoratorEditor(obj: unknown | null | undefined): boolean; | ||
export function createDecoratorMap( | ||
editor: LexicalEditor, | ||
map?: Map<string, DecoratorStateValue>, | ||
): DecoratorMap; | ||
export function isDecoratorMap(obj: unknown | null | undefined): boolean; | ||
export declare class DecoratorArray { | ||
_editor: LexicalEditor; | ||
_observers: Set<DecoratorArrayObserver>; | ||
_array: Array<DecoratorStateValue>; | ||
constructor(editor: LexicalEditor, array?: Array<DecoratorStateValue>); | ||
observe(observer: DecoratorArrayObserver): () => void; | ||
map<V>( | ||
fn: ( | ||
arg0: DecoratorStateValue, | ||
arg1: number, | ||
arg2: Array<DecoratorStateValue>, | ||
) => V, | ||
): Array<V>; | ||
reduce( | ||
fn: ( | ||
arg0: DecoratorStateValue, | ||
arg1: DecoratorStateValue, | ||
) => DecoratorStateValue, | ||
initial?: DecoratorStateValue, | ||
): DecoratorStateValue | void; | ||
push(value: DecoratorStateValue): void; | ||
getLength(): number; | ||
splice( | ||
insertIndex: number, | ||
delCount: number, | ||
value?: DecoratorStateValue, | ||
): void; | ||
indexOf(value: DecoratorStateValue): number; | ||
destroy(): void; | ||
toJSON(): { | ||
type: 'array'; | ||
array: Array<DecoratorStateValue>; | ||
}; | ||
} | ||
export function createDecoratorArray( | ||
editor: LexicalEditor, | ||
list?: Array<DecoratorStateValue>, | ||
): DecoratorArray; | ||
export function isDecoratorArray(x?: unknown): boolean; | ||
/** | ||
* LexicalTextNode | ||
@@ -815,4 +717,3 @@ */ | ||
export declare class DecoratorNode<X> extends LexicalNode { | ||
__state: DecoratorMap; | ||
constructor(state?: DecoratorMap, key?: NodeKey); | ||
constructor(key?: NodeKey); | ||
decorate(editor: LexicalEditor): X; | ||
@@ -819,0 +720,0 @@ isIsolated(): boolean; |
@@ -12,3 +12,3 @@ { | ||
"license": "MIT", | ||
"version": "0.1.21", | ||
"version": "0.2.0", | ||
"main": "Lexical.js", | ||
@@ -15,0 +15,0 @@ "typings": "Lexical.d.ts", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
374072
7859