import { FastifyRequest } from 'fastify';
import 'fastify-cookie';
import { CookieSerializeOptions } from 'cookie';
import * as jwt from 'jsonwebtoken';
import { Controller } from '@harmonyjs/types-server';
declare module 'fastify' {
    interface FastifyInstance {
        jwtAuthenticate: {
            block: (request: FastifyRequest, reply: FastifyReply<any>) => Promise<void>;
            try: (request: FastifyRequest) => Promise<void>;
        };
    }
}
declare type AuthenticationJWTConfig = {
    secret?: jwt.Secret | {
        public: jwt.Secret;
        private: jwt.Secret;
    };
    cookie?: {
        cookieName: string;
    } & CookieSerializeOptions;
    decode?: jwt.DecodeOptions;
    sign?: jwt.SignOptions;
    verify?: jwt.VerifyOptions;
    messages?: {
        badRequestErrorMessage?: string;
        noAuthorizationInHeaderMessage?: string;
        authorizationTokenExpiredMessage?: string;
        authorizationTokenInvalid?: ((err: Error) => string) | string;
        authorizationTokenUntrusted?: string;
    };
    trusted?: (request: FastifyRequest, decodedToken: {
        [k: string]: any;
    }) => boolean | Promise<boolean>;
};
declare const ControllerAuthenticationJWT: Controller<AuthenticationJWTConfig> & {
    validator: string;
};
export default ControllerAuthenticationJWT;
