MCPcopy Index your code
hub / github.com/pyscript/pyscript / storeFSHandler

Function storeFSHandler

core/src/sync.js:23–32  ·  view source on GitHub ↗

* Ask a user action via dialog and returns the directory handler once granted. * @param {string} uid * @param {{id?:string, mode?:"read"|"readwrite", hint?:"desktop"|"documents"|"downloads"|"music"|"pictures"|"videos"}} options * @returns {Promise }

(uid, options = {})

Source from the content-addressed store, hash-verified

21 * @returns {Promise<boolean>}
22 */
23 async storeFSHandler(uid, options = {}) {
24 if (await idb.has(uid)) return true;
25 return getFileSystemDirectoryHandle(options).then(
26 async (handler) => {
27 await idb.set(uid, { handler, options });
28 return true;
29 },
30 () => false,
31 );
32 },
33
34 /**
35 * Explicitly remove the unique identifier for the FS handler.

Callers

nothing calls this directly

Calls 3

hasMethod · 0.80
setMethod · 0.45

Tested by

no test coverage detected