import type { DnsConfig } from '@stacksjs/types'; import type { DnsProvider, DnsRecord } from '@stacksjs/ts-cloud'; /** * Flatten a `config/dns.ts` `DnsConfig` into the provider's record shape. * `nameservers` are delegation, not zone records, so they are not included. */ export declare function desiredDnsRecords(domain: string, cfg: DnsConfig): DnsRecord[]; /** * Build the additive reconciliation plan: which declared records are missing * (create), which are already satisfied (keep), and which cannot be published * at all (skip). Never plans a delete or an overwrite. */ export declare function planDnsSync(desired: DnsRecord[], current: DnsRecord[], options?: { zone?: string }): DnsPlan; /** * Read a zone's live records over public DNS (no registrar credentials). Used by * `pull`, and by `sync`/`diff` as a fallback when no provider is configured. */ export declare function resolveLiveRecords(domain: string): Promise; /** * Resolve a registrar provider for a domain from environment credentials * (`PORKBUN_API_KEY`/`PORKBUN_SECRET_KEY`, AWS, GoDaddy, Cloudflare). Returns * null when no configured provider can manage the domain. */ export declare function dnsProviderForDomain(domain: string): Promise; /** * Render a set of records as a `config/dns.ts` source block (used by `pull`). */ export declare function renderDnsConfig(domain: string, records: DnsRecord[]): string; /** * Additively reconcile a `config/dns.ts` to a domain's registrar. Current state * is read from the provider when credentials are available, else from public * DNS. With `dryRun` (or no provider) it computes the plan without writing. */ export declare function syncDnsConfig(domain: string, cfg: DnsConfig, options?: { dryRun?: boolean, provider?: DnsProvider | null }): Promise; export declare interface DnsPlanItem { record: DnsRecord action: 'create' | 'keep' | 'skip' reason?: string } export declare interface DnsSkippedRecord { record: DnsRecord reason: string } export declare interface DnsPlan { items: DnsPlanItem[] create: DnsRecord[] keep: DnsRecord[] skip: DnsSkippedRecord[] } export declare interface DnsSyncFailure { record: DnsRecord reason: string } export declare interface DnsSyncResult { plan: DnsPlan created: number kept: number failed: number failures: DnsSyncFailure[] skipped: DnsSkippedRecord[] applied: boolean provider: string | null }