Skip to content

Commit 66a0f59

Browse files
committed
Improve docs for number Types
1 parent 062aec9 commit 66a0f59

1 file changed

Lines changed: 40 additions & 8 deletions

File tree

packages/common/src/Type.ts

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1822,19 +1822,35 @@ export const formatNonNegativeError =
18221822
(error) => `The value ${error.value} must be non-negative (≥ 0).`,
18231823
);
18241824

1825-
/** @category Number */
1825+
/**
1826+
* Non-negative number (≥ 0).
1827+
*
1828+
* @category Number
1829+
*/
18261830
export const NonNegativeNumber = nonNegative(Number);
18271831
export type NonNegativeNumber = typeof NonNegativeNumber.Type;
18281832

1829-
/** @category Number */
1833+
/**
1834+
* Positive number (> 0).
1835+
*
1836+
* @category Number
1837+
*/
18301838
export const PositiveNumber = positive(NonNegativeNumber);
18311839
export type PositiveNumber = typeof PositiveNumber.Type;
18321840

1833-
/** @category Number */
1841+
/**
1842+
* Non-positive number (≤ 0).
1843+
*
1844+
* @category Number
1845+
*/
18341846
export const NonPositiveNumber = nonPositive(Number);
18351847
export type NonPositiveNumber = typeof NonPositiveNumber.Type;
18361848

1837-
/** @category Number */
1849+
/**
1850+
* Negative number (< 0).
1851+
*
1852+
* @category Number
1853+
*/
18381854
export const NegativeNumber = negative(NonPositiveNumber);
18391855
export type NegativeNumber = typeof NegativeNumber.Type;
18401856

@@ -1870,11 +1886,19 @@ export const formatIntError = createTypeErrorFormatter<IntError>(
18701886
export const Int = int(Number);
18711887
export type Int = typeof Int.Type;
18721888

1873-
/** @category Number */
1889+
/**
1890+
* Non-negative integer (≥ 0).
1891+
*
1892+
* @category Number
1893+
*/
18741894
export const NonNegativeInt = nonNegative(Int);
18751895
export type NonNegativeInt = typeof NonNegativeInt.Type;
18761896

1877-
/** @category Number */
1897+
/**
1898+
* Positive integer (> 0).
1899+
*
1900+
* @category Number
1901+
*/
18781902
export const PositiveInt = positive(NonNegativeInt);
18791903
export type PositiveInt = typeof PositiveInt.Type;
18801904

@@ -1883,11 +1907,19 @@ export const maxPositiveInt = PositiveInt.orThrow(
18831907
globalThis.Number.MAX_SAFE_INTEGER,
18841908
);
18851909

1886-
/** @category Number */
1910+
/**
1911+
* Non-positive integer (≤ 0).
1912+
*
1913+
* @category Number
1914+
*/
18871915
export const NonPositiveInt = nonPositive(Int);
18881916
export type NonPositiveInt = typeof NonPositiveInt.Type;
18891917

1890-
/** @category Number */
1918+
/**
1919+
* Negative integer (< 0).
1920+
*
1921+
* @category Number
1922+
*/
18911923
export const NegativeInt = negative(NonPositiveInt);
18921924
export type NegativeInt = typeof NegativeInt.Type;
18931925

0 commit comments

Comments
 (0)