Skip to main content

fast-jwt

This is the doc comment for file1.ts

Specify this is a module comment and rename it to my-module:

Classes​

Other Functions​

Primary API Functions​

Interfaces​

Type aliases​

Algorithm​

Ƭ Algorithm: "none" | "HS256" | "HS384" | "HS512" | "ES256" | "ES384" | "ES512" | "RS256" | "RS384" | "RS512" | "PS256" | "PS384" | "PS512" | "EdDSA"


SignerCallback​

Ƭ SignerCallback: (e: Error | TokenError | null, token: string) => void

Type declaration​

â–¸ (e, token): void

Parameters​
NameType
eError | TokenError | null
tokenstring
Returns​

void


VerifierCallback​

Ƭ VerifierCallback: (e: Error | TokenError | null, payload: any) => void

Type declaration​

â–¸ (e, payload): void

Parameters​
NameType
eError | TokenError | null
payloadany
Returns​

void


KeyFetcher​

Ƭ KeyFetcher: (header: { [key: string]: any; }) => Promise<string | Buffer> | (header: { [key: string]: any; }, cb: (err: Error | TokenError | null, key: string | Buffer) => void) => void

Other Functions​

SignerSync​

â–¸ SignerSync(payload): string

internal

Parameters​

NameType
payloadstring | Buffer | { [key: string]: any; }

Returns​

string


SignerAsync​

â–¸ SignerAsync(payload): Promise<string>

Parameters​

NameType
payloadstring | Buffer | { [key: string]: any; }

Returns​

Promise<string>

â–¸ SignerAsync(payload, cb): void

Parameters​

NameType
payloadstring | Buffer | { [key: string]: any; }
cbSignerCallback

Returns​

void


VerifierSync​

â–¸ VerifierSync(token): any

Parameters​

NameType
tokenstring | Buffer

Returns​

any


VerifierAsync​

â–¸ VerifierAsync(token): Promise<any>

Parameters​

NameType
tokenstring | Buffer

Returns​

Promise<any>

â–¸ VerifierAsync(token, cb): void

Parameters​

NameType
tokenstring | Buffer
cbobject

Returns​

void


Primary API Functions​

createSigner​

â–¸ createSigner(options?): typeof SignerSync

Creates a sync version of a signer

category Primary API

Parameters​

NameTypeDescription
options?Partial<SignerOptions & { key: string | Buffer }>The signer options

Returns​

typeof SignerSync

â–¸ createSigner(options?): typeof SignerAsync

Creates an async version of a signer

category Primary API

Parameters​

NameTypeDescription
options?Partial<SignerOptions & { key: KeyFetcher }>The signer options

Returns​

typeof SignerAsync


createDecoder​

â–¸ createDecoder(options?): (token: string | Buffer) => any

Creates a decoder

Parameters​

NameTypeDescription
options?Partial<DecoderOptions>The decoder options

Returns​

fn

â–¸ (token): any

Creates a decoder

category Primary API

Parameters​
NameType
tokenstring | Buffer
Returns​

any


createVerifier​

â–¸ createVerifier(options?): typeof VerifierSync

Creates a synchronous verifier

category Primary API

Parameters​

NameTypeDescription
options?Partial<VerifierOptions & { key: string | Buffer }>The verifier options

Returns​

typeof VerifierSync

â–¸ createVerifier(options?): typeof VerifierAsync

Creates an asynchronous verifier

category Primary API

Parameters​

NameTypeDescription
options?Partial<VerifierOptions & { key: KeyFetcher }>The verifier options

Returns​

typeof VerifierAsync