# AnimatePolicy

type in `@dioramajs/diorama/effects`

```ts
import type { AnimatePolicy } from '@dioramajs/diorama/effects'
```

When an effect asks for frames beyond input and its update's answer:
- 'input' (default): frames only on input (scroll, pointer, resize, param writes).
- 'hover': also while hovered or hover decays.
- 'visible': every frame while on screen.
- a function: checked after update, true requests the next frame. The runtime also asks it
  between frames whether a burst in `ctx.overlay` still flies, which an update's answer cannot
  tell before the next frame (a click that starts a burst and hides its element).
- `{ fps }`: time frames at most `fps` a second while visible, 0 means none. Input frames
  run at full rate.

```ts
type AnimatePolicy<P extends ParamSpec> = 'input' | 'hover' | 'visible' | (ctx: EffectContext<P>) => boolean | { readonly fps: number | (ctx: EffectContext<P>) => number }
```

Also exported from `@dioramajs/effects`.

Defined in [packages/effects/src/types.ts](https://github.com/MasterKurosava/diorama/blob/main/packages/effects/src/types.ts#L542).
