<commit_before>import * as jwt from 'jsonwebtoken';
import * as express from 'express';
import expressUnless from 'express-unless';
import { UnauthorizedError } from './errors/UnauthorizedError';

export type GetVerificationKey = (req: express.Request, token: jwt.Jwt | undefined) => jwt.Secret | Promise<jwt.Secret>;

//deprecates key callback types for backward compatibility with v6
export type SecretCallback = GetVerificationKey;
export type SecretCallbackLong = GetVerificationKey;
//

export type IsRevoked = (req: express.Request, token: jwt.Jwt | undefined) => boolean | Promise<boolean>;
export type TokenGetter = (req: express.Request) => string | Promise<string> | undefined;

type Params = {
  secret: jwt.Secret | GetVerificationKey,
  getToken?: TokenGetter,
  isRevoked?: IsRevoked,
  credentialsRequired?: boolean,
  requestProperty?: string,
} & jwt.VerifyOptions;<commit_msg>make algorithms a required parameter in types. closes #285<commit_after>import * as jwt from 'jsonwebtoken';
import * as express from 'express';
import expressUnless from 'express-unless';
import { UnauthorizedError } from './errors/UnauthorizedError';

export type GetVerificationKey = (req: express.Request, token: jwt.Jwt | undefined) => jwt.Secret | Promise<jwt.Secret>;

//deprecates key callback types for backward compatibility with v6
export type SecretCallback = GetVerificationKey;
export type SecretCallbackLong = GetVerificationKey;
//

export type IsRevoked = (req: express.Request, token: jwt.Jwt | undefined) => boolean | Promise<boolean>;
export type TokenGetter = (req: express.Request) => string | Promise<string> | undefined;

type Params = {
  secret: jwt.Secret | GetVerificationKey,
  getToken?: TokenGetter,
  isRevoked?: IsRevoked,
  credentialsRequired?: boolean,
  requestProperty?: string,
  algorithms: jwt.Algorithm[] | undefined;
} & jwt.VerifyOptions;
{'fraction_non_alphanumeric': 0.10767590618336886, 'fraction_numerical': 0.0026652452025586353, 'mean_word_length': 5.727598566308243, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4349390', 'n_tokens_mistral': 530, 'n_tokens_neox': 530, 'n_words': 164}