Skip to content

Commit 352c459

Browse files
committed
refactored imported types
1 parent c2f852d commit 352c459

File tree

3 files changed

+28
-1301
lines changed

3 files changed

+28
-1301
lines changed

sodium-native.d.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
declare module 'sodium-native' {
2+
// Type definitions for sodium-native 4.x
3+
// Minimal definitions for APIs used by lib-crypto-utils
4+
5+
/// <reference types="node" />
6+
7+
// Constants used by lib-crypto-utils
8+
export const crypto_auth_BYTES: number
9+
export const crypto_box_PUBLICKEYBYTES: number
10+
export const crypto_box_SECRETKEYBYTES: number
11+
export const crypto_scalarmult_BYTES: number
12+
export const crypto_sign_BYTES: number
13+
export const crypto_sign_PUBLICKEYBYTES: number
14+
export const crypto_sign_SECRETKEYBYTES: number
15+
16+
// Functions used by lib-crypto-utils
17+
export function randombytes_buf(buffer: Buffer): void
18+
export function crypto_generichash(output: Buffer, input: Buffer, key?: Buffer): void
19+
export function crypto_sign_keypair(publicKey: Buffer, secretKey: Buffer): void
20+
export function crypto_sign_ed25519_sk_to_curve25519(curve_sk: Buffer, ed_sk: Buffer): void
21+
export function crypto_sign_ed25519_pk_to_curve25519(curve_pk: Buffer, ed_pk: Buffer): void
22+
export function crypto_auth(output: Buffer, input: Buffer, key: Buffer): void
23+
export function crypto_auth_verify(output: Buffer, input: Buffer, key: Buffer): boolean
24+
export function crypto_sign(signedMessage: Buffer, message: Buffer, secretKey: Buffer): void
25+
export function crypto_sign_open(message: Buffer, signedMessage: Buffer, publicKey: Buffer): boolean
26+
export function crypto_scalarmult(sharedSecret: Buffer, secretKey: Buffer, remotePublicKey: Buffer): void
27+
}

0 commit comments

Comments
 (0)