Merge pull request #1 from DefinitelyTyped/master

Merging master
This commit is contained in:
Tomino
2016-09-13 11:41:28 +01:00
committed by GitHub
3318 changed files with 683716 additions and 228163 deletions
+52
View File
@@ -0,0 +1,52 @@
/// <reference path="3d-bin-packing.d.ts" />
import packer = require("3d-bin-packing");
import samchon = require("samchon-framework");
function main(): void
{
///////////////////////////
// CONSTRUCT OBJECTS
///////////////////////////
let wrapperArray: bws.packer.WrapperArray = new packer.WrapperArray();
let instanceArray: bws.packer.InstanceArray = new packer.InstanceArray();
// Wrappers
wrapperArray.push
(
new packer.Wrapper("Large", 1000, 40, 40, 15, 0),
new packer.Wrapper("Medium", 700, 20, 20, 10, 0),
new packer.Wrapper("Small", 500, 15, 15, 8, 0)
);
///////
// Each Instance is repeated #15
///////
instanceArray.insert(instanceArray.end(), 15, new packer.Product("Eraser", 1, 2, 5));
instanceArray.insert(instanceArray.end(), 15, new packer.Product("Book", 15, 30, 3));
instanceArray.insert(instanceArray.end(), 15, new packer.Product("Drink", 3, 3, 10));
instanceArray.insert(instanceArray.end(), 15, new packer.Product("Umbrella", 5, 5, 20));
// Wrappers also can be packed into another Wrapper.
instanceArray.insert(instanceArray.end(), 15, new packer.Wrapper("Notebook-Box", 2000, 30, 40, 4, 2));
instanceArray.insert(instanceArray.end(), 15, new packer.Wrapper("Tablet-Box", 2500, 20, 28, 2, 0));
///////////////////////////
// BEGINS PACKING
///////////////////////////
// CONSTRUCT PACKER
let my_packer: bws.packer.Packer = new packer.Packer(wrapperArray, instanceArray);
///////
// PACK (OPTIMIZE)
let result: bws.packer.WrapperArray = my_packer.optimize();
///////
///////////////////////////
// TRACE PACKING RESULT
///////////////////////////
let xml: samchon.library.XML = result.toXML();
console.log(xml.toString());
}
main();
+1500
View File
File diff suppressed because it is too large Load Diff
+386 -95
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
}
+1 -1
View File
@@ -1,7 +1,7 @@
// 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
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface FinchCallback {
+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
+2 -2
View File
@@ -24,7 +24,7 @@ Please see the [contribution guide](http://definitelytyped.org/guides/contributi
* 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 -1
View File
@@ -1,7 +1,7 @@
// 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"
+6 -7
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;
@@ -77,9 +77,6 @@ declare module AceAjax {
onTextInput(text: any): void;
}
var KeyBinding: {
new(editor: Editor): KeyBinding;
}
export interface TextMode {
@@ -653,7 +650,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 +659,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 +1034,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;
+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");
+2 -2
View File
@@ -1,9 +1,9 @@
// 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="../bluebird/bluebird-2.0.d.ts" />
/// <reference path='../node/node.d.ts'/>
/// <reference path='../redis/redis.d.ts'/>
+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;
}
}
+25
View File
@@ -0,0 +1,25 @@
/// <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;
var postLogoutRedirectUrl = auth.config.postLogoutRedirectUri;
var isValidRequest = auth.getRequestInfo('hash').valid;
+169
View File
@@ -0,0 +1,169 @@
// 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;
postLogoutRedirectUri?: string; // redirect url after succesful logout operation
}
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;
/**
* Indicates whether login is in progress now or not.
*/
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 {RequestInfo} for appropriate hash.
*/
getRequestInfo(hash: string): RequestInfo;
/**
* 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;
/**
* Handles redirection after login operation.
* Gets access token from url and saves token to the (local/session) storage
* or saves error in case unsuccessful login.
*/
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 -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>, Abner Oliveira <https://github.com/abner>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
@@ -216,7 +216,7 @@ declare module "adm-zip" {
* @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
* @param callback The callback function will be called afeter extraction
*/
extractAllToAsync(targetPath: string, overwrite: boolean, callback: (error: Error) => void): void;
/**
@@ -233,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 -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;
@@ -1464,7 +1465,7 @@ declare module ag.grid {
addDropTarget(eDropTarget: any, dropTargetCallback: any): void;
}
}
declare module ag.grid {
declare namespace ag.grid {
class AgList {
private eGui;
private uniqueId;
@@ -1515,7 +1516,7 @@ declare module ag.grid {
getGui(): any;
}
}
declare module ag.grid {
declare namespace ag.grid {
class ColumnSelectionPanel {
private gridOptionsWrapper;
private columnController;
@@ -1531,7 +1532,7 @@ declare module ag.grid {
getGui(): any;
}
}
declare module ag.grid {
declare namespace ag.grid {
class GroupSelectionPanel {
gridOptionsWrapper: any;
columnController: ColumnController;
@@ -1547,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;
@@ -1571,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;
@@ -1587,7 +1588,7 @@ declare module ag.grid {
private beforeDropListener(newItem);
}
}
declare module ag.grid {
declare namespace ag.grid {
class VerticalStack {
isLayoutPanel: any;
childPanels: any;
@@ -1598,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;
@@ -1692,7 +1693,7 @@ declare module ag.grid {
columnApi?: ColumnApi;
}
}
declare module ag.grid {
declare namespace ag.grid {
class GridApi {
private grid;
private rowRenderer;
@@ -1789,7 +1790,7 @@ declare module ag.grid {
refreshPivot(): void;
}
}
declare module ag.grid {
declare namespace ag.grid {
class ValueService {
private gridOptionsWrapper;
private expressionService;
@@ -1800,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;
@@ -1862,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[];
@@ -1878,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;
@@ -1973,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");
})
+451
View File
@@ -0,0 +1,451 @@
// 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;
}
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?: Agenda.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): Agenda.Job;
/**
* Find all Jobs matching `query` and pass same back in cb().
* @param query
* @param cb
*/
jobs(query: any, cb: ResultCallback<Agenda.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?: Agenda.Job, done?: (err?: Error) => void) => void): void;
define(name: string, options: Agenda.JobOptions, handler: (job?: Agenda.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<Agenda.Job>): Agenda.Job;
every(interval: number | string, names: string[], data?: any, options?: any, cb?: ResultCallback<Agenda.Job[]>): Agenda.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<Agenda.Job>): Agenda.Job;
schedule(when: Date | string, names: string[], data?: any, cb?: ResultCallback<Agenda.Job[]>): Agenda.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<Agenda.Job>): Agenda.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 {
/**
* 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;
/**
* Job's state
*/
disabled: boolean
}
/**
* 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;
/**
* Calculates next time the job should run
*/
computeNextRunAt(): Job;
}
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;
}
}
export = Agenda;
}
+74
View File
@@ -0,0 +1,74 @@
/// <reference path="ajv.d.ts" />
import * as Ajv from 'ajv';
var ajv = new Ajv(); // options can be passed, e.g. {allErrors: true}
var validate = ajv.compile({});
var valid = validate({});
if (!valid) console.log(validate.errors);
var valid = ajv.validate({}, {});
if (!valid) console.log(ajv.errors);
ajv.addSchema({}, 'mySchema');
var valid = ajv.validate('mySchema', {});
if (!valid) console.log(ajv.errorsText());
ajv.addKeyword('range', {
type: 'number', compile: function (sch, parentSchema) {
var min: any = sch[0];
var max: any = sch[1];
return parentSchema.exclusiveRange === true
? function (data) { return data > min && data < max; }
: function (data) { return data >= min && data <= max; }
}
});
var schema = { "range": [2, 4], "exclusiveRange": true };
var validate = ajv.compile(schema);
console.log(validate(2.01)); // true
console.log(validate(3.99)); // true
console.log(validate(2)); // false
console.log(validate(4)); // false
declare var request: any;
function loadSchema(uri: any, callback: any) {
request.json(uri, function (err: any, res: any, body: any) {
if (err || res.statusCode >= 400)
callback(err || new Error('Loading error: ' + res.statusCode));
else
callback(null, body);
});
}
var ajv = new Ajv({ loadSchema: loadSchema });
ajv.compileAsync(schema, function (err, validate) {
if (err) return;
var valid = validate({});
});
declare var knex: any;
function checkIdExists(schema: any, data: any) {
return knex(schema.table)
.select('id')
.where('id', data)
.then(function (rows: any) {
return true;
});
}
var validate = ajv.compile(schema);
(validate({ userId: 1, postId: 19 }) as PromiseLike<boolean>)
.then(function (valid) {
// "valid" is always true here
console.log('Data is valid');
}, function (err) {
if (!(err instanceof Ajv.ValidationError)) throw err;
// data is invalid
console.log('Validation errors:', err.errors);
});
var ajv = new Ajv({ /* async: 'es7', */ transpile: 'nodent' });
var validate = ajv.compile(schema); // transpiled es7 async function
(validate({}) as PromiseLike<any>).then(() => { }, () => { });
+112
View File
@@ -0,0 +1,112 @@
// Type definitions for ajv
// Project: https://github.com/epoberezkin/ajv
// Definitions by: York Yao <https://github.com/plantain-00/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module "ajv" {
class Ajv {
/**
* Create Ajv instance.
*/
constructor(options?: Ajv.AjvOptions);
/**
* Generate validating function and cache the compiled schema for future use.
*/
compile(schema: any): Ajv.AjvValidate;
/**
* Asyncronous version of compile method that loads missing remote schemas using asynchronous function in options.loadSchema.
*/
compileAsync(schema: any, callback: (error: Error, validate: Ajv.AjvValidate) => void): void;
/**
* Validate data using passed schema (it will be compiled and cached).
*/
validate(schema: any, data: any): boolean | PromiseLike<boolean>;
errors: Ajv.ValidationError[];
/**
* Add schema(s) to validator instance.
*/
addSchema(schema: any, key: string): void;
/**
* Adds meta schema(s) that can be used to validate other schemas.
* That function should be used instead of addSchema because there may be instance options that would compile a meta schema incorrectly (at the moment it is removeAdditional option).
*/
addMetaSchema(schema: any, key: string): void;
/**
* Validates schema.
* This method should be used to validate schemas rather than validate due to the inconsistency of uri format in JSON-Schema standard.
*/
validateSchema(schema: any): Boolean;
/**
* Retrieve compiled schema previously added with addSchema by the key passed to addSchema or by its full reference (id).
* Returned validating function has schema property with the reference to the original schema.
*/
getSchema(key: string): Ajv.AjvValidate;
/**
* Remove added/cached schema.
* Even if schema is referenced by other schemas it can be safely removed as dependent schemas have local references.
*/
removeSchema(schema: any): void;
/**
* Add custom format to validate strings. It can also be used to replace pre-defined formats for Ajv instance.
*/
addFormat(name: string, format: any): void;
/**
* Add custom validation keyword to Ajv instance.
*/
addKeyword(keyword: string, definition: Ajv.AjxKeywordDefinition): void;
errorsText(): any;
static ValidationError: Function;
}
namespace Ajv {
type AjvOptions = {
v5?: boolean;
allErrors?: boolean;
verbose?: boolean;
jsonPointers?: boolean;
uniqueItems?: boolean;
unicode?: boolean;
format?: string;
formats?: any;
schemas?: any;
missingRefs?: boolean;
loadSchema?(uri: string, callback: (error: Error, body: any) => void): void;
removeAdditional?: boolean;
useDefaults?: boolean;
coerceTypes?: boolean;
async?: any;
transpile?: string;
meta?: boolean;
validateSchema?: boolean;
addUsedSchema?: boolean;
inlineRefs?: boolean;
passContext?: boolean;
loopRequired?: number;
ownProperties?: boolean;
multipleOfPrecision?: boolean;
errorDataPath?: string,
messages?: boolean;
beautify?: boolean;
cache?: any;
}
type AjvValidate = ((data: any) => boolean | PromiseLike<boolean>) & {
errors: ValidationError[];
}
type AjxKeywordDefinition = {
async?: boolean;
type: string;
compile?: (schema: any, parentsSchema: any) => ((data: any) => boolean | PromiseLike<boolean>);
validate?: (schema: any, data: any) => boolean;
}
type ValidationError = {
keyword: string;
dataPath: string;
schemaPath: string;
params: any;
message: string;
schema: any;
parentSchema: any;
data: any;
}
}
export = Ajv;
}
+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;
}
}
}
+25
View File
@@ -0,0 +1,25 @@
/// <reference path="../node/node.d.ts"/>
/// <reference path="./alexa-sdk.d.ts" />
import * as Alexa from "alexa-sdk";
exports.handler = function(event: Alexa.RequestBody, context: Alexa.Context, callback: Function) {
let alexa = Alexa.handler(event, context);
alexa.registerHandlers(handlers);
alexa.execute();
};
let handlers: Alexa.Handlers = {
'LaunchRequest': function () {
var self: Alexa.Handler = this;
self.emit('SayHello');
},
'HelloWorldIntent': function () {
var self: Alexa.Handler = this;
self.emit('SayHello');
},
'SayHello': function () {
var self: Alexa.Handler = this;
self.emit(':tell', 'Hello World!');
}
};
+132
View File
@@ -0,0 +1,132 @@
// Type definitions for Alexa SDK for Node.js v1.0.3
// Project: https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs
// Definitions by: Pete Beegle <https://github.com/petebeegle>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module 'alexa-sdk' {
export function handler(event: RequestBody, context: Context, callback?: Function): AlexaObject;
export function CreateStateHandler(state: string, obj: any): any;
export var StateString: string;
interface AlexaObject {
_event: any;
_context: any;
_callback: any;
state: any;
appId: any;
response: any;
dynamoDBTableName: any;
saveBeforeResponse: boolean;
registerHandlers: (...handlers: Handlers[]) => any;
execute: () => void;
}
interface Handlers {
[intent: string]: () => void;
}
interface Handler {
on: any;
emit(event: string, ...args: any[]): boolean;
emitWithState: any;
state: any;
handler: any;
event: RequestBody;
attributes: any;
context: any;
name: any;
isOverriden: any;
}
interface Context {
callbackWaitsForEmptyEventLoop: boolean;
logGroupName: string;
logStreamName: string;
functionName: string;
memoryLimitInMB: string;
functionVersion: string;
invokeid: string;
awsRequestId: string;
}
interface RequestBody {
version: string;
session: Session;
request: LaunchRequest | IntentRequest | SessionEndedRequest;
}
interface Session {
new: boolean;
sessionId: string;
attributes: any;
application: SessionApplication;
user: SessionUser;
}
interface SessionApplication {
applicationId: string;
}
interface SessionUser {
userId: string;
accessToken: string;
}
interface LaunchRequest extends IRequest {}
interface IntentRequest extends IRequest {
intent: Intent;
}
interface Intent {
name: string;
slots: any;
}
interface SessionEndedRequest extends IRequest{
reason: string;
}
interface IRequest {
type: "LaunchRequest" | "IntentRequest" | "SessionEndedRequest";
requestId: string;
timeStamp: string;
}
interface ResponseBody {
version: string;
sessionAttributes?: any;
response: Response;
}
interface Response {
outputSpeech?: OutputSpeech;
card?: Card;
reprompt?: Reprompt;
shouldEndSession: boolean;
}
interface OutputSpeech {
type: "PlainText" | "SSML";
text?: string;
ssml?: string;
}
interface Card {
type: "Simple" | "Standard" | "LinkAccount";
title?: string;
content?: string;
text?: string;
image?: Image;
}
interface Image {
smallImageUrl: string;
largeImageUrl: string;
}
interface Reprompt {
outputSpeech: OutputSpeech;
}
}
+1 -1
View File
@@ -41,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");
}
}
+4 -4
View File
@@ -1,11 +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"/>
declare module AltJS {
declare namespace AltJS {
interface StoreReduce {
action:any;
@@ -53,8 +53,8 @@ declare module AltJS {
export type Source = {[name:string]: () => SourceModel<any>};
export interface SourceModel<S> {
local(state:any):any;
remote(state:any):Promise<S>;
local(state:any, ...args: any[]):any;
remote(state:any, ...args: any[]):Promise<S>;
shouldFetch?(fetchFn:(...args:Array<any>) => boolean):void;
loading?:(args:any) => void;
success?:(state:S) => void;
+1 -1
View File
@@ -1,7 +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
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module "amazon-product-api" {
+100 -70
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;
@@ -26,17 +26,33 @@ declare module AmCharts {
/** Clears all the charts on page, removes listeners and intervals. */
function clear();
/** Handle ready event */
function ready(Function): void;
/** Create chart by params. */
function makeChart(selector: string, params: any, delay?: number): AmChart;
/** Set a method to be called before initializing the chart.
* When the method is called, the chart instance is passed as an attribute.
* You can use this feature to preprocess chart data or do some other things you need
* before initializing the chart.
* @param {Function} handler - The method to be called.
* @param {string[]} types - Which chart types should call this method. Defaults to all
* if none is passed.
*/
function addInitHandler(handler: Function, types: string[]);
/** 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 +129,7 @@ declare module AmCharts {
outlineAlpha: number;
/** Pie outline color. #FFFFFF */
outlineColor: string;
/** Pie outline thickness.
/** Pie outline thickness.
@default 1
*/
outlineThickness: number;
@@ -187,19 +203,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 +222,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 +230,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 +265,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 +279,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 +295,7 @@ declare module AmCharts {
var chartScrollbar = new AmCharts.ChartScrollbar();
chartScrollbar.hideResizeGrips = false;
chart.addChartScrollbar(chartScrollbar);
chart.write("chartdiv);
*/
class AmXYChart extends AmRectangularChart {
@@ -368,7 +371,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 +385,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 +395,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 +592,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 +806,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 graph’s 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 +948,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,10 +960,14 @@ 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;
/** Allows changing language easily.
* Note, you should include the language.js file from amcharts/lang or ammap/lang folder and then use variable name used in this file, like chart.language = "de";
* Note, for maps this works differently - you use language only for country names, as there are no other strings in the maps application. */
language: string;
/** Legend of a chart. */
legend: AmLegend;
/** Reference to the div of the legend. */
@@ -966,28 +977,30 @@ 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 won’t 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"}] */
prefixesOfBigNumbers: any[];
/** Prefixes which are used to make small numbers shorter: 2μ instead of 0.000002, etc. Prefixes are used on value axes and in the legend. To enable prefixes, set usePrefixes property to true. [{number:1e-24, prefix:"y"},{number:1e-21, prefix:"z"},{number:1e-18, prefix:"a"},{number:1e-15, prefix:"f"},{number:1e-12, prefix:"p"},{number:1e-9, prefix:"n"},{number:1e-6, prefix:"μ"},{number:1e-3, prefix:"m"}] */
prefixesOfSmallNumbers: any[];
/** A config object for Responsive plugin. */
responsive: 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;
@@ -1012,7 +1025,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
bold - specifies if text is bold (true/false),
url - url
*/
addLabel(x: number, y: number, text: string, align: string, size: number, color: string, rotation: number, alpha: number, bold: boolean, url: string);
addLabel(x: number|string, y: number|string, text: string, align: string, size?: number, color?: string, rotation?: number, alpha?: number, bold?: boolean, url?: string);
/** 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.)
@@ -1115,7 +1128,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 +1216,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 +1252,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 +1266,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 +1282,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 +1358,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 +1374,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 +1389,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 +1401,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 +1444,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 +1456,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 +1496,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 +1512,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 +1569,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 +1611,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 +1860,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 +2186,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 +2461,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 +2540,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 +2564,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 +2585,4 @@ Your function should return string.*/
libs: Object;
menu: Object;
}
}
}
+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,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" />
+87
View File
@@ -0,0 +1,87 @@
// Tests for Amplitude SDK TypeScript definitions
/// <reference path="amplitude-js.d.ts" />
module Amplitude.Tests {
function all() {
amplitude.init('YOUR_API_KEY_HERE', null, {
// optional configuration options
saveEvents: true,
includeUtm: true,
includeReferrer: true,
batchEvents: true,
eventUploadThreshold: 50
});
amplitude.init('YOUR_API_KEY_HERE', 'USER_ID_HERE', null, () => {});
amplitude.logEvent('EVENT_IDENTIFIER_HERE');
amplitude.setUserId('USER_ID_HERE');
amplitude.init('YOUR_API_KEY_HERE', 'USER_ID_HERE');
amplitude.setUserId(null); // not string 'null'
amplitude.setVersionName('VERSION_NAME_HERE');
amplitude.regenerateDeviceId();
amplitude.setDeviceId('CUSTOM_DEVICE_ID');
amplitude.logEvent('EVENT_IDENTIFIER_HERE', {
'color': 'blue',
'age': 20,
'key': 'value'
});
amplitude.logEvent("EVENT_IDENTIFIER_HERE", null, (httpCode, response) => { });
let identify = new amplitude.Identify().set('gender', 'female').set('age', 20);
amplitude.identify(identify);
identify = new amplitude.Identify().setOnce('sign_up_date', '08/24/2015');
amplitude.identify(identify);
identify = new amplitude.Identify().setOnce('sign_up_date', '09/14/2015');
amplitude.identify(identify);
identify = new amplitude.Identify().unset('gender').unset('age');
amplitude.identify(identify);
identify = new amplitude.Identify().add('karma', 1).add('friends', 1);
amplitude.identify(identify);
identify = new amplitude.Identify().append('ab-tests', 'new-user-test').append('some_list', [1, 2, 3, 4, 'values']);
amplitude.identify(identify);
identify = new amplitude.Identify().prepend('ab-tests', 'new-user-test').prepend('some_list', [1, 2, 3, 4, 'values']);
amplitude.identify(identify);
identify = new amplitude.Identify()
.set('karma', 10)
.add('karma', 1)
.unset('karma');
amplitude.identify(identify);
identify = new amplitude.Identify()
.set('colors', ['rose', 'gold'])
.append('ab-tests', 'campaign_a')
.append('existing_list', [4, 5]);
amplitude.identify(identify);
amplitude.setUserProperties({
gender: 'female',
age: 20
});
amplitude.clearUserProperties();
amplitude.setOptOut(true);
amplitude.setOptOut(false);
amplitude.setGroup('orgId', '15');
amplitude.setGroup('sport', ['soccer', 'tennis']);
// TODO: Implement those.
/*
var revenue = new amplitude.Revenue().setProductId('com.company.productId').setPrice(3.99).setQuantity(3);
amplitude.logRevenueV2(revenue);
amplitude.logEventWithGroups('initialize_game', { 'key': 'value' }, { 'sport': 'soccer' });
*/
}
}
+61
View File
@@ -0,0 +1,61 @@
// Type definitions for Amplitude SDK 2.12.1
// Project: https://github.com/amplitude/Amplitude-Javascript
// Definitions by: Arvydas Sidorenko <https://github.com/Asido>
// Definitions: https://github.com/Asido/DefinitelyTyped
declare module amplitude {
interface Config {
batchEvents?: boolean;
cookieExpiration?: number;
cookieName?: string;
deviceId?: string;
domain?: string;
eventUploadPeriodMillis?: number;
eventUploadThreshold?: number;
includeReferrer?: boolean;
includeUtm?: boolean;
language?: string;
optOut?: boolean;
platform?: string;
saveEvents?: boolean;
savedMaxCount?: number;
sessionTimeout?: number;
uploadBatchSize?: number;
}
export class Identify {
set(key: string, value: any): Identify;
setOnce(key: string, value: any): Identify;
add(key: string, value: number): Identify;
append(key: string, value: any): Identify;
prepend(key: string, value: any): Identify;
unset(key: string): Identify;
}
export function init(apiKey: string): void;
export function init(apiKey: string, userId: string): void;
export function init(apiKey: string, userId: string, options: Config): void;
export function init(apiKey: string, userId: string, options: Config, callback: () => void): void;
export function setVersionName(version: string): void;
export function setUserId(userId: string): void;
export function setDeviceId(id: string): void;
export function regenerateDeviceId(): void;
export function identify(identify: Identify): void;
export function setUserProperties(properties: Object): void;
export function clearUserProperties(): void;
export function setOptOut(optOut: boolean): void;
export function setGroup(groupType: string, groupName: string | string[]): void;
export function logEvent(event: string): void;
export function logEvent(event: string, data: Object): void;
export function logEvent(event: string, data: Object, callback: (httpCode: number, response: any) => void): void;
export var options: Config;
}
+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" />
+3 -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;
+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 {
/**
+3 -3
View File
@@ -1,7 +1,7 @@
// 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" />
@@ -10,7 +10,7 @@ declare module "angular-dynamic-locale" {
export = ng;
}
declare module angular.dynamicLocale {
declare namespace angular.dynamicLocale {
interface tmhDynamicLocaleService {
set(locale: string): void;
@@ -23,4 +23,4 @@ declare module angular.dynamicLocale {
useStorage(storageName: string): void;
useCookieStorage(): void;
}
}
}
+6 -1
View File
@@ -3,7 +3,7 @@
// Definitions by: Matt Wheatley <https://github.com/terrawheat>
// Definitions: https://github.com/LiberisLabs
declare module angular.environment {
declare namespace angular.environment {
interface ServiceProvider {
/**
* Sets the configuration object
@@ -14,6 +14,11 @@ declare module angular.environment {
* loads the correct environment variables.
*/
check: () => void;
/**
* Retrieves the correct version of a
* variable for the current environment.
*/
read: (key: string) => any;
}
interface Service {
/**
+157
View File
@@ -0,0 +1,157 @@
/// <reference path="./angular-es.d.ts" />
//
// @Component
//
import { Component } from 'angular-es';
@Component({
selector: '',
template: ''
})
class MyComponentController {
}
//
// @Config
//
import { Config } from 'angular-es';
@Config()
class MyConfig {
}
//
// @Constant
//
import { Constant } from 'angular-es';
@Constant('MyConstant')
class MyConstant {
foo = 'foo';
bar = 'bar';
}
//
// @Controller
//
import { Controller } from 'angular-es';
@Controller('MyController')
class MyController {
}
//
// @Decorator
//
import { Decorator } from 'angular-es';
@Decorator('MyServiceDecorator')
class MyServiceDecorator {
}
//
// @Directive
//
import { Directive } from 'angular-es';
@Directive('MyDirective')
class MyDirective {
}
//
// @Factory
//
import { Factory } from 'angular-es';
@Factory('MyFactory')
class MyFactory {
}
//
// @Filter
//
import { Filter } from 'angular-es';
@Filter('MyFilter')
class MyFilter {
}
//
// @Inject
//
import { Inject } from 'angular-es';
@Inject('fooBar')
class MyFooService {
@Inject('bazBar')
myMethod(bazBar: Object) {
}
constructor(fooBar: Object) {
}
}
//
// @InjectAsProperty
//
import { InjectAsProperty } from 'angular-es';
@InjectAsProperty('fooBar')
class MyFooBarService {
fooBar: Object;
myMethod() {
this.fooBar !== undefined;
}
}
//
// @Module
//
import { Module } from 'angular-es';
@Module('my.module')
@Service('MyModuleService')
class MyModuleService {
}
//
// @Provider
//
import { Provider } from 'angular-es';
@Provider('MyProvider')
class MyProvider {
}
//
// @Run
//
import { Run } from 'angular-es';
@Run()
class MyRunBlock {
}
//
// @Service
//
import { Service } from 'angular-es';
@Service('MyService')
class MyService {
}
//
// @Value
//
import { Value } from 'angular-es';
@Value('MyValue')
class MyValue {
}
+187
View File
@@ -0,0 +1,187 @@
// Type definitions for angular-es v0.0.3
// Project: https://github.com/mbutsykin/angular-es
// Definitions by: mbutsykin <https://github.com/mbutsykin/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module 'angular-es' {
interface ClassDecorator {
<TFunction extends Function>(target: TFunction): TFunction|void;
}
interface MethodDecorator {
<T>(target: Object, propertyKey: string|symbol, descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T>|void;
}
/**
* Decorated target
*/
interface ngESDecorator extends ClassDecorator, MethodDecorator {
(target: Object|Function,
ngName?: string,
ngArguments?: Array<any>,
ngType?: string,
injectAsProperty?: Array<string>): void;
}
/**
* Component interface
* @see https://docs.angularjs.org/guide/component
*/
interface iComponent {
template: string,
selector: string,
controllerAs?: string,
require?: string,
templateUrl?: string,
transclude?: string,
bindings?: Object
}
/**
* Register component
*
* @param {Object<iComponent>} component - component config
*
* @returns {ngESDecorator} - decorated class
*/
function Component(component: iComponent): ngESDecorator;
/**
* Register config block
*/
function Config(): ngESDecorator;
/**
* Register constant
*
* @param {string} name - constant name
*
* @returns {ngESDecorator} - decorated class
*/
function Constant(name: string): ngESDecorator;
/**
* Register controller
*
* @param {string} name - controller name
*
* @returns {ngESDecorator} - decorated class
*/
function Controller(name: string): ngESDecorator;
/**
* Register decorator
*
* @param {string} name - provider name to decorate
*
* @returns {ngESDecorator} - decorated class
*/
function Decorator(name: string): ngESDecorator;
/**
* Register directive
*
* @param {string} name - directive selector, can be in hyphen-case
*
* @returns {ngESDecorator} - decorated class
*/
function Directive(name: string): ngESDecorator;
/**
* Register factory
*
* @param {string} name - factory name
*
* @returns {ngESDecorator} - decorated class
*/
function Factory(name: string): ngESDecorator;
/**
* Register filter
*
* @param {string} name - filter name
*
* @returns {ngESDecorator} - decorated class
*/
function Filter(name: string): ngESDecorator;
/**
* Add $inject property to target
*
* @param {Array<string>} dependencies - dependencies to inject
*
* @returns {ngESDecorator} - decorated class
*/
function Inject(...dependencies: Array<string>): ngESDecorator;
/**
* Inject dependencies as properties to target
*
* @param {Array<string>} dependencies - dependencies to inject
*
* @returns {ngESDecorator} - decorated class
*/
function InjectAsProperty(...dependencies: Array<string>): ngESDecorator;
/**
* Attach target to the specified module
*
* @param {string} name - module name
*
* @returns {ngESDecorator} - decorated class
*/
function Module(name: string): ngESDecorator;
/**
* Register provider
*
* @param {string} name - provider name
*
* @returns {ngESDecorator} - decorated class
*/
function Provider(name: string): ngESDecorator;
/**
* Register run block
*
* @returns {ngESDecorator} - decorated class
*/
function Run(): ngESDecorator;
/**
* Register service
*
* @param {string} name - service name
*
* @returns {ngESDecorator} - decorated class
*/
function Service(name: string): ngESDecorator;
/**
* Register value
*
* @param {string} name - value name
*
* @returns {ngESDecorator} - decorated class
*/
function Value(name: string): ngESDecorator;
export {
Component,
Config,
Constant,
Controller,
Decorator,
Directive,
Factory,
Filter,
Inject,
InjectAsProperty,
Module,
Provider,
Run,
Service,
Value,
}
}
+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 -14
View File
@@ -14,30 +14,36 @@ declare module 'angular-formly' {
export = angularFormlyDefaultExport;
}
declare module AngularFormly {
declare namespace AngularFormly {
interface IFieldArray extends Array<IFieldConfigurationObject | IFieldGroup> {
interface IFieldArray extends Array<IFieldConfigurationObject | IFieldGroup> {
}
}
interface IFieldGroup {
data?: Object;
data?: {
[key: string]: any;
};
className?: string;
elementAttributes?: string;
fieldGroup?: IFieldArray;
fieldGroup?: IFieldArray;
form?: Object;
hide?: boolean;
hideExpression?: string | IExpressionFunction;
key?: string | number;
model?: string | Object;
options?: IFormOptionsAPI;
templateOptions?: ITemplateOptions;
wrapper?: string | string[];
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;
@@ -177,7 +183,9 @@ declare module AngularFormly {
*
* see http://docs.angular-formly.com/docs/field-configuration-object#data-object
*/
data?: Object;
data?: {
[key: string]: any;
};
/**
@@ -281,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;
};
/**
@@ -536,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;
@@ -604,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");
};
});
}
}
+6 -6
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,12 +51,12 @@ 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 scope. 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.
* The scope parameter is optional: pass null (or don't pass anything) if you're not using it: this skips interpolation and is a lot faster.
*/
getString(string: string, context?: any): string;
getString(string: string, scope?: any, context?: string): string;
/** Translate a plural string with the given context. */
getPlural(n: number, string: string, stringPlural: string, context?: any): string;
@@ -1,9 +1,9 @@
// 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/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module angular.google.analytics {
declare namespace angular.google.analytics {
interface AnalyticsService {
/**
* @summary If logging is enabled then all outbound calls are accessible via an in-memory array.
+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
+3 -3
View File
@@ -1,11 +1,11 @@
// 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
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
declare module angular.growl {
declare namespace angular.growl {
/**
* Global Time-To-Leave configuration.
@@ -39,7 +39,7 @@ declare module angular.growl {
*/
interface IGrowlMessage extends IGrowlMessageConfig {
text: string;
/**
* Destroy the message.
*/
+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;
}
}
}
+46 -46
View File
@@ -1,98 +1,98 @@
// 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 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.
*
* 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.
*
* 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.
*/
@@ -105,19 +105,19 @@ declare module angular.idle {
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 IRequestConfig, default is null.
*/
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 10 minutes. Must be greater than 0.
*/
interval(seconds: number): void;
@@ -126,7 +126,7 @@ declare module angular.idle {
/**
* 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
* 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 {
@@ -145,7 +145,7 @@ 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.
@@ -158,26 +158,26 @@ declare module angular.idle {
*/
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'
*/
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
*/
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
*/
timeout(seconds: number): void;
@@ -187,14 +187,14 @@ declare module angular.idle {
* 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 | string): void;
/**
* When true, the Keepalive service is automatically stopped and started as needed.
*
*
* @param enabled boolean, default is true
*/
keepalive(enabled: boolean): void;
@@ -202,9 +202,9 @@ declare module angular.idle {
/**
* 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
* 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 {
@@ -219,13 +219,13 @@ declare module angular.idle {
getTimeout(): number;
/**
* Updates the idle value (see IdleProvider.idle()) and
* 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
* Updates the timeout value (see IdleProvider.timeout()) and
* restarts the watch if its running.
*/
setTimeout(timeout: number): void;
@@ -234,7 +234,7 @@ declare module angular.idle {
* 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.
*/
+17 -2
View File
@@ -3,15 +3,30 @@
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;
}
var authManager: ng.jwt.IAuthManagerServiceProvider;
// Indicate the user is authenticated
authManager.authenticate();
// Indicate the user is unauthenticated
authManager.unauthenticate();
// Keep the user authenticated
authManager.checkAuthOnRefresh();
// Redirect the user on unauthorized requests
authManager.redirectWhenUnauthenticated();
+17 -10
View File
@@ -1,21 +1,21 @@
// Type definitions for angular-jwt 0.0.8
// Project: https://github.com/auth0/angular-jwt
// Definitions by: Reto Rezzonico <https://github.com/rerezz>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
declare module angular.jwt {
declare namespace angular.jwt {
interface JwtToken {
iss: string;
sub: string;
aud: string;
exp: number;
nbf: number;
iat: number;
jti: string;
unique_name: string;
iss?: string;
sub?: string;
aud?: string;
exp?: number;
nbf?: number;
iat?: number;
jti?: string;
unique_name?: string;
}
interface IJwtHelper {
@@ -27,4 +27,11 @@ declare module angular.jwt {
interface IJwtInterceptor {
tokenGetter(...params : any[]): string;
}
interface IAuthManagerServiceProvider {
authenticate(): void;
unauthenticate(): void;
checkAuthOnRefresh(): void;
redirectWhenUnauthenticated(): void;
}
}
+12
View File
@@ -0,0 +1,12 @@
/// <reference path="./angular-load.d.ts" />
angular.module('app',['angularLoad'])
.run(['angularLoad',(angularLoad:angular.load.IAngularLoadService)=> {
angularLoad.loadScript("https://ajax.googleapis.com/ajax/libs/angular_material/1.0.4/angular-material.min.js").then(
()=>console.log("angular material js loaded")
);
angularLoad.loadCSS("https://ajax.googleapis.com/ajax/libs/angular_material/1.0.4/angular-material.css").then(
()=>console.log("angular material css loaded")
);
}]);
+15
View File
@@ -0,0 +1,15 @@
// Type definitions for angular-load v0.4.1
// Project: https://github.com/urish/angular-load
// Definitions by: david-gang <https://github.com/david-gang>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
declare namespace angular.load {
interface IAngularLoadService {
loadScript(url:string): ng.IPromise<any>;
loadCSS(url:string): ng.IPromise<any>;
}
}
+4 -4
View File
@@ -1,12 +1,12 @@
// Type definitions for angular-loading-bar
// Project: https://github.com/chieffancypants/angular-loading-bar
// 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 {
declare namespace angular {
interface IRequestShortcutConfig {
/**
@@ -16,8 +16,8 @@ declare module angular {
}
}
declare module angular.loadingBar {
declare namespace angular.loadingBar {
interface ILoadingBarProvider{
/**
* Turn the spinner on or off
+11 -2
View File
@@ -1,11 +1,11 @@
// Type definitions for angular-local-storage v0.1.5
// Project: https://github.com/grevory/angular-local-storage
// Definitions by: Ken Fukuyama <https://github.com/kenfdev>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path='../angularjs/angular.d.ts' />
declare module angular.local.storage {
declare namespace angular.local.storage {
interface ILocalStorageServiceProvider extends angular.IServiceProvider {
/**
* Setter for the prefix
@@ -56,6 +56,15 @@ declare module angular.local.storage {
* @param val
*/
set(key:string, val:string):boolean;
/**
* Directly adds a value to cookies with an expiration.
* Note: Typically used as a fallback if local storage is not supported.
* Returns: Boolean
* @param key
* @param val
* @param daysToExpiry
*/
set(key:string, val:string, daysToExpiry:number):boolean;
/**
* Directly get a value from a cookie.
* Returns: value from local storage
+2 -2
View File
@@ -1,12 +1,12 @@
// Type definitions for angular-localForage 1.2.2
// Project: https://github.com/ocombe/angular-localForage
// Definitions by: Stefan Steinhart <https://github.com/reppners>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../localForage/localForage.d.ts" />
/// <reference path="../angularjs/angular.d.ts" />
declare module angular.localForage {
declare namespace angular.localForage {
interface LocalForageConfig {
driver?:string;
+5 -5
View File
@@ -1,7 +1,7 @@
// Type definitions for Angular Locker v2.0.3
// Project: https://github.com/tymondesigns/angular-locker
// Definitions by: Niko Kovačič <https://github.com/nkovacic>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
@@ -10,7 +10,7 @@ declare module "angular-locker" {
export = _;
}
declare module angular.locker {
declare namespace angular.locker {
interface ILockerServicePutFunction {
(current: any): any
}
@@ -69,7 +69,7 @@ declare module angular.locker {
* Add a new item to storage (even if it already exists)
*
* @param {Mixed} key The key to add
* @param {Mixed} value The value to add
* @param {Mixed} value The value to add
*/
put(key: string, value: any): ILockerService | boolean;
/**
@@ -77,7 +77,7 @@ declare module angular.locker {
*
* @param {Mixed} key The key to add
* @param {Mixed} putFunction The default to pass to function if doesn't already exist
* @param {Mixed} value The value to add
* @param {Mixed} value The value to add
*/
put(key: string, putFunction: ILockerServicePutFunction, value: any): ILockerService | boolean;
/**
@@ -167,4 +167,4 @@ declare module angular.locker {
*/
defaults(lockerSettings: ILockerSettings): void;
}
}
}
+2 -2
View File
@@ -1,10 +1,10 @@
// Type definitions for Angular Material 0.8.3+ (angular.material module)
// Project: https://github.com/angular/material
// Definitions by: Matt Traynham <https://github.com/mtraynham>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
declare module angular.material {
declare namespace angular.material {
interface MDBottomSheetOptions {
templateUrl?: string;
+2 -2
View File
@@ -1,10 +1,10 @@
// Type definitions for Angular Material 0.9.0-rc1+ (angular.material module)
// Project: https://github.com/angular/material
// Definitions by: Matt Traynham <https://github.com/mtraynham>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
declare module angular.material {
declare namespace angular.material {
interface MDBottomSheetOptions {
templateUrl?: string;
+98 -1
View File
@@ -30,7 +30,11 @@ myApp.config((
myApp.controller('BottomSheetController', ($scope: ng.IScope, $mdBottomSheet: ng.material.IBottomSheetService) => {
$scope['openBottomSheet'] = () => {
$mdBottomSheet.show({
template: '<md-bottom-sheet>Hello!</md-bottom-sheet>'
template: '<md-bottom-sheet>Hello!</md-bottom-sheet>',
clickOutsideToClose: true,
disableBackdrop: true,
disableParentScroll: false,
parent: () => {}
});
};
$scope['hideBottomSheet'] = $mdBottomSheet.hide.bind($mdBottomSheet, 'hide');
@@ -55,6 +59,28 @@ myApp.controller('DialogController', ($scope: ng.IScope, $mdDialog: ng.material.
$scope['confirmDialog'] = () => {
$mdDialog.show($mdDialog.confirm().htmlContent('<span>Confirm!</span>'));
};
$scope['promptDialog'] = () => {
$mdDialog.show($mdDialog.prompt().textContent('Prompt!'));
};
$scope['promptDialog'] = () => {
$mdDialog.show($mdDialog.prompt().htmlContent('<span>Prompt!</span>'));
};
$scope['promptDialog'] = () => {
$mdDialog.show($mdDialog.prompt().cancel('Prompt "Cancel" button text'));
};
$scope['promptDialog'] = () => {
$mdDialog.show($mdDialog.prompt().placeholder('Prompt input placeholder text'));
};
$scope['promptDialog'] = () => {
$mdDialog.show($mdDialog.prompt().initialValue('Buddy'));
};
$scope['prerenderedDialog'] = () => {
$mdDialog.show({
template: '<md-dialog>Hello!</md-dialog>',
contentElement: '#myDialog',
clickOutsideToClose: true
});
};
$scope['hideDialog'] = $mdDialog.hide.bind($mdDialog, 'hide');
$scope['cancelDialog'] = $mdDialog.cancel.bind($mdDialog, 'cancel');
});
@@ -93,8 +119,79 @@ myApp.controller('SidenavController', ($scope: ng.IScope, $mdSidenav: ng.materia
$scope['close'] = () => $mdSidenav(componentId).close();
$scope['isOpen'] = $mdSidenav(componentId).isOpen();
$scope['isLockedOpen'] = $mdSidenav(componentId).isLockedOpen();
$scope['asyncLookup'] = $mdSidenav(componentId, true).then((instance) => {
instance.toggle();
instance.open();
instance.close();
instance.isOpen();
instance.isLockedOpen();
});
$scope['onClose'] = $mdSidenav(componentId).onClose(() => {});
});
myApp.controller('ToastController', ($scope: ng.IScope, $mdToast: ng.material.IToastService) => {
$scope['openToast'] = () => $mdToast.show($mdToast.simple().textContent('Hello!'));
$scope['customToast'] = () => {
var options = {
hideDelay: 3000,
position: 'top right',
controller : 'ToastCtrl',
templateUrl : 'toast-template.html',
toastClass: 'my-class'
};
$mdToast.show(options);
}
});
myApp.controller('PanelController', ($scope: ng.IScope, $mdPanel: ng.material.IPanelService) => {
$scope['createPanel'] = () => {
var config = {
id: 'myPanel',
template: '<h1>Hello!</h1>',
hasBackdrop: true,
disableParentScroll: true,
zIndex: 150
};
$mdPanel.create(config);
var panelRef = $mdPanel.create(config);
panelRef.open()
.then((ref: ng.material.IPanelRef) => {
ref.addClass('foo');
ref.removeClass('bar');
ref.close();
})
.finally(() => {
panelRef = undefined;
});
};
$scope['openPanel'] = () => {
$mdPanel.open({
template: '<h1>Hello!</h1>',
hasBackdrop: true,
disableParentScroll: true,
zIndex: 150
})
.then((panelRef: ng.material.IPanelRef) => {
panelRef.addClass('foo');
panelRef.removeClass('bar');
panelRef.close();
});
};
$scope['newPanelPosition'] = () => {
$mdPanel.newPanelPosition().absolute().center();
$mdPanel.newPanelPosition().relativeTo('.demo-menu-open-button').addPanelPosition("ALIGN_START", "BELOW");
};
$scope['newPanelAnimation'] = () => {
$mdPanel.newPanelAnimation().openFrom('.some-target');
$mdPanel.newPanelAnimation().openFrom({top: 0, left: 0});
};
});
+152 -14
View File
@@ -1,10 +1,16 @@
// Type definitions for Angular Material 1.0.0-rc5+ (angular.material module)
// Type definitions for Angular Material 1.1.0-rc5+ (angular.material module)
// Project: https://github.com/angular/material
// Definitions by: Matt Traynham <https://github.com/mtraynham>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions by: Alex Staroselsky <https://github.com/AlStar01>, Blake Bigelow <https://github.com/blbigelow>, Peter Hajdu <https://github.com/PeterHajdu>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
declare module angular.material {
declare module 'angular-material' {
   var _: string;
  export = _;
}
declare namespace angular.material {
interface IBottomSheetOptions {
templateUrl?: string;
@@ -13,11 +19,12 @@ declare module angular.material {
preserveScope?: boolean; // default: false
controller?: string|Function;
locals?: {[index: string]: any};
targetEvent?: MouseEvent;
resolve?: {[index: string]: angular.IPromise<any>}
clickOutsideToClose?: boolean;
disableBackdrop?: boolean;
escapeToClose?: boolean;
resolve?: {[index: string]: () => angular.IPromise<any>};
controllerAs?: string;
bindToController?: boolean;
parent?: string|Element|JQuery; // default: root node
parent?: Function|string|Object; // default: root node
disableParentScroll?: boolean; // default: true
}
@@ -46,7 +53,7 @@ declare module angular.material {
controller(controller?: string|Function): T;
locals(locals?: {[index: string]: any}): T;
bindToController(bindToController?: boolean): T; // default: false
resolve(resolve?: {[index: string]: angular.IPromise<any>}): T;
resolve(resolve?: {[index: string]: () => angular.IPromise<any>}): T;
controllerAs(controllerAs?: string): T;
parent(parent?: string|Element|JQuery): T; // default: root node
onComplete(onComplete?: Function): T;
@@ -60,9 +67,16 @@ declare module angular.material {
cancel(cancel: string): IConfirmDialog;
}
interface IPromptDialog extends IPresetDialog<IPromptDialog> {
cancel(cancel: string): IPromptDialog;
placeholder(placeholder: string): IPromptDialog;
initialValue(initialValue: string): IPromptDialog;
}
interface IDialogOptions {
templateUrl?: string;
template?: string;
contentElement?: string|Element;
autoWrap?: boolean; // default: true
targetEvent?: MouseEvent;
openFrom?: any;
@@ -70,26 +84,28 @@ declare module angular.material {
scope?: angular.IScope; // default: new child scope
preserveScope?: boolean; // default: false
disableParentScroll?: boolean; // default: true
hasBackdrop?: boolean // default: true
hasBackdrop?: boolean; // default: true
clickOutsideToClose?: boolean; // default: false
escapeToClose?: boolean; // default: true
focusOnOpen?: boolean; // default: true
controller?: string|Function;
locals?: {[index: string]: any};
bindToController?: boolean; // default: false
resolve?: {[index: string]: angular.IPromise<any>}
resolve?: {[index: string]: () => angular.IPromise<any>}
controllerAs?: string;
parent?: string|Element|JQuery; // default: root node
onShowing?: Function;
onComplete?: Function;
onRemoving?: Function;
fullscreen?: boolean;
skipHide?: boolean;
fullscreen?: boolean; // default: false
}
interface IDialogService {
show(dialog: IDialogOptions|IAlertDialog|IConfirmDialog): angular.IPromise<any>;
show(dialog: IDialogOptions|IAlertDialog|IConfirmDialog|IPromptDialog): angular.IPromise<any>;
confirm(): IConfirmDialog;
alert(): IAlertDialog;
prompt(): IPromptDialog;
hide(response?: any): angular.IPromise<any>;
cancel(response?: any): void;
}
@@ -116,9 +132,11 @@ declare module angular.material {
close(): angular.IPromise<void>;
isOpen(): boolean;
isLockedOpen(): boolean;
onClose(onClose: Function): void;
}
interface ISidenavService {
(component: string, enableWait: boolean): angular.IPromise<ISidenavObject>;
(component: string): ISidenavObject;
}
@@ -126,6 +144,7 @@ declare module angular.material {
textContent(content: string): T;
action(action: string): T;
highlightAction(highlightAction: boolean): T;
highlightClass(highlightClass: string): T;
capsule(capsule: boolean): T;
theme(theme: string): T;
hideDelay(delay: number): T;
@@ -139,14 +158,16 @@ declare module angular.material {
interface IToastOptions {
templateUrl?: string;
template?: string;
autoWrap?:boolean;
scope?: angular.IScope; // default: new child scope
preserveScope?: boolean; // default: false
hideDelay?: number; // default (ms): 3000
position?: string; // any combination of 'bottom'/'left'/'top'/'right'/'fit'; default: 'bottom left'
toastClass?: string;
controller?: string|Function;
locals?: {[index: string]: any};
bindToController?: boolean; // default: false
resolve?: {[index: string]: angular.IPromise<any>}
resolve?: {[index: string]: () => angular.IPromise<any>}
controllerAs?: string;
parent?: string|Element|JQuery; // default: root node
}
@@ -228,6 +249,7 @@ declare module angular.material {
extendPalette(name: string, palette: IPalette): IPalette;
setDefaultTheme(theme: string): void;
alwaysWatchTheme(alwaysWatch: boolean): void;
setNonce(nonce: string): void;
}
interface IDateLocaleProvider {
@@ -248,4 +270,120 @@ declare module angular.material {
interface IMenuService {
hide(response?: any, options?: any): angular.IPromise<any>;
}
interface IColorPalette {
red: IPalette;
pink: IPalette;
'deep-purple': IPalette;
indigo: IPalette;
blue: IPalette;
'light-blue': IPalette;
cyan: IPalette;
teal: IPalette;
green: IPalette;
'light-green': IPalette;
lime: IPalette;
yellow: IPalette;
amber: IPalette;
orange: IPalette;
'deep-orange': IPalette;
brown: IPalette;
grey: IPalette;
'blue-grey': IPalette;
}
interface IPanelConfig {
id?: string;
template?: string;
templateUrl?: string;
controller?: string|Function;
controllerAs?: string;
bindToController?: boolean; // default: true
locals?: {[index: string]: any};
resolve?: {[index: string]: () => angular.IPromise<any>}
attachTo?: string|JQuery|Element;
propagateContainerEvents?: boolean;
panelClass?: string;
zIndex?: number; // default: 80
position?: IPanelPosition;
clickOutsideToClose?: boolean; // default: false
escapeToClose?: boolean; // default: false
trapFocus?: boolean; // default: false
focusOnOpen?: boolean; // default: true
fullscreen?: boolean; // default: false
animation?: IPanelAnimation;
hasBackdrop?: boolean; // default: false
disableParentScroll?: boolean; // default: false
onDomAdded?: Function;
onOpenComplete?: Function;
onRemoving?: Function;
onDomRemoved?: Function;
origin?: string|JQuery|Element;
}
interface IPanelRef {
id: string;
config: IPanelConfig;
isAttached: boolean;
open(): angular.IPromise<any>;
close(): angular.IPromise<any>;
attach(): angular.IPromise<any>;
detach(): angular.IPromise<any>;
show(): angular.IPromise<any>;
hide(): angular.IPromise<any>;
destroy(): void;
addClass(newClass: string): void;
removeClass(oldClass: string): void;
toggleClass(toggleClass: string): void;
updatePosition(position: IPanelPosition): void;
}
interface IPanelPosition {
absolute(): IPanelPosition;
relativeTo(someElement: string|JQuery|Element): IPanelPosition;
top(top?: string): IPanelPosition; // default: '0'
bottom(bottom?: string): IPanelPosition; // default: '0'
start(start?: string): IPanelPosition; // default: '0'
end(end?: string): IPanelPosition; // default: '0'
left(left?: string): IPanelPosition; // default: '0'
right(right?: string): IPanelPosition; // default: '0'
centerHorizontally(): IPanelPosition;
centerVertically(): IPanelPosition;
center(): IPanelPosition;
addPanelPosition(xPosition: string, yPosition: string): IPanelPosition;
withOffsetX(offsetX: string): IPanelPosition;
withOffsetY(offsetY: string): IPanelPosition;
}
interface IPanelAnimation {
openFrom(from: string|Element|Event|{top: number, left: number}): IPanelAnimation;
closeTo(to: string|Element|{top: number, left: number}): IPanelAnimation;
withAnimation(cssClass: string|{open: string, close: string}): IPanelAnimation;
}
interface IPanelService {
create(opt_config: IPanelConfig): IPanelRef;
open(opt_config: IPanelConfig): angular.IPromise<IPanelRef>;
newPanelPosition(): IPanelPosition;
newPanelAnimation(): IPanelAnimation;
xPosition: {
CENTER: string,
ALIGN_START: string,
ALIGN_END: string,
OFFSET_START: string,
OFFSET_END: string,
};
yPosition: {
CENTER: string,
ALIGN_TOPS: string,
ALIGN_BOTTOMS: string,
ABOVE: string,
BELOW: string,
};
animation: {
SLIDE: string,
SCALE: string,
FADE: string,
};
}
}
@@ -0,0 +1,60 @@
/// <reference path="match-media.d.ts" />
var myApp = angular.module('testModule', ['matchMedia']);
myApp.controller('TestController', ($log: angular.ILogService,
$scope: angular.IScope,
screenSize: angular.matchmedia.IScreenSize) => {
var fnCallback = (result: boolean) => {
$log.info(`Result: ${result}`);
}
// '.isRetina' examples
if(screenSize.isRetina) {
$log.info("Retina screen detected")
}
// '.is(...)' examples
var res = screenSize.is(["xs", "sm"]);
fnCallback(res);
res = screenSize.is("xs, lg")
fnCallback(res);
// '.on(...)' examples
res = screenSize.on(["xs", "sm"], fnCallback);
fnCallback(res);
res = screenSize.on("xs, lg", fnCallback);
fnCallback(res);
res = screenSize.on(["xs", "sm"], fnCallback, $scope);
fnCallback(res);
res = screenSize.on("xs, lg", fnCallback, $scope);
fnCallback(res);
// '.onChange(...)' examples
res = screenSize.onChange($scope, ["xs", "sm"], fnCallback);
fnCallback(res);
res = screenSize.onChange($scope, "xs, lg", fnCallback);
fnCallback(res);
// '.when(...)' examples
res = screenSize.when(["xs", "sm"], fnCallback);
fnCallback(res);
res = screenSize.when("xs, lg", fnCallback);
fnCallback(res);
res = screenSize.when(["xs", "sm"], fnCallback, $scope);
fnCallback(res);
res = screenSize.when("xs, lg", fnCallback, $scope);
fnCallback(res);
});
+30
View File
@@ -0,0 +1,30 @@
// Type definitions for Angular matchMedia 0.6.0 (angular.matchMedia module)
// Project: https://github.com/jacopotarantino/angular-match-media
// Definitions by: Joao Monteiro <https://github.com/jpmnteiro>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
declare namespace angular.matchmedia {
interface IScreenSize {
// Returns a value indicating if the current device has a retina screen
isRetina: boolean;
is(list: Array<string> | string): boolean;
// Executes the callback function on window resize with the match truthiness as the first argument.
// Returns the current match truthiness.
// The 'scope' parameter is optional. If it's not passed in, '$rootScope' is used.
on(list: Array<string> | string, callback: (result: boolean) => void, scope?: angular.IScope): boolean;
// Executes the callback function ONLY when the match differs from previous match.
// Returns the current match truthiness.
// The 'scope' parameter is required for cleanup reasons (destroy event).
onChange(scope: angular.IScope, list: Array<string> | string, callback: (result: boolean) => void): boolean;
// Executes the callback only when inside of the particular screensize.
// The 'scope' parameter is optional. If it's not passed in, '$rootScope' is used.
when(list: Array<string> | string, callback: (result: boolean) => void, scope?: angular.IScope): boolean;
}
}
+97 -97
View File
@@ -1,41 +1,41 @@
// Type definitions for Angular JS Meteor v0.8.8 (angular.meteor module)
// Project: https://github.com/Urigo/angular-meteor
// Definitions by: Peter Grman <https://github.com/pgrm>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../meteor/meteor.d.ts" />
/// <reference path="../angularjs/angular.d.ts" />
declare module angular.meteor {
declare namespace angular.meteor {
interface IRootScopeService extends angular.IRootScopeService {
/**
* The current logged in user and it's data. it is null if the user is not logged in. A reactive data source.
*/
currentUser: Meteor.User;
/**
* True if a login method (such as Meteor.loginWithPassword, Meteor.loginWithFacebook, or Accounts.createUser) is currently in progress.
* True if a login method (such as Meteor.loginWithPassword, Meteor.loginWithFacebook, or Accounts.createUser) is currently in progress.
* A reactive data source. Can be use to display animation while user is logging in.
*/
loggingIn: boolean;
}
interface IScope extends angular.IScope, IRootScopeService {
/**
* A method to get a $scope variable and watch it reactivly
*
*
* @param scopeVariableName - The name of the scope's variable to bind to
* @param [objectEquality=false] - Watch the object equality using angular.equals instead of comparing for reference equality, deeper watch but also slower
*/
getReactively(scopeVariableName: string, objectEquality?: boolean): ReactiveResult;
/**
* A service which is a wrapper for Meteor.subscribe. It subscribes to a Meteor.publish method in the client and returns a AngularJS promise when ready.
* Calling $scope.subscribe will automatically stop the subscription when the scope is destroyed.
*
*
* @param name - Name of the subscription. Matches the name of the server's publish() call.
* @param publisherArguments - Optional arguments passed to publisher function on server.
*
*
* @return The promise solved successfully when subscription is ready. The success promise holds the subscription handle.
*/
subscribe(name: string, ...publisherArguments: any[]): angular.IPromise<Meteor.SubscriptionHandle>;
@@ -57,206 +57,206 @@ declare module angular.meteor {
* The autorun method is part of the ReactiveContext, and available on every context and $scope.
* The argument of this method is a callback, which will be called each time Autorun will be used.
* The Autorun will stop automatically when when it's context ($scope) is destroyed.
*
*
* @param runFunc - The function to run. It receives one argument: the Computation object that will be returned.
*/
autorun(runFunc : () => void) : Tracker.Computation;
}
/**
* $meteor in angularjs
*/
interface IMeteorService {
/**
* A service that wraps the Meteor collections to enable reactivity within AngularJS.
*
* @param collection - A Meteor Collection or a reactive function to bind to.
*
* @param collection - A Meteor Collection or a reactive function to bind to.
* - Reactive function can be used with $scope.getReactively to add $scope variable as reactive variable to the cursor.
* @param [autoClientSave=true] - By default, changes in the Angular collection will automatically update the Meteor collection.
* @param [autoClientSave=true] - By default, changes in the Angular collection will automatically update the Meteor collection.
* - However if set to false, changes in the client won't be automatically propagated back to the Meteor collection.
*/
collection<T>(collection: Mongo.Collection<T>|ReactiveResult|Function|(()=>T), autoClientSave?: boolean): AngularMeteorCollection<T>;
/**
* A service that wraps the Meteor collections to enable reactivity within AngularJS.
*
* @param collection - A Meteor Collection or a reactive function to bind to.
*
* @param collection - A Meteor Collection or a reactive function to bind to.
* - Reactive function can be used with $scope.getReactively to add $scope variable as reactive variable to the cursor.
* @param [autoClientSave=true] - By default, changes in the Angular collection will automatically update the Meteor collection.
* @param [autoClientSave=true] - By default, changes in the Angular collection will automatically update the Meteor collection.
* - However if set to false, changes in the client won't be automatically propagated back to the Meteor collection.
* @param [updateCollection] - A collection object which will be used for updates (insert, update, delete).
*/
collection<T, U>(collection: Mongo.Collection<T>|ReactiveResult|Function|(()=>T), autoClientSave: boolean, updateCollection: Mongo.Collection<U>): AngularMeteorCollection2<T, U>;
/**
* A service that wraps a Meteor object to enable reactivity within AngularJS.
* A service that wraps a Meteor object to enable reactivity within AngularJS.
* Finds the first document that matches the selector, as ordered by sort and skip options. Wraps collection.findOne
*
*
* @param collection - A Meteor Collection to bind to.
* @param selector - A query describing the documents to find or just the ID of the document.
* - $meteor.object will find the first document that matches the selector,
* @param selector - A query describing the documents to find or just the ID of the document.
* - $meteor.object will find the first document that matches the selector,
* - as ordered by sort and skip options, exactly like Meteor's collection.findOne
* @param [autoClientSave=true] - By default, changes in the Angular object will automatically update the Meteor object.
* @param [autoClientSave=true] - By default, changes in the Angular object will automatically update the Meteor object.
* - However if set to false, changes in the client won't be automatically propagated back to the Meteor object.
*/
object<T>(collection: Mongo.Collection<T>, selector: Mongo.Selector|Mongo.ObjectID|string, autoClientSave?: boolean): AngularMeteorObject<T>;
/**
* A service which is a wrapper for Meteor.subscribe. It subscribes to a Meteor.publish method in the client and returns a AngularJS promise when ready.
*
*
* @param name - Name of the subscription. Matches the name of the server's publish() call.
* @param publisherArguments - Optional arguments passed to publisher function on server.
*
*
* @return The promise solved successfully when subscription is ready. The success promise holds the subscription handle.
*/
subscribe(name: string, ...publisherArguments: any[]): angular.IPromise<Meteor.SubscriptionHandle>;
/**
* A service service which wraps up Meteor.methods with AngularJS promises.
*
*
* @param name - Name of method to invoke
* @param methodArguments - Optional method arguments
*
*
* @return The promise solves successfully with the return value of the method or return reject with the error from the method.
*/
call<T>(name: string, ...methodArguments: any[]): angular.IPromise<T>;
// User Authentication BEGIN ->
/**
* Returns a promise fulfilled with the currentUser when the user subscription is ready.
* Returns a promise fulfilled with the currentUser when the user subscription is ready.
* This is useful when you want to grab the current user before the route is rendered.
* If there is no logged in user, it will return null.
* If there is no logged in user, it will return null.
* See the “Authentication with Routers” section of our tutorial for more information and a full example.
*/
waitForUser(): angular.IPromise<Meteor.User>;
/**
* Resolves the promise successfully if a user is authenticated and rejects otherwise.
* This is useful in cases where you want to require a route to have an authenticated user.
* You can catch the rejected promise and redirect the unauthenticated user to a different page, such as the login page.
* Resolves the promise successfully if a user is authenticated and rejects otherwise.
* This is useful in cases where you want to require a route to have an authenticated user.
* You can catch the rejected promise and redirect the unauthenticated user to a different page, such as the login page.
* See the “Authentication with Routers” section of our tutorial for more information and a full example.
*/
requireUser(): angular.IPromise<Meteor.User>;
/**
* Resolves the promise successfully if a user is authenticated and the validatorFn returns true; rejects otherwise.
* This is useful in cases where you want to require a route to have an authenticated user and do extra validation like the user's role or group.
* You can catch the rejected promise and redirect the unauthenticated user to a different page, such as the login page.
* Resolves the promise successfully if a user is authenticated and the validatorFn returns true; rejects otherwise.
* This is useful in cases where you want to require a route to have an authenticated user and do extra validation like the user's role or group.
* You can catch the rejected promise and redirect the unauthenticated user to a different page, such as the login page.
* See the “Authentication with Routers” section of our tutorial for more information and a full example.
*
* The mandatory validator function will be called with the authenticated user as the single param and it's expected to return true in order to resolve.
* If it returns a string, the promise will be rejected using said string as the reason.
*
* The mandatory validator function will be called with the authenticated user as the single param and it's expected to return true in order to resolve.
* If it returns a string, the promise will be rejected using said string as the reason.
* Any other return (false, null, undefined) will be rejected with the default "FORBIDDEN" reason.
*/
requireValidUser(validatorFn: (user: Meteor.User) => boolean|string): angular.IPromise<Meteor.User>;
/**
* Log the user in with a password.
*
*
* @param user - Either a string interpreted as a username or an email; or an object with a single key: email, username or id.
* @param password - The user's password.
*/
loginWithPassword(user: string|{email: string}|{username: string}|{id: string}, password: string): angular.IPromise<void>;
/**
* Create a new user. More information: http://docs.meteor.com/#/full/accounts_createuser
*
*
* @param options.username - A unique name for this user. Either this, or email is required.
* @param options.email - The user's email address. Either this, or username is required.
* @param options.password - The user's password. This is not sent in plain text over the wire.
* @param options.profile - The user's profile, typically including the name field.
*/
createUser(options: {username?: string; email?: string; password: string; profile?: Object}): angular.IPromise<void>;
/**
* Change the current user's password. Must be logged in.
*
*
* @param oldPassword - The user's current password. This is not sent in plain text over the wire.
* @param newPassword - A new password for the user. This is not sent in plain text over the wire.
*/
changePassword(oldPassword: string, newPassword: string): angular.IPromise<void>;
/**
* Request a forgot password email.
*
*
* @param options.email - The email address to send a password reset link.
*/
forgotPassword(options: {email: string}): angular.IPromise<void>;
/**
* Reset the password for a user using a token received in email. Logs the user in afterwards.
*
*
* @param token - The token retrieved from the reset password URL.
* @param newPassword - A new password for the user. This is not sent in plain text over the wire.
*/
resetPassword(token: string, newPassword: string): angular.IPromise<void>;
/**
* Marks the user's email address as verified. Logs the user in afterwards.
*
*
* @param token - The token retrieved from the reset password URL.
*/
verifyEmail(token: string): angular.IPromise<void>;
loginWithFacebook: ILoginWithExternalService;
loginWithTwitter: ILoginWithExternalService;
loginWithGoogle: ILoginWithExternalService;
loginWithGithub: ILoginWithExternalService;
loginWithMeetup: ILoginWithExternalService;
loginWithWeibo: ILoginWithExternalService;
/**
* Log the user out.
*
*
* @return Resolves with no arguments on success, or reject with a Error argument on failure.
*/
logout(): angular.IPromise<void>;
/**
* Log out other clients logged in as the current user, but does not log out the client that calls this function.
* For example, when called in a user's browser, connections in that browser remain logged in,
* Log out other clients logged in as the current user, but does not log out the client that calls this function.
* For example, when called in a user's browser, connections in that browser remain logged in,
* but any other browsers or DDP clients logged in as that user will be logged out.
*
*
* @return Resolves with no arguments on success, or reject with a Error argument on failure.
*/
logoutOtherClients(): angular.IPromise<void>;
// <- User Authentication END
// $meteorUtils BEGIN ->
/**
* @param scope - The AngularJS scope you use the autorun on.
* @param fn - The function that will re-run every time a reactive variable changes inside it.
*/
autorun(scope: angular.IScope, fn: Function): void;
/**
* @param collectionName - The name of the collection you want to get back
*/
getCollectionByName<T>(collectionName: string): Mongo.Collection<T>;
// <- $meteorUtils END
// $meteorCamera BEGIN ->
/**
* A helper service for taking pictures across platforms.
* Must add mdg:camera package to use! (meteor add mdg:camera)
*
*
* @param [options] - options is an optional argument that is an Object with the following possible keys:
* @param options.width - An integer that specifies the minimum width of the returned photo.
* @param options.height - An integer that specifies the minimum height of the returned photo.
* @param options.quality - A number from 0 to 100 specifying the desired quality of JPEG encoding.
*
*
* @return The promise solved successfully when the picture is taken with the data as a parameter or rejected with an error as a parameter in case of error.
*/
getPicture(options?: {width?: number; height?: number; quality?: number}): angular.IPromise<any>;
// <- $meteorCamera END
/**
* A service that binds a scope variable to a Meteor Session variable.
*
*
* @param sessionKey - The name of the session variable
* @return An object with a single function bind - to bind to that variable.
*/
@@ -268,34 +268,34 @@ declare module angular.meteor {
bind: (scope: IScope, model: string) => void;
};
}
/**
* An object that connects a Meteor Object to an AngularJS scope variable.
*
* The object contains also all the properties from the generic type T,
*
* The object contains also all the properties from the generic type T,
* unfortunately TypeScript doesn't at the moment allow to extend a generic type (see https://github.com/Microsoft/TypeScript/issues/2225 for details and updates).
* For a workaround, you'll need to implement an interface which will merge AngularMeteorObject<T> together with T and cast it, like this:
*
*
* interface TodoAngularMeteorObject extends ITodo, AngularMeteorObject<ITodo> { }
* var todo = <TodoAngularMeteorObject>$meteor.object(TodoCollection, 'TodoID');
*/
interface AngularMeteorObject<T> {
/**
* @param [doc] - The doc to save to the Meteor Object. If nothing is passed, the method saves everything in the AngularMeteorObject as is.
* @param [doc] - The doc to save to the Meteor Object. If nothing is passed, the method saves everything in the AngularMeteorObject as is.
* - Unchanged properties will be overridden with their existing values, which may trigger hooks.
* - If doc is passed, the method only updates the Meteor Object with the properties passed, and no other changes will be saved.
*
*
* @return Returns a promise with an error in case for an error or a number of successful docs changed in case of success.
*/
save(doc?: T): angular.IPromise<number>;
/**
* Reset the current value of the object to the one in the server.
*/
reset(): void;
/**
* Returns a copy of the AngularMeteorObject with all the AngularMeteor-specific internal properties removed.
* Returns a copy of the AngularMeteorObject with all the AngularMeteor-specific internal properties removed.
* The returned object is then safe to use as a parameter for method calls, or anywhere else where the data needs to be converted to JSON.
*/
getRawObject(): T;
@@ -303,17 +303,17 @@ declare module angular.meteor {
/**
* A shorten (Syntactic sugar) function for the $meteor.subscribe function.
* Takes only one parameter and not returns a promise like $meteor.subscribe does.
*
*
* @param subscriptionName - The subscription name to subscribe to. Exactly like the first parameter in $meteor.subscribe service.
*/
*/
subscribe(subscriptionName:string): AngularMeteorObject<T>;
}
/**
* An object that connects a Meteor Collection to an AngularJS scope variable
*/
interface AngularMeteorCollection<T> extends AngularMeteorCollection2<T, T> { }
/**
* An object that connects a Meteor Collection to an AngularJS scope variable,
* but can use a differen type for updates.
@@ -321,32 +321,32 @@ declare module angular.meteor {
interface AngularMeteorCollection2<T, U> extends Array<T> {
/**
* @param [docs] - The docs to save to the Meteor Collection.
* - If the docs parameter is empty, the method saves everything in the AngularMeteorCollection as is.
* - If an object is passed, the method pushes that object into the AngularMeteorCollection.
* - If the docs parameter is empty, the method saves everything in the AngularMeteorCollection as is.
* - If an object is passed, the method pushes that object into the AngularMeteorCollection.
* - If an array is passed, the method pushes all objects in the array into the AngularMeteorCollection.
*/
save(docs?: U|U[]): void;
/**
/**
* @param [keys] - The keys of the object to remove from the Meteor Collection.
* - If nothing is passed, the method removes all the documents from the AngularMeteorCollection.
* - If an object is passed, the method removes the object with that key from the AngularMeteorCollection.
* - If nothing is passed, the method removes all the documents from the AngularMeteorCollection.
* - If an object is passed, the method removes the object with that key from the AngularMeteorCollection.
* - If an array is passed, the method removes all objects that matches the keys in the array from the AngularMeteorCollection.
*/
remove(keys?: U|string|number|string[]|number[]): void;
/**
* A shorten (Syntactic sugar) function for the $meteor.subscribe function.
* Takes only one parameter and not returns a promise like $meteor.subscribe does.
*
*
* @param subscriptionName - The subscription name to subscribe to. Exactly like the first parameter in $meteor.subscribe service.
*/
subscribe(subscriptionName:string): AngularMeteorCollection2<T, U>;
}
interface ILoginWithExternalService {
(options: Meteor.LoginWithExternalServiceOptions): angular.IPromise<void>;
}
interface ReactiveResult { }
}
+1 -1
View File
@@ -6,7 +6,7 @@
/// <reference path="../angularjs/angular.d.ts" />
/// <reference path="../jquery/jquery.d.ts" />
declare module angularModal {
declare namespace angularModal {
type AngularModalControllerDefinition = (new (...args: any[]) => any) | Function | string; // Possible arguments to IControllerService
+2 -2
View File
@@ -1,11 +1,11 @@
// Type definitions for angular-notifications
// Project: https://github.com/DerekRies/angular-notifications
// Definitions by: Tomasz Ducin <https://github.com/ducin/DefinitelyTyped>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
declare module angular.notifications {
declare namespace angular.notifications {
interface IAnimation {
duration: number;
+4 -4
View File
@@ -1,11 +1,11 @@
// Type definitions for angular-notify 2.5.0
// Project: https://github.com/cgross/angular-notify
// Definitions by: Suwato <https://github.com/Suwato/DefinitelyTyped>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
///<reference path="../angularjs/angular.d.ts" />
declare module angular.cgNotify {
declare namespace angular.cgNotify {
interface INotifyService {
@@ -51,7 +51,7 @@ declare module angular.cgNotify {
* Optional. Currently center and right are the only acceptable values.
*/
position? : string;
/**
* Optional. The duration (in milliseconds) of the message. A duration of 0 will prevent the message from closing automatically.
*/
@@ -99,7 +99,7 @@ declare module angular.cgNotify {
* The default element that contains each notification. Defaults to document.body.
*/
container? : any;
/**
* The maximum number of total notifications that can be visible at one time. Older notifications will be closed when the maximum is reached.
*/
+3 -3
View File
@@ -1,12 +1,12 @@
// Type definitions for OData Angular Resources
// Project: https://github.com/devnixs/ODataAngularResources
// Definitions by: Raphael ATALLAH <http://raphael.atallah.me>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
declare module OData {
declare namespace OData {
/**
* Currently supported options for the $resource factory options argument.
*/
@@ -0,0 +1,92 @@
/// <reference path="./angular-permission-2.3.1.d.ts" />
import permission = angular.permission;
angular
.module('fooModule', ['permission', 'user'])
.run(function (PermissionStore: permission.PermissionStore, User: any) {
// Define anonymous permission
PermissionStore
.definePermission('anonymous', function (stateParams) {
// If the returned value is *truthy* then the user has the permission, otherwise they don't
if (!User) {
return true; // Is anonymous
}
return false;
});
});
interface BackendUserService {
checkSession(): angular.IPromise<any>;
getAccessLevel(): angular.IPromise<{accessLevel: string}>;
hasPermissionDefinition(permission: string) : angular.IPromise<any>;
}
angular.module('barModule', ['permission', 'user'])
.run(function (PermissionStore: permission.PermissionStore, User: BackendUserService, $q: angular.IQService) {
PermissionStore
// Define user permission calling back-end
.definePermission('user', function (stateParams) {
// This time we will return a promise
// If the promise *resolves* then the user has the permission, if it *rejects* (you guessed it)
// Let's assume this returns a promise that resolves or rejects if session is active
return User.checkSession();
});
PermissionStore
// A different example for admin
.definePermission('admin', function (stateParams) {
var deferred = $q.defer();
User.getAccessLevel()
.then(function (data) {
if (data.accessLevel === 'admin') {
deferred.resolve();
} else {
deferred.reject();
}
})
.catch(function () {
// Error with request
deferred.reject();
});
return deferred.promise;
});
let arrayOfPermissionNames = ['p1', 'p2'];
PermissionStore.defineManyPermissions(arrayOfPermissionNames, function (stateParams: angular.ui.IStateParamsService, permissionName: string) {
return User.hasPermissionDefinition(permissionName);
});
PermissionStore.clearStore();
PermissionStore.removePermissionDefinition('user');
let permissions: Array<permission.Permission> = PermissionStore.getStore();
});
angular
.module('fooModule', ['permission', 'user'])
.run(function (RoleStore: permission.RoleStore, User: any) {
RoleStore
// Permission array validated role
// Library will internally validate if 'user' and 'editor' permissions are valid when checking if role is valid
.defineRole('admin', ['user', 'editor']);
RoleStore
// Server side validated role
.defineRole('accountant', [], function (stateParams) {
// Let's assume that we are making a request to server here and return response as promise
return User.hasRole('accountant');
});
RoleStore.clearStore();
RoleStore.removeRoleDefinition('user');
let roles: Array<permission.Role> = RoleStore.getStore();
});
+165
View File
@@ -0,0 +1,165 @@
// Type definitions for angular-permission 2.3.1
// Project: https://github.com/Narzerus/angular-permission
// Definitions by: Voislav Mishevski <https://github.com/vmishevski>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
/// <reference path="../angular-ui-router/angular-ui-router.d.ts" />
declare namespace angular.permission {
export interface PermissionStore {
/**
* Allows to define permission on application configuration
* @method
*
* @param permissionName {String} Name of defined permission
* @param validationFunction {Function} Function used to validate if permission is valid
*/
definePermission(
name: string,
validationFunction: (stateParams?: angular.ui.IStateParamsService, permission?: string) => boolean | angular.IPromise<any>
): void;
/**
* Allows to define set of permissionNames with shared validation function on application configuration
* @method
* @throws {TypeError}
*
* @param permissionNames {Array} Set of permission names
* @param validationFunction {Function} Function used to validate if permission is valid
*/
defineManyPermissions(
permissions: string[],
validationFunction: (stateParams?: angular.ui.IStateParamsService, permission?: string) => boolean | angular.IPromise<any>
): void;
clearStore(): void;
/**
* Deletes permission
* @method
*
* @param permissionName {String} Name of defined permission
*/
removePermissionDefinition(permission: string): void;
/**
* Checks if permission exists
* @method
*
* @param permissionName {String} Name of defined permission
* @returns {Boolean}
*/
hasPermissionDefinition(permissionName: string): boolean;
/**
* Returns all permissions
* @method
*
* @returns {Object} Permissions collection
*/
getStore(): Permission[];
}
export interface RoleStore {
/**
* Allows to define role
* @method
*
* @param roleName {String} Name of defined role
* @param permissions {Array} Set of permission names
* @param [validationFunction] {Function} Function used to validate if permissions in role are valid
*/
defineRole(
role: string,
permissions: Array<string>,
validationFunction: RoleValidationFunction
): void;
/**
* Allows to define role
* @method
*
* @param roleName {String} Name of defined role
* @param permissions {Array} Set of permission names
*/
defineRole(role: string, permissions: Array<string>): void;
/**
* Checks if role is defined in store
* @method
*
* @param roleName {String} Name of role
* @returns {Boolean}
*/
hasRoleDefinition(role: string): boolean;
/**
* Returns role definition object by it's name
* @method
*
* @returns {permission.Role} Role definition object
*/
getRoleDefinition(roleName: string): Role;
/**
* Removes all role definitions
* @method
*/
clearStore(): void;
/**
* Deletes role from store
* @method
*
* @param roleName {String} Name of defined permission
*/
removeRoleDefinition(roleName: string): void;
/**
* Returns all role definitions
* @method
*
* @returns {Object} Defined roles collection
*/
getStore(): Role[];
}
export interface Role {
roleName: string;
permissionNames: string[];
validationFunction?: RoleValidationFunction;
}
export interface Permission {
permissionName: string;
validationFunction?: PermissionValidationFunction;
}
interface RoleValidationFunction {
(stateParams?: angular.ui.IStateParamsService, permission?: string): boolean | angular.IPromise<any>;
}
interface PermissionValidationFunction {
(stateParams?: angular.ui.IStateParamsService, permission?: string): boolean | angular.IPromise<any>;
}
export interface IPermissionState extends angular.ui.IState {
data?: any | DataWithPermissions;
}
export interface DataWithPermissions {
permissions?: {
only?: (() => void) | Array<string> | angular.IPromise<any>;
except?: (() => void) | Array<string> | angular.IPromise<any>;
redirectTo: string | (() => string) | (() => PermissionRedirectConfigation) | {[index: string]: PermissionRedirectConfigation}
};
}
export interface PermissionRedirectConfigation {
state: string;
params?: {};
options?: angular.ui.IStateOptions;
}
}
@@ -0,0 +1,93 @@
/// <reference path="./angular-permission.d.ts" />
import permissionNamespace = angular.permission;
import { permission, ngPermission, uiPermission } from "angular-permission";
angular
.module('fooModule', [permission, ngPermission, uiPermission, 'user'])
.run(function (PermissionStore: permissionNamespace.PermissionStore, User: any) {
// Define anonymous permission
PermissionStore
.definePermission('anonymous', function (stateParams) {
// If the returned value is *truthy* then the user has the permission, otherwise they don't
if (!User) {
return true; // Is anonymous
}
return false;
});
});
interface BackendUserService {
checkSession(): angular.IPromise<any>;
getAccessLevel(): angular.IPromise<{accessLevel: string}>;
hasPermissionDefinition(permission: string) : angular.IPromise<any>;
}
angular.module('barModule', [permission, 'user'])
.run(function (PermissionStore: permissionNamespace.PermissionStore, User: BackendUserService, $q: angular.IQService) {
PermissionStore
// Define user permission calling back-end
.definePermission('user', function (stateParams) {
// This time we will return a promise
// If the promise *resolves* then the user has the permission, if it *rejects* (you guessed it)
// Let's assume this returns a promise that resolves or rejects if session is active
return User.checkSession();
});
PermissionStore
// A different example for admin
.definePermission('admin', function (permission: string, stateParams: angular.permission.TransitionProperties) {
var deferred = $q.defer();
User.getAccessLevel()
.then(function (data) {
if (data.accessLevel === 'admin') {
deferred.resolve();
} else {
deferred.reject();
}
})
.catch(function () {
// Error with request
deferred.reject();
});
return deferred.promise;
});
let arrayOfPermissionNames = ['p1', 'p2'];
PermissionStore.defineManyPermissions(arrayOfPermissionNames, function (permissionName: string, stateParams: angular.permission.TransitionProperties) {
return User.hasPermissionDefinition(permissionName);
});
PermissionStore.clearStore();
PermissionStore.removePermissionDefinition('user');
let permissions: Array<permissionNamespace.Permission> = PermissionStore.getStore();
});
angular
.module('fooModule', [permission, 'user'])
.run(function (RoleStore: permissionNamespace.RoleStore, User: any) {
RoleStore
// Permission array validated role
// Library will internally validate if 'user' and 'editor' permissions are valid when checking if role is valid
.defineRole('admin', ['user', 'editor']);
RoleStore
// Server side validated role
.defineRole('accountant', [], function (permission, stateParams) {
// Let's assume that we are making a request to server here and return response as promise
return User.hasRole('accountant');
});
RoleStore.clearStore();
RoleStore.removeRoleDefinition('user');
let roles: Array<permissionNamespace.Role> = RoleStore.getStore();
});
+181
View File
@@ -0,0 +1,181 @@
// Type definitions for angular-permission 2.3.6
// Project: https://github.com/Narzerus/angular-permission
// Definitions by: Voislav Mishevski <https://github.com/vmishevski>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
/// <reference path="../angular-ui-router/angular-ui-router.d.ts" />
declare namespace angular.permission {
/**
* Used as optional parameter provided on definitions of permissions and roles
*/
export interface TransitionProperties {
fromState?: angular.ui.IState;
fromParams?: angular.ui.IStateParamsService;
toState?: angular.ui.IState;
toParams?: angular.ui.IStateParamsService;
options?: angular.ui.IStateOptions;
}
export interface PermissionStore {
/**
* Allows to define permission on application configuration
* @method
*
* @param permissionName {String} Name of defined permission
* @param validationFunction {Function} Function used to validate if permission is valid
*/
definePermission(
name: string,
validationFunction: (permission?: string, transitionProperties?: TransitionProperties) => boolean | angular.IPromise<any>
): void;
/**
* Allows to define set of permissionNames with shared validation function on application configuration
* @method
* @throws {TypeError}
*
* @param permissionNames {Array} Set of permission names
* @param validationFunction {Function} Function used to validate if permission is valid
*/
defineManyPermissions(
permissions: string[],
validationFunction: (permission?: string, transitionProperties?: TransitionProperties) => boolean | angular.IPromise<any>
): void;
clearStore(): void;
/**
* Deletes permission
* @method
*
* @param permissionName {String} Name of defined permission
*/
removePermissionDefinition(permission: string): void;
/**
* Checks if permission exists
* @method
*
* @param permissionName {String} Name of defined permission
* @returns {Boolean}
*/
hasPermissionDefinition(permissionName: string): boolean;
/**
* Returns all permissions
* @method
*
* @returns {Object} Permissions collection
*/
getStore(): Permission[];
}
export interface RoleStore {
/**
* Allows to define role
* @method
*
* @param roleName {String} Name of defined role
* @param permissions {Array} Set of permission names
* @param [validationFunction] {Function} Function used to validate if permissions in role are valid
*/
defineRole(
role: string,
permissions: Array<string>,
validationFunction: RoleValidationFunction
): void;
/**
* Allows to define role
* @method
*
* @param roleName {String} Name of defined role
* @param permissions {Array} Set of permission names
*/
defineRole(role: string, permissions: Array<string>): void;
/**
* Checks if role is defined in store
* @method
*
* @param roleName {String} Name of role
* @returns {Boolean}
*/
hasRoleDefinition(role: string): boolean;
/**
* Returns role definition object by it's name
* @method
*
* @returns {permission.Role} Role definition object
*/
getRoleDefinition(roleName: string): Role;
/**
* Removes all role definitions
* @method
*/
clearStore(): void;
/**
* Deletes role from store
* @method
*
* @param roleName {String} Name of defined permission
*/
removeRoleDefinition(roleName: string): void;
/**
* Returns all role definitions
* @method
*
* @returns {Object} Defined roles collection
*/
getStore(): Role[];
}
export interface Role {
roleName: string;
permissionNames: string[];
validationFunction?: RoleValidationFunction;
}
export interface Permission {
permissionName: string;
validationFunction?: PermissionValidationFunction;
}
interface RoleValidationFunction {
(permission?: string, transitionProperties?: TransitionProperties): boolean | angular.IPromise<any>;
}
interface PermissionValidationFunction {
(permission?: string, transitionProperties?: TransitionProperties): boolean | angular.IPromise<any>;
}
export interface IPermissionState extends angular.ui.IState {
data?: any | DataWithPermissions;
}
export interface DataWithPermissions {
permissions?: {
only?: (() => void) | Array<string> | angular.IPromise<any>;
except?: (() => void) | Array<string> | angular.IPromise<any>;
redirectTo: string | (() => string) | (() => PermissionRedirectConfigation) | {[index: string]: PermissionRedirectConfigation}
};
}
export interface PermissionRedirectConfigation {
state: string;
params?: {};
options?: angular.ui.IStateOptions;
}
}
declare module "angular-permission" {
export var permission: string;
export var ngPermission: string;
export var uiPermission: string;
}

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