import { EventTypes } from './EventTypes.js';
import { ApiStoreContextEvent, ApiStoreReadEvent } from './BaseEvents.js';
export const TypeEvents = {
    /**
     * Lists the type (schema) definitions for the API.
     * @param target The node on which to dispatch the event
     */
    list: async (target) => {
        const e = new ApiStoreContextEvent(EventTypes.Type.list);
        target.dispatchEvent(e);
        return e.detail.result;
    },
    /**
     * Reads a type (schema) from the store.
     * @param target The node on which to dispatch the event
     * @param id The id of the object to read.
     */
    get: async (target, id) => {
        const e = new ApiStoreReadEvent(EventTypes.Type.get, id);
        target.dispatchEvent(e);
        return e.detail.result;
    },
};
Object.freeze(TypeEvents);
//# sourceMappingURL=TypeEvents.js.map