type Request = { headers: Record; url: string; path: string; body: Record | string | null; method: string; query: Record; params: Record; ip: string; /** * Milliseconds timestamp when the request started */ startedAt: number; httpVersion: string; protocol: string; }; type Response = { type: '@response'; headers: Record; status: number; body: any; error: null | Error; }; type Props = { auth: TAuth; args: TArgs; services: TServices; request: TRequest; response: Response; framework: TFramework; }; type NextFunc = (props: TProps) => Promise; type SerializableJson = string | number | boolean | null | Date | SerializableJson[] | { [key: string]: SerializableJson; }; type InferProps = TFunc['_props']; type ExobaseBuilder = { init: (init: (func: (...args: any[]) => Promise) => (...args: any[]) => Promise) => Pick; root: (root: (func: (props: Props) => Promise) => (...args: TInitArgs) => Promise) => Pick, 'hook' | 'endpoint'>; hook: >> ERROR: The chain does not contain the required Services to pass to this hook', TRequiredAuth extends KCurrentAuth extends TRequiredAuth ? {} : '>>> ERROR: The chain does not contain the required Auth to pass to this hook', TRequiredArgs extends KCurrentArgs extends TRequiredArgs ? {} : '>>> ERROR: The chain does not contain the required Args to pass to this hook', TRequiredRequest extends KCurrentRequest extends TRequiredRequest ? Request : Request & '>>> ERROR: The chain does not contain the required Request to pass to this hook', TRequiredFramework extends KCurrentFramework extends TRequiredFramework ? {} : '>>> ERROR: The chain does not contain the required Framework to pass to this hook'>(hook: (func: (props: Props) => Promise) => (props: Props) => Promise) => Pick, 'hook' | 'endpoint'>; endpoint: >> ERROR: The chain does not contain the required Services to pass to this endpoint', TRequiredAuth extends KCurrentAuth extends TRequiredAuth ? {} : '>>> ERROR: The chain does not contain the required Auth to pass to this endpoint', TRequiredArgs extends KCurrentArgs extends TRequiredArgs ? {} : '>>> ERROR: The chain does not contain the required Args to pass to this endpoint', TRequiredRequest extends KCurrentRequest extends TRequiredRequest ? Request : Request & '>>> ERROR: The chain does not contain the required Request to pass to this endpoint', TRequiredFramework extends KCurrentFramework extends TRequiredFramework ? {} : '>>> ERROR: The chain does not contain the required Framework to pass to this endpoint'>(handler: (props: Props) => Promise) => ((...args: KInitArgs) => Promise) & { hooks: string[]; }; raw: { init: KInitArgs; args: KCurrentArgs; services: KCurrentServices; auth: KCurrentAuth; request: KCurrentRequest; framework: KCurrentFramework; }; }; declare const chain: (funcs?: Function[]) => ExobaseBuilder; declare const exo: () => Pick, "init" | "root">; type AttributesOnly = { [P in keyof T as P extends 'prototype' ? never : P]: T[P]; }; type MergeProps = Props extends infer A ? A extends {} ? A : {} : {}, UnionToIntersection extends infer B ? B extends {} ? B : {} : {}, UnionToIntersection extends infer C ? C extends {} ? C : {} : {}, UnionToIntersection extends infer D ? D extends Request ? D : Request : Request, UnionToIntersection extends infer E ? E extends {} ? E : {} : {}>; type UnionToIntersection = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never; declare function compose, ROP extends Props, RRF extends { (...args: RA): Promise; }, ER, EF extends (props: ROP) => any>(r: (func: (props: ROP) => any) => RRF, e: EF): RRF & { endpoint: EF; } & AttributesOnly & { _props: ROP; }; declare function compose, ROP extends Props, RRF extends { (...args: RA): Promise; }, H1IP extends Props, H1OP extends Props, H1RF extends (props: ROP extends H1IP ? H1IP : never) => Promise, H1R, ER, EF extends (props: MergeProps<[ROP, H1OP]>) => any>(r: (func: (props: ROP) => Promise) => RRF, h1: (func: (props: H1OP) => Promise) => H1RF, e: EF): RRF & { endpoint: EF; } & AttributesOnly & AttributesOnly & { _props: MergeProps<[ROP, H1OP]>; }; declare function compose, ROP extends Props, RRF extends { (...args: RA): Promise; }, H1IP extends Props, H1OP extends Props, H1RF extends (props: ROP extends H1IP ? H1IP : never) => Promise, H2IP extends Props, H2OP extends Props, H2RF extends (props: H1IP extends H2IP ? H2IP : never) => Promise, ER, EF extends (props: MergeProps<[ROP, H1OP, H2OP]>) => any>(r: (func: (props: ROP) => any) => RRF, h1: (func: (props: H1OP) => any) => H1RF, h2: (func: (props: H2OP) => any) => H2RF, e: EF): RRF & { endpoint: EF; } & AttributesOnly & AttributesOnly & AttributesOnly & { _props: MergeProps<[ROP, H1OP, H2OP]>; }; declare function compose, ROP extends Props, RRF extends { (...args: RA): Promise; }, H1IP extends Props, H1OP extends Props, H1RF extends (props: ROP extends H1IP ? H1IP : never) => Promise, H2IP extends Props, H2OP extends Props, H2RF extends (props: H1IP extends H2IP ? H2IP : never) => Promise, H3IP extends Props, H3OP extends Props, H3RF extends (props: H2IP extends H3IP ? H3IP : never) => Promise, ER, EF extends (props: MergeProps<[ROP, H1OP, H2OP, H3OP]>) => any>(r: (func: (props: ROP) => any) => RRF, h1: (func: (props: H1OP) => any) => H1RF, h2: (func: (props: H2OP) => any) => H2RF, h3: (func: (props: H3OP) => any) => H3RF, e: EF): RRF & { endpoint: EF; } & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & { _props: MergeProps<[ROP, H1OP, H2OP, H3OP]>; }; declare function compose, ROP extends Props, RRF extends { (...args: RA): Promise; }, H1IP extends Props, H1OP extends Props, H1RF extends (props: ROP extends H1IP ? H1IP : never) => Promise, H2IP extends Props, H2OP extends Props, H2RF extends (props: H1IP extends H2IP ? H2IP : never) => Promise, H3IP extends Props, H3OP extends Props, H3RF extends (props: H2IP extends H3IP ? H3IP : never) => Promise, H4IP extends Props, H4OP extends Props, H4RF extends (props: H3IP extends H4IP ? H4IP : never) => Promise, ER, EF extends (props: MergeProps<[ROP, H1OP, H2OP, H3OP, H4OP]>) => any>(r: (func: (props: ROP) => any) => RRF, h1: (func: (props: H1OP) => any) => H1RF, h2: (func: (props: H2OP) => any) => H2RF, h3: (func: (props: H3OP) => any) => H3RF, h4: (func: (props: H4OP) => any) => H4RF, e: EF): RRF & { endpoint: EF; } & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & { _props: MergeProps<[ROP, H1OP, H2OP, H3OP, H4OP]>; }; declare function compose, ROP extends Props, RRF extends { (...args: RA): Promise; }, H1IP extends Props, H1OP extends Props, H1RF extends (props: ROP extends H1IP ? H1IP : never) => Promise, H2IP extends Props, H2OP extends Props, H2RF extends (props: H1IP extends H2IP ? H2IP : never) => Promise, H3IP extends Props, H3OP extends Props, H3RF extends (props: H2IP extends H3IP ? H3IP : never) => Promise, H4IP extends Props, H4OP extends Props, H4RF extends (props: H3IP extends H4IP ? H4IP : never) => Promise, H5IP extends Props, H5OP extends Props, H5RF extends (props: H4IP extends H5IP ? H5IP : never) => Promise, ER, EF extends (props: MergeProps<[ROP, H1OP, H2OP, H3OP, H4OP, H5OP]>) => any>(r: (func: (props: ROP) => any) => RRF, h1: (func: (props: H1OP) => any) => H1RF, h2: (func: (props: H2OP) => any) => H2RF, h3: (func: (props: H3OP) => any) => H3RF, h4: (func: (props: H4OP) => any) => H4RF, h5: (func: (props: H5OP) => any) => H5RF, e: EF): RRF & { endpoint: EF; } & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & { _props: MergeProps<[ROP, H1OP, H2OP, H3OP, H4OP, H5OP]>; }; declare function compose, ROP extends Props, RRF extends { (...args: RA): Promise; }, H1IP extends Props, H1OP extends Props, H1RF extends (props: ROP extends H1IP ? H1IP : never) => Promise, H2IP extends Props, H2OP extends Props, H2RF extends (props: H1IP extends H2IP ? H2IP : never) => Promise, H3IP extends Props, H3OP extends Props, H3RF extends (props: H2IP extends H3IP ? H3IP : never) => Promise, H4IP extends Props, H4OP extends Props, H4RF extends (props: H3IP extends H4IP ? H4IP : never) => Promise, H5IP extends Props, H5OP extends Props, H5RF extends (props: H4IP extends H5IP ? H5IP : never) => Promise, H6IP extends Props, H6OP extends Props, H6RF extends (props: H5IP extends H6IP ? H6IP : never) => Promise, ER, EF extends (props: MergeProps<[ROP, H1OP, H2OP, H3OP, H4OP, H5OP, H6OP]>) => any>(r: (func: (props: ROP) => any) => RRF, h1: (func: (props: H1OP) => any) => H1RF, h2: (func: (props: H2OP) => any) => H2RF, h3: (func: (props: H3OP) => any) => H3RF, h4: (func: (props: H4OP) => any) => H4RF, h5: (func: (props: H5OP) => any) => H5RF, h6: (func: (props: H6OP) => any) => H6RF, e: EF): RRF & { endpoint: EF; } & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & { _props: MergeProps<[ROP, H1OP, H2OP, H3OP, H4OP, H5OP, H6OP]>; }; declare function compose, ROP extends Props, RRF extends { (...args: RA): Promise; }, H1IP extends Props, H1OP extends Props, H1RF extends (props: ROP extends H1IP ? H1IP : never) => Promise, H2IP extends Props, H2OP extends Props, H2RF extends (props: H1IP extends H2IP ? H2IP : never) => Promise, H3IP extends Props, H3OP extends Props, H3RF extends (props: H2IP extends H3IP ? H3IP : never) => Promise, H4IP extends Props, H4OP extends Props, H4RF extends (props: H3IP extends H4IP ? H4IP : never) => Promise, H5IP extends Props, H5OP extends Props, H5RF extends (props: H4IP extends H5IP ? H5IP : never) => Promise, H6IP extends Props, H6OP extends Props, H6RF extends (props: H5IP extends H6IP ? H6IP : never) => Promise, H7IP extends Props, H7OP extends Props, H7RF extends (props: H6IP extends H7IP ? H7IP : never) => Promise, ER, EF extends (props: MergeProps<[ROP, H1OP, H2OP, H3OP, H4OP, H5OP, H6OP, H7OP]>) => any>(r: (func: (props: ROP) => any) => RRF, h1: (func: (props: H1OP) => any) => H1RF, h2: (func: (props: H2OP) => any) => H2RF, h3: (func: (props: H3OP) => any) => H3RF, h4: (func: (props: H4OP) => any) => H4RF, h5: (func: (props: H5OP) => any) => H5RF, h6: (func: (props: H6OP) => any) => H6RF, h7: (func: (props: H7OP) => any) => H7RF, e: EF): RRF & { endpoint: EF; } & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & { _props: MergeProps<[ROP, H1OP, H2OP, H3OP, H4OP, H5OP, H6OP, H7OP]>; }; declare function compose, ROP extends Props, RRF extends { (...args: RA): Promise; }, H1IP extends Props, H1OP extends Props, H1RF extends (props: ROP extends H1IP ? H1IP : never) => Promise, H2IP extends Props, H2OP extends Props, H2RF extends (props: H1IP extends H2IP ? H2IP : never) => Promise, H3IP extends Props, H3OP extends Props, H3RF extends (props: H2IP extends H3IP ? H3IP : never) => Promise, H4IP extends Props, H4OP extends Props, H4RF extends (props: H3IP extends H4IP ? H4IP : never) => Promise, H5IP extends Props, H5OP extends Props, H5RF extends (props: H4IP extends H5IP ? H5IP : never) => Promise, H6IP extends Props, H6OP extends Props, H6RF extends (props: H5IP extends H6IP ? H6IP : never) => Promise, H7IP extends Props, H7OP extends Props, H7RF extends (props: H6IP extends H7IP ? H7IP : never) => Promise, H8IP extends Props, H8OP extends Props, H8RF extends (props: H7IP extends H8IP ? H8IP : never) => Promise, ER, EF extends (props: MergeProps<[ROP, H1OP, H2OP, H3OP, H4OP, H5OP, H6OP, H7OP, H8OP]>) => any>(r: (func: (props: ROP) => any) => RRF, h1: (func: (props: H1OP) => any) => H1RF, h2: (func: (props: H2OP) => any) => H2RF, h3: (func: (props: H3OP) => any) => H3RF, h4: (func: (props: H4OP) => any) => H4RF, h5: (func: (props: H5OP) => any) => H5RF, h6: (func: (props: H6OP) => any) => H6RF, h7: (func: (props: H7OP) => any) => H7RF, h8: (func: (props: H8OP) => any) => H8RF, e: EF): RRF & { endpoint: EF; } & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & { _props: MergeProps<[ROP, H1OP, H2OP, H3OP, H4OP, H5OP, H6OP, H7OP, H8OP]>; }; declare function compose, ROP extends Props, RRF extends { (...args: RA): Promise; }, H1IP extends Props, H1OP extends Props, H1RF extends (props: ROP extends H1IP ? H1IP : never) => Promise, H2IP extends Props, H2OP extends Props, H2RF extends (props: H1IP extends H2IP ? H2IP : never) => Promise, H3IP extends Props, H3OP extends Props, H3RF extends (props: H2IP extends H3IP ? H3IP : never) => Promise, H4IP extends Props, H4OP extends Props, H4RF extends (props: H3IP extends H4IP ? H4IP : never) => Promise, H5IP extends Props, H5OP extends Props, H5RF extends (props: H4IP extends H5IP ? H5IP : never) => Promise, H6IP extends Props, H6OP extends Props, H6RF extends (props: H5IP extends H6IP ? H6IP : never) => Promise, H7IP extends Props, H7OP extends Props, H7RF extends (props: H6IP extends H7IP ? H7IP : never) => Promise, H8IP extends Props, H8OP extends Props, H8RF extends (props: H7IP extends H8IP ? H8IP : never) => Promise, H9IP extends Props, H9OP extends Props, H9RF extends (props: H8IP extends H9IP ? H9IP : never) => Promise, ER, EF extends (props: MergeProps<[ ROP, H1OP, H2OP, H3OP, H4OP, H5OP, H6OP, H7OP, H8OP, H9OP ]>) => any>(r: (func: (props: ROP) => any) => RRF, h1: (func: (props: H1OP) => any) => H1RF, h2: (func: (props: H2OP) => any) => H2RF, h3: (func: (props: H3OP) => any) => H3RF, h4: (func: (props: H4OP) => any) => H4RF, h5: (func: (props: H5OP) => any) => H5RF, h6: (func: (props: H6OP) => any) => H6RF, h7: (func: (props: H7OP) => any) => H7RF, h8: (func: (props: H8OP) => any) => H8RF, h9: (func: (props: H9OP) => any) => H9RF, e: EF): RRF & { endpoint: EF; } & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & { _props: MergeProps<[ ROP, H1OP, H2OP, H3OP, H4OP, H5OP, H6OP, H7OP, H8OP, H9OP ]>; }; declare function compose, ROP extends Props, RRF extends { (...args: RA): Promise; }, H1IP extends Props, H1OP extends Props, H1RF extends (props: ROP extends H1IP ? H1IP : never) => Promise, H2IP extends Props, H2OP extends Props, H2RF extends (props: H1IP extends H2IP ? H2IP : never) => Promise, H3IP extends Props, H3OP extends Props, H3RF extends (props: H2IP extends H3IP ? H3IP : never) => Promise, H4IP extends Props, H4OP extends Props, H4RF extends (props: H3IP extends H4IP ? H4IP : never) => Promise, H5IP extends Props, H5OP extends Props, H5RF extends (props: H4IP extends H5IP ? H5IP : never) => Promise, H6IP extends Props, H6OP extends Props, H6RF extends (props: H5IP extends H6IP ? H6IP : never) => Promise, H7IP extends Props, H7OP extends Props, H7RF extends (props: H6IP extends H7IP ? H7IP : never) => Promise, H8IP extends Props, H8OP extends Props, H8RF extends (props: H7IP extends H8IP ? H8IP : never) => Promise, H9IP extends Props, H9OP extends Props, H9RF extends (props: H8IP extends H9IP ? H9IP : never) => Promise, H10IP extends Props, H10OP extends Props, H10RF extends (props: H9IP extends H10IP ? H10IP : never) => Promise, ER, EF extends (props: MergeProps<[ ROP, H1OP, H2OP, H3OP, H4OP, H5OP, H6OP, H7OP, H8OP, H9OP, H10OP ]>) => any>(r: (func: (props: ROP) => any) => RRF, h1: (func: (props: H1OP) => any) => H1RF, h2: (func: (props: H2OP) => any) => H2RF, h3: (func: (props: H3OP) => any) => H3RF, h4: (func: (props: H4OP) => any) => H4RF, h5: (func: (props: H5OP) => any) => H5RF, h6: (func: (props: H6OP) => any) => H6RF, h7: (func: (props: H7OP) => any) => H7RF, h8: (func: (props: H8OP) => any) => H8RF, h9: (func: (props: H9OP) => any) => H9RF, h10: (func: (props: H10OP) => any) => H10RF, e: EF): RRF & { endpoint: EF; } & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & { _props: MergeProps<[ ROP, H1OP, H2OP, H3OP, H4OP, H5OP, H6OP, H7OP, H8OP, H9OP, H10OP ]>; }; declare function compose, ROP extends Props, RRF extends { (...args: RA): Promise; }, H1IP extends Props, H1OP extends Props, H1RF extends (props: ROP extends H1IP ? H1IP : never) => Promise, H2IP extends Props, H2OP extends Props, H2RF extends (props: H1IP extends H2IP ? H2IP : never) => Promise, H3IP extends Props, H3OP extends Props, H3RF extends (props: H2IP extends H3IP ? H3IP : never) => Promise, H4IP extends Props, H4OP extends Props, H4RF extends (props: H3IP extends H4IP ? H4IP : never) => Promise, H5IP extends Props, H5OP extends Props, H5RF extends (props: H4IP extends H5IP ? H5IP : never) => Promise, H6IP extends Props, H6OP extends Props, H6RF extends (props: H5IP extends H6IP ? H6IP : never) => Promise, H7IP extends Props, H7OP extends Props, H7RF extends (props: H6IP extends H7IP ? H7IP : never) => Promise, H8IP extends Props, H8OP extends Props, H8RF extends (props: H7IP extends H8IP ? H8IP : never) => Promise, H9IP extends Props, H9OP extends Props, H9RF extends (props: H8IP extends H9IP ? H9IP : never) => Promise, H10IP extends Props, H10OP extends Props, H10RF extends (props: H9IP extends H10IP ? H10IP : never) => Promise, H11IP extends Props, H11OP extends Props, H11RF extends (props: H10IP extends H11IP ? H11IP : never) => Promise, ER, EF extends (props: MergeProps<[ ROP, H1OP, H2OP, H3OP, H4OP, H5OP, H6OP, H7OP, H8OP, H9OP, H10OP, H11OP ]>) => any>(r: (func: (props: ROP) => any) => RRF, h1: (func: (props: H1OP) => any) => H1RF, h2: (func: (props: H2OP) => any) => H2RF, h3: (func: (props: H3OP) => any) => H3RF, h4: (func: (props: H4OP) => any) => H4RF, h5: (func: (props: H5OP) => any) => H5RF, h6: (func: (props: H6OP) => any) => H6RF, h7: (func: (props: H7OP) => any) => H7RF, h8: (func: (props: H8OP) => any) => H8RF, h9: (func: (props: H9OP) => any) => H9RF, h10: (func: (props: H10OP) => any) => H10RF, h11: (func: (props: H11OP) => any) => H11RF, e: EF): RRF & { endpoint: EF; } & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & { _props: MergeProps<[ ROP, H1OP, H2OP, H3OP, H4OP, H5OP, H6OP, H7OP, H8OP, H9OP, H10OP, H11OP ]>; }; declare function compose, ROP extends Props, RRF extends { (...args: RA): Promise; }, H1IP extends Props, H1OP extends Props, H1RF extends (props: ROP extends H1IP ? H1IP : never) => Promise, H2IP extends Props, H2OP extends Props, H2RF extends (props: H1IP extends H2IP ? H2IP : never) => Promise, H3IP extends Props, H3OP extends Props, H3RF extends (props: H2IP extends H3IP ? H3IP : never) => Promise, H4IP extends Props, H4OP extends Props, H4RF extends (props: H3IP extends H4IP ? H4IP : never) => Promise, H5IP extends Props, H5OP extends Props, H5RF extends (props: H4IP extends H5IP ? H5IP : never) => Promise, H6IP extends Props, H6OP extends Props, H6RF extends (props: H5IP extends H6IP ? H6IP : never) => Promise, H7IP extends Props, H7OP extends Props, H7RF extends (props: H6IP extends H7IP ? H7IP : never) => Promise, H8IP extends Props, H8OP extends Props, H8RF extends (props: H7IP extends H8IP ? H8IP : never) => Promise, H9IP extends Props, H9OP extends Props, H9RF extends (props: H8IP extends H9IP ? H9IP : never) => Promise, H10IP extends Props, H10OP extends Props, H10RF extends (props: H9IP extends H10IP ? H10IP : never) => Promise, H11IP extends Props, H11OP extends Props, H11RF extends (props: H10IP extends H11IP ? H11IP : never) => Promise, H12IP extends Props, H12OP extends Props, H12RF extends (props: H11IP extends H12IP ? H12IP : never) => Promise, ER, EF extends (props: MergeProps<[ ROP, H1OP, H2OP, H3OP, H4OP, H5OP, H6OP, H7OP, H8OP, H9OP, H10OP, H11OP, H12OP ]>) => any>(r: (func: (props: ROP) => any) => RRF, h1: (func: (props: H1OP) => any) => H1RF, h2: (func: (props: H2OP) => any) => H2RF, h3: (func: (props: H3OP) => any) => H3RF, h4: (func: (props: H4OP) => any) => H4RF, h5: (func: (props: H5OP) => any) => H5RF, h6: (func: (props: H6OP) => any) => H6RF, h7: (func: (props: H7OP) => any) => H7RF, h8: (func: (props: H8OP) => any) => H8RF, h9: (func: (props: H9OP) => any) => H9RF, h10: (func: (props: H10OP) => any) => H10RF, h11: (func: (props: H11OP) => any) => H11RF, h12: (func: (props: H12OP) => any) => H12RF, e: EF): RRF & { endpoint: EF; } & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & AttributesOnly & { _props: MergeProps<[ ROP, H1OP, H2OP, H3OP, H4OP, H5OP, H6OP, H7OP, H8OP, H9OP, H10OP, H11OP, H12OP ]>; }; declare class ExobaseError extends Error { metadata: Omit; key: string; status: number; cause?: Error; constructor(message: string, metadata: TMetadata & { key: string; cause?: Error; }); } declare class BadRequestError extends ExobaseError { status: number; } declare class NotAuthenticatedError extends ExobaseError { status: number; } declare class NotAuthorizedError extends ExobaseError { status: number; } declare class RateLimitError extends ExobaseError { status: number; } declare class InternalServerError extends ExobaseError { status: number; } /** * A helper function to more easily create hook * functions. Encapsulates some of the boiler * plate needed to create the hook structure. * * @example * const useCors = () => hook((func, props) => { * return await func(addCorsHeaders(props)) * }) */ declare function hook(fn: (func: (props: TProducedProps) => any) => (props: TGivenProps) => Promise): (func: (props: TProducedProps) => any) => (props: TGivenProps) => Promise; declare const props: (request: Request) => Props; /** * There is a 1 in 1,000,000,000 chance that someone may * return an object with _type equal to '@response' * and this will break. Nobody do that... */ declare const isResponse: (res: any) => res is Response; declare const defaultResponse: Response; declare const responseFromResult: (result: any) => Response; declare const responseFromError: (error: any) => Response; declare const response: (error: any, result: any) => Response; /** * Generate a response object * * @example * ```ts * const { res } from '@exobase/core' * * const handler = async () => { * return res(401, { * message: 'Not Authorized' * }) * } * * compose(useNext(), handler) * ``` */ declare function res(): Response; declare function res(body: SerializableJson): Response; declare function res(status: number): Response; declare function res(status: number, body: SerializableJson): Response; export { BadRequestError, ExobaseBuilder, ExobaseError, InferProps, InternalServerError, NextFunc, NotAuthenticatedError, NotAuthorizedError, Props, RateLimitError, Request, Response, SerializableJson, chain, compose, exo as default, defaultResponse, exo, hook, isResponse, props, res, response, responseFromError, responseFromResult };