1.1.0 • Published 11 months ago
@rolster/types v1.1.0
Rolster Types
Package containing the basic definitions for handling data types.
Installation
npm i @rolster/typesConfiguration
The package path must be added in the files property in the tsconfig.json file
{
"files": ["node_modules/@rolster/types/index.d.ts"]
}Interfaces
| Name | Description |
|---|---|
Undefined<T> | Allows to type a generic data with undefined value. |
Nulleable<T> | Allows to type a generic data with nulleable value. |
Unknown<T> | Allows to type a generic data with unknown value. |
Implementation
// Variable can contain an string|undefined value
const value1: Undefined<string> = 'string' || undefined;
// Variable can contain an boolean|null value
const value2: Nulleable<boolean> = false || null;
// Variable can contain an number|unknown value
const value3: Unknown<number> = 1044 || unknown;Contributing
- Daniel Andrés Castillo Pedroza :rocket: