Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

copy DefinitelyTyped definitions to our repo #2141

Merged
merged 13 commits into from
Mar 9, 2016
10 changes: 4 additions & 6 deletions src/adhocracy_frontend/adhocracy_frontend/static/js/Adhocracy.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
/// <reference path="../lib/DefinitelyTyped/requirejs/require.d.ts"/>
/// <reference path="../lib/DefinitelyTyped/angularjs/angular.d.ts"/>
/// <reference path="../lib/DefinitelyTyped/lodash/lodash.d.ts"/>
/// <reference path="../lib/DefinitelyTyped/modernizr/modernizr.d.ts"/>
/// <reference path="../lib/DefinitelyTyped/moment/moment.d.ts"/>
/// <reference path="../lib/DefinitelyTyped/leaflet/leaflet.d.ts"/>
/// <reference path="../lib2/types/angular.d.ts"/>
/// <reference path="../lib2/types/lodash.d.ts"/>
/// <reference path="../lib2/types/moment.d.ts"/>
/// <reference path="../lib2/types/leaflet.d.ts"/>
/// <reference path="./_all.d.ts"/>

import * as angular from "angular";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="../lib/DefinitelyTyped/jasmine/jasmine.d.ts"/>
/// <reference path="../lib2/types/jasmine.d.ts"/>
/// <reference path="_all.d.ts"/>

import * as _ from "lodash";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="../lib/DefinitelyTyped/jasmine/jasmine.d.ts"/>
/// <reference path="../lib2/types/jasmine.d.ts"/>
/// <reference path="_all.d.ts"/>

import * as JasmineHelpers from "./JasmineHelpers";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="../../../lib/DefinitelyTyped/angularjs/angular.d.ts"/>
/// <reference path="../../../lib2/types/angular.d.ts"/>
/// <reference path="../../_all.d.ts"/>

import * as _ from "lodash";
Expand Down Expand Up @@ -244,7 +244,7 @@ export var getFirstFormError = (form, element) => {
};

var errorControllers = getErrorControllers(form);
var names = _.unique(_.map(errorControllers, "$name"));
var names = _.uniq(_.map(errorControllers, "$name"));
var selector = _.map(names, (name) => "[name=\"" + name + "\"]").join(", ");

return element.find(selector).first();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="../../../lib/DefinitelyTyped/jasmine/jasmine.d.ts"/>
/// <reference path="../../../lib2/types/jasmine.d.ts"/>

import * as AdhAngularHelpers from "./AngularHelpers";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="../../../lib/DefinitelyTyped/angularjs/angular.d.ts"/>
/// <reference path="../../../lib2/types/angular.d.ts"/>

import * as _ from "lodash";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ export var adhCreateOrShowCommentListing = (
"content_type": RIExternalResource.content_type
}).then(
(result) => {
if (_.contains(result.data[SIPool.nick].elements, commentablePath)) {
if (_.includes(result.data[SIPool.nick].elements, commentablePath)) {
setScope(commentablePath);
} else {
var unwatch = scope.$watch(() => adhCredentials.loggedIn, (loggedIn) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="../../../lib/DefinitelyTyped/jasmine/jasmine.d.ts"/>
/// <reference path="../../../lib2/types/jasmine.d.ts"/>

import * as AdhComment from "./Comment";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export class Service implements IService {
private sendAuthMessages() {
var _self : Service = this;

return typeof _self.adhUser !== "undefined" && _.contains(_self.trustedDomains, _self.embedderOrigin);
return typeof _self.adhUser !== "undefined" && _.includes(_self.trustedDomains, _self.embedderOrigin);
}

private sendLoginState(loggedIn) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="../../../lib/DefinitelyTyped/jasmine/jasmine.d.ts"/>
/// <reference path="../../../lib2/types/jasmine.d.ts"/>

import * as q from "q";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// <reference path="../../../lib/DefinitelyTyped/angularjs/angular.d.ts"/>
/// <reference path="../../../lib/DefinitelyTyped/moment/moment.d.ts"/>
/// <reference path="../../../lib2/types/angular.d.ts"/>
/// <reference path="../../../lib2/types/moment.d.ts"/>

import * as AdhConfig from "../Config/Config";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="../../../lib/DefinitelyTyped/jasmine/jasmine.d.ts"/>
/// <reference path="../../../lib2/types/jasmine.d.ts"/>

import * as AdhDateTime from "./DateTime";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="../../../lib/DefinitelyTyped/angularjs/angular.d.ts"/>
/// <reference path="../../../lib2/types/angular.d.ts"/>

import * as AdhConfig from "../Config/Config";
import * as AdhHttp from "../Http/Http";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export var bindPath = (
title: documentVersion.data[SITitle.nick].title,
paragraphs: paragraphs,
// FIXME: DefinitelyTyped
commentCountTotal: (<any>_).sum(_.map(paragraphs, "commentCount")),
commentCountTotal: (<any>_).sumBy(paragraphs, "commentCount"),
modificationDate: documentVersion.data[SIMetadata.nick].modification_date,
creationDate: documentVersion.data[SIMetadata.nick].creation_date,
creator: documentVersion.data[SIMetadata.nick].creator,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="../../../lib/DefinitelyTyped/angularjs/angular.d.ts"/>
/// <reference path="../../../lib2/types/angular.d.ts"/>

import * as AdhConfig from "../Config/Config";
import * as AdhTopLevelState from "../TopLevelState/TopLevelState";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="../../../lib/DefinitelyTyped/jasmine/jasmine.d.ts"/>
/// <reference path="../../../lib2/types/jasmine.d.ts"/>

import * as AdhEmbed from "./Embed";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="../../../lib/DefinitelyTyped/jasmine/jasmine.d.ts"/>
/// <reference path="../../../lib2/types/jasmine.d.ts"/>

import * as AdhEventManager from "./EventManager";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference path="../../../lib/DefinitelyTyped/requirejs/require.d.ts"/>
/// <reference path="../../../lib/DefinitelyTyped/lodash/lodash.d.ts"/>
/// <reference path="../../../lib2/types/lodash.d.ts"/>

import * as _ from "lodash";

Expand Down Expand Up @@ -102,7 +101,7 @@ export class Service {
var cached = this.cache.get(path);
if (typeof cached === "undefined") {
var wsOff : () => void;
if (!_.contains(this.nonResourceUrls, path)) {
if (!_.includes(this.nonResourceUrls, path)) {
wsOff = this.adhWebSocket.register(path, (msg) => {
this.invalidate(path);
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="../../../lib/DefinitelyTyped/lodash/lodash.d.ts"/>
/// <reference path="../../../lib2/types/lodash.d.ts"/>

import * as _ from "lodash";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="../../../lib/DefinitelyTyped/angularjs/angular.d.ts"/>
/// <reference path="../../../lib2/types/angular.d.ts"/>

// Error responses in the Adhocracy REST API contain json objects in
// the body that have the following form:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/// <reference path="../../../lib/DefinitelyTyped/requirejs/require.d.ts"/>
/// <reference path="../../../lib/DefinitelyTyped/jquery/jquery.d.ts"/>
/// <reference path="../../../lib/DefinitelyTyped/angularjs/angular.d.ts"/>
/// <reference path="../../../lib/DefinitelyTyped/lodash/lodash.d.ts"/>
/// <reference path="../../../lib2/types/jquery.d.ts"/>
/// <reference path="../../../lib2/types/angular.d.ts"/>
/// <reference path="../../../lib2/types/lodash.d.ts"/>

import * as _ from "lodash";

Expand Down Expand Up @@ -149,7 +148,7 @@ export class Service<Content extends ResourcesBase.Resource> {
canPost: (contentType : string) => {
if (raw.data.POST) {
var postOptions = raw.data.POST.request_body;
return _.any(postOptions, { "content_type": contentType });
return _.some(postOptions, { "content_type": contentType });
} else {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="../../../lib/DefinitelyTyped/jasmine/jasmine.d.ts"/>
/// <reference path="../../../lib2/types/jasmine.d.ts"/>

import * as q from "q";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="../../../lib/DefinitelyTyped/jasmine/jasmine.d.ts"/>
/// <reference path="../../../lib2/types/jasmine.d.ts"/>

import * as AdhMetaApi from "./MetaApi";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="../../../lib/DefinitelyTyped/lodash/lodash.d.ts"/>
/// <reference path="../../../lib2/types/lodash.d.ts"/>

import * as _ from "lodash";

Expand Down Expand Up @@ -118,7 +118,7 @@ export class Transaction {
(response) => {
var imported = AdhConvert.importBatchContent(
response.data.responses, this.adhMetaApi, this.adhPreliminaryNames, this.adhCache);
_self.adhCache.invalidateUpdated(response.data.updated_resources, _.pluck(imported, "path"));
_self.adhCache.invalidateUpdated(response.data.updated_resources, <string[]>_.map(imported, "path"));
return imported;
},
AdhError.logBackendBatchError);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/// <reference path="../../../lib/DefinitelyTyped/requirejs/require.d.ts"/>
/// <reference path="../../../lib/DefinitelyTyped/angularjs/angular.d.ts"/>
/// <reference path="../../../lib/DefinitelyTyped/lodash/lodash.d.ts"/>
/// <reference path="../../../lib2/types/angular.d.ts"/>
/// <reference path="../../../lib2/types/lodash.d.ts"/>
/// <reference path="../../_all.d.ts"/>

import * as _ from "lodash";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="../../../lib/DefinitelyTyped/jasmine/jasmine.d.ts"/>
/// <reference path="../../../lib2/types/jasmine.d.ts"/>
/// <reference path="../../_all.d.ts"/>

import * as q from "q";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="../../../lib/DefinitelyTyped/jasmine/jasmine.d.ts"/>
/// <reference path="../../../lib2/types/jasmine.d.ts"/>

import * as AdhWebSocket from "./LocalSocket";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <reference path="../../../lib/DefinitelyTyped/jasmine/jasmine.d.ts"/>
// <reference path="../../../lib2/types/jasmine.d.ts"/>

import * as AdhLocale from "./Locale";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// <reference path="../../../lib/DefinitelyTyped/angularjs/angular.d.ts"/>
/// <reference path="../../../lib/DefinitelyTyped/leaflet/leaflet.d.ts"/>
/// <reference path="../../../lib2/types/angular.d.ts"/>
/// <reference path="../../../lib2/types/leaflet.d.ts"/>

import * as _ from "lodash";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="../../../lib/DefinitelyTyped/jasmine/jasmine.d.ts"/>
/// <reference path="../../../lib2/types/jasmine.d.ts"/>

import * as AdhMapping from "./Mapping";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="../../../lib/DefinitelyTyped/leaflet/leaflet.d.ts"/>
/// <reference path="../../../lib2/types/leaflet.d.ts"/>

// code comes from https://github.com/substack/point-in-polygon/blob/master/index.js
export var pointInPolygon = (point : L.LatLng, polygon : L.Polygon) : Boolean => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="../../../lib/DefinitelyTyped/angularjs/angular.d.ts"/>
/// <reference path="../../../lib2/types/angular.d.ts"/>

import * as AdhConfig from "../Config/Config";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="../../../lib/DefinitelyTyped/jasmine/jasmine.d.ts"/>
/// <reference path="../../../lib2/types/jasmine.d.ts"/>

import * as AdhMarkdown from "./Markdown";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="../../../lib/DefinitelyTyped/jasmine/jasmine.d.ts"/>
/// <reference path="../../../lib2/types/jasmine.d.ts"/>

import * as AdhMovingColumns from "./MovingColumns";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="../../../lib/DefinitelyTyped/angularjs/angular.d.ts"/>
/// <reference path="../../../lib2/types/angular.d.ts"/>

import * as AdhCredentials from "../User/Credentials";
import * as AdhHttp from "../Http/Http";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="../../../lib/DefinitelyTyped/jasmine/jasmine.d.ts"/>
/// <reference path="../../../lib2/types/jasmine.d.ts"/>

import * as AdhPermissions from "./Permissions";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="../../../lib/DefinitelyTyped/jasmine/jasmine.d.ts"/>
/// <reference path="../../../lib2/types/jasmine.d.ts"/>

import * as AdhPreliminaryNames from "./PreliminaryNames";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="../../../lib/DefinitelyTyped/angularjs/angular.d.ts"/>
/// <reference path="../../../lib2/types/angular.d.ts"/>

import * as AdhConfig from "../Config/Config";
import * as AdhHttp from "../Http/Http";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="../../../lib/DefinitelyTyped/jasmine/jasmine.d.ts"/>
/// <reference path="../../../lib2/types/jasmine.d.ts"/>

import * as AdhProcess from "./Process";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="../../../lib/DefinitelyTyped/jasmine/jasmine.d.ts"/>
/// <reference path="../../../lib2/types/jasmine.d.ts"/>

import * as q from "q";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ export class Service implements AdhTopLevelState.IAreaInput {

return {
path: path,
search: _.transform(data, (result, value : string, key : string) => {
search: <Dict>_.transform(data, (result, value : string, key : string) => {
if (defaults.hasOwnProperty(key) && value !== defaults[key]) {
result[key] = value;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="../../../lib/DefinitelyTyped/jasmine/jasmine.d.ts"/>
/// <reference path="../../../lib2/types/jasmine.d.ts"/>

import * as q from "q";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="../../../lib/DefinitelyTyped/jasmine/jasmine.d.ts"/>
/// <reference path="../../../lib2/types/jasmine.d.ts"/>

import * as q from "q";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="../../../lib/DefinitelyTyped/angularjs/angular.d.ts"/>
/// <reference path="../../../lib2/types/angular.d.ts"/>

import * as _ from "lodash";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="../../../lib/DefinitelyTyped/jasmine/jasmine.d.ts"/>
/// <reference path="../../../lib2/types/jasmine.d.ts"/>

import * as q from "q";
import * as _ from "lodash";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="../../../lib/DefinitelyTyped/angularjs/angular.d.ts"/>
/// <reference path="../../../lib2/types/angular.d.ts"/>

import * as AdhConfig from "../Config/Config";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="../../../lib/DefinitelyTyped/jasmine/jasmine.d.ts"/>
/// <reference path="../../../lib2/types/jasmine.d.ts"/>

// import * as Tracking from "./Tracking";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="../../../lib/DefinitelyTyped/angularjs/angular.d.ts"/>
/// <reference path="../../../lib2/types/angular.d.ts"/>

import * as AdhCache from "../Http/Cache";
import * as AdhConfig from "../Config/Config";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="../../../lib/DefinitelyTyped/angularjs/angular.d.ts"/>
/// <reference path="../../../lib2/types/angular.d.ts"/>

import * as AdhHttp from "../Http/Http";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="../../../lib/DefinitelyTyped/jasmine/jasmine.d.ts"/>
/// <reference path="../../../lib2/types/jasmine.d.ts"/>

import * as q from "q";
import * as _ from "lodash";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="../../../lib/DefinitelyTyped/angularjs/angular.d.ts"/>
/// <reference path="../../../lib2/types/angular.d.ts"/>

import * as AdhBadge from "../Badge/Badge";
import * as AdhConfig from "../Config/Config";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="../../../lib/DefinitelyTyped/jasmine/jasmine.d.ts"/>
/// <reference path="../../../lib2/types/jasmine.d.ts"/>

import * as q from "q";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export function sortResourcesTopologically(resources : ResourcesBase.Resource[],
// prepare DAG
// sources are resource paths without incoming references
// FIXME: DefinitelyTyped
var dag : AdhUtil.IDag<ResourcesBase.Resource> = (<any>_).object(_.map(resources, (resource) => [resource.path, {
var dag : AdhUtil.IDag<ResourcesBase.Resource> = (<any>_).fromPairs(_.map(resources, (resource) => [resource.path, {
content: resource, incoming: [], outgoing: [], done: false
}]));
var sources : string[] = [];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="../../../lib/DefinitelyTyped/jasmine/jasmine.d.ts"/>
/// <reference path="../../../lib2/types/jasmine.d.ts"/>

import * as AdhResourceUtil from "./ResourceUtil";

Expand Down
Loading