UNPKG

2.98 kBTypeScriptView Raw
1import { ComponentType } from 'react';
2import { AsElementType } from '@instructure/shared-types';
3/**
4 * A props object that is searched for some fields to determine the
5 * element's type.
6 */
7interface PropsObject {
8 as?: AsElementType;
9 to?: string;
10 href?: string | null;
11 onClick?: ((...args: any) => any) | null;
12}
13/**
14 * ---
15 * category: utilities/react
16 * ---
17 * Get the React element type for a component.
18 *
19 * @module getElementType
20 * @param {ComponentType} Component
21 * @param {Object} props
22 * @param {Function} getDefault an optional function that returns the default element type
23 * @returns {String} the element type
24 */
25declare function getElementType<T extends PropsObject>(Component: Omit<ComponentType<T>, 'propTypes'>, props: T, getDefault?: () => AsElementType<T>): "symbol" | "object" | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | "style" | "map" | "filter" | "big" | "link" | "small" | "sub" | "sup" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "main" | "mark" | "menu" | "menuitem" | "meta" | "meter" | "nav" | "noindex" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "slot" | "script" | "section" | "select" | "source" | "span" | "strong" | "summary" | "table" | "template" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview" | "svg" | "animate" | "animateMotion" | "animateTransform" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | import("react").ComponentClass<T, any> | import("react").FunctionComponent<T> | NonNullable<T["as"]>;
26export default getElementType;
27export { getElementType };
28//# sourceMappingURL=getElementType.d.ts.map
\No newline at end of file