mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-01 09:01:45 +08:00
Add typings for react-split-pane (#9160)
This commit is contained in:
committed by
Masahiro Wakame
parent
15d1bacc2b
commit
53c91ff9a7
24
react-split-pane/react-split-pane-tests.tsx
Normal file
24
react-split-pane/react-split-pane-tests.tsx
Normal file
@@ -0,0 +1,24 @@
|
||||
/// <reference path="../react/react.d.ts" />
|
||||
/// <reference path="./react-split-pane.d.ts"/>
|
||||
|
||||
import * as React from "react";
|
||||
import * as SplitPane from "react-split-pane";
|
||||
|
||||
class SplitPaneTest extends React.Component<React.Props<{}>, {}> {
|
||||
|
||||
render() {
|
||||
return (
|
||||
<SplitPane
|
||||
allowResize={true}
|
||||
className="pane"
|
||||
defaultSize={30}
|
||||
maxSize={50}
|
||||
minSize={20}
|
||||
split="vertical"
|
||||
>
|
||||
<div />
|
||||
<div />
|
||||
</SplitPane>
|
||||
);
|
||||
}
|
||||
}
|
||||
41
react-split-pane/react-split-pane.d.ts
vendored
Normal file
41
react-split-pane/react-split-pane.d.ts
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
// Type definitions for react-split-pane v0.1.38
|
||||
// Project: https://github.com/tomkp/react-split-pane
|
||||
// Definitions by: Roger Chen <https://github.com/rcchen>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../react/react.d.ts"/>
|
||||
|
||||
declare namespace ReactSplitPane {
|
||||
interface ReactSplitPaneProps {
|
||||
allowResize?: boolean;
|
||||
className?: string;
|
||||
/**
|
||||
* Either a number (in pixels) or string (percentage)
|
||||
*/
|
||||
defaultSize?: number | string;
|
||||
/**
|
||||
* Either a number (in pixels) or string (percentage)
|
||||
*/
|
||||
maxSize?: number | string;
|
||||
/**
|
||||
* Either a number (in pixels) or string (percentage)
|
||||
*/
|
||||
minSize?: number | string;
|
||||
onChange?: Function;
|
||||
onDragFinished?: Function;
|
||||
onDragStarted?: Function;
|
||||
primary?: string;
|
||||
/**
|
||||
* Either a number (in pixels) or string (percentage)
|
||||
*/
|
||||
size?: number | string;
|
||||
split?: string;
|
||||
}
|
||||
|
||||
interface ReactSplitPaneClass extends __React.ComponentClass<ReactSplitPaneProps> { }
|
||||
}
|
||||
|
||||
declare module "react-split-pane" {
|
||||
var split: ReactSplitPane.ReactSplitPaneClass;
|
||||
export = split;
|
||||
}
|
||||
Reference in New Issue
Block a user