mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* Update ink-select-input to support latest version and ink2 * Major version up * Fix travis errors * Fix travis errors * Fixed travis errors 3
32 lines
741 B
TypeScript
32 lines
741 B
TypeScript
import * as React from 'react';
|
|
|
|
// tslint:disable-next-line:import-name
|
|
import SelectInput, { ItemOfSelectInput } from 'ink-select-input';
|
|
// NOTE: `import SelectInput = require('ink-select-input');` will work as well.
|
|
// If importing using ES6 default import as above,
|
|
// `allowSyntheticDefaultImports` flag in compiler options needs to be set to `true`
|
|
|
|
const items: ReadonlyArray<ItemOfSelectInput> = [
|
|
{
|
|
label: 'First',
|
|
value: 'first',
|
|
key: 0,
|
|
},
|
|
{
|
|
label: 'Second',
|
|
value: 'second',
|
|
},
|
|
{
|
|
label: 'Third',
|
|
value: 'third',
|
|
},
|
|
];
|
|
|
|
class Demo extends React.PureComponent {
|
|
handleSelect = (item: ItemOfSelectInput) => {};
|
|
|
|
render() {
|
|
return <SelectInput items={items} onSelect={this.handleSelect} />;
|
|
}
|
|
}
|