import { ReqUser } from "../models/ReqUser"; import { Request } from "../models/Http"; interface RequestStore { /** * The current request's user. * * NOTE: This should not be used left and right and always in a way that makes it SUPER clear where it comes from. **/ user?: ReqUser; /** * The current request's request id, should be passed in the headers of all outgoing requests. * * Will be automatically be added to any requests made with the clients extending FairtrailClient. **/ reqId: string; } type RequestContext = Request | string; /** * Runs the inputted function within a async context that has access to the current request's store. * * Happens automatically when registering endpoints through the package. * * @throws Any error thrown by the inputted function */ export declare function runWithRequestContext(reqContext: RequestContext, fn: () => void): Promise; /** Access to the current request's store */ export declare function useReqStore(): RequestStore; export {};