@azure/provisioning-core package

Classes

DefaultNamingPolicy

Default workload-based naming policy.

Generates names by composing the resource type abbreviation, workload, environment, region, label, and an ordinal suffix for repeated types. Global-scope resources get a uniqueString(subscription().subscriptionId) suffix to reduce name collisions; Azure name availability is not checked.

OutputCollection

Authoring-time collection of a stack's deployment outputs. Backed by an ordered private array; supports add/get/delete/iteration. Outputs are terminal sinks (no expression handle), so iteration yields metadata.

ParameterCollection

Authoring-time collection of a stack's deployment parameters. Backed by an ordered private array; supports add/get/delete/iteration. Look parameters up by name via ParameterCollection.get.

ProvisioningComponent

Base class for all tree nodes in the library object model.

Example

import { ProvisioningComponent } from "@azure/provisioning-core";
import { KeyVault, Secret } from "@azure/provisioning-keyvault";

class DataTier extends ProvisioningComponent {
  readonly vault: KeyVault;
  readonly secret: Secret;

  constructor(parent: ProvisioningComponent, tenantId: string, secretValue: string) {
    super(parent);
    this.vault = new KeyVault(this, {
      name: "kv-my-app",
      location: "eastus",
      properties: { tenantId, sku: { family: "A", name: "standard" } },
    });
    this.secret = new Secret(this.vault, {
      name: "database-password",
      properties: { value: secretValue },
    });
  }
}
Resource

Base class for all Azure resources.

Example

import { ResourceGroup, Stack } from "@azure/provisioning-core";
import { KeyVault } from "@azure/provisioning-keyvault";

const stack = new Stack("my-app", { targetScope: "subscription" });
const rg = new ResourceGroup(stack, { name: "rg-my-app", location: "eastus" });
const vault = new KeyVault(rg, {
  name: "kv-my-app",
  properties: {
    tenantId: "11111111-1111-1111-1111-111111111111",
    sku: { family: "A", name: "standard" },
  },
});

// vault.name is an Expression, not a string
// vault.id compiles to resourceId(...)
ResourceDeclaration

Shared base for resource declaration implementations.

ResourceGroup

An Azure resource group that establishes a deployment boundary.

Example

import { Stack, ResourceGroup } from "@azure/provisioning-core";
import { KeyVault } from "@azure/provisioning-keyvault";

const stack = new Stack("my-app");
const rg = new ResourceGroup(stack, { location: "eastus" });
const vault = new KeyVault(rg, {
  properties: { tenantId: "...", sku: { family: "A", name: "standard" } },
});
Stack

A Stack defines a deployment unit.

VariableCollection

Authoring-time collection of a stack's deployment variables. Backed by an ordered private array; supports add/get/delete/iteration. Look variables up by name via VariableCollection.get.

Interfaces

ManagementGroupScope

Typed shape of Bicep's managementGroup() runtime function. Only the properties currently surfaced are listed; extend as needed.

ResourceGroupScope

Typed shape of Bicep's resourceGroup() runtime function. Only the properties currently surfaced are listed; extend as needed.

SubscriptionScope

Typed shape of Bicep's subscription() runtime function. Only the properties currently surfaced are listed; extend as needed.

TenantScope

Typed shape of Bicep's tenant() runtime function. Only the properties currently surfaced are listed; extend as needed.

AnyShape

A TypeSpec scalar rendered as TypeScript any.

ArrayAccessExpressionNode
ArrayShape

An array-of-T property/container shape.

BinaryExpressionNode
BooleanLiteralShape

A terminal TypeSpec boolean literal.

BooleanShape

A scalar whose client-side JavaScript representation is boolean.

BooleanStringEncodingDescriptor
BytesEncodingDescriptor
BytesShape

A scalar whose client-side JavaScript representation is Uint8Array.

DateShape

A scalar whose client-side JavaScript representation is Date.

DateTimeTextEncodingDescriptor
DeferredShape

Deferred reference to a shape value. The thunk is called on dereference so the actual shape lookup is deferred.

Why this exists instead of embedding the shape directly.

Model shapes frequently reference each other — a model's properties can point to other models, and ARM types include both self- referential (tree-like) and mutually-referential (cyclic) structures. If we embedded a ModelShape value directly inside another model shape's value field, both shapes would need to be fully initialized when the parent is constructed. That's impossible whenever:

  • A model references itself, e.g. TreeNode { children: TreeNode[] }.
  • Two models reference each other, e.g. A { b?: B } and B { a?: A }.
  • Two modules each define shapes that reference shapes from the other.

In all three cases the second constant is in the Temporal Dead Zone when the first one's literal evaluates, and the runtime throws ReferenceError: Cannot access ... before initialization.

Wrapping the reference in a thunk solves it. The closure captures the binding name, not its current value. The lookup happens later when the thunk is called — by which time the module graph has finished evaluating and both shapes are fully constructed.

Only the model variant of ValueShape carries a reference — container shapes (array, record) are eager because they don't reference any module-level binding directly; the inner reference deeper down handles cycle-breaking.

DeploymentContext

Inherited environment that flows down the component tree.

DiscriminatedModelShape

A name-discriminated group of variants that share one parent key (an ARM (type, apiVersion) at the registry level, or a parent model's @discriminator field elsewhere). The discriminator names the field whose value selects a variant.

DiscriminatorNames

The two names a discriminator field goes by.

Usually identical — ARM discriminators are type, name, kind and service teams rarely rename them — but a @clientName on the field makes them differ, and the two are looked up in different keyspaces: JS-side state is keyed by jsName, wire JSON by armName. Carrying both is what lets a discriminated shape resolve in either direction.

DurationIso8601EncodingDescriptor
DurationNumericEncodingDescriptor
EnumShape

A terminal TypeSpec enum. Enums cannot carry @encode.

ExistingResourceProps

Public-facing props for a reference to an existing (pre-deployed) Azure resource. This is strictly narrower than the deployable resource props — Bicep existing declarations only accept name and optional scope:.

Read-side access on the returned resource handle is unrestricted — kv.properties.vaultUri, sa.id, etc. all work and compile to symbolic references that ARM resolves at deployment time.

Symbolic parent/extension scopes are expressed by passing the parent resource as the ProvisioningComponent context argument to the resource constructor (with { existing: true }), not via this scope field.

ExpressionBrand
ExpressionTag
FlatModelShape

The standard single-model shape.

FlatVariantPin

One discriminator pinned to a fixed value by a concrete flat variant.

FunctionCallExpressionNode
IdentifierExpressionNode
InputOf

Carries an optional Expression brand on an Input-shaped interface.

This is the asymmetric-brand trick that makes the Input type system work without discriminated unions:

  • Every generated *Input interface extends InputOf<Raw> and therefore inherits the optional brand. Plain literal values (e.g. { foo: 1 }) trivially satisfy it because the brand property is absent, which is permitted by an optional field.
  • Expression<Raw> carries a required brand of the same shape. Required-fields-satisfy-optional is part of TS structural assignability, so any Expression<Raw> is assignable where an InputOf<Raw> (and thus any *Input that extends it) is expected.

Net effect: a single MInput parameter accepts both literals and whole-subtree Expression<M> replacements — no MInput | Expression<M> union is needed in the generated signatures. Callers that want to inspect whether a value is a literal or expression use isExpression().

InputRecord

Writable input form for a Record<string, V> container.

InstanceFunctionCallExpressionNode
InterpolatedStringExpressionNode
NamingContext
NamingPolicy

Strategy for generating Azure resource names when a resource is created without an explicit name.

Implement this interface to provide a custom naming convention. Two built-in implementations are provided:

  • DefaultNamingPolicy — workload-based names with abbreviations, ordinals, and uniqueString() for globally-scoped resources.
  • namingRequiredPolicy — a singleton that throws if a resource doesn't provide an explicit name.
NamingPolicyOptions
NullShape

The TypeSpec null intrinsic.

NumberLiteralShape

A terminal TypeSpec numeric literal.

NumberShape

A scalar whose client-side JavaScript representation is number.

NumericStringEncodingDescriptor
OutputMetadata

Pure declaration data for a deployment output. Stored on the stack and read by the serializer at emit time. An output is a terminal sink — it has no expression handle.

ParameterMetadata

Pure declaration data for a deployment parameter. Stored on the stack (paired with the returned expression handle in <xref:ParameterEntry>); read by the serializer at emit time. Not part of the value-level handle.

PlainDateEncodingDescriptor
PrimitiveTypeMap

Maps each Bicep primitive type name to its TypeScript authoring value type.

Generated from TypeSpec and emitter mappings. Do not edit.

PropertyAccessExpressionNode
PropertyShape

A single property's shape entry.

QueryOptions

Options accepted by the Stack resource queries.

RecordShape

A Record<string, T> property/container shape.

ResourceGroupProps
ResourceNamingRules
ResourceOptions

Optional third-argument bag passed to every resource constructor. Holds authoring flags that affect how the resource declaration is emitted but are not ARM-modeled properties of the resource body.

Fields:

  • condition — an if(...) guard on the declaration. A boolean expression (typically produced by fn.eq, fn.and, etc.) or a plain boolean. Bind it to a const to reuse the same predicate across multiple resources.

existing is deliberately not an option — it is the discriminant of the generated props union ({ existing?: false } | { existing: true }) and lives on props. Routing it through options too would allow contradictory settings between the two channels.

namingRules is deliberately not an option either — it is per-resource-type metadata declared as a protected static namingRules field on each concrete Resource subclass and consumed by the base constructor reflectively, so it stays off the user-facing surface.

ResourceProps

Internal props accepted by the base Resource constructor. A loose superset of both the deployable and existing public shapes — the runtime constructor branches on props.existing to decide which fields are honored. Generated CDK resource classes expose a discriminated union (Deployable & { existing?: false }) | (Existing & { existing: true }); passing { ...existingProps, existing: true } selects the existing arm and emits a Bicep existing reference instead of a new declaration.

ResourceState

Internal representation used to construct resource handle objects. The proxy converts these into the public Resource shape.

StackOptions
StringLiteralShape

A terminal TypeSpec string literal. Literals cannot carry @encode.

StringShape

A scalar whose client-side JavaScript representation is string.

SymbolicValueExpressionNode
TernaryExpressionNode
TupleShape

A fixed-length heterogeneous tuple property/container shape.

UnaryExpressionNode
UnionShape

A terminal TypeSpec union for which no single structural shape can be selected. Unions cannot carry @encode in the provisioning emitter.

UnixTimestampEncodingDescriptor
VariableMetadata

Pure declaration data for a deployment variable. Stored on the stack (paired with the returned expression handle in <xref:VariableEntry>); read by the serializer at emit time. Not part of the value-level handle.

Type Aliases

ArrayAccessIndex

The index stored on an ArrayAccessExpressionNode: a literal number or string, or a raw ExpressionNode evaluated at serialize time (e.g. a loop's symbolic-value index, or a binary / fn-call node for a computed offset). Expression<T> proxies are unwrapped to their raw node before being stored, so the proxy type is intentionally absent here.

BinaryOperator

Binary operators supported in Bicep expressions.

BooleanValueEncodingDescriptor

Encoding supported by a client-side JavaScript boolean.

BytesValueEncodingDescriptor

Encoding supported by a client-side JavaScript Uint8Array.

ContainerShape

A container through which property navigation can continue.

DateValueEncodingDescriptor

Encodings whose client-side value is a JavaScript Date.

offsetDateTime is intentionally absent: the emitter exposes it as a string so the original offset is not erased.

Deref
Expression

An opaque deploy-time expression wrapping type T.

For object types, properties of T are accessible as Expression<Exclude<T[K], undefined>>. Expression proxies always expose a symbolic property path, so TypeScript's undefined omission marker does not belong in the projected value type. Explicit null remains intact. For array types, numeric indices return Expression<element> and .length is an Expression<number>.

Function-typed keys on T are intentionally NOT surfaced — an Expression<(...)=>R> isn't callable at the type level or meaningful at emit time. When bicep-level array/object methods are needed (concat, union, etc.), they are added explicitly via dedicated helper types (e.g. a future ArrayExpression<T>), not reflectively derived.

NonNullable<T> is applied at the input boundary, so Expression<R | undefined> yields the same structural surface as Expression<R> — otherwise the | undefined union would distribute and collapse the object branch into mapped | {}, erasing the index signature / member projection.

ExpressionNode
ExpressionOrValue

Accepts either a plain value T or an Expression<T> substitution.

Use this on scalar/leaf Input sites (primitives, enums, literal-only unions) where a full InputOf<...> structural extension doesn't apply. The result is a simple discriminated union; call isExpression() to branch on the runtime shape.

ExpressionShape
ExpressionValue
FlatVariantSelector

Pins selecting one concrete flat variant.

InferParamType
IntegerScalarName
ModelShape

A single model's shape — either flat or discriminated.

NumberValueEncodingDescriptor

Encodings whose client-side value is a JavaScript number.

NumericScalarName
OutputOptions
OutputType

Primitive Bicep type names supported by deployment outputs.

OutputValue

A value accepted as a deployment output's value: any JSON literal (scalar, null, array, object — recursively), an Expression, a resource view (InputOf<unknown>), or a Resource handle. The literal members are required so plain object/array literals are accepted (a bare InputOf<unknown> is a weak type and would reject them).

OutputValueFor
Parameter
ParameterOptions
PrimitiveTypeName

The set of Bicep primitive type names.

PropertySegment

A single member access segment: an object property name or an array index.

ProvisioningComponentConstructor
ResourceCtor

A Resource class that's eligible to live in the registry.

  • The construct signature uses any for both context and props because concrete classes narrow these (child resources require a specific parent class as context; each resource has its own Props shape). TypeScript's parameter contravariance would reject any concrete parameter types here. The deserializer is the sole caller of resolved constructors and forwards already-correct values it built from the wire document.
  • The two static fields resourceType and apiVersion form the registry key and are always present on emitter-generated classes (and on the hand-maintained ResourceGroup).
  • The generic T propagates the instance type — used by the query API (stack.getResources(KeyVault) → KeyVault[]) to narrow return types without needing a separate descriptor object.
ScalarOutputType
ScopeExpression

A Bicep scope: expression. Used on existing resource references for cross-RG / cross-subscription / cross-MG / cross-tenant lookups, and on modules to set the nested deployment scope.

Typed as Expression<unknown> because the natural producers are the scope-function helpers in fn (fn.resourceGroup(...), fn.subscription(...), fn.managementGroup(...), fn.tenant()), all of which return Expression<TScope> proxies. Narrowing further isn't worthwhile today since the set of acceptable scope-producing expressions isn't closed and Bicep validates the actual call shape downstream.

StringValueEncodingDescriptor

Encodings whose client-side value is a JavaScript string.

The source TypeSpec scalar can be a date/time, duration, byte sequence, numeric value, or boolean. clientMode: "wire" is the important invariant: it means the generated TypeScript API exposes the encoded string itself.

TargetScope

The deployment scope for a Bicep file.

TerminalValueShape

Concrete terminal values in the generated client API.

Scalar kinds describe the JavaScript value accepted by the generated TypeScript surface, not necessarily the semantic TypeSpec scalar. For example, a numeric duration is a NumberShape, while the default ISO8601 duration is a StringShape; their narrowed encoding fields retain the TypeSpec source semantics needed for wire conversion. Numeric and boolean literal shapes can carry the same narrowly applicable encodings that TypeSpec permits on those values. String literals, enums, unions, and null remain distinct non-encodable terminal categories. Expressions are orthogonal wrappers around any value shape and are handled before shape-directed conversion.

UnaryOperator

Unary operators supported in Bicep expressions.

ValueShape
Variable
VariableOptions
VariableValue

A value accepted as a deployment variable's value: any JSON literal (scalar, null, array, object — recursively), an Expression, or a resource view (InputOf<unknown>). The literal members are required so plain object/array literals are accepted (a bare InputOf<unknown> is a weak type and would reject them).

Functions

asDiscriminator<L>(ExpressionOrValue<L>)

Asserts that a deploy-time expression resolves to a specific literal, so it can be used where a discriminator is expected.

Discriminator properties on a @discriminator model are typed as bare literals (kind: "cache") rather than ExpressionOrValue<"cache">. That is deliberate: TypeScript only treats a property as a discriminant when its type is a unit type in every constituent of the union, and a single widened arm disables narrowing for the whole union — completions then offer every variant's properties and excess-property checking degrades to "allowed if the property exists in any variant".

When the discriminator genuinely isn't known until deployment, wrap the expression with this to state which variant you mean. See the deploy-time discriminator example.

Every other property is still fully checked — only the discriminator's type safety is waived. Note that the runtime cannot dispatch on a non-literal discriminator, so serialization falls back to structural variant inference; prefer a literal wherever possible.

The literal is inferred from the expression's own type argument. If the expression is loosely typed (Expression<string>), name the variant explicitly: asDiscriminator<"cache">(param).

createOutput<T>(Stack, string, T, OutputValueFor<NoInfer<T>>, OutputOptions)

A deployment output, compiled to a Bicep output declaration.

Example

import { Stack } from "@azure/provisioning-core";
import { KeyVault } from "@azure/provisioning-keyvault";

const stack = new Stack("my-app", { targetScope: "resourceGroup" });
const vault = new KeyVault(stack, {
  name: "kv-my-app",
  location: "eastus",
  properties: {
    tenantId: "11111111-1111-1111-1111-111111111111",
    sku: { family: "A", name: "standard" },
  },
});
stack.outputs.add("vaultUri", "string", vault.properties.vaultUri);
createParameter<T, A>(Stack, string, T, ParameterOptions<T, A>)

A deploy-time input to a stack, compiled to a Bicep param declaration.

Example

import { Stack, createParameter } from "@azure/provisioning-core";

const stack = new Stack("my-app", { targetScope: "resourceGroup" });
const env = createParameter(stack, "env", "string", {
  allowed: ["dev", "staging", "prod"] as const,
  defaultValue: "dev",
});
createVariable<TValue>(Stack, string, TValue, VariableOptions)

A computed value evaluated at deploy time, compiled to a Bicep var declaration.

Example

import { Stack, createVariable } from "@azure/provisioning-core";

const stack = new Stack("my-app");
const suffix = createVariable(stack, "suffix", "prod");
deref<T>(T)
isExpression(unknown)

Tests whether a value is an Expression<T> — the typed, branded handle for a deploy-time expression (proxy-backed). Returns false for raw ExpressionNode data; use <xref:isExpressionNode> from ./ast-nodes.js for that.

isResource(unknown)

Is x a scalar Resource (not a looped declaration)?

isResourceDeclaration(unknown)

Is x a Bicep resource declaration — either a scalar Resource or a <xref:LoopedResource>?

isResourceOf<T>(unknown, ResourceCtor<T>)

Type guard: is x an instance of the resource class ctor? Narrows x to the class's instance type, so callers can access subclass-specific accessors (e.g. kv.secrets) inside the guarded block.

Accepts any value (unknown), like the other brand guards. A LoopedResource<T> is not a Resource, so instanceof ctor returns false for it — the narrowing is safe. instanceof alone is sufficient (and stricter than a brand + ARM-type-string check: a base-Resource impostor carrying the same type/apiVersion is correctly rejected), so no isResource pre-check is needed.

Matches scalar resource declarations (from a constructor / query / collection). It does NOT match a parent.at(i) element reference of a looped declaration: that proxy intentionally keeps LoopedResource's prototype (no getPrototypeOf trap), so instanceof is false for it even though its ARM reads work. If we ever need cross-realm subclass matching (per-subclass Symbol.for brands, mirroring the base RESOURCE_BRAND), this is the one place to swap.

Variables

INTEGER_SCALAR_NAMES
NUMERIC_SCALAR_NAMES
namingRequiredPolicy

Naming policy that requires every resource to provide an explicit name.

Throws an error when asked to generate a name. Use this on a stack to disable auto-naming entirely.

Function Details

asDiscriminator<L>(ExpressionOrValue<L>)

Asserts that a deploy-time expression resolves to a specific literal, so it can be used where a discriminator is expected.

Discriminator properties on a @discriminator model are typed as bare literals (kind: "cache") rather than ExpressionOrValue<"cache">. That is deliberate: TypeScript only treats a property as a discriminant when its type is a unit type in every constituent of the union, and a single widened arm disables narrowing for the whole union — completions then offer every variant's properties and excess-property checking degrades to "allowed if the property exists in any variant".

When the discriminator genuinely isn't known until deployment, wrap the expression with this to state which variant you mean. See the deploy-time discriminator example.

Every other property is still fully checked — only the discriminator's type safety is waived. Note that the runtime cannot dispatch on a non-literal discriminator, so serialization falls back to structural variant inference; prefer a literal wherever possible.

The literal is inferred from the expression's own type argument. If the expression is loosely typed (Expression<string>), name the variant explicitly: asDiscriminator<"cache">(param).

function asDiscriminator<L>(value: ExpressionOrValue<L>): L

Parameters

Returns

L

createOutput<T>(Stack, string, T, OutputValueFor<NoInfer<T>>, OutputOptions)

A deployment output, compiled to a Bicep output declaration.

Example

import { Stack } from "@azure/provisioning-core";
import { KeyVault } from "@azure/provisioning-keyvault";

const stack = new Stack("my-app", { targetScope: "resourceGroup" });
const vault = new KeyVault(stack, {
  name: "kv-my-app",
  location: "eastus",
  properties: {
    tenantId: "11111111-1111-1111-1111-111111111111",
    sku: { family: "A", name: "standard" },
  },
});
stack.outputs.add("vaultUri", "string", vault.properties.vaultUri);
function createOutput<T>(stack: Stack, name: string, type: T, value: OutputValueFor<NoInfer<T>>, options?: OutputOptions): OutputMetadata

Parameters

stack
Stack
name

string

type

T

value

OutputValueFor<NoInfer<T>>

options
OutputOptions

Returns

createParameter<T, A>(Stack, string, T, ParameterOptions<T, A>)

A deploy-time input to a stack, compiled to a Bicep param declaration.

Example

import { Stack, createParameter } from "@azure/provisioning-core";

const stack = new Stack("my-app", { targetScope: "resourceGroup" });
const env = createParameter(stack, "env", "string", {
  allowed: ["dev", "staging", "prod"] as const,
  defaultValue: "dev",
});
function createParameter<T, A>(stack: Stack, name: string, type: T, options?: ParameterOptions<T, A>): Parameter<T, A>

Parameters

stack
Stack
name

string

type

T

options

ParameterOptions<T, A>

Returns

Parameter<T, A>

Remarks

The returned value is an Expression that can be passed to resource properties. At deploy time, the user supplies the actual value. The declaration metadata is stored separately on the stack, keyed by name.

createVariable<TValue>(Stack, string, TValue, VariableOptions)

A computed value evaluated at deploy time, compiled to a Bicep var declaration.

Example

import { Stack, createVariable } from "@azure/provisioning-core";

const stack = new Stack("my-app");
const suffix = createVariable(stack, "suffix", "prod");
function createVariable<TValue>(stack: Stack, name: string, value: TValue, options?: VariableOptions): Variable<TValue>

Parameters

stack
Stack
name

string

value

TValue

options
VariableOptions

Returns

Variable<TValue>

deref<T>(T)

function deref<T>(value: T): Deref<T>

Parameters

value

T

Returns

Deref<T>

isExpression(unknown)

Tests whether a value is an Expression<T> — the typed, branded handle for a deploy-time expression (proxy-backed). Returns false for raw ExpressionNode data; use <xref:isExpressionNode> from ./ast-nodes.js for that.

function isExpression(value: unknown): value is Expression<unknown>

Parameters

value

unknown

Returns

value is Expression<unknown>

isResource(unknown)

Is x a scalar Resource (not a looped declaration)?

function isResource(x: unknown): x is Resource<string>

Parameters

x

unknown

Returns

x is Resource<string>

isResourceDeclaration(unknown)

Is x a Bicep resource declaration — either a scalar Resource or a <xref:LoopedResource>?

function isResourceDeclaration(x: unknown): x is ResourceDeclaration<string>

Parameters

x

unknown

Returns

x is ResourceDeclaration<string>

isResourceOf<T>(unknown, ResourceCtor<T>)

Type guard: is x an instance of the resource class ctor? Narrows x to the class's instance type, so callers can access subclass-specific accessors (e.g. kv.secrets) inside the guarded block.

Accepts any value (unknown), like the other brand guards. A LoopedResource<T> is not a Resource, so instanceof ctor returns false for it — the narrowing is safe. instanceof alone is sufficient (and stricter than a brand + ARM-type-string check: a base-Resource impostor carrying the same type/apiVersion is correctly rejected), so no isResource pre-check is needed.

Matches scalar resource declarations (from a constructor / query / collection). It does NOT match a parent.at(i) element reference of a looped declaration: that proxy intentionally keeps LoopedResource's prototype (no getPrototypeOf trap), so instanceof is false for it even though its ARM reads work. If we ever need cross-realm subclass matching (per-subclass Symbol.for brands, mirroring the base RESOURCE_BRAND), this is the one place to swap.

function isResourceOf<T>(x: unknown, ctor: ResourceCtor<T>): x is T

Parameters

x

unknown

ctor

ResourceCtor<T>

Returns

x is T

Variable Details

INTEGER_SCALAR_NAMES

INTEGER_SCALAR_NAMES: readonly ["integer", "safeint", "int8", "int16", "int32", "int64", "uint8", "uint16", "uint32", "uint64"]

Type

readonly ["integer", "safeint", "int8", "int16", "int32", "int64", "uint8", "uint16", "uint32", "uint64"]

NUMERIC_SCALAR_NAMES

NUMERIC_SCALAR_NAMES: readonly ["integer", "safeint", "int8", "int16", "int32", "int64", "uint8", "uint16", "uint32", "uint64", "numeric", "decimal", "decimal128", "float", "float32", "float64"]

Type

readonly ["integer", "safeint", "int8", "int16", "int32", "int64", "uint8", "uint16", "uint32", "uint64", "numeric", "decimal", "decimal128", "float", "float32", "float64"]

namingRequiredPolicy

Naming policy that requires every resource to provide an explicit name.

Throws an error when asked to generate a name. Use this on a stack to disable auto-naming entirely.

namingRequiredPolicy: NamingPolicy

Type