import { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify'; import { GrantSession } from 'grant'; import * as t from 'io-ts'; declare module '@fastify/session' { interface FastifySessionObject { grant: GrantSession; user: unknown; } } export type DefaultToken = { email_verified: Readonly; name: Readonly; preferred_username: Readonly; given_name: Readonly; family_name: Readonly; }; declare const KeycloakOptions: t.IntersectionC<[t.TypeC<{ appOrigin: t.ReadonlyC>; keycloakSubdomain: t.ReadonlyC>; clientId: t.ReadonlyC; clientSecret: t.ReadonlyC; }>, t.PartialC<{ useHttps: t.ReadonlyC; logoutEndpoint: t.ReadonlyC; excludedPatterns: t.ReadonlyC>; scope: t.ArrayC>; callback: t.ReadonlyC; disableCookiePlugin: t.ReadonlyC; disableSessionPlugin: t.ReadonlyC; retries: t.ReadonlyC; autoRefreshToken: t.ReadonlyC; usePostLogoutRedirect: t.ReadonlyC; }>]>; export type KeycloakOptions = t.TypeOf & { userPayloadMapper?: (tokenPayload: unknown) => object; unauthorizedHandler?: (request: FastifyRequest, reply: FastifyReply) => void; bypassFn?: (request: FastifyRequest) => boolean | Promise; }; declare const _default: (fastify: FastifyInstance, opts: KeycloakOptions) => Promise; export default _default;