Matthieu Riegler
Matthieu Riegler

Reputation: 55669

Where is definition for document.startViewTransition?

In TS document.startViewTransition throws a Property 'startViewTransition' does not exist on type 'Document' error.

I've tryied to add lib: ["DOM"] but it doesn't change anything.

Why is there TS definition for this new API ?

Upvotes: 6

Views: 3536

Answers (2)

Brandon Pugh
Brandon Pugh

Reputation: 1682

This is now included in Typescript as v5.6, so if you're able to update to the latest version then there's no need for the separate package.

Upvotes: 4

Matthieu Riegler
Matthieu Riegler

Reputation: 55669

The ViewTransition api is still a "Candidate recommandation", so it's not embedded in TSs' definition yet.

I've found that @types/dom-view-transitions fit my needs though !

Upvotes: 15

Related Questions