@yuntijs/ui
Version:
☁️ Yunti UI - an open-source UI component library for building Cloud Native web apps
21 lines (20 loc) • 1.05 kB
TypeScript
import type { MenuTextMatch } from '@lexical/react/LexicalTypeaheadMenuPlugin';
import type { LexicalCommand } from 'lexical';
import type { Dispatch, RefObject, SetStateAction } from 'react';
export type UseSelectOrDeleteHanlder = (nodeKey: string, command: LexicalCommand<undefined>) => [RefObject<HTMLDivElement | null>, boolean];
export declare const useSelectOrDelete: UseSelectOrDeleteHanlder;
export type UseTriggerHandler = () => [
RefObject<HTMLDivElement | null>,
boolean,
Dispatch<SetStateAction<boolean>>
];
export declare const useTrigger: UseTriggerHandler;
export declare function checkForMentions(text: string, triggers: string[], preTriggerChars: string, punctuation: string, allowSpaces: boolean): MenuTextMatch | null;
export declare const useCheckForMentionMatch: (triggers: string[], { punctuation, preTriggerChars, allowSpaces, }: {
punctuation: string;
preTriggerChars: string;
allowSpaces: boolean;
}) => {
trigger: string | null;
checkForMentionMatch: (text: string) => MenuTextMatch | null;
};