From 53c91ff9a7aca751cf75cf940fc3c163e1713b99 Mon Sep 17 00:00:00 2001 From: Roger Chen Date: Sun, 1 May 2016 09:09:52 -0700 Subject: [PATCH] Add typings for react-split-pane (#9160) --- react-split-pane/react-split-pane-tests.tsx | 24 ++++++++++++ react-split-pane/react-split-pane.d.ts | 41 +++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 react-split-pane/react-split-pane-tests.tsx create mode 100644 react-split-pane/react-split-pane.d.ts diff --git a/react-split-pane/react-split-pane-tests.tsx b/react-split-pane/react-split-pane-tests.tsx new file mode 100644 index 0000000000..7aa6c006e6 --- /dev/null +++ b/react-split-pane/react-split-pane-tests.tsx @@ -0,0 +1,24 @@ +/// +/// + +import * as React from "react"; +import * as SplitPane from "react-split-pane"; + +class SplitPaneTest extends React.Component, {}> { + + render() { + return ( + +
+
+ + ); + } +} diff --git a/react-split-pane/react-split-pane.d.ts b/react-split-pane/react-split-pane.d.ts new file mode 100644 index 0000000000..e3d7f959de --- /dev/null +++ b/react-split-pane/react-split-pane.d.ts @@ -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 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +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 { } +} + +declare module "react-split-pane" { + var split: ReactSplitPane.ReactSplitPaneClass; + export = split; +}