mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
Merge pull request #25828 from wazeHQ/mapbox__geojson-area
add types for @mapbox/geojson-area
This commit is contained in:
12
types/mapbox__geojson-area/index.d.ts
vendored
Normal file
12
types/mapbox__geojson-area/index.d.ts
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
// Type definitions for @mapbox/geojson-area 0.2
|
||||
// Project: https://github.com/mapbox/geojson-area#readme
|
||||
// Definitions by: Sagie Maoz <https://github.com/n0nick>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
// tslint:disable-next-line no-single-declare-module
|
||||
declare module "@mapbox/geojson-area" {
|
||||
import { Geometry } from 'geojson';
|
||||
|
||||
function geometry(geo: Geometry): number;
|
||||
}
|
||||
21
types/mapbox__geojson-area/mapbox__geojson-area-tests.ts
Normal file
21
types/mapbox__geojson-area/mapbox__geojson-area-tests.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { geometry } from '@mapbox/geojson-area';
|
||||
|
||||
// Using a polygon argument
|
||||
// $ExpectType number
|
||||
geometry({
|
||||
type: "Polygon",
|
||||
coordinates: [
|
||||
[
|
||||
[170.0, 45.0], [180.0, 45.0]
|
||||
], [
|
||||
[-180.0, 45.0], [-170.0, 45.0]
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
// Using a point argument
|
||||
// $ExpectType number
|
||||
geometry({
|
||||
type: "Point",
|
||||
coordinates: [12, 23]
|
||||
});
|
||||
23
types/mapbox__geojson-area/tsconfig.json
Normal file
23
types/mapbox__geojson-area/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",
|
||||
"mapbox__geojson-area-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/mapbox__geojson-area/tslint.json
Normal file
1
types/mapbox__geojson-area/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user