import type { SchedulerModule, SchedulerRuntime } from '../scheduler-runtime'; import type { SlotAxis } from '../time/slot-axis'; import { type BarSource } from './event-selection-service'; /** Which end of a bar a gesture is dragging. */ export type ResizeEdge = 'start' | 'end'; /** Class marking the leading handle. Mirrors `theme/scheduler-styles.ts`. */ export declare const HANDLE_START_CLASS = "pg-scheduler-bar__handle--start"; /** * Duration of one slot on an axis, used as the fallback minimum resize. * * Slot 0 is sampled rather than averaged: on a prefix axis slots genuinely * differ (28 to 31 days), so no single number is *the* slot duration, and the * first slot is both cheap to read and representative of the view's * granularity. Degenerate single-slot axes fall back to the whole span, and the * result is floored at 1 ms so a caller can never derive a zero-length minimum. */ export declare function slotDurationOf(axis: SlotAxis): number; /** * Pointer-driven resizing of event bars from either edge. * * Shares its mechanics with {@link EventDragService} by importing them rather * than restating them -- the threshold, the snap projection, the ghost and the * suppress-then-commit-once model are identical, and the only real differences * are that a resize is anchored to one edge, never changes resource, and must * respect a minimum duration. * * ## Why the minimum duration is enforced after snapping * * Snapping can pull an edge past its opposite -- dragging the start handle right * across a short event lands it beyond the end, producing a negative duration * that would corrupt the index's sort invariants. Clamping after the snap means * the edge stops at the last legal position instead, so the worst outcome is a * bar that refuses to shrink further rather than one that inverts. */ export declare class EventResizeService implements SchedulerModule { private readonly runtime; private readonly abort; private readonly bars; private readonly layerEl; private session; private preview; /** * @param runtime - Shared scheduler state; the index is written on drop. * @param layerEl - Layer holding the bars. Listeners are delegated here and * the ghost is appended here so it inherits the layer's transforms. * @param bars - Renderer accessor, used to read the committed geometry of the * bar being resized so the ghost starts aligned with it. */ constructor(runtime: SchedulerRuntime, layerEl: HTMLElement, bars: BarSource); /** Whether a resize gesture has passed the threshold and is currently previewing. */ isResizing(): boolean; /** * Aborts any in-flight resize and removes every listener. * * As with the drag service, cancelling first is what stops a destroy during a * gesture from leaving the resized event permanently suppressed. */ destroy(): void; /** Arms a potential resize when the press lands on a handle. */ private readonly onPointerDown; /** Promotes the press to a resize once it clears the threshold, then tracks the pointer. */ private readonly onPointerMove; /** Commits the resize, or does nothing if the press never became a gesture. */ private readonly onPointerUp; private readonly onPointerCancel; /** Escape aborts, restoring the original start and end. */ private readonly onKeyDown; /** Hides the original, creates the ghost and captures the pointer. */ private begin; /** Recomputes the dragged edge from the pointer and repaints the ghost. */ private track; /** * The smallest duration a resize may produce. * * A configured `0` means "unset" rather than "no minimum", because a genuine * zero would let a bar collapse to a zero-width sliver the user can no longer * grab -- unrecoverable through the UI. It therefore resolves to one slot, * read live so the floor tracks a view change. */ private minDuration; /** * Applies the resize, subject to the host's veto. * * Mirrors the move commit exactly -- emit, veto, mutate, emit -- so the two * gestures are indistinguishable to a listener that only cares about ordering. */ private commit; /** Aborts an in-flight gesture without committing anything. */ private cancel; /** Tears the gesture down, always clearing suppression. See the drag service's note. */ private finish; } //# sourceMappingURL=event-resize-service.d.ts.map