mirror of
https://github.com/chenasraf/DefinitelyTyped.git
synced 2026-05-17 17:48:06 +00:00
Adds types for geojson-validation by @LiamAttClarke (#65551)
* Adds types for geojson-validation * Cleans up geojson-validation types * Formats geojson-validation
This commit is contained in:
22
types/geojson-validation/geojson-validation-tests.ts
Normal file
22
types/geojson-validation/geojson-validation-tests.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import GeoJSONValidation = require('geojson-validation');
|
||||
|
||||
GeoJSONValidation.allTypes.Feature; // $ExpectType GeoJSONValidator
|
||||
GeoJSONValidation.define('Feature', () => {}); // $ExpectType boolean
|
||||
GeoJSONValidation.isBbox(null); // $ExpectType string[]
|
||||
GeoJSONValidation.isFeature(null); // $ExpectType string[]
|
||||
GeoJSONValidation.isFeatureCollection(null); // $ExpectType string[]
|
||||
GeoJSONValidation.isGeoJSONObject(null); // $ExpectType string[]
|
||||
GeoJSONValidation.valid(null); // $ExpectType string[]
|
||||
GeoJSONValidation.isGeometryObject(null); // $ExpectType string[]
|
||||
GeoJSONValidation.isLineString(null); // $ExpectType string[]
|
||||
GeoJSONValidation.isLineStringCoor(null); // $ExpectType string[]
|
||||
GeoJSONValidation.isMultiLineString(null); // $ExpectType string[]
|
||||
GeoJSONValidation.isMultiLineStringCoor(null); // $ExpectType string[]
|
||||
GeoJSONValidation.isMultiPoint(null); // $ExpectType string[]
|
||||
GeoJSONValidation.isMultiPointCoor(null); // $ExpectType string[]
|
||||
GeoJSONValidation.isMultiPolygon(null); // $ExpectType string[]
|
||||
GeoJSONValidation.isMultiPolygonCoor(null); // $ExpectType string[]
|
||||
GeoJSONValidation.isPoint(null); // $ExpectType string[]
|
||||
GeoJSONValidation.isPolygon(null); // $ExpectType string[]
|
||||
GeoJSONValidation.isPolygonCoor(null); // $ExpectType string[]
|
||||
GeoJSONValidation.isPosition(null); // $ExpectType string[]
|
||||
46
types/geojson-validation/index.d.ts
vendored
Normal file
46
types/geojson-validation/index.d.ts
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
// Type definitions for geojson-validation 1.0
|
||||
// Project: https://gitlab.com/mjbecze/GeoJSON-Validation
|
||||
// Definitions by: Liam A. Clarke <https://github.com/LiamAttClarke>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export interface GeoJSONValidator {
|
||||
(geoJSONObject: unknown, trace?: boolean | undefined): string[];
|
||||
}
|
||||
|
||||
export const allTypes: {
|
||||
Feature: GeoJSONValidator;
|
||||
FeatureCollection: GeoJSONValidator;
|
||||
Point: GeoJSONValidator;
|
||||
MultiPoint: GeoJSONValidator;
|
||||
LineString: GeoJSONValidator;
|
||||
MultiLineString: GeoJSONValidator;
|
||||
Polygon: GeoJSONValidator;
|
||||
MultiPolygon: GeoJSONValidator;
|
||||
GeometryCollection: GeoJSONValidator;
|
||||
Bbox: GeoJSONValidator;
|
||||
Position: GeoJSONValidator;
|
||||
GeoJSON: GeoJSONValidator;
|
||||
GeometryObject: GeoJSONValidator;
|
||||
};
|
||||
|
||||
export function define(type: keyof typeof allTypes, definition: (...args: any[]) => any): boolean;
|
||||
|
||||
export const isPosition: GeoJSONValidator;
|
||||
export const isGeoJSONObject: GeoJSONValidator;
|
||||
export const valid: GeoJSONValidator;
|
||||
export const isGeometryObject: GeoJSONValidator;
|
||||
export const isPoint: GeoJSONValidator;
|
||||
export const isMultiPointCoor: GeoJSONValidator;
|
||||
export const isMultiPoint: GeoJSONValidator;
|
||||
export const isLineStringCoor: GeoJSONValidator;
|
||||
export const isLineString: GeoJSONValidator;
|
||||
export const isMultiLineStringCoor: GeoJSONValidator;
|
||||
export const isMultiLineString: GeoJSONValidator;
|
||||
export const isPolygonCoor: GeoJSONValidator;
|
||||
export const isPolygon: GeoJSONValidator;
|
||||
export const isMultiPolygonCoor: GeoJSONValidator;
|
||||
export const isMultiPolygon: GeoJSONValidator;
|
||||
export const isGeometryCollection: GeoJSONValidator;
|
||||
export const isFeature: GeoJSONValidator;
|
||||
export const isFeatureCollection: GeoJSONValidator;
|
||||
export const isBbox: GeoJSONValidator;
|
||||
23
types/geojson-validation/tsconfig.json
Normal file
23
types/geojson-validation/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",
|
||||
"geojson-validation-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/geojson-validation/tslint.json
Normal file
1
types/geojson-validation/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "@definitelytyped/dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user