mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 04:49:15 +08:00
Updating some sign and verify interfaces to jsonwebtoken v5.7.0
This commit is contained in:
17
jsonwebtoken/jsonwebtoken.d.ts
vendored
17
jsonwebtoken/jsonwebtoken.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for jsonwebtoken 0.4.0
|
||||
// Type definitions for jsonwebtoken 5.7.0
|
||||
// Project: https://github.com/auth0/node-jsonwebtoken
|
||||
// Definitions by: Maxime LUCE <https://github.com/SomaticIT>, Daniel Heim <https://github.com/danielheim>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
@@ -22,17 +22,20 @@ declare module "jsonwebtoken" {
|
||||
* - none: No digital signature or MAC value included
|
||||
*/
|
||||
algorithm?: string;
|
||||
/**
|
||||
/**
|
||||
*@deprecated - see expiresIn
|
||||
*@member {number} - Lifetime for the token in minutes
|
||||
*@member {number} - Lifetime for the token in minutes
|
||||
*/
|
||||
expiresInMinutes?: number;
|
||||
/** @member {string} - Lifetime for the token expressed in a string describing a time span [rauchg/ms](https://github.com/rauchg/ms.js). Eg: `60`, `"2 days"`, `"10h"`, `"7d"` */
|
||||
expiresIn?: string;
|
||||
notBefore?: string;
|
||||
audience?: string;
|
||||
subject?: string;
|
||||
issuer?: string;
|
||||
jwtid?: string;
|
||||
noTimestamp?: boolean;
|
||||
headers?: Object;
|
||||
}
|
||||
|
||||
export interface VerifyOptions {
|
||||
@@ -40,6 +43,12 @@ declare module "jsonwebtoken" {
|
||||
audience?: string;
|
||||
issuer?: string;
|
||||
ignoreExpiration?: boolean;
|
||||
ignoreNotBefore?: boolean;
|
||||
subject?: string;
|
||||
/**
|
||||
*@deprecated
|
||||
*@member {string} - Max age of token
|
||||
*/
|
||||
maxAge?: string;
|
||||
}
|
||||
|
||||
@@ -74,7 +83,7 @@ declare module "jsonwebtoken" {
|
||||
*/
|
||||
export function sign(payload: string | Buffer | Object, secretOrPrivateKey: string | Buffer, callback: SignCallback): void;
|
||||
export function sign(payload: string | Buffer | Object, secretOrPrivateKey: string | Buffer, options: SignOptions, callback: SignCallback): void;
|
||||
|
||||
|
||||
/**
|
||||
* Synchronously verify given token using a secret or a public key to get a decoded token
|
||||
* @param {String} token - JWT string to verify
|
||||
|
||||
Reference in New Issue
Block a user