Metakit / @doeixd/metakit/artifact

WriteRequirement

const · packages/metakit/src/bundle.ts:97

const WriteRequirement: Schema.Union<
  readonly [
    Schema.TaggedStruct<
      'Present',
      { readonly slot: Schema.$Array<Schema.String> }
    >,
    Schema.TaggedStruct<
      'Variant',
      {
        readonly slot: Schema.$Array<Schema.String>
        readonly allowed: Schema.$Array<Schema.String>
      }
    >,
    Schema.TaggedStruct<
      'KeepsTag',
      { readonly slot: Schema.$Array<Schema.String> }
    >,
  ]
>

Its type

type WriteRequirement = typeof WriteRequirement.Type

What the state before a step must hold, read from one slot, for a write to go; where one fails the step refuses as Unwritable (docs/semantics.md, §6 step 5). Present: the slot holds a value, as it does wherever the record above the target holds one. Variant: the slot, a union's tag, holds one of allowed, the variants that declare the field written. KeepsTag: the slot, the tag the write targets, holds the value written.