Merge pull request #15769 from ricardo-mello/topojson

Added type definitions for topojson 3.0
This commit is contained in:
Ryan Cavanaugh
2017-04-17 12:52:14 -07:00
committed by GitHub
4 changed files with 80 additions and 0 deletions
+48
View File
@@ -0,0 +1,48 @@
// Type definitions for topojson 3.0.0
// Project: https://github.com/topojson/topojson
// Definitions by: Ricardo Mello <https://github.com/ricardo-mello>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export function bbox(topology: any): any;
export function feature(topology: any, o: any): { features: any[]; };
export function filter(topology: any, filter: any): any;
export function filterAttached(topology: any): any;
export function filterAttachedWeight(topology: any, minWeight: any, weight: any): any;
export function filterWeight(topology: any, minWeight: any, weight: any): any;
export function merge(topology: any, ...args: any[]): { type: any, coordinates: any[] };
export function mergeArcs(topology: any, objects: any): any;
export function mesh(topology: any, ...args: any[]): { type: any; coordinates: any[]; };
export function meshArcs(topology: any, object$$1: any, filter: any, ...args: any[]): { type: any; coordinates: any[]; };
export function neighbors(objects: any): any[];
export function planarRingArea(ring: any): any;
export function planarTriangleArea(triangle: any): any;
export function presimplify(topology: any, weight: any): any[];
export function quantile(topology: any, p: any): any;
export function quantize(topology: any, transform: any): any;
export function simplify(topology: any, minWeight: any): any;
export function sphericalRingArea(ring: any, interior: any): any;
export function sphericalTriangleArea(t: any): any;
export function topology(objects: any, quantization: any): any;
export function transform(transform: any): any;
export function untransform(transform: any): any;
+6
View File
@@ -0,0 +1,6 @@
import * as topojson from 'topojson';
// TODO: complete tests.
topojson.feature(null, null); // $ExpectType { features: any[]; }
topojson.mesh(null, null, (a: any, b: any) => a !== b); // $ExpectType { type: any; coordinates: any[]; }
+23
View File
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6",
"dom"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"topojson-tests.ts"
]
}
+3
View File
@@ -0,0 +1,3 @@
{
"extends": "../tslint.json"
}