export declare function captureMaterialFadeDuration(ms: unknown): number; export declare function captureLabelFadeDuration(ms: unknown): number; import type { SceneIdentity, SceneStatus } from './scenes.js'; export type FeatureId = string | number; export type Position = [number, number] | [number, number, number]; export type GeoJSONGeometry = { type: 'Point'; coordinates: Position; } | { type: 'MultiPoint' | 'LineString'; coordinates: Position[]; } | { type: 'MultiLineString' | 'Polygon'; coordinates: Position[][]; } | { type: 'MultiPolygon'; coordinates: Position[][][]; } | { type: 'GeometryCollection'; geometries: GeoJSONGeometry[]; }; export interface GeoJSONFeature { type: 'Feature'; id?: FeatureId; properties: Record | null; geometry: GeoJSONGeometry | null; [member: string]: unknown; } export interface GeoJSONFeatureCollection { type: 'FeatureCollection'; features: GeoJSONFeature[]; [member: string]: unknown; } export type GeoJSON = GeoJSONGeometry | GeoJSONFeature | GeoJSONFeatureCollection; export type ClusterPropertySpecification = ['+' | '-' | '*' | '/' | 'min' | 'max' | 'all' | 'any' | 'concat' | unknown[], unknown[] | number | boolean | string]; export interface GetClusterOptions { cluster: boolean; clusterRadius: number; clusterMaxZoom: number; } export interface SetClusterOptions { cluster?: boolean; clusterRadius?: number; clusterMaxZoom?: number; } export interface LiveSourceOptions { fields: Record; allowDelta?: boolean; } export interface LivePoint { id: string; coordinate: [number, number]; properties: Record; } export type LiveUpdate = { kind: 'snapshot'; epoch: string; sequence: string; points: LivePoint[]; } | { kind: 'delta'; epoch: string; baseSequence: string; sequence: string; upserts: LivePoint[]; deletes: string[]; }; export interface LiveSourceState { initialized: boolean; epoch: string | null; sequence: string | null; protocolRevision: string; pointCount: number; allowDelta: boolean; fields: Record; } export interface LiveUpdateResult { applied: boolean; state: LiveSourceState; dataRevision: string; } export interface LiveSourceSnapshot { source: SourceIdentity; state: LiveSourceState; data: GeoJSONFeatureCollection; } export interface LiveReceiverOptions { owner?: SceneIdentity; protocol?: 'gis-live-v1'; transport: { type: 'http-poll'; url: string; intervalMs?: number; } | { type: 'websocket'; url: string; reconnectDelayMs?: number; }; } export interface LiveReceiverIdentity extends SourceIdentity { receiverInstanceId: string; } export interface LiveReceiverState { owner?: SceneIdentity; ownerState?: SceneStatus; source: SourceIdentity; receiverInstanceId: string; transport: 'http-poll' | 'websocket'; connection?: 'connecting' | 'open' | 'retrying' | 'paused' | 'stopped'; status: 'running' | 'paused' | 'stopped'; loading: boolean; intervalMs: number; lastError: SourceLoadError | null; dataRevision: string; } export interface LiveReceiver extends Readonly { getState(): Promise; pause(): Promise; resume(): Promise; stop(): Promise; } export interface LiveSourceAPI { connectLive(options: LiveReceiverOptions): Promise; getLiveReceiver(): Promise; applyLiveUpdate(frame: LiveUpdate): Promise; getLiveState(): Promise; freezeLiveSnapshot(): Promise; } export interface GeoJSONSourceOptions { sqsLive?: LiveSourceOptions; type: 'geojson'; lineMetrics?: boolean; data: GeoJSON | string; attribution?: string; promoteId?: string; generateId?: boolean; cluster?: boolean; clusterRadius?: number; clusterMaxZoom?: number; clusterMinPoints?: number; clusterProperties?: Record; } export interface GeoJSONFeatureDiff { id: FeatureId; newGeometry?: GeoJSONGeometry | null; removeAllProperties?: boolean; removeProperties?: string[]; addOrUpdateProperties?: { key: string; value: unknown; }[]; } export interface GeoJSONSourceDiff { removeAll?: boolean; remove?: FeatureId[]; add?: GeoJSONFeature[]; update?: GeoJSONFeatureDiff[]; } export interface SourceIdentity { id: string; sourceInstanceId: string; } export interface SourceInfo extends SourceIdentity { sqsLiveReceiver?: LiveReceiverState; sqsLive?: LiveSourceState; type: 'geojson' | 'image' | 'video' | 'canvas' | 'vector' | 'raster' | 'raster-dem'; mediaState?: MediaState; tileMetadata?: TileSourceMetadata; tileState?: TileSourceState; dataRevision: string; stateRevision: string; loaded: boolean; loading: boolean; hasData: boolean; requestRevision: string; loadError: SourceLoadError | null; featureCount: number; bounds: [number, number, number, number] | null; attribution: string; promoteId: string | Record | null; generateId: boolean; lineMetrics: boolean; cluster: boolean; supportsUpdateData: boolean; referenceCount: number; } export interface GeoJSONSource extends Readonly { readonly sqs: LiveSourceAPI; readonly type: 'geojson'; readonly dataRevision: string; getData(): Promise; setData(data: GeoJSON | string): Promise; updateData(diff: GeoJSONSourceDiff): Promise; getClusterOptions(): Promise; setClusterOptions(options: SetClusterOptions): Promise; getClusterChildren(clusterId: number): Promise; getClusterLeaves(clusterId: number, limit?: number, offset?: number): Promise; getClusterExpansionZoom(clusterId: number): Promise; } export interface SourceChangeEvent { readonly sourceCount: number; } export interface QuerySourceFeatureOptions { filter?: unknown[]; validate?: true; sourceLayer?: string; sqs?: { offset?: number; limit?: number; sourceInstanceId?: string; dataRevision?: string; }; } export interface QueriedSourceFeature extends GeoJSONFeature { sourceLayer?: string; source: string; sqs: { sourceInstanceId: string; dataRevision: string; featureIndex: number; }; } export interface FeatureStateTarget { source: string; id: FeatureId; sourceLayer?: string; sqs?: { sourceInstanceId?: string; dataRevision?: string; }; [member: string]: unknown; } export type FeatureState = Record; export type FeatureStateRemovalTarget = Omit & { source: string; id?: FeatureId; }; export interface SourceLoadError { readonly code: string; readonly message: string; } export type SourceLifecycleType = 'sourcedataloading' | 'sourcedata' | 'sourcedataabort' | 'error'; export interface SourceLifecycleEvent { readonly sqsLiveReceiver?: LiveReceiverState; readonly sqsLive?: LiveSourceState; readonly type: SourceLifecycleType; readonly sourceId: string; readonly sourceInstanceId: string; readonly dataType: 'source'; readonly sourceDataType: 'content' | 'metadata'; readonly isSourceLoaded: boolean; readonly loading: boolean; readonly hasData: boolean; readonly dataRevision: string; readonly requestRevision: string; readonly loadError: SourceLoadError | null; readonly error?: SourceLoadError; } export declare function immutableSourceEvent(event: T): T; export declare function immutableSourceInfo(info: SourceInfo): SourceInfo; export type MediaCoordinates = [[number, number], [number, number], [number, number], [number, number]]; export interface MediaSourceOptions { type: 'image' | 'video'; coordinates: MediaCoordinates; attribution?: string; url?: string; urls?: string[]; } export interface ImageSourceUpdate { url: string; coordinates?: MediaCoordinates; } export interface CanvasSourceOptions { type: 'canvas'; canvas: string | HTMLCanvasElement; coordinates: MediaCoordinates; animate?: boolean; attribution?: string; } export type SourceOptions = GeoJSONSourceOptions | MediaSourceOptions | CanvasSourceOptions | TileSourceOptions; export interface MediaState { kind: 'image' | 'video' | 'canvas'; coordinates: MediaCoordinates; revision: number; frameSequence: number; paused: boolean; width: number; height: number; byteLength: number; duration?: number; currentTime?: number; canvas?: string; } export interface MediaFrame { sequence: number; width: number; height: number; data: Uint8Array; } export interface MediaFrameResult { applied: boolean; state: SourceInfo; } export interface MediaSourceBase extends Readonly { readonly dataRevision: string; updateImage(options: ImageSourceUpdate): Promise; setCoordinates(coordinates: MediaCoordinates): Promise; play(): Promise; pause(): Promise; readonly sqs: { getState(): Promise; fail(reason: { code: string; message: string; }): Promise; submitFrame(frame: MediaFrame): Promise; }; } export interface MediaSource extends MediaSourceBase { readonly type: 'image' | 'video'; } export interface CanvasSource extends MediaSourceBase { readonly type: 'canvas'; getCanvas(): HTMLCanvasElement; } export type MapSource = GeoJSONSource | MediaSource | CanvasSource | TileSource; export interface TileSourceMetadata { tiles: string[]; minzoom: number; maxzoom: number; bounds: [number, number, number, number]; scheme: 'xyz' | 'tms'; attribution: string; tileSize: number | null; metadataLoaded: boolean; volatile: boolean; encoding?: 'mapbox' | 'terrarium' | 'custom'; } export interface TileSourceOptions { type: 'vector' | 'raster' | 'raster-dem'; url?: string; tiles?: string[]; minzoom?: number; maxzoom?: number; bounds?: [number, number, number, number]; scheme?: 'xyz' | 'tms'; attribution?: string; tileSize?: 256 | 512; encoding?: 'mvt' | 'mapbox' | 'terrarium' | 'custom'; redFactor?: number; greenFactor?: number; blueFactor?: number; baseShift?: number; promoteId?: string | Record; volatile?: boolean; } export interface TileSource extends Readonly { readonly type: 'vector' | 'raster' | 'raster-dem'; readonly dataRevision: string; setTiles(tiles: string[]): Promise; setUrl(url: string): Promise; readonly sqs: { getTileMetadata(): Promise; }; } export interface TileSourceState { visibleTiles: number; readyTiles: number; fallbackTiles: number; pendingTiles: number; cachedTiles: number; byteLength: number; } export interface TerrainSpecification { source: string; exaggeration?: number; } export interface TerrainEvent { readonly type: 'terrain'; readonly terrain: Readonly | null; } export type SourceNotice = SourceLifecycleEvent | TerrainEvent;