/** * asAsync - a HOC for async loading components. * * Usage: * * const AsyncDialog = asAsync({ * load: () => import('Dialog').then(result => result.default), * }); * * React.render(domElement, } { ...dialogProps } />); * * Note the `asyncPlaceholder` prop will be respected when rendering the async component and it hasn't * been loaded yet. */ import * as React from 'react'; export interface IAsAsyncOptions { /** * Callback which returns a promise resolving an object which exports the component. */ load: () => Promise>; /** * Callback executed when async loading is complete. */ onLoad?: () => void; /** * Callback when async loading fails. */ onError?: (error: Error) => void; } /** * Produces a component which internally loads the target component before first mount. * The component passes all props through to the loaded component. * * This overload accepts a module with a default export for the component. */ export declare function asAsync(options: IAsAsyncOptions): React.ForwardRefExoticComponent | React.FunctionComponent | "keygen" | "menuitem" | "noindex" | "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" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "switch" | "textPath" | "tspan" | "use" | "view" | undefined; }> & React.RefAttributes>>;