import { ReactNode, ComponentType } from 'react'; import { ResolverOptions, DeferTiming } from '@shopify/async'; import { AsyncComponentType } from './types'; interface Options extends ResolverOptions> { defer?: DeferTiming | ((props: Props) => boolean); deferHydration?: DeferTiming | ((props: Props) => boolean); displayName?: string; renderLoading?(props: Props): ReactNode; renderError?(error: Error): ReactNode; /** * Custom logic to use for the usePreload hook of the new, async * component. Because this logic will be used as part of a generated * custom hook, it must follow the rules of hooks. */ usePreload?(props: PreloadOptions): () => void; /** * Custom logic to use for the usePrefetch hook of the new, async * component. Because this logic will be used as part of a generated * custom hook, it must follow the rules of hooks. */ usePrefetch?(props: PrefetchOptions): () => void; /** * Custom logic to use for the useKeepFresh hook of the new, async * component. Because this logic will be used as part of a generated * custom hook, it must follow the rules of hooks. */ useKeepFresh?(props: KeepFreshOptions): () => void; } export declare function createAsyncComponent({ id, load, defer, deferHydration, displayName, renderLoading, renderError, usePreload: useCustomPreload, usePrefetch: useCustomPrefetch, useKeepFresh: useCustomKeepFresh, }: Options): AsyncComponentType, Props, PreloadOptions, PrefetchOptions, KeepFreshOptions>; export {};