/** * @file Alert * @author fex */ import React from 'react'; import type { PlainObject, ReactPropsBase } from 'jamis-core'; import type { ButtonLevel } from '../types'; export interface AlertProps extends ReactPropsBase { container?: any; confirmText?: string; cancelText?: string; title?: string; confirmBtnLevel?: ButtonLevel; alertBtnLevel?: ButtonLevel; } export interface AlertState { show: boolean; title?: string; content: string; confirm: boolean; prompt?: boolean; controls?: any; value?: any; confirmText?: string; } declare class Alert extends React.Component { static instance: any; static getInstance(): any; _resolve: (value: any) => void; _modal: any; _body: any; state: AlertState; constructor(props: AlertProps); static defaultProps: { confirmText: string; cancelText: string; title: string; alertBtnLevel: "primary"; confirmBtnLevel: "danger"; }; componentDidMount(): void; componentDidUpdate(prevProps: AlertProps, prevState: AlertState): void; componentWillUnmount(): void; schemaSope: any; scopeRef(schemaSope: any): void; handleConfirm(): void; handleCancel(): void; close(confirmed: boolean): void; alert(content: string, title?: string): void; confirm(content: string, title?: string, confirmText?: string): Promise; prompt(controls: any, defaultValue?: any, title?: string, confirmText?: string): Promise; modalRef(ref: any): void; handleFormSubmit(values: any): void; render(): JSX.Element; } export type renderSchemaFn = (controls: Array, value: PlainObject, callback?: (values: PlainObject) => void, scopeRef?: (value: any) => void, theme?: string) => JSX.Element; export declare function setRenderSchemaFn(fn: renderSchemaFn): void; export declare const alert: (content: string, title?: string) => void; export declare const confirm: (content: string, title?: string, confirmText?: string) => Promise; export declare const prompt: (controls: any, defaultvalue?: any, title?: string, confirmText?: string) => Promise; export declare const FinnalAlert: typeof Alert; export default FinnalAlert;