返回 AiToEarn
view.ts
1 // 根据文件获取硬盘上的文件流
2 import { ISaveFileParams } from '../../electron/main/views';
3
4 export async function icpGetFileStream(path: string) {
5 const res: Uint8Array = await window.ipcRenderer.invoke(
6 'ICP_VIEWS_GET_FILE_STREAM',
7 path,
8 );
9 return res;
10 }
11
12 // 保存文件
13 export async function icpSaveFile(params: ISaveFileParams) {
14 const res: string = await window.ipcRenderer.invoke(
15 'ICP_VIEWS_SAVE_FILE',
16 params,
17 );
18 return res;
19 }
20
21 // 获取经纬度
22 export async function icpGetLocation() {
23 const res: {
24 bd09: number[];
25 wgs84: number[];
26 gcj02: number[];
27 city: string;
28 } = await window.ipcRenderer.invoke('GET_LOCATION');
29 return res;
30 }
31
31 lines TYPESCRIPT