(name: string, path: string, data: Uint8Array)
| 258 | } |
| 259 | |
| 260 | async fsWrite(name: string, path: string, data: Uint8Array): Promise<void> { |
| 261 | const url = this.spritePath( |
| 262 | name, |
| 263 | `/fs/write?path=${encodeURIComponent(path)}`, |
| 264 | ) |
| 265 | // Copy into a fresh ArrayBuffer-backed view so the body is a plain BodyInit. |
| 266 | const response = await fetch(url, { |
| 267 | method: 'PUT', |
| 268 | headers: this.headers({ 'content-type': 'application/octet-stream' }), |
| 269 | body: data.slice(), |
| 270 | }) |
| 271 | if (!response.ok) await this.fail('PUT', url, response) |
| 272 | await response.body?.cancel() |
| 273 | } |
| 274 | |
| 275 | async fsList(name: string, path: string): Promise<Array<SpriteFsEntry>> { |
| 276 | const url = this.spritePath( |
no test coverage detected