DefinitelyTyped/types/react-s-alert/index.d.ts
Ferdy Budhidharma bc0c933415 feat(react-dependents): update to TS 2.8 (part 2 of 2) (#27744)
* feat(react-dependents): update to ts 2.8

* fix version mismatches

* remove package.json

* post merge updates

* add package.json back again
2018-08-06 06:28:42 +01: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.8
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;