UNPKG

694 BTypeScriptView Raw
1import { IBrontosaurusBody } from "@brontosaurus/definition";
2import { BrontosaurusKey } from "./crypto";
3import { BrontosaurusSign } from "./sign";
4export declare class BrontosaurusToken {
5 static withSecret(secret: BrontosaurusKey): BrontosaurusToken;
6 static key(token: string): string | null;
7 private readonly _secret;
8 private constructor();
9 sign(key: string, body: IBrontosaurusBody): BrontosaurusSign;
10 key(token: string): string | null;
11 clock(token: string, offset: number, allowDelay?: number): boolean;
12 body(token: string): IBrontosaurusBody | null;
13 check(token: string): boolean;
14 validate(token: string, offset: number): boolean;
15}