UNPKG

@azure-tools/typespec-azure-resource-manager

Version:

TypeSpec Azure Resource Manager library

45 lines 2.44 kB
import { Model, Namespace, Program } from "@typespec/compiler"; import { ArmLibraryNamespaceDecorator, ArmProviderNamespaceDecorator, UseLibraryNamespaceDecorator } from "../generated-defs/Azure.ResourceManager.js"; /** * Mark the target namespace as containign only ARM library types. This is used to create libraries to share among RPs * @param context The doecorator context, automatically supplied by the compiler * @param entity The decorated namespace */ export declare const $armLibraryNamespace: ArmLibraryNamespaceDecorator; /** * Check if the given namespace contains ARM library types * @param program The program to process * @param namespace The namespace to check * @returns true if the given namespace contains ARM library types only, false otherwise */ export declare function isArmLibraryNamespace(program: Program, namespace: Namespace): boolean; export declare function isArmProviderNamespace(program: Program, namespace: Namespace | undefined): boolean; /** * Specify which ARM library namespaces this arm provider uses * @param {DecoratorContext} context Standard DecoratorContext object * @param {Namespace} entity The namespace the decorator is applied to * @param {Namespace[]} namespaces The library namespaces that will be used in this namespace */ export declare const $useLibraryNamespace: UseLibraryNamespaceDecorator; /** * Determine which library namespaces are used in this provider * @param {Program} program The program to check * @param {Namespace} namespace The provider namespace */ export declare function getUsedLibraryNamespaces(program: Program, namespace: Namespace): Namespace[] | undefined; /** * `@armProviderNamespace` sets the ARM provider namespace. * @param {DecoratorContext} context DecoratorContext object * @param {type} entity Target of the decorator. Must be `namespace` type * @param {string} armProviderNamespace Provider namespace */ export declare const $armProviderNamespace: ArmProviderNamespaceDecorator; /** * Get the ARM provider namespace for a given entity * @param {Program} program * @param {Namespace | Model} entity * @returns {string | undefined} ARM provider namespace */ export declare function getArmProviderNamespace(program: Program, entity: Namespace | Model): string | undefined; export declare function resolveProviderNamespace(program: Program, ns?: Namespace | undefined): Namespace | undefined; //# sourceMappingURL=namespace.d.ts.map