import * as React from 'react';
import {FormControl, FormControlDefaultProps, FormControlProps} from './FormControl';

export type FormGroupProps = FormControlProps & {
    ariaDescId?: string;
    groupClassName?: string;
    help?: string;
    noOffset?: boolean;
    controlId?: string;
} & Partial<FormGroupDefaultProps> & React.HTMLProps<{}>;

export type FormGroupDefaultProps = FormControlDefaultProps & {
    ariaDescId: null;
}

type AriaDescrProps = {
    'aria-describedby'?: string;
}

export class FormGroup<P extends FormGroupProps> extends FormControl<P> {
    static initialAriaDescId: number;

    getAriaDescProps(hasError: boolean): AriaDescrProps;
    getValue(): string;
    getInputDOMNode(): HTMLInputElement;
    controlLabelFallback(): boolean;
    filterGroupProps(props: FormGroupProps): any;
    renderInput(...args): React.ReactNode;
}
