/** * Shim mapping `@wordpress/api-fetch` to `window.wp.apiFetch`. Requires the * `wp-api-fetch` script dependency on the consuming bundle. In the block * editor the nonce + root-URL middlewares are preconfigured, so callers get * plain-permalink handling and auth for free. */ const apiFetch = (window as any).wp?.apiFetch; export default apiFetch as (options: { path: string; method?: string; data?: unknown }) => Promise;