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

v1.8.2 drop ambient const enums #16

Merged
merged 2 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"newline-before-return": 0,
"prefer-const": 0,
"no-fallthrough": 0,
"quotes": [1, "double"],
"@typescript-eslint/no-duplicate-enum-values": 0,
"@typescript-eslint/no-inferrable-types": 0,
"@typescript-eslint/no-explicit-any": 0,
Expand Down
2 changes: 1 addition & 1 deletion dist/index.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.cjs.map

Large diffs are not rendered by default.

58 changes: 29 additions & 29 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,80 +15,80 @@ export declare function peekHeaderStr(b: ArrayBuffer | ArrayBufferView): string;
*
* @see [Types](https://github.com/reececomo/tinybuf/blob/main/docs/types.md)
*/
export declare const enum Type {
export declare const Type: {
/**
* Unsigned integer (1 - 8 bytes).
* - 0 → 127 = 1 byte
* - 128 → 16,384 = 2 bytes
* - 16,385 → 536,870,911 = 4 bytes
* - 536,870,912 → `Number.MAX_SAFE_INTEGER` = 8 bytes
*/
UInt = 0,
readonly UInt: "uint";
/** Unsigned 8-bit integer (between 0 and 255, 1 byte). */
UInt8 = 1,
readonly UInt8: "u8";
/** Unsigned 16-bit integer (between 0 and 65,535, 2 bytes). */
UInt16 = 2,
readonly UInt16: "u16";
/** Unsigned 32-bit integer (between 0 and 4,294,967,295, 4 bytes). */
UInt32 = 3,
readonly UInt32: "u32";
/**
* Signed integer (1 - 8 bytes).
* - 0 → ±64 = 1 byte
* - ±65 → ±8,192 = 2 bytes
* - ±8,193 → ±268,435,456 = 4 bytes
* - ±268,435,457 → ±`Number.MAX_SAFE_INTEGER` = 8 bytes
*/
Int = 4,
readonly Int: "int";
/** Signed 1 byte integer (between -127 and 127). */
Int8 = 5,
readonly Int8: "i8";
/** Signed 2 byte integer (between -32,767 and 32,767). */
Int16 = 6,
readonly Int16: "i16";
/** Signed 4 byte integer (between -2,147,483,647 and 2,147,483,647). */
Int32 = 7,
readonly Int32: "i32";
/** Default JavaScript `number` type. Floating-point number (64-bit, double precision, 8 bytes). */
Float64 = 8,
readonly Float64: "f64";
/** Floating-point number (32-bit, single precision, 4 bytes). */
Float32 = 9,
readonly Float32: "f32";
/**
* Floating-point number (16-bit in FP16 format, half precision, 2 bytes).
*
* **Warning:** Low precision; maximum range: ±65,504.
*/
Float16 = 10,
readonly Float16: "f16";
/**
* Floating-point number (16-bit in BF16 format, half precision, 2 bytes).
*
* **Warning:** Very low precision.
* **Warning:** Low precision.
*/
BFloat16 = 11,
/** A cheap, low-resolution signed scalar between -1.00 and 1.00 (1 byte). */
Scalar8 = 12,
/** A cheap, low-resolution unsigned scalar between 0.00 and 1.00 (1 byte). */
UScalar8 = 13,
readonly BFloat16: "b16";
/** A signed 2-decimal scalar between -1.00 and 1.00 (1 byte). */
readonly Scalar8: "sc";
/** An unsigned 2-decimal scalar between 0.00 and 1.00 (1 byte). */
readonly UScalar8: "usc";
/**
* Boolean value (1 byte).
* @see {Bools} for packing multiple booleans into a single byte.
*/
Bool = 14,
readonly Bool: "bl";
/** Any array of booleans (1 bit overhead, encoded as UInt). */
Bools = 15,
readonly Bools: "bls";
/** Any ArrayBuffer or ArrayBufferView (e.g. Uint8Array) value (encoded as 1 x UInt for byte length + buffer bytes). */
Buffer = 16,
readonly Buffer: "buf";
/** A UTF-8 string (encoded as 1 x UInt for UTF-8 byte length + UTF-8 bytes). */
String = 17,
/** Any JSON-serializable data. Encodes as a UTF-8 string. */
JSON = 18,
/** JavaScript regular expression. */
RegExp = 19,
readonly String: "str";
/** Any JSON data (encodes as UTF-8). */
readonly JSON: "jsn";
/** JavaScript RegExp object. */
readonly RegExp: "re";
/**
* JavaScript date object.
* JavaScript Date object.
*
* Encoded as an 8 byte (64-bit) integer UTC timestamp from as the number
* of milliseconds since the Unix Epoch (January 1, 1970, 00:00:00 UTC).
*
* @see {Date}
*/
Date = 20
}
readonly Date: "dt";
};
/**
* Mappings for the value types.
*/
Expand Down
2 changes: 1 addition & 1 deletion dist/index.mjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.mjs.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tinybuf",
"version": "1.8.1",
"version": "1.8.2",
"author": "Reece Como <reece.como@gmail.com>",
"authors": [
"Reece Como <reece.como@gmail.com>",
Expand Down
Loading
Loading