mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 23:37:04 +00:00
[knex-postgis] Initial typedef, functions still missing
This commit is contained in:
Vendored
+65
@@ -0,0 +1,65 @@
|
||||
// Type definitions for knex-postgis 0.2
|
||||
// Project: https://github.com/jfgodoy/knex-postgis
|
||||
// Definitions by: Vesa Poikajärvi <https://github.com/vesse>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
import * as Knex from 'knex';
|
||||
|
||||
// Knex does not export this
|
||||
type ColumnName = string | Knex.Raw | Knex.QueryBuilder;
|
||||
|
||||
type KnexPostgis = KnexPostgis.KnexPostgis;
|
||||
|
||||
declare function KnexPostgis(knex: Knex): KnexPostgis;
|
||||
|
||||
// TODO: .as not working
|
||||
declare namespace KnexPostgis {
|
||||
interface KnexPostgis {
|
||||
area(column: ColumnName): Knex.Raw;
|
||||
|
||||
asText(column: ColumnName): Knex.Raw;
|
||||
|
||||
asGeoJSON(column: ColumnName): Knex.Raw;
|
||||
|
||||
asEWKT(column: ColumnName): Knex.Raw;
|
||||
|
||||
// buffer
|
||||
|
||||
centroid(column: ColumnName): Knex.Raw;
|
||||
|
||||
distance(geom1: ColumnName, geom2: ColumnName): Knex.Raw;
|
||||
|
||||
// dwithin
|
||||
|
||||
// intersection
|
||||
|
||||
// intersects
|
||||
|
||||
// geography
|
||||
|
||||
// geometry
|
||||
|
||||
geomFromText(wkt: string, srid?: number): Knex.Raw;
|
||||
|
||||
// geomFromGeoJSON
|
||||
|
||||
// makeEnvelope
|
||||
|
||||
// makePoint
|
||||
|
||||
// makeValid
|
||||
|
||||
point(x_lon: number, y_lat: number): Knex.Raw;
|
||||
|
||||
transform(column: ColumnName, srid: number): Knex.Raw;
|
||||
|
||||
// within
|
||||
|
||||
x(column: ColumnName): Knex.Raw;
|
||||
|
||||
y(column: ColumnName): Knex.Raw;
|
||||
}
|
||||
}
|
||||
|
||||
export = KnexPostgis;
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"koa-morgan-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"unified-signatures": false,
|
||||
"no-empty-interface": false,
|
||||
"prefer-method-signature": false,
|
||||
"callable-types": false
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user