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
Type '(context: ScriptableContext<"line">, options: AnyObject) => Color | null' is not assignable to type 'string | _DeepPartialObject<CanvasGradient> | _DeepPartialObject<CanvasPattern> | ((ctx: ScriptableContext<"line">, options: AnyObject) => Color) | undefined'
Expected Behavior
Should allow returning
null
from scriptable property functions like in example https://www.chartjs.org/docs/latest/samples/advanced/linear-gradient.htmlCurrent Behavior
Type error
Possible Solution
Change the type to also allow
null
Steps to Reproduce
https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBAbzgYQBYENYBo4GUDGUwYM6ARgDYCmyEAdjFQB7wC+cAZlBCHAOT4MsAHQArAM58A3AFgAUPIBumOPhhM4AXjgATCPgCuIKg2EBzKjACi1YwwBCATwCSOgBQAiEI7SYYHgEpZOWUoOG9fWC04OioAdxQhGDc1JhwEeTgsuBhHMCoALn4KYFi+LEzsnXRSIoy5bMa4CnIqCnEigG0PACUqHQ8cD3sKAypBuA8ATTaKCDiJjwBxKCoTRYAFAygwakWAeSh0OgsPAF0Khqas6tJxSw64Tvrr65ayNqK+AGI4CA44AA1CCMSSXV5NW7oLoARgATDgYQBOHAAZhwAFYcAi4KiLpUIVkyOh8ABrMzcAx0HS0OZQIopeiMFhFAhEEjkai0BjMGAAHj4JTKAD4cBASMB6I9jo4AlphTEDBQKASmqwzqrWODsuKYJK6I8Xk1xPh0NRDarGkw6pamraslr7XBHDarhCnaxbZ63XBvawgkA
Context
Trying to implement the mentioned example in a TypeScript environment
Environment
The text was updated successfully, but these errors were encountered: