leonardo
leonardo copied to clipboard
Improve typescript return types
Description
Types returned from 'generateAdaptiveTheme' and 'fixColorValue' now are variable depending on a generic parameter. eg.
// color will be of type 'string',
// while before it would have been of type 'string | { [key: string]: number }'
const color = fixColorValue('#2c66f1', 'HSL', false)
This closes #99
Motivation
This helps the user to better understand what the function will return.
Screenshots
To-do list
- [x] I have read the CONTRIBUTING document.
- [x] This pull request is ready to merge.