mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-17 12:16:38 +08:00
Added type definitions for react-collapsible
This commit is contained in:
35
types/react-collapsible/index.d.ts
vendored
Normal file
35
types/react-collapsible/index.d.ts
vendored
Normal 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> {}
|
||||
17
types/react-collapsible/react-collapsible-tests.tsx
Normal file
17
types/react-collapsible/react-collapsible-tests.tsx
Normal 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>
|
||||
);
|
||||
24
types/react-collapsible/tsconfig.json
Normal file
24
types/react-collapsible/tsconfig.json
Normal 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"
|
||||
]
|
||||
}
|
||||
1
types/react-collapsible/tslint.json
Normal file
1
types/react-collapsible/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user