Variable dConst

    d: {
        between: <M>(
            pointer: Read<V>,
            bs: readonly Drag<M>[],
            mix: (ms: readonly M[], ws: readonly number[]) => M,
        ) => Drag<M>;
        closest: <M>(bs: readonly Drag<M>[]) => Drag<M>;
        fixed: <M>(pointer: Read<V>, state: M, locate: (m: M) => V) => Drag<M>;
        onDrop: <M>(b: Drag<M>, f: (m: M) => M) => Drag<M>;
        vary: <M>(
            pointer: Read<V>,
            place: (p: V) => M,
            locate: (m: M) => V,
        ) => Drag<M>;
        whenFar: <M>(near: Drag<M>, far: Drag<M>, radius: number) => Drag<M>;
        withFloating: <M>(pointer: Read<V>, b: Drag<M>) => Drag<M>;
    } = ...

    The drag-behavior DSL (Dragology's d.): primitives fixed/vary, combinators closest/between/whenFar, modifiers withFloating/onDrop. Build a Drag<M> once at grab; the renderer reads preview/at/drop.

    Type Declaration

    • between: <M>(
          pointer: Read<V>,
          bs: readonly Drag<M>[],
          mix: (ms: readonly M[], ws: readonly number[]) => M,
      ) => Drag<M>
    • closest: <M>(bs: readonly Drag<M>[]) => Drag<M>
    • fixed: <M>(pointer: Read<V>, state: M, locate: (m: M) => V) => Drag<M>
    • onDrop: <M>(b: Drag<M>, f: (m: M) => M) => Drag<M>
    • vary: <M>(pointer: Read<V>, place: (p: V) => M, locate: (m: M) => V) => Drag<M>
    • whenFar: <M>(near: Drag<M>, far: Drag<M>, radius: number) => Drag<M>
    • withFloating: <M>(pointer: Read<V>, b: Drag<M>) => Drag<M>