Merge branch 'master' of github.com:DefinitelyTyped/DefinitelyTyped

# By Ilya Mochalov (82) and others
# Via Masahiro Wakame (803) and others
* 'master' of github.com:DefinitelyTyped/DefinitelyTyped: (3036 commits)
  Update authors as per @mtraynham request
  Partial revert of 1f3e28f - remove duplicate svgRendering identifier
  Revert "Add NavbarHeader to react-bootstrap"
  added in custom error classes
  removed duplicate element "require"
  Split into different folders
  Add more definitions based on documentation.
  Removed implicit any types
  Updated IDialogOptions to include contentElement property for prerendered dialogs. Updated IPromptDialog to add initialValue method. Adding missing semicolon to IPanelConfig.
  Fixed paths in v1 files
  Create a copy of the old v1 files
  Updated IDialogOptions to include contentElement property for prerendered dialogs. Updated IPromptDialog to add initialValue method. Adding missing semicolon to IPanelConfig.
  Added interfaces for Angular Material $mdPanel service, MdPanelPosition type, and MdPanelAnimation type as part of release 1.1.0-rc.5 (2016-06-03). Updated IDialogService show method to include previously added IPromptDialog.
  changed serializers as per package author
  Fix ua-parser-js definitions. Fix code style.
  Improved testing and add property "context" in OptionsObj
  Fix type for Lovefield RawForeignKeySpec object
  Fix ua-parser-js definitions.
  Fix ua-parser-js definitions.
  Update atmosphere.d.ts
  ...

Conflicts:
	state-machine/state-machine.d.ts
This commit is contained in:
samael
2016-06-28 08:27:41 +08:00
3471 changed files with 979923 additions and 425524 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
# Auto detect text files and perform LF normalization
* text=none
* text=auto
# Custom for Visual Studio
*.cs diff=csharp
+37 -37
View File
@@ -1,37 +1,37 @@
*.dll
*.exe
*.cmd
*.pdb
*.suo
*.js
*.user
*.cache
*.cs
*.sln
*.csproj
*.txt
*.map
*.swp
.DS_Store
npm-debug.log
_Resharper.DefinitelyTyped
bin
obj
Properties
# VIM backup files
*~
# test folder
_infrastructure/tests/build
.idea
*.iml
*.js.map
!*.js/
node_modules
.sublimets
.settings/launch.json
*.dll
*.exe
*.cmd
*.pdb
*.suo
*.js
*.user
*.cache
*.cs
*.sln
*.csproj
*.txt
*.map
*.swp
.DS_Store
npm-debug.log
_Resharper.DefinitelyTyped
bin
obj
Properties
# VIM backup files
*~
# test folder
_infrastructure/tests/build
.idea
*.iml
*.js.map
!*.js/
node_modules
.sublimets
.settings/launch.json
+510 -113
View File
File diff suppressed because it is too large Load Diff
+9
View File
@@ -0,0 +1,9 @@
/// <reference path="CybozuLabs-md5.d.ts" />
var hash: string;
hash = CybozuLabs.MD5.calc("abc");
hash = CybozuLabs.MD5.calc("abc", CybozuLabs.MD5.BY_ASCII);
hash = CybozuLabs.MD5.calc("abc", CybozuLabs.MD5.BY_UTF16);
var version: string;
version = CybozuLabs.MD5.VERSION;
+11
View File
@@ -0,0 +1,11 @@
// Type definitions for CybozuLabs.MD5
// Project: http://labs.cybozu.co.jp/blog/mitsunari/2007/07/md5js_1.html
// Definitions by: MIZUNE Pine <https://github.com/pine613>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace CybozuLabs.MD5 {
var VERSION: string;
var BY_ASCII: number;
var BY_UTF16: number;
function calc(str: string, option?: number): string;
}
+9
View File
@@ -1,5 +1,14 @@
/// <reference path="FileSaver.d.ts" />
import {saveAs as importedSaveAs} from "file-saver";
function testImportedSaveAs() {
var data: Blob = new Blob(["Hello, world!"], {type: "text/plain;charset=utf-8"});
var filename: string = 'hello world.txt';
var disableAutoBOM = true;
importedSaveAs(data, filename, disableAutoBOM);
}
/**
* @summary Test for "saveAs" function.
*/
+7 -2
View File
@@ -1,7 +1,7 @@
// Type definitions for FileSaver.js
// Project: https://github.com/eligrey/FileSaver.js/
// Definitions by: Cyril Schumacher <https://github.com/cyrilschumacher>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/**
* @summary Interface for "saveAs" function.
@@ -15,7 +15,7 @@ interface FileSaver {
* @type {Blob}
*/
data: Blob,
/**
* @summary File name.
* @type {DOMString}
@@ -31,3 +31,8 @@ interface FileSaver {
}
declare var saveAs: FileSaver;
declare module "file-saver" {
var fileSaver: { saveAs: typeof saveAs };
export = fileSaver
}
+368 -368
View File
@@ -1,368 +1,368 @@
/// <reference path="Finch.d.ts" />
function test_Finch() {
Finch.route("Hello/Route", function() {
return console.log("Well hello there! How you doin'?!");
});
Finch.route("Hello/Route/:someId", function(bindings) {
return console.log("Hey! Here's Some Id: " + bindings.someId);
});
Finch.route("Hello/Route/:someId", function(bindings, childCallback) {
console.log("Hey! Here's Some Id: " + bindings.someId);
return childCallback();
});
Finch.route("some/route", {
setup: function(bindings) {
return console.log("Some Route has been setup! :)");
},
load: function(bindings) {
return console.log("Some Route has been loaed! :D");
},
unload: function(bindings) {
return console.log("Some Route has been loaed! :(");
},
teardown: function(bindings) {
return console.log("Some Route has been torndown! :'(");
}
});
Finch.route("some/route", {
setup: function(bindings, childCallback) {
console.log("Some Route has been setup! :)");
return childCallback();
},
load: function(bindings, childCallback) {
console.log("Some Route has been loaed! :D");
return childCallback();
},
unload: function(bindings, childCallback) {
console.log("Some Route has been loaed! :(");
return childCallback();
},
teardown: function(bindings, childCallback) {
console.log("Some Route has been torndown! :'(");
return childCallback();
}
});
Finch.call("Some/Route");
Finch.route("Some/Route", function() {
return Finch.observe("hello", "foo", function(hello: any, foo: string) {
return console.log("" + hello + " and " + foo);
});
});
Finch.route("Some/Route", function() {
return Finch.observe(["hello", "foo"], function(hello: any, foo: any) {
return console.log("" + hello + " and " + foo);
});
});
Finch.route("Some/Route", function(bindings) {
return Finch.observe(function(params) {
});
});
Finch.navigate("Some/Route");
Finch.navigate("Some/Route", {
hello: 'world',
foo: 'bar'
});
Finch.navigate("Some/Route", {
foo: 'bar'
}, true);
Finch.navigate("Some/Route", true);
Finch.navigate({
hello: 'world2',
wow: 'wee'
});
Finch.navigate({
foo: 'bar',
wow: 'wee!!!'
});
Finch.navigate({
hello: 'world2'
}, true);
Finch.listen();
Finch.ignore();
Finch.abort();
//test from Finch
Finch.call("/foo/bar");
Finch.call("/foo/bar/123");
Finch.call("/foo/bar/123");
Finch.call("/foo/bar/123?x=Hello&y=World");
Finch.call("/foo/baz/456");
Finch.call("/quux/789?band=Sunn O)))&genre=Post-Progressive Fridgecore");
Finch.call("/foo/bar/baz");
Finch.call("/foo/bar/quux");
Finch.call("/foo");
Finch.call("/foo/bar");
Finch.call("/foo");
Finch.call("/foo");
Finch.call("/");
Finch.call("/");
Finch.call("/foo");
Finch.call("/foo/bar");
Finch.call("/foo/bar?baz=quux");
Finch.call("/foo/bar?baz=xyzzy");
var cb: any;
Finch.route("foo", {
setup: cb.setup_foo = this.stub(),
load: cb.load_foo = this.stub(),
unload: cb.unload_foo = this.stub(),
teardown: cb.teardown_foo = this.stub()
});
Finch.route("[foo]/bar", {
setup: cb.setup_foo_bar = this.stub(),
load: cb.load_foo_bar = this.stub(),
unload: cb.unload_foo_bar = this.stub(),
teardown: cb.teardown_foo_bar = this.stub()
});
Finch.route("[foo/bar]/:id", {
setup: cb.setup_foo_bar_id = this.stub(),
load: cb.load_foo_bar_id = this.stub(),
unload: cb.unload_foo_bar_id = this.stub(),
teardown: cb.teardown_foo_bar_id = this.stub()
});
Finch.route("[foo]/baz", {
setup: cb.setup_foo_baz = this.stub(),
load: cb.load_foo_baz = this.stub(),
unload: cb.unload_foo_baz = this.stub(),
teardown: cb.teardown_foo_baz = this.stub()
});
Finch.route("[foo/baz]/:id", {
setup: cb.setup_foo_baz_id = this.stub(),
load: cb.load_foo_baz_id = this.stub(),
unload: cb.unload_foo_baz_id = this.stub(),
teardown: cb.teardown_foo_baz_id = this.stub()
});
Finch.call("/foo");
Finch.call("/foo/bar");
Finch.call("/foo");
Finch.call("/foo/bar/123?x=abc");
Finch.call("/foo/bar/456?x=aaa&y=zzz");
Finch.call("/foo/bar/456?x=bbb&y=zzz");
Finch.call("/foo/bar/456?y=zzz&x=bbb");
Finch.call("/foo/baz/789");
Finch.call("/foo/baz/abc?term=Hello");
Finch.call("/foo/baz/abc?term=World");
Finch.route("bar", this.stub());
Finch.call("/foo");
Finch.call("/bar");
Finch.route("/", function() {
});
Finch.route("[/]home", function() {
});
Finch.route("[/home]/news", {
setup: function() {
},
load: function() {
},
unload: function() {
return true;
},
teardown: function() {
return false;
}
});
Finch.route("/foo", {
setup: function() {
return true;
},
load: function() {
return true;
},
unload: function() {
},
teardown: function() {
}
});
Finch.route("[/]bar", {
setup: function() {
},
load: function() {
},
unload: function() {
},
teardown: function() {
}
});
Finch.call("/bar");
Finch.call("/home/news");
Finch.call("/foo");
Finch.call("/home/news");
Finch.call("/bar");
Finch.route("baz", this.stub());
Finch.call("/foo");
Finch.call("/foo/bar");
Finch.call("/baz");
Finch.route("/home", {
setup: function(bindings, next) {
return next();
},
load: function(bindings, next) {
return next();
},
unload: function(bindings, next) {
return next();
},
teardown: function(bindings, next) {
return next();
}
});
Finch.route("[/home]/news", {
setup: function(bindings, next) {
return next();
},
load: function(bindings, next) {
return next();
},
unload: function(bindings, next) {
return next();
},
teardown: function(bindings, next) {
return next();
}
});
Finch.call("/home");
Finch.call("/home/news");
Finch.call("/foo");
Finch.route("/", function(bindings) {
return Finch.observe(["x"], function(x) {
});
});
Finch.call("/?x=123");
Finch.call("/?x=123.456");
Finch.call("/?x=true");
Finch.call("/?x=false");
Finch.call("/?x=stuff");
Finch.options({
CoerceParameterTypes: true
});
Finch.call("/?x=123");
Finch.call("/?x=123.456");
Finch.call("/?x=true");
Finch.call("/?x=false");
Finch.call("/?x=stuff");
Finch.route("/:x", function(_arg) {
});
Finch.call("/123");
Finch.call("/123.456");
Finch.call("/true");
Finch.call("/false");
Finch.call("/stuff");
Finch.options({
CoerceParameterTypes: true
});
Finch.call("/123");
Finch.call("/123.456");
Finch.call("/true");
Finch.call("/false");
Finch.call("/stuff");
Finch.navigate("/home");
Finch.navigate("/home/news");
Finch.navigate("/home");
Finch.navigate("/home", {
foo: "bar"
});
Finch.navigate("/home", {
hello: "world"
});
Finch.navigate({
foos: "bars"
});
Finch.navigate({
foos: "baz"
});
Finch.navigate({
hello: "world"
}, true);
Finch.navigate({
foos: null
}, true);
Finch.navigate("/home/news", true);
Finch.navigate("/hello world", {});
Finch.navigate("/hello world", {
foo: "bar bar"
});
Finch.navigate({
foo: "baz baz"
});
Finch.navigate({
hello: 'world world'
}, true);
Finch.navigate("/home?foo=bar", {
hello: "world"
});
Finch.navigate("/home?foo=bar", {
hello: "world",
foo: "baz"
});
Finch.navigate("/home?foo=bar", {
hello: "world",
free: "bird"
});
Finch.navigate("#/home", true);
Finch.navigate("#/home");
Finch.navigate("#/home/news", {
free: "birds",
hello: "worlds"
});
Finch.navigate("#/home/news", {
foo: "bar"
}, true);
Finch.navigate("/home/news");
Finch.navigate("../");
Finch.navigate("./");
Finch.navigate("./news");
Finch.navigate("/home/news/article");
Finch.navigate("../../account");
Finch.listen();
Finch.ignore();
Finch.route("/home", function(bindings, continuation) {
});
Finch.route("/foo", function(bindings, continuation) {
});
Finch.call("home");
Finch.call("foo");
Finch.abort();
Finch.call("foo");
Finch.route("/", {
'setup': cb.slash_setup = this.stub(),
'load': cb.slash_load = this.stub(),
'unload': cb.slash_unload = this.stub(),
'teardown': cb.slash_teardown = this.stub()
});
Finch.route("[/]users/profile", {
'setup': cb.profile_setup = this.stub(),
'load': cb.profile_load = this.stub(),
'unload': cb.profile_unload = this.stub(),
'teardown': cb.profile_teardown = this.stub()
});
Finch.route("[/]:page", {
'setup': cb.page_setup = this.stub(),
'load': cb.page_load = this.stub(),
'unload': cb.page_unload = this.stub(),
'teardown': cb.page_teardown = this.stub()
});
Finch.call("/users");
}
/// <reference path="Finch.d.ts" />
function test_Finch() {
Finch.route("Hello/Route", function() {
return console.log("Well hello there! How you doin'?!");
});
Finch.route("Hello/Route/:someId", function(bindings) {
return console.log("Hey! Here's Some Id: " + bindings.someId);
});
Finch.route("Hello/Route/:someId", function(bindings, childCallback) {
console.log("Hey! Here's Some Id: " + bindings.someId);
return childCallback();
});
Finch.route("some/route", {
setup: function(bindings) {
return console.log("Some Route has been setup! :)");
},
load: function(bindings) {
return console.log("Some Route has been loaed! :D");
},
unload: function(bindings) {
return console.log("Some Route has been loaed! :(");
},
teardown: function(bindings) {
return console.log("Some Route has been torndown! :'(");
}
});
Finch.route("some/route", {
setup: function(bindings, childCallback) {
console.log("Some Route has been setup! :)");
return childCallback();
},
load: function(bindings, childCallback) {
console.log("Some Route has been loaed! :D");
return childCallback();
},
unload: function(bindings, childCallback) {
console.log("Some Route has been loaed! :(");
return childCallback();
},
teardown: function(bindings, childCallback) {
console.log("Some Route has been torndown! :'(");
return childCallback();
}
});
Finch.call("Some/Route");
Finch.route("Some/Route", function() {
return Finch.observe("hello", "foo", function(hello: any, foo: string) {
return console.log("" + hello + " and " + foo);
});
});
Finch.route("Some/Route", function() {
return Finch.observe(["hello", "foo"], function(hello: any, foo: any) {
return console.log("" + hello + " and " + foo);
});
});
Finch.route("Some/Route", function(bindings) {
return Finch.observe(function(params) {
});
});
Finch.navigate("Some/Route");
Finch.navigate("Some/Route", {
hello: 'world',
foo: 'bar'
});
Finch.navigate("Some/Route", {
foo: 'bar'
}, true);
Finch.navigate("Some/Route", true);
Finch.navigate({
hello: 'world2',
wow: 'wee'
});
Finch.navigate({
foo: 'bar',
wow: 'wee!!!'
});
Finch.navigate({
hello: 'world2'
}, true);
Finch.listen();
Finch.ignore();
Finch.abort();
//test from Finch
Finch.call("/foo/bar");
Finch.call("/foo/bar/123");
Finch.call("/foo/bar/123");
Finch.call("/foo/bar/123?x=Hello&y=World");
Finch.call("/foo/baz/456");
Finch.call("/quux/789?band=Sunn O)))&genre=Post-Progressive Fridgecore");
Finch.call("/foo/bar/baz");
Finch.call("/foo/bar/quux");
Finch.call("/foo");
Finch.call("/foo/bar");
Finch.call("/foo");
Finch.call("/foo");
Finch.call("/");
Finch.call("/");
Finch.call("/foo");
Finch.call("/foo/bar");
Finch.call("/foo/bar?baz=quux");
Finch.call("/foo/bar?baz=xyzzy");
var cb: any;
Finch.route("foo", {
setup: cb.setup_foo = this.stub(),
load: cb.load_foo = this.stub(),
unload: cb.unload_foo = this.stub(),
teardown: cb.teardown_foo = this.stub()
});
Finch.route("[foo]/bar", {
setup: cb.setup_foo_bar = this.stub(),
load: cb.load_foo_bar = this.stub(),
unload: cb.unload_foo_bar = this.stub(),
teardown: cb.teardown_foo_bar = this.stub()
});
Finch.route("[foo/bar]/:id", {
setup: cb.setup_foo_bar_id = this.stub(),
load: cb.load_foo_bar_id = this.stub(),
unload: cb.unload_foo_bar_id = this.stub(),
teardown: cb.teardown_foo_bar_id = this.stub()
});
Finch.route("[foo]/baz", {
setup: cb.setup_foo_baz = this.stub(),
load: cb.load_foo_baz = this.stub(),
unload: cb.unload_foo_baz = this.stub(),
teardown: cb.teardown_foo_baz = this.stub()
});
Finch.route("[foo/baz]/:id", {
setup: cb.setup_foo_baz_id = this.stub(),
load: cb.load_foo_baz_id = this.stub(),
unload: cb.unload_foo_baz_id = this.stub(),
teardown: cb.teardown_foo_baz_id = this.stub()
});
Finch.call("/foo");
Finch.call("/foo/bar");
Finch.call("/foo");
Finch.call("/foo/bar/123?x=abc");
Finch.call("/foo/bar/456?x=aaa&y=zzz");
Finch.call("/foo/bar/456?x=bbb&y=zzz");
Finch.call("/foo/bar/456?y=zzz&x=bbb");
Finch.call("/foo/baz/789");
Finch.call("/foo/baz/abc?term=Hello");
Finch.call("/foo/baz/abc?term=World");
Finch.route("bar", this.stub());
Finch.call("/foo");
Finch.call("/bar");
Finch.route("/", function() {
});
Finch.route("[/]home", function() {
});
Finch.route("[/home]/news", {
setup: function() {
},
load: function() {
},
unload: function() {
return true;
},
teardown: function() {
return false;
}
});
Finch.route("/foo", {
setup: function() {
return true;
},
load: function() {
return true;
},
unload: function() {
},
teardown: function() {
}
});
Finch.route("[/]bar", {
setup: function() {
},
load: function() {
},
unload: function() {
},
teardown: function() {
}
});
Finch.call("/bar");
Finch.call("/home/news");
Finch.call("/foo");
Finch.call("/home/news");
Finch.call("/bar");
Finch.route("baz", this.stub());
Finch.call("/foo");
Finch.call("/foo/bar");
Finch.call("/baz");
Finch.route("/home", {
setup: function(bindings, next) {
return next();
},
load: function(bindings, next) {
return next();
},
unload: function(bindings, next) {
return next();
},
teardown: function(bindings, next) {
return next();
}
});
Finch.route("[/home]/news", {
setup: function(bindings, next) {
return next();
},
load: function(bindings, next) {
return next();
},
unload: function(bindings, next) {
return next();
},
teardown: function(bindings, next) {
return next();
}
});
Finch.call("/home");
Finch.call("/home/news");
Finch.call("/foo");
Finch.route("/", function(bindings) {
return Finch.observe(["x"], function(x) {
});
});
Finch.call("/?x=123");
Finch.call("/?x=123.456");
Finch.call("/?x=true");
Finch.call("/?x=false");
Finch.call("/?x=stuff");
Finch.options({
CoerceParameterTypes: true
});
Finch.call("/?x=123");
Finch.call("/?x=123.456");
Finch.call("/?x=true");
Finch.call("/?x=false");
Finch.call("/?x=stuff");
Finch.route("/:x", function(_arg) {
});
Finch.call("/123");
Finch.call("/123.456");
Finch.call("/true");
Finch.call("/false");
Finch.call("/stuff");
Finch.options({
CoerceParameterTypes: true
});
Finch.call("/123");
Finch.call("/123.456");
Finch.call("/true");
Finch.call("/false");
Finch.call("/stuff");
Finch.navigate("/home");
Finch.navigate("/home/news");
Finch.navigate("/home");
Finch.navigate("/home", {
foo: "bar"
});
Finch.navigate("/home", {
hello: "world"
});
Finch.navigate({
foos: "bars"
});
Finch.navigate({
foos: "baz"
});
Finch.navigate({
hello: "world"
}, true);
Finch.navigate({
foos: null
}, true);
Finch.navigate("/home/news", true);
Finch.navigate("/hello world", {});
Finch.navigate("/hello world", {
foo: "bar bar"
});
Finch.navigate({
foo: "baz baz"
});
Finch.navigate({
hello: 'world world'
}, true);
Finch.navigate("/home?foo=bar", {
hello: "world"
});
Finch.navigate("/home?foo=bar", {
hello: "world",
foo: "baz"
});
Finch.navigate("/home?foo=bar", {
hello: "world",
free: "bird"
});
Finch.navigate("#/home", true);
Finch.navigate("#/home");
Finch.navigate("#/home/news", {
free: "birds",
hello: "worlds"
});
Finch.navigate("#/home/news", {
foo: "bar"
}, true);
Finch.navigate("/home/news");
Finch.navigate("../");
Finch.navigate("./");
Finch.navigate("./news");
Finch.navigate("/home/news/article");
Finch.navigate("../../account");
Finch.listen();
Finch.ignore();
Finch.route("/home", function(bindings, continuation) {
});
Finch.route("/foo", function(bindings, continuation) {
});
Finch.call("home");
Finch.call("foo");
Finch.abort();
Finch.call("foo");
Finch.route("/", {
'setup': cb.slash_setup = this.stub(),
'load': cb.slash_load = this.stub(),
'unload': cb.slash_unload = this.stub(),
'teardown': cb.slash_teardown = this.stub()
});
Finch.route("[/]users/profile", {
'setup': cb.profile_setup = this.stub(),
'load': cb.profile_load = this.stub(),
'unload': cb.profile_unload = this.stub(),
'teardown': cb.profile_teardown = this.stub()
});
Finch.route("[/]:page", {
'setup': cb.page_setup = this.stub(),
'load': cb.page_load = this.stub(),
'unload': cb.page_unload = this.stub(),
'teardown': cb.page_teardown = this.stub()
});
Finch.call("/users");
}
+47 -47
View File
@@ -1,47 +1,47 @@
// Type definitions for Finch 0.5.13
// Project: https://github.com/stoodder/finchjs
// Definitions by: David Sichau <https://github.com/DavidSichau>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface FinchCallback {
(bindings?: any, childCallback? : () => void): any;
}
interface ExpandedCallback {
setup?: FinchCallback;
load?: FinchCallback;
unload?: FinchCallback;
teardown?: FinchCallback;
}
interface ObserveCallback {
(...args: any[]): string;
}
interface FinchOptions {
CoerceParameterTypes?: boolean;
}
interface FinchStatic {
route(route: string, callback: FinchCallback): void;
route(route: string, callbacks: ExpandedCallback): void;
call( uri: string ): void;
observe(argN: string[], callback: (params: ObserveCallback ) => void): void;
observe(callback: (params: ObserveCallback) => void): void;
observe(...args: any[]): void;
navigate(uri:string, queryParams?:any, doUpdate?:boolean ): void;
navigate(uri:string, doUpdate:boolean ): void;
navigate(queryParams:any, doUpdate?:boolean ): void;
listen(): boolean;
ignore(): boolean;
abort(): void;
options(options: FinchOptions): void;
}
declare var Finch: FinchStatic;
declare module "finch" {
export = Finch;
}
// Type definitions for Finch 0.5.13
// Project: https://github.com/stoodder/finchjs
// Definitions by: David Sichau <https://github.com/DavidSichau>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface FinchCallback {
(bindings?: any, childCallback? : () => void): any;
}
interface ExpandedCallback {
setup?: FinchCallback;
load?: FinchCallback;
unload?: FinchCallback;
teardown?: FinchCallback;
}
interface ObserveCallback {
(...args: any[]): string;
}
interface FinchOptions {
CoerceParameterTypes?: boolean;
}
interface FinchStatic {
route(route: string, callback: FinchCallback): void;
route(route: string, callbacks: ExpandedCallback): void;
call( uri: string ): void;
observe(argN: string[], callback: (params: ObserveCallback ) => void): void;
observe(callback: (params: ObserveCallback) => void): void;
observe(...args: any[]): void;
navigate(uri:string, queryParams?:any, doUpdate?:boolean ): void;
navigate(uri:string, doUpdate:boolean ): void;
navigate(queryParams:any, doUpdate?:boolean ): void;
listen(): boolean;
ignore(): boolean;
abort(): void;
options(options: FinchOptions): void;
}
declare var Finch: FinchStatic;
declare module "finch" {
export = Finch;
}
+1 -1
View File
@@ -1,7 +1,7 @@
// Type definitions for headroom.js v0.7.0
// Project: http://wicky.nillia.ms/headroom.js/
// Definitions by: Jakub Olek <https://github.com/hakubo/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface HeadroomOptions {
offset?: number;
+61
View File
@@ -0,0 +1,61 @@
/// <reference path="HubSpot-pace.d.ts" />
pace.start({
document: false
});
pace.start();
pace.restart();
pace.stop();
var paceOptions: HubSpotPaceInterfaces.PaceOptions;
paceOptions = {
// Disable the 'elements' source
elements: false,
// Only show the progress on regular and ajax-y page navigation,
// not every request
restartOnRequestAfter: false
}
paceOptions = {
ajax: false, // disabled
document: false, // disabled
eventLag: false, // disabled
elements: {
selectors: ['.my-page']
}
};
paceOptions = {
elements: {
selectors: ['.timeline,.timeline-error', '.user-profile,.profile-error']
}
}
paceOptions = {
restartOnPushState: false
}
paceOptions = {
restartOnRequestAfter: false
}
pace.options = {
restartOnRequestAfter: false
}
pace.ignore(function(){
});
pace.track(function(){
});
pace.options = {
ajax: {
ignoreURLs: ['some-substring', /some-regexp/]
}
};
+115
View File
@@ -0,0 +1,115 @@
// Type definitions for pace v0.7.5
// Project: https://github.com/HubSpot/pace
// Definitions by: Borislav Zhivkov <https://github.com/borislavjivkov>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace HubSpotPaceInterfaces {
interface PaceOptions {
/**
* How long should it take for the bar to animate to a new point after receiving it
*/
catchupTime?: number;
/**
* How quickly should the bar be moving before it has any progress info from a new source in %/ms
*/
initialRate?: number;
/**
* What is the minimum amount of time the bar should be on the screen. Irrespective of this number, the bar will always be on screen for 33 * (100 / maxProgressPerFrame) + ghostTime ms.
*/
minTime?: number;
/**
* What is the minimum amount of time the bar should sit after the last update before disappearing
*/
ghostTime?: number;
/**
* Its easy for a bunch of the bar to be eaten in the first few frames before we know how much there is to load. This limits how much of the bar can be used per frame
*/
maxProgressPerFrame?: number;
/**
* This tweaks the animation easing
*/
easeFactor?: number;
/**
* Should pace automatically start when the page is loaded, or should it wait for `start` to be called? Always false if pace is loaded with AMD or CommonJS.
*/
startOnPageLoad?: boolean;
/**
* Should we restart the browser when pushState or replaceState is called? (Generally means ajax navigation has occured)
*/
restartOnPushState?: boolean;
/**
* Should we show the progress bar for every ajax request (not just regular or ajax-y page navigation)? Set to false to disable. If so, how many ms does the request have to be running for before we show the progress?
*/
restartOnRequestAfter?: boolean | number;
/**
* What element should the pace element be appended to on the page?
*/
target?: string;
document?: boolean | string;
elements?: boolean | PaceElementsOptions;
eventLag?: boolean | PaceEventLagOptions;
ajax?: boolean | PaceAjaxOptions;
}
interface PaceElementsOptions {
/**
* How frequently in ms should we check for the elements being tested for using the element monitor?
*/
checkInterval?: number;
/**
* What elements should we wait for before deciding the page is fully loaded (not required)
*/
selectors?: string[];
}
interface PaceEventLagOptions {
/**
* When we first start measuring event lag, not much is going on in the browser yet, so it's not uncommon for the numbers to be abnormally low for the first few samples. This configures how many samples we need before we consider a low number to mean completion.
*/
minSamples?: number;
/**
* How many samples should we average to decide what the current lag is?
*/
sampleCount?: number;
/**
* Above how many ms of lag is the CPU considered busy?
*/
lagThreshold?: number;
}
interface PaceAjaxOptions {
/**
* Which HTTP methods should we track?
*/
trackMethods?: string[];
/**
* Should we track web socket connections?
*/
trackWebSockets?: boolean;
/**
* A list of regular expressions or substrings of URLS we should ignore (for both tracking and restarting)
*/
ignoreURLs?: (string | RegExp)[];
}
interface Pace {
options: PaceOptions;
start(options?: PaceOptions): void;
restart(): void;
stop(): void;
track(fn: () => void, ...args: any[]): void;
ignore(fn: () => void, ...args: any[]): void;
on(event: string, handler: (...args: any[]) => void, context?: any): void;
off(event: string, handler?: (...args: any[]) => void): void;
once(event: string, handler: (...args: any[]) => void, context?: any): void;
}
enum PaceEvent { start, stop, restart, done, hide }
}
declare var pace: HubSpotPaceInterfaces.Pace;
declare module "HubSpot-pace" {
export = pace;
}
+5
View File
@@ -0,0 +1,5 @@
- [ ] I tried using the latest `xxxx/xxxx.d.ts` file in this repo and had problems.
- [ ] I tried using the latest stable version of tsc. https://www.npmjs.com/package/typescript
- [ ] I have a question that is inappropriate for [StackOverflow](https://stackoverflow.com/). (Please ask any appropriate questions there).
- [ ] I want to talk about `xxxx/xxxx.d.ts`.
- The authors of that type definition are cc/ @....
+1 -1
View File
@@ -1,7 +1,7 @@
// Type definitions for JSONStream v0.8.0
// Project: http://github.com/dominictarr/JSONStream
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
+8 -8
View File
@@ -1,10 +1,10 @@
// Type definitions for OpenJsCad.js
// Project: https://github.com/joostn/OpenJsCad
// Definitions by: Dan Marshall <https://github.com/danmarshall>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../threejs/three.d.ts" />
declare module THREE {
declare namespace THREE {
var CSG: {
fromCSG: (csg: CSG, defaultColor: any) => {
colorMesh: Mesh;
@@ -144,7 +144,7 @@ declare module THREE {
function RenderableSprite(): void;
function Projector(): void;
}
declare module OpenJsCad {
declare namespace OpenJsCad {
interface ILog {
(x: string): void;
prevLogTime?: number;
@@ -404,7 +404,7 @@ declare class CSG extends CxG implements ICenter {
toStlString(): string;
toAMFString(m: IAMFStringOptions): Blob;
}
declare module CSG {
declare namespace CSG {
function fnNumberSort(a: any, b: any): number;
function parseOption(options: any, optionname: any, defaultvalue: any): any;
function parseOptionAs3DVector(options: any, optionname: any, defaultvalue: any): Vector3D;
@@ -546,7 +546,7 @@ declare module CSG {
toStlString(): string;
}
}
declare module CSG.Polygon {
declare namespace CSG.Polygon {
class Shared {
color: any;
tag: any;
@@ -557,7 +557,7 @@ declare module CSG.Polygon {
getHash(): any;
}
}
declare module CSG {
declare namespace CSG {
class PolygonTreeNode {
parent: any;
children: any;
@@ -869,7 +869,7 @@ declare class CAG extends CxG implements ICenter {
toDxf(): Blob;
static PathsToDxf(paths: CSG.Path2D[]): Blob;
}
declare module CAG {
declare namespace CAG {
class Vertex {
pos: CSG.Vector2D;
tag: number;
@@ -905,7 +905,7 @@ interface CAG_extrude_options {
twistangle?: number;
twiststeps?: number;
}
declare module CSG {
declare namespace CSG {
class Polygon2D extends CAG {
constructor(points: Vector2D[]);
}
+8
View File
@@ -0,0 +1,8 @@
case 1. Add a new type definition.
- [ ] checked compilation succeeds with `--target es6` and `--noImplicitAny` options.
- [ ] has correct [naming convention](http://definitelytyped.org/guides/contributing.html#naming-the-file)
- [ ] has a [test file](http://definitelytyped.org/guides/contributing.html#tests) with the suffix of `-tests.ts` or `-tests.tsx`.
case 2. Improvement to existing type definition.
- documentation or source code reference which provides context for the suggested changes. url http://api.jquery.com/html .
- it has been reviewed by a DefinitelyTyped member.
+29 -29
View File
@@ -1,13 +1,13 @@
// Type definitions for PayPal-Cordova-Plugin 3.1.10
// Project: https://github.com/paypal/PayPal-Cordova-Plugin
// Definitions by: Justin Unterreiner <https://github.com/Justin-Credible>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
//#region paypal-mobile-js-helper.js
/**
* The PayPalItem class defines an optional itemization for a payment.
*
*
* @see https://developer.paypal.com/docs/api/#item-object for more details.
*/
declare class PayPalItem {
@@ -51,7 +51,7 @@ declare class PayPalItem {
/**
* The PayPalPaymentDetails class defines optional amount details.
*
*
* @see https://developer.paypal.com/webapps/developer/docs/api/#details-object for more details.
*/
declare class PayPalPaymentDetails {
@@ -256,18 +256,18 @@ declare class PayPalConfiguration {
/**
* For single payments, options for the shipping address.
*
*
* - 0 - PayPalShippingAddressOptionNone: no shipping address applies.
*
*
* - 1 - PayPalShippingAddressOptionProvided: shipping address will be provided by your app,
* in the shippingAddress property of PayPalPayment.
*
*
* - 2 - PayPalShippingAddressOptionPayPal: user will choose from shipping addresses on file
* for their PayPal account.
*
*
* - 3 - PayPalShippingAddressOptionBoth: user will choose from the shipping address provided by your app,
* in the shippingAddress property of PayPalPayment, plus the shipping addresses on file for the user's PayPal account.
*
*
* Defaults to 0 (PayPalShippingAddressOptionNone).
*/
payPalShippingAddressOption: number;
@@ -277,26 +277,26 @@ declare class PayPalConfiguration {
* the SDK will remember the user's PayPal username or phone number;
* if the user pays via their credit card, then the SDK will remember
* the PayPal Vault token representing the user's credit card.
*
*
* If set to false, then any previously-remembered username, phone number, or
* credit card token will be erased, and subsequent payment information will
* not be remembered.
*
*
* Defaults to true.
*/
rememberUser: boolean;
/**
* If not set, or if set to nil, defaults to the device's current language setting.
*
*
* Can be specified as a language code ("en", "fr", "zh-Hans", etc.) or as a locale ("en_AU", "fr_FR", "zh-Hant_HK", etc.).
* If the library does not contain localized strings for a specified locale, then will fall back to the language. E.g., "es_CO" -> "es".
* If the library does not contain localized strings for a specified language, then will fall back to American English.
*
*
* If you specify only a language code, and that code matches the device's currently preferred language,
* then the library will attempt to use the device's current region as well.
* E.g., specifying "en" on a device set to "English" and "United Kingdom" will result in "en_GB".
*
*
* These localizations are currently included:
* da,de,en,en_AU,en_GB,en_SV,es,es_MX,fr,he,it,ja,ko,nb,nl,pl,pt,pt_BR,ru,sv,tr,zh-Hans,zh-Hant_HK,zh-Hant_TW.
*/
@@ -319,7 +319,7 @@ declare class PayPalConfiguration {
/**
* Sandbox credentials can be difficult to type on a mobile device. Setting this flag to true will
* cause the sandboxUserPassword and sandboxUserPin to always be pre-populated into login fields.
*
*
* This setting will have no effect if the operation mode is production.
* Defaults to false.
*/
@@ -385,18 +385,18 @@ interface PayPalConfigurationOptions {
/**
* For single payments, options for the shipping address.
*
*
* - 0 - PayPalShippingAddressOptionNone?: no shipping address applies.
*
*
* - 1 - PayPalShippingAddressOptionProvided?: shipping address will be provided by your app,
* in the shippingAddress property of PayPalPayment.
*
*
* - 2 - PayPalShippingAddressOptionPayPal?: user will choose from shipping addresses on file
* for their PayPal account.
*
*
* - 3 - PayPalShippingAddressOptionBoth?: user will choose from the shipping address provided by your app,
* in the shippingAddress property of PayPalPayment, plus the shipping addresses on file for the user's PayPal account.
*
*
* Defaults to 0 (PayPalShippingAddressOptionNone).
*/
payPalShippingAddressOption?: number;
@@ -406,26 +406,26 @@ interface PayPalConfigurationOptions {
* the SDK will remember the user's PayPal username or phone number;
* if the user pays via their credit card, then the SDK will remember
* the PayPal Vault token representing the user's credit card.
*
*
* If set to false, then any previously-remembered username, phone number, or
* credit card token will be erased, and subsequent payment information will
* not be remembered.
*
*
* Defaults to true.
*/
rememberUser?: boolean;
/**
* If not set, or if set to nil, defaults to the device's current language setting.
*
*
* Can be specified as a language code ("en", "fr", "zh-Hans", etc.) or as a locale ("en_AU", "fr_FR", "zh-Hant_HK", etc.).
* If the library does not contain localized strings for a specified locale, then will fall back to the language. E.g., "es_CO" -> "es".
* If the library does not contain localized strings for a specified language, then will fall back to American English.
*
*
* If you specify only a language code, and that code matches the device's currently preferred language,
* then the library will attempt to use the device's current region as well.
* E.g., specifying "en" on a device set to "English" and "United Kingdom" will result in "en_GB".
*
*
* These localizations are currently included:
* da,de,en,en_AU,en_GB,en_SV,es,es_MX,fr,he,it,ja,ko,nb,nl,pl,pt,pt_BR,ru,sv,tr,zh-Hans,zh-Hant_HK,zh-Hant_TW.
*/
@@ -448,7 +448,7 @@ interface PayPalConfigurationOptions {
/**
* Sandbox credentials can be difficult to type on a mobile device. Setting this flag to true will
* cause the sandboxUserPassword and sandboxUserPin to always be pre-populated into login fields.
*
*
* This setting will have no effect if the operation mode is production.
* Defaults to false.
*/
@@ -469,7 +469,7 @@ interface PayPalConfigurationOptions {
//#region cdv-plugin-paypal-mobile-sdk.js
declare module PayPalCordovaPlugin {
declare namespace PayPalCordovaPlugin {
export interface PayPalClientIds {
PayPalEnvironmentProduction: string;
@@ -545,7 +545,7 @@ declare module PayPalCordovaPlugin {
* the recommended time to preconnect is on page load.
*
* @param environment available options are "PayPalEnvironmentNoNetwork", "PayPalEnvironmentProduction" and "PayPalEnvironmentSandbox"
* @param configuration PayPalConfiguration object, for Future Payments merchantName, merchantPrivacyPolicyURL
* @param configuration PayPalConfiguration object, for Future Payments merchantName, merchantPrivacyPolicyURL
* and merchantUserAgreementURL must be set be set
* @param completionCallback a callback function on success
*/
@@ -592,7 +592,7 @@ declare module PayPalCordovaPlugin {
/**
* Please Read Docs on Future Payments at https://github.com/paypal/PayPal-iOS-SDK#future-payments
*
*
* @param completionCallback a callback function accepting a js object with future payment authorization
* @param cancelCallback a callback function accepting a reason string, called when the user canceled without agreement
*/
@@ -600,7 +600,7 @@ declare module PayPalCordovaPlugin {
/**
* Please Read Docs on Profile Sharing at https://github.com/paypal/PayPal-iOS-SDK#profile-sharing
*
*
* @param scopes scopes Set of requested scope-values. Accepted scopes are: openid, profile, address, email, phone, futurepayments and paypalattributes
* See https://developer.paypal.com/docs/integration/direct/identity/attributes/ for more details
* @param completionCallback a callback function accepting a js object with future payment authorization
+3 -3
View File
@@ -22,9 +22,9 @@ Please see the [contribution guide](http://definitelytyped.org/guides/contributi
## How to get the definitions
* Directly from the Github repos
* Directly from the GitHub repos
* [NuGet packages](http://nuget.org/packages?q=DefinitelyTyped)
* [TypeScript Definition manager](https://github.com/DefinitelyTyped/tsd)
* [Typings - TypeScript Definition Manager](https://github.com/typings/typings)
## List of definitions
@@ -32,7 +32,7 @@ Please see the [contribution guide](http://definitelytyped.org/guides/contributi
## Requested definitions
Here is are the [currently requested definitions](https://github.com/borisyankov/DefinitelyTyped/labels/Definition%3ARequest).
Here are the [currently requested definitions](https://github.com/DefinitelyTyped/DefinitelyTyped/labels/Definition%3ARequest).
## License
+2 -2
View File
@@ -1,11 +1,11 @@
// Type definitions for Node.js debugger API
// Project: http://nodejs.org/
// Definitions by: Basarat Ali Syed <https://github.com/basarat>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../node/node.d.ts"/>
declare module NodeJS {
declare namespace NodeJS {
export module _debugger {
export interface Packet {
raw: string;
+1 -1
View File
@@ -1,7 +1,7 @@
// Type definitions for acc-wizard
// Project: https://github.com/sathomas/acc-wizard
// Definitions by: Cyril Schumacher <https://github.com/cyrilschumacher>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface AccWizardOptions {
/**
-1
View File
@@ -1 +0,0 @@
--noImplicitAny
+107 -107
View File
@@ -1,107 +1,107 @@
/// <reference path="accounting.d.ts"/>
// formatMoney
// Default usage:
accounting.formatMoney(12345678); // $12,345,678.00
// European formatting (custom symbol and separators), could also use options object as second param:
accounting.formatMoney(4999.99, "€", 2, ".", ","); // €4.999,99
// Negative values are formatted nicely, too:
accounting.formatMoney(-500000, "£ ", 0); // £ -500,000
// Simple `format` string allows control of symbol position [%v = value, %s = symbol]:
accounting.formatMoney(5318008, { symbol: "GBP", format: "%v %s" }); // 5,318,008.00 GBP
// Example usage with options object:
accounting.formatMoney(5318008, {
symbol: "GBP",
precision: 0,
thousand: "·",
format: {
pos: "%s %v",
neg: "%s (%v)",
zero: "%s --"
}
});
// Will recursively format an array of values:
accounting.formatMoney([123, 456, [78, 9]], "$", 0); // ["$123", "$456", ["$78", "$9"]]
// formatColumn
// Format list of numbers for display:
accounting.formatColumn([123.5, 3456.49, 777888.99, 12345678, -5432], "$ ");
// Example usage (NB. use a space after the symbol to add arbitrary padding to all values):
accounting.formatColumn([123, 12345], "$ ", 0); // ["$ 123", "$ 12,345"]
// List of numbers can be a multi-dimensional array (formatColumn is applied recursively):
accounting.formatColumn([[1, 100], [900, 9]]); // [["$ 1.00", "$100.00"], ["$900.00", "$ 9.00"]]
// formatNumber
// Example usage:
accounting.formatNumber(5318008); // 5,318,008
accounting.formatNumber(9876543.21, 3, " "); // 9 876 543.210
accounting.formatNumber(4999.99, 2, ".", ","); // 4.999,99
// Example usage with options object:
accounting.formatNumber(5318008, {
precision: 3,
thousand: " "
});
// Will recursively format an array of values:
accounting.formatNumber([123456, [7890, 123]]); // ["123,456", ["7,890", "123"]]
// toFixed
(0.615).toFixed(2); // "0.61"
accounting.toFixed(0.615, 2); // "0.62"
// unformat
// Example usage:
accounting.unformat("£ 12,345,678.90 GBP"); // 12345678.9
accounting.unformat("GBP £ 12,345,678.90"); // 12345678.9
// If a non-standard decimal separator was used (eg. a comma) unformat() will need it in order to work out
// which part of the number is a decimal/float:
accounting.unformat("€ 1.000.000,00", ","); // 1000000
// Settings object that controls default parameters for library methods:
accounting.settings = {
currency: {
symbol: "$", // default currency symbol is '$'
format: "%s%v", // controls output: %s = symbol, %v = value/number (can be object: see below)
decimal: ".", // decimal point separator
thousand: ",", // thousands separator
precision: 2 // decimal places
},
number: {
precision: 0, // default precision on numbers is 0
thousand: ",",
decimal: "."
}
};
// These can be changed externally to edit the library's defaults:
accounting.settings.currency.format = "%s %v";
// Format can be an object, with `pos`, `neg` and `zero`:
accounting.settings.currency.format = {
pos: "%s %v", // for positive values, eg. "$ 1.00" (required)
neg: "%s (%v)", // for negative values, eg. "$ (1.00)" [optional]
zero: "%s -- " // for zero values, eg. "$ --" [optional]
};
/// <reference path="accounting.d.ts"/>
// formatMoney
// Default usage:
accounting.formatMoney(12345678); // $12,345,678.00
// European formatting (custom symbol and separators), could also use options object as second param:
accounting.formatMoney(4999.99, "€", 2, ".", ","); // €4.999,99
// Negative values are formatted nicely, too:
accounting.formatMoney(-500000, "£ ", 0); // £ -500,000
// Simple `format` string allows control of symbol position [%v = value, %s = symbol]:
accounting.formatMoney(5318008, { symbol: "GBP", format: "%v %s" }); // 5,318,008.00 GBP
// Example usage with options object:
accounting.formatMoney(5318008, {
symbol: "GBP",
precision: 0,
thousand: "·",
format: {
pos: "%s %v",
neg: "%s (%v)",
zero: "%s --"
}
});
// Will recursively format an array of values:
accounting.formatMoney([123, 456, [78, 9]], "$", 0); // ["$123", "$456", ["$78", "$9"]]
// formatColumn
// Format list of numbers for display:
accounting.formatColumn([123.5, 3456.49, 777888.99, 12345678, -5432], "$ ");
// Example usage (NB. use a space after the symbol to add arbitrary padding to all values):
accounting.formatColumn([123, 12345], "$ ", 0); // ["$ 123", "$ 12,345"]
// List of numbers can be a multi-dimensional array (formatColumn is applied recursively):
accounting.formatColumn([[1, 100], [900, 9]]); // [["$ 1.00", "$100.00"], ["$900.00", "$ 9.00"]]
// formatNumber
// Example usage:
accounting.formatNumber(5318008); // 5,318,008
accounting.formatNumber(9876543.21, 3, " "); // 9 876 543.210
accounting.formatNumber(4999.99, 2, ".", ","); // 4.999,99
// Example usage with options object:
accounting.formatNumber(5318008, {
precision: 3,
thousand: " "
});
// Will recursively format an array of values:
accounting.formatNumber([123456, [7890, 123]]); // ["123,456", ["7,890", "123"]]
// toFixed
(0.615).toFixed(2); // "0.61"
accounting.toFixed(0.615, 2); // "0.62"
// unformat
// Example usage:
accounting.unformat("£ 12,345,678.90 GBP"); // 12345678.9
accounting.unformat("GBP £ 12,345,678.90"); // 12345678.9
// If a non-standard decimal separator was used (eg. a comma) unformat() will need it in order to work out
// which part of the number is a decimal/float:
accounting.unformat("€ 1.000.000,00", ","); // 1000000
// Settings object that controls default parameters for library methods:
accounting.settings = {
currency: {
symbol: "$", // default currency symbol is '$'
format: "%s%v", // controls output: %s = symbol, %v = value/number (can be object: see below)
decimal: ".", // decimal point separator
thousand: ",", // thousands separator
precision: 2 // decimal places
},
number: {
precision: 0, // default precision on numbers is 0
thousand: ",",
decimal: "."
}
};
// These can be changed externally to edit the library's defaults:
accounting.settings.currency.format = "%s %v";
// Format can be an object, with `pos`, `neg` and `zero`:
accounting.settings.currency.format = {
pos: "%s %v", // for positive values, eg. "$ 1.00" (required)
neg: "%s (%v)", // for negative values, eg. "$ (1.00)" [optional]
zero: "%s -- " // for zero values, eg. "$ --" [optional]
};
+16 -16
View File
@@ -1,30 +1,30 @@
// Type definitions for accounting.js 0.3.2
// Project: http://josscrowcroft.github.io/accounting.js/
// Definitions by: Sergey Gerasimov <https://github.com/gerich-home/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface IAccountingCurrencyFormat {
pos: string; // for positive values, eg. "$ 1.00"
neg?: string; // for negative values, eg. "$ (1.00)"
interface IAccountingCurrencyFormat {
pos: string; // for positive values, eg. "$ 1.00"
neg?: string; // for negative values, eg. "$ (1.00)"
zero?: string; // for zero values, eg. "$ --"
}
interface IAccountingCurrencySettings<TFormat> {
symbol?: string; // default currency symbol is '$'
format?: TFormat; // controls output: %s = symbol, %v = value/number
decimal?: string; // decimal point separator
thousand?: string; // thousands separator
interface IAccountingCurrencySettings<TFormat> {
symbol?: string; // default currency symbol is '$'
format?: TFormat; // controls output: %s = symbol, %v = value/number
decimal?: string; // decimal point separator
thousand?: string; // thousands separator
precision?: number // decimal places
}
interface IAccountingNumberSettings {
precision?: number; // default precision on numbers is 0
thousand?: string;
decimal?: string;
interface IAccountingNumberSettings {
precision?: number; // default precision on numbers is 0
thousand?: string;
decimal?: string;
}
interface IAccountingSettings {
currency: IAccountingCurrencySettings<any>; // IAccountingCurrencySettings<string> or IAccountingCurrencySettings<IAccountingCurrencyFormat>
interface IAccountingSettings {
currency: IAccountingCurrencySettings<any>; // IAccountingCurrencySettings<string> or IAccountingCurrencySettings<IAccountingCurrencyFormat>
number: IAccountingNumberSettings;
}
@@ -76,4 +76,4 @@ declare var accounting: IAccountingStatic;
declare module "accounting" {
export = accounting;
}
}
+6 -4
View File
@@ -1,9 +1,9 @@
// Type definitions for Ace Ajax.org Cloud9 Editor
// Project: http://ace.ajax.org/
// Definitions by: Diullei Gomes <https://github.com/Diullei>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module AceAjax {
declare namespace AceAjax {
export interface Delta {
action: string;
@@ -653,7 +653,7 @@ declare module AceAjax {
* @param type Identify the type of the marker
* @param inFront Set to `true` to establish a front marker
**/
addMarker(range: Range, clazz: string, type: Function, inFront: boolean): void;
addMarker(range: Range, clazz: string, type: Function, inFront: boolean): number;
/**
* Adds a new marker to the given `Range`. If `inFront` is `true`, a front marker is defined, and the `'changeFrontMarker'` event fires; otherwise, the `'changeBackMarker'` event fires.
@@ -662,7 +662,7 @@ declare module AceAjax {
* @param type Identify the type of the marker
* @param inFront Set to `true` to establish a front marker
**/
addMarker(range: Range, clazz: string, type: string, inFront: boolean): void;
addMarker(range: Range, clazz: string, type: string, inFront: boolean): number;
/**
* Adds a dynamic marker to the session.
@@ -1037,6 +1037,8 @@ declare module AceAjax {
**/
export interface Editor {
on(ev: string, callback: (e: any) => any): void;
addEventListener(ev: 'change', callback: (ev: EditorChangeEvent) => any): void;
addEventListener(ev: string, callback: Function): void;
-1
View File
@@ -1 +0,0 @@
+1 -1
View File
@@ -1 +1 @@
+1 -1
View File
@@ -1 +1 @@
@@ -1 +1 @@
+3
View File
@@ -5,6 +5,9 @@ var editor = ace.edit("editor");
editor.setTheme("ace/theme/monokai");
editor.getSession().setMode("ace/mode/javascript");
editor.on("blur", (e) => e);
editor.on("change", (e) => e);
editor.setTheme("ace/theme/twilight");
editor.getSession().setMode("ace/mode/javascript");
+1 -1
View File
@@ -1 +1 @@
+1 -1
View File
@@ -1 +1 @@
@@ -1 +1 @@
+1 -1
View File
@@ -1 +1 @@
@@ -1 +1 @@
@@ -1 +0,0 @@
@@ -1 +1 @@
+1 -1
View File
@@ -1 +1 @@
-1
View File
@@ -1 +0,0 @@
+1 -1
View File
@@ -1 +1 @@
-1
View File
@@ -1 +0,0 @@
+1 -1
View File
@@ -1 +1 @@
@@ -1 +1 @@
@@ -1 +1 @@
+2 -2
View File
@@ -1,13 +1,13 @@
// Type definitions for node_acl 0.4.7
// Project: https://github.com/optimalbits/node_acl
// Definitions by: Qubo <https://github.com/tkQubo>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../bluebird/bluebird.d.ts" />
/// <reference path='../node/node.d.ts'/>
/// <reference path='../redis/redis.d.ts'/>
/// <reference path="../mongodb/mongodb.d.ts" />
/// <reference path="../mongodb/mongodb-1.4.9.d.ts" />
declare module "acl" {
import http = require('http');
+2 -2
View File
@@ -1,11 +1,11 @@
// Type definitions for Acorn v1.0.1
// Project: https://github.com/marijnh/acorn
// Definitions by: RReverser <https://github.com/RReverser>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../estree/estree.d.ts" />
declare module acorn {
declare namespace acorn {
var version: string;
function parse(input: string, options?: Options): ESTree.Program;
function parseExpressionAt(input: string, pos: number, options?: Options): ESTree.Expression;
+46
View File
@@ -0,0 +1,46 @@
/// <reference path="adal-angular.d.ts" />
// Code samples from:
// - https://github.com/AzureAD/azure-activedirectory-library-for-js
// - https://github.com/Azure-Samples/active-directory-angularjs-singlepageapp
// Variable provided by AngularJS
var $httpProvider: angular.IHttpProvider = null;
var adalAuthenticationServiceProvider: adal.AdalAuthenticationServiceProvider = null;
var adalAuthenticationService: adal.AdalAuthenticationService = null;
var endpoints = {
"https://yourhost/api": "b6a68585-5287-45b2-ba82-383ba1f60932",
};
adalAuthenticationServiceProvider.init({
tenant: "52d4b072-9470-49fb-8721-bc3a1c9912a1",
clientId: "e9a5a8b6-8af7-4719-9821-0deef255f68e",
endpoints: endpoints
},
$httpProvider
);
adalAuthenticationServiceProvider.init({
clientId: "e9a5a8b6-8af7-4719-9821-0deef255f68e"
},
$httpProvider
);
adalAuthenticationServiceProvider.init(
{
clientId: 'cb68f72f...',
cacheLocation: 'localStorage'
},
$httpProvider // pass http provider to inject request interceptor to attach tokens
);
adalAuthenticationServiceProvider.init({
tenant: 'Enter your tenant name here e.g. contoso.onmicrosoft.com',
clientId: 'Enter your client ID here e.g. e9a5a8b6-8af7-4719-9821-0deef255f68e',
extraQueryParameter: 'nux=1'
},
$httpProvider
);
adalAuthenticationService.login();
adalAuthenticationService.logOut();
+40
View File
@@ -0,0 +1,40 @@
// Type definitions for ADAL.JS 1.0.8
// Project: https://github.com/AzureAD/azure-activedirectory-library-for-js
// Definitions by: mmaitre314 <https://github.com/mmaitre314>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="adal.d.ts" />
/// <reference path="../angularjs/angular.d.ts" />
declare namespace adal {
interface AdalAuthenticationServiceProvider {
init(configOptions: Config, httpProvider: angular.IHttpProvider): void;
}
interface UserInfo {
isAuthenticated: boolean,
userName: string,
loginError: string,
profile: any
}
interface AdalAuthenticationService {
config: Config;
userInfo: UserInfo,
login(): void;
loginInProgress(): boolean;
logOut(): void;
getCachedToken(resource: string): string;
acquireToken(resource: string): angular.IPromise<string>;
getUser(): angular.IPromise<User>;
getResourceForEndpoint(endpoint: string): string,
clearCache(): void;
clearCacheForResource(resource: string): void;
info(message: string): void;
verbose(message: string): void;
}
}
+23
View File
@@ -0,0 +1,23 @@
/// <reference path="adal.d.ts" />
var endpoints = {
"https://yourhost/api": "b6a68585-5287-45b2-ba82-383ba1f60932",
};
var config : adal.Config = {
tenant: "52d4b072-9470-49fb-8721-bc3a1c9912a1", // Optional by default, it sends common
clientId: "e9a5a8b6-8af7-4719-9821-0deef255f68e", // Required
endpoints: endpoints // If you need to send CORS api requests.
};
var auth = new AuthenticationContext(config);
Logging.log = (message: string) => {
console.log(message);
}
Logging.level = 4;
auth.info("Logging message");
var userName: string = auth.getCachedUser().userName;
+159
View File
@@ -0,0 +1,159 @@
// Type definitions for ADAL.JS 1.0.8
// Project: https://github.com/AzureAD/azure-activedirectory-library-for-js
// Definitions by: mmaitre314 <https://github.com/mmaitre314>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare var AuthenticationContext: adal.AuthenticationContextStatic;
declare var Logging: adal.Logging;
declare module 'adal' {
export = { AuthenticationContext, Logging };
}
declare namespace adal {
interface Config {
tenant?: string,
clientId: string,
redirectUri?: string,
cacheLocation?: string,
displayCall?: (urlNavigate: string) => any,
correlationId?: string,
loginResource?: string,
resource?: string
endpoints?: any // If you need to send CORS api requests.
extraQueryParameter?: string
}
interface User {
userName: string,
profile: any
}
interface RequestInfo {
valid: boolean,
parameters: any,
stateMatch: boolean,
stateResponse: string,
requestType: string
}
interface Logging {
log: (message: string) => void;
level: LoggingLevel;
}
enum LoggingLevel {
ERROR = 0,
WARNING = 1,
INFO = 2,
VERBOSE = 3
}
interface AuthenticationContextStatic {
new (config: Config): AuthenticationContext;
}
interface AuthenticationContext {
instance: string;
config: Config;
/**
* Gets initial Idtoken for the app backend
* Saves the resulting Idtoken in localStorage.
*/
login(): void;
loginInProgress(): boolean;
/**
* Gets token for the specified resource from local storage cache
* @param {string} resource A URI that identifies the resource for which the token is valid.
* @returns {string} token if exists and not expired or null
*/
getCachedToken(resource: string): string;
/**
* Retrieves and parse idToken from localstorage
* @returns {User} user object
*/
getCachedUser(): User;
registerCallback(expectedState: string, resource: string, callback: (message: string, token: string) => any): void;
/**
* Acquire token from cache if not expired and available. Acquires token from iframe if expired.
* @param {string} resource ResourceUri identifying the target resource
* @param {requestCallback} callback
*/
acquireToken(resource: string, callback: (message: string, token: string) => any): void;
/**
* Redirect the Browser to Azure AD Authorization endpoint
* @param {string} urlNavigate The authorization request url
*/
promptUser(urlNavigate: string): void;
/**
* Clear cache items.
*/
clearCache(): void;
/**
* Clear cache items for a resource.
*/
clearCacheForResource(resource: string): void;
/**
* Logout user will redirect page to logout endpoint.
* After logout, it will redirect to post_logout page if provided.
*/
logOut(): void;
/**
* Gets a user profile
* @param {requestCallback} callback - The callback that handles the response.
*/
getUser(callback: (message: string, user?: User) => any): void;
/**
* Checks if hash contains access token or id token or error_description
* @param {string} hash - Hash passed from redirect page
* @returns {Boolean}
*/
isCallback(hash: string): boolean;
/**
* Gets login error
* @returns {string} error message related to login
*/
getLoginError(): string;
/**
* Gets requestInfo from given hash.
* @returns {string} error message related to login
*/
getRequestInfo(hash: string): string;
/**
* Saves token from hash that is received from redirect.
*/
saveTokenFromHash(requestInfo: RequestInfo): void;
/**
* Gets resource for given endpoint if mapping is provided with config.
* @param {string} endpoint - API endpoint
* @returns {string} resource for this API endpoint
*/
getResourceForEndpoint(endpoint: string): string;
handleWindowCallback(): void;
log(level: number, message: string, error: any): void;
error(message: string, error: any): void;
warn(message: string): void;
info(message: string): void;
verbose(message: string): void;
}
}
+1 -1
View File
@@ -1,7 +1,7 @@
// Type definitions for add2home v2.0.5
// Project: http://cubiq.org/add-to-home-screen
// Definitions by: James Wilkins <http://www.codeplex.com/site/users/view/jamesnw>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare var addToHome: {
/** Shows the popup.
+3 -2
View File
@@ -17,7 +17,8 @@ console.log(zip.readAsText("some_folder/my_file.txt"));
zip.extractEntryTo(/*entry name*/"some_folder/my_file.txt", /*target path*/"/home/me/tempfolder", /*overwrite*/true)
// extracts everything
zip.extractAllTo(/*target path*/"/home/me/zipcontent/", /*overwrite*/true);
// extracts everything and calls callback -> async extracction
zip.extractAllToAsync(/*target path*/"/home/me/zipcontent/", /*overwrite*/true, (error: Error)=> {});
// creating archives
var zip = new AdmZip();
@@ -58,4 +59,4 @@ zip.extractEntryTo("folder/subfolder/myfile.txt", "/home/user/", false, true);
function isAdmZipEntry(obj: any): obj is AdmZip.IZipEntry {
return obj !== null && typeof obj === "object" && typeof obj['entryName'] === 'string';
}
}
+11 -3
View File
@@ -1,7 +1,7 @@
// Type definitions for adm-zip v0.4.4
// Project: https://github.com/cthackers/adm-zip
// Definitions by: John Vilk <https://github.com/jvilk>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions by: John Vilk <https://github.com/jvilk>, Abner Oliveira <https://github.com/abner>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
@@ -211,6 +211,14 @@ declare module "adm-zip" {
* will be overwriten if this is true. Default is FALSE
*/
extractAllTo(targetPath: string, overwrite?: boolean): void;
/**
* Extracts the entire archive to the given location
* @param targetPath Target location
* @param overwrite If the file already exists at the target path, the file
* will be overwriten if this is true. Default is FALSE
* @param callback The callback function will be called afeter extraction
*/
extractAllToAsync(targetPath: string, overwrite: boolean, callback: (error: Error) => void): void;
/**
* Writes the newly created zip file to disk at the specified location or
* if a zip was opened and no ``targetFileName`` is provided, it will
@@ -225,7 +233,7 @@ declare module "adm-zip" {
toBuffer(): Buffer;
}
module AdmZip {
namespace AdmZip {
/**
* The ZipEntry is more than a structure representing the entry inside the
* zip file. Beside the normal attributes and headers a entry can have, the
+62 -61
View File
@@ -1,8 +1,9 @@
// Type definitions for ag-grid v2.1.2
// Project: http://www.ag-grid.com/
// Definitions by: Niall Crosby <https://github.com/ceolter/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module ag.grid {
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace ag.grid {
class ColumnChangeEvent {
private type;
private column;
@@ -28,7 +29,7 @@ declare module ag.grid {
isIndividualColumnResized(): boolean;
}
}
declare module ag.grid {
declare namespace ag.grid {
class Utils {
private static isSafari;
private static isIE;
@@ -84,7 +85,7 @@ declare module ag.grid {
static isBrowserSafari(): boolean;
}
}
declare module ag.grid {
declare namespace ag.grid {
class Constants {
static STEP_EVERYTHING: number;
static STEP_FILTER: number;
@@ -109,7 +110,7 @@ declare module ag.grid {
static KEY_RIGHT: number;
}
}
declare module ag.grid {
declare namespace ag.grid {
class Column {
static colIdSequence: number;
colDef: ColDef;
@@ -128,7 +129,7 @@ declare module ag.grid {
setMinimum(): void;
}
}
declare module ag.grid {
declare namespace ag.grid {
class ColumnGroup {
pinned: any;
name: any;
@@ -146,7 +147,7 @@ declare module ag.grid {
addToVisibleColumns(colsToAdd: any): void;
}
}
declare module ag.grid {
declare namespace ag.grid {
class GridOptionsWrapper {
private gridOptions;
private groupHeaders;
@@ -230,7 +231,7 @@ declare module ag.grid {
private getCallbackForEvent(eventName);
}
}
declare module ag.grid {
declare namespace ag.grid {
class LoggerFactory {
private logging;
init(gridOptionsWrapper: GridOptionsWrapper): void;
@@ -243,7 +244,7 @@ declare module ag.grid {
log(message: string): void;
}
}
declare module ag.grid {
declare namespace ag.grid {
class Events {
/** A new set of columns has been entered, everything has potentially changed. */
static EVENT_COLUMN_EVERYTHING_CHANGED: string;
@@ -279,7 +280,7 @@ declare module ag.grid {
static EVENT_READY: string;
}
}
declare module ag.grid {
declare namespace ag.grid {
class EventService {
private allListeners;
private globalListeners;
@@ -291,7 +292,7 @@ declare module ag.grid {
dispatchEvent(eventType: string, event?: any): void;
}
}
declare module ag.grid {
declare namespace ag.grid {
class MasterSlaveService {
private gridOptionsWrapper;
private columnController;
@@ -308,7 +309,7 @@ declare module ag.grid {
onColumnEvent(event: ColumnChangeEvent): void;
}
}
declare module ag.grid {
declare namespace ag.grid {
class ColumnApi {
private _columnController;
constructor(_columnController: ColumnController);
@@ -407,7 +408,7 @@ declare module ag.grid {
private getTotalColWidth(includePinned);
}
}
declare module ag.grid {
declare namespace ag.grid {
interface CsvExportParams {
skipHeader?: boolean;
skipFooters?: boolean;
@@ -426,7 +427,7 @@ declare module ag.grid {
private escape(value);
}
}
declare module ag.grid {
declare namespace ag.grid {
class ExpressionService {
private expressionToFunctionCache;
private logger;
@@ -436,13 +437,13 @@ declare module ag.grid {
private createFunctionBody(expression);
}
}
declare module ag.grid {
declare namespace ag.grid {
interface TextAndNumberFilterParameters {
/** What to do when new rows are loaded. The default is to reset the filter, to keep it in line with 'set' filters. If you want to keep the selection, then set this value to 'keep'. */
newRowsAction?: string;
}
}
declare module ag.grid {
declare namespace ag.grid {
class TextFilter implements Filter {
private filterParams;
private filterChangedCallback;
@@ -473,7 +474,7 @@ declare module ag.grid {
private getApi();
}
}
declare module ag.grid {
declare namespace ag.grid {
class NumberFilter implements Filter {
private filterParams;
private filterChangedCallback;
@@ -504,7 +505,7 @@ declare module ag.grid {
private getApi();
}
}
declare module ag.grid {
declare namespace ag.grid {
interface ColDef {
/** If sorting by default, set it here. Set to 'asc' or 'desc' */
sort?: string;
@@ -594,7 +595,7 @@ declare module ag.grid {
onCellContextMenu?: Function;
}
}
declare module ag.grid {
declare namespace ag.grid {
class SetFilterModel {
private colDef;
private filterParams;
@@ -635,7 +636,7 @@ declare module ag.grid {
}
}
/** The filter parameters for set filter */
declare module ag.grid {
declare namespace ag.grid {
interface SetFilterParameters {
/** Same as cell renderer for grid (you can use the same one in both locations). Setting it separatly here allows for the value to be rendered differently in the filter. */
cellRenderer?: Function;
@@ -649,7 +650,7 @@ declare module ag.grid {
suppressRemoveEntries?: boolean;
}
}
declare module ag.grid {
declare namespace ag.grid {
class SetFilter implements Filter {
private eGui;
private filterParams;
@@ -697,7 +698,7 @@ declare module ag.grid {
private createApi();
}
}
declare module ag.grid {
declare namespace ag.grid {
class PopupService {
private ePopupParent;
init(ePopupParent: any): void;
@@ -705,7 +706,7 @@ declare module ag.grid {
addAsModalPopup(eChild: any, closeOnEsc: boolean): (event: any) => void;
}
}
declare module ag.grid {
declare namespace ag.grid {
interface RowNode {
/** Unique ID for the node. Can be though of as the index of the row in the original list,
* however exceptions apply so don't depend on uniqueness. */
@@ -754,7 +755,7 @@ declare module ag.grid {
_childrenMap?: {};
}
}
declare module ag.grid {
declare namespace ag.grid {
class FilterManager {
private $compile;
private $scope;
@@ -793,7 +794,7 @@ declare module ag.grid {
showFilter(column: Column, eventSource: any): void;
}
}
declare module ag.grid {
declare namespace ag.grid {
class TemplateService {
templateCache: any;
waitingCallbacks: any;
@@ -803,7 +804,7 @@ declare module ag.grid {
handleHttpResult(httpResult: any, url: any): void;
}
}
declare module ag.grid {
declare namespace ag.grid {
class SelectionRendererFactory {
private angularGrid;
private selectionController;
@@ -811,7 +812,7 @@ declare module ag.grid {
createSelectionCheckbox(node: any, rowIndex: any): HTMLInputElement;
}
}
declare module ag.vdom {
declare namespace ag.vdom {
class VElement {
static idSequence: number;
private id;
@@ -824,7 +825,7 @@ declare module ag.vdom {
toHtmlString(): string;
}
}
declare module ag.vdom {
declare namespace ag.vdom {
class VHtmlElement extends VElement {
private type;
private classes;
@@ -855,7 +856,7 @@ declare module ag.vdom {
fireElementAttachedToChildren(element: Element): void;
}
}
declare module ag.vdom {
declare namespace ag.vdom {
class VWrapperElement extends VElement {
private wrappedElement;
constructor(wrappedElement: Element);
@@ -863,7 +864,7 @@ declare module ag.vdom {
elementAttached(element: Element): void;
}
}
declare module ag.grid {
declare namespace ag.grid {
class RenderedCell {
private vGridCell;
private vSpanWithValue;
@@ -924,7 +925,7 @@ declare module ag.grid {
private addClasses();
}
}
declare module ag.grid {
declare namespace ag.grid {
class RenderedRow {
vPinnedRow: any;
vBodyRow: any;
@@ -974,7 +975,7 @@ declare module ag.grid {
private addDynamicClasses();
}
}
declare module ag.grid {
declare namespace ag.grid {
class SvgFactory {
static theInstance: SvgFactory;
static getInstance(): SvgFactory;
@@ -990,10 +991,10 @@ declare module ag.grid {
createArrowUpDownSvg(): Element;
}
}
declare module ag.grid {
declare namespace ag.grid {
function groupCellRendererFactory(gridOptionsWrapper: GridOptionsWrapper, selectionRendererFactory: SelectionRendererFactory, expressionService: ExpressionService): (params: any) => HTMLSpanElement;
}
declare module ag.grid {
declare namespace ag.grid {
class RowRenderer {
private columnModel;
private gridOptionsWrapper;
@@ -1057,7 +1058,7 @@ declare module ag.grid {
startEditingNextCell(rowIndex: any, column: any, shiftKey: any): void;
}
}
declare module ag.grid {
declare namespace ag.grid {
class SelectionController {
private eParentsOfRows;
private angularGrid;
@@ -1094,7 +1095,7 @@ declare module ag.grid {
private updateGroupParentsIfNeeded();
}
}
declare module ag.grid {
declare namespace ag.grid {
class RenderedHeaderElement {
private eRoot;
private dragStartX;
@@ -1110,7 +1111,7 @@ declare module ag.grid {
stopDragging(listenersToRemove: any): void;
}
}
declare module ag.grid {
declare namespace ag.grid {
class RenderedHeaderCell extends RenderedHeaderElement {
private static DEFAULT_SORTING_ORDER;
private eHeaderCell;
@@ -1148,7 +1149,7 @@ declare module ag.grid {
private addHeaderClassesFromCollDef();
}
}
declare module ag.grid {
declare namespace ag.grid {
class RenderedHeaderGroupCell extends RenderedHeaderElement {
private eHeaderGroup;
private eHeaderGroupCell;
@@ -1178,7 +1179,7 @@ declare module ag.grid {
onDragging(dragChange: any): void;
}
}
declare module ag.grid {
declare namespace ag.grid {
class HeaderRenderer {
private gridOptionsWrapper;
private columnController;
@@ -1200,7 +1201,7 @@ declare module ag.grid {
onIndividualColumnResized(column: Column): void;
}
}
declare module ag.grid {
declare namespace ag.grid {
class GroupCreator {
private valueService;
init(valueService: ValueService): void;
@@ -1208,7 +1209,7 @@ declare module ag.grid {
isExpanded(expandByDefault: any, level: any): boolean;
}
}
declare module ag.grid {
declare namespace ag.grid {
class InMemoryRowController {
private gridOptionsWrapper;
private columnController;
@@ -1257,7 +1258,7 @@ declare module ag.grid {
private createFooterNode(groupNode);
}
}
declare module ag.grid {
declare namespace ag.grid {
class VirtualPageRowController {
rowRenderer: any;
datasourceVersion: any;
@@ -1304,7 +1305,7 @@ declare module ag.grid {
};
}
}
declare module ag.grid {
declare namespace ag.grid {
class PaginationController {
eGui: any;
btNext: any;
@@ -1346,7 +1347,7 @@ declare module ag.grid {
setupComponents(): void;
}
}
declare module ag.grid {
declare namespace ag.grid {
class BorderLayout {
private eNorthWrapper;
private eSouthWrapper;
@@ -1386,7 +1387,7 @@ declare module ag.grid {
setSouthVisible(visible: any): void;
}
}
declare module ag.grid {
declare namespace ag.grid {
class GridPanel {
private masterSlaveService;
private gridOptionsWrapper;
@@ -1451,7 +1452,7 @@ declare module ag.grid {
private scrollPinned(bodyTopPosition);
}
}
declare module ag.grid {
declare namespace ag.grid {
class DragAndDropService {
static theInstance: DragAndDropService;
static getInstance(): DragAndDropService;
@@ -1465,7 +1466,7 @@ declare module ag.grid {
}
}
declare function require(name: string): any;
declare module ag.grid {
declare namespace ag.grid {
class AgList {
private eGui;
private uniqueId;
@@ -1516,7 +1517,7 @@ declare module ag.grid {
getGui(): any;
}
}
declare module ag.grid {
declare namespace ag.grid {
class ColumnSelectionPanel {
private gridOptionsWrapper;
private columnController;
@@ -1532,7 +1533,7 @@ declare module ag.grid {
getGui(): any;
}
}
declare module ag.grid {
declare namespace ag.grid {
class GroupSelectionPanel {
gridOptionsWrapper: any;
columnController: ColumnController;
@@ -1548,7 +1549,7 @@ declare module ag.grid {
private onItemMoved(fromIndex, toIndex);
}
}
declare module ag.grid {
declare namespace ag.grid {
class AgDropdownList {
private itemSelectedListeners;
private eValue;
@@ -1572,7 +1573,7 @@ declare module ag.grid {
setModel(model: any): void;
}
}
declare module ag.grid {
declare namespace ag.grid {
class ValuesSelectionPanel {
private gridOptionsWrapper;
private columnController;
@@ -1588,7 +1589,7 @@ declare module ag.grid {
private beforeDropListener(newItem);
}
}
declare module ag.grid {
declare namespace ag.grid {
class VerticalStack {
isLayoutPanel: any;
childPanels: any;
@@ -1599,14 +1600,14 @@ declare module ag.grid {
doLayout(): void;
}
}
declare module ag.grid {
declare namespace ag.grid {
class ToolPanel {
layout: any;
constructor();
init(columnController: any, inMemoryRowController: any, gridOptionsWrapper: GridOptionsWrapper, popupService: PopupService, eventService: EventService): void;
}
}
declare module ag.grid {
declare namespace ag.grid {
interface GridOptions {
virtualPaging?: boolean;
toolPanelSuppressPivot?: boolean;
@@ -1693,7 +1694,7 @@ declare module ag.grid {
columnApi?: ColumnApi;
}
}
declare module ag.grid {
declare namespace ag.grid {
class GridApi {
private grid;
private rowRenderer;
@@ -1790,7 +1791,7 @@ declare module ag.grid {
refreshPivot(): void;
}
}
declare module ag.grid {
declare namespace ag.grid {
class ValueService {
private gridOptionsWrapper;
private expressionService;
@@ -1801,7 +1802,7 @@ declare module ag.grid {
private getValueCallback(data, node, field);
}
}
declare module ag.grid {
declare namespace ag.grid {
class Grid {
private virtualRowCallbacks;
private gridOptions;
@@ -1863,7 +1864,7 @@ declare module ag.grid {
doLayout(): void;
}
}
declare module ag.grid {
declare namespace ag.grid {
class ComponentUtil {
static SIMPLE_PROPERTIES: string[];
static SIMPLE_NUMBER_PROPERTIES: string[];
@@ -1879,7 +1880,7 @@ declare module ag.grid {
static toNumber(value: any): number;
}
}
declare module ag.grid {
declare namespace ag.grid {
class AgGridNg2 {
private elementDef;
private _agGrid;
@@ -1974,11 +1975,11 @@ declare module ag.grid {
private globalEventListener(eventType, event);
}
}
declare module ag.grid {
declare namespace ag.grid {
}
declare var exports: any;
declare var module: any;
declare module ag.grid {
declare namespace ag.grid {
interface Filter {
getGui(): any;
isFilterActive(): boolean;
+62 -62
View File
@@ -1,8 +1,9 @@
// Type definitions for ag-grid v2.1.2
// Project: http://www.ag-grid.com/
// Definitions by: Niall Crosby <https://github.com/ceolter/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module ag.grid {
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace ag.grid {
class ColumnChangeEvent {
private type;
private column;
@@ -28,7 +29,7 @@ declare module ag.grid {
isIndividualColumnResized(): boolean;
}
}
declare module ag.grid {
declare namespace ag.grid {
class Utils {
private static isSafari;
private static isIE;
@@ -84,7 +85,7 @@ declare module ag.grid {
static isBrowserSafari(): boolean;
}
}
declare module ag.grid {
declare namespace ag.grid {
class Constants {
static STEP_EVERYTHING: number;
static STEP_FILTER: number;
@@ -109,7 +110,7 @@ declare module ag.grid {
static KEY_RIGHT: number;
}
}
declare module ag.grid {
declare namespace ag.grid {
class Column {
static colIdSequence: number;
colDef: ColDef;
@@ -128,7 +129,7 @@ declare module ag.grid {
setMinimum(): void;
}
}
declare module ag.grid {
declare namespace ag.grid {
class ColumnGroup {
pinned: any;
name: any;
@@ -146,7 +147,7 @@ declare module ag.grid {
addToVisibleColumns(colsToAdd: any): void;
}
}
declare module ag.grid {
declare namespace ag.grid {
class GridOptionsWrapper {
private gridOptions;
private groupHeaders;
@@ -230,7 +231,7 @@ declare module ag.grid {
private getCallbackForEvent(eventName);
}
}
declare module ag.grid {
declare namespace ag.grid {
class LoggerFactory {
private logging;
init(gridOptionsWrapper: GridOptionsWrapper): void;
@@ -243,7 +244,7 @@ declare module ag.grid {
log(message: string): void;
}
}
declare module ag.grid {
declare namespace ag.grid {
class Events {
/** A new set of columns has been entered, everything has potentially changed. */
static EVENT_COLUMN_EVERYTHING_CHANGED: string;
@@ -279,7 +280,7 @@ declare module ag.grid {
static EVENT_READY: string;
}
}
declare module ag.grid {
declare namespace ag.grid {
class EventService {
private allListeners;
private globalListeners;
@@ -291,7 +292,7 @@ declare module ag.grid {
dispatchEvent(eventType: string, event?: any): void;
}
}
declare module ag.grid {
declare namespace ag.grid {
class MasterSlaveService {
private gridOptionsWrapper;
private columnController;
@@ -308,7 +309,7 @@ declare module ag.grid {
onColumnEvent(event: ColumnChangeEvent): void;
}
}
declare module ag.grid {
declare namespace ag.grid {
class ColumnApi {
private _columnController;
constructor(_columnController: ColumnController);
@@ -407,7 +408,7 @@ declare module ag.grid {
private getTotalColWidth(includePinned);
}
}
declare module ag.grid {
declare namespace ag.grid {
interface CsvExportParams {
skipHeader?: boolean;
skipFooters?: boolean;
@@ -426,7 +427,7 @@ declare module ag.grid {
private escape(value);
}
}
declare module ag.grid {
declare namespace ag.grid {
class ExpressionService {
private expressionToFunctionCache;
private logger;
@@ -436,13 +437,13 @@ declare module ag.grid {
private createFunctionBody(expression);
}
}
declare module ag.grid {
declare namespace ag.grid {
interface TextAndNumberFilterParameters {
/** What to do when new rows are loaded. The default is to reset the filter, to keep it in line with 'set' filters. If you want to keep the selection, then set this value to 'keep'. */
newRowsAction?: string;
}
}
declare module ag.grid {
declare namespace ag.grid {
class TextFilter implements Filter {
private filterParams;
private filterChangedCallback;
@@ -473,7 +474,7 @@ declare module ag.grid {
private getApi();
}
}
declare module ag.grid {
declare namespace ag.grid {
class NumberFilter implements Filter {
private filterParams;
private filterChangedCallback;
@@ -504,7 +505,7 @@ declare module ag.grid {
private getApi();
}
}
declare module ag.grid {
declare namespace ag.grid {
interface ColDef {
/** If sorting by default, set it here. Set to 'asc' or 'desc' */
sort?: string;
@@ -594,7 +595,7 @@ declare module ag.grid {
onCellContextMenu?: Function;
}
}
declare module ag.grid {
declare namespace ag.grid {
class SetFilterModel {
private colDef;
private filterParams;
@@ -635,7 +636,7 @@ declare module ag.grid {
}
}
/** The filter parameters for set filter */
declare module ag.grid {
declare namespace ag.grid {
interface SetFilterParameters {
/** Same as cell renderer for grid (you can use the same one in both locations). Setting it separatly here allows for the value to be rendered differently in the filter. */
cellRenderer?: Function;
@@ -649,7 +650,7 @@ declare module ag.grid {
suppressRemoveEntries?: boolean;
}
}
declare module ag.grid {
declare namespace ag.grid {
class SetFilter implements Filter {
private eGui;
private filterParams;
@@ -697,7 +698,7 @@ declare module ag.grid {
private createApi();
}
}
declare module ag.grid {
declare namespace ag.grid {
class PopupService {
private ePopupParent;
init(ePopupParent: any): void;
@@ -705,7 +706,7 @@ declare module ag.grid {
addAsModalPopup(eChild: any, closeOnEsc: boolean): (event: any) => void;
}
}
declare module ag.grid {
declare namespace ag.grid {
interface RowNode {
/** Unique ID for the node. Can be though of as the index of the row in the original list,
* however exceptions apply so don't depend on uniqueness. */
@@ -754,7 +755,7 @@ declare module ag.grid {
_childrenMap?: {};
}
}
declare module ag.grid {
declare namespace ag.grid {
class FilterManager {
private $compile;
private $scope;
@@ -793,7 +794,7 @@ declare module ag.grid {
showFilter(column: Column, eventSource: any): void;
}
}
declare module ag.grid {
declare namespace ag.grid {
class TemplateService {
templateCache: any;
waitingCallbacks: any;
@@ -803,7 +804,7 @@ declare module ag.grid {
handleHttpResult(httpResult: any, url: any): void;
}
}
declare module ag.grid {
declare namespace ag.grid {
class SelectionRendererFactory {
private angularGrid;
private selectionController;
@@ -811,7 +812,7 @@ declare module ag.grid {
createSelectionCheckbox(node: any, rowIndex: any): HTMLInputElement;
}
}
declare module ag.vdom {
declare namespace ag.vdom {
class VElement {
static idSequence: number;
private id;
@@ -824,7 +825,7 @@ declare module ag.vdom {
toHtmlString(): string;
}
}
declare module ag.vdom {
declare namespace ag.vdom {
class VHtmlElement extends VElement {
private type;
private classes;
@@ -855,7 +856,7 @@ declare module ag.vdom {
fireElementAttachedToChildren(element: Element): void;
}
}
declare module ag.vdom {
declare namespace ag.vdom {
class VWrapperElement extends VElement {
private wrappedElement;
constructor(wrappedElement: Element);
@@ -863,7 +864,7 @@ declare module ag.vdom {
elementAttached(element: Element): void;
}
}
declare module ag.grid {
declare namespace ag.grid {
class RenderedCell {
private vGridCell;
private vSpanWithValue;
@@ -924,7 +925,7 @@ declare module ag.grid {
private addClasses();
}
}
declare module ag.grid {
declare namespace ag.grid {
class RenderedRow {
vPinnedRow: any;
vBodyRow: any;
@@ -974,7 +975,7 @@ declare module ag.grid {
private addDynamicClasses();
}
}
declare module ag.grid {
declare namespace ag.grid {
class SvgFactory {
static theInstance: SvgFactory;
static getInstance(): SvgFactory;
@@ -990,10 +991,10 @@ declare module ag.grid {
createArrowUpDownSvg(): Element;
}
}
declare module ag.grid {
declare namespace ag.grid {
function groupCellRendererFactory(gridOptionsWrapper: GridOptionsWrapper, selectionRendererFactory: SelectionRendererFactory, expressionService: ExpressionService): (params: any) => HTMLSpanElement;
}
declare module ag.grid {
declare namespace ag.grid {
class RowRenderer {
private columnModel;
private gridOptionsWrapper;
@@ -1057,7 +1058,7 @@ declare module ag.grid {
startEditingNextCell(rowIndex: any, column: any, shiftKey: any): void;
}
}
declare module ag.grid {
declare namespace ag.grid {
class SelectionController {
private eParentsOfRows;
private angularGrid;
@@ -1094,7 +1095,7 @@ declare module ag.grid {
private updateGroupParentsIfNeeded();
}
}
declare module ag.grid {
declare namespace ag.grid {
class RenderedHeaderElement {
private eRoot;
private dragStartX;
@@ -1110,7 +1111,7 @@ declare module ag.grid {
stopDragging(listenersToRemove: any): void;
}
}
declare module ag.grid {
declare namespace ag.grid {
class RenderedHeaderCell extends RenderedHeaderElement {
private static DEFAULT_SORTING_ORDER;
private eHeaderCell;
@@ -1148,7 +1149,7 @@ declare module ag.grid {
private addHeaderClassesFromCollDef();
}
}
declare module ag.grid {
declare namespace ag.grid {
class RenderedHeaderGroupCell extends RenderedHeaderElement {
private eHeaderGroup;
private eHeaderGroupCell;
@@ -1178,7 +1179,7 @@ declare module ag.grid {
onDragging(dragChange: any): void;
}
}
declare module ag.grid {
declare namespace ag.grid {
class HeaderRenderer {
private gridOptionsWrapper;
private columnController;
@@ -1200,7 +1201,7 @@ declare module ag.grid {
onIndividualColumnResized(column: Column): void;
}
}
declare module ag.grid {
declare namespace ag.grid {
class GroupCreator {
private valueService;
init(valueService: ValueService): void;
@@ -1208,7 +1209,7 @@ declare module ag.grid {
isExpanded(expandByDefault: any, level: any): boolean;
}
}
declare module ag.grid {
declare namespace ag.grid {
class InMemoryRowController {
private gridOptionsWrapper;
private columnController;
@@ -1257,7 +1258,7 @@ declare module ag.grid {
private createFooterNode(groupNode);
}
}
declare module ag.grid {
declare namespace ag.grid {
class VirtualPageRowController {
rowRenderer: any;
datasourceVersion: any;
@@ -1304,7 +1305,7 @@ declare module ag.grid {
};
}
}
declare module ag.grid {
declare namespace ag.grid {
class PaginationController {
eGui: any;
btNext: any;
@@ -1346,7 +1347,7 @@ declare module ag.grid {
setupComponents(): void;
}
}
declare module ag.grid {
declare namespace ag.grid {
class BorderLayout {
private eNorthWrapper;
private eSouthWrapper;
@@ -1386,7 +1387,7 @@ declare module ag.grid {
setSouthVisible(visible: any): void;
}
}
declare module ag.grid {
declare namespace ag.grid {
class GridPanel {
private masterSlaveService;
private gridOptionsWrapper;
@@ -1451,7 +1452,7 @@ declare module ag.grid {
private scrollPinned(bodyTopPosition);
}
}
declare module ag.grid {
declare namespace ag.grid {
class DragAndDropService {
static theInstance: DragAndDropService;
static getInstance(): DragAndDropService;
@@ -1464,8 +1465,7 @@ declare module ag.grid {
addDropTarget(eDropTarget: any, dropTargetCallback: any): void;
}
}
declare function require(name: string): any;
declare module ag.grid {
declare namespace ag.grid {
class AgList {
private eGui;
private uniqueId;
@@ -1516,7 +1516,7 @@ declare module ag.grid {
getGui(): any;
}
}
declare module ag.grid {
declare namespace ag.grid {
class ColumnSelectionPanel {
private gridOptionsWrapper;
private columnController;
@@ -1532,7 +1532,7 @@ declare module ag.grid {
getGui(): any;
}
}
declare module ag.grid {
declare namespace ag.grid {
class GroupSelectionPanel {
gridOptionsWrapper: any;
columnController: ColumnController;
@@ -1548,7 +1548,7 @@ declare module ag.grid {
private onItemMoved(fromIndex, toIndex);
}
}
declare module ag.grid {
declare namespace ag.grid {
class AgDropdownList {
private itemSelectedListeners;
private eValue;
@@ -1572,7 +1572,7 @@ declare module ag.grid {
setModel(model: any): void;
}
}
declare module ag.grid {
declare namespace ag.grid {
class ValuesSelectionPanel {
private gridOptionsWrapper;
private columnController;
@@ -1588,7 +1588,7 @@ declare module ag.grid {
private beforeDropListener(newItem);
}
}
declare module ag.grid {
declare namespace ag.grid {
class VerticalStack {
isLayoutPanel: any;
childPanels: any;
@@ -1599,14 +1599,14 @@ declare module ag.grid {
doLayout(): void;
}
}
declare module ag.grid {
declare namespace ag.grid {
class ToolPanel {
layout: any;
constructor();
init(columnController: any, inMemoryRowController: any, gridOptionsWrapper: GridOptionsWrapper, popupService: PopupService, eventService: EventService): void;
}
}
declare module ag.grid {
declare namespace ag.grid {
interface GridOptions {
virtualPaging?: boolean;
toolPanelSuppressPivot?: boolean;
@@ -1693,7 +1693,7 @@ declare module ag.grid {
columnApi?: ColumnApi;
}
}
declare module ag.grid {
declare namespace ag.grid {
class GridApi {
private grid;
private rowRenderer;
@@ -1790,7 +1790,7 @@ declare module ag.grid {
refreshPivot(): void;
}
}
declare module ag.grid {
declare namespace ag.grid {
class ValueService {
private gridOptionsWrapper;
private expressionService;
@@ -1801,7 +1801,7 @@ declare module ag.grid {
private getValueCallback(data, node, field);
}
}
declare module ag.grid {
declare namespace ag.grid {
class Grid {
private virtualRowCallbacks;
private gridOptions;
@@ -1863,7 +1863,7 @@ declare module ag.grid {
doLayout(): void;
}
}
declare module ag.grid {
declare namespace ag.grid {
class ComponentUtil {
static SIMPLE_PROPERTIES: string[];
static SIMPLE_NUMBER_PROPERTIES: string[];
@@ -1879,7 +1879,7 @@ declare module ag.grid {
static toNumber(value: any): number;
}
}
declare module ag.grid {
declare namespace ag.grid {
class AgGridNg2 {
private elementDef;
private _agGrid;
@@ -1974,11 +1974,11 @@ declare module ag.grid {
private globalEventListener(eventType, event);
}
}
declare module ag.grid {
declare namespace ag.grid {
}
declare var exports: any;
declare var module: any;
declare module ag.grid {
declare namespace ag.grid {
interface Filter {
getGui(): any;
isFilterActive(): boolean;
+106
View File
@@ -0,0 +1,106 @@
///<reference path="agenda.d.ts"/>
import * as Agenda from "agenda";
var mongoConnectionString = "mongodb://127.0.0.1/agenda";
var agenda = new Agenda({ db: { address: mongoConnectionString } });
agenda.define('delete old users', (job, done) => {
});
agenda.on('ready', () => {
agenda.every('3 minutes', 'delete old users');
// Alternatively, you could also do:
agenda.every('*/3 * * * *', 'delete old users');
agenda.start();
});
agenda.define('send email report', { priority: 'high', concurrency: 10 }, (job, done) => {
});
agenda.on('ready', () => {
agenda.schedule('in 20 minutes', 'send email report', { to: 'admin@example.com' });
agenda.start();
});
agenda.on('ready', () => {
var weeklyReport = agenda.create('send email report', { to: 'another-guy@example.com' });
weeklyReport.repeatEvery('1 week').save();
agenda.start();
});
var agenda = new Agenda({ processEvery: '30 seconds' });
agenda.defaultConcurrency(5);
var agenda = new Agenda({ defaultConcurrency: 5 });
agenda.lockLimit(0);
var agenda = new Agenda({ lockLimit: 0 });
agenda.defaultLockLimit(0);
var agenda = new Agenda({ defaultLockLimit: 0 });
agenda.defaultLockLifetime(10000);
var agenda = new Agenda({ defaultLockLifetime: 10000 });
agenda.define('some long running job', function(job, done) {
done();
});
agenda.every('15 minutes', ['printAnalyticsReport', 'sendNotifications', 'updateUserRecords']);
agenda.schedule('tomorrow at noon', 'printAnalyticsReport', { userCount: 100 });
agenda.schedule('tomorrow at noon', ['printAnalyticsReport', 'sendNotifications', 'updateUserRecords']);
agenda.now('do the hokey pokey');
var job = agenda.create('printAnalyticsReport', { userCount: 100 });
job.save(function(err) {
console.log("Job successfully saved");
});
agenda.jobs({ name: 'printAnalyticsReport' }, function(err, jobs) {
// Work with jobs (see below)
});
agenda.cancel({ name: 'printAnalyticsReport' }, function(err, numRemoved) {
});
agenda.purge(function(err, numRemoved) {
});
agenda.stop(function() {
process.exit(0);
});
job.repeatEvery('10 minutes');
job.repeatAt('3:30pm');
job.schedule('tomorrow at 6pm');
job.priority('low');
job.priority(10);
job.unique({ 'data.type': 'active', 'data.userId': '123' });
job.fail('insuficient disk space');
job.fail(new Error('insufficient disk space'));
job.run(function(err, job) {
console.log("I don't know why you would need to do this...");
});
job.remove(function(err) {
if (!err) console.log("Successfully removed job from collection");
})
+443
View File
@@ -0,0 +1,443 @@
// Type definitions for Agenda v0.8.9
// Project: https://github.com/rschmukler/agenda
// Definitions by: Meir Gottlieb <https://github.com/meirgottlieb>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path='../node/node.d.ts' />
/// <reference path='../mongodb/mongodb.d.ts' />
declare module "agenda" {
import {EventEmitter} from "events";
import {Db, Collection, ObjectID} from "mongodb";
interface Callback {
(err?: Error): void;
}
interface ResultCallback<T> {
(err?: Error, result?: T): void;
}
/**
* Agenda Configuration.
*/
interface AgendaConfiguration {
/**
* Sets the interval with which the queue is checked. A number in milliseconds or a frequency string.
*/
processEvery?: string | number;
/**
* Takes a number which specifies the default number of a specific job that can be running at any given moment.
* By default it is 5.
*/
defaultConcurrency?: number;
/**
* Takes a number which specifies the max number of jobs that can be running at any given moment. By default it
* is 20.
*/
maxConcurrency?: number;
/**
* Takes a number which specifies the default number of a specific job that can be locked at any given moment.
* By default it is 0 for no max.
*/
defaultLockLimit?: number;
/**
* Takes a number shich specifies the max number jobs that can be locked at any given moment. By default it is
* 0 for no max.
*/
lockLimit?: number;
/**
* Takes a number which specifies the default lock lifetime in milliseconds. By default it is 10 minutes. This
* can be overridden by specifying the lockLifetime option to a defined job.
*/
defaultLockLifetime?: number;
/**
* Specifies that Agenda should be initialized using and existing MongoDB connection.
*/
mongo?: {
/**
* The MongoDB database connection to use.
*/
db: Db;
/**
* The name of the collection to use.
*/
collection?: string;
}
/**
* Specifies that Agenda should connect to MongoDB.
*/
db?: {
/**
* The connection URL.
*/
address: string;
/**
* The name of the collection to use.
*/
collection?: string;
/**
* Connection options to pass to MongoDB.
*/
options?: any;
}
}
/**
* The database record associated with a job.
*/
interface JobAttributes {
/**
* The record identity.
*/
_id: ObjectID;
/**
* The name of the job.
*/
name: string;
/**
* The type of the job (single|normal).
*/
type: string;
/**
* The job details.
*/
data: { [name: string]: any };
/**
* The priority of the job.
*/
priority: number;
/**
* How often the job is repeated using a human-readable or cron format.
*/
repeatInterval: string | number;
/**
* The timezone that conforms to [moment-timezone](http://momentjs.com/timezone/).
*/
repeatTimezone: string;
/**
* Date/time the job was las modified.
*/
lastModifiedBy: string;
/**
* Date/time the job will run next.
*/
nextRunAt: Date;
/**
* Date/time the job was locked.
*/
lockedAt: Date;
/**
* Date/time the job was last run.
*/
lastRunAt: Date;
/**
* Date/time the job last finished running.
*/
lastFinishedAt: Date;
/**
* The reason the job failed.
*/
failReason: string;
/**
* The number of times the job has failed.
*/
failCount: number;
/**
* The date/time the job last failed.
*/
failedAt: Date;
}
/**
* A scheduled job.
*/
interface Job {
/**
* The database record associated with the job.
*/
attrs: JobAttributes;
/**
* Specifies an interval on which the job should repeat.
* @param interval A human-readable format String, a cron format String, or a Number.
* @param options An optional argument that can include a timezone field. The timezone should be a string as
* accepted by moment-timezone and is considered when using an interval in the cron string format.
*/
repeatEvery(interval: string | number, options?: { timezone?: string }): Job
/**
* Specifies a time when the job should repeat. [Possible values](https://github.com/matthewmueller/date#examples).
* @param time
*/
repeatAt(time: string): Job
/**
* Disables the job.
*/
disable(): Job;
/**
* Enables the job.
*/
enable(): Job;
/**
* Ensure that only one instance of this job exists with the specified properties
* @param value The properties associated with the job that must be unqiue.
* @param opts
*/
unique(value: any, opts?: { insertOnly?: boolean }): Job;
/**
* Specifies the next time at which the job should run.
* @param time The next time at which the job should run.
*/
schedule(time: string | Date): Job;
/**
* Specifies the priority weighting of the job.
* @param value The priority of the job (lowest|low|normal|high|highest|number).
*/
priority(value: string | number): Job;
/**
* Sets job.attrs.failedAt to now, and sets job.attrs.failReason to reason.
* @param reason A message or Error object that indicates why the job failed.
*/
fail(reason: string | Error): Job;
/**
* Runs the given job and calls callback(err, job) upon completion. Normally you never need to call this manually
* @param cb Called when the job is completed.
*/
run(cb?: ResultCallback<Job>): Job;
/**
* Returns true if the job is running; otherwise, returns false.
*/
isRunning(): boolean;
/**
* Saves the job into the database.
* @param cb Called when the job is saved.
*/
save(cb?: ResultCallback<Job>): Job;
/**
* Removes the job from the database and cancels the job.
* @param cb Called after the job has beeb removed from the database.
*/
remove(cb?: Callback): void;
/**
* Resets the lock on the job. Useful to indicate that the job hasn't timed out when you have very long running
* jobs.
* @param cb Called after the job has been saved to the database.
*/
touch(cb?: Callback): void;
}
interface JobOptions {
/**
* Maximum number of that job that can be running at once (per instance of agenda)
*/
concurrency?: number;
/**
* Maximum number of that job that can be locked at once (per instance of agenda)
*/
lockLimit?: number;
/**
* Interval in ms of how long the job stays locked for (see multiple job processors for more info). A job will
* automatically unlock if done() is called.
*/
lockLifetime?: number;
/**
* (lowest|low|normal|high|highest|number) specifies the priority of the job. Higher priority jobs will run
* first.
*/
priority?: string | number;
}
class Agenda extends EventEmitter {
/**
* Constructs a new Agenda object.
* @param config Optional configuration to initialize the Agenda.
* @param cb Optional callback called with the MongoDB colleciton.
*/
constructor(config?: AgendaConfiguration, cb?: ResultCallback<Collection>);
/**
* Connect to the specified MongoDB server and database.
*/
database(url: string, collection?: string, options?: any, cb?: ResultCallback<Collection>): Agenda;
/**
* Initialize agenda with an existing MongoDB connection.
*/
mongo(db: Db, collection?: string, cb?: ResultCallback<Collection>): Agenda;
/**
* Sets the agenda name.
*/
name(value: string): Agenda;
/**
* Sets the interval with which the queue is checked. A number in milliseconds or a frequency string.
*/
processEvery(interval: string | number): Agenda;
/**
* Takes a number which specifies the max number of jobs that can be running at any given moment. By default it
* is 20.
* @param value The value to set.
*/
maxConcurrency(value: number): Agenda;
/**
* Takes a number which specifies the default number of a specific job that can be running at any given moment.
* By default it is 5.
* @param value The value to set.
*/
defaultConcurrency(value: number): Agenda;
/**
* Takes a number shich specifies the max number jobs that can be locked at any given moment. By default it is
* 0 for no max.
* @param value The value to set.
*/
lockLimit(value: number): Agenda;
/**
* Takes a number which specifies the default number of a specific job that can be locked at any given moment.
* By default it is 0 for no max.
* @param value The value to set.
*/
defaultLockLimit(value: number): Agenda;
/**
* Takes a number which specifies the default lock lifetime in milliseconds. By default it is 10 minutes. This
* can be overridden by specifying the lockLifetime option to a defined job.
* @param value The value to set.
*/
defaultLockLifetime(value: number): Agenda;
/**
* Returns an instance of a jobName with data. This does NOT save the job in the database. See below to learn
* how to manually work with jobs.
* @param name The name of the job.
* @param data Data to associated with the job.
*/
create(name: string, data?: any): Job;
/**
* Find all Jobs matching `query` and pass same back in cb().
* @param query
* @param cb
*/
jobs(query: any, cb: ResultCallback<Job[]>): void;
/**
* Removes all jobs in the database without defined behaviors. Useful if you change a definition name and want
* to remove old jobs.
* @param cb Called with the number of jobs removed.
*/
purge(cb?: ResultCallback<number>): void;
/**
* Defines a job with the name of jobName. When a job of job name gets run, it will be passed to fn(job, done).
* To maintain asynchronous behavior, you must call done() when you are processing the job. If your function is
* synchronous, you may omit done from the signature.
* @param name The name of the jobs.
* @param options The options for the job.
* @param handler The handler to execute.
*/
define(name: string, handler: (job?: Job, done?: (err?: Error) => void) => void): void;
define(name: string, options: JobOptions, handler: (job?: Job, done?: (err?: Error) => void) => void): void;
/**
* Runs job name at the given interval. Optionally, data and options can be passed in.
* @param interval Can be a human-readable format String, a cron format String, or a Number.
* @param names The name or names of the job(s) to run.
* @param data An optional argument that will be passed to the processing function under job.attrs.data.
* @param options An optional argument that will be passed to job.repeatEvery.
* @param cb An optional callback function which will be called when the job has been persisted in the database.
*/
every(interval: number | string, names: string, data?: any, options?: any, cb?: ResultCallback<Job>): Job;
every(interval: number | string, names: string[], data?: any, options?: any, cb?: ResultCallback<Job[]>): Job[];
/**
* Schedules a job to run name once at a given time.
* @param when A Date or a String such as tomorrow at 5pm.
* @param names The name or names of the job(s) to run.
* @param data An optional argument that will be passed to the processing function under job.attrs.data.
* @param cb An optional callback function which will be called when the job has been persisted in the database.
*/
schedule(when: Date | string, names: string, data?: any, cb?: ResultCallback<Job>): Job;
schedule(when: Date | string, names: string[], data?: any, cb?: ResultCallback<Job[]>): Job[];
/**
* Schedules a job to run name once immediately.
* @param name The name of the job to run.
* @param data An optional argument that will be passed to the processing function under job.attrs.data.
* @param cb An optional callback function which will be called when the job has been persisted in the database.
*/
now(name: string, data?: any, cb?: ResultCallback<Job>): Job;
/**
* Cancels any jobs matching the passed mongodb-native query, and removes them from the database.
* @param query Mongodb native query.
* @param cb Called with the number of jobs removed.
*/
cancel(query: any, cb?: ResultCallback<number>): void;
/**
* Starts the job queue processing, checking processEvery time to see if there are new jobs.
*/
start(): void;
/**
* Stops the job queue processing. Unlocks currently running jobs.
* @param cb Called after the job processing queue shuts down and unlocks all jobs.
*/
stop(cb: Callback): void;
}
namespace Agenda {
}
export = Agenda;
}
+15 -15
View File
@@ -1,11 +1,11 @@
// Type definitions for alertify 0.3.11
// Project: http://fabien-d.github.io/alertify.js/
// Definitions by: John Jeffery <http://github.com/jjeffery>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare var alertify: alertify.IAlertifyStatic;
declare module alertify {
declare namespace alertify {
interface IAlertifyStatic {
/**
* Create an alert dialog box
@@ -16,7 +16,7 @@ declare module alertify {
* @since 0.0.1
*/
alert(message: string, fn?: Function, cssClass?: string): IAlertifyStatic;
/**
* Create a confirm dialog box
* @param message The message passed from the callee
@@ -26,7 +26,7 @@ declare module alertify {
* @since 0.0.1
*/
confirm(message: string, fn?: Function, cssClass?: string): IAlertifyStatic;
/**
* Extend the log method to create custom methods
* @param type Custom method name
@@ -34,7 +34,7 @@ declare module alertify {
* @since 0.0.1
*/
extend(type: string): (message: string, wait?: number) => IAlertifyStatic;
/**
* Initialize Alertify and create the 2 main elements.
* Initialization will happen automatically on the first
@@ -42,7 +42,7 @@ declare module alertify {
* @since 0.0.1
*/
init(): void;
/**
* Show a new log message box
* @param message The message passed from the callee
@@ -52,7 +52,7 @@ declare module alertify {
* @since 0.0.1
*/
log(message: string, type?: string, wait?: number): IAlertifyStatic;
/**
* Create a prompt dialog box
* @param message The message passed from the callee
@@ -63,7 +63,7 @@ declare module alertify {
* @since 0.0.1
*/
prompt(message: string, fn?: Function, placeholder?: string, cssClass?: string): IAlertifyStatic;
/**
* Shorthand for log messages
* @param message The message passed from the callee
@@ -71,7 +71,7 @@ declare module alertify {
* @since 0.0.1
*/
success(message: string): IAlertifyStatic;
/**
* Shorthand for log messages
* @param message The message passed from the callee
@@ -79,14 +79,14 @@ declare module alertify {
* @since 0.0.1
*/
error(message: string): IAlertifyStatic;
/**
* Used to set alertify properties
* @param Properties
* @since 0.2.11
*/
set(args: IProperties): void;
/**
* The labels used for dialog buttons
*/
@@ -105,13 +105,13 @@ declare module alertify {
interface IProperties {
/** Default value for milliseconds display of log messages */
delay?: number;
/** Default values for display of labels */
labels?: ILabels;
/** Default button for focus */
buttonFocus?: string;
/** Should buttons be displayed in reverse order */
buttonReverse?: boolean;
}
@@ -121,4 +121,4 @@ declare module alertify {
ok?: string;
cancel?: string;
}
}
}
+2 -4
View File
@@ -2,10 +2,8 @@
* Created by shearerbeard on 6/28/15.
*/
///<reference path="alt.d.ts"/>
///<reference path="../es6-promise/es6-promise.d.ts" />
import Alt = require("alt");
import Promise = require("es6-promise");
//New alt instance
var alt = new Alt();
@@ -43,8 +41,8 @@ class AbstractStoreModel<S> implements AltJS.StoreModel<S> {
class GenerateActionsClass extends AbstractActions {
constructor(config:AltJS.Alt) {
this.generateActions("notifyTest");
super(config);
this.generateActions("notifyTest");
}
}
@@ -74,7 +72,7 @@ var testSource:AltJS.Source = {
fakeLoad():AltJS.SourceModel<string> {
return {
remote() {
return new Promise.Promise<string>((res:any, rej:any) => {
return new Promise<string>((res:any, rej:any) => {
setTimeout(() => {
if(true) {
res("stuff");
+2 -3
View File
@@ -1,12 +1,11 @@
// Type definitions for Alt 0.16.10
// Project: https://github.com/goatslacker/alt
// Definitions by: Michael Shearer <https://github.com/Shearerbeard>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
///<reference path="../react/react.d.ts"/>
///<reference path="../es6-promise/es6-promise.d.ts" />
declare module AltJS {
declare namespace AltJS {
interface StoreReduce {
action:any;
+1 -3
View File
@@ -1,9 +1,7 @@
// Type definitions for amazon-product-api
// Project: https://github.com/t3chnoboy/amazon-product-api
// Definitions by: Matti Lehtinen <https://github.com/MattiLehtinen/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../es6-promise/es6-promise.d.ts"/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module "amazon-product-api" {
+77 -69
View File
@@ -1,10 +1,10 @@
// Type definitions for amCharts
// Project: http://www.amcharts.com/
// Definitions by: aleksey-bykov <https://github.com/aleksey-bykov>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// AmCharts object (it's not a class) is create automatically when amcharts.js or amstock.js file is included in a web page.
declare module AmCharts {
declare namespace AmCharts {
/** Set it to true if you have base href set for your page. This will fix rendering problems in Firefox caused by base href. */
var baseHref: boolean;
@@ -29,14 +29,14 @@ declare module AmCharts {
/** AmPieChart class creates pie/donut chart. In order to display pie chart you need to set at least three properties - dataProvider, titleField and valueField.
@example
var chartData = [{title:"Pie I have eaten",value:70},{title:"Pie I haven\'t eaten",value:30}];
var chartData = [{title:"Pie I have eaten",value:70},{title:"Pie I haven\'t eaten",value:30}];
var chart = new AmCharts.AmPieChart();
chart.valueField = "value";
chart.titleField = "title";
chart.dataProvider = chartData;
chart.write("chartdiv");
*/
class AmPieChart {
class AmPieChart extends AmChart {
/** Name of the field in chart's dataProvider which holds slice's alpha. */
alphaField: string;
/** Pie lean angle (for 3D effect). Valid range is 0 - 90. */
@@ -113,7 +113,7 @@ declare module AmCharts {
outlineAlpha: number;
/** Pie outline color. #FFFFFF */
outlineColor: string;
/** Pie outline thickness.
/** Pie outline thickness.
@default 1
*/
outlineThickness: number;
@@ -187,19 +187,6 @@ declare module AmCharts {
rollOverSlice(index: number);
/** Shows slice. index - the number of a slice or Slice object. */
showSlice(index: number);
/** Adds event listener of the type "clickSlice" or "pullInSlice" or "pullOutSlice" to the object.
@param type Always "clickSlice" or "pullInSlice" or "pullOutSlice".
@param handler
If the type is "clickSlice", dispatched when user clicks on a slice.
If the type is "pullInSlice", dispatched when user clicks on a slice and the slice is pulled-in.
If the type is "pullOutSlice", dispatched when user clicks on a slice and the slice is pulled-out.
If the type is "rollOutSlice", dispatched when user rolls-out of the slice.
If the type is "rollOverSlice", dispatched when user rolls-over the slice.
*/
addListener(type: string, handler: (e: {/** Always "rollOverSlice". */
type: string; dataItem: Slice;
}) => void );
}
/** AmRadarChart is the class you have to use for radar and polar chart types.
@@ -219,7 +206,7 @@ declare module AmCharts {
chart.dataProvider = chartData;
chart.categoryField = "country";
chart.startDuration = 2;
var valueAxis = new AmCharts.ValueAxis();
valueAxis.axisAlpha = 0.15;
valueAxis.minimum = 0;
@@ -227,13 +214,13 @@ declare module AmCharts {
valueAxis.axisTitleOffset = 20;
valueAxis.gridCount = 5;
chart.addValueAxis(valueAxis);
var graph = new AmCharts.AmGraph();
graph.valueField = "litres";
graph.bullet = "round";
graph.balloonText = "[[value]] litres of beer per year"
chart.addGraph(graph);
chart.write("chartdiv");
}
*/
@@ -262,7 +249,7 @@ declare module AmCharts {
{x:1, y:6, value:35}
];
var chart = new AmCharts.AmXYChart();
var chart = new AmCharts.AmXYChart();
chart.pathToImages = "../../amcharts/javascript/images/";
chart.dataProvider = chartData;
chart.marginLeft = 35;
@@ -276,7 +263,7 @@ declare module AmCharts {
var yAxis = new AmCharts.ValueAxis();
yAxis.position = "bottom";
yAxis.autoGridCount = true;
chart.addValueAxis(yAxis);
chart.addValueAxis(yAxis);
var graph = new AmCharts.AmGraph();
graph.valueField = "value";
@@ -292,7 +279,7 @@ declare module AmCharts {
var chartScrollbar = new AmCharts.ChartScrollbar();
chartScrollbar.hideResizeGrips = false;
chart.addChartScrollbar(chartScrollbar);
chart.write("chartdiv);
*/
class AmXYChart extends AmRectangularChart {
@@ -368,7 +355,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
}
/** ImagesSettings is a class which holds common settings of all MapImage objects. */
class ImagesSettings {
/** Opacity of the image.
/** Opacity of the image.
@default 1
*/
alpha: number;
@@ -382,7 +369,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
color: string;
/** Height of a description window. */
descriptionWindowHeight: number;
/** Width of a description window.
/** Width of a description window.
@default 250
*/
descriptionWindowWidth: number;
@@ -392,7 +379,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
descriptionWindowY: number;
/** Label color. #000000 */
labelColor: string;
/** Font size of a label.
/** Font size of a label.
@default 11
*/
labelfontSize: string;
@@ -589,7 +576,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
/** Adds event listener of the type "rollOutStockEvent" or "rollOverStockEvent" or "clickStockEvent" to the object.
@param type // Either "rollOutStockEvent" or "rollOverStockEvent" or "clickStockEvent".
@param handler
@param handler
If the type is "rollOutStockEvent", dispatched when the user rolls-out of the Stock event (bullet).
If the type is "rollOverStockEvent", dispatched when the user rolls-over of the Stock event (bullet).
If the type is "clickStockEvent", dispatched when the user clicks on the Stock event (bullet).
@@ -803,6 +790,10 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
textClickEnabled: boolean;
/** In case legend position is set to "absolute", you can set distance from top of the chart, in pixels. */
top: number;
/** Legend markers can mirror graphs settings, displaying a line and a real bullet as in the graph itself.
Set this property to true if you want to enable this feature. Note, if you set graph colors in dataProvider, they will not be reflected in the marker.
@default false*/
useGraphSettings: boolean;
/** Specifies if legend labels should be use same color as corresponding markers. */
useMarkerColorForLabels: boolean;
/** Alignment of the value text. Possible values are "left" and "right". right */
@@ -941,7 +932,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
@default 11
*/
fontSize: string;
/** If you set this to true, the lines of the chart will be distorted and will produce hand-drawn effect. Try to adjust chart.handDrawScatter and chart.handDrawThickness properties for a more scattered result.
/** If you set this to true, the lines of the chart will be distorted and will produce hand-drawn effect. Try to adjust chart.handDrawScatter and chart.handDrawThickness properties for a more scattered result.
@Default false
*/
handDrawn: boolean;
@@ -953,7 +944,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
@Default 1
*/
handDrawThickness: number;
/** Time, in milliseconds after which balloon is hidden if the user rolls-out of the object. Might be useful for AmMap to avoid balloon flickering while moving mouse over the areas. Note, this is not duration of fade-out. Duration of fade-out is set in AmBalloon class.
/** Time, in milliseconds after which balloon is hidden if the user rolls-out of the object. Might be useful for AmMap to avoid balloon flickering while moving mouse over the areas. Note, this is not duration of fade-out. Duration of fade-out is set in AmBalloon class.
@Default 150
*/
hideBalloonTime: number;
@@ -966,19 +957,19 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
/** This setting affects touch-screen devices only. If a chart is on a page, and panEventsEnabled are set to true, the page won't move if the user touches the chart first. If a chart is big enough and occupies all the screen of your touch device, the user wont be able to move the page at all. That's why the default value is "false". If you think that selecting/panning the chart or moving/pinching the map is a primary purpose of your users, you should set panEventsEnabled to true. */
panEventsEnabled: boolean;
/** Specifies absolute or relative path to amCharts files, i.e. "amcharts/". (where all .js files are located)
If relative URLs are used, they will be relative to the current web page, displaying the chart.
You can also set path globally, using global JavaScript variable AmCharts_path. If this variable is set, and "path" is not set in chart config, the chart will assume the path from the global variable. This allows setting amCharts path globally. I.e.:
If relative URLs are used, they will be relative to the current web page, displaying the chart.
You can also set path globally, using global JavaScript variable AmCharts_path. If this variable is set, and "path" is not set in chart config, the chart will assume the path from the global variable. This allows setting amCharts path globally. I.e.:
var AmCharts_path = "/libs/amcharts/";
"path" parameter will be used by the charts to locate it's files, like images, plugins or patterns.*/
path: string;
path: string;
/** Specifies path to the folder where images like resize grips, lens and similar are.
IMPORTANT: Since V3.14.12, you should use "path" to point to amCharts directory instead. The "pathToImages" will be automatically set and does not need to be in the chart config, unless you keep your images separately from other amCharts files. */
pathToImages: string;
/** Precision of percent values. -1 means percent values won't be rounded at all and show as they are.
/** Precision of percent values. -1 means percent values won't be rounded at all and show as they are.
@default 2
*/
percentPrecision: number;
/** Precision of values. -1 means values won't be rounded at all and show as they are.
/** Precision of values. -1 means values won't be rounded at all and show as they are.
@Default 1*/
precision: number;
/** Prefixes which are used to make big numbers shorter: 2M instead of 2000000, etc. Prefixes are used on value axes and in the legend. To enable prefixes, set usePrefixes property to true. [{number:1e+3,prefix:"k"},{number:1e+6,prefix:"M"},{number:1e+9,prefix:"G"},{number:1e+12,prefix:"T"},{number:1e+15,prefix:"P"},{number:1e+18,prefix:"E"},{number:1e+21,prefix:"Z"},{number:1e+24,prefix:"Y"}] */
@@ -987,7 +978,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
prefixesOfSmallNumbers: any[];
/** Theme of a chart. Config files of themes can be found in amcharts/themes/ folder. More info about using themes. */
theme: string;
/** Thousands separator.
/** Thousands separator.
@default .
*/
thousandsSeparator: string;
@@ -1115,7 +1106,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
/** Adds a graph to the chart.
*/
addGraph(graph: AmGraph);
/** Adds a legend to the chart. By default, you don't need to create div for your legend, however if you want it to be positioned in some different way, you can create div anywhere you want and pass id or reference to your div as a second parameter. (NOTE: This method will not work on StockPanel.) */
/** Adds a legend to the chart. By default, you don't need to create div for your legend, however if you want it to be positioned in some different way, you can create div anywhere you want and pass id or reference to your div as a second parameter. (NOTE: This method will not work on StockPanel.) */
/** Adds value axis to the chart.
One value axis is created automatically, so if you don't want to change anything or add more value axes, you don't need to add it.
*/
@@ -1203,33 +1194,33 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
/** SerialDataItem holds all the information about each series. When working with a chart, you do not create SerialDataItem objects or change it's properties directly. Consider properties of a SerialDataItem read-only - change values in chart's data provider if you need to. When serial chart parses dataProvider, it generates "chartData" array. Objects of this array are SerialDataItem objects. */
class SerialDataItem {
/** You can access each GraphDataItem using this object. The data structure is: graphDataItem = serialDataItem.axes[axisId].graphs[graphId]. */
axes: Object;
/** category value. String if parseDates is false, Date if true. */
category: any;
/** Timestamp of a series date. Avalable only if parseDates property of CategoryAxis is set to true. */
time: number;
/** Coordinate (horizontal or vertical, depends on chart's rotate property) of the series. */
x: number;
}
class CategoryAxis extends AxisBase {
/** When parse dates is on for the category axis, the chart will try to highlight the beginning of the periods, like month, in bold. Set this to false to disable the functionality.
@default true
*/
boldPeriodBeginning: boolean;
/** Date formats of different periods. Possible period values: fff - milliseconds, ss - seconds, mm - minutes, hh - hours, DD - days, MM - months, WW - weeks, YYYY - years. Check this page for date formatting strings. [{period:'fff',format:'JJ:NN:SS'},{period:'ss',format:'JJ:NN:SS'},{period:'mm',format:'JJ:NN'},{period:'hh',format:'JJ:NN'},{period:'DD',format:'MMM DD'},{period:'WW',format:'MMM DD'},{period:'MM',format:'MMM'},{period:'YYYY',format:'YYYY'}] */
dateFormats: any[];
/** In case your category axis values are Date objects and parseDates is set to true, the chart will parse dates and will place your data points at irregular intervals. However if you want dates to be parsed (displayed on the axis, baloons, etc), but data points to be placed at equal intervals (omiting dates with no data), set equalSpacing to true. */
equalSpacing: boolean;
/** Field in data provider which specifies if the category value should always be shown. For example: categoryAxis.forceShowField = "forceShow"; Field in data provider which specifies if the category value should always be shown. For example: categoryAxis.forceShowField = "forceShow";
And in data:
{category:"one", forceShow:true, value:100}
@@ -1239,6 +1230,11 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
/** Specifies if a grid line is placed on the center of a cell or on the beginning of a cell. Possible values are: "start" and "middle" This setting doesn't work if parseDates is set to true. middle */
gridPosition: string;
/** Specifies if minor grid should be displayed.
NOTE: If equalSpacing is set to true, this setting will be ignored.
@default false*/
minorGridEnabled: boolean;
/** Specifies the shortest period of your data. This should be set only if parseDates is set to "true". Possible period values: fff - milliseconds, ss - seconds, mm - minutes, hh - hours, DD - days, MM - months, YYYY - years. DD */
minPeriod: string;
@@ -1248,6 +1244,14 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
/** Specifies whether the graph should start on axis or not. In case you display columns, it is recommended to set this to false. If parseDates is set to true, startOnAxis will allways be false, unless equalSpacing is set to true. */
startOnAxis: boolean;
/** Works only when parseDates is set to true and equalSpacing is false. If you set it to true, at the position where bigger period changes,
category axis will display date strings of bot small and big period, in two rows.
@default false*/
twoLineMode: boolean;
/** Use line color for bullet
@default false*/
useLineColorForBulletBorder: boolean;
/** Number returns coordinate of a category. Works only if parseDates is false. If parseDates is true, use dateToCoordinate method. category - String */
categoryToCoordinate(category: string);
@@ -1256,7 +1260,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
/** Number Returns coordinate of the date, in case parseDates is set to true. if parseDates is false, use categoryToCoordinate method. date - Date object */
dateToCoordinate(date: Date);
/** Number Returns index of the category which is most close to specified coordinate. x - coordinate */
xToIndex(x: number);
}
@@ -1332,7 +1336,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
/** AmRectangularChart is a base class of AmSerialChart and AmXYChart. It can not be instantiated explicitly.*/
class AmRectangularChart extends AmCoordinateChart {
/** The angle of the 3D part of plot area. This creates a 3D effect (if the "depth3D" is > 0).
/** The angle of the 3D part of plot area. This creates a 3D effect (if the "depth3D" is > 0).
@default 0
*/
angle: number;
@@ -1348,7 +1352,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
chartCursor: ChartCursor;
/** Chart scrollbar. */
chartScrollbar: ChartScrollbar;
/** The depth of the 3D part of plot area. This creates a 3D effect (if the "angle" is > 0).
/** The depth of the 3D part of plot area. This creates a 3D effect (if the "angle" is > 0).
@default 0*/
depth3D: number;
/** Number of pixels between the container's bottom border and plot area. This space can be used for bottom axis' values. If autoMargin is true and bottom side has axis, this property is ignored.
@@ -1363,7 +1367,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
@default 20
*/
marginRight: number;
/** Flag which should be set to false if you need margins to be recalculated on next chart.validateNow() call.
/** Flag which should be set to false if you need margins to be recalculated on next chart.validateNow() call.
@default false
*/
marginsUpdated: boolean;
@@ -1375,24 +1379,24 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
@default 0
*/
plotAreaBorderAlpha: number;
/** The color of the plot area's border. Note, the it is invisible by default, as plotAreaBorderAlpha default value is 0. Set it to a value higher than 0 to make it visible.
/** The color of the plot area's border. Note, the it is invisible by default, as plotAreaBorderAlpha default value is 0. Set it to a value higher than 0 to make it visible.
@default '#000000'*/
plotAreaBorderColor: string;
/** Opacity of plot area. Plural form is used to keep the same property names as our Flex charts'. Flex charts can accept array of numbers to generate gradients. Although you can set array here, only first value of this array will be used.
/** Opacity of plot area. Plural form is used to keep the same property names as our Flex charts'. Flex charts can accept array of numbers to generate gradients. Although you can set array here, only first value of this array will be used.
@default 0
*/
plotAreaFillAlphas: number;
/** You can set both one color if you need a solid color or array of colors to generate gradients, for example: ["#000000", "#0000CC"]
/** You can set both one color if you need a solid color or array of colors to generate gradients, for example: ["#000000", "#0000CC"]
@default '#FFFFFF'
*/
plotAreaFillColors: any;
/** If you are using gradients to fill the plot area, you can use this property to set gradient angle. The only allowed values are horizontal and vertical: 0, 90, 180, 270.
/** If you are using gradients to fill the plot area, you can use this property to set gradient angle. The only allowed values are horizontal and vertical: 0, 90, 180, 270.
@default 0
*/
plotAreaGradientAngle: number;
/** Array of trend lines added to a chart. You can add trend lines to a chart using this array or access already existing trend lines */
trendLines: TrendLine[];
/** Opacity of zoom-out button background.
/** Opacity of zoom-out button background.
@default 0
*/
zoomOutButtonAlpha: number;
@@ -1418,7 +1422,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
zoomOutButtonRollOverAlpha: number;
/** Text in the zoom-out button. Show all */
zoomOutText: string;
/** Adds a ChartCursor object to a chart */
addChartCursor(cursor: ChartCursor);
/** Adds a ChartScrollbar to a chart */
@@ -1430,7 +1434,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
removeChartCursor();
/** Removes scrollbar from the chart */
removeChartScrollbar();
/** Removes a trend line from a chart.
/** Removes a trend line from a chart.
You should call chart.validateNow() in order the changes to be visible. */
removeTrendLine(trendLine: TrendLine);
}
@@ -1470,7 +1474,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
categoryBalloonColor: string;
/** Category balloon date format (used only if category axis parses dates). Check this page for instructions on how to format dates. MMM DD, YYYY */
categoryBalloonDateFormat: string;
/** Specifies whether category balloon is enabled.
/** Specifies whether category balloon is enabled.
@default true
*/
categoryBalloonEnabled: boolean;
@@ -1486,6 +1490,10 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
@default true
*/
enabled: boolean;
/** If set to true, instead of a cursor line user will see a fill which width will always be equal to the width of one data item.
Recommend setting cursorAlpha to 0.1 or some other small number if using this feature.
@default false*/
fullWidth: boolean;
/** If this is set to true, only one balloon at a time will be displayed. Note, this is quite CPU consuming. */
oneBalloonOnly: boolean;
/** If this is set to true, the user will be able to pan the chart (Serial only) instead of zooming. */
@@ -1539,17 +1547,17 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
/** AmSerialChart is the class you have to use for majority of chart types. The supported chart types are: line, area, column, bar, step line, smoothed line, candlestick and OHLC. The chart can be rotated by 90 degrees so the column chart becomes bar chart. The chart supports simple and logarithmic scales, it can have multiple value axes. The chart can place data points at equal intervals or can parse dates and place data points at irregular intervals.
@example
var chartData = [{title:"sample 1",value:130},{title:"sample 2",value:26}];
var chart = new AmCharts.AmSerialChart();
chart.categoryField = "title";
chart.dataProvider = chartData;
var graph = new AmCharts.AmGraph();
graph.valueField = "value";
graph.type = "column";
graph.fillAlphas = 1;
chart.addGraph(graph);
chart.write("chartdiv");
*/
class AmSerialChart extends AmRectangularChart {
@@ -1581,7 +1589,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
maxSelectedSeries: number;
/** The longest time span allowed to select (in milliseconds) for example, 259200000 will limit selection to 3 days. */
maxSelectedTime: number;
/** The shortest time span allowed to select (in milliseconds) for example, 1000 will limit selection to 1 second.
/** The shortest time span allowed to select (in milliseconds) for example, 1000 will limit selection to 1 second.
@default 0
*/
minSelectedTime: number;
@@ -1830,7 +1838,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
/** Specifies if label is bold or not. */
bold: boolean;
/** Color of a label */
color: string;
color: string;
/** Unique id of a Label. You don't need to set it, unless you want to. */
id: string;
/** Rotation angle. */
@@ -2156,7 +2164,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
/** Value balloon color. Will use graph or data item color if not set. */
balloonColor: string;
/** If you set some function, the graph will call it and pass GraphDataItem and AmGraph object to it. This function should return a string which will be displayed in a balloon. */
balloonFunction(graphDataItem: GraphDataItem, amGraph: AmGraph): string;
balloonFunction(graphDataItem: GraphDataItem, amGraph: AmGraph): string;
/** Balloon text. You can use tags like [[value]], [[description]], [[percents]], [[open]], [[category]] [[value]] */
balloonText: string;
/** Specifies if the line graph should be placed behind column graphs */
@@ -2431,7 +2439,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
/** Specifies whether values on axis can only be integers or both integers and doubles. */
integersOnly: boolean;
/** You can use this function to format Value axis labels. This function is called and these parameters are passed: labelFunction(value, valueText, valueAxis);
Where value is numeric value, valueText is formatted string and valueAxis is a reference to valueAxis object.
Where value is numeric value, valueText is formatted string and valueAxis is a reference to valueAxis object.
If axis type is "date", labelFunction will pass different arguments:
labelFunction(valueText, date, valueAxis)
@@ -2510,7 +2518,7 @@ Your function should return string.*/
removeGuide(guide: Guide);
/** Removes event listener from the object. */
removeListener(obj: any, type: string, handler: any);
/** One value axis can be synchronized with another value axis. You should set synchronizationMultiplyer in order for this to work. */
synchronizeWithAxis(axis:ValueAxis);
/** XY Chart only. Zooms-in the axis to the provided values. */
@@ -2534,15 +2542,15 @@ Your function should return string.*/
/** Removes event listener from chart object. */
removeListener(chart: AmChart, type: string, handler: any);
}
class Title {
/** @default 1 */
alpha: number;
/** Specifies if the tile is bold or not.
/** Specifies if the tile is bold or not.
@default false*/
bold: boolean;
/** Text color of a title. */
color: string;
color: string;
/** Unique id of a Title. You don't need to set it, unless you want to. */
id: string;
/** Text size */
@@ -2555,4 +2563,4 @@ Your function should return string.*/
libs: Object;
menu: Object;
}
}
}
+1 -1
View File
@@ -1 +1 @@
+1 -1
View File
@@ -1,7 +1,7 @@
// Type definitions for AmplifyJs 1.1.0 using JQuery Deferred
// Project: http://amplifyjs.com/
// Definitions by: Jonas Eriksson <https://github.com/joeriks/>, Laurentiu Stamate <https://github.com/laurentiustamate94>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts" />
+1 -1
View File
@@ -1 +1 @@
+2 -2
View File
@@ -1,7 +1,7 @@
// Type definitions for AmplifyJs 1.1.0
// Project: http://amplifyjs.com/
// Definitions by: Jonas Eriksson <https://github.com/joeriks/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts" />
@@ -179,4 +179,4 @@ interface amplifyStatic {
}
declare var amplify: amplifyStatic;
declare module "amplify" { export =amplify; }
+1 -1
View File
@@ -1,7 +1,7 @@
// Type definitions for amqp-rpc v0.0.8
// Project: https://github.com/demchenkoe/node-amqp-rpc/
// Definitions by: Wonshik Kim <https://github.com/wokim/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
+4 -3
View File
@@ -1,13 +1,13 @@
// Type definitions for amqplib 0.3.x
// Project: https://github.com/squaremo/amqp.node
// Definitions by: Michael Nahkies <https://github.com/mnahkies>, Ab Reitsma <https://github.com/abreits>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../when/when.d.ts" />
/// <reference path="../node/node.d.ts" />
declare module "amqplib/properties" {
module Replies {
namespace Replies {
interface Empty {
}
interface AssertQueue {
@@ -29,7 +29,7 @@ declare module "amqplib/properties" {
}
}
module Options {
namespace Options {
interface AssertQueue {
exclusive?: boolean;
durable?: boolean;
@@ -38,6 +38,7 @@ declare module "amqplib/properties" {
messageTtl?: number;
expires?: number;
deadLetterExchange?: string;
deadLetterRoutingKey?: string;
maxLength?: number;
}
interface DeleteQueue {
+2 -2
View File
@@ -1,9 +1,9 @@
// Type definitions for Segment's analytics.js for Node.js
// Project: https://segment.com/docs/libraries/node/
// Definitions by: Andrew Fong <https://github.com/fongandrew>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module AnalyticsNode {
declare namespace AnalyticsNode {
interface Integrations {
[index: string]: boolean;
+17 -17
View File
@@ -1,42 +1,42 @@
// Type definitions for AngularAgility
// Project: https://github.com/AngularAgility/AngularAgility
// Definitions by: Roland Zwaga <https://github.com/rolandzwaga>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path='../angularjs/angular.d.ts' />
declare module aa {
declare namespace aa {
export interface ILabelStrategies {
[strategyName: string]: (element:ng.IAugmentedJQueryStatic, labelText:string, isRequired:boolean)=>void;
}
export interface IFieldGroupStrategies {
[strategyName: string]: (element:ng.IAugmentedJQueryStatic)=>void;
}
export interface IValMsgPlacementStrategies {
[strategyName: string]: (formFieldElement:ng.IAugmentedJQueryStatic, formName:string, formFieldName:string)=>void;
}
export interface IValidIconStrategy {
validIcon:string;
invalidIcon:string;
getContainer(element:ng.IAugmentedJQueryStatic):void;
}
export interface ISpinnerClickStrategies {
[strategyName: string]: (element:ng.IAugmentedJQueryStatic)=>void;
}
export interface IOnNavigateAwayStrategies {
[strategyName: string]: (rootFormScope:ng.IScope, rootForm:ng.IAugmentedJQueryStatic, $injector:ng.auto.IInjectorService)=>void;
}
export interface IValidationMessages {
[validationKey: string]: string;
}
export interface IGlobalSettings {
[settingName: string]: any;
}
@@ -53,18 +53,18 @@ declare module aa {
valMsgForTemplate:string;
confirmResetStrategy:()=>boolean;
globalSettings:IGlobalSettings;
labelStrategies:ILabelStrategies;
fieldGroupStrategies:IFieldGroupStrategies;
valMsgPlacementStrategies:IValMsgPlacementStrategies;
spinnerClickStrategies:ISpinnerClickStrategies;
onNavigateAwayStrategies:IOnNavigateAwayStrategies;
}
export interface INotifyPredicate {
(message:string, options:any, notifier:any):any;
}
export interface INotifyDefaults {
success: INotifyPredicate;
info: INotifyPredicate;
@@ -72,7 +72,7 @@ declare module aa {
danger: INotifyPredicate;
error: INotifyPredicate;
}
export interface INotifyConfig {
name:string;
template?:string;
@@ -80,14 +80,14 @@ declare module aa {
options:INotifyOptions;
namedDefaults:INotifyDefaults;
}
export interface INotifyOptions {
cssClasses?:string;
messageType:string;
allowHtml:boolean;
message:string;
}
export interface INotifyConfigProvider extends ng.IServiceProvider {
notifyConfigs:any;
defaultTargetContainerName:string;
@@ -95,7 +95,7 @@ declare module aa {
addOrUpdateNotifyConfig(name:string, opts:INotifyConfig):void;
optionsTransformer(options:INotifyOptions, $sce:ng.ISCEService):void;
}
export interface IExternalFormValidationConfig {
validations:any;
ignore?:any;
@@ -103,4 +103,4 @@ declare module aa {
resolve?:any;
resolveFn?:(modelValue:string)=>string;
}
}
}
@@ -0,0 +1,46 @@
///<reference path='angular-bootstrap-calendar.d.ts'/>
///<reference path='../angularjs/angular.d.ts'/>
var myApp = angular.module('testModule');
interface MyAppScope extends ng.IScope {
events: ng.bootstrap.calendar.IEvent[];
}
myApp.config(function (calendarConfig: ng.bootstrap.calendar.ICalendarConfig) {
calendarConfig.templates.calendarMonthView = 'path/to/custom/template.html'; //change the month view template to a custom template
calendarConfig.dateFormatter = 'moment'; //use either moment or angular to format dates on the calendar. Default angular. Setting this will override any date formats you have already set.
calendarConfig.allDateFormats.moment.date.hour = 'HH:mm'; //this will configure times on the day view to display in 24 hour format rather than the default of 12 hour
calendarConfig.allDateFormats.moment.title.day = 'ddd D MMM'; //this will configure the day view title to be shorter
calendarConfig.i18nStrings.weekNumber = 'Week {week}'; //This will set the week number hover label on the month view
calendarConfig.displayAllMonthEvents = true; //This will display all events on a month view even if they're not in the current month. Default false.
calendarConfig.displayEventEndTimes = true; //This will display event end times on the month and year views. Default false.
calendarConfig.showTimesOnWeekView = true; //Make the week view more like the day view, with the caveat that event end times are ignored.
});
var someController: Function = ($scope: MyAppScope) => {
$scope.events = [
{
title: 'My event title', // The title of the event
type: 'info', // The type of the event (determines its color). Can be important, warning, info, inverse, success or special
startsAt: new Date(2013, 5, 1, 1), // A javascript date object for when the event starts
endsAt: new Date(2014, 8, 26, 15), // Optional - a javascript date object for when the event ends
editable: false, // If edit-event-html is set and this field is explicitly set to false then dont make it editable.
deletable: false, // If delete-event-html is set and this field is explicitly set to false then dont make it deleteable
draggable: true, //Allow an event to be dragged and dropped
resizable: true, //Allow an event to be resizable
incrementsBadgeTotal: true, //If set to false then will not count towards the badge total amount on the month and year view
recursOn: 'year', // If set the event will recur on the given period. Valid values are year or month
cssClass: 'a-css-class-name' //A CSS class (or more, just separate with spaces) that will be added to the event when it is displayed on each view. Useful for marking an event as selected / active etc
}
];
};
@@ -0,0 +1,138 @@
// Type definitions for angular-bootstrap-calendar
// Project: https://github.com/mattlewis92/angular-bootstrap-calendar
// Definitions by: Egor Komarov <https://github.com/Odrin>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../moment/moment.d.ts" />
declare namespace angular.bootstrap.calendar {
interface IEvent {
/**
* The title of the event
*/
title: string;
/**
* The type of the event (determines its color). Can be important, warning, info, inverse, success or special
*/
type: string;
/**
* A javascript date object for when the event starts
*/
startsAt: Date;
/**
* Optional - a javascript date object for when the event ends
*/
endsAt?: Date;
/**
* If edit-event-html is set and this field is explicitly set to false then dont make it editable.
*/
editable?: boolean;
/**
* If delete-event-html is set and this field is explicitly set to false then dont make it deleteable
*/
deletable?: boolean;
/**
* Allow an event to be dragged and dropped
*/
draggable?: boolean;
/**
* Allow an event to be resizable
*/
resizable?: boolean;
/**
* If set to false then will not count towards the badge total amount on the month and year view
*/
incrementsBadgeTotal?: boolean;
/**
* If set the event will recur on the given period. Valid values are year or month
*/
recursOn?: string;
/**
* A CSS class (or more, just separate with spaces) that will be added to the event when it is displayed on each view. Useful for marking an event as selected / active etc
*/
cssClass?: string;
}
interface ICalendarConfig {
allDateFormats: {
angular: IFormats;
moment: IFormats;
};
dateFormats: IDateFormats;
titleFormats: ITitleFormats;
dateFormatter: string;
displayEventEndTimes: boolean;
showTimesOnWeekView: boolean;
displayAllMonthEvents: boolean;
i18nStrings: { weekNumber: string; };
templates: {
calendarDayView: string;
calendarHourList: string;
calendarMonthCell: string;
calendarMonthCellEvents: string;
calendarMonthView: string;
calendarSlideBox: string;
calendarWeekView: string;
calendarYearView: string;
};
}
interface IFormats {
date: IDateFormats;
title: ITitleFormats;
}
interface IDateFormats {
hour: string;
day: string;
month: string;
weekDay: string;
time: string;
datetime: string;
}
interface ITitleFormats {
day: string;
week: string;
month: string;
year: string;
}
interface ICalendarCell {
label: number;
date: moment.Moment;
inMonth: boolean;
isPast: boolean;
isToday: boolean;
isFuture: boolean;
isWeekend: boolean;
events: IEvent[];
badgeTotal: number;
}
namespace events {
interface IOnEventClick {
(calendarEvent: IEvent): void;
}
interface IOnEventTimesChanged {
(calendarEvent: IEvent, calendarNewEventStart: Date, calendarNewEventEnd: Date): void;
}
interface IOnEditEventClick {
(calendarEvent: IEvent): void;
}
interface IOnDeleteEventClick {
(calendarEvent: IEvent): void;
}
interface IOnTimespanClick {
(calendarDate: Date, calendarCell: ICalendarCell): void;
}
interface IOnViewChangeClick {
(calendarDate: Date, calendarNextView: string): void;
}
}
}
+3 -3
View File
@@ -1,9 +1,9 @@
// Type definitions for angular-bootstrap-lightbox
// Project: https://github.com/compact/angular-bootstrap-lightbox
// Definitions by: Roland Zwaga <https://github.com/rolandzwaga>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module angular.bootstrap.lightbox {
declare namespace angular.bootstrap.lightbox {
export interface ILightboxImageInfo {
url: string;
@@ -48,4 +48,4 @@ declare module angular.bootstrap.lightbox {
calculateImageDimensionLimits:(dimensions:IImageDimensionParameter)=>IImageDimensionLimits;
calculateModalDimensions:(dimensions:IModalDimensionsParameter)=>IModalDimensions;
}
}
}
+79
View File
@@ -0,0 +1,79 @@
// Type definitions for angular-breadcrumb 0.4.1
// Project: https://github.com/ncuillery/angular-breadcrumb
// Definitions by: Marc Talary <https://github.com/marctalary>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../angular-ui-router/angular-ui-router.d.ts" />
declare namespace angular.ui {
export interface IState {
ncyBreadcrumb?: {
/**
* Contains the label for the step in the breadcrumb. The state name is used if not defined.
**/
label?: string;
/**
* Override the parent state (only for the breadcrumb)
**/
parent?: string;
/**
* When defined to true, the state is never included in the chain of states and never appears in the breadcrumb
**/
skip?: boolean;
},
ncyBreadcrumbLabel?: string;
ncyBreadcrumbLink?: string;
}
}
declare namespace ncy {
/**
* Provider that returns an instance of $breadcrumb service. It contains the global configuration of the module.
**/
export interface $breadcrumbProvider {
/**
* Setter for options defined in a module.config block
**/
setOptions(options: breadcrumbProviderOptions): void;
}
/**
* Global configuration options for angular-breadcrumb
**/
export interface breadcrumbProviderOptions {
/**
* An existing state's name to be the state is the first step of the breadcrumb
**/
prefixStateName?: string;
/**
* Contains a predefined template's name; 'bootstrap3' (default), 'bootstrap2' or HTML for a custom template. This property is ignored if templateUrl is defined.
**/
template?: string;
/**
* Contains the path to a template file. This property takes precedence over the template property.
**/
templateUrl?: string;
/**
* If true, abstract states are included in the breadcrumb. This option has a lower priority than the state-specific option skip
**/
includeAbstract?: boolean;
}
/**
* Service responsible for access to $state and for directive configuration.
**/
export interface $breadcrumbService {
/**
* Returns the state chain to the current state (i.e. all the steps of the breadcrumb). It's an array of state object enriched with the module-specific property ncyBreadcrumbLink (the href for the breadcrumb step).
**/
getStatesChain(): angular.ui.IState[];
/**
* Return the last step of the breadcrumb, generally the one relative to the current state, expect if it is configured as skipped (the method returns its parent). As getStatesChain, the state object is enriched with ncyBreadcrumbLink.
**/
getLastStep(): angular.ui.IState;
}
}
+21
View File
@@ -0,0 +1,21 @@
/// <reference path='../angularjs/angular.d.ts' />
/// <reference path='angular-cookie.d.ts' />
angular.module('myApp', ['ipCookie'])
.controller('cookieController', ['ipCookie', function(ipCookie: angular.cookie.CookieService) {
ipCookie('key', 'value');
ipCookie('key', { value: 'value'});
ipCookie('key', [1, 2, 3]);
ipCookie('key', 'value', { expires: 21 });
ipCookie('key', 'value', { encode: function (value) { return value; } });
ipCookie();
ipCookie('key');
ipCookie('key', undefined, {decode: function (value) { return value; }});
ipCookie.remove('key');
ipCookie.remove('key', { path: '/some/path/' });
var obj: Object = '255';
}]);
+65
View File
@@ -0,0 +1,65 @@
// Type definitions for angular-cookie v4.1.0
// Project: https://github.com/ivpusic/angular-cookie
// Definitions by: Borislav Zhivkov <https://github.com/borislavjivkov>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace angular.cookie {
interface CookieService {
/**
* Get all cookies
*/
(): any;
/**
* Get a cookie with a specific key
*/
(key: string): any;
/**
* Create a cookie
*/
(key: string, value: any, options?: CookieOptions): any;
/**
* Remove a cookie
*/
remove(key: string, options?: CookieOptions): void;
}
interface CookieOptions {
/**
* The domain tells the browser to which domain the cookie should be sent. If you don't specify it, it becomes the domain of the page that sets the cookie.
*/
domain?: string;
/**
* The path gives you the chance to specify a directory where the cookie is active.
*/
path?: string;
/**
* Each cookie has an expiry date after which it is trashed. If you don't specify the expiry date the cookie is trashed when you close the browser.
*/
expires?: number;
/**
* Allows you to set the expiration time in hours, minutes, seconds, or `milliseconds. If this is not specified, any expiration time specified will default to days.
*/
expirationUnit?: string;
/**
* The Secure attribute is meant to keep cookie communication limited to encrypted transmission, directing browsers to use cookies only via secure/encrypted connections.
*/
secure?: boolean;
/**
* The method that will be used to encode the cookie value (should be passed when using Set).
*/
encode?: (value: any) => any;
/**
* The method that will be used to decode extracted cookie values (should be passed when using Get).
*/
decode?: (value: any) => any;
}
}
@@ -0,0 +1,11 @@
/// <reference path="../angularjs/angular.d.ts" />
/// <reference path="./angular-deferred-bootstrap.d.ts" />
deferredBootstrapper.bootstrap(
{
element: window.document,
module: "myApp",
resolve: {
configuration: ["$http", ($http: ng.IHttpService) => $http.get("config.json")]
}
});
@@ -0,0 +1,20 @@
// Type definitions for angular-deferred-bootstrap v0.1.9
// Project: https://github.com/philippd/angular-deferred-bootstrap
// Definitions by: Markus Wagner <https://github.com/Ritzlgrmft/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
declare var deferredBootstrapper: angular.IDeferredBootstrapperStatic;
declare module angular {
interface IDeferredBootstrapperStatic {
bootstrap(configParam: IConfigParam): ng.IPromise<boolean>
}
interface IConfigParam {
element?: Node,
module?: string,
resolve: any
}
}
+2 -2
View File
@@ -1,12 +1,12 @@
// Type definitions for Angular Dialog Service 5.2.8
// Project: https://github.com/m-e-conroy/angular-dialog-service
// Definitions by: William Comartin <https://github.com/wcomartin>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts"/>
/// <reference path="../angular-ui-bootstrap/angular-ui-bootstrap.d.ts"/>
declare module angular.dialogservice {
declare namespace angular.dialogservice {
interface IDialogOptions {
/**
+8 -3
View File
@@ -1,11 +1,16 @@
// Type definitions for angular-dynamic-locale v0.1.27
// Project: https://github.com/lgalfaso/angular-dynamic-locale
// Definitions by: Stephen Lautier <https://github.com/stephenlautier>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
declare module angular.dynamicLocale {
declare module "angular-dynamic-locale" {
import ng = angular.dynamicLocale;
export = ng;
}
declare namespace angular.dynamicLocale {
interface tmhDynamicLocaleService {
set(locale: string): void;
@@ -18,4 +23,4 @@ declare module angular.dynamicLocale {
useStorage(storageName: string): void;
useCookieStorage(): void;
}
}
}
@@ -0,0 +1,30 @@
/// <reference path="angular-environment.d.ts" />
var envServiceProvider: angular.environment.ServiceProvider;
var envService: angular.environment.Service;
envServiceProvider.config({
domains: {
development: ['localhost', 'dev.local'],
production: ['acme.com', 'acme.net', 'acme.org']
},
vars: {
development: {
apiUrl: '//localhost/api',
staticUrl: '//localhost/static'
},
production: {
apiUrl: '//api.acme.com/v2',
staticUrl: '//static.acme.com'
}
}
});
envServiceProvider.check();
envService.get();
envService.set('production');
var isProd: boolean = envService.is('production');
var val: any = envService.read('apiUrl');
+52
View File
@@ -0,0 +1,52 @@
// Type definitions for angular-environment v1.0.4
// Project: https://github.com/juanpablob/angular-environment
// Definitions by: Matt Wheatley <https://github.com/terrawheat>
// Definitions: https://github.com/LiberisLabs
declare namespace angular.environment {
interface ServiceProvider {
/**
* Sets the configuration object
*/
config: (config: angular.environment.Config) => void;
/**
* Evaluates the current domain and
* loads the correct environment variables.
*/
check: () => void;
}
interface Service {
/**
* Retrieve the current environment
*/
get: () => string,
/**
* Force sets the current environment
*/
set: (environment: string) => void,
/**
* Evaluates current environment against
* environment parameter.
*/
is: (environment: string) => boolean,
/**
* Retrieves the correct version of a
* variable for the current environment.
*/
read: (key: string) => any;
}
interface Config {
/**
* Map of domains to their environments
*/
domains: { [environment: string]: Array<string> },
/**
* List of variables split by environment
*/
vars: { [environment: string]: { [variable: string]: any }},
}
}
+1 -1
View File
@@ -1,7 +1,7 @@
// Type definitions for Angular File Upload 4.2.1
// Project: https://github.com/danialfarid/ng-file-upload
// Definitions by: John Reilly <https://github.com/johnnyreilly>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../ng-file-upload/ng-file-upload.d.ts" />
+28 -1
View File
@@ -20,11 +20,23 @@ class FormConfig {
name: 'customInput',
extends: 'input'
});
formlyConfig.disableWarnings = true;
formlyConfig.templateManipulators = undefined;
formlyConfig.extras.apiCheckInstance = null;
formlyConfig.extras.defaultHideDirective = 'ng-if';
formlyConfig.extras.disableNgModelAttrsManipulator = true;
formlyConfig.extras.errorExistsAndShouldBeVisibleExpression = angular.noop;
formlyConfig.extras.explicitAsync = true;
formlyConfig.extras.fieldTransform = angular.noop;
formlyConfig.extras.getFieldId = angular.noop;
formlyConfig.extras.ngModelAttrsManipulatorPreferUnbound = true;
}
}
class AppController {
fields: AngularFormly.IFieldConfigurationObject[];
fields: AngularFormly.IFieldArray;
constructor() {
var vm = this;
vm.fields = [
@@ -99,6 +111,21 @@ class AppController {
templateOptions: {
label: 'no wrapper here...'
}
},
{
//From http://angular-formly.com/#/example/other/nested-formly-forms
key: 'address',
wrapper: 'panel',
templateOptions: { label: 'Address' },
fieldGroup: [{
key: 'town',
type: 'input',
templateOptions: {
required: true,
type: 'text',
label: 'Town'
}
}]
}
]
}
+83 -37
View File
@@ -1,7 +1,7 @@
// Type definitions for angular-formly 6.18.0
// Type definitions for angular-formly 7.2.3
// Project: https://github.com/formly-js/angular-formly
// Definitions by: Scott Hatcher <https://github.com/scatcher>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
@@ -14,25 +14,36 @@ declare module 'angular-formly' {
export = angularFormlyDefaultExport;
}
declare module AngularFormly {
declare namespace AngularFormly {
interface IFieldArray extends Array<IFieldConfigurationObject | IFieldGroup> {
}
interface IFieldGroup {
data?: Object;
data?: {
[key: string]: any;
};
className?: string;
elementAttributes?: { [key: string]: string };
fieldGroup: IFieldConfigurationObject[];
elementAttributes?: string;
fieldGroup?: IFieldArray;
form?: Object;
hide?: boolean;
hideExpression?: string | IExpresssionFunction;
hideExpression?: string | IExpressionFunction;
key?: string | number;
model?: string | Object;
options?: IFormOptionsAPI
model?: string | {
[key: string]: any;
};
options?: IFormOptionsAPI;
templateOptions?: ITemplateOptions;
wrapper?: string | string[];
}
interface IFormOptionsAPI {
data?: Object;
data?: {
[key: string]: any;
};
fieldTransform?: Function;
formState?: Object;
removeChromeAutoComplete?: boolean;
@@ -46,7 +57,7 @@ declare module AngularFormly {
/**
* see http://docs.angular-formly.com/docs/formly-expressions#expressionproperties-validators--messages
*/
interface IExpresssionFunction {
interface IExpressionFunction {
($viewValue: any, $modelValue: any, scope: ITemplateScope): any;
}
@@ -70,6 +81,11 @@ declare module AngularFormly {
postWrapper?: ITemplateManipulator[];
}
interface ISelectOption {
name: string;
value?: string;
group?: string;
}
/**
* see http://docs.angular-formly.com/docs/ngmodelattrstemplatemanipulator
@@ -91,19 +107,25 @@ declare module AngularFormly {
type?: string;
//expression types
onBlur?: string;
onChange?: string;
onClick?: string;
onFocus?: string;
onKeydown?: string;
onKeypress?: string;
onKeyup?: string;
onBlur?: string | IExpressionFunction;
onChange?: string | IExpressionFunction;
onClick?: string | IExpressionFunction;
onFocus?: string | IExpressionFunction;
onKeydown?: string | IExpressionFunction;
onKeypress?: string | IExpressionFunction;
onKeyup?: string | IExpressionFunction;
//Bootstrap types
label?: string;
description?: string;
[key: string]: any;
// types for select/radio fields
options?: Array<ISelectOption>;
groupProp?: string; // default: group
valueProp?: string; // default: value
labelProp?: string; // default: name
}
@@ -111,8 +133,8 @@ declare module AngularFormly {
* see http://docs.angular-formly.com/docs/field-configuration-object#validators-object
*/
interface IValidator {
expression: string | IExpresssionFunction;
message?: string | IExpresssionFunction;
expression: string | IExpressionFunction;
message?: string | IExpressionFunction;
}
@@ -143,8 +165,8 @@ declare module AngularFormly {
* see http://angular-formly.com/#/example/other/unique-value-async-validation
*/
asyncValidators?: {
[key: string]: string | IExpresssionFunction | IValidator;
}
[key: string]: string | IExpressionFunction | IValidator;
};
/**
* This is a great way to add custom behavior to a specific field. It is injectable with the $scope of the
@@ -161,7 +183,9 @@ declare module AngularFormly {
*
* see http://docs.angular-formly.com/docs/field-configuration-object#data-object
*/
data?: Object;
data?: {
[key: string]: any;
};
/**
@@ -182,7 +206,9 @@ declare module AngularFormly {
className?: string;
elementAttributes?: string;
elementAttributes?: {
[key: string]: string;
};
/**
@@ -193,8 +219,8 @@ declare module AngularFormly {
* see http://docs.angular-formly.com/docs/field-configuration-object#expressionproperties-object
*/
expressionProperties?: {
[key: string]: string | IExpresssionFunction | IValidator;
}
[key: string]: string | IExpressionFunction | IValidator;
};
/**
@@ -203,7 +229,7 @@ declare module AngularFormly {
*
* see http://docs.angular-formly.com/docs/field-configuration-object#hide-boolean
*/
hide?: boolean
hide?: boolean;
/**
@@ -213,7 +239,7 @@ declare module AngularFormly {
*
* see http://docs.angular-formly.com/docs/field-configuration-object#hideexpression-string--function
*/
hideExpression?: string | IExpresssionFunction;
hideExpression?: string | IExpressionFunction;
/**
@@ -263,7 +289,9 @@ declare module AngularFormly {
*
* see http://docs.angular-formly.com/docs/field-configuration-object#model-object--string
*/
model?: Object | string;
model?: string | {
[key: string]: any;
};
/**
@@ -405,7 +433,7 @@ declare module AngularFormly {
* like in this example.
*/
messages?: {
[key: string]: IExpresssionFunction | string;
[key: string]: IExpressionFunction | string;
}
@@ -416,7 +444,7 @@ declare module AngularFormly {
*/
show?: boolean;
}
};
/**
@@ -429,8 +457,8 @@ declare module AngularFormly {
* see http://docs.angular-formly.com/docs/field-configuration-object#validators-object
*/
validators?: {
[key: string]: string | IExpresssionFunction | IValidator;
}
[key: string]: string | IExpressionFunction | IValidator;
};
/**
@@ -518,7 +546,9 @@ declare module AngularFormly {
apiCheckOptions?: Object;
defaultOptions?: IFieldConfigurationObject | Function;
controller?: Function | string | any[];
data?: Object;
data?: {
[key: string]: any;
};
extends?: string;
link?: ng.IDirectiveLinkFn;
overwriteOk?: boolean;
@@ -542,10 +572,24 @@ declare module AngularFormly {
validateOptions?: Function;
}
interface IFormlyConfigExtras {
disableNgModelAttrsManipulator: boolean;
apiCheckInstance: any;
ngModelAttrsManipulatorPreferUnbound: boolean;
removeChromeAutoComplete: boolean;
defaultHideDirective: string;
errorExistsAndShouldBeVisibleExpression: any;
getFieldId: Function;
fieldTransform: Function;
explicitAsync: boolean;
}
interface IFormlyConfig {
disableWarnings: boolean;
extras: IFormlyConfigExtras;
setType(typeOptions: ITypeOptions): void;
setWrapper(wrapperOptions: IWrapperOptions): void;
templateManipulators: ITemplateManipulators;
}
interface ITemplateScopeOptions {
@@ -562,7 +606,7 @@ declare module AngularFormly {
//Shortcut to options.formControl
fc: ng.IFormController | ng.IFormController[];
//all the fields for the form
fields: IFieldConfigurationObject[];
fields: IFieldArray;
//the form controller the field is in
form: any;
//The object passed as options.formState to the formly-form directive. Use this to share state between fields.
@@ -572,7 +616,9 @@ declare module AngularFormly {
//The index of the field the form is on (in ng-repeat)
index: number;
//the model of the form (or the model specified by the field if it was specified).
model: Object | string;
model?: string | {
[key: string]: any;
};
//Shortcut to options.validation.errorExistsAndShouldBeVisible
showError: boolean;
//Shortcut to options.templateOptions
@@ -0,0 +1,12 @@
/// <reference path="angular-fullscreen.d.ts" />
angular
.module('TestApp', ['FBAngular'])
.controller('TestCtrl', (Fullscreen: ng.fullscreen.IFullscreen) => {
Fullscreen.all();
Fullscreen.toggleAll();
Fullscreen.enable(document.getElementById('test-id'));
Fullscreen.cancel();
Fullscreen.isEnabled();
Fullscreen.isSupported();
});
+34
View File
@@ -0,0 +1,34 @@
// Type definitions for AngularJS HTML5 Fullscreen v1.0.1
// Project: https://github.com/fabiobiondi/angular-fullscreen
// Definitions by: Julien Paroche <https://github.com/julienpa>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/angular-fullscreen
/// <reference path="../angularjs/angular.d.ts" />
declare namespace angular.fullscreen {
/**
* Prefixing interface name with "I" is not recommended: http://www.typescriptlang.org/Handbook#writing-dts-files
* However, we let it here to keep consistency with all the other Angular-related definitions
*/
interface IFullscreen {
// enable document fullscreen
all(): void;
// enable or disable the document fullscreen
toggleAll(): void;
// enable fullscreen to a specific element
enable(element: Element|HTMLElement): void;
// disable fullscreen
cancel(): void;
// return true if fullscreen is enabled, otherwise false
isEnabled(): boolean;
// return true if fullscreen API is supported by your browser
isSupported(): boolean;
}
}
+7 -7
View File
@@ -1,7 +1,7 @@
/// <reference path="angular-gettext.d.ts" />
module angular_gettext_tests {
namespace angular_gettext_tests {
// Configuring angular-gettext
// https://angular-gettext.rocketeer.be/dev-guide/configure/
@@ -15,12 +15,12 @@ module angular_gettext_tests {
gettextCatalog.debug = true;
});
// Marking strings in JavaScript code as translatable.
// https://angular-gettext.rocketeer.be/dev-guide/annotate-js/
// Marking strings in JavaScript code as translatable.
// https://angular-gettext.rocketeer.be/dev-guide/annotate-js/
angular.module("myApp").controller("helloController", function (gettext: angular.gettext.gettextFunction) {
var myString = gettext("Hello");
});
});
//Translating directly in JavaScript.
angular.module("myApp").controller("helloController", function (gettextCatalog: angular.gettext.gettextCatalog) {
@@ -58,4 +58,4 @@ module angular_gettext_tests {
gettextCatalog.loadRemote("/languages/" + lang + ".json");
};
});
}
}
+4 -4
View File
@@ -1,11 +1,11 @@
// Type definitions for angular-gettext v2.1.0
// Project: https://angular-gettext.rocketeer.be/
// Definitions by: Ákos Lukács <https://github.com/AkosLukacs>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
declare module angular.gettext {
declare namespace angular.gettext {
interface gettextCatalog {
//////////////
@@ -24,7 +24,7 @@ declare module angular.gettext {
translatedMarkerSuffix: string;
/** An object of loaded translation strings.Shouldn't be used directly. */
strings: {};
/** The default language, in which you're application is written. This defaults to English and it's generally a bad idea to use anything else: if your language has different pluralization rules you'll end up with incorrect translations. Deprecated
/** The default language, in which you're application is written. This defaults to English and it's generally a bad idea to use anything else: if your language has different pluralization rules you'll end up with incorrect translations. Deprecated
* @deprecreated
*/
baseLanguage: string;
@@ -51,7 +51,7 @@ declare module angular.gettext {
/** Get the correct pluralized (but untranslated) string for the value of n. */
getStringForm(string: string, n: number): string;
/** Translate a string with the given context. Uses Angular.JS interpolation, so something like this will do what you expect:
/** Translate a string with the given context. Uses Angular.JS interpolation, so something like this will do what you expect:
* var hello = gettextCatalog.getString("Hello {{name}}!", { name: "Ruben" });
* // var hello will be "Hallo Ruben!" in Dutch.
* The context parameter is optional: pass null (or don't pass anything) if you're not using it: this skips interpolation and is a lot faster.
@@ -0,0 +1,62 @@
// Type definitions for angular-google-analytics v1.1.0
// Project: https://github.com/revolunet/angular-google-analytics
// Definitions by: Matt Wheatley <https://github.com/terrawheat>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace angular.google.analytics {
interface AnalyticsService {
/**
* @summary If logging is enabled then all outbound calls are accessible via an in-memory array.
* This is useful for troubleshooting and seeing the order of outbound calls with parameters.
*/
log: Array<Object>;
/**
* @summary If in offline mode then all calls are queued to an in-memory array for future processing.
* All calls queued to the offlineQueue are not outbound calls yet and hence do not show up in the log.
*/
offlineQueue: Array<Object>;
/**
* @summary Returns the current URL that would be sent if a `trackPage` call was made.
* @return {string} The URL
*/
getUrl: () => string;
/**
* @summary Manually create classic analytics (ga.js) script tag
*/
createScriptTag: () => void;
/**
* @summary Manually create universal analytics (analytics.js) script tag
*/
createAnalyticsScriptTag: () => void;
/**
* @summary Allows for advanced configuration and definitions in univeral analytics only. This is a no-op when using classic analytics.
*/
set: (key: string, value: any, accountName?: string) => void;
/**
* @summary Creates a new page view event
* @param {string} pageURL URL of page view
* @param {string} title Page Title
* @param {Object} dimensions Additional dimensions and metrics
*/
trackPage: (pageURL: string, title?: string, dimensions?: { [expr: string]: any }) => void;
/**
* @summary Create a new event
*/
trackEvent: (category: string, action: string, label: string, value?: any, nonInteractionFlag?: boolean, dimensions?: { [expr: string]: any }) => void;
trackException: (descrption: string, isFatal: boolean) => void;
/**
* @summary While in offline mode, no calls to the ga function or pushes to the gaq array are made.
* This will queue all calls for later sending once offline mode is reset to false.
*/
offline: (offlineMode: boolean) => void;
}
}
@@ -1,4 +1,5 @@
/// <reference path="angular-google-analytics.d.ts" />
/// <reference path="angular-google-analytics-service.d.ts" />
function ConfigurationMethodChaining(AnalyticsProvider: angular.google.analytics.AnalyticsProvider) {
AnalyticsProvider
@@ -54,3 +55,41 @@ function SetRouteTrackingBehaviors(AnalyticsProvider: angular.google.analytics.A
AnalyticsProvider.setPageEvent("$stateChangeSuccess");
AnalyticsProvider.setRemoveRegExp(/\/\d+?$/);
}
function RetrieveCurrentURL(Analytics: angular.google.analytics.AnalyticsService) {
var test = Analytics.getUrl();
}
function ManualScriptTagInjection(Analytics: angular.google.analytics.AnalyticsService) {
Analytics.createScriptTag();
Analytics.createAnalyticsScriptTag();
}
function SetCustomDimensions(Analytics: angular.google.analytics.AnalyticsService) {
Analytics.set('&uid', 1234);
Analytics.set('dimension1', 'Paid');
Analytics.set('dimension2', 'Paid', 'accountName');
}
function PageTracking(Analytics: angular.google.analytics.AnalyticsService) {
Analytics.trackPage('/video/detail/XXX');
Analytics.trackPage('/video/detail/XXX', 'Video XXX');
Analytics.trackPage('/video/detail/XXX', 'Video XXX', { dimension15: 'My Custom Dimension', metric18: 8000 });
}
function EventTracking(Analytics: angular.google.analytics.AnalyticsService) {
Analytics.trackEvent('video', 'play', 'django.mp4');
Analytics.trackEvent('video', 'play', 'django.mp4', 4);
Analytics.trackEvent('video', 'play', 'django.mp4', 4, true);
Analytics.trackEvent('video', 'play', 'django.mp4', 4, true, { dimension15: 'My Custom Dimension', metric18: 8000 });
}
function ExceptionTracking(Analytics: angular.google.analytics.AnalyticsService) {
Analytics.trackException('Function "foo" is undefined on object "bar"', true);
}
function OfflineMode(Analytics: angular.google.analytics.AnalyticsService) {
Analytics.offline(true);
Analytics.offline(false);
Analytics.offlineQueue;
}
+2 -2
View File
@@ -1,11 +1,11 @@
// Type definitions for angular-google-analytics v1.1.0
// Project: https://github.com/revolunet/angular-google-analytics
// Definitions by: Cyril Schumacher <https://github.com/cyrilschumacher>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
declare module angular.google.analytics {
declare namespace angular.google.analytics {
/**
* @summary Interface for {@link AnalysticsProvider}.
* @interface
+65 -61
View File
@@ -1,61 +1,65 @@
/// <reference path="angular-growl-v2.d.ts" />
var app = angular.module("ag", ["pascalprecht.translate", "$httpProvider"]);
app.config((growlProvider:angular.growl.IGrowlProvider, $httpProvider:angular.IHttpProvider) => {
var ttl:angular.growl.IGrowlTTLConfig = {
success: 5000,
error: 4000
};
growlProvider.globalTimeToLive(ttl)
.globalTimeToLive(5000)
.globalDisableCloseButton(true)
.globalDisableIcons(true)
.globalReversedOrder(false)
.globalDisableCountDown(true)
.messageVariableKey("someKey")
.globalInlineMessages(false)
.globalPosition("top-center")
.messagesKey("someKey")
.messageTextKey("someKey")
.messageTitleKey("someKey")
.messageSeverityKey("someKey")
.onlyUniqueMessages(false);
$httpProvider.interceptors.push(growlProvider.serverMessagesInterceptor);
});
app.controller("Ctrl", ($scope:angular.IScope,
growl:angular.growl.IGrowlService,
growlMessages:angular.growl.IGrowlMessagesService) => {
var config:angular.growl.IGrowlMessageConfig = {
ttl: 5000,
disableCountDown: true,
disableCloseButton: true
};
var message = "Some message";
growl.warning(message);
growl.warning(message, config);
growl.error(message);
growl.error(message, config);
growl.info(message);
growl.info(message, config);
growl.success(message);
growl.success(message, config);
growl.general(message);
growl.general(message, config);
growl.general(message, config, "error");
growl.onlyUnique();
growl.reverseOrder();
growl.inlineMessages();
growl.position();
growlMessages.initDirective(1, 10);
var messages:angular.growl.IGrowlMessage[] = growlMessages.getAllMessages(2);
growlMessages.destroyAllMessages(0);
growlMessages.addMessage(messages[0]);
growlMessages.deleteMessage(messages[1]);
});
/// <reference path="angular-growl-v2.d.ts" />
var app = angular.module("ag", ["pascalprecht.translate", "$httpProvider"]);
app.config((growlProvider:angular.growl.IGrowlProvider, $httpProvider:angular.IHttpProvider) => {
var ttl:angular.growl.IGrowlTTLConfig = {
success: 5000,
error: 4000
};
growlProvider.globalTimeToLive(ttl)
.globalTimeToLive(5000)
.globalDisableCloseButton(true)
.globalDisableIcons(true)
.globalReversedOrder(false)
.globalDisableCountDown(true)
.messageVariableKey("someKey")
.globalInlineMessages(false)
.globalPosition("top-center")
.messagesKey("someKey")
.messageTextKey("someKey")
.messageTitleKey("someKey")
.messageSeverityKey("someKey")
.onlyUniqueMessages(false);
$httpProvider.interceptors.push(growlProvider.serverMessagesInterceptor);
});
app.controller("Ctrl", ($scope:angular.IScope,
growl:angular.growl.IGrowlService,
growlMessages:angular.growl.IGrowlMessagesService) => {
var config:angular.growl.IGrowlMessageConfig = {
ttl: 5000,
disableCountDown: true,
disableCloseButton: true
};
var message = "Some message";
growl.warning(message);
growl.warning(message, config);
growl.error(message);
growl.error(message, config);
growl.info(message);
growl.info(message, config);
growl.success(message);
growl.success(message, config);
growl.general(message);
growl.general(message, config);
growl.general(message, config, "error");
growl.onlyUnique();
growl.reverseOrder();
growl.inlineMessages();
growl.position();
growlMessages.initDirective(1, 10);
var messages:angular.growl.IGrowlMessage[] = growlMessages.getAllMessages(2);
growlMessages.destroyAllMessages(0);
growlMessages.addMessage(messages[0]);
growlMessages.deleteMessage(messages[1]);
var testMessage = growl.warning(message);
testMessage.setText("Some other message");
testMessage.destroy();
});
+259 -249
View File
@@ -1,249 +1,259 @@
// Type definitions for Angular Growl 2 v.0.7.5
// Project: http://janstevens.github.io/angular-growl-2
// Definitions by: Tadeusz Hucal <https://github.com/mkp05>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
declare module angular.growl {
/**
* Global Time-To-Leave configuration.
*/
interface IGrowlTTLConfig {
success?: number;
error?: number;
warning?: number;
info?: number;
}
/**
* Custom configuration used in single message call.
*/
interface IGrowlMessageConfig {
title?: string;
ttl?: number;
disableCountDown?: boolean;
disableIcons?: boolean;
disableCloseButton?: boolean;
onclose?: Function;
onopen?: Function;
position?: string;
referenceId?: number;
translateMessage?: boolean;
variables?: { [variable: string]: any; };
}
/**
* Growl message with configuration.
*/
interface IGrowlMessage extends IGrowlMessageConfig {
text: string;
}
/**
* Growl service provider.
*/
interface IGrowlProvider extends angular.IServiceProvider {
/**
* Pre-defined server error interceptor.
*/
serverMessagesInterceptor: (string|IHttpInterceptorFactory)[];
/**
* Set default TTL settings.
* @param ttl configuration of TTL for different type of message
*/
globalTimeToLive(ttl: IGrowlTTLConfig): IGrowlProvider;
/**
* Set default TTL settings.
* @param ttl ttl in milliseconds
*/
globalTimeToLive(ttl: number): IGrowlProvider;
/**
* Set default setting for disabling close button.
* @param disableCloseButton
*/
globalDisableCloseButton(disableCloseButton: boolean): IGrowlProvider;
/**
* Set default setting for disabling icons.
* @param disableIcons
*/
globalDisableIcons(disableIcons: boolean): IGrowlProvider;
/**
* Set reversing order of displaying new messages.
* @param reverseOrder
*/
globalReversedOrder(reverseOrder: boolean): IGrowlProvider;
/**
* Set default setting for displaying message disappear countdown.
* @param disableCountDown
*/
globalDisableCountDown(disableCountDown: boolean): IGrowlProvider;
/**
* Set default allowance for inline messages.
* @param inline
*/
globalInlineMessages(inline: boolean): IGrowlProvider;
/**
* Set default message position.
* @param position
*/
globalPosition(position: string): IGrowlProvider;
/**
* Enable/disable displaying only unique messages.
* @param onlyUniqueMessages
*/
onlyUniqueMessages(onlyUniqueMessages: boolean): IGrowlProvider;
/**
* Set key where messages are stored (for http interceptor).
* @param messageVariableKey
*/
messagesKey(messageKey: string): IGrowlProvider;
/**
* Set key where message text is stored (for http interceptor).
* @param messageVariableKey
*/
messageTextKey(messageTextKey: string): IGrowlProvider;
/**
* Set key where title of message is stored (for http interceptor).
* @param messageVariableKey
*/
messageTitleKey(messageTitleKey: string): IGrowlProvider;
/**
* Set key where severity of message is stored (for http interceptor).
* @param messageVariableKey
*/
messageSeverityKey(messageSeverityKey: string): IGrowlProvider;
/**
* Set key where variables for message are stored (for http interceptor).
* @param messageVariableKey
*/
messageVariableKey(messageVariableKey: string): IGrowlProvider;
}
/**
* Growl service.
*/
interface IGrowlService {
/**
* Show warning message.
* @param message text to display (or code for angular-translate)
*/
warning(message: string): IGrowlMessage;
/**
* Show warning message.
* @param message text to display (or code for angular-translate)
* @param config additional message configuration
*/
warning(message: string, config: IGrowlMessageConfig): IGrowlMessage;
/**
* Show error message.
* @param message text to display (or code for angular-translate)
*/
error(message: string): IGrowlMessage;
/**
* Show error message.
* @param message text to display (or code for angular-translate)
* @param config additional message configuration
*/
error(message: string, config: IGrowlMessageConfig): IGrowlMessage;
/**
* Show information message.
* @param message text to display (or code for angular-translate)
*/
info(message: string): IGrowlMessage;
/**
* Show information message.
* @param message text to display (or code for angular-translate)
* @param config additional message configuration
*/
info(message: string, config: IGrowlMessageConfig): IGrowlMessage;
/**
* Show success message.
* @param message text to display (or code for angular-translate)
* @param config additional message configuration
*/
success(message: string): IGrowlMessage;
/**
* Show success message.
* @param message text to display (or code for angular-translate)
*/
success(message: string, config: IGrowlMessageConfig): IGrowlMessage;
/**
* Show message (generic).
* @param message text to display (or code for angular-translate)
*/
general(message: string): IGrowlMessage;
/**
* Show message (generic).
* @param message text to display (or code for angular-translate)
* @param config additional message configuration
*/
general(message: string, config: IGrowlMessageConfig): IGrowlMessage;
/**
* Show message (generic).
* @param message text to display (or code for angular-translate)
* @param config additional message configuration
* @param severity message severity (error, warning, success, info).
*/
general(message: string, config: IGrowlMessageConfig, severity: string): IGrowlMessage;
/**
* Get current setting for displaying only unique messages.
*/
onlyUnique(): boolean;
/**
* Get current setting for reversing messages order.
*/
reverseOrder(): boolean;
/**
* Get current allowance for inline messages.
*/
inlineMessages(): boolean;
/**
* Get current messages position.
*/
position(): string;
}
/**
* GrowlMessages service.
*/
interface IGrowlMessagesService {
/**
* Initialize a directive
* We look at the preloaded directive and use this else we
* create a new blank object
* @param referenceId
* @param limitMessages
*/
initDirective(referenceId: number, limitMessages: number): ng.IDirective;
/**
* Get current messages
*/
getAllMessages(referenceId?: number): IGrowlMessage[];
/**
* Destroy all messages
*/
destroyAllMessages(referenceId?: number): void;
/**
* Add a message
*/
addMessage(message: IGrowlMessage): IGrowlMessage;
/**
* Delete a message
*/
deleteMessage(message: IGrowlMessage): void;
}
}
// Type definitions for Angular Growl 2 v.0.7.5
// Project: http://janstevens.github.io/angular-growl-2
// Definitions by: Tadeusz Hucal <https://github.com/mkp05>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
declare namespace angular.growl {
/**
* Global Time-To-Leave configuration.
*/
interface IGrowlTTLConfig {
success?: number;
error?: number;
warning?: number;
info?: number;
}
/**
* Custom configuration used in single message call.
*/
interface IGrowlMessageConfig {
title?: string;
ttl?: number;
disableCountDown?: boolean;
disableIcons?: boolean;
disableCloseButton?: boolean;
onclose?: Function;
onopen?: Function;
position?: string;
referenceId?: number;
translateMessage?: boolean;
variables?: { [variable: string]: any; };
}
/**
* Growl message with configuration.
*/
interface IGrowlMessage extends IGrowlMessageConfig {
text: string;
/**
* Destroy the message.
*/
destroy(): void;
/**
* Update the message body.
* @param newText new message body
*/
setText(newText: string): void;
}
/**
* Growl service provider.
*/
interface IGrowlProvider extends angular.IServiceProvider {
/**
* Pre-defined server error interceptor.
*/
serverMessagesInterceptor: (string|IHttpInterceptorFactory)[];
/**
* Set default TTL settings.
* @param ttl configuration of TTL for different type of message
*/
globalTimeToLive(ttl: IGrowlTTLConfig): IGrowlProvider;
/**
* Set default TTL settings.
* @param ttl ttl in milliseconds
*/
globalTimeToLive(ttl: number): IGrowlProvider;
/**
* Set default setting for disabling close button.
* @param disableCloseButton
*/
globalDisableCloseButton(disableCloseButton: boolean): IGrowlProvider;
/**
* Set default setting for disabling icons.
* @param disableIcons
*/
globalDisableIcons(disableIcons: boolean): IGrowlProvider;
/**
* Set reversing order of displaying new messages.
* @param reverseOrder
*/
globalReversedOrder(reverseOrder: boolean): IGrowlProvider;
/**
* Set default setting for displaying message disappear countdown.
* @param disableCountDown
*/
globalDisableCountDown(disableCountDown: boolean): IGrowlProvider;
/**
* Set default allowance for inline messages.
* @param inline
*/
globalInlineMessages(inline: boolean): IGrowlProvider;
/**
* Set default message position.
* @param position
*/
globalPosition(position: string): IGrowlProvider;
/**
* Enable/disable displaying only unique messages.
* @param onlyUniqueMessages
*/
onlyUniqueMessages(onlyUniqueMessages: boolean): IGrowlProvider;
/**
* Set key where messages are stored (for http interceptor).
* @param messageVariableKey
*/
messagesKey(messageKey: string): IGrowlProvider;
/**
* Set key where message text is stored (for http interceptor).
* @param messageVariableKey
*/
messageTextKey(messageTextKey: string): IGrowlProvider;
/**
* Set key where title of message is stored (for http interceptor).
* @param messageVariableKey
*/
messageTitleKey(messageTitleKey: string): IGrowlProvider;
/**
* Set key where severity of message is stored (for http interceptor).
* @param messageVariableKey
*/
messageSeverityKey(messageSeverityKey: string): IGrowlProvider;
/**
* Set key where variables for message are stored (for http interceptor).
* @param messageVariableKey
*/
messageVariableKey(messageVariableKey: string): IGrowlProvider;
}
/**
* Growl service.
*/
interface IGrowlService {
/**
* Show warning message.
* @param message text to display (or code for angular-translate)
*/
warning(message: string): IGrowlMessage;
/**
* Show warning message.
* @param message text to display (or code for angular-translate)
* @param config additional message configuration
*/
warning(message: string, config: IGrowlMessageConfig): IGrowlMessage;
/**
* Show error message.
* @param message text to display (or code for angular-translate)
*/
error(message: string): IGrowlMessage;
/**
* Show error message.
* @param message text to display (or code for angular-translate)
* @param config additional message configuration
*/
error(message: string, config: IGrowlMessageConfig): IGrowlMessage;
/**
* Show information message.
* @param message text to display (or code for angular-translate)
*/
info(message: string): IGrowlMessage;
/**
* Show information message.
* @param message text to display (or code for angular-translate)
* @param config additional message configuration
*/
info(message: string, config: IGrowlMessageConfig): IGrowlMessage;
/**
* Show success message.
* @param message text to display (or code for angular-translate)
* @param config additional message configuration
*/
success(message: string): IGrowlMessage;
/**
* Show success message.
* @param message text to display (or code for angular-translate)
*/
success(message: string, config: IGrowlMessageConfig): IGrowlMessage;
/**
* Show message (generic).
* @param message text to display (or code for angular-translate)
*/
general(message: string): IGrowlMessage;
/**
* Show message (generic).
* @param message text to display (or code for angular-translate)
* @param config additional message configuration
*/
general(message: string, config: IGrowlMessageConfig): IGrowlMessage;
/**
* Show message (generic).
* @param message text to display (or code for angular-translate)
* @param config additional message configuration
* @param severity message severity (error, warning, success, info).
*/
general(message: string, config: IGrowlMessageConfig, severity: string): IGrowlMessage;
/**
* Get current setting for displaying only unique messages.
*/
onlyUnique(): boolean;
/**
* Get current setting for reversing messages order.
*/
reverseOrder(): boolean;
/**
* Get current allowance for inline messages.
*/
inlineMessages(): boolean;
/**
* Get current messages position.
*/
position(): string;
}
/**
* GrowlMessages service.
*/
interface IGrowlMessagesService {
/**
* Initialize a directive
* We look at the preloaded directive and use this else we
* create a new blank object
* @param referenceId
* @param limitMessages
*/
initDirective(referenceId: number, limitMessages: number): angular.IDirective;
/**
* Get current messages
*/
getAllMessages(referenceId?: number): IGrowlMessage[];
/**
* Destroy all messages
*/
destroyAllMessages(referenceId?: number): void;
/**
* Add a message
*/
addMessage(message: IGrowlMessage): IGrowlMessage;
/**
* Delete a message
*/
deleteMessage(message: IGrowlMessage): void;
}
}
+2 -2
View File
@@ -1,11 +1,11 @@
// Type definitions for angular-hotkeys
// Project: https://github.com/chieffancypants/angular-hotkeys
// Definitions by: Jason Zhao <https://github.com/jlz27>, Stefan Steinhart <https://github.com/reppners>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
declare module angular.hotkeys {
declare namespace angular.hotkeys {
interface HotkeysProvider {
template: string;
+2 -2
View File
@@ -1,11 +1,11 @@
// Type definitions for angular-http-auth 1.2.1
// Project: https://github.com/witoldsz/angular-http-auth
// Definitions by: vvakame <https://github.com/vvakame>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
declare module angular.httpAuth {
declare namespace angular.httpAuth {
interface IAuthService {
loginConfirmed(data?:any, configUpdater?:Function):void;
loginCancelled(data?:any, reason?:any):void;
+3 -3
View File
@@ -1,11 +1,11 @@
// Type definitions for angular-httpi
// Project: https://github.com/bennadel/httpi
// Definitions by: Andrew Camilleri <https://github.com/Kukks>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
declare module Httpi {
declare namespace Httpi {
export interface HttpiPayload extends ng.IRequestShortcutConfig {
method?: string;
url?: string;
@@ -39,4 +39,4 @@ declare module Httpi {
setKeepTrailingSlash(newKeepTrailingSlash: boolean): HttpiResource;
}
}
}
+47 -17
View File
@@ -1,23 +1,53 @@
/// <reference path="./angular-idle.d.ts" />
angular.module('app', ['ngIdle'])
.config(['$keepaliveProvider', '$idleProvider',
($keepaliveProvider: ng.idle.IKeepAliveProvider, $idleProvider: ng.idle.IIdleProvider) => {
$idleProvider.activeOn('mousemove keydown DOMMouseScroll mousewheel mousedown');
$idleProvider.idleDuration(5);
$idleProvider.warningDuration(5);
$idleProvider.keepalive(true)
$idleProvider.autoResume(true);
$keepaliveProvider.interval(10);
.config(['KeepaliveProvider', 'IdleProvider', 'TitleProvider',
(keepaliveProvider: angular.idle.IKeepAliveProvider, idleProvider: angular.idle.IIdleProvider,
titleProvider: angular.idle.ITitleProvider) => {
idleProvider.interrupt('mousemove keydown DOMMouseScroll mousewheel mousedown');
idleProvider.idle(5);
idleProvider.timeout(5);
idleProvider.keepalive(true)
idleProvider.autoResume(true);
const config: ng.IRequestConfig = {
url: "http://google.com",
method: "GET"
};
keepaliveProvider.http(config.url); // should accept string and ng.IRequestConfig
keepaliveProvider.http(config);
keepaliveProvider.interval(10);
titleProvider.enabled(true);
}])
.run(['$keepalive', '$idle', ($keepalive: ng.idle.IKeepAliveService, $idle: ng.idle.IIdleService) => {
$idle.watch();
if ($idle.running() || $idle.idling()) {
$idle.unwatch();
.run(['Keepalive', 'Idle', 'Title', (Keepalive: angular.idle.IKeepAliveService, Idle: angular.idle.IIdleService,
Title: angular.idle.ITitleService) => {
Idle.setTimeout(Idle.getTimeout());
Idle.setIdle(Idle.getIdle());
Idle.watch();
Idle.interrupt();
const expired: boolean = Idle.isExpired();
if (Idle.running() || Idle.idling()) {
Idle.unwatch();
}
$keepalive.start();
$keepalive.ping();
$keepalive.stop();
Keepalive.start();
Keepalive.ping();
Keepalive.stop();
Keepalive.setInterval(10);
Title.setEnabled(Title.isEnabled());
Title.original(Title.original());
Title.value(Title.value());
Title.store(false);
Title.store();
Title.restore();
Title.idleMessage(Title.idleMessage());
Title.timedOutMessage(Title.timedOutMessage());
Title.setAsIdle(120);
Title.setAsTimedOut();
}]);
+171 -42
View File
@@ -1,41 +1,133 @@
// Type definitions for ng-idle v0.3.5
// Type definitions for ng-idle v1.1.1
// Project: http://hackedbychinese.github.io/ng-idle/
// Definitions by: mthamil <https://github.com/mthamil>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
declare module angular.idle {
declare namespace angular.idle {
/**
* Used to configure the $keepalive service.
* Used to configure the Title service.
*/
interface ITitleProvider extends IServiceProvider {
/**
* Enables or disables the Title functionality.
*
* @param enabled Boolean, default is true.
*/
enabled(enabled: boolean): void;
}
interface ITitleService {
/**
* Allows the title functionality to be enabled or disabled on the fly.
*/
setEnabled(enabled: boolean): void;
/**
* Returns whether or not the title functionality has been enabled.
*/
isEnabled(): boolean;
/**
* Will store val as the "original" title of the document.
*
* Tracking the original title is important when restoring the title after displaying, for example, the idle warning message.
*/
original(val: string): void;
/**
* Returns the "original" title value that has been previously set.
*
* Tracking the original title is important when restoring the title after displaying, for example, the idle warning message.
*/
original(): string;
/**
* Changes the actual title of the document.
*/
value(val: string): void;
/**
* Returns the current document title.
*/
value(): string;
/**
* If overwrite is false or unspecified, updates the "original" title with the current document title
* if it has not already been stored. If overwrite is true, the current document title is stored regardless.
*/
store(overwrite?: boolean): void;
/**
* Sets the title to the original value (if it was stored or set previously).
*/
restore(): void;
/**
* Sets the text to use as the message displayed when the user is idle.
*/
idleMessage(val: string): void;
/**
* Gets the text to use as the message displayed when the user is idle.
*/
idleMessage(): string;
/**
* Sets the text to use as the message displayed when the user is timed out.
*/
timedOutMessage(val: string): void;
/**
* Gets the text to use as the message displayed when the user is timed out.
*/
timedOutMessage(): string;
/**
* Stores the original title if it hasn't been already, determines the number minutes, seconds,
* and total seconds from countdown, and displays the idleMessage with the aforementioned values interpolated.
*/
setAsIdle(countdown: number): void;
/**
* Stores the original title if it hasn't been already, and displays the timedOutMessage.
*/
setAsTimedOut(): void;
}
/**
* Used to configure the Keepalive service.
*/
interface IKeepAliveProvider extends IServiceProvider {
/**
* If configured, options will be used to issue a request using $http.
* If the value is null, no HTTP request will be issued.
* You can specify a string, which it will assume to be a URL to a simple GET request.
* If configured, options will be used to issue a request using $http.
* If the value is null, no HTTP request will be issued.
* You can specify a string, which it will assume to be a URL to a simple GET request.
* Otherwise, you can use the same options $http takes. However, cache will always be false.
*
* @param value May be string or object, default is null.
*
* @param value May be string or IRequestConfig, default is null.
*/
http(value: any): void;
http(value: string | IRequestConfig): void;
/**
* This specifies how often the keepalive event is triggered and the
* This specifies how often the keepalive event is triggered and the
* HTTP request is issued.
*
* @param seconds Integer, default is 5 minutes. Must be greater than 0.
*
* @param seconds Integer, default is 10 minutes. Must be greater than 0.
*/
interval(seconds: number): void;
}
/**
* $keepalive will use a timeout to periodically wake, broadcast a $keepalive event on the root scope,
* and optionally make an $http request. By default, the $idle service will stop and start $keepalive
* when a user becomes idle or returns from idle, respectively. It is also started automatically when
* $idle.watch() is called. This can be disabled by configuring the $idleProvider.
* Keepalive will use a timeout to periodically wake, broadcast a Keepalive event on the root scope,
* and optionally make an $http request. By default, the Idle service will stop and start Keepalive
* when a user becomes idle or returns from idle, respectively. It is also started automatically when
* Idle.watch() is called. This can be disabled by configuring the IdleProvider.
*/
interface IKeepAliveService {
@@ -53,64 +145,96 @@ declare module angular.idle {
* Performs one ping only.
*/
ping(): void;
/**
* Changes the interval value at runtime.
* You will need to restart the pinging process by calling start() manually for the changes to be reflected.
*/
setInterval(seconds: number): void;
}
/**
* Used to configure the $idle service.
* Used to configure the Idle service.
*/
interface IIdleProvider extends IServiceProvider {
/**
* Specifies the DOM events the service will watch to reset the idle timeout.
* Specifies the DOM events the service will watch to reset the idle timeout.
* Multiple events should be separated by a space.
*
*
* @param events string, default 'mousemove keydown DOMMouseScroll mousewheel mousedown'
*/
activeOn(events: string): void;
interrupt(events: string): void;
/**
* The idle timeout duration in seconds. After this amount of time passes without the user
* performing an action that triggers one of the watched DOM events, the user is considered
* The idle timeout duration in seconds. After this amount of time passes without the user
* performing an action that triggers one of the watched DOM events, the user is considered
* idle.
*
*
* @param seconds integer, default is 20min
*/
idleDuration(seconds: number): void;
idle(seconds: number): void;
/**
* The amount of time the user has to respond (in seconds) before they have been considered
* The amount of time the user has to respond (in seconds) before they have been considered
* timed out.
*
*
* @param seconds integer, default is 30s
*/
warningDuration(seconds: number): void;
timeout(seconds: number): void;
/**
* When true, user activity will automatically interrupt the warning countdown and reset the
* idle state. If false, you will need to manually call watch() when you want to start
* watching for idleness again.
*
* @param enabled boolean, default is true
* When true or idle, user activity will automatically interrupt the warning countdown
* and reset the idle state. If false or off, you will need to manually call watch()
* when you want to start watching for idleness again. If notIdle, user activity will
* only automatically interrupt if the user is not yet idle.
*
* @param enabled boolean or string, possible values: off/false, idle/true, or notIdle
*/
autoResume(enabled: boolean): void;
autoResume(enabled: boolean | string): void;
/**
* When true, the $keepalive service is automatically stopped and started as needed.
*
* When true, the Keepalive service is automatically stopped and started as needed.
*
* @param enabled boolean, default is true
*/
keepalive(enabled: boolean): void;
}
/**
* $idle, once watch() is called, will start a timeout which if expires, will enter a warning state
* countdown. Once the countdown reaches zero, idle will broadcast a timeout event indicating the
* user has timed out (where your app should log them out or whatever you like). If the user performs
* an action that triggers a watched DOM event that bubbles up to document.body, this will reset the
* Idle, once watch() is called, will start a timeout which if expires, will enter a warning state
* countdown. Once the countdown reaches zero, idle will broadcast a timeout event indicating the
* user has timed out (where your app should log them out or whatever you like). If the user performs
* an action that triggers a watched DOM event that bubbles up to document.body, this will reset the
* idle/warning state and start the process over again.
*/
interface IIdleService {
/**
* Gets the current idle value
*/
getIdle(): number;
/**
* Gets the current timeout value
*/
getTimeout(): number;
/**
* Updates the idle value (see IdleProvider.idle()) and
* restarts the watch if its running.
*/
setIdle(idle: number): void;
/**
* Updates the timeout value (see IdleProvider.timeout()) and
* restarts the watch if its running.
*/
setTimeout(timeout: number): void;
/**
* Whether user has timed out (meaning idleDuration + timeout has passed without any activity)
*/
isExpired(): boolean;
/**
* Whether or not the watch() has been called and it is watching for idleness.
*/
@@ -130,5 +254,10 @@ declare module angular.idle {
* Stops watching for idleness, and resets the idle/warning state.
*/
unwatch(): void;
/**
* Manually trigger the idle interrupt that normally occurs during user activity.
*/
interrupt(): any;
}
}
+2 -2
View File
@@ -3,14 +3,14 @@
var app = angular.module("angular-jwt-tests", ["angular-jwt"]);
var $jwtHelper: angular.jwt.IJwtHelper;
var $jwtHelper: ng.jwt.IJwtHelper;
var expToken = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3NhbXBsZXMuYXV0aDAuY29tLyIsInN1YiI6ImZhY2Vib29rfDEwMTU0Mjg3MDI3NTEwMzAyIiwiYXVkIjoiQlVJSlNXOXg2MHNJSEJ3OEtkOUVtQ2JqOGVESUZ4REMiLCJleHAiOjE0MTIyMzQ3MzAsImlhdCI6MTQxMjE5ODczMH0.7M5sAV50fF1-_h9qVbdSgqAnXVF7mz3I6RjS6JiH0H8';
var tokenPayload = $jwtHelper.decodeToken(expToken);
var date = $jwtHelper.getTokenExpirationDate(expToken);
var bool = $jwtHelper.isTokenExpired(expToken);
var $jwtInterceptor: angular.jwt.IJwtInterceptor;
var $jwtInterceptor: ng.jwt.IJwtInterceptor;
$jwtInterceptor.tokenGetter = () => {
return expToken;

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