File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 23
23
24
24
"lint" : {
25
25
"rules" : {
26
- "exclude" : [" no-unused-vars" ]
26
+ "exclude" : [" no-unused-vars" , " no-window " ]
27
27
}
28
28
}
29
29
}
Original file line number Diff line number Diff line change @@ -244,6 +244,24 @@ export class WindowDropEvent extends WindowEvent {
244
244
export type AnimationFrameCallback = ( time : number ) => unknown ;
245
245
export const animationFrames = new Map < number , AnimationFrameCallback > ( ) ;
246
246
247
+ let animationFrameId = 0 ;
248
+
249
+ export function _requestAnimationFrameImpl ( callback : AnimationFrameCallback ) {
250
+ animationFrameId ++ ;
251
+ animationFrames . set ( animationFrameId , callback ) ;
252
+ return animationFrameId ;
253
+ }
254
+
255
+ export function _cancelAnimationFrameImpl ( id : number ) {
256
+ animationFrames . delete ( id ) ;
257
+ }
258
+
259
+ // deno-lint-ignore no-window
260
+ Object . assign ( window , {
261
+ requestAnimationFrame : _requestAnimationFrameImpl ,
262
+ cancelAnimationFrame : _cancelAnimationFrameImpl ,
263
+ } ) ;
264
+
247
265
declare global {
248
266
interface WindowEventMap {
249
267
close : WindowCloseEvent ;
You can’t perform that action at this time.
0 commit comments