sard-uniapp
Version:
sard-uniapp 是一套基于 Uniapp + Vue3 框架开发的兼容多端的 UI 组件库
472 lines (471 loc) • 17.1 kB
TypeScript
import { type TransitionHookCallbacks } from '../popup/common';
import { type ToastEmits, type ToastProps } from '../toast/common';
export interface ToastAgentProps extends ToastProps, TransitionHookCallbacks {
id?: string;
}
export declare const defaultToastAgentProps: () => {
id?: (string | ((props: {
id: string;
rootStyle: import("vue").StyleValue;
rootClass: string;
type: "text" | "loading" | "success" | "fail";
title: string | number;
visible: boolean;
position: "top" | "center" | "bottom";
overlay: boolean;
transparent: boolean;
timeout: number;
duration: number;
onVisibleHook: (name: import("../../use").TransitionHookName) => void;
onBeforeEnter: () => void;
onEnter: () => void;
onAfterEnter: () => void;
onEnterCancelled: () => void;
onBeforeLeave: () => void;
onLeave: () => void;
onAfterLeave: () => void;
onLeaveCancelled: () => void;
}) => string)) | undefined;
rootStyle?: string | false | ((props: {
id: string;
rootStyle: import("vue").StyleValue;
rootClass: string;
type: "text" | "loading" | "success" | "fail";
title: string | number;
visible: boolean;
position: "top" | "center" | "bottom";
overlay: boolean;
transparent: boolean;
timeout: number;
duration: number;
onVisibleHook: (name: import("../../use").TransitionHookName) => void;
onBeforeEnter: () => void;
onEnter: () => void;
onAfterEnter: () => void;
onEnterCancelled: () => void;
onBeforeLeave: () => void;
onLeave: () => void;
onAfterLeave: () => void;
onLeaveCancelled: () => void;
}) => string | false | import("vue").CSSProperties | import("vue").StyleValue[]) | null | undefined;
rootClass?: string | ((props: {
id: string;
rootStyle: import("vue").StyleValue;
rootClass: string;
type: "text" | "loading" | "success" | "fail";
title: string | number;
visible: boolean;
position: "top" | "center" | "bottom";
overlay: boolean;
transparent: boolean;
timeout: number;
duration: number;
onVisibleHook: (name: import("../../use").TransitionHookName) => void;
onBeforeEnter: () => void;
onEnter: () => void;
onAfterEnter: () => void;
onEnterCancelled: () => void;
onBeforeLeave: () => void;
onLeave: () => void;
onAfterLeave: () => void;
onLeaveCancelled: () => void;
}) => string) | undefined;
type?: "text" | "success" | "fail" | "loading" | ((props: {
id: string;
rootStyle: import("vue").StyleValue;
rootClass: string;
type: "text" | "loading" | "success" | "fail";
title: string | number;
visible: boolean;
position: "top" | "center" | "bottom";
overlay: boolean;
transparent: boolean;
timeout: number;
duration: number;
onVisibleHook: (name: import("../../use").TransitionHookName) => void;
onBeforeEnter: () => void;
onEnter: () => void;
onAfterEnter: () => void;
onEnterCancelled: () => void;
onBeforeLeave: () => void;
onLeave: () => void;
onAfterLeave: () => void;
onLeaveCancelled: () => void;
}) => "text" | "success" | "fail" | "loading") | undefined;
title?: string | number | ((props: {
id: string;
rootStyle: import("vue").StyleValue;
rootClass: string;
type: "text" | "loading" | "success" | "fail";
title: string | number;
visible: boolean;
position: "top" | "center" | "bottom";
overlay: boolean;
transparent: boolean;
timeout: number;
duration: number;
onVisibleHook: (name: import("../../use").TransitionHookName) => void;
onBeforeEnter: () => void;
onEnter: () => void;
onAfterEnter: () => void;
onEnterCancelled: () => void;
onBeforeLeave: () => void;
onLeave: () => void;
onAfterLeave: () => void;
onLeaveCancelled: () => void;
}) => string | number) | undefined;
visible?: boolean | ((props: {
id: string;
rootStyle: import("vue").StyleValue;
rootClass: string;
type: "text" | "loading" | "success" | "fail";
title: string | number;
visible: boolean;
position: "top" | "center" | "bottom";
overlay: boolean;
transparent: boolean;
timeout: number;
duration: number;
onVisibleHook: (name: import("../../use").TransitionHookName) => void;
onBeforeEnter: () => void;
onEnter: () => void;
onAfterEnter: () => void;
onEnterCancelled: () => void;
onBeforeLeave: () => void;
onLeave: () => void;
onAfterLeave: () => void;
onLeaveCancelled: () => void;
}) => boolean) | undefined;
position?: "center" | "bottom" | "top" | ((props: {
id: string;
rootStyle: import("vue").StyleValue;
rootClass: string;
type: "text" | "loading" | "success" | "fail";
title: string | number;
visible: boolean;
position: "top" | "center" | "bottom";
overlay: boolean;
transparent: boolean;
timeout: number;
duration: number;
onVisibleHook: (name: import("../../use").TransitionHookName) => void;
onBeforeEnter: () => void;
onEnter: () => void;
onAfterEnter: () => void;
onEnterCancelled: () => void;
onBeforeLeave: () => void;
onLeave: () => void;
onAfterLeave: () => void;
onLeaveCancelled: () => void;
}) => "center" | "bottom" | "top") | undefined;
overlay?: boolean | ((props: {
id: string;
rootStyle: import("vue").StyleValue;
rootClass: string;
type: "text" | "loading" | "success" | "fail";
title: string | number;
visible: boolean;
position: "top" | "center" | "bottom";
overlay: boolean;
transparent: boolean;
timeout: number;
duration: number;
onVisibleHook: (name: import("../../use").TransitionHookName) => void;
onBeforeEnter: () => void;
onEnter: () => void;
onAfterEnter: () => void;
onEnterCancelled: () => void;
onBeforeLeave: () => void;
onLeave: () => void;
onAfterLeave: () => void;
onLeaveCancelled: () => void;
}) => boolean) | undefined;
transparent?: boolean | ((props: {
id: string;
rootStyle: import("vue").StyleValue;
rootClass: string;
type: "text" | "loading" | "success" | "fail";
title: string | number;
visible: boolean;
position: "top" | "center" | "bottom";
overlay: boolean;
transparent: boolean;
timeout: number;
duration: number;
onVisibleHook: (name: import("../../use").TransitionHookName) => void;
onBeforeEnter: () => void;
onEnter: () => void;
onAfterEnter: () => void;
onEnterCancelled: () => void;
onBeforeLeave: () => void;
onLeave: () => void;
onAfterLeave: () => void;
onLeaveCancelled: () => void;
}) => boolean) | undefined;
timeout?: number | ((props: {
id: string;
rootStyle: import("vue").StyleValue;
rootClass: string;
type: "text" | "loading" | "success" | "fail";
title: string | number;
visible: boolean;
position: "top" | "center" | "bottom";
overlay: boolean;
transparent: boolean;
timeout: number;
duration: number;
onVisibleHook: (name: import("../../use").TransitionHookName) => void;
onBeforeEnter: () => void;
onEnter: () => void;
onAfterEnter: () => void;
onEnterCancelled: () => void;
onBeforeLeave: () => void;
onLeave: () => void;
onAfterLeave: () => void;
onLeaveCancelled: () => void;
}) => number) | undefined;
duration?: number | ((props: {
id: string;
rootStyle: import("vue").StyleValue;
rootClass: string;
type: "text" | "loading" | "success" | "fail";
title: string | number;
visible: boolean;
position: "top" | "center" | "bottom";
overlay: boolean;
transparent: boolean;
timeout: number;
duration: number;
onVisibleHook: (name: import("../../use").TransitionHookName) => void;
onBeforeEnter: () => void;
onEnter: () => void;
onAfterEnter: () => void;
onEnterCancelled: () => void;
onBeforeLeave: () => void;
onLeave: () => void;
onAfterLeave: () => void;
onLeaveCancelled: () => void;
}) => number) | undefined;
onVisibleHook?: (((name: import("../../use").TransitionHookName) => void) | ((props: {
id: string;
rootStyle: import("vue").StyleValue;
rootClass: string;
type: "text" | "loading" | "success" | "fail";
title: string | number;
visible: boolean;
position: "top" | "center" | "bottom";
overlay: boolean;
transparent: boolean;
timeout: number;
duration: number;
onVisibleHook: (name: import("../../use").TransitionHookName) => void;
onBeforeEnter: () => void;
onEnter: () => void;
onAfterEnter: () => void;
onEnterCancelled: () => void;
onBeforeLeave: () => void;
onLeave: () => void;
onAfterLeave: () => void;
onLeaveCancelled: () => void;
}) => (name: import("../../use").TransitionHookName) => void)) | undefined;
onBeforeEnter?: ((() => void) | ((props: {
id: string;
rootStyle: import("vue").StyleValue;
rootClass: string;
type: "text" | "loading" | "success" | "fail";
title: string | number;
visible: boolean;
position: "top" | "center" | "bottom";
overlay: boolean;
transparent: boolean;
timeout: number;
duration: number;
onVisibleHook: (name: import("../../use").TransitionHookName) => void;
onBeforeEnter: () => void;
onEnter: () => void;
onAfterEnter: () => void;
onEnterCancelled: () => void;
onBeforeLeave: () => void;
onLeave: () => void;
onAfterLeave: () => void;
onLeaveCancelled: () => void;
}) => () => void)) | undefined;
onEnter?: ((() => void) | ((props: {
id: string;
rootStyle: import("vue").StyleValue;
rootClass: string;
type: "text" | "loading" | "success" | "fail";
title: string | number;
visible: boolean;
position: "top" | "center" | "bottom";
overlay: boolean;
transparent: boolean;
timeout: number;
duration: number;
onVisibleHook: (name: import("../../use").TransitionHookName) => void;
onBeforeEnter: () => void;
onEnter: () => void;
onAfterEnter: () => void;
onEnterCancelled: () => void;
onBeforeLeave: () => void;
onLeave: () => void;
onAfterLeave: () => void;
onLeaveCancelled: () => void;
}) => () => void)) | undefined;
onAfterEnter?: ((() => void) | ((props: {
id: string;
rootStyle: import("vue").StyleValue;
rootClass: string;
type: "text" | "loading" | "success" | "fail";
title: string | number;
visible: boolean;
position: "top" | "center" | "bottom";
overlay: boolean;
transparent: boolean;
timeout: number;
duration: number;
onVisibleHook: (name: import("../../use").TransitionHookName) => void;
onBeforeEnter: () => void;
onEnter: () => void;
onAfterEnter: () => void;
onEnterCancelled: () => void;
onBeforeLeave: () => void;
onLeave: () => void;
onAfterLeave: () => void;
onLeaveCancelled: () => void;
}) => () => void)) | undefined;
onEnterCancelled?: ((() => void) | ((props: {
id: string;
rootStyle: import("vue").StyleValue;
rootClass: string;
type: "text" | "loading" | "success" | "fail";
title: string | number;
visible: boolean;
position: "top" | "center" | "bottom";
overlay: boolean;
transparent: boolean;
timeout: number;
duration: number;
onVisibleHook: (name: import("../../use").TransitionHookName) => void;
onBeforeEnter: () => void;
onEnter: () => void;
onAfterEnter: () => void;
onEnterCancelled: () => void;
onBeforeLeave: () => void;
onLeave: () => void;
onAfterLeave: () => void;
onLeaveCancelled: () => void;
}) => () => void)) | undefined;
onBeforeLeave?: ((() => void) | ((props: {
id: string;
rootStyle: import("vue").StyleValue;
rootClass: string;
type: "text" | "loading" | "success" | "fail";
title: string | number;
visible: boolean;
position: "top" | "center" | "bottom";
overlay: boolean;
transparent: boolean;
timeout: number;
duration: number;
onVisibleHook: (name: import("../../use").TransitionHookName) => void;
onBeforeEnter: () => void;
onEnter: () => void;
onAfterEnter: () => void;
onEnterCancelled: () => void;
onBeforeLeave: () => void;
onLeave: () => void;
onAfterLeave: () => void;
onLeaveCancelled: () => void;
}) => () => void)) | undefined;
onLeave?: ((() => void) | ((props: {
id: string;
rootStyle: import("vue").StyleValue;
rootClass: string;
type: "text" | "loading" | "success" | "fail";
title: string | number;
visible: boolean;
position: "top" | "center" | "bottom";
overlay: boolean;
transparent: boolean;
timeout: number;
duration: number;
onVisibleHook: (name: import("../../use").TransitionHookName) => void;
onBeforeEnter: () => void;
onEnter: () => void;
onAfterEnter: () => void;
onEnterCancelled: () => void;
onBeforeLeave: () => void;
onLeave: () => void;
onAfterLeave: () => void;
onLeaveCancelled: () => void;
}) => () => void)) | undefined;
onAfterLeave?: ((() => void) | ((props: {
id: string;
rootStyle: import("vue").StyleValue;
rootClass: string;
type: "text" | "loading" | "success" | "fail";
title: string | number;
visible: boolean;
position: "top" | "center" | "bottom";
overlay: boolean;
transparent: boolean;
timeout: number;
duration: number;
onVisibleHook: (name: import("../../use").TransitionHookName) => void;
onBeforeEnter: () => void;
onEnter: () => void;
onAfterEnter: () => void;
onEnterCancelled: () => void;
onBeforeLeave: () => void;
onLeave: () => void;
onAfterLeave: () => void;
onLeaveCancelled: () => void;
}) => () => void)) | undefined;
onLeaveCancelled?: ((() => void) | ((props: {
id: string;
rootStyle: import("vue").StyleValue;
rootClass: string;
type: "text" | "loading" | "success" | "fail";
title: string | number;
visible: boolean;
position: "top" | "center" | "bottom";
overlay: boolean;
transparent: boolean;
timeout: number;
duration: number;
onVisibleHook: (name: import("../../use").TransitionHookName) => void;
onBeforeEnter: () => void;
onEnter: () => void;
onAfterEnter: () => void;
onEnterCancelled: () => void;
onBeforeLeave: () => void;
onLeave: () => void;
onAfterLeave: () => void;
onLeaveCancelled: () => void;
}) => () => void)) | undefined;
};
export interface ToastAgentEmits extends ToastEmits {
}
export declare const imperativeName = "toast";
export interface ToastImperative {
show(newProps: Record<string, any>): void;
hide(): void;
}
export type ToastOptions = ToastAgentProps;
export interface ToastSimpleShowFunction {
(options: ToastOptions): void;
(title?: string | number, options?: ToastOptions): void;
}
export interface ToastShowFunction {
(optionsOrTitle?: string | number | ToastOptions, options?: ToastOptions, internalType?: ToastOptions['type']): void;
}
export type ToastFunction = ToastSimpleShowFunction & {
success: ToastSimpleShowFunction;
fail: ToastSimpleShowFunction;
loading: ToastSimpleShowFunction;
hide: (id?: string) => void;
hideAll: () => void;
};
declare const toast: ToastFunction;
export { toast };