///
/**
* An error returned from an ArcGIS service.
* @example
* // Inside async function
* const response = await fetch("https://www.example.com/ArcGIS/rest/services/MyService/query?invalidOption=thisisinvalid");
* const obj = await response.json();
* if (obj.error) {
* throw new ArcGisError(obj.error);
* }
*/
export declare class ArcGisError extends Error {
readonly errorInfo: IError;
/**
* Error code
*/
readonly code?: number;
/**
* Creates a new instance of ArcGisError.
* @param errorInfo - The "error" property of the response object returned from a failed ArcGIS Server request.
*/
constructor(errorInfo: IError);
}
/**
* Error information object returned from a bad ArcGIS service request.
*/
export interface IError {
[key: string]: any;
/** Status code */
code: number;
/** text description of error */
message: string;
}
/**
* Information about a map service.
*/
export interface IServiceInfo {
[key: string]: any;
/**
* Comma-separated list of the names of extensions supported by a service. (Commas may also be followed by spaces)
*/
supportedExtensions?: string;
/** Error information. This property will only be present if a problem has occured with a request. */
error?: IError;
}
/**
* Gets map service info
* @param serviceUrl map service URL.
* @throws {ArcGisError}
*/
export declare function getServiceInfo(serviceUrl: string): Promise;
/**
* Detects if a map service supports the "LayerMetadata" capability.
* @param serviceUrl Map or Feature service URL.
* @throws {ArcGisError}
*/
export declare function detectLayerMetadataSupport(serviceUrl: string): Promise;
/**
* Gets a list of data sources
* @param serviceUrl Map service URL
* @returns An object keyed by data set names with values that are layer ID integers associated with those datasets.
*/
export declare function getLayerSources(serviceUrl: string): Promise;
/**
* Gets URLs to unique metadata items.
* @param url map service URL
* @param layerSources If you have already called getLayerSources, you can pass in the results here to avoid making a duplicate request.
* @returns Key value pairs. Keys are table names and values are metadata URLs.
*/
export declare function getMetadataLinks(url: string, layerSources?: ILayerLayerSources): Promise<{
[key: string]: string;
}>;
/**
* Gets a list of valid layer IDs
* @param url Map service URL
* @throws {ArcGisError} Thrown if the map service returns an error.
* @throws {TypeError} Thrown if HTTP request returns an object in unexpected format.
*/
export declare function getValidLayers(url: string): Promise;
/**
* A mapping of data sources to layer ID integers.
*/
export interface ILayerLayerSources {
[key: string]: number[];
}