Skip to content
Source
Sign inSign up

mediaActions.ts

15 lines444 Bytes

1import { isWindowsAbsolutePath } from "@t3tools/shared/path";
2​
3// The file host can use a different path style from the client.
4export function formatFilePathForClipboard(path: string, hostPath = path): string {
5 return isWindowsAbsolutePath(hostPath) ? path.replaceAll("/", "\\") : path;
6}
7​
8export type MediaActionId =
9 | "copy-full-path"
10 | "copy-relative-path"
11 | "copy-url"
12 | "open-file"
13 | "save"
14 | "save-image"
15 | "copy-image";