mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-24 05:06:02 +08:00
Add react-virtualized-select.
This commit is contained in:
34
types/react-virtualized-select/index.d.ts
vendored
Normal file
34
types/react-virtualized-select/index.d.ts
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
// Type definitions for react-virtualized-select 3.0
|
||||
// Project: https://github.com/bvaughn/react-virtualized-select
|
||||
// Definitions by: Sean Kelley <https://github.com/seansfkelley>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
import * as React from "react";
|
||||
import { ReactSelectProps } from "react-select";
|
||||
import { ListProps } from "react-virtualized";
|
||||
|
||||
export interface VirtualizedOptionRenderOptions<T> {
|
||||
focusedOption: T;
|
||||
focusedOptionIndex: number;
|
||||
focusOption(option: T): void;
|
||||
key: string;
|
||||
labelKey: keyof T;
|
||||
listProps: ListProps;
|
||||
option: T;
|
||||
options: T[];
|
||||
selectValue(option: T): void;
|
||||
style: Record<string, string>;
|
||||
valueArray: T[];
|
||||
}
|
||||
|
||||
export interface VirtualizedSelectProps extends ReactSelectProps {
|
||||
async?: boolean;
|
||||
maxHeight?: number;
|
||||
optionHeight?: number;
|
||||
optionRenderer?(options: VirtualizedOptionRenderOptions<any>): JSX.Element;
|
||||
selectComponent?: React.ComponentClass<any> | React.StatelessComponent<any>;
|
||||
}
|
||||
|
||||
declare class VirtualizedSelect extends React.PureComponent<VirtualizedSelectProps, {}> {}
|
||||
export default VirtualizedSelect;
|
||||
@@ -0,0 +1,12 @@
|
||||
import * as React from "react";
|
||||
import Select = require("react-select");
|
||||
import VirtualizedSelect from "react-virtualized-select";
|
||||
|
||||
<VirtualizedSelect
|
||||
async={true}
|
||||
maxHeight={0}
|
||||
optionHeight={0}
|
||||
optionRenderer={() => <div/>}
|
||||
selectComponent={Select}
|
||||
options={[]}
|
||||
/>;
|
||||
23
types/react-virtualized-select/tsconfig.json
Normal file
23
types/react-virtualized-select/tsconfig.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"jsx": "react",
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"react-virtualized-select-tests.tsx"
|
||||
]
|
||||
}
|
||||
1
types/react-virtualized-select/tslint.json
Normal file
1
types/react-virtualized-select/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user