leonardo icon indicating copy to clipboard operation
leonardo copied to clipboard

Improve typescript return types

Open fedeci opened this issue 3 years ago • 0 comments

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.

fedeci avatar Sep 12 '20 10:09 fedeci