Skip to content

Commit

Permalink
fix: standardise obj exports
Browse files Browse the repository at this point in the history
  • Loading branch information
yeojz committed Jun 12, 2018
1 parent 2e7e6aa commit 0151b52
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions packages/types-ts/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ interface hmacOptions {
encoding?: string;
}

type createHmacSecret = (
secret: string,
options: hmacOptions
) => Buffer;
type createHmacSecret = (secret: string, options: hmacOptions) => Buffer;

interface hotpOptionsInterface extends hmacOptions {
createHmacSecret?: createHmacSecret;
Expand Down Expand Up @@ -114,9 +111,14 @@ declare class Authenticator extends TOTP {
}

declare module 'otplib' {
const authenticator: Authenticator;
const hotp: HOTP;
const totp: TOTP;
interface otplibModule {
authenticator: Authenticator;
hotp: HOTP;
totp: TOTP;
}

const otplib: otplibModule;
export = otplib;
}

declare module 'otplib/authenticator' {
Expand All @@ -135,7 +137,7 @@ declare module 'otplib/hotp' {
}

declare module 'otplib/core' {
interface core {
interface coreModule {
hotpCheck: hotpCheck;
hotpCounter: hotpCounter;
hotpDigest: hotpDigest;
Expand All @@ -149,6 +151,7 @@ declare module 'otplib/core' {
totpSecret: totpSecret;
totpToken: totpToken;
}
const lib: core;
export = lib;

const core: coreModule;
export = core;
}

0 comments on commit 0151b52

Please sign in to comment.