UNPKG

@ne1410s/xprest

Version:
21 lines (20 loc) 715 B
import { JwtToken } from './jwt-token'; /** A host for issuing json web tokens. */ export declare class JwtIssuer { private issuer; private secret; private minutes; /** Initialises a new instance. */ constructor(issuer: string, secret: string, minutes?: number); /** Issues a token containing the supplied payload. */ issue<T extends JwtToken>(payload: T): string; /** Parses the contents of a (valid) token. */ parseValid<T extends JwtToken>(token: string): T; /** Parses the contents of a token. */ private parseRaw; /** Prepares payload according to current time and instance config. */ private preparePayload; } export interface IToken { token: string; }