DefinitelyTyped/shapefile/shapefile.d.ts
Denis 4c7b1220e0 Implemented shapefile definition (#11307)
* Implement shapefile definition

* Implement shapefile definition

* Shapefile remove Promise reference
2016-09-19 16:22:08 +09:00

32 lines
890 B
TypeScript

// Type definitions for shapefile 0.5.6
// Project: https://github.com/mbostock/shapefile
// Definitions by: Denis Carriere <https://github.com/DenisCarriere>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../geojson/geojson.d.ts"/>
declare const shapefile: shapefile.ShapefileStatic;
declare namespace shapefile {
interface Options {
encoding: string
highWaterMark: number
}
interface Feature {
done: boolean
value: GeoJSON.Feature<any>
}
interface Shapefile {
bbox: Array<number>
read(): Promise<Feature>;
}
interface ShapefileStatic {
open(shp: any, dbf?: any, options?: Options): Promise<Shapefile>;
read(shp: any, dbf?: any, options?: Options): Promise<GeoJSON.FeatureCollection<any>>;
}
}
declare module "shapefile" {
export = shapefile
}