UNPKG

2.24 kBTypeScriptView Raw
1import React, { type JSXElementConstructor } from 'react';
2import type { ShowModalInnerProps, ShowConfig } from './types';
3type ModalInnerProps = ShowModalInnerProps & {
4 type?: string;
5};
6export declare const ModalInner: ({ type, messageProps, title, rtl, prefix, content, }: ModalInnerProps) => React.JSX.Element;
7/**
8 * 创建对话框
9 * @param config - 配置项
10 * @returns 包含有 hide 方法,可用来关闭对话框
11 */
12export declare const show: (config?: ShowConfig) => {
13 hide: () => void;
14};
15/**
16 * 创建警示对话框
17 * @param config - 配置项
18 * @returns 包含有 hide 方法,可用来关闭对话框
19 */
20export declare const alert: (config?: ShowConfig) => {
21 hide: () => void;
22};
23export declare const success: (config?: ShowConfig) => {
24 hide: () => void;
25};
26export declare const error: (config?: ShowConfig) => {
27 hide: () => void;
28};
29export declare const notice: (config?: ShowConfig) => {
30 hide: () => void;
31};
32export declare const warning: (config?: ShowConfig) => {
33 hide: () => void;
34};
35export declare const help: (config?: ShowConfig) => {
36 hide: () => void;
37};
38/**
39 * 创建确认对话框
40 * @param config - 配置项
41 * @returns 包含有 hide 方法,可用来关闭对话框
42 */
43export declare const confirm: (config?: ShowConfig) => {
44 hide: () => void;
45};
46export interface ContextDialog {
47 show: (config?: ShowConfig) => {
48 hide: () => void;
49 };
50 alert: (config?: ShowConfig) => {
51 hide: () => void;
52 };
53 confirm: (config?: ShowConfig) => {
54 hide: () => void;
55 };
56 success: (config?: ShowConfig) => {
57 hide: () => void;
58 };
59 error: (config?: ShowConfig) => {
60 hide: () => void;
61 };
62 warning: (config?: ShowConfig) => {
63 hide: () => void;
64 };
65 notice: (config?: ShowConfig) => {
66 hide: () => void;
67 };
68 help: (config?: ShowConfig) => {
69 hide: () => void;
70 };
71}
72export interface WithContextDialogProps {
73 contextDialog: ContextDialog;
74}
75export declare const withContext: <P extends WithContextDialogProps, C>(WrappedComponent: React.JSXElementConstructor<P> & C) => (props: JSX.LibraryManagedAttributes<C, Omit<P, "contextDialog">>) => React.JSX.Element;
76export {};