UNPKG

4.18 kBTypeScriptView Raw
1/**
2 * An array of events that are allowed on every html element type.
3 *
4 * @public
5 */
6export declare const baseElementEvents: Record<string, number>;
7/**
8 * An array of element attributes which are allowed on every html element type.
9 *
10 * @public
11 */
12export declare const baseElementProperties: Record<string, number>;
13/**
14 * An array of HTML element properties and events.
15 *
16 * @public
17 */
18export declare const htmlElementProperties: Record<string, number>;
19/**
20 * An array of LABEL tag properties and events.
21 *
22 * @public
23 */
24export declare const labelProperties: Record<string, number>;
25/**
26 * An array of AUDIO tag properties and events.
27
28 * @public
29 */
30export declare const audioProperties: Record<string, number>;
31/**
32 * An array of VIDEO tag properties and events.
33 *
34 * @public
35 */
36export declare const videoProperties: Record<string, number>;
37/**
38 * An array of OL tag properties and events.
39 *
40 * @public
41 */
42export declare const olProperties: Record<string, number>;
43/**
44 * An array of LI tag properties and events.
45 *
46 * @public
47 */
48export declare const liProperties: Record<string, number>;
49/**
50 * An array of A tag properties and events.
51 *
52 * @public
53 */
54export declare const anchorProperties: Record<string, number>;
55/**
56 * An array of BUTTON tag properties and events.
57 *
58 * @public
59 */
60export declare const buttonProperties: Record<string, number>;
61/**
62 * An array of INPUT tag properties and events.
63 *
64 * @public
65 */
66export declare const inputProperties: Record<string, number>;
67/**
68 * An array of TEXTAREA tag properties and events.
69 *
70 * @public
71 */
72export declare const textAreaProperties: Record<string, number>;
73/**
74 * An array of SELECT tag properties and events.
75 *
76 * @public
77 */
78export declare const selectProperties: Record<string, number>;
79export declare const optionProperties: Record<string, number>;
80/**
81 * An array of TABLE tag properties and events.
82 *
83 * @public
84 */
85export declare const tableProperties: Record<string, number>;
86/**
87 * An array of TR tag properties and events.
88 *
89 * @public
90 */
91export declare const trProperties: Record<string, number>;
92/**
93 * An array of TH tag properties and events.
94 *
95 * @public
96 */
97export declare const thProperties: Record<string, number>;
98/**
99 * An array of TD tag properties and events.
100 *
101 * @public
102 */
103export declare const tdProperties: Record<string, number>;
104export declare const colGroupProperties: Record<string, number>;
105export declare const colProperties: Record<string, number>;
106/**
107 * An array of FORM tag properties and events.
108 *
109 * @public
110 */
111export declare const formProperties: Record<string, number>;
112/**
113 * An array of IFRAME tag properties and events.
114 *
115 * @public
116 */
117export declare const iframeProperties: Record<string, number>;
118/**
119 * An array of IMAGE tag properties and events.
120 *
121 * @public
122 */
123export declare const imgProperties: Record<string, number>;
124/**
125 * @deprecated Use imgProperties for img elements.
126 */
127export declare const imageProperties: Record<string, number>;
128/**
129 * An array of DIV tag properties and events.
130 *
131 * @public
132 */
133export declare const divProperties: Record<string, number>;
134/**
135 * Gets native supported props for an html element provided the allowance set. Use one of the property
136 * sets defined (divProperties, buttonPropertes, etc) to filter out supported properties from a given
137 * props set. Note that all data- and aria- prefixed attributes will be allowed.
138 * NOTE: getNativeProps should always be applied first when adding props to a react component. The
139 * non-native props should be applied second. This will prevent getNativeProps from overriding your custom props.
140 * For example, if props passed to getNativeProps has an onClick function and getNativeProps is added to
141 * the component after an onClick function is added, then the getNativeProps onClick will override it.
142 *
143 * @public
144 * @param props - The unfiltered input props
145 * @param allowedPropsNames - The array or record of allowed prop names.
146 * @returns The filtered props
147 */
148export declare function getNativeProps<T extends Record<string, any>>(props: Record<string, any>, allowedPropNames: string[] | Record<string, number>, excludedPropNames?: string[]): T;