UNPKG

1.12 kBTypeScriptView Raw
1import * as React from 'react';
2import { ButtonGroup } from 'react-bootstrap';
3import { Omit } from "../index";
4
5declare namespace ToggleButtonGroup {
6 interface BaseProps {
7 /**
8 * You'll usually want to use string|number|string[]|number[] here,
9 * but you can technically use any|any[].
10 */
11 defaultValue?: any;
12 /**
13 * You'll usually want to use string|number|string[]|number[] here,
14 * but you can technically use any|any[].
15 */
16 value?: any;
17 }
18
19 interface RadioProps {
20 /** Required if `type` is set to "radio" */
21 name: string;
22 type: "radio";
23 onChange?(value: any): void;
24 }
25
26 interface CheckboxProps {
27 name?: string | undefined;
28 type: "checkbox";
29 onChange?(values: any[]): void;
30 }
31
32 export type ToggleButtonGroupProps = BaseProps
33 & (RadioProps | CheckboxProps)
34 & Omit<ButtonGroup.ButtonGroupProps, "onChange">
35 & Omit<React.HTMLProps<ToggleButtonGroup>, "defaultValue" | "type" | "value" | "onChange">;
36}
37declare class ToggleButtonGroup extends React.Component<ToggleButtonGroup.ToggleButtonGroupProps> { }
38export = ToggleButtonGroup;