TypeScript-DOM-lib-generator icon indicating copy to clipboard operation
TypeScript-DOM-lib-generator copied to clipboard

Types for CSS painting API - `registerPaint`

Open beamery-tomht opened this issue 4 years ago • 3 comments

Suggestion

🔍 Search Terms

registerPaint, CSS paint API, types

✅ Viability Checklist

My suggestion meets these guidelines:

  • [x] This wouldn't be a breaking change in existing TypeScript/JavaScript code
  • [x] This wouldn't change the runtime behavior of existing JavaScript code
  • [x] This could be implemented without emitting different JS based on the types of the expressions
  • [x] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
  • [x] This feature would agree with the rest of TypeScript's Design Goals.

⭐ Suggestion

I'd like to add a type definition for the CSS paint API to the lib.dom.ts.d

  • https://developer.mozilla.org/en-US/docs/Web/API/CSS_Painting_API/Guide
  • https://caniuse.com/css-paint-api
  • https://developers.google.com/web/updates/2018/01/paintapi

📃 Motivating Example

An existing example taken from the wild of a custom border radius smoothing implementation using the CSS paint API: https://css-houdini.rocks/smooth-corners/

💻 Use Cases

  • To make use of the CSS paint API in a FE project/

beamery-tomht avatar Nov 02 '21 10:11 beamery-tomht

microsoft/TypeScript-DOM-lib-generator is the right repository for DOM related type declarations. I haven't found an issue related CSS painting.

MartinJohns avatar Nov 02 '21 15:11 MartinJohns

Just noting for others that this looks to be a chromium only API, so you'd need to either submit the extension to DefinitelyTyped or persuade other browsers to support the API.

orta avatar Dec 06 '21 14:12 orta