Skip to content

Commit

Permalink
fix: startViewTransition
Browse files Browse the repository at this point in the history
  • Loading branch information
nailiable committed Dec 28, 2024
1 parent ddca1e2 commit e590de7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 0 additions & 2 deletions frontend/composables/dark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ export async function toggleWithAnimate({ clientX: x, clientY: y }: MouseEvent,
)}px at ${x}px ${y}px)`,
]

// eslint-disable-next-line ts/ban-ts-comment
// @ts-expect-error
await document.startViewTransition(async () => {
action()
await nextTick()
Expand Down
7 changes: 7 additions & 0 deletions types/shims.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,10 @@ declare module '*.vue' {
const component: DefineComponent<object, object, any>
export default component
}

interface Document {
startViewTransition(callback: () => Promise<void> | void): {
ready: Promise<void>
finished: Promise<void>
}
}

0 comments on commit e590de7

Please sign in to comment.