Skip to content

API Reference / @gtkx/animated / Interpolation

Class: Interpolation<Input, Output>

Defined in: node_modules/.pnpm/@react-spring+core@10.1.2_react@19.2.8/node_modules/@react-spring/core/dist/react-spring_core.modern.d.mts:17

An Interpolation is a memoized value that's computed whenever one of its FluidValue dependencies has its value changed.

Other FrameValue objects can depend on this. For example, passing an Interpolation as the to prop of a useSpring call will trigger an animation toward the memoized value.

Extends

Type Parameters

Input

Input = any

Output

Output = any

Constructors

Constructor

new Interpolation<Input, Output>(source, args): Interpolation<Input, Output>

Defined in: node_modules/.pnpm/@react-spring+core@10.1.2_react@19.2.8/node_modules/@react-spring/core/dist/react-spring_core.modern.d.mts:28

Parameters

source

unknown

args

InterpolatorArgs<Input, Output>

Returns

Interpolation<Input, Output>

Overrides

FrameValue.constructor

Properties

_active

protected _active: Set<FluidValue<any, any>>

Defined in: node_modules/.pnpm/@react-spring+core@10.1.2_react@19.2.8/node_modules/@react-spring/core/dist/react-spring_core.modern.d.mts:27

The inputs which are currently animating


_priority

protected _priority: number

Defined in: node_modules/.pnpm/@react-spring+core@10.1.2_react@19.2.8/node_modules/@react-spring/core/dist/react-spring_core.modern.d.mts:50

Inherited from

FrameValue._priority


calc

readonly calc: InterpolatorFn<Input, Output>

Defined in: node_modules/.pnpm/@react-spring+core@10.1.2_react@19.2.8/node_modules/@react-spring/core/dist/react-spring_core.modern.d.mts:25

The function that maps inputs values to output


id

readonly id: number

Defined in: node_modules/.pnpm/@react-spring+core@10.1.2_react@19.2.8/node_modules/@react-spring/core/dist/react-spring_core.modern.d.mts:47

Inherited from

FrameValue.id


idle

idle: boolean

Defined in: node_modules/.pnpm/@react-spring+core@10.1.2_react@19.2.8/node_modules/@react-spring/core/dist/react-spring_core.modern.d.mts:23

Equals false when in the frameloop

Overrides

FrameValue.idle


key?

optional key?: string

Defined in: node_modules/.pnpm/@react-spring+core@10.1.2_react@19.2.8/node_modules/@react-spring/core/dist/react-spring_core.modern.d.mts:21

Useful for debugging.

Overrides

FrameValue.key


source

readonly source: unknown

Defined in: node_modules/.pnpm/@react-spring+core@10.1.2_react@19.2.8/node_modules/@react-spring/core/dist/react-spring_core.modern.d.mts:19

The source of input values

Accessors

priority

Get Signature

get priority(): number

Defined in: node_modules/.pnpm/@react-spring+core@10.1.2_react@19.2.8/node_modules/@react-spring/core/dist/react-spring_core.modern.d.mts:51

Returns

number

Set Signature

set priority(priority): void

Defined in: node_modules/.pnpm/@react-spring+core@10.1.2_react@19.2.8/node_modules/@react-spring/core/dist/react-spring_core.modern.d.mts:52

Parameters
priority

number

Returns

void

Inherited from

FrameValue.priority

Methods

_attach()

protected _attach(): void

Defined in: node_modules/.pnpm/@react-spring+core@10.1.2_react@19.2.8/node_modules/@react-spring/core/dist/react-spring_core.modern.d.mts:34

Called when the first child is added.

Returns

void

Overrides

FrameValue._attach


_detach()

protected _detach(): void

Defined in: node_modules/.pnpm/@react-spring+core@10.1.2_react@19.2.8/node_modules/@react-spring/core/dist/react-spring_core.modern.d.mts:35

Called when the last child is removed.

Returns

void

Overrides

FrameValue._detach


_get()

protected _get(): Output

Defined in: node_modules/.pnpm/@react-spring+core@10.1.2_react@19.2.8/node_modules/@react-spring/core/dist/react-spring_core.modern.d.mts:32

Returns

Output


_onChange()

protected _onChange(value, idle?): void

Defined in: node_modules/.pnpm/@react-spring+core@10.1.2_react@19.2.8/node_modules/@react-spring/core/dist/react-spring_core.modern.d.mts:71

Tell our children about our new value

Parameters

value

Output

idle?

boolean

Returns

void

Inherited from

FrameValue._onChange


_onPriorityChange()

protected _onPriorityChange(priority): void

Defined in: node_modules/.pnpm/@react-spring+core@10.1.2_react@19.2.8/node_modules/@react-spring/core/dist/react-spring_core.modern.d.mts:73

Tell our children about our new priority

Parameters

priority

number

Returns

void

Inherited from

FrameValue._onPriorityChange


_start()

protected _start(): void

Defined in: node_modules/.pnpm/@react-spring+core@10.1.2_react@19.2.8/node_modules/@react-spring/core/dist/react-spring_core.modern.d.mts:33

Returns

void


advance()

advance(_dt?): void

Defined in: node_modules/.pnpm/@react-spring+core@10.1.2_react@19.2.8/node_modules/@react-spring/core/dist/react-spring_core.modern.d.mts:31

Internal

Parameters

_dt?

number

Returns

void

Overrides

FrameValue.advance


eventObserved()

eventObserved(event): void

Defined in: node_modules/.pnpm/@react-spring+core@10.1.2_react@19.2.8/node_modules/@react-spring/core/dist/react-spring_core.modern.d.mts:37

Internal

Parameters

event

Event

Returns

void

Overrides

FrameValue.eventObserved


get()

get(): Output

Defined in: node_modules/.pnpm/@react-spring+core@10.1.2_react@19.2.8/node_modules/@react-spring/core/dist/react-spring_core.modern.d.mts:54

Get the current value

Returns

Output

Inherited from

FrameValue.get


interpolate()

interpolate<Out>(...args): Interpolation<Output, Out>

Defined in: node_modules/.pnpm/@react-spring+core@10.1.2_react@19.2.8/node_modules/@react-spring/core/dist/react-spring_core.modern.d.mts:58

Type Parameters

Out

Out

Parameters

args

...InterpolatorArgs<Output, Out>

Returns

Interpolation<Output, Out>

Deprecated

Use the to method instead.

Inherited from

FrameValue.interpolate


observerAdded()

protected observerAdded(count): void

Defined in: node_modules/.pnpm/@react-spring+core@10.1.2_react@19.2.8/node_modules/@react-spring/core/dist/react-spring_core.modern.d.mts:60

Called after an observer is added.

Parameters

count

number

Returns

void

Inherited from

FrameValue.observerAdded


observerRemoved()

protected observerRemoved(count): void

Defined in: node_modules/.pnpm/@react-spring+core@10.1.2_react@19.2.8/node_modules/@react-spring/core/dist/react-spring_core.modern.d.mts:61

Called after an observer is removed.

Parameters

count

number

Returns

void

Inherited from

FrameValue.observerRemoved


to()

to<Out>(...args): Interpolation<Output, Out>

Defined in: node_modules/.pnpm/@react-spring+core@10.1.2_react@19.2.8/node_modules/@react-spring/core/dist/react-spring_core.modern.d.mts:56

Create a spring that maps our value to another value

Type Parameters

Out

Out

Parameters

args

...InterpolatorArgs<Output, Out>

Returns

Interpolation<Output, Out>

Inherited from

FrameValue.to


toJSON()

toJSON(): Output

Defined in: node_modules/.pnpm/@react-spring+core@10.1.2_react@19.2.8/node_modules/@react-spring/core/dist/react-spring_core.modern.d.mts:59

Returns

Output

Inherited from

FrameValue.toJSON

Released under the MPL-2.0 License.