import { DataParser, VectorData } from 'geostyler-data'; import { JSONSchema4TypeName } from 'json-schema'; export type RequestBaseParams = { service: 'WFS'; request: 'GetFeature' | 'DescribeFeatureType'; exceptions?: string; }; export type GetFeatureOptionalParams = { featureID?: string; propertyName?: string; sortBy?: string; srsName?: string; }; export type RequestParams1_1_0 = { version: '1.1.0'; typeName: string; maxFeatures?: number; outputFormat?: 'application/json' | 'application/geo+json'; }; export type RequestParams2_0_0 = { version: '2.0.0'; typeNames: string; count?: number; outputFormat?: 'application/json' | 'application/geo+json'; }; export type RequestParams = GetFeatureOptionalParams & (RequestParams1_1_0 | RequestParams2_0_0); export type DescribeFeatureTypeParams = RequestBaseParams & (RequestParams1_1_0 | RequestParams2_0_0); export type GetFeatureParams = DescribeFeatureTypeParams & GetFeatureOptionalParams; /** * Interface representing the parameters to be send to WFS */ export interface ReadParams { url: string; requestParams: RequestParams; fetchParams?: RequestInit; } /** * Class implementing DataParser to fetch schema and sample data * using WFS requests (DescribeFeatureType resp. GetFeature) */ export declare class WfsDataParser implements DataParser { /** * The name of the WfsDataParser. */ static title: string; title: string; /** * Generate request parameter string for a passed object * * @param {Object} params Object holding request params * @return {string} The URI encoded request parameter string joined with & */ generateRequestParamString(params: any): string; /** * Map XSD datatypes (SimpleType) to json schema data stypes * * @param qualifiedXsdDataType The XSD datatype as string (including namespace) * @returns {JSONSchema4TypeName} The corresponding JSON schema type name */ mapXsdTypeToJsonDataType(qualifiedXsdDataType: string): JSONSchema4TypeName; /** * Fetch schema and sample data and transforms it to the GeoStyler data model. * * Currently, WFS service must support application/json as outputFormat * and needs CORS headers (only needed if WFS Service is not located on the same origin * as the component using this parser) to be available in responses * * @param wfsConfig The parameters of the WFS */ readData({ url, requestParams, fetchParams }: ReadParams): Promise; } export default WfsDataParser;