Merge pull request #30281 from Hoff97/master

Add types for rmc-drawer
This commit is contained in:
Armando Aguirre
2018-11-05 15:23:43 -08:00
committed by GitHub
4 changed files with 78 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
// Type definitions for rmc-drawer 0.4
// Project: https://github.com/react-component/m-drawer
// Definitions by: Frithjof Winkelmann <https://github.com/Hoff97>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
import * as moment from "moment";
import * as React from 'react';
interface DrawerProps {
className?: string;
prefixCls?: string;
children?: React.ReactNode | React.ReactNode[];
style?: React.CSSProperties;
sidebarStyle?: React.CSSProperties;
contentStyle?: React.CSSProperties;
overlayStyle?: React.CSSProperties;
dragHandleStyle?: React.CSSProperties;
sidebar?: React.ReactNode;
onOpenChange?: (open: boolean, overlay?: { overlayClicked: boolean }) => void;
open?: boolean;
position?: 'left' | 'right' | 'top' | 'bottom';
docked?: boolean;
transitions?: boolean;
touch?: boolean;
enableDragHandle?: boolean;
dragToggleDistance?: number;
}
declare class Drawer extends React.Component<Partial<DrawerProps>> {
}
export = Drawer;
+19
View File
@@ -0,0 +1,19 @@
import Drawer from 'rmc-drawer';
import * as React from 'react';
const sidebar = (<div>
<h3>
sidebar
</h3>
<p>this is content!</p>
</div>);
const drawer = <Drawer sidebar={sidebar} docked={false} open={false}
style={{ overflow: 'auto' }} touch={true} enableDragHandle={true}
position="left" dragToggleDistance={30} transitions={true}
onOpenChange={_open => {}}>
<div className="main">
<p>React component</p>
Testcontent
</div>
</Drawer>;
+25
View File
@@ -0,0 +1,25 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"esModuleInterop": true,
"jsx": "react"
},
"files": [
"index.d.ts",
"rmc-drawer-tests.tsx"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }