@douyinfe/semi-ui
Version:
A modern, comprehensive, flexible design system and UI library. Connect DesignOps & DevOps. Quickly build beautiful React apps. Maintained by Douyin-fe team.
75 lines (74 loc) • 2.89 kB
TypeScript
import React from 'react';
/**
* stop propagation
*
* @param {React.MouseEvent<HTMLElement>} e React mouse event object
* @param {boolean} noImmediate Skip stopping immediate propagation
*/
export declare function stopPropagation(e: React.MouseEvent | React.FocusEvent<HTMLElement>, noImmediate?: boolean): void;
/**
* use in Table, Form, Navigation
*
* skip clone function and react element
*/
export declare function cloneDeep<T>(value: T): T;
export declare function cloneDeep<T>(value: T, customizer: (value: any) => any): any;
/**
* [getHighLightTextHTML description]
*
* @param {string} sourceString [source content text]
* @param {Array<string>} searchWords [keywords to be highlighted]
* @param {object} option
* @param {true} option.highlightTag [The tag wrapped by the highlighted content, mark is used by default]
* @param {true} option.highlightClassName
* @param {true} option.highlightStyle
* @param {boolean} option.caseSensitive
*
* @return {Array<object>}
*/
export declare const getHighLightTextHTML: ({ sourceString, searchWords, option }: GetHighLightTextHTMLProps) => (string | React.ReactElement<{
style: React.CSSProperties;
className: string;
key: string;
}, string | React.JSXElementConstructor<any>>)[];
export interface RegisterMediaQueryOption {
match?: (e: MediaQueryList | MediaQueryListEvent) => void;
unmatch?: (e: MediaQueryList | MediaQueryListEvent) => void;
callInInit?: boolean;
}
/**
* register matchFn and unMatchFn callback while media query
* @param {string} media media string
* @param {object} param param object
* @returns function
*/
export declare const registerMediaQuery: (media: string, { match, unmatch, callInInit }: RegisterMediaQueryOption) => () => void;
export interface GetHighLightTextHTMLProps {
sourceString?: string;
searchWords?: string[];
option: HighLightTextHTMLOption;
}
export interface HighLightTextHTMLOption {
highlightTag?: string;
highlightClassName?: string;
highlightStyle?: React.CSSProperties;
caseSensitive: boolean;
autoEscape: boolean;
}
export interface HighLightTextHTMLChunk {
start?: number;
end?: number;
highlight?: any;
}
/**
* Determine whether the incoming element is a built-in icon
* @param icon 元素
* @returns boolean
*/
export declare const isSemiIcon: (icon: any) => boolean;
export declare function getActiveElement(): HTMLElement | null;
export declare function isNodeContainsFocus(node: HTMLElement): boolean;
export declare function getFocusableElements(node: HTMLElement): HTMLElement[];
export declare function runAfterTicks(func: (...args: any) => any, numberOfTicks: number): Promise<void>;
export declare function getScrollbarWidth(): number;
export declare function getDefaultPropsFromGlobalConfig(componentName: string, semiDefaultProps?: any): any;