DefinitelyTyped/types/react-s-alert/index.d.ts
Forbes Lindesay 8f8f6c4392 [react] Use HTMLDialogElement for the dialog node (#23053)
* [react] Use HTMLDialogElement for the dialog node

* Actually add the `open` property

* This update requires typescript 2.6

* Update dependents of react to also require typescript 2.6
2018-02-12 12:55:52 +00:00

56 lines
1.4 KiB
TypeScript

// Type definitions for react-s-alert 1.3
// Project: https://github.com/juliancwirko/react-s-alert
// Definitions by: mitsuruog <https://github.com/mitsuruog>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.6
import * as React from "react";
declare class SAlert extends React.Component<SAlert.SAlertProps> {}
declare namespace SAlert {
interface SAlertConfigProps {
position?: string;
offset?: number;
stack?: boolean | SAlertStackProps;
effect?: string;
beep?: string | boolean | SAlertBeepProps;
timeout?: string | number;
html?: boolean;
onClose?: () => void;
onShow?: () => void;
customFields?: object;
contentTemplate?: (...args: any[]) => any;
}
interface SAlertProps extends SAlertConfigProps {
message?: string;
}
interface SAlertStackProps {
limit?: number;
spacing?: number;
}
interface SAlertBeepProps {
info?: string;
error?: string;
warning?: string;
success?: string;
}
function info(msg?: string, data?: SAlertConfigProps): number;
function error(msg?: string, data?: SAlertConfigProps): number;
function warning(msg?: string, data?: SAlertConfigProps): number;
function success(msg?: string, data?: SAlertConfigProps): number;
function close(id: number): void;
function closeAll(): void;
}
export default SAlert;