Composition / foldkit-builder

Drag

const · packages/builder/src/index.ts:68

const Drag: Schema.Struct<{
  readonly source: Schema.Union<
    readonly [
      Schema.TaggedStruct<
        'Existing',
        {
          readonly id: Schema.brand<
            Schema.NonEmptyString,
            '@foldkit-composition/NodeId'
          >
        }
      >,
      Schema.TaggedStruct<'New', { readonly block: Schema.String }>,
    ]
  >
  readonly over: Schema.OptionFromNullOr<
    Schema.Struct<{
      readonly id: Schema.brand<
        Schema.NonEmptyString,
        '@foldkit-composition/NodeId'
      >
      readonly zone: Schema.Literals<readonly ['before', 'inside', 'after']>
      readonly region: Schema.OptionFromNullOr<Schema.String>
    }>
  >
  readonly at: Schema.OptionFromNullOr<
    Schema.Union<
      readonly [
        Schema.TaggedStruct<'Root', { readonly index: Schema.Int }>,
        Schema.TaggedStruct<
          'Region',
          {
            readonly parent: Schema.brand<
              Schema.NonEmptyString,
              '@foldkit-composition/NodeId'
            >
            readonly region: Schema.String
            readonly index: Schema.Int
          }
        >,
      ]
    >
  >
}>

Its type

type Drag = typeof Drag.Type

A drag under way: what is dragged, what it is over, and where it would go.