global.d.ts 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. convertFileSrc(url: string, protocol?: string): string;
  14. writeText(text: string): Promise<void>;
  15. invoke(command: string, payload?: Record<string, unknown>): Promise<any>;
  16. dialog: {
  17. save(options?: Record<string, unknown>): Promise<string | null>;
  18. };
  19. fs: {
  20. writeBinaryFile(path: string, data: Uint8Array): Promise<void>;
  21. writeTextFile(path: string, data: string): Promise<void>;
  22. };
  23. notification: {
  24. requestPermission(): Promise<Permission>;
  25. isPermissionGranted(): Promise<boolean>;
  26. sendNotification(options: string | Options): void;
  27. };
  28. http: {
  29. fetch<T>(
  30. url: string,
  31. options?: Record<string, unknown>,
  32. ): Promise<Response<T>>;
  33. };
  34. };
  35. }