UXP Toolkit
    Preparing search index...
    interface Storage {
        domains: {
            appLocalCache: DomainSymbol;
            appLocalData: DomainSymbol;
            appLocalLibrary: DomainSymbol;
            appLocalShared: DomainSymbol;
            appLocalTemporary: DomainSymbol;
            appRoamingData: DomainSymbol;
            appRoamingLibrary: DomainSymbol;
            userDesktop: DomainSymbol;
            userDocuments: DomainSymbol;
            userMusic: DomainSymbol;
            userPictures: DomainSymbol;
            userVideos: DomainSymbol;
        };
        errors: {
            AbstractMethodInvocationError: Error;
            DataFileFormatMismatchError: Error;
            DomainNotSupportedError: Error;
            EntryExistsError: Error;
            EntryIsNotAFileError: Error;
            EntryIsNotAFolderError: Error;
            EntryIsNotAnEntryError: Error;
            FileIsReadOnlyError: Error;
            InvalidFileFormatError: Error;
            InvalidFileNameError: Error;
            NotAFileSystemError: Error;
            OutOfSpaceError: Error;
            PermissionDeniedError: Error;
            ProviderMismatchError: Error;
        };
        fileTypes: { all: string[]; images: string[]; text: string[] };
        formats: { binary: FormatSymbol; utf8: FormatSymbol };
        localFileSystem: LocalFileSystemProvider;
        modes: { readOnly: ModeSymbol; readWrite: ModeSymbol };
        secureStorage: {
            clear: () => Promise<void>;
            getItem: (key: string) => Promise<Uint8Array<ArrayBufferLike>>;
            key: (index: number) => string;
            length: number;
            removeItem: (key: string) => Promise<void>;
            setItem: (
                key: string,
                value: string | ArrayBuffer | Uint8Array<ArrayBufferLike>,
            ) => Promise<void>;
        };
        types: { file: TypeSymbol; folder: TypeSymbol };
    }
    Index

    Properties

    domains: {
        appLocalCache: DomainSymbol;
        appLocalData: DomainSymbol;
        appLocalLibrary: DomainSymbol;
        appLocalShared: DomainSymbol;
        appLocalTemporary: DomainSymbol;
        appRoamingData: DomainSymbol;
        appRoamingLibrary: DomainSymbol;
        userDesktop: DomainSymbol;
        userDocuments: DomainSymbol;
        userMusic: DomainSymbol;
        userPictures: DomainSymbol;
        userVideos: DomainSymbol;
    }

    Common locations that we can use when displaying a file picker.

    Type Declaration

    • appLocalCache: DomainSymbol

      Local application cache directory (persistence not guaranteed).

    • appLocalData: DomainSymbol

      Local application data.

    • appLocalLibrary: DomainSymbol

      Local application library.

    • appLocalShared: DomainSymbol

      Local application shared data folder.

    • appLocalTemporary: DomainSymbol

      Local temporary directory.

    • appRoamingData: DomainSymbol

      Roaming application data.

    • appRoamingLibrary: DomainSymbol

      Roaming application library data.

    • userDesktop: DomainSymbol

      The user's desktop folder.

    • userDocuments: DomainSymbol

      The user's documents folder.

    • userMusic: DomainSymbol

      The user's music folder or library.

    • userPictures: DomainSymbol

      The user's pictures folder or library.

    • userVideos: DomainSymbol

      The user's videos / movies folder or library.

    errors: {
        AbstractMethodInvocationError: Error;
        DataFileFormatMismatchError: Error;
        DomainNotSupportedError: Error;
        EntryExistsError: Error;
        EntryIsNotAFileError: Error;
        EntryIsNotAFolderError: Error;
        EntryIsNotAnEntryError: Error;
        FileIsReadOnlyError: Error;
        InvalidFileFormatError: Error;
        InvalidFileNameError: Error;
        NotAFileSystemError: Error;
        OutOfSpaceError: Error;
        PermissionDeniedError: Error;
        ProviderMismatchError: Error;
    }

    Type Declaration

    • AbstractMethodInvocationError: Error

      Attempted to invoke an abstract method.

    • DataFileFormatMismatchError: Error

      Data and Format mismatch.

    • DomainNotSupportedError: Error

      Domain is not supported by the current FileSystemProvider instance.

    • EntryExistsError: Error

      An attempt was made to overwrite an entry without indicating that it was safe to do so via overwrite: true.

    • EntryIsNotAFileError: Error

      The entry is not a file, but was expected to be.

    • EntryIsNotAFolderError: Error

      The entry is not a folder, but was expected to be a folder.

    • EntryIsNotAnEntryError: Error

      The object passed as an entry is not actually an Entry.

    • FileIsReadOnlyError: Error

      An attempt was made to write to a file that was opened as read-only.

    • InvalidFileFormatError: Error

      Unsupported format type.

    • InvalidFileNameError: Error

      The file name contains invalid characters.

    • NotAFileSystemError: Error

      The instance was expected to be a file system, but wasn't.

    • OutOfSpaceError: Error

      The file system is out of space (or quota has been exceeded).

    • PermissionDeniedError: Error

      The file system revoked permission to complete the requested action.

    • ProviderMismatchError: Error

      Attempted to execute a command that required the providers of all entries to match.

    fileTypes: { all: string[]; images: string[]; text: string[] }

    This namespace describes the various file type extensions that can used be used in some FS file open methods.

    Type Declaration

    • all: string[]

      All file types.

    • images: string[]

      Image file extensions.

    • text: string[]

      Text file extensions.

    formats: { binary: FormatSymbol; utf8: FormatSymbol }

    This namespace describes the file content formats supported in FS methods like read and write.

    Type Declaration

    localFileSystem: LocalFileSystemProvider
    modes: { readOnly: ModeSymbol; readWrite: ModeSymbol }

    This namespace describes the file open modes. For eg: open file in read-only or both read-write.

    Type Declaration

    • readOnly: ModeSymbol

      The file is read-only; attempts to write will fail.

    • readWrite: ModeSymbol

      The file is read-write.

    secureStorage: {
        clear: () => Promise<void>;
        getItem: (key: string) => Promise<Uint8Array<ArrayBufferLike>>;
        key: (index: number) => string;
        length: number;
        removeItem: (key: string) => Promise<void>;
        setItem: (
            key: string,
            value: string | ArrayBuffer | Uint8Array<ArrayBufferLike>,
        ) => Promise<void>;
    }

    SecureStorage provides a protected storage which can be used to store sensitive data per plugin. SecureStorage takes a key-value pair and encrypts the value before being stored. After encryption, it stores the key and the encrypted value pair. When the value is requested with an associated key, it's retrieved after being decrypted. Please note that the key is not encrypted thus it's not protected by the cryptographic operation.

    Caveats for SecureStorage are as follows:

    1. Data in SecureStorage can be lost for various reasons. For an example, the user could uninstall the host application and delete the secure storage. Or, the cryptographic information used by the secure storage could be damaged by the user accidentally, and it will result in loss of data without the secure storage being removed. SecureStorage should be regarded as a cache rather than a persistent storage. Data in SecureStorage should be able to be regenerated from plugins after the time of loss.
    2. SecureStorage is not an appropriate storage for sensitive data which wants to keep secret from the current user. SecureStorage is protected under the current user's account credential. It means the encrypted data can be at risk of being decrypted with the current user's privilege.

    Type Declaration

    • clear: () => Promise<void>

      Clear all values in a secure storage.

    • getItem: (key: string) => Promise<Uint8Array<ArrayBufferLike>>

      Retrieve a value associated with a provided key after the value is being decrypted from a secure storage.

      If a key doesn't have an acceptable type.

    • key: (index: number) => string

      Returns a key which is stored at the given index.

    • length: number

      Returns number of items stored in the secure storage.

    • removeItem: (key: string) => Promise<void>

      Remove a value associated with a provided key.

      If a key doesn't have an acceptable type.

    • setItem: (
          key: string,
          value: string | ArrayBuffer | Uint8Array<ArrayBufferLike>,
      ) => Promise<void>

      Store a key and value pair after the value is encrypted in a secure storage.

      If either key or value doesn't have one of acceptable types.

    types: { file: TypeSymbol; folder: TypeSymbol }

    This namespace describes the type of the entry. Whether file or folder etc.

    Type Declaration

    • file: TypeSymbol

      A file; used when creating an entity.

    • folder: TypeSymbol

      A folder; used when creating an entity.