@getcronit/pylon
Version:

25 lines (24 loc) • 786 B
TypeScript
import { Context as HonoContext } from 'hono';
import type { Toucan } from 'toucan-js';
import type { AuthState } from './plugins/use-auth';
import { AsyncLocalStorage } from 'async_hooks';
import type { GraphQLResolveInfo } from 'graphql';
export interface Bindings {
NODE_ENV: string;
AUTH_PROJECT_ID?: string;
AUTH_KEY?: string;
AUTH_ISSUER?: string;
}
export interface Variables {
auth: AuthState;
sentry: Toucan;
graphqlResolveInfo?: GraphQLResolveInfo;
}
export type Env = {
Bindings: Bindings;
Variables: Variables;
};
export type Context = HonoContext<Env, string, {}>;
export declare const asyncContext: AsyncLocalStorage<Context>;
export declare const getContext: () => Context;
export declare const setContext: (context: Context) => void;