Updating some sign and verify interfaces to jsonwebtoken v5.7.0

This commit is contained in:
Samuel Horwitz
2016-02-27 14:24:04 -05:00
parent 163a427719
commit ca9ebadd87

View File

@@ -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