@rolster/types
v1.0.10
Published
Package containing the basic definitions for handling data types.
Downloads
102
Readme
Rolster Types
Package containing the basic definitions for handling data types.
Installation
npm i @rolster/types
Configuration
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: