# resolveSnap

Picks the detent to settle on when a drag ends.

This is a function exported by `@mapcairn/core`, checked against version 0.2.0.

## Signature

```ts
import { resolveSnap } from "@mapcairn/core";
 
function resolveSnap(input: {
    heights: DetentHeights;
    currentHeight: number;
    velocityPxPerSecond: number;
}): SheetDetent;
```

## Parameters

- `input` (`{
    heights: DetentHeights;
    currentHeight: number;
    velocityPxPerSecond: number;
}`): The fields, by name:
   - `currentHeight`: The sheet's visible height at release.
   - `velocityPxPerSecond`: Positive when the sheet is expanding.

## Returns

`SheetDetent`

## Remarks

A fast fling (faster than `SHEET_FLING_VELOCITY`) moves one
 detent from the nearest one, in the fling's direction. Anything slower
 projects 0.15 seconds of momentum and snaps to the
 nearest detent to that point. Exact ties go to the smaller detent.

## See also

- [`DetentHeights`](https://docs.mapcairn.com/api/core/DetentHeights.md)
- [`SheetDetent`](https://docs.mapcairn.com/api/core/SheetDetent.md)

Source: [packages/core/src/sheet/sheet.ts:86](https://github.com/MapCairn/mapcairn/blob/main/packages/core/src/sheet/sheet.ts#L86)
