npm install --save @types/shpjs
This package contains type definitions for shpjs (https://github.com/calvinmetcalf/shapefile-js#readme).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/shpjs.
/// <reference types="node" />
/// <reference types="geojson" />
declare namespace shpjs {
// All toBuffer() compatible buffers.
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;
- Last updated: Sat, 27 Apr 2024 10:07:07 GMT
- Dependencies: @types/geojson, @types/node
These definitions were written by Hsiao-Ting Yu.