Skip to main content

LensStudio:ScopedStorage.js.IStorage

Interface

Interface for safe file system operations within a specified directory

Index

Properties

path

path: Path

Gets the path of the storage directory

Methods

createFile()

createFile(name, content): Path

Creates a new file in the storage directory

Parameters

ParameterType
namestring
contentstring | Uint8Array<ArrayBufferLike>

Returns

Path


readBytes()

readBytes(path): Uint8Array<ArrayBufferLike>

Reads a file as a byte array

Parameters

ParameterType
pathstring | Path

Returns

Uint8Array<ArrayBufferLike>


readFile()

readFile(path): string

Reads a file as a string

Parameters

ParameterType
pathstring | Path

Returns

string


unpackContent()

unpackContent(archivePath): Path

Unpacks a ZIP archive into the storage directory

Parameters

ParameterType
archivePathstring | Path

Returns

Path