-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
44 lines (37 loc) · 1.16 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import React from 'react';
type ShowAlertTypes = {
title?: string;
text?: string;
alertData?: object | null | undefined;
onEvent?: ((event: any) => void) | null | undefined;
hideCancel?: boolean | null | undefined;
};
type RenderAlertProps = {
alertData: object | null | undefined;
visible: boolean | null | undefined;
onEvent: ((event: any) => void) | null | undefined;
onPressCancel: (() => void) | null | undefined;
onPressOk: (() => void) | null | undefined;
title?: string;
text?: string;
hideCancel?: boolean | null | undefined
};
type UseAlertProps = {
renderAlert?: (props: RenderAlertProps) => React.ReactElement;
children: React.ReactElement;
};
type UseAlertReturnType = {
showAlert: (options: ShowAlertTypes) => Promise<boolean>;
AlertComp: React.FC;
};
declare function useAlert(props: UseAlertProps): UseAlertReturnType;
declare const AlertProvider: React.FC<UseAlertProps>;
type ShowAlertFunction = (options: ShowAlertTypes) => Promise<boolean>;
declare function useShowAlert(): ShowAlertFunction;
export {AlertProvider, useShowAlert};
export type {
ShowAlertTypes,
RenderAlertProps,
UseAlertProps,
UseAlertReturnType,
};