/** * A WGS 84-compatible longitude coordinate value. * * @minimum -180 * @maximum 180 */ export type Longitude = number; /** * A WGS 84-compatible latitude coordinate value. * * @minimum -90 * @maximum 90 */ export type Latitude = number; /** * A valid WGS 84 position consisting of a longitude coodinate, followed by a * latitude coordinate. * * @minItems 2 * @maxItems 2 */ export type Position = [Longitude, Latitude]; export interface Geometry { type: string; } /** * An RFC-7946 compatible GeoJSON Point geometry. */ export interface Point extends Geometry { type: 'Point'; coordinates: Position; } /** * An RFC-7946 compatible GeoJSON Polygon geometry. */ export interface Polygon extends Geometry { type: 'Polygon'; coordinates: Position[][]; } /** * An RFC-7946 compatible GeoJSON MultiPolygon geometry. */ export interface MultiPolygon extends Geometry { type: 'MultiPolygon'; coordinates: Position[][][]; } /** * An RFC-7946 compatible GeoJSON LineString geometry. */ export interface LineString extends Geometry { type: 'LineString'; /** * @minItems 2 */ coordinates: Position[]; } /** * The type field used for individual GeoJSON features. */ export type FeatureType = 'Feature'; export interface Feature { type: FeatureType; geometry: G; properties: P; } /** * The type field used for a collection of GeoJSON features. */ export type FeatureCollectionType = 'FeatureCollection'; export interface FeatureCollection { type: FeatureCollectionType; features: Feature[]; } export interface GeoJSONPoint extends Geometry { type: 'Point'; coordinates: number[]; } export interface GeoJSONLineString extends Geometry { type: 'LineString'; coordinates: number[][]; } export interface GeoJSONPolygon extends Geometry { type: 'Polygon'; coordinates: number[][][]; } export interface GeoJSONMultiPolygon extends Geometry { type: 'MultiPolygon'; coordinates: number[][][][]; } export type DowncastGeometry = G extends Point ? GeoJSONPoint : G extends LineString ? GeoJSONLineString : G extends Polygon ? GeoJSONPolygon : G extends MultiPolygon ? GeoJSONMultiPolygon : G; export type DowncastFeature = F extends Feature ? Feature : G, P> : F; export type DowncastFeatureCollection = FC extends FeatureCollection ? FeatureCollection : G, P> : FC; export type Downcast = T extends FeatureCollection ? DowncastFeatureCollection : T extends Feature ? DowncastFeature : T extends Geometry ? DowncastGeometry : T extends (infer U)[] ? Downcast[] : T extends object ? { [K in keyof T]: Downcast; } : T; export type UpcastGeometry = G extends GeoJSONPoint ? Point : G extends GeoJSONLineString ? LineString : G extends GeoJSONPolygon ? Polygon : G extends GeoJSONMultiPolygon ? MultiPolygon : G; export type UpcastFeature = F extends Feature ? Feature : G, P> : F; export type UpcastFeatureCollection = FC extends FeatureCollection ? FeatureCollection : G, P> : FC; export type Upcast = T extends FeatureCollection ? UpcastFeatureCollection : T extends Feature ? UpcastFeature : T extends Geometry ? UpcastGeometry : T extends (infer U)[] ? Upcast[] : T extends object ? { [K in keyof T]: Upcast; } : T; //# sourceMappingURL=geojson.d.ts.map