<!-- Generated by scripts/gen-docs.mts from the JSDoc in registry/. Do not edit; run `pnpm run docs`. -->

# restoreTimer

Imports a saved countdown, leaving an existing native timer intact. A false return means storage is unavailable: keep the original saved data. When a write fails, mounted readers still receive the import in memory. An unreadable store is left untouched. Invalid state throws before changing the timer.

```tsx
import { restoreTimer } from "@/lib/ouro/use-timer";
```

## Example

```tsx
restoreTimer("pasta", { status: "paused", duration: 600, remainingMs: 120000 });
```

## Parameters

| Parameter | Type |
| --- | --- |
| `timerId` | `string` |
| `state` | `TimerState` |

## Returns

`boolean`

## Types

### `TimerState`

A countdown's saved state, for importing progress from another timer implementation.

```ts
type TimerState =
  | { status: "running"; duration: number; endsAt: number }
  | { status: "paused"; duration: number; remainingMs: number }
  | { status: "done"; duration: number; endedAt: number };
```
