matrix-react-sdk
Version:
SDK for matrix.org using React
23 lines (22 loc) • 938 B
TypeScript
export declare function copyPlaintext(text: string): Promise<boolean>;
export declare function selectText(target: Element): void;
/**
* Copy rich text to user's clipboard
* It will overwrite user's selection range
* In certain browsers it may only work if triggered by a user action or may ask user for permissions
* @param ref pointer to the node to copy
*/
export declare function copyNode(ref?: Element | null): boolean;
/**
* Returns text which has been selected by the user
* @returns the selected text
*/
export declare function getSelectedText(): string;
export declare const graphemeSegmenter: Intl.Segmenter;
/**
* Returns the first grapheme in the given string,
* especially useful for strings containing emoji, will not break compound emoji up.
* @param str string to parse
* @returns the first grapheme or an empty string if given an empty string
*/
export declare function getFirstGrapheme(str: string): string;