Files
DefinitelyTyped/rc-select/index.d.ts
Eric Anderson 9b53298395 Support Pick<> on setState now that TS 2.1 is out (#13155)
* Support Partial<> on setState now that TS 2.1 is out

* Update readme to reflect setState being typed correctly

* Switch setState to Pick

* Restore cloneELement portion of readme

* Use Pick<> | S for setState due to cast issue

* state and props should be readonly

* Fix nit + document why we

* Add typescript compiler header

* Update to properly order headers

* Update readme to reflect 2.1.5 fixing stPick

* Update readme now that 2.1.5 is out

* All that depend on react now require 2.1

* Fix definition that fails due to readonly state
2017-01-23 12:36:53 -08:00

69 lines
2.1 KiB
TypeScript

// Type definitions for React Select v5.9.0
// Project: https://github.com/react-component/select
// Definitions by: Denis Tirilis <https://github.com/DenisTirilis>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
/// <reference types="react" />
import * as React from "react";
import Select = RcSelect.Select;
import Option = RcSelect.Option;
import OptGroup = RcSelect.OptGroup;
export default Select;
export {
Option,
OptGroup
};
declare namespace RcSelect {
interface SelectProps {
className?: string;
prefixCls?: string;
animation?: string;
transitionName?: string;
choiceTransitionName?: string;
dropdownMatchSelectWidth?: boolean;
dropdownClassName?: string;
dropdownStyle?: { [key: string]: string };
dropdownMenuStyle?: { [key: string]: string };
notFoundContent?: string;
showSearch?: boolean;
allowClear?: boolean;
tags?: boolean;
maxTagTextLength?: number;
combobox?: boolean;
multiple?: boolean;
disabled?: boolean;
filterOption?: boolean;
optionFilterProp?: string;
optionLabelProp?: string;
defaultValue?: string | Array<string>;
value?: string | Array<string>;
onChange?: (value: string, label: string) => void;
onSearch?: Function;
onSelect?: (value: string, ontion: Option) => void;
onDeselect?: Function;
defaultLabel?: string | Array<string>;
defaultActiveFirstOption?: boolean;
getPopupContainer?: (trigger: Node) => Node;
}
export class Select extends React.Component<SelectProps, any> { }
interface OptionProps {
className?: string;
disabled?: boolean;
key?: string;
value?: string;
}
export class Option extends React.Component<OptionProps, any> { }
interface OptGroupProps {
label?: string | React.ReactElement<any>;
key?: string;
value?: string;
}
export class OptGroup extends React.Component<OptGroupProps, any> { }
}