diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 7b6be179f..639cf8364 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -6837,10 +6837,24 @@ module TestIsObject { } // _.isPlainObject -result = _.isPlainObject(any); -result = _(1).isPlainObject(); -result = _([]).isPlainObject(); -result = _({}).isPlainObject(); +module TestIsPlainObject { + { + let result: boolean; + + result = _.isPlainObject(any); + result = _(1).isPlainObject(); + result = _([]).isPlainObject(); + result = _({}).isPlainObject(); + } + + { + let result: _.LoDashExplicitWrapper; + + result = _(1).chain().isPlainObject(); + result = _([]).chain().isPlainObject(); + result = _({}).chain().isPlainObject(); + } +} // _.isRegExp module TestIsRegExp { diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 9cd18ba01..f8d42c958 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -10755,6 +10755,13 @@ declare module _ { isPlainObject(): boolean; } + interface LoDashExplicitWrapperBase { + /** + * see _.isPlainObject + */ + isPlainObject(): LoDashExplicitWrapper; + } + //_.isRegExp interface LoDashStatic { /** diff --git a/osmtogeojson/osmtogeojson-tests.ts b/osmtogeojson/osmtogeojson-tests.ts new file mode 100644 index 000000000..a4debe4c1 --- /dev/null +++ b/osmtogeojson/osmtogeojson-tests.ts @@ -0,0 +1,96 @@ +/// +/// + +import osmtogeojson from 'osmtogeojson'; +import {OsmJSON, GeoJSON} from 'osmtogeojson'; +import * as xmldom from 'xmldom'; + +let xml: Document = (new xmldom.DOMParser()).parseFromString("", '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} +}); diff --git a/osmtogeojson/osmtogeojson.d.ts b/osmtogeojson/osmtogeojson.d.ts new file mode 100644 index 000000000..0edee3509 --- /dev/null +++ b/osmtogeojson/osmtogeojson.d.ts @@ -0,0 +1,96 @@ +// Type definitions for osmtogeojson 2.2.5 +// Project: https://github.com/tyrasd/osmtogeojson.git +// Definitions by: Qubo +// 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; +} + diff --git a/restify/restify.d.ts b/restify/restify.d.ts index 826b2ca43..1464176eb 100644 --- a/restify/restify.d.ts +++ b/restify/restify.d.ts @@ -251,6 +251,7 @@ declare module "restify" { interface Next { (err?: any): any; + ifError: (err?: any) => any; } interface RequestHandler { diff --git a/ui-select/ui-select-tests.ts b/ui-select/ui-select-tests.ts new file mode 100644 index 000000000..e0017576f --- /dev/null +++ b/ui-select/ui-select-tests.ts @@ -0,0 +1,9 @@ +/// + +angular + .module('main', ['ui-select']) + .config(function(uiSelectConfig: angular.ui.select.ISelectConfig) { + uiSelectConfig.appendToBody = true; + uiSelectConfig.resetSearchInput = true; + uiSelectConfig.theme = "bootstrap"; + }); \ No newline at end of file diff --git a/ui-select/ui-select.d.ts b/ui-select/ui-select.d.ts new file mode 100644 index 000000000..e223b947e --- /dev/null +++ b/ui-select/ui-select.d.ts @@ -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č +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "ui-select" { + var _: string; + export = _; +} + +declare module angular.ui.select { + interface ISelectConfig { + appendToBody: boolean; + resetSearchInput: boolean; + theme: string; + } +}