global.d.ts 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. declare module "*.jpg";
  2. declare module "*.png";
  3. declare module "*.woff2";
  4. declare module "*.woff";
  5. declare module "*.ttf";
  6. declare module "*.scss" {
  7. const content: Record<string, string>;
  8. export default content;
  9. }
  10. declare module "*.svg";
  11. declare interface Window {
  12. __TAURI__?: {
  13. writeText(text: string): Promise<void>;
  14. invoke(command: string, payload?: Record<string, unknown>): Promise<any>;
  15. dialog: {
  16. save(options?: Record<string, unknown>): Promise<string | null>;
  17. };
  18. fs: {
  19. writeBinaryFile(path: string, data: Uint8Array): Promise<void>;
  20. writeTextFile(path: string, data: string): Promise<void>;
  21. };
  22. notification: {
  23. requestPermission(): Promise<Permission>;
  24. isPermissionGranted(): Promise<boolean>;
  25. sendNotification(options: string | Options): void;
  26. };
  27. updater: {
  28. checkUpdate(): Promise<UpdateResult>;
  29. installUpdate(): Promise<void>;
  30. onUpdaterEvent(
  31. handler: (status: UpdateStatusResult) => void,
  32. ): Promise<UnlistenFn>;
  33. };
  34. http: {
  35. fetch<T>(
  36. url: string,
  37. options?: Record<string, unknown>,
  38. ): Promise<Response<T>>;
  39. };
  40. };
  41. }