sard-uniapp
Version:
sard-uniapp 是一套基于 Uniapp + Vue3 框架开发的兼容多端的 UI 组件库
515 lines (514 loc) • 18 kB
TypeScript
import { type NotifyEmits, type NotifyProps } from '../notify/common';
import { type TransitionHookCallbacks } from '../popup/common';
export interface NotifyAgentProps extends NotifyProps, TransitionHookCallbacks {
id?: string;
}
export declare const defaultNotifyAgentProps: () => {
id?: (string | ((props: {
id: string;
rootStyle: import("vue").StyleValue;
rootClass: string;
type: "primary" | "success" | "warning" | "error";
message: string;
color: string;
background: string;
visible: boolean;
position: "top" | "bottom";
timeout: number;
duration: number;
statusBar: boolean;
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: "primary" | "success" | "warning" | "error";
message: string;
color: string;
background: string;
visible: boolean;
position: "top" | "bottom";
timeout: number;
duration: number;
statusBar: boolean;
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: "primary" | "success" | "warning" | "error";
message: string;
color: string;
background: string;
visible: boolean;
position: "top" | "bottom";
timeout: number;
duration: number;
statusBar: boolean;
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?: "success" | "error" | "primary" | "warning" | ((props: {
id: string;
rootStyle: import("vue").StyleValue;
rootClass: string;
type: "primary" | "success" | "warning" | "error";
message: string;
color: string;
background: string;
visible: boolean;
position: "top" | "bottom";
timeout: number;
duration: number;
statusBar: boolean;
onVisibleHook: (name: import("../../use").TransitionHookName) => void;
onBeforeEnter: () => void;
onEnter: () => void;
onAfterEnter: () => void;
onEnterCancelled: () => void;
onBeforeLeave: () => void;
onLeave: () => void;
onAfterLeave: () => void;
onLeaveCancelled: () => void;
}) => "success" | "error" | "primary" | "warning") | undefined;
message?: string | ((props: {
id: string;
rootStyle: import("vue").StyleValue;
rootClass: string;
type: "primary" | "success" | "warning" | "error";
message: string;
color: string;
background: string;
visible: boolean;
position: "top" | "bottom";
timeout: number;
duration: number;
statusBar: boolean;
onVisibleHook: (name: import("../../use").TransitionHookName) => void;
onBeforeEnter: () => void;
onEnter: () => void;
onAfterEnter: () => void;
onEnterCancelled: () => void;
onBeforeLeave: () => void;
onLeave: () => void;
onAfterLeave: () => void;
onLeaveCancelled: () => void;
}) => string) | undefined;
color?: string | ((props: {
id: string;
rootStyle: import("vue").StyleValue;
rootClass: string;
type: "primary" | "success" | "warning" | "error";
message: string;
color: string;
background: string;
visible: boolean;
position: "top" | "bottom";
timeout: number;
duration: number;
statusBar: boolean;
onVisibleHook: (name: import("../../use").TransitionHookName) => void;
onBeforeEnter: () => void;
onEnter: () => void;
onAfterEnter: () => void;
onEnterCancelled: () => void;
onBeforeLeave: () => void;
onLeave: () => void;
onAfterLeave: () => void;
onLeaveCancelled: () => void;
}) => string) | undefined;
background?: string | ((props: {
id: string;
rootStyle: import("vue").StyleValue;
rootClass: string;
type: "primary" | "success" | "warning" | "error";
message: string;
color: string;
background: string;
visible: boolean;
position: "top" | "bottom";
timeout: number;
duration: number;
statusBar: boolean;
onVisibleHook: (name: import("../../use").TransitionHookName) => void;
onBeforeEnter: () => void;
onEnter: () => void;
onAfterEnter: () => void;
onEnterCancelled: () => void;
onBeforeLeave: () => void;
onLeave: () => void;
onAfterLeave: () => void;
onLeaveCancelled: () => void;
}) => string) | undefined;
visible?: boolean | ((props: {
id: string;
rootStyle: import("vue").StyleValue;
rootClass: string;
type: "primary" | "success" | "warning" | "error";
message: string;
color: string;
background: string;
visible: boolean;
position: "top" | "bottom";
timeout: number;
duration: number;
statusBar: boolean;
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?: "bottom" | "top" | ((props: {
id: string;
rootStyle: import("vue").StyleValue;
rootClass: string;
type: "primary" | "success" | "warning" | "error";
message: string;
color: string;
background: string;
visible: boolean;
position: "top" | "bottom";
timeout: number;
duration: number;
statusBar: boolean;
onVisibleHook: (name: import("../../use").TransitionHookName) => void;
onBeforeEnter: () => void;
onEnter: () => void;
onAfterEnter: () => void;
onEnterCancelled: () => void;
onBeforeLeave: () => void;
onLeave: () => void;
onAfterLeave: () => void;
onLeaveCancelled: () => void;
}) => "bottom" | "top") | undefined;
timeout?: number | ((props: {
id: string;
rootStyle: import("vue").StyleValue;
rootClass: string;
type: "primary" | "success" | "warning" | "error";
message: string;
color: string;
background: string;
visible: boolean;
position: "top" | "bottom";
timeout: number;
duration: number;
statusBar: boolean;
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: "primary" | "success" | "warning" | "error";
message: string;
color: string;
background: string;
visible: boolean;
position: "top" | "bottom";
timeout: number;
duration: number;
statusBar: boolean;
onVisibleHook: (name: import("../../use").TransitionHookName) => void;
onBeforeEnter: () => void;
onEnter: () => void;
onAfterEnter: () => void;
onEnterCancelled: () => void;
onBeforeLeave: () => void;
onLeave: () => void;
onAfterLeave: () => void;
onLeaveCancelled: () => void;
}) => number) | undefined;
statusBar?: boolean | ((props: {
id: string;
rootStyle: import("vue").StyleValue;
rootClass: string;
type: "primary" | "success" | "warning" | "error";
message: string;
color: string;
background: string;
visible: boolean;
position: "top" | "bottom";
timeout: number;
duration: number;
statusBar: boolean;
onVisibleHook: (name: import("../../use").TransitionHookName) => void;
onBeforeEnter: () => void;
onEnter: () => void;
onAfterEnter: () => void;
onEnterCancelled: () => void;
onBeforeLeave: () => void;
onLeave: () => void;
onAfterLeave: () => void;
onLeaveCancelled: () => void;
}) => boolean) | undefined;
onVisibleHook?: (((name: import("../../use").TransitionHookName) => void) | ((props: {
id: string;
rootStyle: import("vue").StyleValue;
rootClass: string;
type: "primary" | "success" | "warning" | "error";
message: string;
color: string;
background: string;
visible: boolean;
position: "top" | "bottom";
timeout: number;
duration: number;
statusBar: boolean;
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: "primary" | "success" | "warning" | "error";
message: string;
color: string;
background: string;
visible: boolean;
position: "top" | "bottom";
timeout: number;
duration: number;
statusBar: boolean;
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: "primary" | "success" | "warning" | "error";
message: string;
color: string;
background: string;
visible: boolean;
position: "top" | "bottom";
timeout: number;
duration: number;
statusBar: boolean;
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: "primary" | "success" | "warning" | "error";
message: string;
color: string;
background: string;
visible: boolean;
position: "top" | "bottom";
timeout: number;
duration: number;
statusBar: boolean;
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: "primary" | "success" | "warning" | "error";
message: string;
color: string;
background: string;
visible: boolean;
position: "top" | "bottom";
timeout: number;
duration: number;
statusBar: boolean;
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: "primary" | "success" | "warning" | "error";
message: string;
color: string;
background: string;
visible: boolean;
position: "top" | "bottom";
timeout: number;
duration: number;
statusBar: boolean;
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: "primary" | "success" | "warning" | "error";
message: string;
color: string;
background: string;
visible: boolean;
position: "top" | "bottom";
timeout: number;
duration: number;
statusBar: boolean;
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: "primary" | "success" | "warning" | "error";
message: string;
color: string;
background: string;
visible: boolean;
position: "top" | "bottom";
timeout: number;
duration: number;
statusBar: boolean;
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: "primary" | "success" | "warning" | "error";
message: string;
color: string;
background: string;
visible: boolean;
position: "top" | "bottom";
timeout: number;
duration: number;
statusBar: boolean;
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 NotifyAgentEmits extends NotifyEmits {
}
export declare const imperativeName = "notify";
export interface NotifyImperative {
show(newProps: Record<string, any>): void;
hide(): void;
}
export type NotifyOptions = NotifyAgentProps;
export interface NotifySimpleShowFunction {
(options: NotifyOptions): void;
(message: string, options?: NotifyOptions): void;
}
export interface NotifyShowFunction {
(optionsOrMessage: string | NotifyOptions, options?: NotifyOptions, internalType?: NotifyOptions['type']): void;
}
export type NotifyFunction = NotifySimpleShowFunction & {
success: NotifySimpleShowFunction;
warning: NotifySimpleShowFunction;
error: NotifySimpleShowFunction;
hide: (id?: string) => void;
hideAll: () => void;
};
declare const notify: NotifyFunction;
export { notify };