18 lines
472 B
TypeScript
18 lines
472 B
TypeScript
import { open } from '@tauri-apps/plugin-dialog';
|
|
import { readFile as read, readTextFile as readText } from '@tauri-apps/plugin-fs';
|
|
|
|
export const requestSingleFile = async () => {
|
|
return open({
|
|
multiple: false,
|
|
directory: false,
|
|
});
|
|
}
|
|
|
|
export const readFile = async (path: string): Promise<Uint8Array<ArrayBufferLike>> => {
|
|
return read(path);
|
|
}
|
|
|
|
export const readTextFile = async (path: string): Promise<string> => {
|
|
return readText(path);
|
|
}
|