From f0d25f25f893335f62ca489edd941fb9524097cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brikou=20Carr=C3=A9?= Date: Tue, 21 Nov 2017 22:22:34 +0100 Subject: [PATCH] Typo with jwtid params --- types/jsonwebtoken/index.d.ts | 64 +++++++++++++++++++++++++++-------- 1 file changed, 50 insertions(+), 14 deletions(-) diff --git a/types/jsonwebtoken/index.d.ts b/types/jsonwebtoken/index.d.ts index 335a6f52b7..766042e627 100644 --- a/types/jsonwebtoken/index.d.ts +++ b/types/jsonwebtoken/index.d.ts @@ -1,6 +1,8 @@ -// Type definitions for jsonwebtoken 7.2.0 +// Type definitions for jsonwebtoken 7.2.1 // Project: https://github.com/auth0/node-jsonwebtoken -// Definitions by: Maxime LUCE , Daniel Heim +// Definitions by: Maxime LUCE , +// Daniel Heim , +// Brice BERNARD // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -51,7 +53,6 @@ export interface SignOptions { noTimestamp?: boolean; header?: object; encoding?: string; - } export interface VerifyOptions { @@ -61,7 +62,7 @@ export interface VerifyOptions { issuer?: string | string[]; ignoreExpiration?: boolean; ignoreNotBefore?: boolean; - jwtId?: string; + jwtid?: string; subject?: string; /** *@deprecated @@ -76,14 +77,17 @@ export interface DecodeOptions { } export interface VerifyCallback { - (err: JsonWebTokenError | NotBeforeError | TokenExpiredError, decoded: object | string): void; + ( + err: JsonWebTokenError | NotBeforeError | TokenExpiredError, + decoded: object | string, + ): void; } export interface SignCallback { (err: Error, encoded: string): void; } -export type Secret = string | Buffer | {key: string, passphrase: string} +export type Secret = string | Buffer | { key: string; passphrase: string }; /** * Synchronously sign the given payload into a JSON Web Token string @@ -92,7 +96,11 @@ export type Secret = string | Buffer | {key: string, passphrase: string} * @param {SignOptions} [options] - Options for the signature * @returns {String} The JSON Web Token string */ -export declare function sign(payload: string | Buffer | object, secretOrPrivateKey: Secret, options?: SignOptions): string; +export declare function sign( + payload: string | Buffer | object, + secretOrPrivateKey: Secret, + options?: SignOptions, +): string; /** * Sign the given payload into a JSON Web Token string @@ -101,8 +109,17 @@ export declare function sign(payload: string | Buffer | object, secretOrPrivateK * @param {SignOptions} [options] - Options for the signature * @param {Function} callback - Callback to get the encoded token on */ -export declare function sign(payload: string | Buffer | object, secretOrPrivateKey: Secret, callback: SignCallback): void; -export declare function sign(payload: string | Buffer | object, secretOrPrivateKey: Secret, options: SignOptions, callback: SignCallback): void; +export declare function sign( + payload: string | Buffer | object, + secretOrPrivateKey: Secret, + callback: SignCallback, +): void; +export declare function sign( + payload: string | Buffer | object, + secretOrPrivateKey: Secret, + options: SignOptions, + callback: SignCallback, +): void; /** * Synchronously verify given token using a secret or a public key to get a decoded token @@ -111,8 +128,15 @@ export declare function sign(payload: string | Buffer | object, secretOrPrivateK * @param {VerifyOptions} [options] - Options for the verification * @returns The decoded token. */ -declare function verify(token: string, secretOrPublicKey: string | Buffer): object | string; -declare function verify(token: string, secretOrPublicKey: string | Buffer, options?: VerifyOptions): object | string; +declare function verify( + token: string, + secretOrPublicKey: string | Buffer, +): object | string; +declare function verify( + token: string, + secretOrPublicKey: string | Buffer, + options?: VerifyOptions, +): object | string; /** * Asynchronously verify given token using a secret or a public key to get a decoded token @@ -121,8 +145,17 @@ declare function verify(token: string, secretOrPublicKey: string | Buffer, optio * @param {VerifyOptions} [options] - Options for the verification * @param {Function} callback - Callback to get the decoded token on */ -declare function verify(token: string, secretOrPublicKey: string | Buffer, callback?: VerifyCallback): void; -declare function verify(token: string, secretOrPublicKey: string | Buffer, options?: VerifyOptions, callback?: VerifyCallback): void; +declare function verify( + token: string, + secretOrPublicKey: string | Buffer, + callback?: VerifyCallback, +): void; +declare function verify( + token: string, + secretOrPublicKey: string | Buffer, + options?: VerifyOptions, + callback?: VerifyCallback, +): void; /** * Returns the decoded payload without verifying if the signature is valid. @@ -130,4 +163,7 @@ declare function verify(token: string, secretOrPublicKey: string | Buffer, optio * @param {DecodeOptions} [options] - Options for decoding * @returns {Object} The decoded Token */ -declare function decode(token: string, options?: DecodeOptions): null | object | string; +declare function decode( + token: string, + options?: DecodeOptions, +): null | object | string;