You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But how to type this correct? I'm too stupid, sorry.
For DEFAULT_COLORS[1]
I get this:
// Element implicitly has an 'any' type because expression of// type 'string' can't be used to indextype// 'Colors & { createColors: (enabled?: boolean | undefined) => Colors; }'.// No index signature with a parameter of type 'string' was// found on type 'Colors & { createColors: (enabled?: boolean | undefined) => Colors; }'.
Problem is that a user can just overwrite colors by using own colors handed in as strings. So I'm trying to stick to that.
The text was updated successfully, but these errors were encountered:
Thanks for your reply!
Unfortunately with this I get an error and no more output:
This expression is not callable.
Not all constituents of type'boolean | Formatter | ((enabled?: boolean) => Colors)' are callable.
Type 'false' has no call signatures.typescript(2349)
const DEFAULT_COLORS: [keyof Colors |"createColors", keyof Colors |"createColors", keyof Colors |"createColors"]
This is just running fine:
https://codesandbox.io/p/sandbox/picocolors-types-29zfg9?file=%2Fsrc%2Findex.ts%3A11%2C1
But how to type this correct? I'm too stupid, sorry.
For
DEFAULT_COLORS[1]
I get this:
Problem is that a user can just overwrite colors by using own colors handed in as strings. So I'm trying to stick to that.
The text was updated successfully, but these errors were encountered: