import { ReactNode, ReactElement, Dispatch, SetStateAction, MutableRefObject } from 'react'; import { LayoutChangeEvent, TextStyle, ImageProps } from 'react-native'; import type { FastImageProps } from '@d11/react-native-fast-image'; import type { AnyFunc } from './types/common'; export declare const TEXT_STYLE_REGEX: RegExp; export declare const PERCENT_REGEX: RegExp; export declare const URL_REGEX: RegExp; export declare const SVG_REGEXP: RegExp; export declare const BACKGROUND_REGEX: RegExp; export declare const TEXT_PROPS_REGEX: RegExp; export declare const DEFAULT_FONT_SIZE = 16; export declare const HIDDEN_STYLE: { opacity: number; }; export declare const isIOS: boolean; export declare const isAndroid: boolean; export declare const isHarmony: boolean; export declare const extendObject: { (target: T, source: U): T & U; (target: T_1, source1: U_1, source2: V): T_1 & U_1 & V; (target: T_2, source1: U_2, source2: V_1, source3: W): T_2 & U_2 & V_1 & W; (target: object, ...sources: any[]): any; }; export declare function useNavigation(): Record | undefined; export declare function omit(obj: T, fields: K[]): Omit; /** * 用法等同于 useEffect,但是会忽略首次执行,只在依赖更新时执行 */ export declare const useUpdateEffect: (effect: any, deps: any) => void; export declare const parseUrl: (cssUrl?: string) => string | undefined; export declare const getRestProps: (transferProps?: any, originProps?: any, deletePropsKey?: any) => any; export declare function isText(ele: ReactNode): ele is ReactElement; export declare function every(children: ReactNode, callback: (children: ReactNode) => boolean): boolean; type GroupData = Record>; export declare function groupBy>(obj: T, callback: (key: string, val: T[keyof T]) => string, group?: GroupData): GroupData; export declare function splitStyle>(styleObj: T): { textStyle?: Partial; backgroundStyle?: Partial; innerStyle?: Partial; }; export declare function parseValues(str: string, char?: string): string[]; interface TransformStyleConfig { enableVar?: boolean; externalVarContext?: Record; parentFontSize?: number; parentWidth?: number; parentHeight?: number; transformRadiusPercent?: boolean; } export declare function useTransformStyle(styleObj: Record | undefined, { enableVar, transformRadiusPercent, externalVarContext, parentFontSize, parentWidth, parentHeight }: TransformStyleConfig): { hasVarDec: boolean; varContextRef: MutableRefObject<{}>; setWidth: Dispatch>; setHeight: Dispatch>; normalStyle: Record; hasSelfPercent: boolean; hasPositionFixed: boolean; }; export interface VisitorArg { target: Record; key: string; value: any; keyPath: Array; } export declare function traverseStyle(styleObj: Record, visitors: Array<(arg: VisitorArg) => void>): void; export declare function setStyle(styleObj: Record, keyPath: Array, setter: (arg: VisitorArg) => void): void; export declare function splitProps>(props: T): { textProps?: Partial; innerProps?: Partial; }; interface LayoutConfig { props: Record; hasSelfPercent: boolean; setWidth?: Dispatch>; setHeight?: Dispatch>; onLayout?: (event?: LayoutChangeEvent) => void; nodeRef: React.RefObject; } export declare const useLayout: ({ props, hasSelfPercent, setWidth, setHeight, onLayout, nodeRef }: LayoutConfig) => { layoutRef: MutableRefObject<{}>; layoutStyle: {}; layoutProps: Record; }; export interface WrapChildrenConfig { hasVarDec: boolean; varContext?: Record; textStyle?: TextStyle; textProps?: Record; } export declare function wrapChildren(props: Record | undefined, { hasVarDec, varContext, textStyle, textProps }: WrapChildrenConfig): any; export declare const debounce: (func: T, delay: number) => ((...args: Parameters) => void) & { clear: () => void; }; export declare const useDebounceCallback: (func: T, delay: number) => ((...args: Parameters) => void) & { clear: () => void; }; export declare const useStableCallback: (callback: T) => T extends AnyFunc ? T : () => void; export declare function usePrevious(value: T): T | undefined; export interface GestureHandler { nodeRefs?: Array<{ getNodeInstance: () => { nodeRef: unknown; }; }>; current?: unknown; } export declare function flatGesture(gestures?: Array): any[]; export declare function getCurrentPage(pageId: number | null | undefined): any; export declare function renderImage(imageProps: ImageProps | FastImageProps, enableFastImage?: boolean): ReactElement>; export declare function pickStyle(styleObj: Record | undefined, pickedKeys: Array, callback?: (key: string, val: number | string) => number | string): Record; export declare function useHover({ enableHover, hoverStartTime, hoverStayTime, disabled }: { enableHover: boolean; hoverStartTime: number; hoverStayTime: number; disabled?: boolean; }): { isHover: boolean; gesture?: undefined; } | { isHover: boolean; gesture: import("react-native-gesture-handler/lib/typescript/handlers/gestures/panGesture").PanGesture; }; export declare function useRunOnJSCallback(callbackMapRef: MutableRefObject>): (key: string, ...args: any) => any; export {};