From e2d6acccf04c2e60c1aa6dee405266c33fd931c2 Mon Sep 17 00:00:00 2001 From: Sean Zellmer Date: Fri, 17 Jan 2025 05:42:27 -0600 Subject: [PATCH] Add `Pear.media.getPathForFile(file)` documentation (#164) --- reference/pear/api.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/reference/pear/api.md b/reference/pear/api.md index 1dce634..57de7b5 100644 --- a/reference/pear/api.md +++ b/reference/pear/api.md @@ -338,6 +338,16 @@ Captures available desktop sources. Resolves to an array of objects with shape ` * https://www.electronjs.org/docs/latest/api/structures/desktop-capturer-source * [``](https://www.electronjs.org/docs/latest/api/native-image) +### `const path = Pear.media.getPathForFile(file )` + +Accepts a web [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File/File) object and returns the file system path for that file as a `String`. In cases where the `file` argument is not a `File` object an exception is thrown. In the case that the `file` is constructed in JS and is not backed by a file on disk an empty string is returned. + +Available in Desktop Applications only. + +**References** + +* https://www.electronjs.org/docs/latest/api/web-utils#webutilsgetpathforfilefile + ### `Pear.versions ` Function that returns a promise which resolves to a Pear versions object with the shape `{ fork , length , key }`.