标题: 请教`Property 'context' does not exist on type` XXX如何解决 [打印本页] 作者: DSOE1024 时间: 2024-5-6 01:24 标题: 请教`Property 'context' does not exist on type` XXX如何解决 [md]请教,导出的ts模块提供给团结引擎,报错:`Property 'context' does not exist on type 'ImageSaver'. <ArkTSCheck>`
```typescript
export class ImageSaver{
async saveImage(buffer: ArrayBuffer | string): Promise<void> {
let helper = photoAccessHelper.getPhotoAccessHelper(this.context);
let uri = await helper.createAsset(photoAccessHelper.PhotoType.IMAGE, 'jpg');
let file = await fs.open(uri, fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE);
await fs.write(file.fd, buffer);
await fs.close(file.fd);
}
}
```
[/md]作者: hyacinth养花人 时间: 2024-5-6 19:07 标题: 请教`Property 'context' does not exist on type` XXX如何解决