import "./events/carrier/CarrierStats.js";
import "./events/travel/Docked.js";
import "./events/station/EngineerCraft.js";
import "./events/travel/FSDJump.js";
import "./events/travel/Location.js";
import "./events/exploration/Scan.js";
import "./events/startup/Statistics.js";
import "./events/other/Synthesis.js";
import type { AnyJournalEvent } from "./AnyJournalEvent.js";
import type { Backpack } from "./events/odyssey/Backpack.js";
import type { ExtendedFCMaterials } from "./events/odyssey/FCMaterials.js";
import type { ExtendedModuleInfo } from "./events/other/ModuleInfo.js";
import type { Status } from "./events/other/Status.js";
import type { ExtendedMarket } from "./events/station/Market.js";
import type { ExtendedOutfitting } from "./events/station/Outfitting.js";
import type { ExtendedShipyard } from "./events/station/Shipyard.js";
import type { ExtendedNavRoute } from "./events/travel/NavRoute.js";
import type { JournalPosition } from "./JournalPosition.js";
/**
 * Options for reading journal files.
 */
export interface JournalOptions {
    /** Optional journal directory. If not specified then automatically determined by looking in popular spots. */
    directory?: string;
    /**
     * Optional position within the journal where to start at. Can be either a specific journal position or the
     * string "end" to indicate starting at the end of the journal. Starting at the end only makes sense for watch
     * mode to only watch for new events. In normal read mode you would simply read no events at all.
     * Defaults to "start".
     */
    position?: JournalPosition | "start" | "end";
    /**
     * Set to true to watch the journal for new events. False (default) just reads the existing journal events and
     * does not wait for new ones.
     */
    watch?: boolean;
}
/**
 * Journal reader/watcher.
 *
 * Reads or watches a journal directory. It implements the AsyncIterable interface so for reading/watching the
 * journal you simply iterate of the instance of this class with a for..of loop for example. If you prefer you can
 * also use the {@link next} method to read the next event from the journal until this method returns null to indicate
 * the end of the journal.
 *
 * In watch mode the iteration does not end and is continued every time a new event is appended to the journal by the
 * game. Watch mode can be stopped by calling the {@link close} method. Iteration loops will end when journal is closed.
 */
export declare class Journal implements AsyncIterable<AnyJournalEvent> {
    /** The journal directory. */
    private readonly directory;
    /** The current journal position pointing to the next event to read. */
    private position;
    /** The generator used for reading journal events. */
    private readonly generator;
    /** The currently open line reader. Null if currently none open. */
    private lineReader;
    /** Controller used to abort watchers when journal is closed. */
    private readonly abortController;
    /**
     * Creates journal read from given directory at given position.
     *
     * @param directory - The journal directory.
     * @param position  - The position to start reading from.
     * @param watch     - True to watch journal, false to just read it.
     */
    private constructor();
    /**
     * Opens the journal.
     */
    static open({ directory, position, watch }?: JournalOptions): Promise<Journal>;
    /**
     * Searches for the journal directory in common spaces. First it checks for existence of directory specified with
     * environment variable ED_JOURNAL_DIR. Then it looks into the standard directory on a windows system and then
     * it checks to standard directory within Proton (for Linux).
     *
     * If you know more common journal locations then please let me know so I can improve the search.
     *
     * @return The found journal directory.
     * @throws JournalError - When journal directory was not found.
     */
    static findDirectory(): Promise<string>;
    /**
     * Returns the journal directory.
     *
     * @return The journal directory.
     */
    getDirectory(): string;
    /**
     * Returns the current journal position which points to the next event to read.
     *
     * @return The current journal position.
     */
    getPosition(): JournalPosition;
    /**
     * Closes the journal by stopping the watcher (if any) and closing the line reader.
     */
    close(): Promise<void>;
    /**
     * Finds the end position of the journal and returns it.
     *
     * @return End position of the journal.
     */
    static findEnd(directory: string): Promise<JournalPosition>;
    /**
     * Watches the journal for new or changed files and returns filenames sorted by date. An optional starting file
     * can be specified to define the starting point for the watcher. If not specified then the whole journal
     * directory is scanned and all found journal files are returned before starting to watch for changed or new
     * files.
     *
     * @param startFile - Optional starting file. If not specified then the watcher starts with the oldest available
     *                    journal file.
     * @return New/changed journal files in chronological order.
     */
    private watchJournalFiles;
    /**
     * Lists journal files. An optional starting file can be specified to define the starting point for the watcher.
     * If not specified then the whole journal directory is scanned and all found files are returned..
     *
     * @param startFile - Optional starting file. If not specified then the reader starts with the oldest available
     *                    journal file.
     * @return The found journal files.
     */
    private listJournalFiles;
    /**
     * Parses a single journal event line. Additionally to parsing the string into a JSON object this function also
     * updates old properties in the journal event to new ones if needed.
     *
     * @param line - The JSON line to parse.
     * @return The parsed journal event.
     */
    private parseJournalEvent;
    /**
     * Creates the journal event generator.
     *
     * @param watch - True to watch the journal instead of just reading it.
     * @return The created journal event generator.
     */
    private createGenerator;
    /**
     * Returns async iterator for the journal events.
     *
     * @return Async iterator for the events in this journal.
     */
    [Symbol.asyncIterator](): AsyncGenerator<AnyJournalEvent>;
    /**
     * Returns the next event from the journal. When end of journal is reached then in watch mode this method waits
     * until a new event arrives. When not in watch mode or when journal is closed this method returns null when no
     * more events are available.
     *
     * @return The next journal event or null when end is reached.
     */
    next(): Promise<AnyJournalEvent | null>;
    /**
     * Reads the given JSON file, parses it as at a journal event and returns it.
     *
     * @param filename - The filename of the JSON file to read. Relative to journal directory.
     * @return The parsed journal event. Null when file is not present.
     */
    private readFile;
    /**
     * Watches the given JSON file for changes and reports any new content. It always reports the current content as
     * first change.
     *
     * @param filename - The filename of the JSON file to read and watch. Relative to journal directory.
     * @return Async iterator watching content changes.
     */
    private watchFile;
    private watchFileContent;
    /**
     * Returns the current backpack inventory read from the Backpack.json file.
     *
     * @return The current backpack inventory. Null if Backpack.json file does not exist or is not readable.
     */
    readBackpack(): Promise<Backpack | null>;
    /**
     * Watches the Backpack.json file for changes and reports any new data. It always reports the current data as
     * first change.
     *
     * @return Async iterator watching backpack inventory changes.
     */
    watchBackpack(): AsyncGenerator<Backpack>;
    /**
     * Returns the current cargo data read from the Cargo.json file.
     *
     * @return The current cargo data. Null if Cargo.json file does not exist or is not readable.
     */
    readCargo(): Promise<Backpack | null>;
    /**
     * Watches the Cargo.json file for changes and reports any new data. It always reports the current data as
     * first change.
     *
     * @return Async iterator watching cargo changes.
     */
    watchCargo(): AsyncGenerator<Backpack>;
    /**
     * Returns the current fleet carrier materials data read from the FCMaterials.json file.
     *
     * @return The current fleet carrier materials data. Null if FCMaterials.json file does not exist or
     *         is not readable.
     */
    readFCMaterials(): Promise<ExtendedFCMaterials | null>;
    /**
     * Watches the FCMaterials.json file for changes and reports any new data. It always reports the current data as
     * first change.
     *
     * @return Async iterator watching fleet carrier materials data changes.
     */
    watchFCMaterials(): AsyncGenerator<ExtendedFCMaterials>;
    /**
     * Returns the current market data read from the Market.json file.
     *
     * @return The current market data. Null if Market.json file does not exist or is not readable.
     */
    readMarket(): Promise<ExtendedMarket | null>;
    /**
     * Watches the Market.json file for changes and reports any new data. It always reports the current data as
     * first change.
     *
     * @return Async iterator watching market data changes.
     */
    watchMarket(): AsyncGenerator<ExtendedMarket>;
    /**
     * Returns the current modules info read from the ModulesInfo.json file.
     *
     * @return The current modules info. Null if ModulesInfo.json file does not exist or is not readable.
     */
    readModulesInfo(): Promise<ExtendedModuleInfo | null>;
    /**
     * Watches the ModulesInfo.json file for changes and reports any new data. It always reports the current data as
     * first change.
     *
     * @return Async iterator watching modules info changes.
     */
    watchModulesInfo(): AsyncGenerator<ExtendedModuleInfo>;
    /**
     * Returns the current nav route read from the NavRoute.json file.
     *
     * @return The current nav route data. Null if NavRoute.json file does not exist or is not readable.
     */
    readNavRoute(): Promise<ExtendedNavRoute | null>;
    /**
     * Watches the NavRoute.json file for changes and reports any new data. It always reports the current data as
     * first change.
     *
     * @return Async iterator watching nav route data changes.
     */
    watchNavRoute(): AsyncGenerator<ExtendedNavRoute>;
    /**
     * Returns the current outfitting data read from the Outfitting.json file.
     *
     * @return The current outfitting data. Null if Outfitting.json file does not exist or is not readable.
     */
    readOutfitting(): Promise<ExtendedOutfitting | null>;
    /**
     * Watches the Outfitting.json file for changes and reports any new data. It always reports the current data as
     * first change.
     *
     * @return Async iterator watching outfitting data changes.
     */
    watchOutfitting(): AsyncGenerator<ExtendedOutfitting>;
    /**
     * Returns the current contents of the ship locker from the ShipLocker.json file.
     *
     * @return The current ship locker content. Null if ShipLocker.json file does not exist or is not readable.
     */
    readShipLocker(): Promise<ExtendedShipyard | null>;
    /**
     * Watches the ShipLocker.json file for changes and reports any new data. It always reports the current data as
     * first change.
     *
     * @return Async iterator watching ship locker content changes.
     */
    watchShipLocker(): AsyncGenerator<ExtendedShipyard>;
    /**
     * Returns the current shipyard data read from the Shipyard.json file.
     *
     * @return The current shipyard data. Null if Shipyard.json file does not exist or is not readable.
     */
    readShipyard(): Promise<ExtendedShipyard | null>;
    /**
     * Watches the Shipyard.json file for changes and reports any new data. It always reports the current data as
     * first change.
     *
     * @return Async iterator watching shipyard data changes.
     */
    watchShipyard(): AsyncGenerator<ExtendedShipyard>;
    /**
     * Returns the current status read from the Status.json file.
     *
     * @return The current status. Null if Status.json file does not exist or is not readable.
     */
    readStatus(): Promise<Status | null>;
    /**
     * Watches the Status.json file for changes and reports any new status. It always reports the current status as
     * first change.
     *
     * @return Async iterator watching status changes.
     */
    watchStatus(): AsyncGenerator<Status>;
}
