---
id: "packages/active-geo/api/types"
title: "Types"
description: "FeatureOption, GeoApplyStateOptions, GeoApplyStateResult, GeoAreaFeature and 114 more: generated from the source of active-geo."
url: "/packages/active-geo/api/types"
locale: "en"
revision: "g0mvjxwj5c-88bdbe1c:types"
---

# Types

Exported by `@workspace/active-geo`. Generated from the package source; part of [the index of every export](/packages/active-geo/api).

## Types

**FeatureOption**

```ts
type FeatureOption<T> = T | boolean;
```

`true` on (the farther object kept), `false` off, an object refines.

**GeoApplyStateOptions**

```ts
interface GeoApplyStateOptions {
  readonly isCompatible?: (
    saved: GeoDatasetIdentity | null,
    current: GeoDatasetIdentity | null,
  ) => boolean;
  readonly fields?: readonly GeoStateField[];
}
```

**GeoApplyStateResult**

```ts
interface GeoApplyStateResult {
  readonly status: 'applied' | 'partial' | 'rejected';
  readonly reason?: GeoStateReason;
  readonly version: 1 | 2 | null;
  readonly fields: readonly GeoStateFieldResult[];
  readonly entries: readonly GeoStateEntryResult[];
  readonly requested: {
    readonly level?: string;
    readonly layers?: Readonly<Record<string, boolean>>;
  };
}
```

**GeoAreaFeature**

```ts
interface GeoAreaFeature<TMeta = unknown> {
  readonly key: GeoKey;
  readonly name?: string;
  readonly geometry: GeoAreaGeometry | null;
  readonly values?: GeoValues;
  readonly details?: readonly GeoDetail[];
  readonly meta?: TMeta;
}
```

**GeoAreaLayer**

```ts
interface GeoAreaLayer<TMeta = unknown> extends GeoDataLayerBase<TMeta> {
  readonly type: 'area';
  readonly features: readonly GeoAreaFeature<TMeta>[];
  readonly data?: readonly GeoDataRecord[];
  readonly convention?: GeoRingConvention;
  readonly fill?: GeoFill;
  readonly stroke?: {readonly color?: GeoColor; readonly width?: number};
}
```

**GeoAttribution**

```ts
type GeoAttribution =
  | string
  | {readonly text: string; readonly position?: GeoCorner | 'below' | 'none'};
```

**GeoCategoryDefinition**

```ts
interface GeoCategoryDefinition {
  readonly id: GeoId;
  readonly label?: string;
}
```

**GeoCategoryMeasure**

```ts
interface GeoCategoryMeasure extends GeoMeasureBase {
  readonly kind: 'category';
  readonly categories: readonly GeoCategoryDefinition[];
  readonly semantics?: never;
}
```

**GeoChannel**

```ts
type GeoChannel =
  'fill' | 'size' | 'shape' | 'rotation' | 'color' | 'width';
```

Every channel. OUTPUT: `shape`, `rotation`, `color`, `width` dormant in P1.

**GeoClassScale**

```ts
type GeoClassScale =
  | {
      readonly type: 'threshold';
      readonly thresholds: readonly number[];
      readonly classLabels?: readonly (string | undefined)[];
    }
  | {
      readonly type: 'quantize';
      readonly classes: number;
      readonly domain?: readonly [min: number, max: number];
      readonly classLabels?: readonly (string | undefined)[];
    }
  | {readonly type: 'category'}
  | (GeoDivergingScale & {
      readonly classLabels?: readonly (string | undefined)[];
    });
```

Classed colour scales; `classLabels` by class index. End classes are open.

**GeoClusterSnapshot**

```ts
interface GeoClusterSnapshot {
  readonly kind: 'cluster';
  readonly layerId: string;
  readonly clusterId: string;
  readonly viewRevision: number;
  readonly members: readonly GeoItemRef[];
  readonly position: GeoPosition;
  readonly count: number;
  readonly selectedCount: number;
  readonly aggregates: Readonly<
    Record<
      GeoId,
      | {
          readonly status: 'value';
          readonly value: number;
          readonly text: string;
          readonly included: number;
        }
      | {readonly status: 'suppressed' | 'missing'}
    >
  >;
}
```

OUTPUT, dormant before P4: a cluster as a menu target and in events.

**GeoColor**

```ts
type GeoColor = string;
```

**GeoColorMapping**

```ts
interface GeoColorMapping {
  readonly measure: GeoId;
  readonly scale: GeoClassScale;
  readonly palette?: GeoPalette;
  readonly legend?: FeatureOption<GeoExplanationOptions>;
}
```

P1 colour: an own classed scale (no continuous, no shared reference).

**GeoConfigSource**

```ts
interface GeoConfigSource {
  readonly locale?: GeoPresentation;
  readonly t?: GeoTranslateFn;
  readonly diagnostics?: GeoDiagnosticSink;
  readonly components?: Resettable<GeoComponents>;
  readonly header?: FeatureOption<GeoHeaderOptions>;
  readonly legend?: FeatureOption<GeoLegendOptions>;
  readonly tooltip?: FeatureOption<GeoTooltipOptions>;
  readonly zoom?: FeatureOption<GeoZoomOptions>;
  readonly contextMenu?: FeatureOption<GeoContextMenuOptions>;
  readonly table?: FeatureOption<GeoTableOptions>;
  readonly export?: GeoExportOptions;
  readonly attribution?: GeoAttribution;
  readonly selection?: FeatureOption<GeoSelectionOptions>;
}
```

The configuration a source (package, provider, props) can carry.

**GeoContextMenuOptions**

```ts
interface GeoContextMenuOptions {
  readonly items?: Resettable<
    (context: GeoMenuContext) => readonly GeoMenuItem[]
  >;
  readonly features?: GeoMenuFeatures;
  readonly groupOrder?: Resettable<readonly GeoMenuGroup[]>;
  readonly trigger?: 'none' | 'button';
}
```

**GeoCorner**

```ts
type GeoCorner = 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end';
```

**GeoCsvExportOptions**

```ts
interface GeoCsvExportOptions {
  readonly layerId: string;
  readonly scope?: 'all' | 'selected';
  readonly details?: Resettable<boolean>;
  readonly text?: Resettable<boolean>;
  readonly filename?: string;
  readonly download?: boolean;
}
```

**GeoCustomLegendEntry**

```ts
interface GeoCustomLegendEntry {
  readonly label: string;
  readonly description?: string;
  readonly symbol?:
    | {
        readonly swatch: GeoColor;
        readonly shape?: never;
        readonly line?: never;
      }
    | {
        readonly shape: 'circle';
        readonly fill?: GeoColor;
        readonly line?: never;
        readonly swatch?: never;
      };
}
```

P1 custom key: a swatch or a circle.

**GeoDataLayerType**

```ts
type GeoDataLayerType = 'area' | 'point' | 'line';
```

**GeoDataRecord**

```ts
interface GeoDataRecord {
  readonly key: GeoKey;
  readonly values?: GeoValues;
  readonly details?: readonly GeoDetail[];
}
```

A value record joined by key; never together with inline `values`.

**GeoDescribe**

```ts
type GeoDescribe<TMeta = unknown> = (
  context: GeoObjectTextContext<TMeta>,
) => {readonly name?: string; readonly description?: string};
```

**GeoDetail**

```ts
interface GeoDetail {
  readonly id: GeoId;
  readonly label: string;
  readonly value: string | number | null;
  readonly semantics?: GeoValueSemantics;
}
```

**GeoEffectivePresentation**

```ts
interface GeoEffectivePresentation {
  readonly header: boolean;
  readonly legend: {
    readonly requested: GeoLegendPosition;
    readonly position: GeoLegendPosition;
    readonly arrangement: 'row' | 'stack';
    readonly explanations: readonly GeoExplanationRef[];
  } | null;
  readonly zoom: {
    readonly controls: 'always' | 'on-demand' | 'none';
    readonly actions: readonly GeoNavigationAction[];
  } | null;
  readonly contextMenu:
    {readonly [K in keyof GeoMenuFeatures]-?: boolean} | null;
  readonly table: {
    readonly position: 'below' | 'outlet';
    readonly open: boolean;
    readonly fellBack: boolean;
  } | null;
  readonly attribution: GeoCorner | 'below' | 'none' | null;
}
```

What `getEffectivePresentation()` reports.

**GeoEncodingReading**

```ts
type GeoEncodingReading =
  | {
      readonly status: 'encoded';
      readonly channel: GeoChannel;
      readonly entry?: GeoScaleEntry;
      readonly visual: GeoVisualValue;
    }
  | {
      readonly status: GeoSpecialStatus;
      readonly channel: GeoChannel;
      readonly visual: GeoVisualValue;
    }
  | {
      readonly status: 'unrepresentable';
      readonly channel: GeoChannel;
      readonly reason: GeoUnrepresentableReason;
      readonly visual: GeoVisualValue;
    }
  | {
      readonly status: 'constant';
      readonly channel: GeoChannel;
      readonly visual: GeoVisualValue;
    };
```

**GeoEncodingSnapshot**

```ts
interface GeoEncodingSnapshot {
  readonly ref: {readonly layerId: string; readonly channel: GeoChannel};
  readonly measure: GeoId | null;
  readonly explanation: GeoExplanationRef | null;
  readonly fingerprint: string | null;
  readonly domain: readonly [number, number] | null;
}
```

**GeoEncodingStatus**

```ts
type GeoEncodingStatus =
  'encoded' | GeoSpecialStatus | 'unrepresentable' | 'constant';
```

**GeoExplanationOptions**

```ts
interface GeoExplanationOptions {
  readonly title?: Resettable<string | false>;
  readonly parts?: Resettable<readonly GeoExplanationPart[]>;
  readonly statuses?: 'present' | 'listed';
  readonly statusLayout?: 'inline' | 'separate';
  readonly counts?: {
    readonly classes?: Resettable<boolean>;
    readonly statuses?: Resettable<boolean>;
  };
  readonly countScope?: 'drawn' | 'supplied';
  readonly display?: 'compact' | 'list';
  readonly direction?: 'ascending' | 'descending';
  readonly samples?: readonly number[];
}
```

**GeoExplanationPart**

```ts
type GeoExplanationPart = 'scale' | GeoSpecialStatus | 'unrepresentable';
```

**GeoExplanationRef**

```ts
type GeoExplanationRef =
  | {
      readonly kind: 'encoding';
      readonly layerId: string;
      readonly channel: GeoChannel;
    }
  | {readonly kind: 'scale'; readonly scaleId: GeoId}
  | {readonly kind: 'layer'; readonly layerId: string}
  | {readonly kind: 'custom'; readonly entryId: GeoId};
```

**GeoExplanationRefInput**

```ts
type GeoExplanationRefInput =
  | {
      readonly kind: 'encoding';
      readonly layerId: string;
      readonly channel: GeoInputChannel;
    }
  | {readonly kind: 'layer'; readonly layerId: string}
  | {readonly kind: 'custom'; readonly entryId: GeoId};
```

The explanation references a P1 host can write.

**GeoExportLegendLayout**

```ts
interface GeoExportLegendLayout {
  readonly content: 'presentation' | 'all';
  readonly position?: 'bottom' | 'end';
  readonly arrangement?: 'row' | 'stack';
  readonly sections?: Resettable<readonly GeoLegendSection[]>;
}
```

**GeoExportOptions**

```ts
interface GeoExportOptions {
  readonly formats?: Resettable<readonly GeoExportFormat[]>;
  readonly image?: GeoImageExportDefaults;
  readonly csv?: {
    readonly details?: Resettable<boolean>;
    readonly text?: Resettable<boolean>;
  };
  readonly limits?: GeoExportLimits;
  readonly themes?: GeoExportThemes;
}
```

**GeoExportResult**

```ts
interface GeoExportResult {
  readonly format: GeoExportFormat;
  readonly filename: string;
  readonly blob: Blob;
  readonly downloadStarted: boolean;
  readonly frame?: {
    readonly x: number;
    readonly y: number;
    readonly width: number;
    readonly height: number;
  };
  readonly revision: number;
  readonly presentationRevision: number;
  readonly warnings: readonly GeoExportWarning[];
}
```

**GeoExportWarning**

```ts
interface GeoExportWarning {
  readonly code: GeoExportWarningCode;
  readonly layerId?: string;
}
```

**GeoExportWarningCode**

```ts
type GeoExportWarningCode =
  | 'image-symbol-fallback'
  | 'stylesheet-unreadable'
  | 'font-fallback'
  | 'gradient-approximation-limit';
```

**GeoFeatureQuery**

```ts
interface GeoFeatureQuery {
  readonly layers?: readonly string[];
  readonly rows?: 'all' | 'objects';
  readonly items?: readonly GeoItemRef[];
}
```

**GeoFeatureSnapshot**

```ts
interface GeoFeatureSnapshot {
  readonly revision: number;
  readonly presentationRevision: number;
  readonly dataset: GeoDatasetIdentity | null;
  readonly level: string | null;
  readonly layers: readonly GeoLayerSnapshot[];
}
```

**GeoFill**

```ts
type GeoFill = GeoColor | GeoColorMapping;
```

**GeoFocusReturn**

```ts
interface GeoFocusReturn {
  readonly item: GeoItemRef | null;
  readonly origin: 'map' | 'legend' | 'table' | 'host';
}
```

**GeoGeometryStatus**

```ts
type GeoGeometryStatus =
  'drawn' | 'partial' | 'not-projectable' | 'excluded';
```

**GeoHeaderOptions**

```ts
interface GeoHeaderOptions {
  readonly subtitle?: Resettable<boolean>;
}
```

**GeoHighlight**

```ts
interface GeoHighlight {
  readonly targets: readonly GeoHighlightTarget[];
  readonly fingerprints?: Readonly<Record<string, string>>;
}
```

A non-empty set of targets; `fingerprints` binds them to their meaning.
The same type flows in (`highlight`) and out (`onHighlightChange`,
`getLegendModel`, `useGeoLegend`), so a controlled host needs no cast.

**GeoHighlightChange**

```ts
interface GeoHighlightChange {
  readonly cause: 'legend' | 'chip' | 'api' | 'restore' | 'reconcile';
  readonly requested: boolean;
}
```

**GeoHighlightTarget**

```ts
interface GeoHighlightTarget {
  readonly explanation: GeoExplanationRefInput;
  readonly entry: GeoScaleEntry;
}
```

One highlight target a P1 host can write: an entry of an own explanation
(`encoding`, `layer`, `custom`). A shared-scale target is a later phase
(v0.5 § 13); it never reaches a highlight in P1.

**GeoHome**

```ts
type GeoHome =
  | 'frame'
  | {readonly center: GeoPosition; readonly zoom: number}
  | {readonly fit: 'layers'; readonly layers: readonly string[]};
```

Where `home()` goes; `fit()` is always the frame.

**GeoId**

```ts
type GeoId = string;
```

A host-chosen identifier (measures, categories, details, sections,
custom entries, status blocks): `/^[A-Za-z0-9_][A-Za-z0-9_.-]{0,63}$/`.

**GeoImageExportDefaults**

```ts
interface GeoImageExportDefaults {
  readonly theme?: Resettable<GeoExportTheme>;
  readonly extent?: Resettable<'current' | 'fitted'>;
  readonly legend?: Resettable<
    'presentation' | 'all' | false | GeoExportLegendLayout
  >;
  readonly title?: Resettable<string | false>;
  readonly description?: Resettable<string | false>;
  readonly attribution?: Resettable<boolean>;
  readonly background?: Resettable<'theme' | 'transparent'>;
  readonly labels?: Resettable<boolean>;
  readonly scale?: Resettable<number>;
}
```

**GeoImageExportOptions**

```ts
interface GeoImageExportOptions extends GeoImageExportDefaults {
  readonly filename?: Resettable<string>;
  readonly download?: boolean;
}
```

One image export of the handle or the menu (P1 projection of § 15).

**GeoInputChannel**

```ts
type GeoInputChannel = 'fill' | 'size';
```

The channels a P1 host can encode.

**GeoInvalidReason**

```ts
type GeoInvalidReason =
  'not-finite' | 'wrong-type' | 'unknown-category' | 'malformed';
```

**GeoItem**

```ts
interface GeoItem extends GeoItemRef {
  readonly layerType: GeoDataLayerType;
  readonly name: string;
}
```

A map object as reported. OUTPUT: `line` is dormant in P1.

**GeoKeyReading**

```ts
interface GeoKeyReading {
  readonly key: GeoKey | null;
  readonly status: 'valid' | 'missing' | 'invalid';
  readonly encoded: string | null;
}
```

A key with its machine identity (`v1:` + JSON).

**GeoLabelOptions**

```ts
interface GeoLabelOptions {
  readonly fields?: readonly GeoTextField[];
  readonly max?: number;
  readonly placement?: readonly ('end' | 'start' | 'above' | 'below')[];
}
```

**GeoLayer**

```ts
type GeoLayer =
  | GeoAreaLayer<any>
  | GeoPointLayer<any>
  | GeoContextLayer;
```

**GeoLayerSnapshot**

```ts
interface GeoLayerSnapshot {
  readonly layerType: GeoDataLayerType;
  readonly layerId: string;
  readonly visible: boolean;
  readonly measures: readonly GeoMeasure[];
  readonly detailOrder: readonly GeoId[];
  readonly encodings: readonly GeoEncodingSnapshot[];
  readonly rows: readonly GeoRowSnapshot[];
}
```

**GeoLayerTooltipOptions**

```ts
interface GeoLayerTooltipOptions {
  readonly title?: Resettable<'name' | false>;
  readonly fields?: readonly Exclude<GeoTextField, 'name'>[];
}
```

**GeoLegendActivation**

```ts
interface GeoLegendActivation {
  readonly entryId: string;
  readonly targets: readonly GeoLegendEntryRef[];
  readonly source: 'pointer' | 'keyboard' | 'touch' | 'host-legend';
  readonly defaultAction:
    'highlight' | 'clear-highlight' | 'filter-out' | 'filter-in' | 'none';
  preventDefault(): void;
  readonly defaultPrevented: boolean;
}
```

Activation of one resolved legend entry, cancellable.

**GeoLegendEntryRef**

```ts
interface GeoLegendEntryRef {
  readonly explanation: GeoExplanationRef;
  readonly entry: GeoScaleEntry;
}
```

**GeoLegendHook**

```ts
interface GeoLegendHook {
  readonly model: GeoLegendModel | null;
  readonly activate: (entryId: string) => boolean;
}
```

Inside a `GeoMapScope`: the legend model and its action, for a host legend.

**GeoLegendKey**

```ts
type GeoLegendKey =
  | {
      readonly kind: 'swatch';
      readonly color: GeoColor;
      readonly pattern?: GeoSpecialStatus | 'unrepresentable';
    }
  | {
      readonly kind: 'symbol';
      readonly shape: 'circle';
      readonly resolved: GeoResolvedVectorSymbol;
      readonly color: GeoColor;
      readonly radius: number;
      readonly hollow: boolean;
    }
  | {
      readonly kind: 'line';
      readonly color: GeoColor;
      readonly width: number;
      readonly dash: 'solid' | 'dashed' | 'dotted';
    }
  | {
      readonly kind: 'gradient';
      readonly domain: readonly [min: number, max: number];
      readonly stops: readonly {
        readonly value: number;
        readonly color: GeoColor;
      }[];
      readonly interpolation: 'oklab' | 'srgb';
      readonly srgbStops: readonly {
        readonly value: number;
        readonly color: GeoColor;
      }[];
      readonly outOfDomain: 'clamp' | 'unrepresentable';
      readonly ticks: readonly {
        readonly value: number;
        readonly label: string;
      }[];
    };
```

OUTPUT: `line` and `gradient` keys dormant in P1.

**GeoLegendModel**

```ts
interface GeoLegendModel {
  readonly revision: number;
  readonly sections: readonly {
    readonly id: string;
    readonly title: string | null;
    readonly entries: readonly GeoLegendModelEntry[];
  }[];
  readonly highlight: {
    readonly value: GeoHighlight;
    readonly status: 'active' | 'dormant';
  } | null;
}
```

**GeoLegendModelEntry**

```ts
interface GeoLegendModelEntry {
  readonly id: string;
  readonly role:
    | 'class'
    | 'category'
    | 'status'
    | 'unrepresentable'
    | 'layer'
    | 'custom'
    | 'cluster'
    | 'sample'
    | 'gradient';
  readonly targets: readonly GeoLegendEntryRef[];
  readonly label: string;
  readonly description: string;
  readonly key: GeoLegendKey | null;
  readonly sampleValue?: number;
  readonly count: number | null;
  readonly interactive: boolean;
  readonly highlighted: boolean;
  readonly filteredOut: boolean;
}
```

**GeoLegendOptions**

```ts
interface GeoLegendOptions {
  readonly position?: GeoLegendPosition;
  readonly offset?: readonly [inline: number, block: number];
  readonly align?: 'start' | 'center' | 'end';
  readonly arrangement?: 'row' | 'stack';
  readonly sections?: Resettable<readonly GeoLegendSection[]>;
  readonly unplaced?: 'append' | 'omit';
  readonly order?: Resettable<readonly GeoExplanationRefInput[]>;
  readonly explanations?: GeoExplanationOptions;
  readonly customEntries?: Readonly<Record<GeoId, GeoCustomLegendEntry>>;
  readonly interaction?: 'highlight' | 'none' | 'host';
  readonly highlightChip?: 'auto' | 'always' | 'never';
}
```

**GeoLegendPosition**

```ts
type GeoLegendPosition =
  'bottom' | 'top' | 'start' | 'end' | GeoCorner | 'outlet';
```

**GeoLegendSection**

```ts
interface GeoLegendSection {
  readonly id: GeoId;
  readonly title?: string;
  readonly items: readonly GeoLegendSectionItem[];
}
```

**GeoLegendSectionItem**

```ts
type GeoLegendSectionItem =
  | {
      readonly explanation: GeoExplanationRefInput;
      readonly parts?: Resettable<readonly GeoExplanationPart[]>;
    }
  | {
      readonly statuses: {
        readonly id: GeoId;
        readonly of: readonly GeoExplanationRefInput[];
        readonly parts?: readonly (GeoSpecialStatus | 'unrepresentable')[];
      };
    }
  | {readonly custom: GeoId};
```

**GeoLinkStatus**

```ts
type GeoLinkStatus = 'inline' | 'linked' | 'no-record' | 'ambiguous';
```

**GeoMapHandle**

```ts
interface GeoMapHandle {
  zoomIn(): void;
  zoomOut(): void;
  fit(options?: {readonly layers?: readonly string[]}): void;
  home(): void;
  pan(direction: 'up' | 'down' | 'left' | 'right'): void;
  zoomTo(items: GeoItemRef | readonly GeoItemRef[]): boolean;
  focusItem(item: GeoItemRef): boolean;
  revealInTable(
    item: GeoItemRef,
    options?: {readonly focus?: boolean},
  ): Promise<GeoTableRevealResult>;
  exportAsPng(options?: GeoImageExportOptions): Promise<GeoExportResult>;
  exportAsSvg(options?: GeoImageExportOptions): Promise<GeoExportResult>;
  exportAsCsv(options: GeoCsvExportOptions): Promise<GeoExportResult>;
  getFeatures(query?: GeoFeatureQuery): GeoFeatureSnapshot;
  getLegendModel(): GeoLegendModel;
  activateLegendEntry(entryId: string): boolean;
  getEffectivePresentation(): GeoEffectivePresentation;
  getState(): GeoMapState;
  applyState(
    state: unknown,
    options?: GeoApplyStateOptions,
  ): GeoApplyStateResult;
  requestLevel(level: GeoLevel, options?: {readonly item?: GeoItemRef}): void;
}
```

The map's handle (P1 projection: no `project`/`invert`). The navigation
methods of a controlled view are REQUESTS (§ 10.6); every method runs the
same route as the package's own control for it.

**GeoMapState**

```ts
interface GeoMapState {
  readonly version: 2;
  readonly dataset: GeoDatasetIdentity | null;
  readonly level: string | null;
  readonly view:
    | (GeoView & {readonly extent: readonly [GeoPosition, GeoPosition] | null})
    | null;
  readonly selection: readonly GeoItemRef[];
  readonly layers: Readonly<Record<string, {readonly visible: boolean}>>;
  readonly encodings: Readonly<
    Record<string, Readonly<Partial<Record<GeoChannel, string>>>>
  >;
  readonly scales: Readonly<Record<GeoId, string>>;
  readonly highlight: GeoHighlight | null;
  readonly filter: readonly GeoLegendEntryRef[];
}
```

**GeoMarker**

```ts
interface GeoMarker {
  readonly size?: number | GeoSizeMapping;
  readonly fill?: GeoFill;
  readonly stroke?: {readonly color?: GeoColor; readonly width?: number};
  readonly opacity?: number;
}
```

P1 marker: circles only.

**GeoMeasure**

```ts
type GeoMeasure = GeoNumberMeasure | GeoCategoryMeasure;
```

**GeoMeasurementReading**

```ts
type GeoMeasurementReading =
  | {
      readonly status: 'value';
      readonly kind: 'number';
      readonly value: number;
      readonly text: string;
    }
  | {
      readonly status: 'value';
      readonly kind: 'category';
      readonly categoryId: GeoId;
      readonly text: string;
    }
  | {readonly status: 'missing'}
  | {readonly status: 'invalid'; readonly reason: GeoInvalidReason}
  | {readonly status: 'suppressed'};
```

**GeoMeasurementStatus**

```ts
type GeoMeasurementStatus = 'value' | GeoSpecialStatus;
```

**GeoMenuContext**

```ts
interface GeoMenuContext {
  readonly target: GeoMenuTarget;
  readonly source: 'pointer' | 'keyboard' | 'touch' | 'table';
  readonly selectedItemCount: number;
  readonly view: {
    readonly zoom: number;
    readonly mode: GeoViewMode;
    readonly atHome: boolean;
  };
  readonly level: GeoLevel | null;
  readonly getMeta: (ref: GeoItemRef) => unknown;
}
```

One opening of the menu, frozen while it stays open. Never a value.

**GeoMenuFeatures**

```ts
interface GeoMenuFeatures {
  readonly copy?: Resettable<boolean>;
  readonly table?: Resettable<boolean>;
  readonly navigation?: Resettable<boolean>;
  readonly export?: Resettable<boolean>;
  readonly level?: Resettable<boolean>;
}
```

**GeoMenuGroup**

```ts
type GeoMenuGroup = 'host' | keyof GeoMenuFeatures;
```

**GeoMenuItem**

```ts
type GeoMenuItem =
  | 'separator'
  | {
      readonly label: string;
      readonly action?: (context: GeoMenuContext) => void;
      readonly icon?: unknown;
      readonly variant?: 'default' | 'destructive';
      readonly disabled?: boolean;
      readonly disabledReason?: string;
      readonly shortcut?: string;
      readonly keepOpen?: boolean;
      readonly visible?: (context: GeoMenuContext) => boolean;
      readonly separatorBefore?: boolean;
      readonly children?: readonly GeoMenuItem[];
    };
```

One item of the map's menu: the family's item (active-helpers
`menu-items`), acting on the opening's {@link GeoMenuContext}. The icon is
a component the menu renders hidden from assistive technology.

**GeoMenuTarget**

```ts
type GeoMenuTarget =
  | {
      readonly kind: 'object';
      readonly item: GeoItem;
      readonly atPlace: readonly GeoItem[];
    }
  | {readonly kind: 'cluster'; readonly cluster: GeoClusterSnapshot}
  | {readonly kind: 'map'; readonly position: GeoPosition | null}
  | {readonly kind: 'legend-entry'; readonly entry: GeoLegendModelEntry};
```

OUTPUT: what a menu was opened on; `cluster` is dormant before P4.

**GeoNavigationAction**

```ts
type GeoNavigationAction =
  'zoom-in' | 'zoom-out' | 'home' | 'fit' | 'pan';
```

**GeoNumberMeasure**

```ts
interface GeoNumberMeasure extends GeoMeasureBase {
  readonly kind?: 'number';
  readonly semantics?: GeoValueSemantics;
}
```

**GeoObjectSnapshot**

```ts
interface GeoObjectSnapshot {
  readonly kind: 'object';
  readonly rowId: string;
  readonly ref: GeoItemRef;
  readonly keyReading: GeoKeyReading;
  readonly name: string;
  readonly geometry: GeoGeometryStatus;
  readonly geometryReason: string | null;
  readonly link: GeoLinkStatus;
  readonly linkReason: string | null;
  readonly issues: readonly GeoRowIssue[];
  readonly position?: GeoPosition;
  readonly endpoints?: readonly [GeoPosition, GeoPosition] | null;
  readonly frames?: readonly string[];
  readonly measurements: Readonly<Record<GeoId, GeoMeasurementReading>>;
  readonly encodings: Readonly<Partial<Record<GeoChannel, GeoEncodingReading>>>;
  readonly details: readonly GeoDetail[];
  readonly selected: boolean;
  readonly highlighted: boolean;
  readonly filteredOut: boolean;
}
```

**GeoObjectTextContext**

```ts
interface GeoObjectTextContext<TMeta = unknown> {
  readonly item: GeoItem;
  readonly meta: TMeta | undefined;
  readonly measurements: Readonly<Record<GeoId, GeoMeasurementReading>>;
  readonly encodings: Readonly<Partial<Record<GeoChannel, GeoEncodingReading>>>;
  readonly details: readonly GeoDetail[];
}
```

What a text callback sees. Never a withheld value.

**GeoPalette**

```ts
type GeoPalette =
  readonly GeoColor[] | Readonly<Record<GeoId, GeoColor>>;
```

**GeoPointDatum**

```ts
interface GeoPointDatum<TMeta = unknown> {
  readonly key: GeoKey;
  readonly latitude: number;
  readonly longitude: number;
  readonly name?: string;
  readonly values?: GeoValues;
  readonly details?: readonly GeoDetail[];
  readonly meta?: TMeta;
}
```

**GeoPointLayer**

```ts
interface GeoPointLayer<
  TMeta = unknown,
> extends GeoDataLayerBase<TMeta> {
  readonly type: 'point';
  readonly points: readonly GeoPointDatum<TMeta>[];
  readonly marker?: GeoMarker;
  readonly renderer?: GeoPointRenderer;
}
```

**GeoRecordLink**

```ts
type GeoRecordLink =
  | 'no-object'
  | 'object-excluded'
  | 'ambiguous'
  | 'invalid-key'
  | 'duplicate-key';
```

**GeoRecordSnapshot**

```ts
interface GeoRecordSnapshot {
  readonly kind: 'record';
  readonly rowId: string;
  readonly layerId: string;
  readonly source: 'object-input' | 'value-record';
  readonly keyReading: GeoKeyReading;
  readonly link: GeoRecordLink;
  readonly linkReason: string;
  readonly issues: readonly GeoRowIssue[];
  readonly measurements: Readonly<Record<GeoId, GeoMeasurementReading>>;
  readonly details: readonly GeoDetail[];
}
```

**GeoResolvedVectorSymbol**

```ts
interface GeoResolvedVectorSymbol {
  readonly kind: 'vector';
  readonly label: string;
  readonly viewBox: readonly [number, number];
  readonly parts: readonly {
    readonly path: string;
    readonly fill: GeoColor;
    readonly fillRule: 'nonzero' | 'evenodd';
  }[];
  readonly anchor: readonly [number, number];
  readonly sizeBasis: 'fill-area' | 'box';
  readonly transform: readonly [number, number, number, number, number, number];
  readonly stroke: GeoColor;
  readonly strokeWidth: number;
  readonly opacity: number;
}
```

OUTPUT: the vector form of a symbol, fully resolved.

**GeoRowIssue**

```ts
type GeoRowIssue = 'duplicate-detail-id' | 'key-type-differs';
```

**GeoRowSnapshot**

```ts
type GeoRowSnapshot = GeoObjectSnapshot | GeoRecordSnapshot;
```

**GeoScaleEntry**

```ts
type GeoScaleEntry =
  | {readonly kind: 'class'; readonly index: number}
  | {readonly kind: 'category'; readonly categoryId: GeoId}
  | {readonly kind: 'status'; readonly status: GeoSpecialStatus}
  | {readonly kind: 'unrepresentable'}
  | {readonly kind: 'symbol'};
```

**GeoSelectionChange**

```ts
type GeoSelectionChange =
  | {
      readonly source: 'pointer' | 'keyboard';
      readonly item: GeoItem;
      readonly selected: boolean;
    }
  | {readonly source: 'update'; readonly removed: readonly GeoItemRef[]}
  | {readonly source: 'restore'}
  | {readonly source: 'api'}
  | {readonly source: 'cluster'; readonly members: readonly GeoItemRef[]};
```

OUTPUT: `cluster` is dormant in P1.

**GeoSizeMapping**

```ts
interface GeoSizeMapping {
  readonly measure: GeoId;
  readonly domainMax?: number;
  readonly maxRadius?: number;
  readonly legend?: FeatureOption<GeoExplanationOptions>;
}
```

Area ∝ value; the radius of the equal-area circle.

**GeoSpecialStatus**

```ts
type GeoSpecialStatus = 'missing' | 'invalid' | 'suppressed';
```

**GeoStateDisposition**

```ts
type GeoStateDisposition =
  'applied' | 'adjusted' | 'delegated' | 'dropped' | 'unchanged';
```

**GeoStateEntryResult**

```ts
type GeoStateEntryResult =
  | {
      readonly field: 'selection';
      readonly item: GeoItemRef;
      readonly reason: 'objects-missing' | 'malformed';
    }
  | {
      readonly field: 'layers';
      readonly layerId: string;
      readonly reason: 'unknown-layer';
    }
  | {
      readonly field: 'highlight' | 'filter';
      readonly entry: GeoLegendEntryRef;
      readonly reason:
        | 'scale-changed'
        | 'target-dormant'
        | 'unknown-entry'
        | 'capability-unavailable';
    };
```

**GeoStateField**

```ts
type GeoStateField =
  'view' | 'selection' | 'layers' | 'highlight' | 'filter' | 'level';
```

**GeoStateFieldResult**

```ts
interface GeoStateFieldResult {
  readonly field: GeoStateField;
  readonly disposition: GeoStateDisposition;
  readonly reason?: GeoStateReason;
}
```

**GeoStateReason**

```ts
type GeoStateReason =
  | 'malformed'
  | 'unsupported-version'
  | 'migrated-v1'
  | 'dataset-mismatch'
  | 'dataset-version-changed'
  | 'level-mismatch'
  | 'host-owned'
  | 'controlled'
  | 'invalid-view'
  | 'zoom-clamped'
  | 'view-clamped'
  | 'unknown-layer'
  | 'objects-missing'
  | 'scale-changed'
  | 'target-dormant'
  | 'unknown-entry'
  | 'not-requested'
  | 'capability-unavailable';
```

**GeoSuppressed**

```ts
interface GeoSuppressed {
  readonly suppressed: true;
}
```

**GeoTableOptions**

```ts
interface GeoTableOptions {
  readonly position?: 'below' | 'outlet';
  readonly open?: boolean;
  readonly defaultOpen?: boolean;
  readonly onOpenChange?: (
    open: boolean,
    cause: 'menu' | 'api' | 'reveal' | 'escape',
  ) => void;
  readonly layers?: readonly string[];
}
```

**GeoTableRequest**

```ts
interface GeoTableRequest {
  readonly item: GeoItemRef;
  readonly focus: boolean;
  readonly source: 'menu' | 'keyboard' | 'api';
  readonly requestId: number;
  readonly revision: number;
  readonly dataset: GeoDatasetIdentity | null;
  readonly signal: AbortSignal;
  readonly returnFocus: GeoFocusReturn;
}
```

**GeoTableRequestOutcome**

```ts
type GeoTableRequestOutcome =
  | {readonly status: 'shown'; readonly focus: 'host' | 'none' | 'package'}
  | {readonly status: 'unavailable'; readonly reason?: string};
```

**GeoTableRevealFailure**

```ts
type GeoTableRevealFailure =
  | 'no-table'
  | 'item-unknown'
  | 'host-refused'
  | 'host-failed'
  | 'not-opened'
  | 'outlet-hidden'
  | 'not-focusable'
  | 'superseded'
  | 'unmounted'
  | 'stale-data';
```

**GeoTableRevealResult**

```ts
type GeoTableRevealResult =
  | {
      readonly status: 'revealed';
      readonly by: 'host' | 'package';
      readonly focused: boolean;
    }
  | {
      readonly status: 'unavailable';
      readonly reason: GeoTableRevealFailure;
      readonly hostReason?: string;
    };
```

Every reveal settles exactly once with one of these.

**GeoTextField**

```ts
type GeoTextField =
  | 'name'
  | {readonly measure: GeoId; readonly show?: never; readonly encoding?: never}
  | {
      readonly encoding: GeoInputChannel;
      readonly show?: 'class' | 'value-and-class';
      readonly measure?: never;
    }
  | {readonly detail: GeoId}
  | 'details';
```

P1 text fields: encoding fields on P1 channels only.

**GeoTooltipOptions**

```ts
interface GeoTooltipOptions {
  readonly anchor?: Resettable<'object' | 'pointer'>;
  readonly delay?: Resettable<number>;
  readonly pinOnTap?: Resettable<boolean>;
}
```

**GeoUnrepresentableReason**

```ts
type GeoUnrepresentableReason =
  'negative-size' | 'negative-width' | 'out-of-domain' | 'not-rotatable';
```

OUTPUT: `negative-width` and `not-rotatable` dormant in P1.

**GeoValueInput**

```ts
type GeoValueInput = number | string | null | GeoSuppressed;
```

A number, a category id, `null`/absent (missing) or `{suppressed: true}`.

**GeoValues**

```ts
type GeoValues = Readonly<Record<GeoId, GeoValueInput | undefined>>;
```

**GeoView**

```ts
type GeoView =
  | {readonly mode: 'frame'}
  | {
      readonly mode: 'free';
      readonly center: GeoPosition;
      readonly zoom: number;
    };
```

One value for coordinates AND mode, controlled or uncontrolled.

**GeoViewCause**

```ts
type GeoViewCause =
  | 'pointer'
  | 'wheel'
  | 'pinch'
  | 'keyboard'
  | 'control'
  | 'menu'
  | 'api'
  | 'focus-follow'
  | 'restore'
  | 'level'
  | 'cluster'
  | 'reconcile';
```

**GeoViewChange**

```ts
interface GeoViewChange {
  readonly cause: GeoViewCause;
  readonly requested: boolean;
}
```

**GeoViewMode**

```ts
type GeoViewMode = GeoView['mode'];
```

**GeoVisualValue**

```ts
type GeoVisualValue =
  | {
      readonly kind: 'color';
      readonly color: GeoColor;
      readonly pattern?: GeoSpecialStatus | 'unrepresentable';
    }
  | {readonly kind: 'radius'; readonly radius: number; readonly hollow: boolean}
  | {readonly kind: 'width'; readonly width: number}
  | {readonly kind: 'shape'; readonly shape: string | {readonly symbol: GeoId}}
  | {readonly kind: 'rotation'; readonly degrees: number};
```

OUTPUT: `width`, `shape`, `rotation` dormant in P1.

**GeoZoomControls**

```ts
type GeoZoomControls =
  | {
      readonly visibility: 'always';
      readonly position?: GeoCorner;
      readonly orientation?: 'horizontal' | 'vertical';
      readonly actions?: Resettable<readonly GeoNavigationAction[]>;
    }
  | {
      readonly visibility: 'on-demand';
      readonly keepWhileZoomed?: boolean;
      readonly position?: GeoCorner;
      readonly orientation?: 'horizontal' | 'vertical';
      readonly actions?: Resettable<readonly GeoNavigationAction[]>;
    };
```

**GeoZoomOptions**

```ts
interface GeoZoomOptions {
  readonly controls?: Resettable<false | GeoZoomControls>;
  readonly gestures?: {
    readonly wheel?: Resettable<'modifier' | 'free' | false>;
    readonly drag?: Resettable<boolean>;
    readonly pinch?: Resettable<boolean>;
    readonly doubleClick?: Resettable<'zoom-in' | false>;
  };
  readonly keyboardShortcuts?: Resettable<boolean>;
  readonly minZoom?: Resettable<number>;
  readonly maxZoom?: Resettable<number>;
}
```

**Resettable**

```ts
type Resettable<T> = T | null;
```

`null` on a declared path resets it to the package or instance default.
