1 | import * as React from "react";
|
2 | import type { IconName } from "@blueprintjs/icons";
|
3 | import { Intent } from "./intent";
|
4 | export declare const DISPLAYNAME_PREFIX = "Blueprint4";
|
5 | /**
|
6 | * Alias for all valid HTML props for `<div>` element.
|
7 | * Does not include React's `ref` or `key`.
|
8 | */
|
9 | export declare type HTMLDivProps = React.HTMLAttributes<HTMLDivElement>;
|
10 | /**
|
11 | * Alias for all valid HTML props for `<input>` element.
|
12 | * Does not include React's `ref` or `key`.
|
13 | */
|
14 | export declare type HTMLInputProps = React.InputHTMLAttributes<HTMLInputElement>;
|
15 | /**
|
16 | * Alias for a `JSX.Element` or a value that renders nothing.
|
17 | *
|
18 | * In React, `boolean`, `null`, and `undefined` do not produce any output.
|
19 | */
|
20 | export declare type MaybeElement = JSX.Element | false | null | undefined;
|
21 | /**
|
22 | * A shared base interface for all Blueprint component props.
|
23 | *
|
24 | * @deprecated use Props
|
25 | */
|
26 | export interface IProps {
|
27 | /** A space-delimited list of class names to pass along to a child element. */
|
28 | className?: string;
|
29 | }
|
30 | export declare type Props = IProps;
|
31 | /** @deprecated use IntentProps */
|
32 | export interface IIntentProps {
|
33 | /** Visual intent color to apply to element. */
|
34 | intent?: Intent;
|
35 | }
|
36 | export declare type IntentProps = IIntentProps;
|
37 | /**
|
38 | * Interface for a clickable action, such as a button or menu item.
|
39 | * These props can be spready directly to a `<Button>` or `<MenuItem>` element.
|
40 | *
|
41 | * @deprecated use ActionProps
|
42 | */
|
43 | export interface IActionProps extends IntentProps, Props {
|
44 | /** Whether this action is non-interactive. */
|
45 | disabled?: boolean;
|
46 | /** Name of a Blueprint UI icon (or an icon element) to render before the text. */
|
47 | icon?: IconName | MaybeElement;
|
48 | /** Click event handler. */
|
49 | onClick?: (event: React.MouseEvent<HTMLElement>) => void;
|
50 | /** Action text. Can be any single React renderable. */
|
51 | text?: React.ReactNode;
|
52 | }
|
53 | export declare type ActionProps = IActionProps;
|
54 | /**
|
55 | * Interface for a link, with support for customizing target window.
|
56 | *
|
57 | * @deprecated use LinkProps
|
58 | */
|
59 | export interface ILinkProps {
|
60 | /** Link URL. */
|
61 | href?: string;
|
62 | /** Link target attribute. Use `"_blank"` to open in a new window. */
|
63 | target?: string;
|
64 | }
|
65 | export declare type LinkProps = ILinkProps;
|
66 | /**
|
67 | * Interface for a controlled input.
|
68 | *
|
69 | * @deprecated use ControlledProps2.
|
70 | */
|
71 | export interface IControlledProps {
|
72 | /** Initial value of the input, for uncontrolled usage. */
|
73 | defaultValue?: string;
|
74 | /** Change event handler. Use `event.target.value` for new value. */
|
75 | onChange?: React.FormEventHandler<HTMLElement>;
|
76 | /** Form value of the input, for controlled usage. */
|
77 | value?: string;
|
78 | }
|
79 | export interface IControlledProps2 {
|
80 | /** Initial value of the input, for uncontrolled usage. */
|
81 | defaultValue?: string;
|
82 | /** Form value of the input, for controlled usage. */
|
83 | value?: string;
|
84 | }
|
85 | export declare type ControlledProps2 = IControlledProps2;
|
86 | /**
|
87 | * @deprecated will be removed in Blueprint v5.0, where components will use `ref` prop instead
|
88 | */
|
89 | export interface IElementRefProps<E extends HTMLElement> {
|
90 | /** A ref handler or a ref object that receives the native HTML element rendered by this component. */
|
91 | elementRef?: React.Ref<E>;
|
92 | }
|
93 | /**
|
94 | * An interface for an option in a list, such as in a `<select>` or `RadioGroup`.
|
95 | * These props can be spread directly to an `<option>` or `<Radio>` element.
|
96 | *
|
97 | * @deprecated use OptionProps
|
98 | */
|
99 | export interface IOptionProps extends Props {
|
100 | /** Whether this option is non-interactive. */
|
101 | disabled?: boolean;
|
102 | /** Label text for this option. If omitted, `value` is used as the label. */
|
103 | label?: string;
|
104 | /** Value of this option. */
|
105 | value: string | number;
|
106 | }
|
107 | export declare type OptionProps = IOptionProps;
|
108 | /**
|
109 | * Typically applied to HTMLElements to filter out disallowed props. When applied to a Component,
|
110 | * can filter props from being passed down to the children. Can also filter by a combined list of
|
111 | * supplied prop keys and the denylist (only appropriate for HTMLElements).
|
112 | *
|
113 | * @param props The original props object to filter down.
|
114 | * @param {string[]} invalidProps If supplied, overwrites the default denylist.
|
115 | * @param {boolean} shouldMerge If true, will merge supplied invalidProps and denylist together.
|
116 | */
|
117 | export declare function removeNonHTMLProps(props: {
|
118 | [key: string]: any;
|
119 | }, invalidProps?: string[], shouldMerge?: boolean): {
|
120 | [key: string]: any;
|
121 | };
|