-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: change declaration TypeScript files (#40)
- Loading branch information
Showing
4 changed files
with
38 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
const { encrypt, Encrypt } = require("./lib/encrypt"); | ||
const { decrypt, Decrypt } = require("./lib/decrypt"); | ||
|
||
/** | ||
* Module declaration for the "@barudakrosul/gcrypt" module. | ||
* | ||
* @module @barudakrosul/gcrypt | ||
*/ | ||
declare module "@barudakrosul/gcrypt" { | ||
declare module "gcrypt" { | ||
/** | ||
* Interface representing the gcrypt module. | ||
* Encrypts text using PBKDF2, zlib compression, and AES-256-GCM encryption. | ||
* | ||
* @param {Buffer|string} text - The text to be encrypted. | ||
* @param {string} [password] - The passphrase for encryption. | ||
* @returns {Buffer} - Encrypted data. | ||
*/ | ||
interface Gcrypt { | ||
encrypt: Encrypt; | ||
decrypt: Decrypt; | ||
gcrypt: Gcrypt; | ||
} | ||
function encrypt(text: Buffer | string, password?: string): Buffer; | ||
|
||
const gcrypt: Gcrypt; | ||
/** | ||
* Decrypts encrypted data using PBKDF2, zlib decompression, and AES-256-GCM decryption. | ||
* | ||
* @param {Buffer|string} text - The encrypted data text. | ||
* @param {string} [password] - The passphrase for decryption. | ||
* @returns {Buffer|string} - Decrypted text. | ||
*/ | ||
function decrypt(text: Buffer | string, password?: string): Buffer | string; | ||
|
||
export { gcrypt, encrypt, decrypt, Gcrypt, Encrypt, Decrypt }; | ||
export default gcrypt; | ||
export { encrypt, decrypt }; | ||
} | ||
|
||
export = gcrypt; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,12 @@ | ||
/** | ||
* Module declaration for decrypting text. | ||
* | ||
* @module decrypt | ||
*/ | ||
declare module "decrypt" { | ||
/** | ||
* Interface representing the decryption function. | ||
* Decrypts encrypted data using PBKDF2, zlib decompression, and AES-256-GCM decryption. | ||
* | ||
* @param {Buffer|string} text - The encrypted data text. | ||
* @param {string} [password] - The passphrase for decryption. | ||
* @returns {Buffer|string} - Decrypted text. | ||
*/ | ||
interface Decrypt { | ||
(text: Buffer | string, password?: string): Buffer | string; | ||
} | ||
function decrypt(text: Buffer | string, password?: string): Buffer | string; | ||
|
||
const decrypt: Decrypt; | ||
|
||
export { decrypt, Decrypt }; | ||
export default decrypt; | ||
export = decrypt; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,12 @@ | ||
/** | ||
* Module declaration for encrypting text. | ||
* | ||
* @module encrypt | ||
*/ | ||
declare module "encrypt" { | ||
/** | ||
* Interface representing the encryption function. | ||
* Encrypts text using PBKDF2, zlib compression, and AES-256-GCM encryption. | ||
* | ||
* @param {Buffer|string} text - The text to be encrypted. | ||
* @param {string} [password] - The passphrase for encryption. | ||
* @returns {Buffer} - Encrypted data. | ||
*/ | ||
interface Encrypt { | ||
(text: Buffer | string, password?: string): Buffer; | ||
} | ||
function encrypt(text: Buffer | string, password?: string): Buffer; | ||
|
||
const encrypt: Encrypt; | ||
|
||
export { encrypt, Encrypt }; | ||
export default encrypt; | ||
export = encrypt; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,11 @@ | ||
/** | ||
* Module declaration for parse boolean value. | ||
* | ||
* @module parse-boolean | ||
*/ | ||
declare module "parse-boolean" { | ||
/** | ||
* Interface representing the parsing boolean function. | ||
* Parse a boolean value from either a boolean or string representation. | ||
* | ||
* @param {boolean | string} value - The input value to parse as a boolean. | ||
* @returns {boolean | undefined} - The parsed boolean value, or undefined if parsing fails. | ||
*/ | ||
interface ParseBoolean { | ||
(value: boolean | string): boolean | undefined; | ||
} | ||
function parseBoolean(value: boolean | string): boolean | undefined; | ||
|
||
const parseBoolean: ParseBoolean; | ||
|
||
export { parseBoolean, ParseBoolean }; | ||
export default parseBoolean; | ||
export = parseBoolean; | ||
} |