@types/shpjs
TypeScript icon, indicating that this package has built-in type declarations

3.4.7 • Public • Published

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.

/// <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;

Additional Details

Credits

These definitions were written by Hsiao-Ting Yu.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/shpjs

Weekly Downloads

8,156

Version

3.4.7

License

MIT

Unpacked Size

5.21 kB

Total Files

5

Last publish

Collaborators

  • types