/**
 * A base class to use with store events that do not expect a result.
 */
export class ApiStoreContextVoidEvent extends CustomEvent {
    /**
     * @param type The event type
     * @param detail The optional detail object. It adds object's properties to the `detail` with the `result` property.
     */
    constructor(type, detail) {
        super(type, {
            bubbles: true,
            composed: true,
            cancelable: true,
            detail,
        });
    }
}
/**
 * A base class to use with store events.
 */
export class ApiStoreContextEvent extends CustomEvent {
    /**
     * @param type The event type
     * @param detail The optional detail object. It adds object's properties to the `detail` with the `result` property.
     */
    constructor(type, detail) {
        const d = detail || {};
        super(type, {
            bubbles: true,
            composed: true,
            cancelable: true,
            detail: {
                result: undefined,
                ...d,
            },
        });
    }
}
/**
 * An event to be used to read an object from the API store.
 */
export class ApiStoreReadEvent extends ApiStoreContextEvent {
    /**
     * @param type The type of the event
     * @param id The domain id of the object to read
     * @param parent The domain id of the parent object (like endpoint for an operation).
     */
    constructor(type, id, parent) {
        super(type, { id, parent });
    }
}
/**
 * An event to be used to read a list of object from the API store.
 */
export class ApiStoreReadBulkEvent extends ApiStoreContextEvent {
    /**
     * @param type The type of the event
     * @param ids The list of domain ids to read. These must be of the same domain type.
     */
    constructor(type, ids) {
        super(type, { ids });
    }
}
//# sourceMappingURL=BaseEvents.js.map