Capability first · transport second

DirectoryPicker.js

Wraps the provider-owned native directory chooser and normalizes selected/cancelled/error results.

SDK 0.5.18Runtime 0.8.12Protocol arcane/1
On this page

Overview

Wraps the provider-owned native directory chooser and normalizes selected/cancelled/error results.

  • Artifact
    DirectoryPicker.js · esm
  • Classification
    public first party
  • Availability
    Native bridge
  • Normalization
    Complete mutable caller options and provider result fields; coded cancellation and malformed-result errors.

Import and lifecycle

JavaScript
import * as module from '/arcane/modules/DirectoryPicker.js';

select opens one provider-owned operating-system directory chooser; it never enumerates directories, persists paths, or invokes a browser file picker.

Application-facing behavior: default DirectoryPicker, normalizeDirectoryPickerOptions(), normalizeDirectorySelection().

Protocol and host implementation

Arcane.filesystem.selectDirectory This detail does not widen the application-facing API or grant authority.

Exports, signatures, parameters, and results

BindingFormDeclaration or signatureParameter syntax
defaultdefault · classclass DirectoryPicker
normalizeDirectoryPickerOptionsfunctionfunction normalizeDirectoryPickerOptions(input={})input={}
normalizeDirectorySelectionfunctionfunction normalizeDirectorySelection(input)input
CallableKindExact public signatureParameter syntax
normalizeDirectoryPickerOptionsexported-functionfunction normalizeDirectoryPickerOptions(input={})input={}
normalizeDirectorySelectionexported-functionfunction normalizeDirectorySelection(input)input
MemberKindExact public declarationParameter syntax
DirectoryPicker.constructorconstructorconstructor(provider=globalThis.Arcane?.filesystem)provider=globalThis.Arcane?.filesystem
DirectoryPicker.availablegetget available()
DirectoryPicker.selectasync methodasync select(options={})options={}

Parameter meanings and results

DirectoryPicker(provider).select(options) preserves every caller option, passes complete title and initialPath strings unchanged, and preserves every provider result field while normalizing cancelled and path. Returned option and result records remain mutable. normalizeDirectoryPickerOptions and normalizeDirectorySelection are public pure helpers.

Events, side effects, and errors

Source-literal CustomEvent dispatches

No source-literal CustomEvent dispatch is part of this artifact.

Lifecycle and event flow

This artifact has no additional documented lifecycle event flow.

Direct coded failures

This artifact directly assigns no stable coded failure.

Exported Error subclasses

This artifact exports no Error subclass.

Documented failure behavior

  • DIRECTORY_PICKER_UNAVAILABLE
  • DIRECTORY_PICKER_INVALID_RESULT
  • TypeError for non-object options or non-string title and initialPath values

Availability and capabilities

Native bridge. Complete mutable caller options and provider result fields; coded cancellation and malformed-result errors.

Normalized native Arcane.filesystem.selectDirectory wrapper, not a Core filesystem browser.

Contract example

JavaScript
import DirectoryPicker from '/arcane/modules/DirectoryPicker.js';

const picker=new DirectoryPicker({
    selectDirectory:async options=>({cancelled:false,path:'/workspace'})
});
console.log(await picker.select({title:'Choose a workspace'}));