function clampOffset(state: ScrollState, containerLength: number): ScrollState {
  return {
    offset: clamp(-(state.length - containerLength), 0, state.offset),
    length: state.length,
  };
}
Single-axis offset and length state.

```
contentStart   containerStart  containerEnd   contentEnd
    |<----------offset|              |             |
    |<-------------------length------------------->|
```