import * as _tern_secure_types from '@tern-secure/types'; import { TernSecureInstanceTree, TernSecureAuthProvider, TernSecureState, TernSecureAuth } from '@tern-secure/types'; import * as react from 'react'; import react__default from 'react'; declare const useTernSecure: () => TernSecureInstanceTree; type TernSecureAuthContextType = { authProvider: TernSecureAuthProvider | null | undefined; authState: TernSecureState; }; declare const TernSecureInstanceContext: react.Context<{ value: TernSecureInstanceTree; } | undefined>; declare const useTernSecureInstanceContext: () => TernSecureInstanceTree; declare const TernSecureAuthContext: react.Context<{ value: TernSecureAuthContextType; } | undefined>; declare const useTernSecureAuthContext: () => TernSecureAuthContextType; declare const SessionContext: react.Context<{ value: _tern_secure_types.SignedInSession | null; } | undefined>; declare const useSessionContext: () => _tern_secure_types.SignedInSession | null; declare const UserContext: react.Context<{ value: _tern_secure_types.TernSecureUser | null; } | undefined>; declare const useUserContext: () => _tern_secure_types.TernSecureUser | null; declare function useAssertWrappedByTernSecureProvider(displayNameOrFn: string | (() => void)): void; /** * Assert that the context value exists, otherwise throw an error. * * @internal */ declare function assertContextExists(contextVal: unknown, msgOrCtx: string | react__default.Context): asserts contextVal; type Options = { assertCtxFn?: (v: unknown, msg: string) => void; }; type ContextAndHook = react__default.Context<{ value: T; } | undefined>; type UseCtxFn = () => T; /** * Create and return a Context and two hooks that return the context value. * The Context type is derived from the type passed in by the user. * * The first hook returned guarantees that the context exists so the returned value is always `CtxValue` * The second hook makes no guarantees, so the returned value can be `CtxValue | undefined` * * @internal */ declare const createContextAndHook: (displayName: string, options?: Options) => [ContextAndHook, UseCtxFn, UseCtxFn>]; declare const TernSecureAuthCtx: react.Context<{ value: TernSecureAuth; } | undefined>; declare const useTernSecureAuthCtx: () => TernSecureAuth; declare function useAssertWrappedByTernSecureAuthProvider(displayNameOrFn: string | (() => void)): void; export { SessionContext, TernSecureAuthContext, TernSecureAuthCtx, TernSecureInstanceContext, UserContext, assertContextExists, createContextAndHook, useAssertWrappedByTernSecureAuthProvider, useAssertWrappedByTernSecureProvider, useSessionContext, useTernSecure, useTernSecureAuthContext, useTernSecureAuthCtx, useTernSecureInstanceContext, useUserContext };