1 | import React, { Context, ComponentType } from 'react';
|
2 | import { ResolverOptions } from '@shopify/async';
|
3 | import { AsyncComponentType } from './types';
|
4 | interface Options<Value> extends ResolverOptions<Value> {
|
5 | }
|
6 | interface ProviderProps {
|
7 | children?: React.ReactNode;
|
8 | }
|
9 | interface ConsumerProps<Value> {
|
10 | children(value: Value | null): React.ReactNode;
|
11 | }
|
12 | export interface AsyncContextType<Value> {
|
13 | Context: React.Context<Value | null>;
|
14 | }
|
15 | export interface AsyncContextType<Value> extends AsyncComponentType<Value, never, {}, {}, {}> {
|
16 | Context: Context<Value | null>;
|
17 | Provider: ComponentType<ProviderProps>;
|
18 | Consumer: ComponentType<ConsumerProps<Value>>;
|
19 | }
|
20 | export declare function createAsyncContext<Value>({ id, load, }: Options<Value>): AsyncContextType<Value>;
|
21 | export {};
|