The readme gives the following code example: const ColorArrayEnumParam = createEnumArrayParam<Color[]>(['red', 'green', 'blue']) but this raises the following typescript warning Type 'Color[]' does not satisfy the constraint 'string'.ts(2344)
This makes sense when looking at the Typescript declarations for createEnumArrayParam which is as follows: declare const createEnumArrayParam: <T extends string>(enumValues: T[])
This illustrates that only T is expected as a generic type parameter declaration while the expected function parameter is an array of T.
So I believe the solution here is update the Readme from:
const ColorArrayEnumParam = createEnumArrayParam<Color[]>(['red', 'green', 'blue'])
to:
const ColorArrayEnumParam = createEnumArrayParam<Color>(['red', 'green', 'blue'])
The
readme
gives the following code example:const ColorArrayEnumParam = createEnumArrayParam<Color[]>(['red', 'green', 'blue'])
but this raises the following typescript warningType 'Color[]' does not satisfy the constraint 'string'.ts(2344)
This makes sense when looking at the Typescript declarations for
createEnumArrayParam
which is as follows:declare const createEnumArrayParam: <T extends string>(enumValues: T[])
This illustrates that only T is expected as a generic type parameter declaration while the expected function parameter is an array of T.
So I believe the solution here is update the
Readme
from:const ColorArrayEnumParam = createEnumArrayParam<Color[]>(['red', 'green', 'blue'])
to:const ColorArrayEnumParam = createEnumArrayParam<Color>(['red', 'green', 'blue'])