import type { Return } from '@kraftr/errors'; import { ContextNotFound, ScopeNotFound } from '../errors'; import { Context } from './context'; /** * Get the actual context can throw an exception since try running injection without context is undesirable * @returns Actual context */ export declare function getContext(): Return; export declare function openContext(scope?: string): Return; export declare function closeContext(): void; export declare function useContext(ctx: Context, fn: (ctx: Context) => Promise): Promise; export declare function useContext(ctx: Context, fn: (ctx: Context) => T): T; export declare function useContext(ctx: Context, fn: (ctx: Context) => void): void; export declare function createContext(fn: (ctx: Context) => Promise, scope?: string): Promise; export declare function createContext(fn: (ctx: Context) => T, scope?: string): T; export declare function createContext(fn: (ctx: Context) => void, scope?: string): void; export declare function useScope(scope: string, fnScoped: () => void): Return;