import { HTMLStencilElement } from '@stencil/core/internal';
import { ContextProvider, ListenerOptions } from 'dom-context';
export declare function createContext(name: string, initial?: T): {
useContext: (options?: PollingOpts) => T;
useContextState: (initialState?: T) => readonly [T, StateUpdater, ContextProvider];
Listener: new (o: Pick, "element" | "onChange" | "onStatus" | "pollingMs" | "attempts">) => import("dom-context").ContextListener;
listen(o: Pick, "element" | "onChange" | "onStatus" | "pollingMs" | "attempts">): import("dom-context").ContextListener;
Provider: new (o: Pick, "element" | "initialState">) => ContextProvider;
provide(o: Pick, "element" | "initialState">): ContextProvider;
provideGlobally(next: T): void;
name: string;
};
export declare function useComponent(): T;
export declare function useHost(): HTMLStencilElement;
declare type PollingOpts = Omit, 'contextName' | 'element' | 'onChange'>;
/**
* Uses the parent context, if it exists. Similar to React's `useContext`
*
* Since this uses `dom-context` as the library, functional components can't provide context
*
* @param contextName
*/
export declare function useDomContext(contextName: string, options?: PollingOpts): T | undefined;
declare type NewState = T | ((previousState?: T) => T);
declare type StateUpdater = (value: NewState) => void;
/**
* Similar to `useState` except the state is shared with children
*/
export declare function useDomContextState(contextName: string, initialState?: T): readonly [T, StateUpdater, ContextProvider];
export {};