From 9c8af49f07af0326d7d4993ed789b20f99f27368 Mon Sep 17 00:00:00 2001 From: Richard Lucas Date: Mon, 23 Apr 2018 16:12:26 -0600 Subject: [PATCH] adding typescript bindings --- index.d.ts | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 index.d.ts diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..9133c32 --- /dev/null +++ b/index.d.ts @@ -0,0 +1,34 @@ + +declare module 'amazon-user-pool-srp-client' { + export interface SRPClient { + poolName: string + N: string + k: string + g: string + infoBits: string + constructor(poolName: string) + generateRandomSmallA(): string + calculateA(a: string): string + calculateU(A: string, B: string): string + getPasswordAuthenticationKey( + username: string, + password: string, + serverBValue: string, + salt: string + ): string + padHex(bigInt: string): string + hash(str: string): string + hexHash(str: string): string + computehkdf(ikm: string, salt: string): string + } + + export function calculateSignature ( + hkdf: string, + userPoolId: string, + username: string, + secretBlock: string, + dateNow: string + ): string + + export function getNowString(): string +}