gx
chenyc
2025-06-12 7b72ac13a83764a662159d4a49b7fffb90476ecb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
export type FileSystem = {
  // eslint-disable-next-line no-unused-vars
  readFile: (filePath: string) => Promise<any>
}
 
export type Environment = FileSystem & {
  Canvas: typeof HTMLCanvasElement
  CanvasRenderingContext2D: typeof CanvasRenderingContext2D
  Image: typeof HTMLImageElement
  ImageData: typeof ImageData
  Video: typeof HTMLVideoElement
  createCanvasElement: () => HTMLCanvasElement
  createImageElement: () => HTMLImageElement
  createVideoElement: () => HTMLVideoElement
  // eslint-disable-next-line no-undef, no-unused-vars
  fetch: (url: string, init?: RequestInit) => Promise<Response>
}