hed-typescript API
    Preparing search index...

    Class BidsWebAccessor

    BIDS file accessor for browser environments.

    Reads file content using the browser File.text() API. Schemas come from the bundled copies or from GitHub, never from a local file.

    const input = document.querySelector('input[webkitdirectory]')
    const [dataset, issues] = await BidsDataset.create(input.files, BidsWebAccessor)

    Hierarchy (View Summary)

    Index
    datasetRootDirectory: string

    The root directory of the dataset.

    fileMap: Map<string, File>

    Map of relative file paths to file representations.

    organizedPaths: Map<string, Map<string, string[]>>

    Organized paths.

    schemaBuilder: SchemaBuilder

    The HED schema builder function.

    SPECIAL_DIRS: readonly string[] = ...

    BIDS special directories.

    SUFFIXES: readonly string[] = ...

    BIDS suffixes.

    • Read a file's content via the browser File API.

      Parameters

      • relativePath: string

        The relative path to the file within the dataset.

      Returns Promise<string | null>

      The file contents, or null if the file is not found or cannot be read.

    • Factory method to create a BidsWebAccessor from a browser FileList.

      Parameters

      • fileInput: FileList | File[]

        The files from a webkitdirectory upload.

      Returns Promise<BidsWebAccessor>

      A Promise resolving to the accessor.