Type Alias Interpolation<T, U>

Interpolation: {
    easing?: EasingCurve;
    input: [InterpolateOn[T][number], ...InterpolateOn[T]];
    on: T;
    output: [U[number], ...U];
}

Define interpolation behavior for a value.

Type Parameters

Type declaration

  • Optionaleasing?: EasingCurve

    The easing function to use for the interpolation.

    'linear'
    
  • input: [InterpolateOn[T][number], ...InterpolateOn[T]]

    Breakpoints in the observed property.

  • on: T

    The property to observe when interpolating.

    'zoom-level'
    
  • output: [U[number], ...U]

    Output values corresponding to the input breakpoints.

// Interpolate a value from 1 to 2 between zoom levels 17 and 18 with easing
const value: Interpolation<'zoom-level', [number, number]> = {
on: 'zoom-level',
input: [17, 18],
output: [1, 2],
easing: 'ease-in',