Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typings #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 34 additions & 34 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,114 +2,114 @@ declare module "node-crc" {
/**
* bits = 64, reflection = true, exp = 0xD800000000000000, ini = 0xFFFFFFFFFFFFFFFF, fix = 0xFFFFFFFFFFFFFFFF
* @param {Buffer!} data
* @returns {Buffer | boolean} If there is any error in the computation, it will return false.
* @returns {Buffer | false} If there is any error in the computation, it will return false.
*/
export function crc64iso(data: Buffer): Buffer | boolean;
export function crc64iso(data: Buffer): Buffer | false;

/**
* bits = 64, reflection = true, exp = 0x95AC9329AC4BC9B5u64, ini = 0x0000000000000000, fix = 0x0000000000000000
* @param {Buffer!} data
* @returns {Buffer | boolean} If there is any error in the computation, it will return false.
* @returns {Buffer | false} If there is any error in the computation, it will return false.
*/
export function crc64jones(data: Buffer): Buffer | boolean;
export function crc64jones(data: Buffer): Buffer | false;

/**
* bits = 64, reflection = false, exp = 0x42F0E1EBA9EA3693, ini = 0xFFFFFFFFFFFFFFFF, fix = 0xFFFFFFFFFFFFFFFF
* @param {Buffer!} data
* @returns {Buffer | boolean} If there is any error in the computation, it will return false.
* @returns {Buffer | false} If there is any error in the computation, it will return false.
*/
export function crc64ecma(data: Buffer): Buffer | boolean;
export function crc64ecma(data: Buffer): Buffer | false;

/**
* bits = 64, reflection = false, exp = 0x42F0E1EBA9EA3693, ini = 0xFFFFFFFFFFFFFFFF, fix = 0xFFFFFFFFFFFFFFFF
* @param {Buffer!} data
* @returns {Buffer | boolean} If there is any error in the computation, it will return false.
* @returns {Buffer | false} If there is any error in the computation, it will return false.
*/
export function crc64(data: Buffer): Buffer | boolean;
export function crc64(data: Buffer): Buffer | false;

/**
* bits = 32, reflection = true, exp = 0xEDB88320, ini = 0xFFFFFFFF, fix = 0xFFFFFFFF
* @param {Buffer!} data
* @returns {Buffer | boolean} If there is any error in the computation, it will return false.
* @returns {Buffer | false} If there is any error in the computation, it will return false.
*/
export function crc32ieee(data: Buffer): Buffer | boolean;
export function crc32ieee(data: Buffer): Buffer | false;

/**
* bits = 32, reflection = true, exp = 0xEDB88320, ini = 0xFFFFFFFF, fix = 0xFFFFFFFF
* @param {Buffer!} data
* @returns {Buffer | boolean} If there is any error in the computation, it will return false.
* @returns {Buffer | false} If there is any error in the computation, it will return false.
*/
export function crc32b(data: Buffer): Buffer | boolean;
export function crc32b(data: Buffer): Buffer | false;

/**
* bits = 32, reflection = true, exp = 0xEDB88320, ini = 0xFFFFFFFF, fix = 0xFFFFFFFF
* @param {Buffer!} data
* @returns {Buffer | boolean} If there is any error in the computation, it will return false.
* @returns {Buffer | false} If there is any error in the computation, it will return false.
*/
export function crc32(data: Buffer): Buffer | boolean;
export function crc32(data: Buffer): Buffer | false;

/**
* bits = 32, reflection = true, exp = 0x82F63B78, ini = 0xFFFFFFFF, fix = 0xFFFFFFFF
* @param {Buffer!} data
* @returns {Buffer | boolean} If there is any error in the computation, it will return false.
* @returns {Buffer | false} If there is any error in the computation, it will return false.
*/
export function crc32c(data: Buffer): Buffer | boolean;
export function crc32c(data: Buffer): Buffer | false;

/**
* bits = 32, reflection = false, exp = 0x04C11DB7, ini = 0xFFFFFFFF, fix = 0xFFFFFFFF, reversed
* @param {Buffer!} data
* @returns {Buffer | boolean} If there is any error in the computation, it will return false.
* @returns {Buffer | false} If there is any error in the computation, it will return false.
*/
export function crc32mhash(data: Buffer): Buffer | boolean;
export function crc32mhash(data: Buffer): Buffer | false;

/**
* bits = 16, reflection = true, exp = 0xA001, ini = 0x0000, fix = 0x0000
* @param {Buffer!} data
* @returns {Buffer | boolean} If there is any error in the computation, it will return false.
* @returns {Buffer | false} If there is any error in the computation, it will return false.
*/
export function crc16ibm(data: Buffer): Buffer | boolean;
export function crc16ibm(data: Buffer): Buffer | false;

/**
* bits = 16, reflection = true, exp = 0xA001, ini = 0x0000, fix = 0x0000
* @param {Buffer!} data
* @returns {Buffer | boolean} If there is any error in the computation, it will return false.
* @returns {Buffer | false} If there is any error in the computation, it will return false.
*/
export function crc16(data: Buffer): Buffer | boolean;
export function crc16(data: Buffer): Buffer | false;

/**
* bits = 16, reflection = false, exp = 0x1021, ini = 0xFFFF, fix = 0x0000
* @param {Buffer!} data
* @returns {Buffer | boolean} If there is any error in the computation, it will return false.
* @returns {Buffer | false} If there is any error in the computation, it will return false.
*/
export function crc16ccitt(data: Buffer): Buffer | boolean;
export function crc16ccitt(data: Buffer): Buffer | false;

/**
* bits = 16, reflection = false, exp = 0x1021, ini = 0xFFFF, fix = 0x0000
* @param {Buffer!} data
* @returns {Buffer | boolean} If there is any error in the computation, it will return false.
* @returns {Buffer | false} If there is any error in the computation, it will return false.
*/
export function crcccitt(data: Buffer): Buffer | boolean;
export function crcccitt(data: Buffer): Buffer | false;

/**
* bits = 8, reflection = false, exp = 0x07, ini = 0x00, fix = 0x00
* @param {Buffer!} data
* @returns {Buffer | boolean} If there is any error in the computation, it will return false.
* @returns {Buffer | false} If there is any error in the computation, it will return false.
*/
export function crc8atm(data: Buffer): Buffer | boolean;
export function crc8atm(data: Buffer): Buffer | false;

/**
* bits = 8, reflection = false, exp = 0x07, ini = 0x00, fix = 0x00
* @param {Buffer!} data
* @returns {Buffer | boolean} If there is any error in the computation, it will return false.
* @returns {Buffer | false} If there is any error in the computation, it will return false.
*/
export function crc8(data: Buffer): Buffer | boolean;
export function crc8(data: Buffer): Buffer | false;

/**
* bits = 8, reflection = false, exp = 0x9B, ini = 0xFF, fix = 0x00
* @param {Buffer!} data
* @returns {Buffer | boolean} If there is any error in the computation, it will return false.
* @returns {Buffer | false} If there is any error in the computation, it will return false.
*/
export function crc8cdma(data: Buffer): Buffer | boolean;
export function crc8cdma(data: Buffer): Buffer | false;

/**
* Compute a n-bit CRC value. You can change the length of bits, reflection, expression, the initial value, the final xor value by yourself.
Expand All @@ -122,7 +122,7 @@ declare module "node-crc" {
* @param {number!} fixL
* @param {number!} fixH
* @param {Buffer!} data
* @returns {Buffer | boolean} If there is any error in the computation, it will return false.
* @returns {Buffer | false} If there is any error in the computation, it will return false.
*/
export function crc(bits: number, reflection: boolean, expL: number, expH: number, iniL: number, iniH: number, fixL: number, fixH: number, data: Buffer): Buffer | boolean;
export function crc(bits: number, reflection: boolean, expL: number, expH: number, iniL: number, iniH: number, fixL: number, fixH: number, data: Buffer): Buffer | false;
}