/** * ARM deployment-scope metadata (#1545). * * The generated lexicon records `deployScopes` for resources that exist * somewhere other than plain resource-group scope (management groups, * subscription aliases, policy definitions). This module loads that map and * resolves which deployment scope a template targets, shared by the * serializer (picks the template $schema) and AZR030 (flags resources * emitted at a scope their schema does not define). * * Lazy-loaded and cached for the lifetime of the process. */ import { DECLARABLE_MARKER, type Declarable } from "@intentius/chant/declarable"; export type DeployScope = "resourceGroup" | "subscription" | "managementGroup" | "tenant"; /** Marker symbol for deployment-scope pin identification. */ export declare const DEPLOYMENT_SCOPE_MARKER: unique symbol; /** * A deployment-scope pin — wraps a scope into a Declarable the serializer * uses instead of inferring the scope from the resource set. */ export interface DeploymentScope extends Declarable { readonly [DEPLOYMENT_SCOPE_MARKER]: true; readonly [DECLARABLE_MARKER]: true; readonly lexicon: "azure"; readonly entityType: "chant:azure:deploymentScope"; readonly scope: DeployScope; } /** Type guard for DeploymentScope. */ export declare function isDeploymentScope(value: unknown): value is DeploymentScope; /** * Pin the project's deployment scope. Without a pin the serializer picks * the scope every resource supports that is closest to a resource group, * which cannot tell a management-group policy project from a subscription * one — policy definitions and assignments deploy at both. One pin per * project; AZR030 flags resources whose schema does not define the pinned * scope. * * @example * ```ts * export const scope = deploymentScope("managementGroup"); * ``` */ export declare function deploymentScope(scope: DeployScope): DeploymentScope; /** Template $schema URL per deployment scope. */ export declare const TEMPLATE_SCHEMAS: Record; /** * Load per-resource deployment scopes from the lexicon JSON. * Only resources with a non-default scope set appear; everything else is * plain resource-group scope. Result is cached after first call. */ export declare function loadDeployScopes(): Map; /** Deployment scopes for one ARM resource type (defaults to resource group). */ export declare function deployScopesFor(resourceType: string): DeployScope[]; /** * Resolve the deployment scope for a template containing the given resource * types: the scopes every resource supports, intersected. * * Resource-group scope wins whenever the intersection allows it (the * pre-#1545 behavior for every template that could already be emitted). * Otherwise the scope closest to a resource group is chosen. An empty * intersection has no valid single-template answer; resource-group scope is * returned and AZR030 reports the resources that cannot deploy there. */ export declare function resolveTemplateScope(resourceTypes: Iterable): DeployScope; /** Map a template $schema URL back to its deployment scope. */ export declare function scopeForTemplateSchema(schema: unknown): DeployScope; //# sourceMappingURL=deploy-scopes.d.ts.map