UNPKG

1.58 kBTypeScriptView Raw
1import * as React from 'react';
2declare type EventType = React.KeyboardEvent<HTMLDivElement> | React.MouseEvent<HTMLDivElement | HTMLButtonElement>;
3declare type getContainerFunc = () => HTMLElement;
4declare const PlacementTypes: ["top", "right", "bottom", "left"];
5declare type placementType = typeof PlacementTypes[number];
6export interface PushState {
7 distance: string | number;
8}
9export interface DrawerProps {
10 closable?: boolean;
11 closeIcon?: React.ReactNode;
12 destroyOnClose?: boolean;
13 forceRender?: boolean;
14 getContainer?: string | HTMLElement | getContainerFunc | false;
15 maskClosable?: boolean;
16 mask?: boolean;
17 maskStyle?: React.CSSProperties;
18 style?: React.CSSProperties;
19 /** Wrapper dom node style of header and body */
20 drawerStyle?: React.CSSProperties;
21 headerStyle?: React.CSSProperties;
22 bodyStyle?: React.CSSProperties;
23 contentWrapperStyle?: React.CSSProperties;
24 title?: React.ReactNode;
25 visible?: boolean;
26 width?: number | string;
27 height?: number | string;
28 zIndex?: number;
29 prefixCls?: string;
30 push?: boolean | PushState;
31 placement?: placementType;
32 onClose?: (e: EventType) => void;
33 afterVisibleChange?: (visible: boolean) => void;
34 className?: string;
35 handler?: React.ReactNode;
36 keyboard?: boolean;
37 footer?: React.ReactNode;
38 footerStyle?: React.CSSProperties;
39 level?: string | string[] | null | undefined;
40}
41export interface IDrawerState {
42 push?: boolean;
43}
44declare const DrawerWrapper: React.FC<DrawerProps>;
45export default DrawerWrapper;