Added type definitions for react-collapsible

This commit is contained in:
knegusen
2018-05-16 08:48:24 +02:00
parent e22846ad77
commit ad76e164ab
4 changed files with 77 additions and 0 deletions

35
types/react-collapsible/index.d.ts vendored Normal file
View File

@@ -0,0 +1,35 @@
// Type definitions for react-collapsible 2.2
// Project: https://github.com/glennflanagan/react-collapsible#readme
// Definitions by: knegusen <https://github.com/knegusen>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export interface CollapsibleProp {
children?: string | React.ReactNode;
transitionTime?: number;
transitionCloseTime?: number;
triggerTagName?: string;
easing?: string;
open?: boolean;
classParentString?: string;
openedClassName?: string;
triggerStyle?: object;
triggerClassName?: string;
triggerOpenedClassName?: string;
contentOuterClassName?: string;
contentInnerClassName?: string;
accordionPosition?: string | number;
handleTriggerClick?: (accordionPosition?: string | number) => void;
onOpen?: () => void;
onClose?: () => void;
onOpening?: () => void;
onClosing?: () => void;
trigger?: string | React.ReactNode;
triggerWhenOpen?: string | React.ReactNode;
triggerDisabled?: boolean;
lazyRender?: boolean;
overflowWhenOpen?: 'hidden' | 'visible' | 'auto' | 'scroll' | 'inherit' | 'initial' | 'unset';
triggerSibling?: React.ReactNode | string | (() => void);
tabIndex?: number;
}
export default class Collapsible extends React.Component<CollapsibleProp> {}

View File

@@ -0,0 +1,17 @@
import Collapsible from "react-collapsible";
import * as React from "react";
const Component = (
<div>
<Collapsible trigger="Start here">
<p>
This is the collapsible content. It can be any element or React
component you like.
</p>
<p>
It can even be another Collapsible component. Check out the next
section!
</p>
</Collapsible>
</div>
);

View File

@@ -0,0 +1,24 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"jsx": "react",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"react-collapsible-tests.tsx"
]
}

View File

@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }