typescriptview-transitions-api

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 ?


Solution

  • Edit: Type have been shipped in lib.dom since TS 5.6


    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 !