import * as react_jsx_runtime from 'react/jsx-runtime'; import * as react from 'react'; import { ImageProps, ViewProps, ButtonProps, TextProps } from '@tarojs/components'; import { ShareAppMessageReturnObject } from '@tarojs/taro'; interface MinDebuggerOptions { className?: string; /** for custom header of the status tab */ StatusHeader?: React.FC; /** for custom footer of the status tab */ StatusFooter?: React.FC; /** for custom 2nd button in bottom of the status tab */ StatusButton?: React.FC; } interface MinDebuggerProps { options?: MinDebuggerOptions; onMove?(e: { x: number; y: number; }): void; } /** * use MinDebugger in hooks way. * * Only need to import once in the miniapp entry `app.ts`, it can be applied to all pages. */ declare function useMinDebugger(options?: MinDebuggerOptions): void; declare function Debugger({ onMove, options }: MinDebuggerProps): react_jsx_runtime.JSX.Element; declare namespace Debugger { var displayName: string; } declare const MinDebugger: typeof Debugger & { use: typeof useMinDebugger; }; type SwipeDirection = 'left' | 'right' | 'up' | 'down'; interface ISwipeEvent { horizontal?: boolean; direction: SwipeDirection; distance: number; } type EventHandler = (e: T) => void; interface GestureProps { children: React.ReactElement; onSwipe?: EventHandler; } declare function Gesture({ children, onSwipe }: GestureProps): react.ReactElement>; declare namespace Gesture { var displayName: string; } interface MinIconProps extends Omit { name: string; /** `size` or `[width, height]` @default 16 */ size?: number | number[]; style?: React.CSSProperties; } declare function MinIcon({ name, size, ...props }: MinIconProps): react_jsx_runtime.JSX.Element; declare namespace MinIcon { var displayName: string; var Font: typeof IconFont; var configs: Record; var load: (icons: Record) => void; } interface MinIconFontProps extends Omit { name: string; } declare function IconFont({ name, className, ...props }: MinIconFontProps): react_jsx_runtime.JSX.Element; declare namespace IconFont { var displayName: string; } interface MinImageProps extends Omit { /** * - `true`: enable preview * - `string[]`: preview multiple images */ preview?: boolean | string[]; } /** * Enhanced Image component * * Features: * - enable `lazyLoad` as default * - support `previewImage` when click * - add loading style * - add error style * * @see https://developers.weixin.qq.com/miniprogram/dev/component/image.html */ declare function MinImage({ preview, ...props }: MinImageProps): react_jsx_runtime.JSX.Element; declare namespace MinImage { var displayName: string; } type UnmountPortal = { (): boolean; id: string; }; /** * mount Portal on current page instance * @throws if not found page instance */ declare function mountPortal(Component: React.FC, props?: T, displayName?: string): UnmountPortal; declare namespace IModal { type Props = { className?: string; children?: React.ReactNode; onOk?(e: TOk): void; onCancel?(e: TCancel): void; } & OwnProps; type Result = { ok: true; detail: TOk; } | { ok: false; detail: TCancel | 'backdrop' | 'unmount'; }; interface Task extends Promise> { unmount: UnmountPortal; } interface DrawerProps { className?: string; /** 弹出位置 @default 'center' */ position?: 'center' | 'top' | 'bottom'; zIndex?: number; /** 动画时长,单位毫秒 @default 300 */ duration?: number; children?: React.ReactNode; /** 点击背景关闭 @default false */ backdropCloseable?: boolean; /** * X轴偏移量 相对`position`方向 * @default 0 */ offsetX?: number; /*** * Y轴偏移量 相对`position`方向 * * 默认值见配置 {@link Modal.defaults.offsetY} */ offsetY?: number; /** 点击背景关闭事件 */ onClose?(): void; } type ContainerProps = Pick & { /** Specify className of the container (Drawer) */ containerClass?: string; }; interface ConfirmProps { icon?: React.ReactNode; title?: React.ReactNode; subtitle?: React.ReactNode; okText: React.ReactNode; cancelText?: React.ReactNode; buttonInline?: boolean; footer?: React.ReactNode; /** @default true */ divider?: boolean; /** @default true when unset `cancelText` either */ closeable?: boolean; userSelect?: boolean; } } declare function Drawer({ className, position, backdropCloseable, zIndex, duration, offsetX, offsetY, children, onClose, }: IModal.DrawerProps): react_jsx_runtime.JSX.Element; declare namespace Drawer { var defaults: { offsetY: { center: number; top: number; bottom: number; }; }; var displayName: string; } type WithOpenProps = IModal.ContainerProps & T; type OpenProps = Omit, 'onOk' | 'onCancel'>; declare function withOpen>(displayName: string, Component: React.FC, defaultProps?: IModal.ContainerProps): (props?: OpenProps) => IModal.Task; declare const Modal: typeof Drawer & { with: typeof withOpen; confirm: (props?: { className?: string | undefined; children?: react.ReactNode; position?: "center" | "top" | "bottom" | undefined; footer?: react.ReactNode; title?: react.ReactNode; icon?: react.ReactNode; userSelect?: boolean | undefined; backdropCloseable?: boolean | undefined; zIndex?: number | undefined; duration?: number | undefined; offsetX?: number | undefined; offsetY?: number | undefined; containerClass?: string | undefined; subtitle?: react.ReactNode; okText: react.ReactNode; cancelText?: react.ReactNode; buttonInline?: boolean | undefined; divider?: boolean | undefined; closeable?: boolean | undefined; }) => IModal.Task; }; type ReactProps = { className?: string; style?: React.CSSProperties; children?: React.ReactNode; } & T; interface MinNavigationBarProps extends ReactProps { title?: React.ReactNode; } declare function MinNavigationBar({ className, children, title }: MinNavigationBarProps): react_jsx_runtime.JSX.Element; declare namespace MinNavigationBar { var displayName: string; var rect: { height: number; width: number; top: number; bottom: number; }; } declare namespace IMinShare { type Message = ShareAppMessageReturnObject; interface ShareMessage { message?: Message; } interface ShareMenu extends ShareMessage { /** 分享朋友圈内容 默认同`message` */ timeline?: Omit & { query?: string; }; /** 菜单 发送给朋友 */ onShareAppMessage?(): void; /** 菜单 分享到朋友圈 */ onShareTimeline?(): void; } interface ShareButtonProps extends Omit, ShareMessage { onShare?(): void; } } declare function ShareButton({ onShare, ...props }: IMinShare.ShareButtonProps): react_jsx_runtime.JSX.Element; /** * 分享Hook * * ***仅在页面级组件中使用*** * * 按需添加页面分享相关配置: * ```ts * { * enableShareAppMessage: true, // 启用分享给好友 * enableShareTimeline: true, // 启用分享到朋友圈 * } * ``` */ declare function useShareMessage(menu?: IMinShare.ShareMenu): void; interface MinTextProps extends TextProps { } declare function MinText({ decode, space, children, ...props }: MinTextProps): react_jsx_runtime.JSX.Element; declare function renderText(text?: React.ReactNode, props?: Omit): react_jsx_runtime.JSX.Element; export { Gesture, type GestureProps, IMinShare, IModal, type ISwipeEvent, MinDebugger, type MinDebuggerOptions, type MinDebuggerProps, MinIcon, type MinIconProps, MinImage, type MinImageProps, MinNavigationBar, type MinNavigationBarProps, MinText, type MinTextProps, Modal, type ReactProps, ShareButton, type UnmountPortal, mountPortal, renderText, useShareMessage };