Merge branch 'master' into mithril-1.1

This commit is contained in:
spacejack
2017-03-29 20:48:56 -04:00
458 changed files with 11144 additions and 12233 deletions
+2 -4
View File
@@ -1,19 +1,17 @@
Please fill in this template.
- [ ] Make your PR against the `master` branch.
- [ ] Use a meaningful title for the pull request. Include the name of the package modified.
- [ ] Test the change in your own code. (Compile and run.)
- [ ] Follow the advice from the [readme](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#make-a-pull-request).
- [ ] Avoid [common mistakes](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#common-mistakes).
- [ ] Run `tsc` without errors.
- [ ] Run `npm run lint package-name` if a `tslint.json` is present.
- [ ] Run `npm run lint package-name` (or `tsc` if no `tslint.json` is present).
Select one of these and delete the others:
If adding a new definition:
- [ ] The package does not provide its own types, and you can not add them.
- [ ] If this is for an NPM package, match the name. If not, do not conflict with the name of an NPM package.
- [ ] Create it with `npm run new-package package-name`, not by basing it on an existing project.
- [ ] Create it with `dts-gen --dt`, not by basing it on an existing project.
- [ ] `tslint.json` should be present, and `tsconfig.json` should have `noImplicitAny`, `noImplicitThis`, and `strictNullChecks` set to `true`.
If changing an existing definition:
+6 -5
View File
@@ -110,9 +110,8 @@ Your package should have this structure:
| tsconfig.json | This allows you to run `tsc` within the package. |
| tslint.json | Enables linting. |
Generate these by running `npm run new-package -- --name my-package-name --template module`.
(Other templates are `module-class`, `module-function`, `module-plugin`, `global`, `global-plugin`, and `global-modifying-module`.
This just wraps [dts-gen](https://github.com/Microsoft/dts-gen), so it supports all options from that.)
Generate these by running `npm install -g dts-gen` and `dts-gen --dt --name my-package-name --template module`.
See all options at [dts-gen](https://github.com/Microsoft/dts-gen).
You may edit the `tsconfig.json` to add new files, to add `"target": "es6"` (needed for async functions), to add to `"lib"`, or to add the `"jsx"` compiler option.
@@ -167,9 +166,11 @@ If a `tslint.json` turns rules off, this is because that hasn't been fixed yet.
}
```
(To indicate that a lint rule truly does not apply, use `// tslint:disable:rule-name` or better, `//tslint:disable-next-line:rule-name`.)
(To indicate that a lint rule truly does not apply, use `// tslint:disable rule-name` or better, `//tslint:disable-next-line rule-name`.)
Test by running `npm run lint package-name` where `package-name` is the name of your package.
This script uses [dtslint](https://github.com/Microsoft/dtslint).
Test the linter by running `npm run lint -- package-name`. Do not use a globally installed tslint.
## FAQ
+4 -5
View File
@@ -16,13 +16,12 @@
},
"scripts": {
"compile-scripts": "tsc -p scripts",
"new-package": "dts-gen --dt",
"not-needed": "node scripts/not-needed.js",
"lint": "node scripts/lint.js",
"test": "node node_modules/types-publisher/bin/tester/test.js --run-from-definitely-typed --nProcesses 1"
"test": "node node_modules/types-publisher/bin/tester/test.js --run-from-definitely-typed --nProcesses 1",
"lint": "dtslint --dt types"
},
"devDependencies": {
"types-publisher": "Microsoft/types-publisher#production",
"dts-gen": "latest"
"dtslint": "Microsoft/dtslint#production",
"types-publisher": "Microsoft/types-publisher#production"
}
}
-314
View File
@@ -1,314 +0,0 @@
// Type definitions for React OnSenui (react-onsenui) 2.1
// Project: https://onsen.io/v2/docs/guide/react/
// Definitions by: Ozytis <https://ozytis.fr>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
import { Component } from 'react';
declare interface Modifiers_string {
default?: string,
material?: string
}
declare interface Modifiers_number {
default?: number,
material?: number
}
declare interface AnimationOptions {
duration?: number,
delay?: number,
timing?: string
}
/*** splitter ***/
declare class SplitterSide extends Component<{
side?: "left" | "right",
collapse?: "portrait" | "landscape" | boolean,
isOpen?: boolean,
onOpen?: (e?: Event) => void,
onPreOpen?: (e?: Event) => void,
onPreClose?: (e?: Event) => void,
onModeChange?: (e?: Event) => void,
onClose?: (e?: Event) => void,
isSwipeable?: boolean,
swipeTargetWidth?: number,
width?: number,
animation?: "overlay" | "default"
animationOptions?: AnimationOptions,
openThreshold?: number,
mode?: "collapse" | "split"
}, any>{ }
declare class SplitterContent extends Component<{}, any> { }
declare class Splitter extends Component<{}, any> { }
/*** toolbar ***/
declare class Toolbar extends Component<{}, any>{}
declare class BottomToolbar extends Component<{
modifier?: string
}, any>{}
declare class ToolbarButton extends Component<{
modifier?: string,
disabled?: boolean,
onClick?: (e?: Event) => void
}, any>{}
/*** icon ***/
declare class Icon extends Component<{
modifier?: string,
icon?: string | Modifiers_string,
size?: number | Modifiers_number,
rotate?: 90 | 180 | 270,
fixedWidth?: boolean,
spin?: boolean
}, any>{}
/*** page ***/
declare class Page extends Component<{
contentStyle?: any,
modifier?: string,
renderModal?: () => void,
renderToolbar?: () => void,
renderBottomToolbar?: () => void,
renderFixed?: () => void,
onInit?: () => void,
onShow?: () => void,
onHide?: () => void
}, any>{}
/*** Grid ***/
declare class Col extends Component<{
verticalAlign?: "top" | "bottom" | "center",
width?: string
}, any>{}
declare class Row extends Component<{
verticalAlign?: "top" | "bottom" | "center",
}, any>{}
/*** Navigation ***/
declare class BackButton extends Component<{
modifier?: string,
onClick?: (navigator: Navigator) => void
}, any>{}
declare class Navigator extends Component<{
renderPage: () => any,
initialRouteStack?: string[],
initialRoute?: any,
onPrePush?: () => void,
onPostPush?: () => void,
onPrePop?: () => void,
onPostPop?: () => void,
animation?: "slide" | "lift" | "fade" | "none" | string,
animationOptions?: AnimationOptions
}, any>{
resetPage(route: any, options: any): void;
resetPageStack(route: any, options: any): void;
pushPage(route: any, options: any): void;
popPage(route: any, options: any): void;
}
/*** Carousel ***/
declare class Carousel extends Component<{
direction?: "horizontal" | "vertical",
fullscreen?: boolean,
overscrollable?: boolean,
centered?: boolean,
itemWidth?: number,
itemHeight?: number,
autoScroll?: boolean,
autoScrollRatio?: number,
swipeable?: boolean,
disabled?: boolean,
index?: number,
autoRefresh?: boolean,
onPostChange?: () => void,
onRefresh?: () => void,
onOverscroll?: () => void
animationOptions?: AnimationOptions
}, any>{}
declare class CarouselItem extends Component<{
modifier: string
}, any>{}
/*** AlertDialog ***/
declare class AlertDialog extends Component<{
onCancel?: () => void,
isOpen?: boolean,
isCancelable?: boolean,
isDisabled?: boolean,
animation?: "none" | "default",
modifier?: string,
maskColor?: string,
animationOptions?: AnimationOptions,
onPreShow?: () => void,
onPostShow?: () => void,
onPreHide?: () => void,
onPostHide?: () => void,
}, any>{}
declare class Dialog extends Component<{
onCancel?: () => void,
isOpen?: boolean,
isCancelable?: boolean,
isDisabled?: boolean,
animation?: "none" | "default",
modifier?: string,
maskColor?: string,
animationOptions?: AnimationOptions,
onPreShow?: () => void,
onPostShow?: () => void,
onPreHide?: () => void,
onPostHide?: () => void,
}, any>{}
declare class Modal extends Component<{
animation?: "fade" | "none",
animationOptions?: AnimationOptions
onShow?: () => void,
onHide?: () => void,
isOpen?: boolean
}, any>{}
declare class Popover extends Component<{
getTarget?: () => Component<any, any> | HTMLElement,
onCancel?: () => void,
isOpen?: boolean,
isCancelable?: boolean,
isDisabled?: boolean,
animation?: "none" | "default",
modifier?: string,
maskColor?: string,
animationOptions?: AnimationOptions,
onPreShow?: () => void,
onPostShow?: () => void,
onPreHide?: () => void,
onPostHide?: () => void,
}, any>{}
declare class ProgressBar extends Component<{
modifier?: string,
value?: number,
secondaryValue?: boolean,
intermediate?: boolean,
}, any> {}
declare class ProgressCircular extends Component<{
modifier?: string,
value?: number,
secondaryValue?: boolean,
intermediate?: boolean,
}, any>{}
declare class Ripple extends Component<{
color?: string,
background?: string,
disabled?: boolean,
}, any>{}
/*** Forms ***/
declare class Fab extends Component<{
modifier?: string,
ripple?: boolean,
position?: string,
disabled?: boolean,
onClick?: () => void,
}, any>{}
declare class Button extends Component<{
modifier?: string,
disabled?: boolean,
ripple?: boolean,
onClick?: (e?: Event) => void
}, any>{}
declare class Input extends Component<{
modifier?: string,
disabled?: boolean,
onChange?: (e: Event) => void,
value?: string,
checked?: boolean,
placehoder?: string,
type?: string,
inputId?: string,
float?: boolean,
}, any> {}
declare class Range extends Component<{
modifier?: string,
onChange?: (e: Event) => void,
value?: number,
disabled?: boolean,
}, any>{}
declare class Switch extends Component<{
onChange?: (e: Event) => void,
checked?: boolean,
disabled?: boolean,
inputId?: string
}, any>{}
/**
* Tabs
*/
declare class Tab extends Component<{}, any>{ }
declare class TabActive extends Component<{}, any>{ }
declare class TabInactive extends Component<{}, any>{ }
declare class Tabbar extends Component<{
index?: number,
renderTabs?: () => any,
position?: "bottom" | "top" | "auto",
animation: "none" | "slide" | "fade",
animationOptions?: AnimationOptions,
onPreChange?: () => void,
onPostChange?: () => void,
onReactive?: () => void,
}, any> { }
/**
* Lists
*/
declare class LazyList extends Component<{
modifier?: string,
length?: number,
renderRow: (rowIndex: number) => any,
calculateItemHeight: (rowIndex: number) => any,
}, any>{ }
declare class List extends Component<{
modifier?: string,
dataSource?: string[],
renderRow?: () => void,
renderHeader?: () => void,
renderFooter?: () => void,
}, any>{}
declare class ListHeader extends Component<{
modifier?: string,
}, any>{}
declare class ListItem extends Component<{
modifier?: string,
tappable?: boolean,
tapBackgroundColor?: string,
lockOnDrag?: boolean,
}, any>{}
-49
View File
@@ -1,49 +0,0 @@
import * as React from "react";
import * as ReactDOM from "react-dom";
import { SplitterSide, Splitter, SplitterContent, Page } from "react-onsenui";
class AppState {
isOpen: boolean = false;
}
interface AppProps {
}
export class App extends React.Component<AppProps, AppState>{
constructor(props?: AppProps) {
super(props);
this.state = new AppState();
}
hide() {
this.setState({ isOpen: false });
}
render() {
return (
<Splitter>
<SplitterSide
side='left'
collapse={true}
isOpen={this.state.isOpen}
onClose={() => this.hide()}
isSwipeable={true}>
<Page>
Menu content
</Page>
</SplitterSide>
<SplitterContent>
<Page>
Test page
</Page>
</SplitterContent>
</Splitter>
);
}
}
ReactDOM.render(<App />, document.getElementById('react-body'));
-25
View File
@@ -1,25 +0,0 @@
{
"compilerOptions": {
"sourceMap": true,
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"module": "commonjs",
"target": "es5",
"jsx": "react",
"experimentalDecorators": true,
"baseUrl": "../",
"typeRoots": [ "../" ],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"lib": [
"es6",
"dom"
],
"types": []
},
"files": [
"index.d.ts",
"react-onsenui-tests.tsx"
]
}
-25
View File
@@ -1,25 +0,0 @@
// Usage: npm run lint -- my-package-name
const pkg = process.argv[2];
const execSync = require("child_process").execSync;
const existsSync = require("fs").existsSync;
const path = require("path");
const pkgPath = path.join("types", pkg);
// Path of tslint when `types-publisher` is symlinked
const symlinkedTslintPath = "../../node_modules/types-publisher/node_modules/tslint"
let tslintPath = existsSync(path.join(pkgPath, symlinkedTslintPath)) ? symlinkedTslintPath : "../node_modules/tslint";
// An older version (e.g. abs/v0) is in a nested directory, so needs to look one more level up for tslint.
if (pkg.includes("/") && pkg[pkg.length - 1] !== "/") {
tslintPath = path.join("..", tslintPath);
}
const cmd = `node ${tslintPath}/lib/tslint-cli --format stylish "**/*.ts"`;
console.log(cmd);
try {
// Child process writes directly to our own stdout
execSync(cmd, { cwd: pkgPath, stdio: "inherit" });
} catch (_) {
// Process should have printed out error info
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"extends": "../tslint.json",
"rules": {
"forbidden-types": false
"ban-types": false
}
}
+5 -10
View File
@@ -16,7 +16,6 @@ amplify.subscribe("dataexample", data => {
alert(data.foo); // bar
});
amplify.publish("dataexample", { foo: "bar" });
amplify.subscribe("dataexample2", (param1, param2) => {
@@ -47,7 +46,6 @@ amplify.subscribe("priorityexample", data => {
}
}, 1);
// Store data with amplify storage picking the default storage technology:
amplify.publish("priorityexample", { foo: "bar" });
@@ -56,9 +54,9 @@ amplify.publish("priorityexample", { foo: "oops" });
amplify.store("storeExample1", { foo: "bar" });
amplify.store("storeExample2", "baz");
// retrieve the data later via the key
var myStoredValue = amplify.store("storeExample1"),
myStoredValue2 = amplify.store("storeExample2"),
myStoredValues = amplify.store();
const myStoredValue = amplify.store("storeExample1");
let myStoredValue2 = amplify.store("storeExample2");
const myStoredValues = amplify.store();
myStoredValue.foo; // bar
myStoredValue2; // baz
myStoredValues.storeExample1.foo; // bar
@@ -68,15 +66,13 @@ myStoredValues.storeExample2; // baz
amplify.store.sessionStorage("explicitExample", { foo2: "baz" });
// retrieve the data later via the key
var myStoredValue2 = amplify.store.sessionStorage("explicitExample");
myStoredValue2 = amplify.store.sessionStorage("explicitExample");
myStoredValue2.foo2; // baz
// REQUEST
// Set up and use a request utilizing Ajax
amplify.request.define("ajaxExample1", "ajax", {
url: "/myApiUrl",
dataType: "json",
@@ -175,7 +171,7 @@ amplify.request("twitter-mentions", { user: "amplifyjs" });
// Example:
var appEnvelopeDecoder: amplify.Decoder = (data, status, xhr, success, error) => {
const appEnvelopeDecoder: amplify.Decoder = (data, status, xhr, success, error) => {
if (data.status === "success") {
success(data.data);
} else if (data.status === "fail" || data.status === "error") {
@@ -197,7 +193,6 @@ amplify.request.decoders.appEnvelope = appEnvelopeDecoder;
// but you can also just add it via an index
amplify.request.decoders['appEnvelopeStr'] = appEnvelopeDecoder;
amplify.request.define("decoderExample", "ajax", {
url: "/myAjaxUrl",
type: "POST",
+2 -2
View File
@@ -9,8 +9,8 @@ declare namespace amplify {
interface RequestSettings {
resourceId: string;
data?: any;
success?: (...args: any[]) => void;
error?: (...args: any[]) => void;
success?(...args: any[]): void;
error?(...args: any[]): void;
}
type Decoder =
+1 -1
View File
@@ -1,7 +1,7 @@
{
"extends": "../tslint.json",
"rules": {
"forbidden-types": false,
"ban-types": false,
"unified-signatures": false
}
}
@@ -3,11 +3,10 @@ import * as angular from "angular";
import gridster from "angular-gridster";
var myApp = angular.module("testModule", ["gridster"]);
const myApp = angular.module("testModule", ["gridster"]);
// configure gridster's global options
myApp.run(["gridsterConfig", (gridsterConfig: angular.gridster.GridsterConfig) => {
gridsterConfig.mobileBreakPoint = 697;
gridsterConfig.colWidth = "100";
gridsterConfig.rowHeight = "100";
@@ -24,4 +23,4 @@ myApp.run(["gridsterConfig", (gridsterConfig: angular.gridster.GridsterConfig) =
gridsterConfig.resizable = { enabled: true,
handles: ["n", "s", "e", "w", "ne", "se", "sw", "nw"]};
}
]);
]);
+1 -1
View File
@@ -7,4 +7,4 @@ angular.module('angular-oauth2-test', ['angular-oauth2'])
clientId: 'CLIENT_ID',
clientSecret: 'CLIENT_SECRET' // optional
});
}]);
}]);
+50 -61
View File
@@ -62,7 +62,6 @@ angular.module('http-auth-interceptor', [])
* On 401 response - it stores the request and broadcasts 'event:angular-auth-loginRequired'.
*/
.config(['$httpProvider', 'authServiceProvider', ($httpProvider: ng.IHttpProvider, authServiceProvider: any) => {
$httpProvider.defaults.headers.common = {Authorization: 'Bearer token'};
$httpProvider.defaults.headers.get['Authorization'] = 'Bearer token';
$httpProvider.defaults.headers.post['Authorization'] = (config: ng.IRequestConfig) => 'Bearer token';
@@ -108,7 +107,7 @@ namespace HttpAndRegularPromiseTests {
$http.get<ExpectedResponse>('http://somewhere/some/resource')
.then((response: ng.IHttpPromiseCallbackArg<ExpectedResponse>) => {
// typing lost, so something like
// var i: number = response.data
// const i: number = response.data
// would type check
$scope.person = response.data;
});
@@ -116,7 +115,7 @@ namespace HttpAndRegularPromiseTests {
$http.get<ExpectedResponse>('http://somewhere/some/resource')
.then((response: ng.IHttpPromiseCallbackArg<ExpectedResponse>) => {
// typing lost, so something like
// var i: number = response.data
// const i: number = response.data
// would NOT type check
$scope.person = response.data;
});
@@ -153,7 +152,13 @@ namespace HttpAndRegularPromiseTests {
// Test for AngularJS Syntax
namespace My.Namespace {
export var x: any; // need to export something for module to kick in
export const x: any = null; // need to export something for module to kick in
}
class TestProvider implements ng.IServiceProvider {
constructor(private $scope: ng.IScope) {}
$get() {}
}
// IModule Registering Test
@@ -229,14 +234,6 @@ mod.value(My.Namespace);
mod.decorator('name', ($scope: ng.IScope) => {});
mod.decorator('name', ['$scope', ($scope: ng.IScope) => {}]);
class TestProvider implements ng.IServiceProvider {
constructor(private $scope: ng.IScope) {
}
$get() {
}
}
// QProvider tests
angular.module('qprovider-test', [])
.config(['$qProvider', ($qProvider: ng.IQProvider) => {
@@ -276,8 +273,8 @@ foo.then((x) => {
// Object is inferred here
x.a = 123;
// Try a promise
var y: ng.IPromise<number>;
var condition: boolean;
const y: ng.IPromise<number> = null;
const condition: boolean = null;
return condition ? y : x.a; // IPromise<T> | T, both are good for the 1st arg of .then()
}).then((x) => {
// x is infered to be a number, which is the resolved value of a promise
@@ -299,15 +296,15 @@ namespace TestQ {
g: string;
h: number;
}
var tResult: TResult;
var promiseTResult: angular.IPromise<TResult>;
var tValue: TValue;
var promiseTValue: angular.IPromise<TValue>;
var tOther: TOther;
var promiseTOther: angular.IPromise<TOther>;
const tResult: TResult = null;
const promiseTResult: angular.IPromise<TResult> = null;
const tValue: TValue = null;
const promiseTValue: angular.IPromise<TValue> = null;
const tOther: TOther = null;
const promiseTOther: angular.IPromise<TOther> = null;
var $q: angular.IQService;
var promiseAny: angular.IPromise<any>;
const $q: angular.IQService = null;
const promiseAny: angular.IPromise<any> = null;
const assertPromiseType = <T>(arg: angular.IPromise<T>) => arg;
@@ -346,7 +343,7 @@ namespace TestQ {
let result: angular.IDeferred<TResult>;
result = $q.defer<TResult>();
result.resolve(tResult);
var anyValue: any;
const anyValue: any = null;
result.reject(anyValue);
result.promise.then(result => {
return $q.resolve<TResult>(result);
@@ -411,7 +408,7 @@ namespace TestQ {
let httpFoo: ng.IHttpPromise<number>;
httpFoo.then((x) => {
// When returning a promise the generic type must be inferred.
var innerPromise: ng.IPromise<number>;
const innerPromise: ng.IPromise<number> = null;
return innerPromise;
}).then((x) => {
// must still be number.
@@ -427,16 +424,16 @@ httpFoo.then((response: ng.IHttpPromiseCallbackArg<any>) => {
// Deferred signature tests
namespace TestDeferred {
var any: any;
const any: any = null;
interface TResult {
a: number;
b: string;
c: boolean;
}
var tResult: TResult;
const tResult: TResult = null;
var deferred: angular.IDeferred<TResult>;
const deferred: angular.IDeferred<TResult> = null;
// deferred.resolve
{
@@ -467,7 +464,7 @@ namespace TestDeferred {
}
namespace TestInjector {
var $injector: angular.auto.IInjectorService;
const $injector: angular.auto.IInjectorService = null;
$injector.strictDi = true;
@@ -477,7 +474,7 @@ namespace TestInjector {
// Promise signature tests
namespace TestPromise {
var any: any;
const any: any = null;
interface TResult {
kind: 'result';
@@ -497,16 +494,16 @@ namespace TestPromise {
return x.kind === 'result';
}
var tresult: TResult;
var tresultPromise: ng.IPromise<TResult>;
var tresultHttpPromise: ng.IHttpPromise<TResult>;
const tresult: TResult = null;
const tresultPromise: ng.IPromise<TResult> = null;
const tresultHttpPromise: ng.IHttpPromise<TResult> = null;
var tother: TOther;
var totherPromise: ng.IPromise<TOther>;
var totherHttpPromise: ng.IHttpPromise<TOther>;
const tother: TOther = null;
const totherPromise: ng.IPromise<TOther> = null;
const totherHttpPromise: ng.IHttpPromise<TOther> = null;
var promise: angular.IPromise<TResult>;
var $q: angular.IQService;
const promise: angular.IPromise<TResult> = null;
const $q: angular.IQService = null;
const assertPromiseType = <T>(arg: angular.IPromise<T>) => arg;
const reject = $q.reject();
@@ -608,9 +605,9 @@ namespace TestTimeout {
b: string;
c: boolean;
}
var fnTResult: (...args: any[]) => TResult;
var promiseAny: angular.IPromise<any>;
var $timeout: angular.ITimeoutService;
const fnTResult: (...args: any[]) => TResult = null;
const promiseAny: angular.IPromise<any> = null;
const $timeout: angular.ITimeoutService = null;
// $timeout
{
@@ -670,9 +667,7 @@ class SampleDirective implements ng.IDirective {
return new SampleDirective();
}
link(scope: ng.IScope) {
}
link(scope: ng.IScope) {}
}
class SampleDirective2 implements ng.IDirective {
@@ -688,9 +683,7 @@ class SampleDirective2 implements ng.IDirective {
return new SampleDirective2();
}
link(scope: ng.IScope) {
}
link(scope: ng.IScope) {}
}
angular.module('SameplDirective', []).directive('sampleDirective', SampleDirective.instance).directive('sameplDirective2', SampleDirective2.instance);
@@ -825,7 +818,6 @@ angular.module('docsTimeDirective', [])
$scope.format = 'M/d/yy h:mm:ss a';
}])
.directive('myCurrentTime', ['$interval', 'dateFilter', ($interval: any, dateFilter: any) => {
return {
link(scope: ng.IScope, element: ng.IAugmentedJQuery, attrs: ng.IAttributes) {
let format: any,
@@ -1030,11 +1022,10 @@ interface ICopyExampleUser {
}
interface ICopyExampleScope {
user: ICopyExampleUser;
master: ICopyExampleUser;
update: (copyExampleUser: ICopyExampleUser) => any;
reset: () => any;
update(copyExampleUser: ICopyExampleUser): any;
reset(): any;
}
angular.module('copyExample', [])
@@ -1055,8 +1046,7 @@ angular.module('copyExample', [])
}]);
namespace locationTests {
var $location: ng.ILocationService;
const $location: ng.ILocationService = null;
/*
* From https://docs.angularjs.org/api/ng/service/$location
@@ -1114,9 +1104,9 @@ namespace locationTests {
// NgModelController
function NgModelControllerTyping() {
var ngModel: angular.INgModelController;
var $http: angular.IHttpService;
var $q: angular.IQService;
const ngModel: angular.INgModelController = null;
const $http: angular.IHttpService = null;
const $q: angular.IQService = null;
// See https://docs.angularjs.org/api/ng/type/ngModel.NgModelController#$validators
ngModel.$validators['validCharacters'] = (modelValue, viewValue) => {
@@ -1141,8 +1131,7 @@ function NgModelControllerTyping() {
let $filter: angular.IFilterService;
function testFilter() {
var items: string[];
const items: string[] = null;
$filter('filter')(items, 'test');
$filter('filter')(items, {name: 'test'});
$filter('filter')(items, (val, index, array) => {
@@ -1224,7 +1213,7 @@ function testCustomFilter() {
}
function parseTyping() {
var $parse: angular.IParseService;
const $parse: angular.IParseService = null;
const compiledExp = $parse('a.b.c');
if (compiledExp.constant) {
return compiledExp({});
@@ -1234,7 +1223,7 @@ function parseTyping() {
}
function parseWithParams() {
var $parse: angular.IParseService;
const $parse: angular.IParseService = null;
const compiledExp1 = $parse('a.b.c', () => null);
const compiledExp2 = $parse('a.b.c', null, false);
}
@@ -1255,7 +1244,7 @@ function doBootstrap(element: Element | JQuery, mode: string): ng.auto.IInjector
}
function testIHttpParamSerializerJQLikeProvider() {
var serializer: angular.IHttpParamSerializer;
const serializer: angular.IHttpParamSerializer = null;
serializer({
a: 'b'
});
@@ -1271,6 +1260,6 @@ function anyOf3<T1, T2, T3>(v1: T1, v2: T2, v3: T3) {
}
function toPromise<T>(val: T): ng.IPromise<T> {
var p: ng.IPromise<T>;
const p: ng.IPromise<T> = null;
return p;
}
+5 -6
View File
@@ -782,7 +782,7 @@ declare namespace angular {
// Check angular's i18n files for exemples
NUMBER_FORMATS: ILocaleNumberFormatDescriptor;
DATETIME_FORMATS: ILocaleDateTimeFormatDescriptor;
pluralCat: (num: any) => string;
pluralCat(num: any): string;
}
interface ILocaleNumberFormatDescriptor {
@@ -1591,10 +1591,10 @@ declare namespace angular {
}
interface IHttpInterceptor {
request?: (config: IRequestConfig) => IRequestConfig|IPromise<IRequestConfig>;
requestError?: (rejection: any) => any;
response?: <T>(response: IHttpPromiseCallbackArg<T>) => IPromise<IHttpPromiseCallbackArg<T>>|IHttpPromiseCallbackArg<T>;
responseError?: (rejection: any) => any;
request?(config: IRequestConfig): IRequestConfig|IPromise<IRequestConfig>;
requestError?(rejection: any): any;
response?<T>(response: IHttpPromiseCallbackArg<T>): IPromise<IHttpPromiseCallbackArg<T>>|IHttpPromiseCallbackArg<T>;
responseError?(rejection: any): any;
}
interface IHttpInterceptorFactory {
@@ -2025,7 +2025,6 @@ declare namespace angular {
service(name: string, inlineAnnotatedFunction: any[]): IServiceProvider;
value(name: string, value: any): IServiceProvider;
}
}
/**
+6 -22
View File
@@ -2,32 +2,16 @@
"extends": "../tslint.json",
"rules": {
"class-name": true,
"curly": true,
"max-line-length": false,
"no-consecutive-blank-lines": true,
"no-shadowed-variable": true,
"quotemark": [
true,
"single"
],
"align": true,
"indent": [true, "spaces"],
"quotemark": [true, "single"],
"variable-name": [true, "check-format"],
"callable-types": false,
"forbidden-types": false,
"indent": [
true,
"spaces"
],
"ban-types": false,
"interface-name": false,
"linebreak-style": [
true,
"LF"
],
"no-empty-interface": false,
"max-line-length": false,
"unified-signatures": false,
"variable-name": [
true,
"check-format"
],
"void-return": false
}
}
-5
View File
@@ -1,5 +0,0 @@
{
"dependencies": {
"@types/auth0-js": "latest"
}
}
-5
View File
@@ -1,5 +0,0 @@
{
"dependencies": {
"@types/auth0-js": "latest"
}
}
@@ -1,4 +1,4 @@
import { context } from "aws-lambda-mock-context";
import context = require("aws-lambda-mock-context");
import * as Alexa from "alexa-sdk";
const launchRequestJson: any = {
+2 -2
View File
@@ -5,6 +5,8 @@
declare function context(options?: Options): Context;
export = context;
interface Context {
Promise: Promise<any>;
callbackWaitsForEmptyEventLoop: boolean;
@@ -30,5 +32,3 @@ interface Options {
memoryLimitInMB: string;
alias?: string;
}
export { context };
+3 -3
View File
@@ -1,5 +1,5 @@
import * as base64js from "base64-js";
const length: number = base64js.byteLength("");
const bytes: Uint8Array = base64js.toByteArray("");
const decoded: string = base64js.fromByteArray(new Uint8Array(0));
base64js.byteLength(""); // $ExpectType number
base64js.toByteArray(""); // $ExpectType Uint8Array
base64js.fromByteArray(new Uint8Array(0)); // $ExpectTpe string
@@ -7,7 +7,6 @@ function testSomeStaticMethods() {
function testFunctionReturningPromise() {
function functionReturningPromise(): Promise<string> {
return new Promise<string>((resolve, reject, onCancel) => {
if (onCancel) {
onCancel(() => {
console.log("onCancel cleanup");
@@ -40,5 +39,4 @@ function testPromiseRejection() {
.then((value) => {
return value.toUpperCase();
});
}
+1 -1
View File
@@ -5,6 +5,6 @@
"no-empty-interface": false,
"array-type": false,
"unified-signatures": false,
"forbidden-types": false
"ban-types": false
}
}
+8 -8
View File
@@ -3,15 +3,15 @@ const charm = getCharm();
charm.pipe(process.stdout);
charm.reset();
var colors: getCharm.CharmColor[] = [ 'red', 'cyan', 'yellow', 'green', 'blue' ];
var text = 'Always after me lucky charms.';
const colors: getCharm.CharmColor[] = [ 'red', 'cyan', 'yellow', 'green', 'blue' ];
const text = 'Always after me lucky charms.';
var offset = 0;
var iv = setInterval(() => {
var y = 0, dy = 1;
for (var i = 0; i < 40; i++) {
var color = colors[(i + offset) % colors.length];
var c = text[(i + offset) % text.length];
let offset = 0;
const iv = setInterval(() => {
let y = 0, dy = 1;
for (let i = 0; i < 40; i++) {
const color = colors[(i + offset) % colors.length];
const c = text[(i + offset) % text.length];
charm
.move(1, dy)
.foreground(color)
+1 -1
View File
@@ -1,6 +1,6 @@
{
"extends": "../tslint.json",
"rules": {
"forbidden-types": false
"ban-types": false
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"extends": "../tslint.json",
"rules": {
"forbidden-types": false
"ban-types": false
}
}
+16 -35
View File
@@ -49,87 +49,68 @@ export interface Console {
* Forces invocations of this function to always have this refer to the class instance,
* even if the function is passed around or would otherwise lose its this context. e.g. var fn = context.method;
*/
declare var autobind: Function;
export const autobind: Function;
/**
* Marks a property or method as not being writable.
*/
declare var readonly: PropertyOrMethodDecorator;
export const readonly: PropertyOrMethodDecorator;
/**
* Checks that the marked method indeed overrides a function with the same signature somewhere on the prototype chain.
*/
declare var override: MethodDecorator;
export const override: MethodDecorator;
/**
* Calls console.warn() with a deprecation message. Provide a custom message to override the default one. You can also provide an options hash with a url, for further reading.
*/
declare var deprecate: Deprecate;
export const deprecate: Deprecate;
/**
* Calls console.warn() with a deprecation message. Provide a custom message to override the default one. You can also provide an options hash with a url, for further reading.
*/
declare var deprecated: Deprecate;
export const deprecated: Deprecate;
/**
* Creates a new debounced function which will be invoked after wait milliseconds since the time it was invoked. Default timeout is 300 ms.
*/
declare var debounce: (wait: number) => MethodDecorator;
export function debounce(wait: number): MethodDecorator;
/**
* Creates a new throttled function which will be invoked in every wait milliseconds. Default timeout is 300 ms.
*/
declare var throttle: (wait: number, options?: ThrottleOptions) => MethodDecorator;
export function throttle(wait: number, options?: ThrottleOptions): MethodDecorator;
/**
* Suppresses any JavaScript console.warn() call while the decorated function is called. (i.e. on the stack)
*/
declare var suppressWarnings: MethodDecorator;
export const suppressWarnings: MethodDecorator;
/**
* Marks a property or method as not being enumerable.
*/
declare var nonenumerable: PropertyOrMethodDecorator;
export const nonenumerable: PropertyOrMethodDecorator;
/**
* Marks a property or method as not being writable.
*/
declare var nonconfigurable: PropertyOrMethodDecorator;
export const nonconfigurable: PropertyOrMethodDecorator;
/**
* Initial implementation included, likely slow. WIP.
*/
declare var memoize: MethodDecorator;
export const memoize: MethodDecorator;
/**
* Immediately applies the provided function and arguments to the method, allowing you to wrap methods with arbitrary helpers like those provided by lodash.
* The first argument is the function to apply, all further arguments will be passed to that decorating function.
*/
declare var decorate: (func: Function, ...args: any[]) => MethodDecorator;
export function decorate(func: Function, ...args: any[]): MethodDecorator;
/**
* Prevents a property initializer from running until the decorated property is actually looked up.
* Useful to prevent excess allocations that might otherwise not be used, but be careful not to over-optimize things.
*/
declare var lazyInitialize: PropertyDecorator;
export const lazyInitialize: PropertyDecorator;
/**
* Mixes in all property descriptors from the provided Plain Old JavaScript Objects (aka POJOs) as arguments.
* Mixins are applied in the order they are passed, but do not override descriptors already on the class, including those inherited traditionally.
*/
declare var mixin: (...mixins: any[]) => ClassDecorator;
export function mixin(...mixins: any[]): ClassDecorator;
/**
* Mixes in all property descriptors from the provided Plain Old JavaScript Objects (aka POJOs) as arguments.
* Mixins are applied in the order they are passed, but do not override descriptors already on the class, including those inherited traditionally.
*/
declare var mixins: (...mixins: any[]) => ClassDecorator;
export function mixins(...mixins: any[]): ClassDecorator;
/**
* Uses console.time and console.timeEnd to provide function timings with a unique label whose default prefix is ClassName.method. Supply a first argument to override the prefix:
*/
declare var time: (label: string, console?: Console) => MethodDecorator;
export {
autobind,
readonly,
override,
deprecate,
deprecated,
debounce,
throttle,
suppressWarnings,
nonenumerable,
nonconfigurable,
memoize,
decorate,
lazyInitialize,
mixin,
mixins,
time,
};
export function time(label: string, console?: Console): MethodDecorator;
+1 -1
View File
@@ -2,6 +2,6 @@
"extends": "../tslint.json",
"rules": {
"callable-types": false,
"forbidden-types": false
"ban-types": false
}
}
+2 -2
View File
@@ -927,7 +927,7 @@ declare module "core-js/fn/function" {
export = Function;
}
declare module "core-js/fn/function/has-instance" {
const hasInstance: (value: any) => boolean;
function hasInstance(value: any): boolean;
export = hasInstance;
}
declare module "core-js/fn/function/name" {
@@ -1706,7 +1706,7 @@ declare module "core-js/library/fn/function" {
export = Function;
}
declare module "core-js/library/fn/function/has-instance" {
const hasInstance: (value: any) => boolean;
function hasInstance(value: any): boolean;
export = hasInstance;
}
declare module "core-js/library/fn/function/name" {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"extends": "../tslint.json",
"rules": {
"forbidden-types": false
"ban-types": false
}
}
+1 -1
View File
@@ -2,7 +2,7 @@
"extends": "../tslint.json",
"rules": {
// Heavy use of Function type in this older package.
"forbidden-types": false,
"ban-types": false,
"no-misused-new": false,
// not sure what this means
"no-single-declare-module": false
+1 -1
View File
@@ -933,7 +933,7 @@ interface IStaticCanvasOptions {
* Function that determines clipping of entire canvas area
* Being passed context as first argument. See clipping canvas area
*/
clipTo?: (context: CanvasRenderingContext2D) => void;
clipTo?(context: CanvasRenderingContext2D): void;
/**
* Indicates whether object controls (borders/controls) are rendered above overlay image
+1 -1
View File
@@ -2,7 +2,7 @@
"extends": "../tslint.json",
"rules": {
"adjacent-overload-signatures": false,
"forbidden-types": false,
"ban-types": false,
"interface-name": false,
"no-empty-interface": false,
"unified-signatures": false
+8 -8
View File
@@ -1,19 +1,19 @@
import * as fs from "fs-promise";
var src: string;
var dst: string;
var dir: string;
var path: string;
var data: any;
var writeOptions: fs.WriteOptions;
var writeJsonOptions: fs.WriteJsonOptions = {
let src: string;
let dst: string;
let dir: string;
let path: string;
let data: any;
let writeOptions: fs.WriteOptions;
const writeJsonOptions: fs.WriteJsonOptions = {
spaces: 2,
replacer(key, value) {
src = key;
return value;
}
};
var readJsonOptions: fs.ReadJsonOptions;
let readJsonOptions: fs.ReadJsonOptions;
async function test() {
await fs.copy(src, dst);
+1 -1
View File
@@ -27,7 +27,7 @@ export interface WriteJsonOptions extends WriteOptions {
export interface ReadJsonOptions {
encoding: string;
flag?: string;
reviver: (key: any, value: any) => any;
reviver(key: any, value: any): any;
}
export function copy(src: string, dst: string): Promise<void>;
+24 -24
View File
@@ -55,10 +55,10 @@ export interface Options extends AgendaOptions, EventDraggingResizingOptions, Dr
aspectRatio?: number;
handleWindowResize?: boolean;
views?: ViewSpecificOptions;
viewRender?: (view: ViewObject, element: JQuery) => void;
viewDestroy?: (view: ViewObject, element: JQuery) => void;
dayRender?: (date: Date, cell: HTMLTableDataCellElement) => void;
windowResize?: (view: ViewObject) => void;
viewRender?(view: ViewObject, element: JQuery): void;
viewDestroy?(view: ViewObject, element: JQuery): void;
dayRender?(date: Date, cell: HTMLTableDataCellElement): void;
windowResize?(view: ViewObject): void;
// Timezone
timezone?: string | boolean;
@@ -90,10 +90,10 @@ export interface Options extends AgendaOptions, EventDraggingResizingOptions, Dr
// Clicking & Hovering - http://fullcalendar.io/docs/mouse/
dayClick?: (date: Date, allDay: boolean, jsEvent: MouseEvent, view: ViewObject) => void;
eventClick?: (event: EventObject, jsEvent: MouseEvent, view: ViewObject) => any; // return type boolean or void
eventMouseover?: (event: EventObject, jsEvent: MouseEvent, view: ViewObject) => void;
eventMouseout?: (event: EventObject, jsEvent: MouseEvent, view: ViewObject) => void;
dayClick?(date: Date, allDay: boolean, jsEvent: MouseEvent, view: ViewObject): void;
eventClick?(event: EventObject, jsEvent: MouseEvent, view: ViewObject): any; // return type boolean or void
eventMouseover?(event: EventObject, jsEvent: MouseEvent, view: ViewObject): void;
eventMouseout?(event: EventObject, jsEvent: MouseEvent, view: ViewObject): void;
// Event Data - http://fullcalendar.io/docs/event_data/
@@ -120,8 +120,8 @@ export interface Options extends AgendaOptions, EventDraggingResizingOptions, Dr
startParam?: string;
endParam?: string;
lazyFetching?: boolean;
eventDataTransform?: (eventData: any) => EventObject;
loading?: (isLoading: boolean, view: ViewObject) => void;
eventDataTransform?(eventData: any): EventObject;
loading?(isLoading: boolean, view: ViewObject): void;
eventLimit?: boolean;
// Event Rendering - http://fullcalendar.io/docs/event_rendering/
@@ -130,10 +130,10 @@ export interface Options extends AgendaOptions, EventDraggingResizingOptions, Dr
eventBackgroundColor?: string;
eventBorderColor?: string;
eventTextColor?: string;
eventRender?: (event: EventObject, element: HTMLDivElement, view: ViewObject) => void;
eventAfterRender?: (event: EventObject, element: HTMLDivElement, view: ViewObject) => void;
eventAfterAllRender?: (view: ViewObject) => void;
eventDestroy?: (event: EventObject, element: JQuery, view: ViewObject) => void;
eventRender?(event: EventObject, element: HTMLDivElement, view: ViewObject): void;
eventAfterRender?(event: EventObject, element: HTMLDivElement, view: ViewObject): void;
eventAfterAllRender?(view: ViewObject): void;
eventDestroy?(event: EventObject, element: JQuery, view: ViewObject): void;
// scheduler options
resourceAreaWidth?: number;
@@ -172,12 +172,12 @@ export interface EventDraggingResizingOptions {
dragScroll?: boolean;
eventOverlap?: boolean | ((stillEvent: EventObject, movingEvent: EventObject) => boolean);
eventConstraint?: "businessHours" | BusinessHours | Timespan;
eventDragStart?: (event: EventObject, jsEvent: MouseEvent, ui: any, view: ViewObject) => void;
eventDragStop?: (event: EventObject, jsEvent: MouseEvent, ui: any, view: ViewObject) => void;
eventDrop?: (event: EventObject, delta: moment.Duration, revertFunc: Function, jsEvent: Event, ui: any, view: ViewObject) => void;
eventResizeStart?: (event: EventObject, jsEvent: MouseEvent, ui: any, view: ViewObject) => void;
eventResizeStop?: (event: EventObject, jsEvent: MouseEvent, ui: any, view: ViewObject) => void;
eventResize?: (event: EventObject, delta: moment.Duration, revertFunc: Function, jsEvent: Event, ui: any, view: ViewObject) => void;
eventDragStart?(event: EventObject, jsEvent: MouseEvent, ui: any, view: ViewObject): void;
eventDragStop?(event: EventObject, jsEvent: MouseEvent, ui: any, view: ViewObject): void;
eventDrop?(event: EventObject, delta: moment.Duration, revertFunc: Function, jsEvent: Event, ui: any, view: ViewObject): void;
eventResizeStart?(event: EventObject, jsEvent: MouseEvent, ui: any, view: ViewObject): void;
eventResizeStop?(event: EventObject, jsEvent: MouseEvent, ui: any, view: ViewObject): void;
eventResize?(event: EventObject, delta: moment.Duration, revertFunc: Function, jsEvent: Event, ui: any, view: ViewObject): void;
}
/*
* Selection - http://fullcalendar.io/docs/selection/
@@ -189,15 +189,15 @@ export interface SelectionOptions {
unselectCancel?: string;
selectOverlap?: boolean | ((event: EventObject) => boolean);
selectConstraint?: Timespan | BusinessHours;
select?: (start: moment.Moment, end: moment.Moment, jsEvent: MouseEvent, view: ViewObject, resource?: any) => void;
unselect?: (view: ViewObject, jsEvent: Event) => void;
select?(start: moment.Moment, end: moment.Moment, jsEvent: MouseEvent, view: ViewObject, resource?: any): void;
unselect?(view: ViewObject, jsEvent: Event): void;
}
export interface DroppingExternalElementsOptions {
droppable?: boolean;
dropAccept?: string | ((draggable: any) => boolean);
drop?: (date: moment.Moment, jsEvent: MouseEvent, ui: any) => void;
eventReceive?: (event: EventObject) => void;
drop?(date: moment.Moment, jsEvent: MouseEvent, ui: any): void;
eventReceive?(event: EventObject): void;
}
export interface ButtonTextObject {
+1 -1
View File
@@ -1,7 +1,7 @@
{
"extends": "../tslint.json",
"rules": {
"forbidden-types": false,
"ban-types": false,
"unified-signatures": false
}
}
+24 -24
View File
@@ -71,10 +71,10 @@ declare global {
contentHeight?: number;
aspectRatio?: number;
handleWindowResize?: boolean;
viewRender?: (view: ViewObject, element: JQuery) => void;
viewDestroy?: (view: ViewObject, element: JQuery) => void;
dayRender?: (date: Date, cell: HTMLTableDataCellElement) => void;
windowResize?: (view: ViewObject) => void;
viewRender?(view: ViewObject, element: JQuery): void;
viewDestroy?(view: ViewObject, element: JQuery): void;
dayRender?(date: Date, cell: HTMLTableDataCellElement): void;
windowResize?(view: ViewObject): void;
// Timezone
timezone?: string | boolean;
@@ -106,10 +106,10 @@ declare global {
// Clicking & Hovering - http://arshaw.com/fullcalendar/docs/mouse/
dayClick?: (date: Date, allDay: boolean, jsEvent: MouseEvent, view: ViewObject) => void;
eventClick?: (event: EventObject, jsEvent: MouseEvent, view: ViewObject) => any; // return type boolean or void
eventMouseover?: (event: EventObject, jsEvent: MouseEvent, view: ViewObject) => void;
eventMouseout?: (event: EventObject, jsEvent: MouseEvent, view: ViewObject) => void;
dayClick?(date: Date, allDay: boolean, jsEvent: MouseEvent, view: ViewObject): void;
eventClick?(event: EventObject, jsEvent: MouseEvent, view: ViewObject): any; // return type boolean or void
eventMouseover?(event: EventObject, jsEvent: MouseEvent, view: ViewObject): void;
eventMouseout?(event: EventObject, jsEvent: MouseEvent, view: ViewObject): void;
// Event Data - http://arshaw.com/fullcalendar/docs/event_data/
@@ -137,8 +137,8 @@ declare global {
startParam?: string;
endParam?: string;
lazyFetching?: boolean;
eventDataTransform?: (eventData: any) => EventObject;
loading?: (isLoading: boolean, view: ViewObject) => void;
eventDataTransform?(eventData: any): EventObject;
loading?(isLoading: boolean, view: ViewObject): void;
// Event Rendering - http://arshaw.com/fullcalendar/docs/event_rendering/
@@ -146,10 +146,10 @@ declare global {
eventBackgroundColor?: string;
eventBorderColor?: string;
eventTextColor?: string;
eventRender?: (event: EventObject, element: HTMLDivElement, view: ViewObject) => void;
eventAfterRender?: (event: EventObject, element: HTMLDivElement, view: ViewObject) => void;
eventAfterAllRender?: (view: ViewObject) => void;
eventDestroy?: (event: EventObject, element: JQuery, view: ViewObject) => void;
eventRender?(event: EventObject, element: HTMLDivElement, view: ViewObject): void;
eventAfterRender?(event: EventObject, element: HTMLDivElement, view: ViewObject): void;
eventAfterAllRender?(view: ViewObject): void;
eventDestroy?(event: EventObject, element: JQuery, view: ViewObject): void;
}
interface ViewOptionHash {
@@ -193,12 +193,12 @@ declare global {
dragScroll?: boolean;
eventOverlap?: boolean | ((stillEvent: EventObject, movingEvent: EventObject) => boolean);
eventConstraint?: BusinessHours | Timespan;
eventDragStart?: (event: EventObject, jsEvent: MouseEvent, ui: any, view: ViewObject) => void;
eventDragStop?: (event: EventObject, jsEvent: MouseEvent, ui: any, view: ViewObject) => void;
eventDrop?: (event: EventObject, delta: moment.Duration, revertFunc: Function, jsEvent: Event, ui: any, view: ViewObject) => void;
eventResizeStart?: (event: EventObject, jsEvent: MouseEvent, ui: any, view: ViewObject) => void;
eventResizeStop?: (event: EventObject, jsEvent: MouseEvent, ui: any, view: ViewObject) => void;
eventResize?: (event: EventObject, delta: moment.Duration, revertFunc: Function, jsEvent: Event, ui: any, view: ViewObject) => void;
eventDragStart?(event: EventObject, jsEvent: MouseEvent, ui: any, view: ViewObject): void;
eventDragStop?(event: EventObject, jsEvent: MouseEvent, ui: any, view: ViewObject): void;
eventDrop?(event: EventObject, delta: moment.Duration, revertFunc: Function, jsEvent: Event, ui: any, view: ViewObject): void;
eventResizeStart?(event: EventObject, jsEvent: MouseEvent, ui: any, view: ViewObject): void;
eventResizeStop?(event: EventObject, jsEvent: MouseEvent, ui: any, view: ViewObject): void;
eventResize?(event: EventObject, delta: moment.Duration, revertFunc: Function, jsEvent: Event, ui: any, view: ViewObject): void;
}
/*
* Selection - http://arshaw.com/fullcalendar/docs/selection/
@@ -210,15 +210,15 @@ declare global {
unselectCancel?: string;
selectOverlap?: boolean | ((event: EventObject) => boolean);
selectConstraint?: Timespan | BusinessHours;
select?: (start: moment.Moment, end: moment.Moment, jsEvent: MouseEvent, view: ViewObject, resource?: any) => void;
unselect?: (view: ViewObject, jsEvent: Event) => void;
select?(start: moment.Moment, end: moment.Moment, jsEvent: MouseEvent, view: ViewObject, resource?: any): void;
unselect?(view: ViewObject, jsEvent: Event): void;
}
interface DroppingExternalElementsOptions {
droppable?: boolean;
dropAccept?: string | ((draggable: any) => boolean);
drop?: (date: moment.Moment, jsEvent: MouseEvent, ui: any) => void;
eventReceive?: (event: EventObject) => void;
drop?(date: moment.Moment, jsEvent: MouseEvent, ui: any): void;
eventReceive?(event: EventObject): void;
}
interface ButtonTextObject {
+1 -1
View File
@@ -1,7 +1,7 @@
{
"extends": "../tslint.json",
"rules": {
"forbidden-types": false,
"ban-types": false,
"unified-signatures": false
}
}
+1 -1
View File
@@ -292,7 +292,7 @@ declare namespace UniversalAnalytics {
expVar?: string;
flashVersion?: string;
forceSSL?: boolean;
hitCallback?: () => void;
hitCallback?(): void;
hitType?: string;
hostname?: string;
id?: string;
+1 -1
View File
@@ -2,7 +2,7 @@
"extends": "../tslint.json",
"rules": {
"dt-header": false,
"forbidden-types": false,
"ban-types": false,
"unified-signatures": false
}
}
+292 -17
View File
@@ -835,24 +835,52 @@ declare namespace google.maps {
getVisible(): boolean;
setDraggable(draggable: boolean): void;
setEditable(editable: boolean): void;
setMap(map: Map | null): void;
setMap(map: Map | null): void;
setOptions(options: PolylineOptions): void;
setPath(path: MVCArray|LatLng[]|LatLngLiteral[]): void; // MVCArray<LatLng>|Array<LatLng|LatLngLiteral>
setVisible(visible: boolean): void;
}
export interface PolylineOptions {
/** Indicates whether this Polyline handles mouse events. Defaults to true. */
clickable?: boolean;
/**
* If set to true, the user can drag this shape over the map.
* The geodesic property defines the mode of dragging. Defaults to false.
*/
draggable?: boolean;
/**
* If set to true, the user can edit this shape by dragging the control points shown at the vertices and on
* each segment. Defaults to false.
*/
editable?: boolean;
/**
* When true, edges of the polygon are interpreted as geodesic and will follow the curvature of the Earth.
* When false, edges of the polygon are rendered as straight lines in screen space. Note that the shape of a
* geodesic polygon may appear to change when dragged, as the dimensions are maintained relative to the
* surface of the earth. Defaults to false.
*/
geodesic?: boolean;
/** The icons to be rendered along the polyline. */
icons?: IconSequence[];
/** Map on which to display Polyline. */
map?: Map;
/**
* The ordered sequence of coordinates of the Polyline.
* This path may be specified using either a simple array of LatLngs, or an MVCArray of LatLngs.
* Note that if you pass a simple array, it will be converted to an MVCArray Inserting or removing LatLngs
* in the MVCArray will automatically update the polyline on the map.
*/
path?: MVCArray|LatLng[]|LatLngLiteral[]; // MVCArray<LatLng>|Array<LatLng|LatLngLiteral>
/** The stroke color. All CSS3 colors are supported except for extended named colors. */
strokeColor?: string;
/** The stroke opacity between 0.0 and 1.0. */
strokeOpacity?: number;
/** The stroke width in pixels. */
strokeWeight?: number;
/** Whether this polyline is visible on the map. Defaults to true. */
visible?: boolean;
/** The zIndex compared to other polys. */
zIndex?: number;
}
@@ -873,7 +901,7 @@ declare namespace google.maps {
getVisible(): boolean;
setDraggable(draggable: boolean): void;
setEditable(editable: boolean): void;
setMap(map: Map | null): void;
setMap(map: Map | null): void;
setOptions(options: PolygonOptions): void;
setPath(path: MVCArray|LatLng[]|LatLngLiteral[]): void;
setPaths(paths: MVCArray): void;
@@ -959,7 +987,7 @@ declare namespace google.maps {
setBounds(bounds: LatLngBounds|LatLngBoundsLiteral): void;
setDraggable(draggable: boolean): void;
setEditable(editable: boolean): void;
setMap(map: Map | null): void;
setMap(map: Map | null): void;
setOptions(options: RectangleOptions): void;
setVisible(visible: boolean): void;
}
@@ -980,38 +1008,75 @@ declare namespace google.maps {
zIndex?: number;
}
/** A circle on the Earth's surface; also known as a "spherical cap". */
export class Circle extends MVCObject {
/** Create a circle using the passed CircleOptions, which specify the center, radius, and style. */
constructor(opts?: CircleOptions);
/** Gets the LatLngBounds of this Circle. */
getBounds(): LatLngBounds;
/** Returns the center of this circle. */
getCenter(): LatLng;
/** Returns whether this circle can be dragged by the user. */
getDraggable(): boolean;
/** Returns whether this circle can be edited by the user. */
getEditable(): boolean;
/** Returns the map on which this circle is displayed. */
getMap(): Map;
/** Returns the radius of this circle (in meters). */
getRadius(): number;
/** Returns whether this circle is visible on the map. */
getVisible(): boolean;
/** Sets the center of this circle. */
setCenter(center: LatLng|LatLngLiteral): void;
/** If set to true, the user can drag this circle over the map. */
setDraggable(draggable: boolean): void;
/**
* If set to true, the user can edit this circle by dragging the control points shown at the center and around
* the circumference of the circle.
*/
setEditable(editable: boolean): void;
setMap(map: Map | null): void;
/** Renders the circle on the specified map. If map is set to null, the circle will be removed. */
setMap(map: Map | null): void;
setOptions(options: CircleOptions): void;
/** Sets the radius of this circle (in meters). */
setRadius(radius: number): void;
/** Hides this circle if set to false. */
setVisible(visible: boolean): void;
}
export interface CircleOptions {
/** The center */
center?: LatLng|LatLngLiteral;
/** Indicates whether this Circle handles mouse events. Defaults to true. */
clickable?: boolean;
/** If set to true, the user can drag this circle over the map. Defaults to false. */
draggable?: boolean;
/**
* If set to true, the user can edit this circle by dragging the control points shown at the center and around
* the circumference of the circle. Defaults to false.
*/
editable?: boolean;
/** The fill color. All CSS3 colors are supported except for extended named colors. */
fillColor?: string;
/** The fill opacity between 0.0 and 1.0 */
fillOpacity?: number;
/** Map on which to display Circle. */
map?: Map;
/** The radius in meters on the Earth's surface */
radius?: number;
/** The stroke color. All CSS3 colors are supported except for extended named colors. */
strokeColor?: string;
/** The stroke opacity between 0.0 and 1.0 */
strokeOpacity?: number;
/**
* The stroke position. Defaults to CENTER. This property is not supported on Internet Explorer 8 and earlier.
*/
strokePosition?: StrokePosition;
/** The stroke width in pixels. */
strokeWeight?: number;
/** Whether this circle is visible on the map. Defaults to true. */
visible?: boolean;
/** The zIndex compared to other polys. */
zIndex?: number;
}
@@ -1036,7 +1101,7 @@ declare namespace google.maps {
getMap(): Map;
getOpacity(): number;
getUrl(): string;
setMap(map: Map | null): void;
setMap(map: Map | null): void;
setOpacity(opacity: number): void;
}
@@ -1053,7 +1118,7 @@ declare namespace google.maps {
getProjection(): MapCanvasProjection;
onAdd(): void;
onRemove(): void;
setMap(map: Map | StreetViewPanorama | null): void;
setMap(map: Map | StreetViewPanorama | null): void;
}
export interface MapPanes {
@@ -1144,7 +1209,7 @@ declare namespace google.maps {
getPanel(): Element;
getRouteIndex(): number;
setDirections(directions: DirectionsResult): void;
setMap(map: Map | null): void;
setMap(map: Map | null): void;
setOptions(options: DirectionsRendererOptions): void;
setPanel(panel: Element): void;
setRouteIndex(routeIndex: number): void;
@@ -1171,20 +1236,59 @@ declare namespace google.maps {
route(request: DirectionsRequest, callback: (result: DirectionsResult, status: DirectionsStatus) => void ): void;
}
/** A directions query to be sent to the DirectionsService. */
export interface DirectionsRequest {
/** If true, instructs the Directions service to avoid ferries where possible. Optional. */
avoidFerries?: boolean;
/** If true, instructs the Directions service to avoid highways where possible. Optional. */
avoidHighways?: boolean;
/** If true, instructs the Directions service to avoid toll roads where possible. Optional. */
avoidTolls?: boolean;
/**
* Location of destination. This can be specified as either a string to be geocoded, or a LatLng,
* or a Place. Required.
*/
destination?: string|LatLng|Place;
durationInTraffic?: boolean; /* Deprecated. Use drivingOptions field instead */
/** Deprecated. Use drivingOptions field instead */
durationInTraffic?: boolean;
/**
* Settings that apply only to requests where travelMode is DRIVING. This object will have no effect
* for other travel modes.
*/
drivingOptions?: DrivingOptions;
/**
* If set to true, the DirectionService will attempt to re-order the supplied intermediate waypoints
* to minimize overall cost of the route. If waypoints are optimized, inspect DirectionsRoute.waypoint_order
* in the response to determine the new ordering.
*/
optimizeWaypoints?: boolean;
/**
* Location of origin. This can be specified as either a string to be geocoded, or a LatLng, or a Place.
* Required.
*/
origin?: string|LatLng|Place;
/** Whether or not route alternatives should be provided. Optional. */
provideRouteAlternatives?: boolean;
/** Region code used as a bias for geocoding requests. Optional. */
region?: string;
/**
* Settings that apply only to requests where travelMode is TRANSIT. This object will have no effect for
* other travel modes.
*/
transitOptions?: TransitOptions;
/** Type of routing requested. Required. */
travelMode?: TravelMode;
/**
* Preferred unit system to use when displaying distance. Defaults to the unit system used
* in the country of origin.
*/
unitSystem?: UnitSystem;
/**
* Array of intermediate waypoints. Directions will be calculated from the origin to the destination by way
* of each waypoint in this array. The maximum allowed waypoints is 8, plus the origin, and destination.
* Premium Plan customers are allowed 23 waypoints, plus the origin, and destination.
* Waypoints are not supported for transit directions. Optional.
*/
waypoints?: DirectionsWaypoint[];
}
@@ -1235,8 +1339,20 @@ declare namespace google.maps {
PESSIMISTIC
}
/**
* A DirectionsWaypoint represents a location between origin and destination
* through which the trip should be routed.
*/
export interface DirectionsWaypoint {
/** Waypoint location. Can be an address string, a LatLng, or a Place. Optional. */
location: LatLng|LatLngLiteral|string;
/**
* If true, indicates that this waypoint is a stop between the origin and destination.
* This has the effect of splitting the route into two legs. If false, indicates that the route
* should be biased to go through this waypoint, but not split into two legs. This is useful
* if you want to create a route in response to the user dragging waypoints on a map.
* This value is true by default. Optional.
*/
stopover: boolean;
}
@@ -1255,14 +1371,50 @@ declare namespace google.maps {
routes: DirectionsRoute[];
}
/**
* A single route containing a set of legs in a DirectionsResult.
* Note that though this object is "JSON-like," it is not strictly JSON,
* as it directly and indirectly includes LatLng objects.
*/
export interface DirectionsRoute {
/** The bounds for this route. */
bounds: LatLngBounds;
/** Copyrights text to be displayed for this route. */
copyrights: string;
/** The total fare for the whole transit trip. Only applicable to transit requests. */
fare: TransitFare;
/**
* An array of DirectionsLegs, each of which contains information about the steps of which it is composed.
* There will be one leg for each stopover waypoint or destination specified. So a route with no stopover
* waypoints will contain one DirectionsLeg and a route with one stopover waypoint will contain two.
*/
legs: DirectionsLeg[];
/**
* An array of LatLngs representing the entire course of this route. The path is simplified in order to make
* it suitable in contexts where a small number of vertices is required (such as Static Maps API URLs).
*/
overview_path: LatLng[];
/**
* An encoded polyline representation of the route in overview_path.
* This polyline is an approximate (smoothed) path of the resulting directions.
*/
overview_polyline: string;
/** Warnings to be displayed when showing these directions. */
warnings: string[];
/**
* If optimizeWaypoints was set to true, this field will contain the re-ordered permutation
* of the input waypoints. For example, if the input was:
* Origin: Los Angeles
* Waypoints: Dallas, Bangor, Phoenix
* Destination: New York
* and the optimized output was ordered as follows:
* Origin: Los Angeles
* Waypoints: Phoenix, Dallas, Bangor
* Destination: New York
* then this field will be an Array containing the values [2, 0, 1]. Note that the numbering of waypoints
* is zero-based. If any of the input waypoints has stopover set to false, this field will be empty,
* since route optimization is not available for such queries.
*/
waypoint_order: number[];
}
@@ -1624,13 +1776,13 @@ declare namespace google.maps {
export class BicyclingLayer extends MVCObject {
constructor();
getMap(): Map;
setMap(map: Map | null): void;
setMap(map: Map | null): void;
}
export class FusionTablesLayer extends MVCObject {
constructor(options: FusionTablesLayerOptions);
getMap(): Map;
setMap(map: Map | null): void;
setMap(map: Map | null): void;
setOptions(options: FusionTablesLayerOptions): void;
}
@@ -1701,7 +1853,7 @@ declare namespace google.maps {
getStatus(): KmlLayerStatus;
getUrl(): string;
getZIndex(): number;
setMap(map: Map | null): void;
setMap(map: Map | null): void;
setUrl(url: string): void;
setZIndez(zIndex: number): void;
}
@@ -1772,7 +1924,7 @@ declare namespace google.maps {
export class TransitLayer extends MVCObject {
constructor();
getMap(): void;
setMap(map: Map | null): void;
setMap(map: Map | null): void;
}
/***** Street View *****/
@@ -1904,7 +2056,7 @@ declare namespace google.maps {
export class StreetViewCoverageLayer extends MVCObject {
getMap(): Map;
setMap(map: Map | null): void;
setMap(map: Map | null): void;
}
/***** Events *****/
@@ -1953,11 +2105,31 @@ declare namespace google.maps {
static trigger(instance: any, eventName: string, ...args: any[]): void;
}
/**
* This object is returned from various mouse events on the map and overlays,
* and contains all the fields shown below.
*/
export interface MouseEvent {
/** Prevents this event from propagating further. */
stop(): void;
/** The latitude/longitude that was below the cursor when the event occurred. */
latLng: LatLng;
}
/**
* This object is sent in an event when a user clicks on an icon on the map.
* The place ID of this place is stored in the placeId member.
* To prevent the default info window from showing up, call the stop() method on this event to prevent it being
* propagated. Learn more about place IDs in the Places API developer guide.
*/
export interface IconMouseEvent extends MouseEvent {
/**
* The place ID of the place that was clicked.
* This place ID can be used to query more information about the feature that was clicked.
*/
placeId: string;
}
/* **** Base **** */
/**
@@ -2005,20 +2177,41 @@ declare namespace google.maps {
export type LatLngLiteral = { lat: number; lng: number }
export type LatLngBoundsLiteral = { east: number; north: number; south: number; west: number }
/**
* A LatLngBounds instance represents a rectangle in geographical coordinates, including one
* that crosses the 180 degrees longitudinal meridian.
*/
export class LatLngBounds {
/** Constructs a rectangle from the points at its south-west and north-east corners. */
constructor(sw?: LatLng|LatLngLiteral, ne?: LatLng|LatLngLiteral);
/** Returns true if the given lat/lng is in this bounds. */
contains(latLng: LatLng|LatLngLiteral): boolean;
/** Returns true if this bounds approximately equals the given bounds. */
equals(other: LatLngBounds|LatLngBoundsLiteral): boolean;
/** Extends this bounds to contain the given point. */
extend(point: LatLng|LatLngLiteral): LatLngBounds;
/** Computes the center of this LatLngBounds */
getCenter(): LatLng;
/** Returns the north-east corner of this bounds. */
getNorthEast(): LatLng;
/** Returns the south-west corner of this bounds. */
getSouthWest(): LatLng;
/** Returns true if this bounds shares any points with the other bounds. */
intersects(other: LatLngBounds|LatLngBoundsLiteral): boolean;
/** Returns if the bounds are empty. */
isEmpty(): boolean;
/** Converts to JSON representation. This function is intended to be used via JSON.stringify. */
toJSON(): LatLngBoundsLiteral;
/** Converts the given map bounds to a lat/lng span. */
toSpan(): LatLng;
/** Converts to string. */
toString(): string;
/**
* Returns a string of the form "lat_lo,lng_lo,lat_hi,lng_hi" for this bounds, where "lo" corresponds to the
* southwest corner of the bounding box, while "hi" corresponds to the northeast corner of that box.
*/
toUrlValue(precision?: number): string;
/** Extends this bounds to contain the union of this and the given bounds. */
union(other: LatLngBounds|LatLngBoundsLiteral): LatLngBounds;
}
@@ -2044,16 +2237,39 @@ declare namespace google.maps {
}
/***** MVC *****/
/** Base class implementing KVO. */
export class MVCObject {
/**
* The MVCObject constructor is guaranteed to be an empty function, and so you may inherit from MVCObject
* by simply writing MySubclass.prototype = new google.maps.MVCObject();. Unless otherwise noted,
* this is not true of other classes in the API, and inheriting from other classes in the API is not supported.
*/
constructor();
/**
* Adds the given listener function to the given event name. Returns an identifier for this listener
* that can be used with google.maps.event.removeListener.
*/
addListener(eventName: string, handler: (...args: any[]) => void): MapsEventListener;
/** Binds a View to a Model. */
bindTo(key: string, target: MVCObject, targetKey?: string, noNotify?: boolean): void;
changed(key: string): void;
/** Gets a value. */
get(key: string): any;
/**
* Notify all observers of a change on this property. This notifies both objects that are bound
* to the object's property as well as the object that it is bound to.
*/
notify(key: string): void;
/** Sets a value. */
set(key: string, value: any): void;
/** Sets a collection of key-value pairs. */
setValues(values: any): void;
/**
* Removes a binding. Unbinding will set the unbound property to the current value.
* The object will not be notified, as the value has not changed.
*/
unbind(key: string): void;
/** Removes all bindings. */
unbindAll(): void;
}
@@ -2155,7 +2371,7 @@ declare namespace google.maps {
setBorderColor(borderColor: string): void;
setChannelNumber(channelNumber: string): void;
setFormat(format: AdFormat): void;
setMap(map: Map | null): void;
setMap(map: Map | null): void;
setPosition(position: ControlPosition): void;
setTextColor(textColor: string): void;
setTitleColor(titleColor: string): void;
@@ -2421,19 +2637,51 @@ declare namespace google.maps {
getDrawingMode(): OverlayType;
getMap(): Map;
setDrawingMode(drawingMode: OverlayType): void;
setMap(map: Map | null): void;
setMap(map: Map | null): void;
setOptions(options: DrawingManagerOptions): void;
}
/** Options for the drawing manager. */
export interface DrawingManagerOptions {
/**
* Options to apply to any new circles created with this DrawingManager. The center and radius properties
* are ignored, and the map property of a new circle is always set to the DrawingManager's map.
*/
circleOptions?: CircleOptions;
/** The enabled/disabled state of the drawing control. Defaults to true. */
drawingControl?: boolean;
/** The display options for the drawing control. */
drawingControlOptions?: DrawingControlOptions;
/**
* The DrawingManager's drawing mode, which defines the type of overlay to be added on the map.
* Accepted values are 'marker', 'polygon', 'polyline', 'rectangle', 'circle', or null. A drawing mode
* of null means that the user can interact with the map as normal, and clicks do not draw anything.
*/
drawingMode?: OverlayType;
/**
* The Map to which the DrawingManager is attached, which is the Map on which the overlays created
* will be placed.
*/
map?: Map;
/**
* Options to apply to any new markers created with this DrawingManager. The position property is ignored,
* and the map property of a new marker is always set to the DrawingManager's map.
*/
markerOptions?: MarkerOptions;
/**
* Options to apply to any new polygons created with this DrawingManager. The paths property is ignored,
* and the map property of a new polygon is always set to the DrawingManager's map.
*/
polygonOptions?: PolygonOptions;
/**
* Options to apply to any new polylines created with this DrawingManager. The path property is ignored,
* and the map property of a new polyline is always set to the DrawingManager's map.
*/
polylineOptions?: PolylineOptions;
/**
* Options to apply to any new rectangles created with this DrawingManager. The bounds property is ignored,
* and the map property of a new rectangle is always set to the DrawingManager's map.
*/
rectangleOptions?: RectangleOptions;
}
@@ -2442,16 +2690,43 @@ declare namespace google.maps {
position?: ControlPosition;
}
/** The properties of an overlaycomplete event on a DrawingManager.. */
export interface OverlayCompleteEvent {
/** The completed overlay. */
overlay: Marker|Polygon|Polyline|Rectangle|Circle;
/** The completed overlay's type. */
type: OverlayType;
}
/**
* The types of overlay that may be created by the DrawingManager. Specify these by value, or by using the
* constant's name. For example, 'polygon' or google.maps.drawing.OverlayType.POLYGON.
*/
export enum OverlayType {
/**
* Specifies that the DrawingManager creates circles, and that the overlay given in the overlaycomplete
* event is a circle.
*/
CIRCLE,
/**
* Specifies that the DrawingManager creates markers, and that the overlay given in the overlaycomplete
* event is a marker.
*/
MARKER,
/**
* Specifies that the DrawingManager creates polygons, and that the overlay given in the overlaycomplete
* event is a polygon.
*/
POLYGON,
/**
* Specifies that the DrawingManager creates polylines, and that the overlay given in the overlaycomplete
* event is a polyline.
*/
POLYLINE,
/**
* Specifies that the DrawingManager creates rectangles, and that the overlay given in the overlaycomplete
* event is a rectangle.
*/
RECTANGLE
}
}
@@ -2470,7 +2745,7 @@ declare namespace google.maps {
getZIndex(): number;
setLayerId(layerId: string): void;
setLayerKey(layerKey: string): void;
setMap(map: Map | null): void;
setMap(map: Map | null): void;
setMapId(mapId: string): void;
setOpacity(opacity: number): void;
setOptions(options: MapsEngineLayerOptions): void;
@@ -2514,7 +2789,7 @@ declare namespace google.maps {
setData(data: MVCArray): void;
setData(data: LatLng[]): void;
setData(data: WeightedLocation[]): void;
setMap(map: Map | null): void;
setMap(map: Map | null): void;
}
export interface HeatmapLayerOptions {
+82 -82
View File
@@ -122,90 +122,90 @@ declare namespace ht {
visibleRows?: number;
width?: number|Function;
wordWrap?: boolean;
isEmptyCol?: (col: number) => boolean;
isEmptyRow?: (row: number) => boolean;
isEmptyCol?(col: number): boolean;
isEmptyRow?(row: number): boolean;
// hooks
afterAutofillApplyValues?: (startArea: any[], entireArea: any[]) => void;
afterCellMetaReset?: () => void;
afterChange?: (changes: any[], source: string) => void;
afterChangesObserved?: () => void;
afterColumnMove?: (startColumn: number, endColumn: number) => void;
afterColumnResize?: (currentColumn: number, newSize: number, isDoubleClick: boolean) => void;
afterColumnSort?: (column: number, order: boolean) => void;
afterContextMenuDefaultOptions?: (predefinedItems: any[]) => void;
afterContextMenuHide?: (context: Object) => void;
afterContextMenuShow?: (context: Object) => void;
afterCopyLimit?: (selectedRows: number, selectedColumnds: number, copyRowsLimit: number, copyColumnsLimit: number) => void;
afterCreateCol?: (index: number, amount: number) => void;
afterCreateRow?: (index: number, amount: number) => void;
afterDeselect?: () => void;
afterDestroy?: () => void;
afterDocumentKeyDown?: (event: Event) => void;
afterFilter?: (formulasStack: any[]) => void;
afterGetCellMeta?: (row: number, col: number, cellProperties: Object) => void;
afterGetColHeader?: (col: number, TH: Element) => void;
afterGetColumnHeaderRenderers?: (array: any[]) => void;
afterGetRowHeader?: (row: number, TH: Element) => void;
afterGetRowHeaderRenderers?: (array: any[]) => void;
afterInit?: () => void;
afterLoadData?: (firstTime: boolean) => void;
afterMomentumScroll?: () => void;
afterOnCellCornerMouseDown?: (event: Object) => void;
afterOnCellMouseDown?: (event: Object, coords: Object, TD: Element) => void;
afterOnCellMouseOver?: (event: Object, coords: Object, TD: Element) => void;
afterRemoveCol?: (index: number, amount: number) => void;
afterRemoveRow?: (index: number, amount: number) => void;
afterRender?: (isForced: boolean) => void;
afterRenderer?: (TD: Element, row: number, col: number, prop: string|number, value: string, cellProperties: Object) => void;
afterRowMove?: (startRow: number, endRow: number) => void;
afterRowResize?: (currentRow: number, newSize: number, isDoubleClick: boolean) => void;
afterScrollHorizontally?: () => void;
afterScrollVertically?: () => void;
afterSelection?: (r: number, c: number, r2: number, c2: number) => void;
afterSelectionByProp?: (r: number, p: string, r2: number, p2: string) => void;
afterSelectionEnd?: (r: number, c: number, r2: number, c2: number) => void;
afterSelectionEndByProp?: (r: number, p: string, r2: number, p2: string) => void;
afterSetCellMeta?: (row: number, col: number, key: string, value: any) => void;
afterUpdateSettings?: () => void;
afterValidate?: (isValid: boolean, value: any, row: number, prop: string|number, source: string) => void|boolean;
beforeAutofill?: (start: Object, end: Object, data: any[]) => void;
beforeCellAlignment?: (stateBefore: any, range: any, type: string, alignmentClass: string) => void;
beforeChange?: (changes: any[], source: string) => void;
beforeChangeRender?: (changes: any[], source: string) => void;
beforeColumnMove?: (startColumn: number, endColumn: number) => void;
beforeColumnResize?: (currentColumn: number, newSize: number, isDoubleClick: boolean) => void;
beforeColumnSort?: (column: number, order: boolean) => void;
beforeDrawBorders?: (corners: any[], borderClassName: string) => void;
beforeFilter?: (formulasStack: any[]) => void;
beforeGetCellMeta?: (row: number, col: number, cellProperties: Object) => void;
beforeInit?: () => void;
beforeInitWalkontable?: (walkontableConfig: Object) => void;
beforeKeyDown?: (event: Event) => void;
beforeOnCellMouseDown?: (event: Event, coords: Object, TD: Element) => void;
beforeRemoveCol?: (index: number, amount: number, logicalCols?: any[]) => void;
beforeRemoveRow?: (index: number, amount: number, logicalRows?: any[]) => void;
beforeRender?: (isForced: boolean) => void;
beforeRenderer?: (TD: Element, row: number, col: number, prop: string|number, value: string, cellProperties: Object) => void;
beforeRowMove?: (startRow: number, endRow: number) => void;
beforeRowResize?: (currentRow: number, newSize: number, isDoubleClick: boolean) => any;
beforeSetRangeEnd?: (coords: any[]) => void;
beforeStretchingColumnWidth?: (stretchedWidth: number, column: number) => void;
beforeTouchScroll?: () => void;
beforeValidate?: (value: any, row: number, prop: string|number, source: string) => void;
construct?: () => void;
init?: () => void;
modifyCol?: (col: number) => void;
modifyColHeader?: (column: number) => void;
modifyColWidth?: (width: number, col: number) => void;
modifyCopyableRange?: (copyableRanges: any[]) => void;
modifyRow?: (row: number) => void;
modifyRowHeader?: (row: number) => void;
modifyRowHeight?: (height: number, row: number) => void;
persistentStateLoad?: (key: string, valuePlaceholder: Object) => void;
persistentStateReset?: (key: string) => void;
persistentStateSave?: (key: string, value: any) => void;
unmodifyCol?: (col: number) => void;
afterAutofillApplyValues?(startArea: any[], entireArea: any[]): void;
afterCellMetaReset?(): void;
afterChange?(changes: any[], source: string): void;
afterChangesObserved?(): void;
afterColumnMove?(startColumn: number, endColumn: number): void;
afterColumnResize?(currentColumn: number, newSize: number, isDoubleClick: boolean): void;
afterColumnSort?(column: number, order: boolean): void;
afterContextMenuDefaultOptions?(predefinedItems: any[]): void;
afterContextMenuHide?(context: Object): void;
afterContextMenuShow?(context: Object): void;
afterCopyLimit?(selectedRows: number, selectedColumnds: number, copyRowsLimit: number, copyColumnsLimit: number): void;
afterCreateCol?(index: number, amount: number): void;
afterCreateRow?(index: number, amount: number): void;
afterDeselect?(): void;
afterDestroy?(): void;
afterDocumentKeyDown?(event: Event): void;
afterFilter?(formulasStack: any[]): void;
afterGetCellMeta?(row: number, col: number, cellProperties: Object): void;
afterGetColHeader?(col: number, TH: Element): void;
afterGetColumnHeaderRenderers?(array: any[]): void;
afterGetRowHeader?(row: number, TH: Element): void;
afterGetRowHeaderRenderers?(array: any[]): void;
afterInit?(): void;
afterLoadData?(firstTime: boolean): void;
afterMomentumScroll?(): void;
afterOnCellCornerMouseDown?(event: Object): void;
afterOnCellMouseDown?(event: Object, coords: Object, TD: Element): void;
afterOnCellMouseOver?(event: Object, coords: Object, TD: Element): void;
afterRemoveCol?(index: number, amount: number): void;
afterRemoveRow?(index: number, amount: number): void;
afterRender?(isForced: boolean): void;
afterRenderer?(TD: Element, row: number, col: number, prop: string|number, value: string, cellProperties: Object): void;
afterRowMove?(startRow: number, endRow: number): void;
afterRowResize?(currentRow: number, newSize: number, isDoubleClick: boolean): void;
afterScrollHorizontally?(): void;
afterScrollVertically?(): void;
afterSelection?(r: number, c: number, r2: number, c2: number): void;
afterSelectionByProp?(r: number, p: string, r2: number, p2: string): void;
afterSelectionEnd?(r: number, c: number, r2: number, c2: number): void;
afterSelectionEndByProp?(r: number, p: string, r2: number, p2: string): void;
afterSetCellMeta?(row: number, col: number, key: string, value: any): void;
afterUpdateSettings?(): void;
afterValidate?(isValid: boolean, value: any, row: number, prop: string|number, source: string): void|boolean;
beforeAutofill?(start: Object, end: Object, data: any[]): void;
beforeCellAlignment?(stateBefore: any, range: any, type: string, alignmentClass: string): void;
beforeChange?(changes: any[], source: string): void;
beforeChangeRender?(changes: any[], source: string): void;
beforeColumnMove?(startColumn: number, endColumn: number): void;
beforeColumnResize?(currentColumn: number, newSize: number, isDoubleClick: boolean): void;
beforeColumnSort?(column: number, order: boolean): void;
beforeDrawBorders?(corners: any[], borderClassName: string): void;
beforeFilter?(formulasStack: any[]): void;
beforeGetCellMeta?(row: number, col: number, cellProperties: Object): void;
beforeInit?(): void;
beforeInitWalkontable?(walkontableConfig: Object): void;
beforeKeyDown?(event: Event): void;
beforeOnCellMouseDown?(event: Event, coords: Object, TD: Element): void;
beforeRemoveCol?(index: number, amount: number, logicalCols?: any[]): void;
beforeRemoveRow?(index: number, amount: number, logicalRows?: any[]): void;
beforeRender?(isForced: boolean): void;
beforeRenderer?(TD: Element, row: number, col: number, prop: string|number, value: string, cellProperties: Object): void;
beforeRowMove?(startRow: number, endRow: number): void;
beforeRowResize?(currentRow: number, newSize: number, isDoubleClick: boolean): any;
beforeSetRangeEnd?(coords: any[]): void;
beforeStretchingColumnWidth?(stretchedWidth: number, column: number): void;
beforeTouchScroll?(): void;
beforeValidate?(value: any, row: number, prop: string|number, source: string): void;
construct?(): void;
init?(): void;
modifyCol?(col: number): void;
modifyColHeader?(column: number): void;
modifyColWidth?(width: number, col: number): void;
modifyCopyableRange?(copyableRanges: any[]): void;
modifyRow?(row: number): void;
modifyRowHeader?(row: number): void;
modifyRowHeight?(height: number, row: number): void;
persistentStateLoad?(key: string, valuePlaceholder: Object): void;
persistentStateReset?(key: string): void;
persistentStateSave?(key: string, value: any): void;
unmodifyCol?(col: number): void;
}
interface Methods {
addHook(key: string, callback: Function|any[]): void;
+2 -2
View File
@@ -1,7 +1,7 @@
{
{
"extends": "../tslint.json",
"rules": {
"forbidden-types": false,
"ban-types": false,
"no-single-declare-module": false
}
}
+125 -123
View File
@@ -3,138 +3,140 @@
// Definitions by: Yang Guan <https://github.com/lookuptable>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="leaflet" />
import * as Leaflet from "leaflet";
/*
* Configuration object of a heatmap
*/
interface HeatmapConfiguration {
declare global {
/*
* Configuration object of a heatmap
*/
interface HeatmapConfiguration {
/*
* A background color string in form of hexcode, color name, or rgb(a)
*/
backgroundColor?: string;
/*
* The blur factor that will be applied to all datapoints. The higher the
* blur factor is, the smoother the gradients will be
* Default value: 0.85
*/
blur?: number;
/*
* An object that represents the gradient
*/
gradient?: any;
/*
* The property name of your latitude coordinate in a datapoint
* Default value: 'x'
*/
latField?: string;
/*
* The property name of your longitude coordinate in a datapoint
* Default value: 'y'
*/
lngField?: string;
/*
* The maximal opacity the highest value in the heatmap will have. (will be
* overridden if opacity set)
* Default value: 0.6
*/
maxOpacity?: number;
/*
* The minimum opacity the lowest value in the heatmap will have (will be
* overridden if opacity set)
*/
minOpacity?: number;
/*
* A global opacity for the whole heatmap. This overrides maxOpacity and
* minOpacity if set
*/
opacity?: number;
/*
* The radius each datapoint will have (if not specified on the datapoint
* itself)
*/
radius?: number;
/**
* Scales the radius based on map zoom.
*/
scaleRadius?: boolean;
/*
* Indicate whether the heatmap should use a global extrema or a local
* extrema (the maximum and minimum of the currently displayed viewport)
*/
useLocalExtrema?: boolean;
/*
* The property name of the value/weight in a datapoint
* Default value: 'value'
*/
valueField?: string;
}
/*
* A background color string in form of hexcode, color name, or rgb(a)
*/
backgroundColor?: string;
* A single data point on a heatmap. The keys are specified by
* HeatmapConfig.latField, HeatmapConfig.lngField and HeatmapConfig.valueField
*/
interface HeatmapDataPoint {
[index: string]: number;
}
/*
* The blur factor that will be applied to all datapoints. The higher the
* blur factor is, the smoother the gradients will be
* Default value: 0.85
*/
blur?: number;
* An object representing the set of data points on a heatmap
*/
interface HeatmapData {
/*
* An array of HeatmapDataPoints
*/
data: HeatmapDataPoint[];
/*
* Max value of the valueField
*/
max?: number;
/*
* Min value of the valueField
*/
min?: number;
}
/*
* An object that represents the gradient
*/
gradient?: any;
* The overlay layer to be added onto leaflet map
*/
class HeatmapOverlay {
/*
* The property name of your latitude coordinate in a datapoint
* Default value: 'x'
*/
latField?: string;
/*
* Initialization function
*/
constructor(configuration: HeatmapConfiguration)
/*
* The property name of your longitude coordinate in a datapoint
* Default value: 'y'
*/
lngField?: string;
/*
* Create DOM elements for an overlay, adding them to map panes and puts
* listeners on relevant map events
*/
onAdd(map: Leaflet.Map): void;
/*
* The maximal opacity the highest value in the heatmap will have. (will be
* overridden if opacity set)
* Default value: 0.6
*/
maxOpacity?: number;
/*
* Remove the overlay's elements from the DOM and remove listeners
* previously added by onAdd()
*/
onRemove(map: Leaflet.Map): void;
/*
* The minimum opacity the lowest value in the heatmap will have (will be
* overridden if opacity set)
*/
minOpacity?: number;
/*
* A global opacity for the whole heatmap. This overrides maxOpacity and
* minOpacity if set
*/
opacity?: number;
/*
* The radius each datapoint will have (if not specified on the datapoint
* itself)
*/
radius?: number;
/**
* Scales the radius based on map zoom.
*/
scaleRadius?: boolean;
/*
* Indicate whether the heatmap should use a global extrema or a local
* extrema (the maximum and minimum of the currently displayed viewport)
*/
useLocalExtrema?: boolean;
/*
* The property name of the value/weight in a datapoint
* Default value: 'value'
*/
valueField?: string;
}
/*
* A single data point on a heatmap. The keys are specified by
* HeatmapConfig.latField, HeatmapConfig.lngField and HeatmapConfig.valueField
*/
interface HeatmapDataPoint {
[index: string]: number;
}
/*
* An object representing the set of data points on a heatmap
*/
interface HeatmapData {
/*
* An array of HeatmapDataPoints
*/
data: HeatmapDataPoint[];
/*
* Max value of the valueField
*/
max?: number;
/*
* Min value of the valueField
*/
min?: number;
}
/*
* The overlay layer to be added onto leaflet map
*/
declare class HeatmapOverlay {
/*
* Initialization function
*/
constructor(configuration: HeatmapConfiguration)
/*
* Create DOM elements for an overlay, adding them to map panes and puts
* listeners on relevant map events
*/
onAdd(map: L.Map): void;
/*
* Remove the overlay's elements from the DOM and remove listeners
* previously added by onAdd()
*/
onRemove(map: L.Map): void;
/*
* Initialize a heatmap instance with the given dataset
*/
setData(data: HeatmapData): void;
/*
* Initialize a heatmap instance with the given dataset
*/
setData(data: HeatmapData): void;
}
}
-5
View File
@@ -1,5 +0,0 @@
{
"dependencies": {
"@types/leaflet": "^0.7"
}
}
+8
View File
@@ -9,7 +9,15 @@
"noImplicitThis": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"paths": {
"leaflet": [
"leaflet/v0"
]
},
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
+1 -1
View File
@@ -5,6 +5,6 @@
import * as Highcharts from "highcharts";
declare var HighchartsMore: (H: Highcharts.Static) => Highcharts.Static;
declare function HighchartsMore(H: Highcharts.Static): Highcharts.Static;
export = HighchartsMore;
export as namespace HighchartsMore;
+1 -1
View File
@@ -46,7 +46,7 @@ declare namespace Highstock {
inputBoxHeight?: number;
inputBoxWidth?: number;
inputDateFormat?: string;
inputDateParser?: (date: string) => number;
inputDateParser?(date: string): number;
inputEditDateFormat?: string;
inputEnabled?: boolean;
inputPosition?: {
+50 -50
View File
@@ -96,7 +96,7 @@ declare namespace Highcharts {
* this are axis, chart, isFirst and isLast.
* @default function() {return this.value;}
*/
formatter?: () => string;
formatter?(): string;
/**
* Horizontal axis only. When staggerLines is not set, maxStaggerLines defines how many lines the axis is allowed to
* add to automatically avoid overlapping X labels. Set to 1 to disable overlap detection.
@@ -173,10 +173,10 @@ declare namespace Highcharts {
}
interface MousePlotEvents {
click?: (event: Event) => void;
mouseover?: (event: Event) => void;
mouseout?: (event: Event) => void;
mousemove?: (event: Event) => void;
click?(event: Event): void;
mouseover?(event: Event): void;
mouseout?(event: Event): void;
mousemove?(event: Event): void;
}
/**
@@ -491,19 +491,19 @@ declare namespace Highcharts {
* An event fired after the breaks have rendered.
* @since 4.1.0
*/
afterBreaks?: (event: Event) => void;
afterBreaks?(event: Event): void;
/**
* As opposed to the setExtremes event, this event fires after the final min and max values are computed and
* corrected for minRange.
* The this keyword refers to the {@link AxisObject|Axis} object.
* @since 2.3
*/
afterSetExtremes?: (event: AxisEvent) => void;
afterSetExtremes?(event: AxisEvent): void;
/**
* An event fired when a break from this axis occurs on a point.
* The this keyword refers to the {@link AxisObject|Axis} object.
*/
pointBreak?: (event: Event) => void;
pointBreak?(event: Event): void;
/**
* Fires when the minimum and maximum is set for the axis, either by calling the .setExtremes() method or by
* selecting an area in the chart. One parameter, event, is passed to the function. This contains common event
@@ -516,7 +516,7 @@ declare namespace Highcharts {
* The this keyword refers to the {@link AxisObject|Axis} object.
* @since 1.2.0
*/
setExtremes?: (event: AxisEvent) => void;
setExtremes?(event: AxisEvent): void;
};
/**
* The lowest allowed value for automatically computed axis extremes.
@@ -868,7 +868,7 @@ declare namespace Highcharts {
* behaviour of tickPixelInterval and tickInterval. The automatic tick positions are accessible through
* this.tickPositions and can be modified by the callback.
*/
tickPositioner?: (min: number, max: number) => void;
tickPositioner?(min: number, max: number): void;
/**
* An array defining where the ticks are laid out on the axis. This overrides the default behaviour of
* tickPixelInterval and tickInterval.
@@ -958,7 +958,7 @@ declare namespace Highcharts {
* corrected for minRange.
* The this keyword refers to the {@link AxisObject|Axis} object.
*/
afterSetExtremes?: (event: AxisEvent) => void;
afterSetExtremes?(event: AxisEvent): void;
/**
* Fires when the minimum and maximum is set for the axis, either by calling the .setExtremes() method or by
* selecting an area in the chart. One parameter, event, is passed to the function. This contains common event
@@ -970,7 +970,7 @@ declare namespace Highcharts {
*
* The this keyword refers to the {@link AxisObject|Axis} object.
*/
setExtremes?: (event: AxisEvent) => void;
setExtremes?(event: AxisEvent): void;
};
/**
* Color of the grid lines extending from the axis across the gradient.
@@ -1163,7 +1163,7 @@ declare namespace Highcharts {
* A callback function returning array defining where the ticks are laid out on the axis. This overrides the default
* behaviour of tickPixelInterval and tickInterval.
*/
tickPositioner?: (min: number, max: number) => void;
tickPositioner?(min: number, max: number): void;
/**
* An array defining where the ticks are laid out on the axis. This overrides the default behaviour of
* tickPixelInterval and tickInterval.
@@ -1281,19 +1281,19 @@ declare namespace Highcharts {
* The this keyword refers to the Chart object.
* @since 1.2.0
*/
addSeries?: (event: AddSeriesEvent) => boolean | void;
addSeries?(event: AddSeriesEvent): boolean | void;
/**
* Fires after a chart is printed through the context menu item or the Chart.print method. Requires the exporting
* module.
* @since 4.1.0
*/
afterPrint?: (event: Event) => void;
afterPrint?(event: Event): void;
/**
* Fires before a chart is printed through the context menu item or the Chart.print method. Requires the exporting
* module.
* @since 4.1.0
*/
beforePrint?: (event: Event) => void;
beforePrint?(event: Event): void;
/**
* Fires when clicking on the plot background. One parameter, event, is passed to the function. This contains common
* event information based on jQuery or MooTools depending on which library is used as the base for Highcharts.
@@ -1309,17 +1309,17 @@ declare namespace Highcharts {
* The this keyword refers to the Chart object.
* @since 1.2.0
*/
click?: (event: ChartClickEvent) => void;
click?(event: ChartClickEvent): void;
/**
* Fires when a drilldown point is clicked, before the new series is added.
* @since 3.0.8
*/
drilldown?: (event: ChartDrilldownEvent) => void;
drilldown?(event: ChartDrilldownEvent): void;
/**
* Fires when drilling up from a drilldown series.
* @since 3.0.8
*/
drillup?: (event: Event) => void;
drillup?(event: Event): void;
/**
* Fires when the chart is finished loading. One parameter, event, is passed to the function. This contains common
* event information based on jQuery or MooTools depending on which library is used as the base for Highcharts.
@@ -1329,7 +1329,7 @@ declare namespace Highcharts {
*
* The this keyword refers to the Chart object.
*/
load?: (event: Event) => void;
load?(event: Event): void;
/**
* Fires when the chart is redrawn, either after a call to chart.redraw() or after an axis, series or point is
* modified with the redraw option set to true. One parameter, event, is passed to the function. This contains
@@ -1339,7 +1339,7 @@ declare namespace Highcharts {
* The this keyword refers to the Chart object.
* @since 1.2.0
*/
redraw?: (event: Event) => void;
redraw?(event: Event): void;
/**
* Fires when an area of the chart has been selected. Selection is enabled by setting the chart's zoomType. One
* parameter, event, is passed to the function. This contains common event information based on jQuery or MooTools
@@ -1360,7 +1360,7 @@ declare namespace Highcharts {
* console.log(event.yAxis[0].min, event.yAxis[0].max);
* }
*/
selection?: (event: ChartSelectionEvent) => void;
selection?(event: ChartSelectionEvent): void;
}
interface LinearGradient {
@@ -1886,7 +1886,7 @@ declare namespace Highcharts {
* extended with additional options and passed directly to the chart constructor.
* @since 4.0
*/
complete?: (options: Options) => void;
complete?(options: Options): void;
/**
* A comma delimited string to be parsed. Related options are startRow, endRow, startColumn and endColumn to delimit
* what part of the table is used. The lineDelimiter and itemDelimiter options define the CSV delimiter formats.
@@ -1955,14 +1955,14 @@ declare namespace Highcharts {
* timestamp on success.
* @since 4.0
*/
parseDate?: (val: any) => number;
parseDate?(val: any): number;
/**
* A callback function to access the parsed columns, the two-dimentional input data array directly, before they are
* interpreted into series data and categories. Return false to stop completion, or call this.complete() to continue
* async.
* @since 4.0
*/
parsed?: (columns: [string | number][]) => boolean | void;
parsed?(columns: [string | number][]): boolean | void;
/**
* The same as the columns input option, but defining rows intead of columns.
* @since 4.0
@@ -2080,7 +2080,7 @@ declare namespace Highcharts {
/**
* Callback function to run on click.
*/
onclick: () => void;
onclick(): void;
}
interface Button {
@@ -2184,7 +2184,7 @@ declare namespace Highcharts {
* A click handler callback to use on the button directly instead of the popup menu.
* @since 2.0
*/
onclick?: () => void;
onclick?(): void;
/**
* The symbol for the button. Points to a definition function in the Highcharts.Renderer.symbols collection. The
* default exportIcon function is part of the exporting module.
@@ -2345,7 +2345,7 @@ declare namespace Highcharts {
* charts in specific time zones using their local DST crossover dates, with the help of external libraries.
* @since 4.1.0
*/
getTimezoneOffset?: (timestamp: number) => number;
getTimezoneOffset?(timestamp: number): number;
/**
* The timezone offset in minutes. Positive values are west, negative values are east of UTC, as in the ECMAScript
* getTimezoneOffset method. Use this to display UTC based data in a predefined time zone.
@@ -2624,7 +2624,7 @@ declare namespace Highcharts {
* Callback function to format each of the series' labels. The this keyword refers to the series object, or the
* point object in case of pie charts. By default the series or point name is printed.
*/
labelFormatter?: () => string;
labelFormatter?(): string;
/**
* The layout of the legend items. Can be one of 'horizontal' or 'vertical'.
* @default 'horizontal'
@@ -2983,7 +2983,7 @@ declare namespace Highcharts {
* - this.x: The x value.
* - this.y: The y value.
*/
formatter?: () => string;
formatter?(): string;
/**
* For points with an extent, like columns, whether to align the data label inside the box or to the actual value
* point. Defaults to false in most cases, true in stacked columns.
@@ -3126,7 +3126,7 @@ declare namespace Highcharts {
* The this keyword refers to the Series object.
* @since 4.0
*/
afterAnimate?: (event: Event) => void;
afterAnimate?(event: Event): void;
/**
* Fires when the checkbox next to the series' name in the legend is clicked. One parameter, event, is passed to the
* function. The state of the checkbox is found by event.checked. The checked item is found by event.item. Return
@@ -3135,7 +3135,7 @@ declare namespace Highcharts {
* The this keyword refers to the Series object.
* @since 1.2.0
*/
checkboxClick?: (event: AreaCheckboxEvent) => boolean | void;
checkboxClick?(event: AreaCheckboxEvent): boolean | void;
/**
* Fires when the series is clicked. One parameter, event, is passed to the function. This contains common event
* information based on jQuery or MooTools depending on which library is used as the base for Highcharts.
@@ -3143,14 +3143,14 @@ declare namespace Highcharts {
*
* The this keyword refers to the Series object.
*/
click?: (event: AreaClickEvent) => void;
click?(event: AreaClickEvent): void;
/**
* Fires when the series is hidden after chart generation time, either by clicking the legend item or by calling
* .hide().
*
* The this keyword refers to the Series object.
*/
hide?: () => void;
hide?(): void;
/**
* Fires when the legend item belonging to the series is clicked. One parameter, event, is passed to the function.
* This contains common event information based on jQuery or MooTools depending on which library is used as the base
@@ -3159,7 +3159,7 @@ declare namespace Highcharts {
*
* The this keyword refers to the Series object.
*/
legendItemClick?: (event: Event) => boolean | void;
legendItemClick?(event: Event): boolean | void;
/**
* Fires when the mouse leaves the graph. One parameter, event, is passed to the function. This contains common
* event information based on jQuery or MooTools depending on which library is used as the base for Highcharts. If
@@ -3168,14 +3168,14 @@ declare namespace Highcharts {
*
* The this keyword refers to the Series object.
*/
mouseOut?: (event: Event) => void;
mouseOut?(event: Event): void;
/**
* Fires when the mouse enters the graph. One parameter, event, is passed to the function. This contains common
* event information based on jQuery or MooTools depending on which library is used as the base for Highcharts.
*
* The this keyword refers to the Series object.
*/
mouseOver?: (event: Event) => void;
mouseOver?(event: Event): void;
/**
* Fires when the series is shown after chart generation time, either by clicking the legend item or by calling
* .show().
@@ -3183,7 +3183,7 @@ declare namespace Highcharts {
* The this keyword refers to the Series object.
* @since 1.2.0
*/
show?: () => void;
show?(): void;
}
interface MarkerState {
@@ -3273,7 +3273,7 @@ declare namespace Highcharts {
*
* The this keyword refers to the Point object.
*/
click?: (event: Event) => boolean;
click?(event: Event): boolean;
/**
* Fires when the mouse leaves the area close to the point. One parameter, event, is passed to the function. This
* contains common event information based on jQuery or MooTools depending on which library is used as the base for
@@ -3281,7 +3281,7 @@ declare namespace Highcharts {
*
* The this keyword refers to the Point object.
*/
mouseOut?: (event: Event) => void;
mouseOut?(event: Event): void;
/**
* Fires when the mouse enters the area close to the point. One parameter, event, is passed to the function. This
* contains common event information based on jQuery or MooTools depending on which library is used as the base for
@@ -3289,7 +3289,7 @@ declare namespace Highcharts {
*
* The this keyword refers to the Point object.
*/
mouseOver?: (event: Event) => void;
mouseOver?(event: Event): void;
/**
* Fires when the point is removed using the .remove() method. One parameter, event, is passed to the function.
* Returning false cancels the operation.
@@ -3297,7 +3297,7 @@ declare namespace Highcharts {
* The this keyword refers to the Point object.
* @since 1.2.0
*/
remove?: (event: Event) => boolean | void;
remove?(event: Event): boolean | void;
/**
* Fires when the point is selected either programmatically or following a click on the point. One parameter, event,
* is passed to the function. Returning false cancels the operation.
@@ -3305,7 +3305,7 @@ declare namespace Highcharts {
* The this keyword refers to the Point object.
* @since 1.2.0
*/
select?: (event: Event) => boolean | void;
select?(event: Event): boolean | void;
/**
* Fires when the point is unselected either programmatically or following a click on the point. One parameter,
* event, is passed to the function. Returning false cancels the operation.
@@ -3313,7 +3313,7 @@ declare namespace Highcharts {
* The this keyword refers to the Point object.
* @since 1.2.0
*/
unselect?: (event: Event) => boolean | void;
unselect?(event: Event): boolean | void;
/**
* Fires when the point is updated programmatically through the .update() method. One parameter, event, is passed to
* the function. The new point options can be accessed through event.options. Returning false cancels the operation.
@@ -3321,14 +3321,14 @@ declare namespace Highcharts {
* The this keyword refers to the Point object.
* @since 1.2.0
*/
update?: (event: Event) => boolean | void;
update?(event: Event): boolean | void;
/**
* Fires when the legend item belonging to the pie point (slice) is clicked.
* The this keyword refers to the point itself. One parameter, event, is passed to the function.
* This contains common event information based on jQuery or MooTools depending on which library is used as the base for Highcharts.
* The default action is to toggle the visibility of the point. This can be prevented by calling event.preventDefault().
*/
legendItemClick?: (event: Event) => boolean | void;
legendItemClick?(event: Event): boolean | void;
}
interface Halo {
@@ -3516,7 +3516,7 @@ declare namespace Highcharts {
* - this.x: The x value.
* - this.y: The y value.
*/
formatter?: () => string;
formatter?(): string;
/**
* For points with an extent, like columns, whether to align the data label inside the box or to the actual value
* point. Defaults to false in most cases, true in stacked columns.
@@ -5404,7 +5404,7 @@ declare namespace Highcharts {
* this.y (not shared) / this.points[i].y (shared)
* The y value.
*/
formatter?: () => boolean | string;
formatter?(): boolean | string;
/**
* A callback function to place the tooltip in a default position. The callback receives three parameters:
* labelWidth, labelHeight and point, where point contains values for plotX and plotY telling where the reference
@@ -5413,7 +5413,7 @@ declare namespace Highcharts {
* The return should be an object containing x and y values, for example { x: 100, y: 100 }.
* @since 2.2.4
*/
positioner?: (labelWidth: number, labelHeight: number, point: PlotPoint) => { x: number; y: number; };
positioner?(labelWidth: number, labelHeight: number, point: PlotPoint): { x: number; y: number; };
/**
* Whether to apply a drop shadow to the tooltip.
* @default true
@@ -5516,7 +5516,7 @@ declare namespace Highcharts {
* The this keyword refers to the Point object.
* @since 4.1.0
*/
pointFormatter?: () => string;
pointFormatter?(): string;
/**
* How many decimals to show in each series' y value. This is overridable in each series' tooltip options object.
* The default is to preserve all decimals.
+1 -1
View File
@@ -5,6 +5,6 @@
import { Static } from "highcharts";
declare var HighchartsBoost: (H: Static) => Static;
declare function HighchartsBoost(H: Static): Static;
export = HighchartsBoost;
export as namespace HighchartsBoost;
+1 -1
View File
@@ -5,6 +5,6 @@
import { Static } from "highcharts";
declare var HighchartsExporting: (H: Static) => Static;
declare function HighchartsExporting(H: Static): Static;
export = HighchartsExporting;
export as namespace HighchartsExporting;
+1 -1
View File
@@ -29,6 +29,6 @@ declare module "highcharts" {
}
}
declare var HighchartsNoDataToDisplay: (H: Static) => Static;
declare function HighchartsNoDataToDisplay(H: Static): Static;
export = HighchartsNoDataToDisplay;
export as namespace HighchartsNoDataToDisplay;
+1 -1
View File
@@ -5,6 +5,6 @@
import { Static } from "highcharts";
declare var HighchartsOfflineExporting: (H: Static) => Static;
declare function HighchartsOfflineExporting(H: Static): Static;
export = HighchartsOfflineExporting;
export as namespace HighchartsOfflineExporting;
+1 -1
View File
@@ -1,7 +1,7 @@
{
"extends": "../tslint.json",
"rules": {
"forbidden-types": false,
"ban-types": false,
"unified-signatures": false,
"array-type": false,
"no-empty-interface": false,
+1 -1
View File
@@ -18,4 +18,4 @@ const wss = AzureRelay.createRelayedServer(
wss.on('error', (err: any) => {
console.log('error' + err);
});
});
+1 -1
View File
@@ -24,4 +24,4 @@ export function createRelayToken(uri: string, key_name: string, key: string, exp
export function appendRelayToken(uri: string, key_name: string, key: string, expiry?: number): string;
export function createRelayBaseUri(serviceBusNamespace: string, path: string): string;
export function createRelaySendUri(serviceBusNamespace: string, path: string, token?: any, id?: any): string;
export function createRelayListenUri(serviceBusNamespace: string, path: string, token?: any, id?: any): string;
export function createRelayListenUri(serviceBusNamespace: string, path: string, token?: any, id?: any): string;
+7203 -7784
View File
File diff suppressed because it is too large Load Diff
+4 -1
View File
@@ -1,8 +1,11 @@
{
"extends": "../tslint.json",
"rules": {
"array-type": false,
"dt-header": false,
"forbidden-types": false,
"ban-types": false,
"callable-types": false,
"no-empty-interface": false,
"unified-signatures": false,
"max-line-length": false,
"whitespace": false
+1 -1
View File
@@ -21,7 +21,7 @@ interface JasmineAjaxRequest extends XMLHttpRequest {
password: string;
requestHeaders: { [key: string]: string };
overriddenMimeType: string;
data: () => string;
data(): string;
respondWith(response: JasmineAjaxResponse): void;
}
+1 -1
View File
@@ -1,7 +1,7 @@
{
"extends": "../tslint.json",
"rules": {
"forbidden-types": false,
"ban-types": false,
"unified-signatures": false
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"extends": "../tslint.json",
"rules": {
"forbidden-types": false
"ban-types": false
}
}
+41 -49
View File
@@ -5,18 +5,16 @@
/// <reference types="jquery"/>
declare namespace JQueryValidation
{
type RulesDictionary = { [name: string]: any };
declare namespace JQueryValidation {
interface RulesDictionary { [name: string]: any; }
type ValidatePredicate = ((element: HTMLElement, event: JQueryEventObject) => void);
type ShouldValidatePredicate = boolean|ValidatePredicate;
interface ValidationOptions
{
interface ValidationOptions {
/**
* Enables debug mode. If true, the form is not submitted and certain errors are displayed on the console
* Enables debug mode. If true, the form is not submitted and certain errors are displayed on the console
* (will check if a window.console property exists). Try to enable when a form is just submitted instead of validation stopping the submit.
*
* default: false
@@ -48,24 +46,24 @@ declare namespace JQueryValidation
*
* default: Places the error label after the invalid element
*/
errorPlacement?: (error: JQuery, element: JQuery) => void;
errorPlacement?(error: JQuery, element: JQuery): void;
/**
* If enabled, removes the errorClass from the invalid elements and hides all error messages whenever the element is focused.
* If enabled, removes the errorClass from the invalid elements and hides all error messages whenever the element is focused.
* Avoid combination with focusInvalid.
*
* default: false
*/
focusCleanup?: boolean;
/**
* Focus the last active or first invalid element on submit via validator.focusInvalid(). The last active element is the one
* that had focus when the form was submitted, avoiding stealing its focus. If there was no element focused, the first one
* Focus the last active or first invalid element on submit via validator.focusInvalid(). The last active element is the one
* that had focus when the form was submitted, avoiding stealing its focus. If there was no element focused, the first one
* in the form gets it, unless this option is turned off.
*
* default: true
*/
focusInvalid?: boolean;
/**
* Specify grouping of error messages. A group consists of an arbitrary group name as the key and a space separated list of
* Specify grouping of error messages. A group consists of an arbitrary group name as the key and a space separated list of
* element names as the value. Use errorPlacement to control where the group message is placed.
*/
groups?: { [groupName: string]: string };
@@ -74,29 +72,29 @@ declare namespace JQueryValidation
*
* default: Adds errorClass (see the option) to the element
*/
highlight?: (element: HTMLElement, errorClass: string, validClass: string) => void;
highlight?(element: HTMLElement, errorClass: string, validClass: string): void;
/**
* Elements to ignore when validating, simply filtering them out. jQuery's not-method is used, therefore everything that is
* Elements to ignore when validating, simply filtering them out. jQuery's not-method is used, therefore everything that is
* accepted by not() can be passed as this option. Inputs of type submit and reset are always ignored, so are disabled elements.
*/
ignore?: string;
/**
* Set to skip reading messages from the title attribute, helps to avoid issues with Google Toolbar; default is false for compability,
* Set to skip reading messages from the title attribute, helps to avoid issues with Google Toolbar; default is false for compability,
* the message-from-title is likely to be completely removed in a future release.
*
* default: false
*/
ignoreTitle?: boolean;
/**
* Callback for custom code when an invalid form is submitted. Called with an event object as the first argument, and the validator
* Callback for custom code when an invalid form is submitted. Called with an event object as the first argument, and the validator
* as the second.
*/
invalidHandler?: (event: JQueryEventObject, validator: Validator) => void;
invalidHandler?(event: JQueryEventObject, validator: Validator): void;
/**
* Key/value pairs defining custom messages. Key is the name of an element, value the message to display for that element. Instead
* of a plain message, another map with specific messages for each rule can be used. Overrides the title attribute of an element or
* the default message for the method (in that order). Each message can be a String or a Callback. The callback is called in the scope
* of the validator, with the rule's parameters as the first argument and the element as the second, and must return a String to display
* Key/value pairs defining custom messages. Key is the name of an element, value the message to display for that element. Instead
* of a plain message, another map with specific messages for each rule can be used. Overrides the title attribute of an element or
* the default message for the method (in that order). Each message can be a String or a Callback. The callback is called in the scope
* of the validator, with the rule's parameters as the first argument and the element as the second, and must return a String to display
* as the message.
*
* default: the default message for the method used
@@ -111,8 +109,8 @@ declare namespace JQueryValidation
*/
onclick?: ShouldValidatePredicate;
/**
* Function. Validate elements when user focuses in. If omitted hides all other fields marked as invalid.
*
* Function. Validate elements when user focuses in. If omitted hides all other fields marked as invalid.
*
* Set to a custom Function to decide for yourself when to run validation.
*/
onfocusin?: ValidatePredicate;
@@ -124,7 +122,7 @@ declare namespace JQueryValidation
*/
onfocusout?: ShouldValidatePredicate;
/**
* Boolean or Function. Validate elements on keyup. As long as the field is not marked as invalid, nothing happens.
* Boolean or Function. Validate elements on keyup. As long as the field is not marked as invalid, nothing happens.
* Otherwise, all rules are checked on each key up event. Set to false to disable.
*
* Set to a Function to decide for yourself when to run validation.
@@ -140,36 +138,36 @@ declare namespace JQueryValidation
*/
onsubmit?: boolean;
/**
* A custom message display handler. Gets the map of errors as the first argument and an array of errors as the second,
* called in the context of the validator object. The arguments contain only those elements currently validated,
* which can be a single element when doing validation onblur/keyup. You can trigger (in addition to your own messages)
* A custom message display handler. Gets the map of errors as the first argument and an array of errors as the second,
* called in the context of the validator object. The arguments contain only those elements currently validated,
* which can be a single element when doing validation onblur/keyup. You can trigger (in addition to your own messages)
* the default behaviour by calling this.defaultShowErrors().
*/
rules?: RulesDictionary;
/**
* A custom message display handler. Gets the map of errors as the first argument and an array of errors as the second,
* called in the context of the validator object. The arguments contain only those elements currently validated, which can
* be a single element when doing validation onblur/keyup. You can trigger (in addition to your own messages) the default
* A custom message display handler. Gets the map of errors as the first argument and an array of errors as the second,
* called in the context of the validator object. The arguments contain only those elements currently validated, which can
* be a single element when doing validation onblur/keyup. You can trigger (in addition to your own messages) the default
* behaviour by calling this.defaultShowErrors().
*/
showErrors?: (errorMap: ErrorDictionary, errorList: ErrorListItem[]) => void;
showErrors?(errorMap: ErrorDictionary, errorList: ErrorListItem[]): void;
/**
* Callback for handling the actual submit when the form is valid. Gets the form and the event object. Replaces the default submit.
* Callback for handling the actual submit when the form is valid. Gets the form and the event object. Replaces the default submit.
* The right place to submit a form via Ajax after it is validated.
*/
submitHandler?: (form: HTMLFormElement, event?: JQueryEventObject) => void;
submitHandler?(form: HTMLFormElement, event?: JQueryEventObject): void;
/**
* String or Function. If specified, the error label is displayed to show a valid element. If a String is given, it is added as
* a class to the label. If a Function is given, it is called with the label (as a jQuery object) and the validated input (as a DOM element).
* String or Function. If specified, the error label is displayed to show a valid element. If a String is given, it is added as
* a class to the label. If a Function is given, it is called with the label (as a jQuery object) and the validated input (as a DOM element).
* The label can be used to add a text like "ok!".
*/
success?: string|{($label: JQuery, validatedInput: HTMLElement): void};
success?: string | (($label: JQuery, validatedInput: HTMLElement) => void);
/**
* Called to revert changes made by option highlight, same arguments as highlight.
*
* default: Removes the errorClass
*/
unhighlight?: (element: HTMLElement, errorClass: string, validClass: string) => void;
unhighlight?(element: HTMLElement, errorClass: string, validClass: string): void;
/**
* This class is added to an element after it was validated and considered valid.
*
@@ -184,19 +182,16 @@ declare namespace JQueryValidation
wrapper?: string;
}
interface ErrorDictionary
{
interface ErrorDictionary {
[name: string]: string;
}
interface ErrorListItem
{
interface ErrorListItem {
message: string;
element: HTMLElement;
}
interface ValidatorStatic
{
interface ValidatorStatic {
/**
* Add a compound class method - useful to refactor common combinations of rules into a single class.
*
@@ -236,8 +231,7 @@ declare namespace JQueryValidation
methods: { [index: string]: Function };
}
interface Validator
{
interface Validator {
element(element: string|JQuery): boolean;
checkForm(): boolean;
/**
@@ -277,8 +271,7 @@ declare namespace JQueryValidation
}
}
interface JQuery
{
interface JQuery {
/**
* Remove the specified attributes from the first matched element and return them.
*
@@ -288,7 +281,7 @@ interface JQuery
// tslint:disable:unified-signatures
/**
* Adds the specified rules and returns all rules for the first matched element. Requires that the parent form is validated, that is, $( "form" ).validate() is called first.
*
*
* @param command "remove" or "add"
* @param rules The rules to add. Accepts the same format as the rules-option of the validate-method.
*/
@@ -317,8 +310,7 @@ interface JQuery
validate(options?: JQueryValidation.ValidationOptions): JQueryValidation.Validator;
}
interface JQueryStatic
{
interface JQueryStatic {
/**
* Replaces {n} placeholders with arguments.
*
@@ -12,9 +12,9 @@ function test_validate() {
});
$(".selector").validate({
invalidHandler: (form, validator) => {
var errors = validator.numberOfInvalids();
const errors = validator.numberOfInvalids();
if (errors) {
var message = errors == 1
const message = errors === 1
? 'You missed 1 field. It has been highlighted'
: 'You missed ' + errors + ' fields. They have been highlighted';
$("div.error span").html(message);
@@ -55,8 +55,8 @@ function test_validate() {
username: "fname lname"
},
errorPlacement: (error, element) => {
if (element.attr("name") == "fname"
|| element.attr("name") == "lname")
if (element.attr("name") === "fname"
|| element.attr("name") === "lname")
error.insertAfter("#lastname");
else
error.insertAfter(element);
@@ -97,7 +97,7 @@ function test_validate() {
});
$("#myform").validate({
meta: "validate",
submitHandler: () => { alert("Submitted!") }
submitHandler: () => { alert("Submitted!"); }
});
$(".selector").validate({
errorClass: "invalid"
@@ -114,13 +114,13 @@ function test_validate() {
$("#myform").validate({
errorLabelContainer: "#messageBox",
wrapper: "li",
submitHandler: () => { alert("Submitted!") }
submitHandler: () => { alert("Submitted!"); }
});
$("#myform").validate({
errorContainer: "#messageBox1, #messageBox2",
errorLabelContainer: "#messageBox1 ul",
wrapper: "li", debug: true,
submitHandler: () => { alert("Submitted!") }
submitHandler: () => { alert("Submitted!"); }
});
$(".selector").validate({
showErrors: (errorMap: JQueryValidation.ErrorDictionary, errorList: JQueryValidation.ErrorListItem[]) => {
@@ -136,13 +136,13 @@ function test_validate() {
});
$("#myform").validate({
success: "valid",
submitHandler: () => { alert("Submitted!") }
submitHandler: () => { alert("Submitted!"); }
});
$("#myform").validate({
success: (label) => {
label.addClass("valid").text("Ok!")
label.addClass("valid").text("Ok!");
},
submitHandler: () => { alert("Submitted!") }
submitHandler: () => { alert("Submitted!"); }
});
$(".selector").validate({
highlight: (element, errorClass) => {
@@ -176,7 +176,7 @@ function test_validate() {
$('.selector').validate({
onfocusout: () => {},
onkeyup: () => {},
onclick: (elt) => { return 2; }
onclick: elt => 2,
});
}
@@ -205,7 +205,7 @@ function test_methods() {
}
});
$("#skip").click(() => {
var rules = $("#myinput").removeAttrs("min max");
const rules = $("#myinput").removeAttrs("min max");
$("#myform").submit();
$("#myinput").attr(rules);
});
@@ -213,25 +213,25 @@ function test_methods() {
$("#myform").validate().form();
$("#myform").validate().element("#myselect");
$("#myform").validate().element($("#myselect"));
var validator = $("#myform").validate();
const validator = $("#myform").validate();
validator.resetForm();
validator.showErrors({ "firstname": "I know that your firstname is Pete, Pete!" });
validator.showErrors({ firstname: "I know that your firstname is Pete, Pete!" });
validator.hideErrors();
var isValid: boolean = validator.valid();
var size: number = validator.size();
var errorMap: JQueryValidation.ErrorDictionary = validator.errorMap;
var errorList: JQueryValidation.ErrorListItem[] = validator.errorList;
const isValid: boolean = validator.valid();
const size: number = validator.size();
const errorMap: JQueryValidation.ErrorDictionary = validator.errorMap;
const errorList: JQueryValidation.ErrorListItem[] = validator.errorList;
$("#summary").text(validator.numberOfInvalids() + " field(s) are invalid");
var invalidElements: HTMLElement[] = validator.invalidElements();
var validElements: HTMLElement[] = validator.validElements();
const invalidElements: HTMLElement[] = validator.invalidElements();
const validElements: HTMLElement[] = validator.validElements();
}
function test_static_methods() {
jQuery.validator.setDefaults({
debug: true
});
jQuery.validator.addMethod("domain", function (value, element) {
jQuery.validator.addMethod("domain", function(value, element) {
return this.optional(element) || /^http:\/\/mycorporatedomain.com/.test(value);
}, "Please specify the correct domain for your documents");
jQuery.validator.addClassRules({
+1 -1
View File
@@ -1,6 +1,6 @@
{
"extends": "../tslint.json",
"rules": {
"forbidden-types": false
"ban-types": false
}
}
+3 -3
View File
@@ -7,9 +7,9 @@ import * as JSData from 'js-data';
declare module 'js-data' {
interface DSHttpAdapterOptions {
serialize?: (resourceName: string, data: any) => any;
deserialize?: (resourceName: string, data: any) => any;
queryTransform?: (resourceName: string, params: DSFilterParams) => any;
serialize?(resourceName: string, data: any): any;
deserialize?(resourceName: string, data: any): any;
queryTransform?(resourceName: string, params: DSFilterParams): any;
httpConfig?: any;
forceTrailingSlash?: boolean;
log?: boolean | ((message?: any, ...optionalParams: any[]) => void);
+1 -1
View File
@@ -1,7 +1,7 @@
{
"extends": "../tslint.json",
"rules": {
"forbidden-types": false,
"ban-types": false,
"no-misused-new": false
}
}
+1 -1
View File
@@ -71,7 +71,7 @@ export interface GridRow {
type: "open"|"fold";
/** @property {Function} [type="null"] State value that indicates whether a child row is shown or hidden. */
tpl?: () => void;
tpl?(): void;
setIndex(rownum: number|string): void;
reload(columns: GridColumn[], seq: any, xssFilter: any): void;
+1 -1
View File
@@ -1,6 +1,6 @@
{
"extends": "../tslint.json",
"rules": {
"forbidden-types": false
"ban-types": false
}
}
-4
View File
@@ -23,11 +23,9 @@
=============================================== */
import * as Koa from "koa";
declare function views(dir: string, opts?: {
/*
* default extension for your views
*/
@@ -44,13 +42,11 @@ declare function views(dir: string, opts?: {
* replace consolidate as default engine source
*/
engineSource?: any,
}): Koa.Middleware;
declare namespace views { }
export = views;
import * as koa from "koa";
declare module 'koa' {
+1 -1
View File
@@ -16,4 +16,4 @@ app.use((ctx: Koa.Context) => {
ctx.render('user', {
user: 'John'
}).then(() => console.log('done render call'));
});
});
+1 -1
View File
@@ -1,6 +1,6 @@
{
"extends": "../tslint.json",
"rules": {
"forbidden-types": false
"ban-types": false
}
}
-5
View File
@@ -1,5 +0,0 @@
{
"dependencies": {
"@types/leaflet": "^0.7"
}
}
+3
View File
@@ -9,6 +9,9 @@
"noImplicitThis": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
+8 -8
View File
@@ -3,9 +3,9 @@
// Definitions by: Dominic Alie <https://github.com/dalie>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="leaflet" />
import * as Leaflet from "leaflet";
declare namespace L {
declare global { namespace L {
/**
* Make geometries editable in Leaflet.
*
@@ -43,12 +43,12 @@ declare namespace L {
/**
* Layer used to store edit tools (vertex, line guide…).
*/
editLayer?: L.LayerGroup<L.ILayer>;
editLayer?: Leaflet.LayerGroup<Leaflet.ILayer>;
/**
* Default layer used to store drawn features (marker, polyline…).
*/
featuresLayer?: L.LayerGroup<L.Polyline|L.Polygon|L.Marker>;
featuresLayer?: Leaflet.LayerGroup<L.Polyline|L.Polygon|L.Marker>;
/**
* Class to be used as vertex, for path editing.
@@ -104,20 +104,20 @@ declare namespace L {
* Start drawing a polyline. If latlng is given, a first point will be added. In any case, continuing on user
* click. If options is given, it will be passed to the polyline class constructor.
*/
startPolyline(latLng?: LatLng, options?: L.PolylineOptions): L.Polyline;
startPolyline(latLng?: LatLng, options?: Leaflet.PolylineOptions): L.Polyline;
/**
* Start drawing a polygon. If latlng is given, a first point will be added. In any case, continuing on user
* click. If options is given, it will be passed to the polygon class constructor.
*/
startPolygon(latLng?: LatLng, options?: L.PolylineOptions): L.Polygon;
startPolygon(latLng?: LatLng, options?: Leaflet.PolylineOptions): L.Polygon;
/**
* Start adding a marker. If latlng is given, the marker will be shown first at this point. In any case, it
* will follow the user mouse, and will have a final latlng on next click (or touch). If options is given,
* it will be passed to the marker class constructor.
*/
startMarker(latLng?: LatLng, options?: L.MarkerOptions): L.Marker;
startMarker(latLng?: LatLng, options?: Leaflet.MarkerOptions): L.Marker;
/**
* When you need to stop any ongoing drawing, without needing to know which editor is active.
@@ -255,4 +255,4 @@ declare namespace L {
export interface Polygon extends EditableMixin, PolygonEditor {
}
}
} }
@@ -1,4 +1,11 @@
class MarkerClass { }
class MarkerEditorClass { }
class MiddleMarkerClass { }
class PolygonClass { }
class PolygonEditorClass { }
class PolylineClass { }
class PolylineEditorClass { }
class VertexMarkerClass { }
var map: L.Map = L.map('div', {
editable: true,
@@ -46,12 +53,3 @@ enabled = polygon.editEnabled();
polygon.newHole(L.latLng(0, 0));
polygon.reset();
polygon.toggleEdit();
class MarkerClass { }
class MarkerEditorClass { }
class MiddleMarkerClass { }
class PolygonClass { }
class PolygonEditorClass { }
class PolylineClass { }
class PolylineEditorClass { }
class VertexMarkerClass { }
-5
View File
@@ -1,5 +0,0 @@
{
"dependencies": {
"@types/leaflet": "^0.7"
}
}
+8
View File
@@ -9,7 +9,15 @@
"noImplicitThis": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"paths": {
"leaflet": [
"leaflet/v0"
]
},
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
-5
View File
@@ -1,5 +0,0 @@
{
"dependencies": {
"@types/leaflet": "^1.0.58"
}
}
+3
View File
@@ -9,6 +9,9 @@
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
+9 -9
View File
@@ -3,18 +3,18 @@
// Definitions by: Leonard Lausen <http://leonard.lausen.nl/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="leaflet" />
import * as Leaflet from "leaflet";
declare namespace L {
declare global { namespace L {
namespace Control {
export interface GeocoderStatic extends ClassStatic {
export interface GeocoderStatic extends Leaflet.ClassStatic {
/**
* Creates a geocoder control.
*/
new (options?: GeocoderOptions): Geocoder;
}
export interface Geocoder extends L.Control {
export interface Geocoder extends Leaflet.Control {
}
export interface GeocoderOptions {
@@ -32,7 +32,7 @@ declare namespace L {
*
* Default value: false.
*/
bounds?: LatLngBounds | boolean;
bounds?: Leaflet.LatLngBounds | boolean;
/**
* If true, search and autocomplete prioritizes results near the center
@@ -42,7 +42,7 @@ declare namespace L {
*
* Default value: 'true'.
*/
focus?: LatLng | boolean;
focus?: Leaflet.LatLng | boolean;
/**
* Filters results by layers (documentation).
@@ -77,7 +77,7 @@ declare namespace L {
*
* Default value: 'topleft'.
*/
position?: L.PositionString;
position?: Leaflet.PositionString;
/**
* Attribution text to include.
@@ -126,7 +126,7 @@ declare namespace L {
*
* Default value: true
*/
markers?: MarkerOptions | boolean;
markers?: Leaflet.MarkerOptions | boolean;
/**
* If true, the input box will expand to take up the full width of the map container.
@@ -173,4 +173,4 @@ declare namespace L {
*/
export function geocoder(api_key: string, options?: Control.GeocoderOptions): L.Control.Geocoder;
}
}
} }
@@ -1,5 +0,0 @@
{
"dependencies": {
"@types/leaflet": "^0.7"
}
}
@@ -9,7 +9,15 @@
"noImplicitThis": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"paths": {
"leaflet": [
"leaflet/v0"
]
},
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
+1 -1
View File
@@ -3,7 +3,7 @@
// Definitions by: Wim Looman <https://github.com/Nemo157>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="leaflet" />
import * as Leaflet from "leaflet";
declare global {
namespace L {
-5
View File
@@ -1,5 +0,0 @@
{
"dependencies": {
"@types/leaflet": "^0.7"
}
}
+8
View File
@@ -9,7 +9,15 @@
"noImplicitThis": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"paths": {
"leaflet": [
"leaflet/v0"
]
},
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
-5
View File
@@ -1,5 +0,0 @@
{
"dependencies": {
"@types/leaflet": "^1.0"
}
}
+6 -6
View File
@@ -3,15 +3,15 @@
// Definitions by: Egor Komarov <https://github.com/Odrin>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="leaflet" />
import * as Leaflet from "leaflet";
declare module L {
declare global { namespace L {
module AwesomeMarkers {
var version: string;
function icon(options: AwesomeMarkers.IconOptions): AwesomeMarkers.Icon;
interface IconStatic extends L.IconStatic {
interface IconStatic extends Leaflet.IconStatic {
/**
* Creates an icon instance with the given options.
*/
@@ -27,11 +27,11 @@ declare module L {
};
}
interface Icon extends L.Icon {
interface Icon extends Leaflet.Icon {
options: AwesomeMarkers.IconOptions;
}
interface IconOptions extends L.IconOptions {
interface IconOptions extends Leaflet.IconOptions {
/**
* Name of the icon. See glyphicons or font-awesome.
*/
@@ -65,4 +65,4 @@ declare module L {
var Icon: AwesomeMarkers.IconStatic;
}
}
} }
@@ -1,5 +0,0 @@
{
"dependencies": {
"@types/leaflet": "^0.7"
}
}
@@ -9,7 +9,15 @@
"noImplicitThis": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"paths": {
"leaflet": [
"leaflet/v0"
]
},
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
-5
View File
@@ -1,5 +0,0 @@
{
"dependencies": {
"@types/leaflet": "^0.7"
}
}
+3
View File
@@ -9,6 +9,9 @@
"noImplicitThis": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
-5
View File
@@ -1,5 +0,0 @@
{
"dependencies": {
"@types/leaflet": "^1.0.58"
}
}
@@ -9,6 +9,9 @@
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
+1 -1
View File
@@ -1,6 +1,6 @@
{
"extends": "../tslint.json",
"rules": {
"forbidden-types": false
"ban-types": false
}
}
+50
View File
@@ -0,0 +1,50 @@
// Type definitions for tweezer.js 2.0
// Project: https://github.com/markdown-it/linkify-it
// Definitions by: Lindsey Smith <https://github.com/praxxis>, Robert Coie <https://github.com/rapropos/typed-linkify-it>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare const LinkifyIt: {
(schemas?: LinkifyIt.SchemaRules, options?: LinkifyIt.Options): LinkifyIt.LinkifyIt;
new (schemas?: LinkifyIt.SchemaRules, options?: LinkifyIt.Options): LinkifyIt.LinkifyIt;
};
declare namespace LinkifyIt {
export interface FullRule {
validate: (text: string, pos: number, self: LinkifyIt) => number;
normalize?: (match: string) => string;
}
export type Rule = string | RegExp | FullRule;
export interface SchemaRules {
[schema: string]: Rule;
}
export interface Options {
fuzzyLink?: boolean;
fuzzyIP?: boolean;
fuzzyEmail?: boolean;
}
export interface Match {
index: number;
lastIndex: number;
raw: string;
schema: string;
text: string;
url: string;
}
export interface LinkifyIt {
add(schema: string, rule: Rule): LinkifyIt;
match(text: string): Match[];
normalize(raw: string): string;
pretest(text: string): boolean;
set(options: Options): LinkifyIt;
test(text: string): boolean;
testSchemaAt(text: string, schemaName: string, pos: number): number;
tlds(list: string | string[], keepOld?: boolean): LinkifyIt;
}
}
export = LinkifyIt;
+24
View File
@@ -0,0 +1,24 @@
import LinkifyIt = require('linkify-it');
// fluent interface
const linkifier = new LinkifyIt();
linkifier
.add('git:', 'http:')
.set({ fuzzyIP: true })
.tlds('onion', true)
.test("https://github.com/DefinitelyTyped/DefinitelyTyped/");
// match
const matches = linkifier.match("https://github.com/DefinitelyTyped/DefinitelyTyped/");
matches.forEach(({index, lastIndex, raw, schema, text, url}) => {});
// complex rule
linkifier.add('@', {
validate: (text, pos, self) => {
return 42;
},
normalize: (match) => {
return 'forty-two';
}
});
+22
View File
@@ -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",
"linkify-it-tests.ts"
]
}
+1 -1
View File
@@ -1,2 +1,2 @@
import { add } from "../index";
export = add;
export = add;

Some files were not shown because too many files have changed in this diff Show More