Cosmos Journeyer API Documentation - v1.10.4
    Preparing search index...

    Interface defining the file system operations for save data.

    interface IFileSystem {
        createDirectory(path: string): Promise<boolean>;
        deleteDirectory(path: string): Promise<boolean>;
        deleteFile(path: string): Promise<boolean>;
        directoryExists(path: string): Promise<boolean>;
        fileExists(path: string): Promise<boolean>;
        listDirectory(path: string): Promise<null | string[]>;
        readFile(path: string): Promise<null | string>;
        writeFile(path: string, content: string): Promise<boolean>;
    }

    Implemented by

    Index

    Methods

    • Creates a directory at the specified path.

      Parameters

      • path: string

        The directory path to create

      Returns Promise<boolean>

      Boolean indicating success or failure

    • Deletes a directory at the specified path.

      Parameters

      • path: string

        The directory path to delete

      Returns Promise<boolean>

      Boolean indicating success or failure

    • Checks if a directory exists.

      Parameters

      • path: string

        The directory path to check

      Returns Promise<boolean>

      Boolean indicating if directory exists

    • Lists the contents of a directory.

      Parameters

      • path: string

        The directory path to list

      Returns Promise<null | string[]>

      Array of file/directory names, or null if directory doesn't exist

    • Reads content from a file.

      Parameters

      • path: string

        The file path to read from

      Returns Promise<null | string>

      File content or null if file doesn't exist

    • Writes content to a file.

      Parameters

      • path: string

        The file path to write to

      • content: string

        The content to write

      Returns Promise<boolean>

      Boolean indicating success or failure