import { EventTypes } from './EventTypes.js';
export default {
    /**
     * Starts an activity with the given intent.
     * The started activity does not expect a result.
     * @param intent The intent to start.
     * @param target Optional events target on which to dispatch the event.
     */
    startActivity: (intent, target = document.body) => {
        const e = new CustomEvent(EventTypes.Intent.startActivity, {
            bubbles: true,
            cancelable: true,
            composed: true,
            detail: {
                intent,
            },
        });
        target.dispatchEvent(e);
    },
    /**
     * Starts an activity with the given intent.
     * The started activity expects a result.
     * @param intent The intent to start.
     * @param target Optional events target on which to dispatch the event.
     */
    startActivityForResult: (intent, onResult, target = document.body) => {
        const e = new CustomEvent(EventTypes.Intent.startActivityForResult, {
            bubbles: true,
            cancelable: true,
            composed: true,
            detail: {
                intent,
                onResult,
            },
        });
        target.dispatchEvent(e);
    },
};
//# sourceMappingURL=IntentEvents.js.map