import { Definitions , StylePriority , StyleSet } from "./Theme" ; import { WorkerServiceProtocol } from "./WorkerServiceProtocol" ; /**
 * Interface for `OptionsMap` which describes a general structure of key-value pairs.
 */ export interface OptionsMap { [ name ] : any ; } remarks export class RequestController implements AbortController { param { number } priority param { AbortController } abortController constructor ( public priority = 0 , public abortController = new AbortController ( ) ) { } get signal ( ) : AbortSignal { return this . abortController . signal ; } /**
     * Invoking this method will set this object's AbortSignal's aborted flag and
     * signal to any observers that the associated activity is to be aborted.
     */ abort ( ) { this . abortController . abort ( ) ; } } /**
 * Communication protocol with [[ITileDecoder]].
 */ export namespace WorkerDecoderProtocol { /**
     * Define possible names of messages exchanged with decoder services within `WebWorker`.
     */ export enum DecoderMessageName { Configuration = "configuration" } /**
     * Interface for `DecodedTileMessage` which describes metadata for a decoded tile.
     */ export interface DecoderMessage { service : string ; type : DecoderMessageName ; } /**
     * Interface for a ConfigurationMessage that is sent from the datasource to the decoder. The
     * message used to configure the [[ITileDecoder]].
     */ export interface ConfigurationMessage extends DecoderMessage { type : DecoderMessageName . Configuration ; styleSet ? : StyleSet ; definitions ? : Definitions ; priorities ? : StylePriority [ ] ; labelPriorities ? : string [ ] ; options ? : OptionsMap ; languages ? : string [ ] ; } /**
     * Type guard to check if an object is an instance of `ConfigurationMessage`.
     */ export function isConfigurationMessage ( message ) { return ( message && typeof message . service === "string" && typeof message . type === "string" && message . type === DecoderMessageName . Configuration ) ; } /**
     * Define possible names of requests called on decoder services within `WebWorker`.
     */ export enum Requests { DecodeTileRequest = "decode-tile-request" , TileInfoRequest = "tile-info-request" } /**
     * This object is sent to the decoder asking to decode a specific tile. The expected response
     * type is a [[DecodedTile]].
     */ export interface DecodeTileRequest extends WorkerServiceProtocol . ServiceRequest { type : Requests . DecodeTileRequest ; tileKey : number ; data : ArrayBufferLike ; projection : string ; } /**
     * Type guard to check if an object is a decoded tile object sent to a worker.
     */ export function isDecodeTileRequest ( message ) { return ( message && typeof message . type === "string" && message . type === Requests . DecodeTileRequest ) ; } /**
     * This object is sent to the decoder asking for a tile info of a specific tile. The expected
     * response type is a [[DecodedTile]].
     */ export interface TileInfoRequest extends WorkerServiceProtocol . ServiceRequest { type : Requests . TileInfoRequest ; tileKey : number ; data : ArrayBufferLike ; projection : string ; } /**
     * Type guard to check if an object is an info tile object sent to a worker.
     */ export function isTileInfoRequest ( message ) { return ( message && typeof message . type === "string" && message . type === Requests . TileInfoRequest ) ; } }