Source: hyrrokkin_engine/persistence_interface.js

/*
    Hyrrokkin - a library for building and running executable graphs

    MIT License - Copyright (C) 2022-2025  Visual Topology Ltd

    Permission is hereby granted, free of charge, to any person obtaining a copy of this software
    and associated documentation files (the "Software"), to deal in the Software without
    restriction, including without limitation the rights to use, copy, modify, merge, publish,
    distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
    Software is furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included in all copies or
    substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
    BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
    NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
    DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

var hyrrokkin_engine = hyrrokkin_engine || {};

/**
 * An interface defining a persistence API used to store properties and data for a node or configuration
 *
 * @interface
 * @type {hyrrokkin_engine.PersistenceInterface}
 */
hyrrokkin_engine.PersistenceInterface = class {

    /**
     * Construct a instance
     */
    constructor() {
    }

    /**
     * Get the set of properties associated with this node/configuration
     *
     * @returns {Object} the value of the properties
     */
    async get_properties() {
    }

    /**
     * Set the properties associated with this node
     *
     * @param {Object} properties the properties to set, must be an Object that is JSON serialisable
     */
    async set_properties(properties) {
    }

    /**
     * Retrieve data associated with a key or null if no data is associated with that key
     *
     * @param {string} key the key value
     *
     * @return {Promise<(ArrayBuffer|null)>}
     */
    async get_data(key) {
    }

    /**
     * Store data associated with a key
     *
     * @param {string} key the key value
     * @param {(ArrayBuffer|null)} data the data value (pass null to delete data associated with the key)
     *
     * @return {Promise<void>}
     */
    async set_data(key, data) {
    }

    /**
     * Get an array containing the keys of all data items
     *
     * @return {Promise<string[]>}
     */
    async get_data_keys() {
    }

}