下面的 transormer 方法实际上应该是匿名的,但这在 typescript 中是不允许的:
class Proj {
static (a, b): {
forward: (p: Point) => Point;
inverse: (p: Point) => Point;
};
static defs(name: string): any;
static defs(name: string, def: string): void;
static transform(from: any, to: any, pt: Point);
static parse(sr: string): any;
}
那么如何定义这使得以下是可能的呢?
import proj = require("proj");
proj("EPSG:3857", "EPSG:4326").forward([0,0]);