Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing interface definition for Highlight API #53003

Closed
eladsadeh opened this issue Feb 27, 2023 · 9 comments
Closed

Missing interface definition for Highlight API #53003

eladsadeh opened this issue Feb 27, 2023 · 9 comments
Labels
Working as Intended The behavior described is the intended behavior; this is not a bug

Comments

@eladsadeh
Copy link

Bug Report

🔎 Search Terms

  • Highlight
  • Highlight API
  • CSS custom highlight api

🕗 Version & Regression Information

Version 4.9.5

This happen in the 'Nightly' version as well.

Please keep and fill in the line that best applies:

  • This is a crash
  • This changed between versions ______ and _______
    X This is the behavior in every version I tried, and I reviewed the FAQ for entries about: Could not find anything relevant.
  • I was unable to test this on prior versions because _______

⏯ Playground Link

A link to a TypeScript Playground "Share" link which shows this behavior: http://www.typescriptlang.org/play/?ts=Nightly

💻 Code

const hl = new Highlight()

🙁 Actual behavior

Cannot find name 'Highlight'.(2304)

🙂 Expected behavior

Should return a newly created Highlight object.

Constructor
Highlight()

let hl = new Highlight();
console.log(hl) // Highlight {priority: 0, type: 'highlight', size: 0}
@RyanCavanaugh RyanCavanaugh added the Working as Intended The behavior described is the intended behavior; this is not a bug label Feb 27, 2023
@RyanCavanaugh
Copy link
Member

Experimental features are not included in the built-in DOM

@eladsadeh
Copy link
Author

Thanks for the fast reply!

@typescript-bot
Copy link
Collaborator

This issue has been marked 'Working as Intended' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

@Emberfire
Copy link

My understanding is the Custom Highlights API has left the experimental stage, with only Firefox for desktop and Android lacking support for it in their respective official versions. Are there any plans to add it to the DOM definitions?

@Micka33
Copy link

Micka33 commented Mar 20, 2024

Looking for it as well.

Is there anyway to get it working until it is officially supported?

@Kreash
Copy link

Kreash commented Mar 21, 2024

You can create a d.ts file for you project

declare class Highlight {
  constructor(...range: Range[]);
}

declare namespace CSS {
  var highlights: Map<string, Highlight>;
}

@acherkashin
Copy link

@RyanCavanaugh I guess this issue should be reopened, as this API has really good support in browsers now.

https://developer.mozilla.org/en-US/docs/Web/CSS/::highlight

image

@Momomash
Copy link

Momomash commented Apr 3, 2024

@RyanCavanaugh I guess this issue should be reopened, as this API has really good support in browsers now.

https://developer.mozilla.org/en-US/docs/Web/CSS/::highlight

image

@acherkashin #58051

@acherkashin
Copy link

@Momomash Спасибо) Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Working as Intended The behavior described is the intended behavior; this is not a bug
Projects
None yet
Development

No branches or pull requests

8 participants