Hosanna UI API v1.30.2-next
    Preparing search index...

    Interface IHosannaFileSystem

    Interface representing a file system for managing files.

    interface IHosannaFileSystem {
        clear(): void;
        deleteFile(path: string): boolean;
        fileExists(path: string): boolean;
        getAllFileNames(): string[];
        getFileSize(path: string): undefined | number;
        readFile(path: string): null | string;
        renameFile(oldPath: string, newPath: string): boolean;
        writeBytes(path: string, data: Uint8Array, contentType?: string): void;
        writeFile(path: string, data: string): void;
    }
    Index

    Methods

    • Clears all files in the file system (mainly for testing purposes).

      Returns void

    • Deletes a file.

      Parameters

      • path: string

        The path to the file.

      Returns boolean

      True if the file was successfully deleted, false otherwise.

    • Checks if a file exists.

      Parameters

      • path: string

        The path to the file.

      Returns boolean

      True if the file exists, false otherwise.

    • Retrieves all file names in the file system.

      Returns string[]

      An array of file names.

    • Parameters

      • path: string

      Returns undefined | number

    • Reads the content of a file.

      Parameters

      • path: string

        The path to the file.

      Returns null | string

      The file content as a string, or null if the file does not exist.

    • Renames a file.

      Parameters

      • oldPath: string

        The current path of the file.

      • newPath: string

        The new path for the file.

      Returns boolean

      True if the file was successfully renamed, false otherwise.

    • Parameters

      • path: string
      • data: Uint8Array
      • OptionalcontentType: string

      Returns void

    • Writes data to a file.

      Parameters

      • path: string

        The path to the file.

      • data: string

        The data to write.

      Returns void