mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 19:07:08 +00:00
[@types/geobuf] Add typings for geobuf project (#40532)
* Add types for geobuf https://github.com/mapbox/geobuf * Remove patch version from header
This commit is contained in:
parent
b82c575b67
commit
593b226eac
14
types/geobuf/geobuf-tests.ts
Normal file
14
types/geobuf/geobuf-tests.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import * as geobuf from 'geobuf';
|
||||
import { GeoJSON } from 'geojson';
|
||||
import Pbf = require('pbf');
|
||||
|
||||
geobuf.decode(new Pbf(Uint8Array.from([]))); // $ExpectType GeoJSON
|
||||
const geojson: GeoJSON = {
|
||||
type: 'Feature',
|
||||
properties: {},
|
||||
geometry: {
|
||||
type: 'Point',
|
||||
coordinates: [-127, 19]
|
||||
}
|
||||
};
|
||||
geobuf.encode(geojson, new Pbf()); // $ExpectType Uint8Array
|
||||
9
types/geobuf/index.d.ts
vendored
Normal file
9
types/geobuf/index.d.ts
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
// Type definitions for geobuf 3.0
|
||||
// Project: https://github.com/mapbox/geobuf
|
||||
// Definitions by: Chad Burt <https://github.com/DefinitelyTyped>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
import Pbf = require('pbf');
|
||||
import { GeoJSON } from 'geojson';
|
||||
|
||||
export function decode(pbf: Pbf): GeoJSON;
|
||||
export function encode(obj: GeoJSON, pbf: Pbf): Uint8Array;
|
||||
23
types/geobuf/tsconfig.json
Normal file
23
types/geobuf/tsconfig.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"geobuf-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/geobuf/tslint.json
Normal file
1
types/geobuf/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user