mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-13 21:40:21 +00:00
added in custom error classes
added in the custom error classes that are used for the verify tokens.
This commit is contained in:
Vendored
+19
-1
@@ -7,6 +7,24 @@
|
||||
|
||||
declare module "jsonwebtoken" {
|
||||
|
||||
export class JsonWebTokenError extends Error {
|
||||
inner: Error;
|
||||
|
||||
constructor(message: string, error?: Error);
|
||||
}
|
||||
|
||||
export class TokenExpiredError extends JsonWebTokenError {
|
||||
expiredAt: number;
|
||||
|
||||
constructor(message: string, expiredAt: number);
|
||||
}
|
||||
|
||||
export class NotBeforeError extends JsonWebTokenError {
|
||||
date: Date;
|
||||
|
||||
constructor(message: string, date: Date);
|
||||
}
|
||||
|
||||
export interface SignOptions {
|
||||
/**
|
||||
* Signature algorithm. Could be one of these values :
|
||||
@@ -53,7 +71,7 @@ declare module "jsonwebtoken" {
|
||||
}
|
||||
|
||||
export interface VerifyCallback {
|
||||
(err: Error, decoded: any): void;
|
||||
(err: JsonWebTokenError | TokenExpiredError | NotBeforeError, decoded: any): void;
|
||||
}
|
||||
|
||||
export interface SignCallback {
|
||||
|
||||
Reference in New Issue
Block a user