Skip to content

Function: createPolicyBuilder() ​

ts
function createPolicyBuilder<THandle>(id, options?): PolicyBuilder<THandle>;

Defined in: builders/create-policy-builder.ts:36

Creates a fluent PolicyBuilder for P.policy(id).

Assigns deterministic guard clause identifiers "${id}:clause:${i}" and supports .extend(newId) inheritance with re-keyed clause identifiers.

Type Parameters ​

Type ParameterDefault typeDescription
THandleunknownRuntime handle type of the active isolation scope.

Parameters ​

ParameterTypeDescription
idstringUnique identifier of the policy.
options?CreatePolicyBuilderState<THandle>Optional internal copy-on-write state.

Returns ​

PolicyBuilder<THandle>

Frozen PolicyBuilder instance.

Released under the MIT License.