Installation
npm install --save @types/shpjs
Summary
This package contains type definitions for shpjs (https://github.com/calvinmetcalf/shapefile-js#readme).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/shpjs.
declare namespace shpjs {
type ShpJSBuffer = Buffer | ArrayBuffer | { buffer: ArrayBuffer };
interface FeatureCollectionWithFilename extends GeoJSON.FeatureCollection {
fileName?: string | undefined;
}
interface ShpJS {
(
base: string | ShpJSBuffer,
whiteList?: readonly string[],
): Promise<FeatureCollectionWithFilename | FeatureCollectionWithFilename[]>;
parseZip(
buffer: ShpJSBuffer,
whiteList?: readonly string[],
): Promise<FeatureCollectionWithFilename | FeatureCollectionWithFilename[]>;
getShapefile(
base: string | ShpJSBuffer,
whiteList?: readonly string[],
): Promise<FeatureCollectionWithFilename | FeatureCollectionWithFilename[]>;
combine(
arr: [readonly GeoJSON.Geometry[], readonly GeoJSON.GeoJsonProperties[]],
): GeoJSON.FeatureCollection;
parseShp(shp: ShpJSBuffer, prj?: string | Buffer): GeoJSON.Geometry[];
parseDbf(dbf: ShpJSBuffer, cpg: ShpJSBuffer): GeoJSON.GeoJsonProperties[];
}
}
declare var shpjs: shpjs.ShpJS;
export = shpjs;
Additional Details
Credits
These definitions were written by Hsiao-Ting Yu.