Source: plugins/store_base.js

/*   Skadi - A visual modelling tool for constructing directed graphs.

     Copyright (C) 2022-2025 Visual Topology Ltd

     Licensed under the MIT License
*/

var skadi = skadi || {};

skadi.StoreBase = class {

    /**
     * Initialise the store
     *
     * @param {object} the options object defining system configuration
     *
     * @returns {Promise<void>}
     */
    async init(options)  {
    }

    /**
     * Create a new topology in the store
     *
     * @param {string} topology_id ID of new topology
     * @param {?string} from_topology_id ID of a topology to copy, if provided
     * @returns {Promise<void>}
     */
    async create_topology(topology_id, from_topology_id) {
    }

    /**
     * Copy a topology
     *
     * @param from_topology_id
     * @param to_topology_id
     *
     * @return {Promise<void>}
     */
    async copy_topology(from_topology_id, to_topology_id) {
    }

    /**
     * Remove a topology from the store, if it exists
     *
     * @param topology_id
     * @returns {Promise<void>}
     */
    async remove_topology(topology_id) {

    }

    /**
     * Reload a topology from its template
     *
     * @param topology_id
     * @returns {Promise<void>}
     */
    async reload_topology(topology_id) {

    }

    /**
     * @typedef  TopologyMetadata
     * @type {object}
     * @property {string} name - the topology name.
     * @property {string} description - the topology name.
     * @property {?string} version - the topology version.
     * @property {?number} authors - list of authors.
     *
     */

    /**
     * Get an array of all the topology ids in the store
     *
     * @returns {Promise<string[]>}
     */
    async list_topologies() {

    }

    /**
     * Check if a topology exists in the store
     *
     * @param {string} topology_id the id of the topology
     * @returns {Promise<boolean>}
     */
    async topology_exists(topology_id) {

    }

    /**
     * Return a list of topologies, where the key is the topology metadata
     *
     * @returns {Promise<Object.<string, TopologyMetadata>>}
     */
    async get_topology_details() {

    }

    /**
     * Get the metadata for a topology
     *
     * @returns {Promise<TopologyMetadata>}
     */
    async get_topology_metadata(topology_id) {

    }

    /**
     * Load the topology from the store into the bound skadi instance
     *
     * @param {string} topology_id the id of the topology to load
     *
     * @returns {Promise<void>}
     */
    async load_topology(topology_id) {
    }

    /**
     *
     */
    bind() {
    }

    async save() {
    }

    async get_save_link() {
    }

    async load_from(file) {
    }

    get_file_suffix() {
    }

}