declare function getOwnerWindow(node?: HTMLElement | null): Window & typeof globalThis;
declare function getOwnerDocument(node?: HTMLElement | null): Document;
declare function canUseDOM(): boolean;
declare function contains(parent: HTMLElement, child: HTMLElement): boolean;
export interface CreateContextOptions {
/**
* If `true`, React will throw if context is `null` or `undefined`
* In some cases, you might want to support nested context, so you can set it to `false`
*/
strict?: boolean;
/**
* Error message to throw if the context is `undefined`
*/
errorMessage?: string;
/**
* The display name of the context
*/
name?: string;
}
export type CreateContextReturn = [
React.Provider,
() => T,
React.Context
];
declare function createContext(options?: CreateContextOptions): CreateContextReturn;
declare function getValidChildren(children: React.ReactNode): React.ReactElement[];
export type ReactRef = React.Ref | React.RefObject | React.MutableRefObject;
declare function assignRef(ref: ReactRef | undefined, value: T): void;
declare function mergeRefs(...refs: Array | undefined>): (value: T) => void;
export declare const utils: {
isBrowser: boolean;
canUseDOM: typeof canUseDOM;
contains: typeof contains;
logInfo: {
(...args: any[]): void;
enabled: boolean;
};
deepEqual: (foo: any, bar: any) => boolean;
getOwnerDocument: typeof getOwnerDocument;
getOwnerWindow: typeof getOwnerWindow;
assignRef: typeof assignRef;
createContext: typeof createContext;
getValidChildren: typeof getValidChildren;
mergeRefs: typeof mergeRefs;
getFullUrlHref: () => string;
promiseAllSettled: (...promises: Array<() => Promise>) => Promise;
};
export {};