import type { AddOn, AddOnCreateOpts } from '@heroku/types/3.sdk'; import type { ResourceCtx } from '../../../core/extend-resource.js'; import type { CreateAndWaitOptions } from './types.js'; /** * Create an add-on and optionally wait for provisioning to complete. * * Wraps `addOn.create` with three pieces of orchestration: * * - 423 `confirmation_required` from the platform is converted to a * typed `AddonConfirmationRequiredError`. Callers should catch * this, prompt the user for confirmation, and retry the call with * `body.confirm` set. * - When `wait: true` is set, polls `addOn.infoByApp` on a * `waitIntervalMs` cadence until the add-on's `state` is no longer * `provisioning`. Throws `AddonProvisioningFailedError` if the * terminal state is `deprovisioned`. * - `options.onProvisioning` fires once after the create response * when polling is about to begin, letting callers surface a * two-phase status display ("Created" → "Waiting"). * * Both the create and poll calls are issued with `Accept-Expansion: * addon_service,plan` so the response includes the full plan shape * (price, unit, etc.). The create call additionally sets * `X-Heroku-Legacy-Provider-Messages: true` to opt into * provider-supplied `provision_message` text on the response — without * it the platform silently omits that field. */ export declare function createAndWait(ctx: Pick, appIdentity: string, body: AddOnCreateOpts, options?: CreateAndWaitOptions): Promise;