diff --git a/types/react-panelgroup/index.d.ts b/types/react-panelgroup/index.d.ts new file mode 100644 index 0000000000..3f8ebdda54 --- /dev/null +++ b/types/react-panelgroup/index.d.ts @@ -0,0 +1,30 @@ +// Type definitions for react-panelgroup 1.0.7 +// Project: https://github.com/DanFessler/react-panelgroup +// Definitions by: My Self +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import * as React from "react"; + +/** + * Interface used to define a number of options for a panel. + */ +export interface PanelWidth { + size?: number; + minSize?: number; + resize?: "fixed" | "dynamic" | "stretch"; + snap?: number[]; +} + +interface PropTypes { + spacing?: number; + borderColor?: string; + panelColor?: string; + direction?: "row" | "column"; + panelWidths?: Array; + onUpdate?: (data: PanelWidth) => void; +} + +/** + * React component that allows for the creation of resizable panels. + */ +export default class PanelGroup extends React.Component {} diff --git a/types/react-panelgroup/react-panelgroup-tests.tsx b/types/react-panelgroup/react-panelgroup-tests.tsx new file mode 100644 index 0000000000..fcbbeab0ee --- /dev/null +++ b/types/react-panelgroup/react-panelgroup-tests.tsx @@ -0,0 +1,68 @@ +import PanelGroup, { PanelWidth } from "react-panelgroup"; +import * as React from "react"; + +const test1 = ( + +
panel 1
+
panel 2
+
panel 3
+
+); + +const test2 = ( + +
panel 1
+
panel 2
+
panel 3
+
+); + +const test3 = ( + + +
panel 1
+
panel 2
+
panel 3
+
+
panel 4
+ +
panel 5
+
panel 6
+
+
+); + +const test4 = ( + +
panel 1
+
panel 2
+
panel 3
+
+); + +const test5 = ( + {}} + > +
panel 1
+
panel 2
+
panel 3
+
+); + +const test6: PanelWidth = { + size: 100, + minSize: 100, + resize: "fixed", + snap: [50, 75] +}; diff --git a/types/react-panelgroup/tsconfig.json b/types/react-panelgroup/tsconfig.json new file mode 100644 index 0000000000..47d08fddd7 --- /dev/null +++ b/types/react-panelgroup/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "jsx": "react", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "react-panelgroup-tests.tsx"] +} diff --git a/types/react-panelgroup/tslint.json b/types/react-panelgroup/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-panelgroup/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }