@types/react-alert
Advanced tools
Comparing version 2.4.4 to 2.4.5
// Type definitions for react-alert 2.4 | ||
// Project: https://github.com/schiehll/react-alert | ||
// Definitions by: Steve Syrell <https://github.com/ssyrell> | ||
// Yue Yang <https://github.com/g1eny0ung> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
// TypeScript Version: 2.8 | ||
import * as React from "react"; | ||
import { ReactElement, Component, ReactNode } from 'react'; | ||
export interface AlertContainerProps { | ||
/** | ||
* The offset of the alert from the page border, can be any number. | ||
* The offset of the alert from the page border. Can be any number. | ||
* | ||
* Default: 14. | ||
* Default: 14 | ||
*/ | ||
offset: number; | ||
offset?: number | undefined; | ||
@@ -22,3 +22,3 @@ /** | ||
*/ | ||
position: string; | ||
position?: 'bottom left' | 'bottom right' | 'top left' | 'top right' | undefined; | ||
@@ -30,12 +30,10 @@ /** | ||
*/ | ||
theme: string; | ||
theme?: 'dark' | 'light' | undefined; | ||
/** | ||
* The time in milliseconds the alert is displayed. After this | ||
* time ellapses, the alert will close itself. Use 0 to prevent self-closure | ||
* (applies to all alerts). | ||
* The time in miliseconds to the alert close itself. Use 0 to prevent auto close (apply to all alerts). | ||
* | ||
* Default: 5000 | ||
*/ | ||
time: number; | ||
time?: number | undefined; | ||
@@ -47,3 +45,3 @@ /** | ||
*/ | ||
transition: string; | ||
transition?: 'scale' | 'fade' | undefined; | ||
} | ||
@@ -53,5 +51,13 @@ | ||
/** | ||
* The time in milliseconds the alert is displayed. After this | ||
* time ellapses, the alert will close itself. Use 0 to prevent self-closure. | ||
* The alert type. Can be [info, success, error]. Only used in `show` method. | ||
* | ||
* Default: info | ||
*/ | ||
type?: 'info' | 'success' | 'error' | undefined; | ||
/** | ||
* The time in miliseconds to the alert close itself. Use 0 to prevent auto close (apply to this alert only). | ||
* | ||
* Default: 5000 | ||
*/ | ||
time?: number | undefined; | ||
@@ -64,42 +70,38 @@ | ||
*/ | ||
icon?: React.ReactNode | undefined; | ||
icon?: ReactElement | undefined; | ||
/** | ||
* A callback function that will be called when the alert is closed. | ||
* The function called when message is closed. | ||
*/ | ||
onClose?: (() => void) | undefined; | ||
onClose?: () => void | undefined; | ||
} | ||
export default class AlertContainer extends Component<AlertContainerProps> { | ||
/** | ||
* The type of alert to show. This will only be used when calling show(). | ||
* Can be [info, success, error]. | ||
* Show an alert. | ||
* | ||
* Default: 'info' | ||
*/ | ||
type?: string | undefined; | ||
} | ||
export default class AlertContainer extends React.Component<AlertContainerProps> { | ||
/** | ||
* Show a success alert. | ||
* @returns The id of the created alert. | ||
*/ | ||
success(message: string, options?: AlertShowOptions): string; | ||
show(message: ReactNode, options?: AlertShowOptions): string; | ||
/** | ||
* Show an error alert. | ||
* Show an info alert. | ||
* | ||
* @returns The id of the created alert. | ||
*/ | ||
error(message: string, options?: AlertShowOptions): string; | ||
info(message: ReactNode, options?: AlertShowOptions): string; | ||
/** | ||
* Show an info alert. | ||
* Show an success alert. | ||
* | ||
* @returns The id of the created alert. | ||
*/ | ||
info(message: string, options?: AlertShowOptions): string; | ||
success(message: ReactNode, options?: AlertShowOptions): string; | ||
/** | ||
* Show an alert. | ||
* Show an error alert. | ||
* | ||
* @returns The id of the created alert. | ||
*/ | ||
show(message: string, options?: AlertShowOptions): string; | ||
error(message: ReactNode, options?: AlertShowOptions): string; | ||
@@ -114,3 +116,3 @@ /** | ||
*/ | ||
remove(id: string): void; | ||
removeAlert(id: string): void; | ||
} |
{ | ||
"name": "@types/react-alert", | ||
"version": "2.4.4", | ||
"version": "2.4.5", | ||
"description": "TypeScript definitions for react-alert", | ||
@@ -12,2 +12,7 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-alert", | ||
"githubUsername": "ssyrell" | ||
}, | ||
{ | ||
"name": "Yue Yang", | ||
"url": "https://github.com/g1eny0ung", | ||
"githubUsername": "g1eny0ung" | ||
} | ||
@@ -26,4 +31,4 @@ ], | ||
}, | ||
"typesPublisherContentHash": "5341739c184e37c869832b3edcca7f5a16e5219ee32a23c0f392d4659ab5468d", | ||
"typeScriptVersion": "3.6" | ||
"typesPublisherContentHash": "5883342608f22c88ee6e52949e0f04148c6b6d3ff034b2b2aa92825fa0370603", | ||
"typeScriptVersion": "3.9" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Thu, 08 Jul 2021 20:20:24 GMT | ||
* Last updated: Fri, 04 Mar 2022 14:31:44 GMT | ||
* Dependencies: [@types/react](https://npmjs.com/package/@types/react) | ||
@@ -17,2 +17,2 @@ * Global values: none | ||
# Credits | ||
These definitions were written by [Steve Syrell](https://github.com/ssyrell). | ||
These definitions were written by [Steve Syrell](https://github.com/ssyrell), and [Yue Yang](https://github.com/g1eny0ung). |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
5574
96
0