Merge remote-tracking branch 'refs/remotes/DefinitelyTyped/master' into mongo2.1

This commit is contained in:
CaselIT
2016-01-11 15:03:57 +01:00
7 changed files with 246 additions and 4 deletions
+18 -4
View File
@@ -6837,10 +6837,24 @@ module TestIsObject {
}
// _.isPlainObject
result = <boolean>_.isPlainObject(any);
result = <boolean>_(1).isPlainObject();
result = <boolean>_<any>([]).isPlainObject();
result = <boolean>_({}).isPlainObject();
module TestIsPlainObject {
{
let result: boolean;
result = _.isPlainObject(any);
result = _(1).isPlainObject();
result = _<any>([]).isPlainObject();
result = _({}).isPlainObject();
}
{
let result: _.LoDashExplicitWrapper<boolean>;
result = _(1).chain().isPlainObject();
result = _<any>([]).chain().isPlainObject();
result = _({}).chain().isPlainObject();
}
}
// _.isRegExp
module TestIsRegExp {
+7
View File
@@ -10755,6 +10755,13 @@ declare module _ {
isPlainObject(): boolean;
}
interface LoDashExplicitWrapperBase<T, TWrapper> {
/**
* see _.isPlainObject
*/
isPlainObject(): LoDashExplicitWrapper<boolean>;
}
//_.isRegExp
interface LoDashStatic {
/**
+96
View File
@@ -0,0 +1,96 @@
/// <reference path="osmtogeojson.d.ts" />
/// <reference path="../xmldom/xmldom.d.ts" />
import osmtogeojson from 'osmtogeojson';
import {OsmJSON, GeoJSON} from 'osmtogeojson';
import * as xmldom from 'xmldom';
let xml: Document = (new xmldom.DOMParser()).parseFromString("<osm><node id='1' lat='1.234' lon='4.321' /></osm>", 'text/xml');
let geojson: GeoJSON.FeatureCollection = {
type: "FeatureCollection",
features: [
{
type: "Feature",
id: "node/1",
properties: {
type: "node",
id: 1,
tags: {},
relations: [],
meta: {}
},
geometry: {
type: "Point",
coordinates: [4.321, 1.234]
}
}
]
};
osmtogeojson.toGeojson(xml);
osmtogeojson(xml, {
flatProperties: true,
uninterestingTags: {foo:true}
});
let json: OsmJSON.Root = {
elements: [
{
type: "node",
id: 1,
lat: 1.234,
lon: 4.321,
timestamp: "2013-01-13T22:56:07Z",
version: 7,
changeset: 1234,
user: "johndoe",
uid: 666
},
{
type: "relation",
tags: {"type": "multipolygon"},
id: 1,
members: [
{
type: "way",
ref: 2,
role: "outer"
},
{
type: "way",
ref: 3,
role: "outer"
}
]
},
{
type: "way",
id: 2,
nodes: [4,5,6,4]
},
{
type: "node",
id: 4,
lat: 0.0,
lon: 0.0
},
{
type: "node",
id: 5,
lat: 0.0,
lon: 1.0
},
{
type: "node",
id: 6,
lat: 1.0,
lon: 0.0
}
]
};
osmtogeojson.toGeojson(json);
osmtogeojson(json, {
flatProperties: true,
uninterestingTags: {foo:true}
});
+96
View File
@@ -0,0 +1,96 @@
// Type definitions for osmtogeojson 2.2.5
// Project: https://github.com/tyrasd/osmtogeojson.git
// Definitions by: Qubo <https://github.com/tkqubo>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "osmtogeojson" {
export interface OsmToGeoJSON {
(data: Document|OsmJSON.Root, options?: Options): GeoJSON.GeoJSONObject;
toGeojson(data: Document|OsmJSON.Root, options?: Options): GeoJSON.GeoJSONObject;
}
export interface Options {
verbose?: boolean;
/**
* If true, the resulting GeoJSON feature's properties will be a simple key-value list instead of a structured json object (with separate tags and metadata). default: false
*/
flatProperties?: boolean;
/**
* Either a blacklist of tag keys or a callback function. Will be used to decide if a feature is interesting enough for its own GeoJSON feature.
*/
uninterestingTags?: { [tag: string]: boolean; }|Function; //TODO: type function
/**
* Either a json object or callback function that is used to determine if a closed way should be treated as a Polygon or LineString.
*/
polygonFeatures?: any|Function; //TODO: type this
}
export namespace GeoJSON {
export interface GeoJSONObject {
type: string;
}
export interface Feature extends GeoJSONObject {
id?: string;
geometry: Geometry;
properties: any; //TODO: type this
}
export interface FeatureCollection extends GeoJSONObject {
features: Feature[];
}
export interface Geometry extends GeoJSONObject {
coordinates: Coordinate|Coordinate[]|Coordinate[][];
}
export interface GeometryCollection extends GeoJSONObject {
geometries: Geometry[];
}
export type Coordinate2d = [number, number];
export type Coordinate3d = [number, number, number];
export type Coordinate = Coordinate2d|Coordinate3d;
}
export namespace OsmJSON {
export interface Root {
elements: (Node|Way|Relationship)[];
}
export interface OsmJSONObject {
type: string;
id: number;
tags?: { [name: string]: string; }
timestamp?: string;
version?: number;
changeset?: number;
user?: string;
uid?: number;
}
export interface Node extends OsmJSONObject {
lat: number;
lon: number;
}
export interface Way extends OsmJSONObject {
nodes: number[];
}
export interface Relationship extends OsmJSONObject {
members: Member[];
}
export interface Member {
type: string;
ref: number;
role: string;
}
}
var osmtogeojson: OsmToGeoJSON;
export default osmtogeojson;
}
+1
View File
@@ -251,6 +251,7 @@ declare module "restify" {
interface Next {
(err?: any): any;
ifError: (err?: any) => any;
}
interface RequestHandler {
+9
View File
@@ -0,0 +1,9 @@
/// <reference path="ui-select.d.ts" />
angular
.module('main', ['ui-select'])
.config(function(uiSelectConfig: angular.ui.select.ISelectConfig) {
uiSelectConfig.appendToBody = true;
uiSelectConfig.resetSearchInput = true;
uiSelectConfig.theme = "bootstrap";
});
+19
View File
@@ -0,0 +1,19 @@
// Type definitions for ui-select 0.13.2
// Project: https://github.com/angular-ui/ui-select
// Definitions by: Niko Kovačič <https://github.com/nkovacic>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
declare module "ui-select" {
var _: string;
export = _;
}
declare module angular.ui.select {
interface ISelectConfig {
appendToBody: boolean;
resetSearchInput: boolean;
theme: string;
}
}