import type { Context } from "../context.js"; import { Resource } from "../resource.js"; import { type CloudflareApiOptions } from "./api.js"; /** * Properties for creating or updating a CustomDomain */ export interface CustomDomainProps extends CloudflareApiOptions { /** * The domain name to bind to the worker */ name: string; /** * Cloudflare Zone ID for the domain */ zoneId: string; /** * Name of the worker to bind to the domain */ workerName: string; /** * Worker environment (defaults to production) * @default "production" */ environment?: string; } /** * Output returned after CustomDomain creation/update */ export interface CustomDomain extends Resource<"cloudflare::CustomDomain">, CustomDomainProps { /** * The unique identifier for the Cloudflare domain binding. */ id: string; /** * Time at which the domain binding was created (approximated if not returned by API) */ createdAt: number; /** * Time at which the domain binding was last updated */ updatedAt: number; } /** * Configure custom domain for a Cloudflare Worker using the Cloudflare Custom Domains API * This attaches a worker to a specific hostname within a zone. * * @example * // Bind a domain to a standard Cloudflare Worker * const apiWorker = await Worker("api", { * name: "my-api-worker", * entrypoint: "./src/api-worker.ts" * }); * * const apiDomain = await CustomDomain("api-domain-binding", { * name: "api.example.com", * zoneId: "YOUR_ZONE_ID", // Replace with actual Zone ID * workerName: apiWorker.name // Use the name from the Worker resource * }); * * @see https://developers.cloudflare.com/api/resources/workers/subresources/domains/ */ export declare const CustomDomain: (((this: any, id: string, props?: {}) => never) & (new (_: never) => never)) | ((this: Context, logicalId: string, props: CustomDomainProps) => Promise); //# sourceMappingURL=custom-domain.d.ts.map