For AI agents: a documentation index is available at /llms.txt. Markdown versions of all pages are available by appending .md to any URL.

Interface Property<T, R>

Implementations of the Property interface:

  • Hold metadata about a property that's independent of any specific value: stuff like the type of the value, the default value, etc. This comes from the style specification JSON.
  • Define behavior that needs to be polymorphic across different properties: "possibly evaluating" an input value (see below), and interpolating between two possibly-evaluted values.

The type T is the fully-evaluated value type (e.g. number, string, Color). The type R is the intermediate "possibly evaluated" value type. See below.

There are two main implementations of the interface -- one for properties that allow data-driven values, and one for properties that don't. There are a few "special case" implementations as well: one for properties which cross-fade between two values rather than interpolating, one for heatmap-color and line-gradient, and one for light-position.

interface Property<T, R> {
    name: string;
    specification: StylePropertySpecification;
    interpolate(a: R, b: R, t: number): R;
    possiblyEvaluate(
        value: PropertyValue<T, R>,
        parameters: EvaluationParameters,
        canonical?: CanonicalTileID,
        availableImages?: string[],
    ): R;
}

Type Parameters

  • T
  • R

Implemented by

Index

Properties

name: string

Methods

  • Parameters

    • a: R
    • b: R
    • t: number

    Returns R

Was this helpful?