node_modules ignore

This commit is contained in:
2025-05-08 23:43:47 +02:00
parent e19d52f172
commit 4574544c9f
65041 changed files with 10593536 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
/// <reference types="react" />
import { Editor } from 'slate';
declare type EditorChangeHandler = (editor: Editor) => void;
/**
* A React context for sharing the editor selector context in a way to control rerenders
*/
export declare const SlateSelectorContext: import("react").Context<{
getSlate: () => Editor;
addEventListener: (callback: EditorChangeHandler) => () => void;
}>;
/**
* use redux style selectors to prevent rerendering on every keystroke.
* Bear in mind rerendering can only prevented if the returned value is a value type or for reference types (e.g. objects and arrays) add a custom equality function.
*
* Example:
* ```
* const isSelectionActive = useSlateSelector(editor => Boolean(editor.selection));
* ```
*/
export declare function useSlateSelector<T>(selector: (editor: Editor) => T, equalityFn?: (a: T, b: T) => boolean): T;
/**
* Create selector context with editor updating on every editor change
*/
export declare function useSelectorContext(editor: Editor): {
selectorContext: {
getSlate: () => import("..").ReactEditor;
addEventListener: (callback: EditorChangeHandler) => () => void;
};
onChange: (editor: Editor) => void;
};
export {};
//# sourceMappingURL=use-slate-selector.d.ts.map