export interface SyncLoadingOptions { text?: string } export const SYNC_LOADING_EVENT = 'sync-loading' export const SYNC_LOADING_HIDE_EVENT = 'sync-loading-hide' const dispatchSyncLoading = (detail: SyncLoadingOptions) => { window.dispatchEvent(new CustomEvent(SYNC_LOADING_EVENT, { detail })) } export const showSyncLoading = (options?: SyncLoadingOptions) => { dispatchSyncLoading(options ?? {}) } export const hideSyncLoading = () => { window.dispatchEvent(new Event(SYNC_LOADING_HIDE_EVENT)) }