export const DOCS_REGION_EDIT_EVENT = "ultidocs:region-edit-start"

export type DocsRegionEditDetail = {
  region: "header" | "footer"
  pageIndex?: number
}

export function startDocsRegionEdit(region: "header" | "footer", pageIndex = 0) {
  window.dispatchEvent(
    new CustomEvent<DocsRegionEditDetail>(DOCS_REGION_EDIT_EVENT, {
      detail: { region, pageIndex },
    })
  )
}
