Skip to content

Commit

Permalink
Update TS by removing unexported functions
Browse files Browse the repository at this point in the history
  • Loading branch information
larabr committed Nov 15, 2023
1 parent 5a6371e commit 5420eeb
Showing 1 changed file with 35 additions and 35 deletions.
70 changes: 35 additions & 35 deletions nacl.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ declare namespace nacl {
secretKey: Uint8Array;
}

export interface secretbox {
(msg: Uint8Array, nonce: Uint8Array, key: Uint8Array): Uint8Array;
open(box: Uint8Array, nonce: Uint8Array, key: Uint8Array): Uint8Array | null;
readonly keyLength: number;
readonly nonceLength: number;
readonly overheadLength: number;
}
// export interface secretbox {
// (msg: Uint8Array, nonce: Uint8Array, key: Uint8Array): Uint8Array;
// open(box: Uint8Array, nonce: Uint8Array, key: Uint8Array): Uint8Array | null;
// readonly keyLength: number;
// readonly nonceLength: number;
// readonly overheadLength: number;
// }

export interface scalarMult {
(n: Uint8Array, p: Uint8Array): Uint8Array;
Expand All @@ -31,29 +31,29 @@ declare namespace nacl {
readonly groupElementLength: number;
}

namespace boxProps {
export interface open {
(msg: Uint8Array, nonce: Uint8Array, publicKey: Uint8Array, secretKey: Uint8Array): Uint8Array | null;
after(box: Uint8Array, nonce: Uint8Array, key: Uint8Array): Uint8Array | null;
}
// namespace boxProps {
// export interface open {
// (msg: Uint8Array, nonce: Uint8Array, publicKey: Uint8Array, secretKey: Uint8Array): Uint8Array | null;
// after(box: Uint8Array, nonce: Uint8Array, key: Uint8Array): Uint8Array | null;
// }

export interface keyPair {
(): BoxKeyPair;
fromSecretKey(secretKey: Uint8Array): BoxKeyPair;
}
}
// export interface keyPair {
// (): BoxKeyPair;
// fromSecretKey(secretKey: Uint8Array): BoxKeyPair;
// }
// }

export interface box {
(msg: Uint8Array, nonce: Uint8Array, publicKey: Uint8Array, secretKey: Uint8Array): Uint8Array;
before(publicKey: Uint8Array, secretKey: Uint8Array): Uint8Array;
after(msg: Uint8Array, nonce: Uint8Array, key: Uint8Array): Uint8Array;
open: boxProps.open;
// (msg: Uint8Array, nonce: Uint8Array, publicKey: Uint8Array, secretKey: Uint8Array): Uint8Array;
// before(publicKey: Uint8Array, secretKey: Uint8Array): Uint8Array;
// after(msg: Uint8Array, nonce: Uint8Array, key: Uint8Array): Uint8Array;
// open: boxProps.open;
keyPair: boxProps.keyPair;
readonly publicKeyLength: number;
readonly secretKeyLength: number;
readonly sharedKeyLength: number;
readonly nonceLength: number;
readonly overheadLength: number;
// readonly publicKeyLength: number;
// readonly secretKeyLength: number;
// readonly sharedKeyLength: number;
// readonly nonceLength: number;
// readonly overheadLength: number;
}

namespace signProps {
Expand All @@ -80,19 +80,19 @@ declare namespace nacl {
readonly signatureLength: number;
}

export interface hash {
(msg: Uint8Array): Uint8Array;
readonly hashLength: number;
}
// export interface hash {
// (msg: Uint8Array): Uint8Array;
// readonly hashLength: number;
// }
}

declare interface nacl {
randomBytes(n: number): Uint8Array;
secretbox: nacl.secretbox;
// randomBytes(n: number): Uint8Array;
// secretbox: nacl.secretbox;
scalarMult: nacl.scalarMult;
box: nacl.box;
sign: nacl.sign;
hash: nacl.hash;
verify(x: Uint8Array, y: Uint8Array): boolean;
setPRNG(fn: (x: Uint8Array, n: number) => void): void;
// hash: nacl.hash;
// verify(x: Uint8Array, y: Uint8Array): boolean;
// setPRNG(fn: (x: Uint8Array, n: number) => void): void;
}

0 comments on commit 5420eeb

Please sign in to comment.