UNPKG

1.64 kBTypeScriptView Raw
1import * as React from "react";
2import { InputGroupProps2, OverlayProps } from "@blueprintjs/core";
3import { ListItemsProps } from "../../common";
4export declare type OmnibarProps<T> = IOmnibarProps<T>;
5/** @deprecated use OmnibarProps */
6export interface IOmnibarProps<T> extends ListItemsProps<T> {
7 /**
8 * Props to spread to the query `InputGroup`. Use `query` and
9 * `onQueryChange` instead of `inputProps.value` and `inputProps.onChange`
10 * to control this input.
11 */
12 inputProps?: InputGroupProps2;
13 /**
14 * Toggles the visibility of the omnibar.
15 * This prop is required because the component is controlled.
16 */
17 isOpen: boolean;
18 /**
19 * A callback that is invoked when user interaction causes the omnibar to
20 * close, such as clicking on the overlay or pressing the `esc` key (if
21 * enabled). Receives the event from the user's interaction, if there was an
22 * event (generally either a mouse or key event).
23 *
24 * Note that due to controlled usage, this component will not actually close
25 * itself until the `isOpen` prop becomes `false`.
26 * .
27 */
28 onClose?: (event?: React.SyntheticEvent<HTMLElement>) => void;
29 /** Props to spread to `Overlay`. */
30 overlayProps?: Partial<OverlayProps>;
31}
32/**
33 * Omnibar component.
34 *
35 * @see https://blueprintjs.com/docs/#select/omnibar
36 */
37export declare class Omnibar<T> extends React.PureComponent<OmnibarProps<T>> {
38 static displayName: string;
39 static ofType<U>(): new (props: OmnibarProps<U>) => Omnibar<U>;
40 render(): JSX.Element;
41 private renderQueryList;
42 private handleOverlayClose;
43}