Merge remote-tracking branch 'dt/master'

This commit is contained in:
Konstantin Burkalev
2016-06-27 11:47:25 +03:00
310 changed files with 73169 additions and 19790 deletions
+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/DefinitelyTyped/DefinitelyTyped/labels/Definition%3ARequest).
Here are the [currently requested definitions](https://github.com/DefinitelyTyped/DefinitelyTyped/labels/Definition%3ARequest).
## License
+2
View File
@@ -1037,6 +1037,8 @@ declare namespace 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");
+8
View File
@@ -12,4 +12,12 @@ var config : adal.Config = {
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;
+14 -1
View File
@@ -4,9 +4,10 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare var AuthenticationContext: adal.AuthenticationContextStatic;
declare var Logging: adal.Logging;
declare module 'adal' {
export = AuthenticationContext;
export = { AuthenticationContext, Logging };
}
declare namespace adal {
@@ -36,6 +37,18 @@ declare namespace adal {
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;
@@ -67,6 +67,16 @@ myApp.controller('DialogController', ($scope: ng.IScope, $mdDialog: ng.material.
$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');
});
@@ -110,3 +120,51 @@ myApp.controller('SidenavController', ($scope: ng.IScope, $mdSidenav: ng.materia
myApp.controller('ToastController', ($scope: ng.IScope, $mdToast: ng.material.IToastService) => {
$scope['openToast'] = () => $mdToast.show($mdToast.simple().textContent('Hello!'));
});
myApp.controller('PanelController', ($scope: ng.IScope, $mdPanel: ng.material.IPanelService) => {
$scope['createPanel'] = () => {
var config = {
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});
};
});
+79 -4
View File
@@ -68,12 +68,14 @@ declare namespace angular.material {
interface IPromptDialog extends IPresetDialog<IPromptDialog> {
cancel(cancel: string): IPromptDialog;
placeholder(placeholder: 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;
@@ -81,7 +83,7 @@ declare namespace 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
@@ -94,11 +96,12 @@ declare namespace angular.material {
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;
@@ -283,4 +286,76 @@ declare namespace angular.material {
grey: IPalette;
'blue-grey': IPalette;
}
interface IPanelConfig {
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;
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;
focusOnOpen(): void;
}
interface IPanelPosition {
absolute(): IPanelPosition;
relativeTo(someElement: string|JQuery|Element): IPanelPosition;
top(opt_top: string): IPanelPosition; // default: '0'
bottom(opt_bottom: string): IPanelPosition; // default: '0'
left(opt_left: string): IPanelPosition; // default: '0'
right(opt_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;
}
}
@@ -0,0 +1,42 @@
///<reference path="angular-q-spread.d.ts"/>
interface IMyService {
getFirstname(): ng.IPromise<string>;
getLastname(): ng.IPromise<string>;
}
interface IScope {
name: string;
}
function TestCtrl($scope: IScope, $q: ng.IQService, MyService: IMyService) {
$scope.name = null;
function firstCallback(firstname: string, lastname: string)
{
return firstname + ' ' + lastname;
}
function anotherCallback(fullname: string)
{
$scope.name = fullname;
}
function failureCallback(reason: any)
{
alert('Could not load data: ' + reason);
}
$q
.all([
MyService.getFirstname(),
MyService.getLastname()
])
.spread(firstCallback)
.then(anotherCallback)
.catch(failureCallback);
};
TestCtrl.$inject = ['$scope', '$q', 'MyService'];
angular.module('test').controller('TestCtrl', TestCtrl);
+17
View File
@@ -0,0 +1,17 @@
// Type definitions for angular-q-spread module
// Project: https://www.npmjs.com/package/angular-q-spread
// Definitions by: rafw87 <https://github.com/rafw87>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
declare module angular {
interface IPromise<T> {
/**
This method can be used as a replacement for then. Similarly, it takes two parameters, a callback when all promises are resolved and a callback for failure. The resolve callback is going to be called with the result of the list of promises passed to $q.all as separate parameters instead of one parameters which is an array.
* @param successCallback Callback for resolved promise, similar to then's one, but takes multiple parameters instead of single array parameter
* @param errorCallback Callback for error, the same as for then
*/
spread<TResult>(successCallback: (...promiseValues: any[]) => IPromise<TResult>|TResult, errorCallback?: (reason: any) => any): IPromise<TResult>;
}
}
+1 -1
View File
@@ -72,7 +72,7 @@ declare namespace angular.translate {
}
interface ITranslateProvider extends angular.IServiceProvider {
translations(): ITranslationTable;
translations(key?: string): ITranslationTable;
translations(key: string, translationTable: ITranslationTable): ITranslateProvider;
cloakClassName(): string;
cloakClassName(name: string): ITranslateProvider;
@@ -0,0 +1,25 @@
/// <reference path="angular-websocket.d.ts" />
let dummySocket: ng.websocket.IWebSocket;
let provider: ng.websocket.IWebSocketProvider = (url: string) => {
return dummySocket;
}
let socket = provider("wss://localhost");
socket.onOpen((event) => {})
.onClose((event) => {})
.onError((event) => {})
.onMessage((event) => {});
socket.onMessage((event) => {}, { filter: /Some Filter/ })
.onMessage((event) => {}, { filter: 'Some Filter' })
.onMessage((event) => {}, { filter: 'Some Filter', autoApply: true })
.onMessage((event) => {}, { autoApply: false });
socket.close(true);
socket.close();
socket.send("Some great data here!").finally(() => {});
socket.send({ list: [1, 2, 3, 4] });
+86
View File
@@ -0,0 +1,86 @@
// Type definitions for angular-websocket v2.0
// Project: https://github.com/AngularClass/angular-websocket
// Definitions by: Nick Veys <https://github.com/nickveys>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path='../angularjs/angular.d.ts' />
declare namespace angular.websocket {
interface IWebSocketProvider {
/**
* Creates and opens an IWebSocket instance.
*
* @param url url to connect to
* @return websocket instance
*/
(url: string): IWebSocket;
}
/** Options available to be specified for IWebSocket.onMessage */
type IWebSocketMessageOptions = {
/**
* If specified, only messages that match the filter will cause the message event
* to be fired.
*/
filter?: string | RegExp;
/** If true, each message handled will safely call `$rootScope.$digest()`. */
autoApply?: boolean;
}
interface IWebSocket {
/**
* Adds a callback to be executed each time a socket connection is opened for
* this instance.
*
* @param event event object
* @returns this instance, for method chaining
*/
onOpen(callback: (event: Event) => void): IWebSocket;
/**
* Adds a callback to be executed each time a socket connection is closed for
* this instance.
*
* @param event event object
* @returns this instance, for method chaining
*/
onClose(callback: (event: CloseEvent) => void): IWebSocket;
/**
* Adds a callback to be executed each time a socket connection is closed for
* this instance.
*
* @param event event object
* @returns this instance, for method chaining
*/
onError(callback: (event: Event) => void): IWebSocket;
/**
* Adds a callback to be executed each time a socket connection has an error for
* this instance.
*
* @param event event object
* @returns this instance, for method chaining
*/
onMessage(callback: (event: MessageEvent) => void, options?: IWebSocketMessageOptions): IWebSocket;
/**
* Closes the underlying socket, as long as no data is still being sent from the client.
*
* @param force if `true`, force close even if data is still being sent
* @returns this instance, for method chaining
*/
close(force?: boolean): IWebSocket;
/**
* Adds data to a queue, and attempts to send if the socket is ready.
*
* @param data data to send, if this is an object, it will be stringified before sending
*/
send(data: string | {}): ng.IPromise<any>;
}
}
+28 -17
View File
@@ -43,7 +43,7 @@ declare namespace angular.animate {
* @param container the container element that will capture each of the animation events that are fired on itself as well as among its children
* @param callback the callback function that will be fired when the listener is triggered
*/
on(event: string, container: JQuery, callback: Function): void;
on(event: string, container: JQuery, callback: (element?: JQuery, phase?: string) => any): void;
/**
* Deregisters an event listener based on the event which has been associated with the provided element.
@@ -52,7 +52,7 @@ declare namespace angular.animate {
* @param container the container element the event listener was placed on
* @param callback the callback function that was registered as the listener
*/
off(event: string, container?: JQuery, callback?: Function): void;
off(event: string, container?: JQuery, callback?: (element?: JQuery, phase?: string) => any): void;
/**
* Associates the provided element with a host parent element to allow the element to be animated even if it exists outside of the DOM structure of the Angular application.
@@ -183,16 +183,6 @@ declare namespace angular.animate {
* see https://docs.angularjs.org/api/ngAnimate/#applying-directive-specific-styles-to-an-animation
*/
interface IAnimationOptions {
/**
* The ending CSS styles (a key/value object) that will be applied across the animation via a CSS transition.
*/
to?: Object;
/**
* The starting CSS styles (a key/value object) that will be applied at the start of the animation.
*/
from?: Object;
/**
* The DOM event (e.g. enter, leave, move). When used, a generated CSS class of ng-EVENT and
* ng-EVENT-active will be applied to the element during the animation. Multiple events can be provided when
@@ -200,6 +190,12 @@ declare namespace angular.animate {
*/
event?: string;
/**
* Indicates that the ng-prefix will be added to the event class. Setting to false or
* omitting will turn ng-EVENT and ng-EVENT-active in EVENT and EVENT-active. Unused if event is omitted.
*/
structural?: boolean;
/**
* The CSS easing value that will be applied to the transition or keyframe animation (or both).
*/
@@ -208,12 +204,22 @@ declare namespace angular.animate {
/**
* The raw CSS transition style that will be used (e.g. 1s linear all).
*/
transition?: string;
transitionStyle?: string;
/**
* The raw CSS keyframe animation style that will be used (e.g. 1s my_animation linear).
*/
keyframe?: string;
keyframeStyle?: string;
/**
* The starting CSS styles (a key/value object) that will be applied at the start of the animation.
*/
from?: Object;
/**
* The ending CSS styles (a key/value object) that will be applied across the animation via a CSS transition.
*/
to?: Object;
/**
* A space separated list of CSS classes that will be added to the element and spread across the animation.
@@ -250,11 +256,16 @@ declare namespace angular.animate {
/**
* The numeric index representing the stagger item (e.g. a value of 5 is equal to the sixth item
* in the stagger; therefore when a stagger option value of 0.1 is used then there will be a stagger delay of 600ms)
* applyClassesEarly - Whether or not the classes being added or removed will be used when detecting the animation.
* This is set by $animate when enter/leave/move animations are fired to ensure that the CSS classes are resolved in time.
* (Note that this will prevent any transitions from occuring on the classes being added and removed.)
*
*/
staggerIndex?: number;
/**
* Whether or not the provided from and to styles will be removed once the animation is closed. This is useful for
* when the styles are used purely for the sake of the animation and do not have a lasting visual effect on the element
* (e.g. a colapse and open animation). By default this value is set to false.
*/
cleanupStyles?: boolean;
}
interface IAnimateCssRunner {
+1 -1
View File
@@ -869,7 +869,7 @@ angular.module('docsTabsExample', [])
angular.module('componentExample', [])
.component('counter', {
require: ['^ctrl'],
require: {'ctrl': '^ctrl'},
bindings: {
count: '='
},
+8 -4
View File
@@ -156,7 +156,7 @@ declare namespace angular {
noop(...args: any[]): void;
reloadWithDebugInfo(): void;
toJson(obj: any, pretty?: boolean): string;
toJson(obj: any, pretty?: boolean | number): string;
uppercase(str: string): string;
version: {
full: string;
@@ -1707,6 +1707,10 @@ declare namespace angular {
* Use the array form to define dependencies (necessary if strictDi is enabled and you require dependency injection)
*/
templateUrl?: string | Function | (string | Function)[];
/**
* Define object mapping to other directive or component required controllers.
*/
require?: any;
/**
* Define DOM attribute binding to component properties. Component properties are always bound to the component
* controller and not to the scope.
@@ -1716,7 +1720,7 @@ declare namespace angular {
* Whether transclusion is enabled. Enabled by default.
*/
transclude?: boolean | string | {[slot: string]: string};
require?: string | string[] | {[controller: string]: string};
require?: {[controller: string]: string};
}
interface IComponentTemplateFn {
@@ -1755,7 +1759,7 @@ declare namespace angular {
* analogous to the ngAfterViewInit and ngAfterContentInit hooks in Angular 2. Since the compilation process is rather
* different in Angular 1 there is no direct mapping and care should be taken when upgrading.
*/
$postInit?(): void;
$postLink?(): void;
}
interface IChangesObject {
@@ -1800,7 +1804,7 @@ declare namespace angular {
* that is passed to the link function instead.
*/
transclude: ITranscludeFunction
): IDirectivePrePost;
): void | IDirectivePrePost;
}
interface IDirective {
@@ -27,7 +27,26 @@ var config: Microsoft.ApplicationInsights.IConfig = {
cookieDomain: ""
};
var appInsights = new Microsoft.ApplicationInsights.AppInsights(config);
var appInsights: Microsoft.ApplicationInsights.IAppInsights = {
config: config,
context: null,
queue: null,
startTrackPage(name?: string) { return null; },
stopTrackPage(name?: string, url?: string, properties?: { [name: string]: string; }, measurements?: { [name: string]: number; }) { return null; },
trackPageView(name?: string, url?: string, properties?: { [name: string]: string; }, measurements?: { [name: string]: number; }, duration?: number) { return null; },
startTrackEvent(name: string) { return null },
stopTrackEvent(name: string, properties?: { [name: string]: string; }, measurements?: { [name: string]: number; }) { return null },
trackEvent(name: string, properties?: { [name: string]: string; }, measurements?: { [name: string]: number; }) { return null },
trackAjax(id: string, absoluteUrl: string, pathName: string, totalTime: number, success: boolean, resultCode: number, method?: string) { return null },
trackException(exception: Error, handledAt?: string, properties?: { [name: string]: string; }, measurements?: { [name: string]: number; }, severityLevel?: AI.SeverityLevel) { return null },
trackMetric(name: string, average: number, sampleCount?: number, min?: number, max?: number, properties?: { [name: string]: string; }) { return null },
trackTrace(message: string, properties?: { [name: string]: string; }) { return null },
flush() { return null },
setAuthenticatedUserContext(authenticatedUserId: string, accountId?: string) { return null },
clearAuthenticatedUserContext() { return null },
_onerror(message: string, url: string, lineNumber: number, columnNumber: number, error: Error) { return null }
};
// trackPageView
appInsights.trackPageView("page1");
@@ -68,7 +87,7 @@ appInsights.config.instrumentationKey = "<new key>";
// TelementryContext
var context = appInsights.context;
var context: Microsoft.ApplicationInsights.ITelemetryContext = appInsights.context;
context.application.ver = "v0.0.0";
context.application.build = "1.1.1";
@@ -93,4 +112,46 @@ var envelope = new Microsoft.ApplicationInsights.Telemetry.Common.Envelope(data,
context.track(envelope);
context.addTelemetryInitializer((envelope) => false);
context.addTelemetryInitializer((envelope) => false);
// track event
var eventObj = new Microsoft.ApplicationInsights.Telemetry.Event("test", null, null);
var eventData = new Microsoft.ApplicationInsights.Telemetry.Common.Data<Microsoft.ApplicationInsights.Telemetry.Event>(Microsoft.ApplicationInsights.Telemetry.Event.dataType, eventObj);
var eventEnvelope = new Microsoft.ApplicationInsights.Telemetry.Common.Envelope(eventData, Microsoft.ApplicationInsights.Telemetry.Event.envelopeType);
context.track(eventEnvelope);
// track exception
var exceptionObj = new Microsoft.ApplicationInsights.Telemetry.Exception(new Error(), "handledAt", null, null, AI.SeverityLevel.Critical);
var exceptionData = new Microsoft.ApplicationInsights.Telemetry.Common.Data<Microsoft.ApplicationInsights.Telemetry.Exception>(Microsoft.ApplicationInsights.Telemetry.Exception.dataType, exceptionObj);
var exceptionEnvelope = new Microsoft.ApplicationInsights.Telemetry.Common.Envelope(exceptionData, Microsoft.ApplicationInsights.Telemetry.Exception.envelopeType);
context.track(exceptionEnvelope);
// track metric
var metricObj = new Microsoft.ApplicationInsights.Telemetry.Metric("name", 1234, 1, 0, 100, null);
var metricData = new Microsoft.ApplicationInsights.Telemetry.Common.Data<Microsoft.ApplicationInsights.Telemetry.Metric>(Microsoft.ApplicationInsights.Telemetry.Metric.dataType, metricObj);
var metricEnvelope = new Microsoft.ApplicationInsights.Telemetry.Common.Envelope(metricData, Microsoft.ApplicationInsights.Telemetry.Metric.envelopeType);
context.track(metricEnvelope);
// track page view
var pageViewObj = new Microsoft.ApplicationInsights.Telemetry.PageView("page name", "url", 999, null, null);
var pageViewData = new Microsoft.ApplicationInsights.Telemetry.Common.Data<Microsoft.ApplicationInsights.Telemetry.PageView>(Microsoft.ApplicationInsights.Telemetry.PageView.dataType, pageViewObj);
var pageViewEnvelope = new Microsoft.ApplicationInsights.Telemetry.Common.Envelope(pageViewData, Microsoft.ApplicationInsights.Telemetry.PageView.envelopeType);
context.track(pageViewEnvelope);
// track page view performance
var pageViewPerfObj = new Microsoft.ApplicationInsights.Telemetry.PageViewPerformance("page name", "url", 999, null, null);
var pageViewPerfData = new Microsoft.ApplicationInsights.Telemetry.Common.Data<Microsoft.ApplicationInsights.Telemetry.PageViewPerformance>(Microsoft.ApplicationInsights.Telemetry.PageViewPerformance.dataType, pageViewPerfObj);
var pageViewPerfEnvelope = new Microsoft.ApplicationInsights.Telemetry.Common.Envelope(pageViewPerfData, Microsoft.ApplicationInsights.Telemetry.PageViewPerformance.envelopeType);
context.track(pageViewPerfEnvelope);
// track remote dependency
var remoteDepObj = new Microsoft.ApplicationInsights.Telemetry.RemoteDependencyData("id", "url", "command", 1, true, 1234, "GET");
var remoteDepData = new Microsoft.ApplicationInsights.Telemetry.Common.Data<Microsoft.ApplicationInsights.Telemetry.RemoteDependencyData>(Microsoft.ApplicationInsights.Telemetry.RemoteDependencyData.dataType, remoteDepObj);
var remoteDepEnvelope = new Microsoft.ApplicationInsights.Telemetry.Common.Envelope(remoteDepData, Microsoft.ApplicationInsights.Telemetry.RemoteDependencyData.envelopeType);
context.track(pageViewPerfEnvelope);
// track trace
var traceObj = new Microsoft.ApplicationInsights.Telemetry.Trace("message", null);
var traceData = new Microsoft.ApplicationInsights.Telemetry.Common.Data<Microsoft.ApplicationInsights.Telemetry.Trace>(Microsoft.ApplicationInsights.Telemetry.Trace.dataType, traceObj);
var traceEnvelope = new Microsoft.ApplicationInsights.Telemetry.Common.Envelope(traceData, Microsoft.ApplicationInsights.Telemetry.Trace.envelopeType);
context.track(traceEnvelope);
File diff suppressed because it is too large Load Diff
+22
View File
@@ -341,9 +341,31 @@ interface Client {
trackMetric(name: string, value: number, count?:number, min?: number, max?: number, stdDev?: number, properties?: {
[key: string]: string;
}): void;
/**
* Log an incoming http request to your server. The request data will be tracked during the response "finish" event if it is successful or the request "error"
* event if it fails. The request duration is automatically calculated as the timespan between when the trackRequest method was called, and when the response "finish"
* or request "error" events were fired.
* @param request The http.ServerRequest object to track
* @param response The http.ServerResponse object for this request
* @param properties map[string, string] - additional data used to filter requests in the portal. Defaults to empty.
*/
trackRequest(request: any /* http.ServerRequest */, response: any /* http.ServerResponse */, properties?: {
[key: string]: string;
}): void;
/**
* Log an incoming http request to your server. The request data is tracked synchronously rather than waiting for the response "finish"" or request "error"" events.
* Use this if you need your request telemetry to respect custom app insights operation and user context (for example if you set any appInsights.client.context.tags).
* @param request The http.ServerRequest object to track
* @param response The http.ServerResponse object for this request
* @param ellapsedMilliseconds The duration for this request. Defaults to 0.
* @param properties map[string, string] - additional data used to filter requests in the portal. Defaults to empty.
* @param error An error that was returned for this request if it was unsuccessful. Defaults to null.
*/
trackRequestSync(request: any /*http.ServerRequest */, response: any /*http.ServerResponse */, ellapsedMilliseconds?: number, properties?: {
[key: string]: string;}, error?: any) : void;
/**
* Log information about a dependency of your app. Typically used to track the time database calls or outgoing http requests take from your server.
* @param name The name of the dependency (i.e. "myDatabse")
+1 -1
View File
@@ -55,7 +55,7 @@ declare namespace Atmosphere {
connectTimeout?: number;
reconnectInterval?: number;
dropHeaders?: boolean;
uuid?: number;
uuid?: string;
async?: boolean;
shared?: boolean;
readResponsesHeaders?: boolean;
+5
View File
@@ -797,3 +797,8 @@ declare module "avoscloud-sdk" {
export = AV;
}
declare module 'leanengine' {
import alias = require('avoscloud-sdk');
export = alias;
}
+109 -2
View File
@@ -18,6 +18,10 @@ declare module "aws-sdk" {
accessKeyId: string;
}
export class EnvironmentCredentials extends Credentials {
constructor(profile: string);
}
export interface Logger {
write?: (chunk: any, encoding?: string, callback?: () => void) => void;
log?: (...messages: any[]) => void;
@@ -86,6 +90,8 @@ declare module "aws-sdk" {
export interface ClientConfigPartial extends Services {
credentials?: Credentials;
region?: string;
accessKeyId: string;
secretAccessKey: string;
computeChecksums?: boolean;
convertResponseTypes?: boolean;
logger?: Logger;
@@ -138,9 +144,9 @@ declare module "aws-sdk" {
export class SNS {
constructor(options?: any);
public client: Sns.Client;
publish(request: Sns.PublishRequest, callback: (err: any, data: any) => void): void;
}
export class SimpleWorkflow {
constructor(options?: any);
public client: Swf.Client;
@@ -152,6 +158,51 @@ declare module "aws-sdk" {
getObject(params: s3.GetObjectRequest, callback: (err: any, data: any) => void): void;
}
export class STS{
constructor(options?: any);
/**
* Returns a set of temporary security credentials (consisting of an access key ID, a secret access key, and a security token) that you can use to access AWS resources that you might not normally have access to.
*/
assumeRole(params: sts.AssumeRoleParams, callback: (err: any, data: any) => void): void;
/**
* Returns a set of temporary security credentials for users who have been authenticated via a SAML authentication response.
*/
assumeRoleWithSAML(params: sts.AssumeRoleWithSAMLParams, callback: (err: any, data: any) => void): void;
/**
* Returns a set of temporary security credentials for users who have been authenticated in a mobile or web application with a web identity provider, such as Amazon Cognito, Login with Amazon, Facebook, Google, or any OpenID Connect-compatible identity provider.
*/
assumeRoleWithWebIdentity(params: sts.AssumeRoleWithWebIdentityParams, callback: (err: any, data: any) => void): void;
/**
* Creates a credentials object from STS response data containing credentials information.
*/
credentialsFrom(params: sts.CredentialsFromParams, callback: (err: any, data: any) => void): void;
/**
* Decodes additional information about the authorization status of a request from an encoded message returned in response to an AWS request.
*/
decodeAuthorizationMessage(params: sts.DecodeAuthorizationMessageParams, callback: (err: any, data: any) => void): void;
/**
* Returns details about the IAM identity whose credentials are used to call the API.
*/
getCallerIdentity(params: {}, callback: (err: any, data: any) => void): void;
/**
* Returns a set of temporary security credentials (consisting of an access key ID, a secret access key, and a security token) for a federated user.
*/
getFederationToken(params: sts.GetFederationTokenParams, callback: (err: any, data: any) => void): void;
/**
* Returns a set of temporary credentials for an AWS account or IAM user.
*/
getSessionToken(params: sts.GetSessionTokenParams, callback: (err: any, data: any) => void): void;
}
export class ECS {
constructor(options?: any);
/**
@@ -1345,4 +1396,60 @@ declare module "aws-sdk" {
taskDefinition: string;
}
}
export module sts {
export interface AssumeRoleParams {
RoleArn: string;
RoleSessionName: string;
DurationSeconds?: number;
ExternalId?: string;
Policy?: string;
SerialNumber?: string;
TokenCode?: string;
}
export interface AssumeRoleWithSAMLParams {
PrincipalArn: string;
RoleArn: string;
SAMLAssertion: string;
DurationSeconds?: number;
Policy?: string;
}
export interface AssumeRoleWithWebIdentityParams {
RoleArn: string;
RoleSessionName: string;
WebIdentityToken: string;
DurationSeconds?: number;
Policy?: string;
ProviderId?: string;
}
export interface CredentialsFromParams {
/**
* Data retrieved from a call to AWS.STS.getFederatedToken, getSessionToken(), assumeRole(), or assumeRoleWithWebIdentity().
*/
Data: any;
/**
* An optional credentials object to fill instead of creating a new object. Useful when modifying an existing credentials object from a refresh call.
*/
Credentials?: Credentials
}
export interface DecodeAuthorizationMessageParams {
EncodedMessage: string;
}
export interface GetFederationTokenParams {
Name: string;
DurationSeconds?: number,
Policy?: string
}
export interface GetSessionTokenParams {
DurationSeconds: number,
SerialNumber: string;
TokenCode: string;
}
}
}
+37 -3
View File
@@ -7,10 +7,11 @@ declare namespace Microsoft.WindowsAzure {
// MobileServiceClient object based on Microsoft Azure documentation: http://msdn.microsoft.com/en-us/library/windowsazure/jj554219.aspx
interface MobileServiceClient {
new (applicationUrl: string, applicationKey: string): MobileServiceClient;
new (applicationUrl: string, applicationKey?: string): MobileServiceClient;
applicationUrl: string;
applicationKey: string;
currentUser: User;
push: Push;
//for provider:string use one of ProviderEnum: 'microsoftaccount', 'facebook', 'twitter', 'google'
login(provider: string, token: string, callback: (error: any, user: User) => void ): void;
login(provider: string, token: string): asyncPromise;
@@ -18,8 +19,40 @@ declare namespace Microsoft.WindowsAzure {
login(provider: string): asyncPromise;
logout(): void;
getTable(tableName: string): MobileServiceTable;
withFilter(serviceFilter: (request: any, next: (request: any, callback: (error:any, response: any) => void ) => void, callback: (error: any, response: any) => void ) => void ) : MobileServiceClient;
invokeApi(apiName: string, options?:InvokeApiOptions): asyncPromise;
withFilter(serviceFilter: (request: any, next: (request: any, callback: (error: any, response: any) => void) => void, callback: (error: any, response: any) => void) => void): MobileServiceClient;
/**
* Invokes the specified custom api and returns a response object.
*
* @param apiName The custom api to invoke.
* @param options Contains additional parameter information, valid values are:
* body: The body of the HTTP request.
* method: The HTTP method to use in the request, with the default being POST,
* parameters: Any additional query string parameters,
* headers: HTTP request headers, specified as an object.
* @param callback Optional callback accepting (error, results) parameters.
*/
invokeApi(apiName: string, options?: InvokeApiOptions, callback?: (error: any, results: any) => void): asyncPromise;
}
interface Push
{
/**
* Register a push channel with the Mobile Apps backend to start receiving notifications.
*
* @param platform The device platform being used - wns, gcm or apns.
* @param pushChannel The push channel identifier or URI.
* @param templates An object containing template definitions. Template objects should contain body, headers and tags properties.
* @param secondaryTiles An object containing template definitions to be used with secondary tiles when using WNS.
* @param callback Optional callback accepting (error, results) parameters.
*/
register(platform: string, pushChannel: string, templates?: any, secondaryTiles?: any, callback?: (error: any, results: any) => void): void;
/**
* Invokes the specified custom api and returns a response object.
*
* @param pushChannel The push channel identifier or URI.
* @param callback Optional callback accepting (error, results) parameters.
*/
unregister(pushChannel: string, callback?: (error: any, results: any) => void): void;
}
interface InvokeApiOptions
@@ -36,6 +69,7 @@ declare namespace Microsoft.WindowsAzure {
accessTokens: any; // { [providerName: string]: string; }
level: string; //for level:string use one of LevelEnum: 'admin','anonymous','authenticated'
userId: string;
mobileServiceAuthenticationToken: string;
}
+23
View File
@@ -0,0 +1,23 @@
/// <reference path="babelify.d.ts" />
import babelify = require("babelify");
module BabelifyTest {
export function whatDidTheEs6Say(srcPath: string, opts?: babelify.BabelifyOptions) {
opts.extensions = opts.extensions || undefined;
opts.sourceMapsAbsolute = opts.sourceMapsAbsolute || false;
var dst: NodeJS.ReadWriteStream;
babelify(""); // 'opts' are optional
babelify(srcPath, opts).on("error", function (err: any) {
console.error("babelify error: ", err);
});
babelify.configure(opts)(srcPath).pipe(dst);
}
}
export = BabelifyTest;
+46
View File
@@ -0,0 +1,46 @@
// Type definitions for babelify v7.3.0
// Project: https://github.com/babel/babelify
// Definitions by: TeamworkGuy2 <https://github.com/TeamworkGuy2>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
/// <reference path="../babel-core/babel-core.d.ts" />
/** Browserify transform for Babel
*/
declare module 'babelify' {
import stream = require("stream");
import babel = require("babel-core");
function Babelify(filename: string, opts?: Babelify.BabelifyOptions): Babelify.BabelifyObject;
module Babelify {
export interface BabelifyConstructor {
(filename: string, opts: Babelify.BabelifyOptions): Babelify.BabelifyObject;
}
/** In addition to the various purposes documented here, all of the babelify options are passed to babel which passes them on to babel.transform() when each file is transformed */
export interface BabelifyOptions extends babel.TransformOptions {
/** These are passed to babel.util.canCompile() for each filename
* default: null
*/
extensions?: string | string[];
/** if true, a 'sourceFileName' property with a value equal to the current file being transformed is included with the options passed to babel.transform()
* default: false
*/
sourceMapsAbsolute?: boolean;
}
export class BabelifyObject extends stream.Transform {
_transform(buf: string | Buffer, encoding: string, callback: () => void): void;
_flush(callback: () => void): void;
}
export function configure(opts: Babelify.BabelifyOptions): (filename: string) => Babelify.BabelifyObject;
}
export = Babelify;
}
+62 -46
View File
@@ -147,7 +147,6 @@ declare namespace Backbone {
/*private*/ set(attributeName: string, value: any, options?: ModelSetOptions): Model;
set(obj: any, options?: ModelSetOptions): Model;
change(): any;
changedAttributes(attributes?: any): any[];
clear(options?: Silenceable): any;
clone(): Model;
@@ -173,8 +172,12 @@ declare namespace Backbone {
invert(): any;
pick(keys: string[]): any;
pick(...keys: string[]): any;
pick(fn: (value: any, key: any, object: any) => any): any;
omit(keys: string[]): any;
omit(...keys: string[]): any;
omit(fn: (value: any, key: any, object: any) => any): any;
chain(): any;
isEmpty(): boolean;
}
class Collection<TModel extends Model> extends ModelBase {
@@ -209,8 +212,8 @@ declare namespace Backbone {
pluck(attribute: string): any[];
push(model: TModel, options?: AddOptions): TModel;
pop(options?: Silenceable): TModel;
remove(model: TModel, options?: Silenceable): TModel;
remove(models: TModel[], options?: Silenceable): TModel[];
remove(model: {}|TModel, options?: Silenceable): TModel;
remove(models: ({}|TModel)[], options?: Silenceable): TModel[];
reset(models?: TModel[], options?: Silenceable): TModel[];
set(models?: TModel[], options?: Silenceable): TModel[];
shift(options?: Silenceable): TModel;
@@ -223,58 +226,72 @@ declare namespace Backbone {
private _removeReference(model: TModel): void;
private _onModelEvent(event: string, model: TModel, collection: Collection<TModel>, options: any): void;
/**
* Return a shallow copy of this collection's models, using the same options as native Array#slice.
*/
slice(min: number, max?: number): TModel[];
// mixins from underscore
all(iterator: (element: TModel, index: number) => boolean, context?: any): boolean;
any(iterator: (element: TModel, index: number) => boolean, context?: any): boolean;
collect(iterator: (element: TModel, index: number, context?: any) => any[], context?: any): any[];
all(iterator?: _.ListIterator<TModel, boolean>, context?: any): boolean;
any(iterator?: _.ListIterator<TModel, boolean>, context?: any): boolean;
chain(): any;
contains(value: any): boolean;
countBy(iterator: (element: TModel, index: number) => any): _.Dictionary<number>;
countBy(attribute: string): _.Dictionary<number>;
detect(iterator: (item: any) => boolean, context?: any): any; // ???
drop(): TModel;
drop(n: number): TModel[];
each(iterator: (element: TModel, index: number, list?: any) => void, context?: any): any;
every(iterator: (element: TModel, index: number) => boolean, context?: any): boolean;
filter(iterator: (element: TModel, index: number) => boolean, context?: any): TModel[];
find(iterator: (element: TModel, index: number) => boolean, context?: any): TModel;
collect<TResult>(iterator: _.ListIterator<TModel, TResult>, context?: any): TResult[];
contains(value: TModel): boolean;
countBy(iterator?: _.ListIterator<TModel, any>): _.Dictionary<number>;
countBy(iterator: string): _.Dictionary<number>;
detect(iterator: _.ListIterator<TModel, boolean>, context?: any): TModel;
difference(others: TModel[]): TModel[];
drop(n?: number): TModel[];
each(iterator: _.ListIterator<TModel, void>, context?: any): TModel[];
every(iterator: _.ListIterator<TModel, boolean>, context?: any): boolean;
filter(iterator: _.ListIterator<TModel, boolean>, context?: any): TModel[];
find(iterator: _.ListIterator<TModel, boolean>, context?: any): TModel;
findIndex(predicate: _.ListIterator<TModel, boolean>, context?: any): number;
findLastIndex(predicate: _.ListIterator<TModel, boolean>, context?: any): number;
first(): TModel;
first(n: number): TModel[];
foldl(iterator: (memo: any, element: TModel, index: number) => any, initialMemo: any, context?: any): any;
forEach(iterator: (element: TModel, index: number, list?: any) => void, context?: any): any;
groupBy(iterator: (element: TModel, index: number) => string, context?: any): _.Dictionary<TModel[]>;
groupBy(attribute: string, context?: any): _.Dictionary<TModel[]>;
include(value: any): boolean;
indexOf(element: TModel, isSorted?: boolean): number;
foldl<TResult>(iterator: _.MemoIterator<TModel, TResult>, memo?: TResult, context?: any): TResult;
foldr<TResult>(iterator: _.MemoIterator<TModel, TResult>, memo?: TResult, context?: any): TResult;
forEach(iterator: _.ListIterator<TModel, void>, context?: any): TModel[];
groupBy(iterator: _.ListIterator<TModel, any>, context?: any): _.Dictionary<TModel[]>;
groupBy(iterator: string, context?: any): _.Dictionary<TModel[]>;
head(): TModel;
head(n: number): TModel[];
include(value: TModel): boolean;
includes(value: TModel): boolean;
indexBy(iterator: _.ListIterator<TModel, any>, context?: any): _.Dictionary<TModel>;
indexBy(iterator: string, context?: any): _.Dictionary<TModel>;
indexOf(value: TModel, isSorted?: boolean): number;
initial(): TModel;
initial(n: number): TModel[];
inject(iterator: (memo: any, element: TModel, index: number) => any, initialMemo: any, context?: any): any;
isEmpty(object: any): boolean;
invoke(methodName: string, args?: any[]): any;
inject<TResult>(iterator: _.MemoIterator<TModel, TResult>, memo?: TResult, context?: any): TResult;
invoke(methodName: string, ...args: any[]): any;
isEmpty(): boolean;
last(): TModel;
last(n: number): TModel[];
lastIndexOf(element: TModel, fromIndex?: number): number;
map(iterator: (element: TModel, index: number, context?: any) => any, context?: any): any[];
max(iterator?: (element: TModel, index: number) => any, context?: any): TModel;
min(iterator?: (element: TModel, index: number) => any, context?: any): TModel;
reduce(iterator: (memo: any, element: TModel, index: number) => any, initialMemo: any, context?: any): any;
select(iterator: any, context?: any): any[];
lastIndexOf(value: TModel, from?: number): number;
map<TResult>(iterator: _.ListIterator<TModel, TResult>, context?: any): TResult[];
max(iterator?: _.ListIterator<TModel, any>, context?: any): TModel;
min(iterator?: _.ListIterator<TModel, any>, context?: any): TModel;
partition(iterator: _.ListIterator<TModel, boolean>): TModel[][];
reduce<TResult>(iterator: _.MemoIterator<TModel, TResult>, memo?: TResult, context?: any): TResult;
reduceRight<TResult>(iterator: _.MemoIterator<TModel, TResult>, memo?: TResult, context?: any): TResult;
reject(iterator: _.ListIterator<TModel, boolean>, context?: any): TModel[];
rest(n?: number): TModel[];
sample(): TModel;
sample(n: number): TModel[];
select(iterator: _.ListIterator<TModel, boolean>, context?: any): TModel[];
shuffle(): TModel[];
size(): number;
shuffle(): any[];
slice(min: number, max?: number): TModel[];
some(iterator: (element: TModel, index: number) => boolean, context?: any): boolean;
sortBy(iterator: (element: TModel, index: number) => number, context?: any): TModel[];
sortBy(attribute: string, context?: any): TModel[];
sortedIndex(element: TModel, iterator?: (element: TModel, index: number) => number): number;
reduceRight(iterator: (memo: any, element: TModel, index: number) => any, initialMemo: any, context?: any): any[];
reject(iterator: (element: TModel, index: number) => boolean, context?: any): TModel[];
rest(): TModel;
rest(n: number): TModel[];
tail(): TModel;
tail(n: number): TModel[];
toArray(): any[];
without(...values: any[]): TModel[];
some(iterator?: _.ListIterator<TModel, boolean>, context?: any): boolean;
sortBy<TSort>(iterator?: _.ListIterator<TModel, TSort>, context?: any): TModel[];
sortBy(iterator: string, context?: any): TModel[];
tail(n?: number): TModel[];
take(): TModel;
take(n: number): TModel[];
toArray(): TModel[];
without(...values: TModel[]): TModel[];
}
class Router extends Events {
@@ -370,7 +387,6 @@ declare namespace Backbone {
$(selector: any): JQuery;
render(): View<TModel>;
remove(): View<TModel>;
make(tagName: any, attributes?: any, content?: any): any;
delegateEvents(events?: EventsHash): any;
delegate(eventName: string, selector: string, listener: Function): View<TModel>;
undelegateEvents(): any;
+91
View File
@@ -90,6 +90,25 @@ function test_models() {
note.set({ title: "March 20", content: "In his eyes she eclipses..." });
note.set("title", "A Scandal in Bohemia");
let strings: string[]
let value: any;
let values: any[];
let bool: boolean;
// underscore methods
strings = note.keys();
values = note.values();
values = note.pairs();
values = note.invert();
value = note.pick("foo");
value = note.pick("foo", "bar");
value = note.pick((value: any, key: any, object: any) => true);
value = note.omit("foo");
value = note.omit("foo", "bar");
value = note.omit((value: any, key: any, object: any) => true);
value = note.chain().pick().omit().value();
bool = note.isEmpty();
}
class Employee extends Backbone.Model {
@@ -161,6 +180,78 @@ function test_collection() {
book.get("published") === true);
var alphabetical = books.sortBy((book: Book): number => null);
let one: Book;
let models: Book[];
let bool: boolean;
let numDict: _.Dictionary<number>;
let modelDict: _.Dictionary<Book>;
let modelsDict: _.Dictionary<Book[]>;
let num: number;
models = books.slice(1);
models = books.slice(1, 3);
// underscore methods
bool = books.all((value: Book, index: number, list: Book[]) => true);
bool = books.any((value: Book, index: number, list: Book[]) => true);
bool = books.chain().any((value: Book, index: number, list: Book[]) => true).value();
models = books.collect((value: Book, index: number, list: Book[]) => value);
bool = books.contains(book1);
numDict = books.countBy((value: Book, index: number, list: Book[]) => true);
numDict = books.countBy("foo");
one = books.detect((value: Book, index: number, list: Book[]) => true);
models = books.difference([book1]);
models = books.drop();
models = books.each((value: Book, index: number, list: Book[]) => true);
bool = books.every((value: Book, index: number, list: Book[]) => true);
models = books.filter((value: Book, index: number, list: Book[]) => true);
one = books.find((value: Book, index: number, list: Book[]) => true);
num = books.findIndex((value: Book, index: number, list: Book[]) => true);
num = books.findLastIndex((value: Book, index: number, list: Book[]) => true);
one = books.first();
models = books.first(3);
models = books.foldl((prev: Book[], curr: Book, index: number, list: Book[]) => prev, []);
models = books.foldr((prev: Book[], curr: Book, index: number, list: Book[]) => prev, []);
models = books.forEach((value: Book, index: number, list: Book[]) => true);
modelsDict = books.groupBy((value: Book, index: number, list: Book[]) => true);
modelsDict = books.groupBy("foo");
one = books.head();
models = books.head(3);
bool = books.include(book1);
bool = books.includes(book1);
modelDict = books.indexBy((value: Book, index: number, list: Book[]) => true);
modelDict = books.indexBy("foo");
num = books.indexOf(book1, true);
one = books.initial();
models = books.initial(3);
models = books.inject((prev: Book[], curr: Book, index: number, list: Book[]) => prev, []);
one = books.invoke("at", 3);
bool = books.isEmpty();
one = books.last();
models = books.last(3);
num = books.lastIndexOf(book1, 3);
models = books.map((value: Book, index: number, list: Book[]) => value);
one = books.max((value: Book, index: number, list: Book[]) => value);
one = books.min((value: Book, index: number, list: Book[]) => value);
[models] = books.partition((value: Book, index: number, list: Book[]) => true);
models = books.reduce((prev: Book[], curr: Book, index: number, list: Book[]) => prev, []);
models = books.reduceRight((prev: Book[], curr: Book, index: number, list: Book[]) => prev, []);
models = books.reject((value: Book, index: number, list: Book[]) => true);
models = books.rest(3);
one = books.sample();
models = books.sample(3);
models = books.select((value: Book, index: number, list: Book[]) => true);
models = books.shuffle();
num = books.size();
bool = books.some((value: Book, index: number, list: Book[]) => true);
models = books.sortBy((value: Book, index: number, list: Book[]) => value);
models = books.sortBy("foo");
models = books.tail(3);
one = books.take();
models = books.take(3);
models = books.toArray();
models = books.without(book1, book1);
}
//////////
+91
View File
@@ -91,6 +91,25 @@ function test_models() {
note.set({ title: "March 20", content: "In his eyes she eclipses..." });
note.set("title", "A Scandal in Bohemia");
let strings: string[]
let value: any;
let values: any[];
let bool: boolean;
// underscore methods
strings = note.keys();
values = note.values();
values = note.pairs();
values = note.invert();
value = note.pick("foo");
value = note.pick("foo", "bar");
value = note.pick((value: any, key: any, object: any) => true);
value = note.omit("foo");
value = note.omit("foo", "bar");
value = note.omit((value: any, key: any, object: any) => true);
value = note.chain().pick().omit().value();
bool = note.isEmpty();
}
class Employee extends Backbone.Model {
@@ -152,6 +171,78 @@ function test_collection() {
book.get("published") === true);
var alphabetical = books.sortBy((book: Book): number => null);
let one: Book;
let models: Book[];
let bool: boolean;
let numDict: _.Dictionary<number>;
let modelDict: _.Dictionary<Book>;
let modelsDict: _.Dictionary<Book[]>;
let num: number;
models = books.slice(1);
models = books.slice(1, 3);
// underscore methods
bool = books.all((value: Book, index: number, list: Book[]) => true);
bool = books.any((value: Book, index: number, list: Book[]) => true);
bool = books.chain().any((value: Book, index: number, list: Book[]) => true).value();
models = books.collect((value: Book, index: number, list: Book[]) => value);
bool = books.contains(book1);
numDict = books.countBy((value: Book, index: number, list: Book[]) => true);
numDict = books.countBy("foo");
one = books.detect((value: Book, index: number, list: Book[]) => true);
models = books.difference([book1]);
models = books.drop();
models = books.each((value: Book, index: number, list: Book[]) => true);
bool = books.every((value: Book, index: number, list: Book[]) => true);
models = books.filter((value: Book, index: number, list: Book[]) => true);
one = books.find((value: Book, index: number, list: Book[]) => true);
num = books.findIndex((value: Book, index: number, list: Book[]) => true);
num = books.findLastIndex((value: Book, index: number, list: Book[]) => true);
one = books.first();
models = books.first(3);
models = books.foldl((prev: Book[], curr: Book, index: number, list: Book[]) => prev, []);
models = books.foldr((prev: Book[], curr: Book, index: number, list: Book[]) => prev, []);
models = books.forEach((value: Book, index: number, list: Book[]) => true);
modelsDict = books.groupBy((value: Book, index: number, list: Book[]) => true);
modelsDict = books.groupBy("foo");
one = books.head();
models = books.head(3);
bool = books.include(book1);
bool = books.includes(book1);
modelDict = books.indexBy((value: Book, index: number, list: Book[]) => true);
modelDict = books.indexBy("foo");
num = books.indexOf(book1, true);
one = books.initial();
models = books.initial(3);
models = books.inject((prev: Book[], curr: Book, index: number, list: Book[]) => prev, []);
one = books.invoke("at", 3);
bool = books.isEmpty();
one = books.last();
models = books.last(3);
num = books.lastIndexOf(book1, 3);
models = books.map((value: Book, index: number, list: Book[]) => value);
one = books.max((value: Book, index: number, list: Book[]) => value);
one = books.min((value: Book, index: number, list: Book[]) => value);
[models] = books.partition((value: Book, index: number, list: Book[]) => true);
models = books.reduce((prev: Book[], curr: Book, index: number, list: Book[]) => prev, []);
models = books.reduceRight((prev: Book[], curr: Book, index: number, list: Book[]) => prev, []);
models = books.reject((value: Book, index: number, list: Book[]) => true);
models = books.rest(3);
one = books.sample();
models = books.sample(3);
models = books.select((value: Book, index: number, list: Book[]) => true);
models = books.shuffle();
num = books.size();
bool = books.some((value: Book, index: number, list: Book[]) => true);
models = books.sortBy((value: Book, index: number, list: Book[]) => value);
models = books.sortBy("foo");
models = books.tail(3);
one = books.take();
models = books.take(3);
models = books.toArray();
models = books.without(book1, book1);
}
//////////
+6
View File
@@ -0,0 +1,6 @@
/// <reference path="base64-js.d.ts" />
import * as base64js from 'base64-js';
const bytes: Uint8Array = base64js.toByteArray('shemp');
const decoded: string = base64js.fromByteArray(new Uint8Array(0));
+10
View File
@@ -0,0 +1,10 @@
// Type definitions for base64-js v1.1.2
// Project: https://github.com/beatgammit/base64-js
// Definitions by: Peter Safranek <https://github.com/pe8ter>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module 'base64-js' {
export function toByteArray(encoded: string): Uint8Array;
export function fromByteArray(bytes: Uint8Array): string;
}
+8
View File
@@ -174,6 +174,7 @@ declare namespace Microsoft.Maps {
fixedMapPosition?: boolean;
height?: number;
inertiaIntensity?: number;
navigationBarMode?: number;
showBreadcrumb?: boolean;
showCopyright?: boolean;
showDashboard?: boolean;
@@ -216,6 +217,12 @@ declare namespace Microsoft.Maps {
getY(): number;
}
export enum NavigationBarMode {
default,
compact,
minified
}
export enum PixelReference {
control,
page,
@@ -307,6 +314,7 @@ declare namespace Microsoft.Maps {
getZIndex(): number;
setHtmlContent(content: string): void;
setLocation(location: Location): void;
setMap(map: Map): void;
setOptions(options: InfoboxOptions): void;
toString(): string;
}
+1269
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -33,7 +33,7 @@ declare module "body-parser" {
/**
* passed to JSON.parse().
*/
receiver?: (key: string, value: any) => any;
reviver?: (key: string, value: any) => any;
/**
* parse extended syntax with the qs module. (default: true)
*/
@@ -65,7 +65,7 @@ declare module "body-parser" {
/**
* passed to JSON.parse().
*/
receiver?: (key: string, value: any) => any;
reviver?: (key: string, value: any) => any;
}): express.RequestHandler;
export function raw(options?: {
File diff suppressed because it is too large Load Diff
+6 -1
View File
@@ -15,7 +15,7 @@
* http://bootstrap-datepicker.readthedocs.org/en/release/options.html
*/
interface DatepickerOptions {
format?: string;
format?: string | DatepickerCustomFormatOptions;
weekStart?: number;
startDate?: any;
endDate?: any;
@@ -38,6 +38,11 @@ interface DatepickerOptions {
assumeNearbyYear?: any;
}
interface DatepickerCustomFormatOptions {
toDisplay?(date: string, format: any, language: any): string;
toValue?(date: string, format: any, language: any): Date;
}
interface DatepickerEventObject extends JQueryEventObject {
date: Date;
format(format?: string): string;
+5
View File
@@ -44,3 +44,8 @@ $('.typeahead').typeahead({
});
$('#navbar').affix();
$('.item').emulateTransitionEnd(2000);
$.support.transition = false;
console.log(($.support.transition as TransitionEventNames).end === "transitionend");
+11 -1
View File
@@ -53,7 +53,7 @@ interface PopoverOptions {
}
interface CollapseOptions {
parent?: any;
parent?: any;
toggle?: boolean;
}
@@ -79,6 +79,10 @@ interface AffixOptions {
target?: any;
}
interface TransitionEventNames {
end: string;
}
interface JQuery {
modal(options?: ModalOptions): JQuery;
modal(options?: ModalOptionsBackdropString): JQuery;
@@ -114,6 +118,12 @@ interface JQuery {
typeahead(options?: TypeaheadOptions): JQuery;
affix(options?: AffixOptions): JQuery;
emulateTransitionEnd(duration: number): JQuery;
}
interface JQuerySupport {
transition: boolean | TransitionEventNames;
}
declare module "bootstrap" {
+33
View File
@@ -0,0 +1,33 @@
/// <reference path="browser-pack.d.ts" />
import browserPack = require("browser-pack");
module BrowserPackTest {
export function packIt(opts?: BrowserPack.Options) {
var packOpts: BrowserPack.Options = {
basedir: opts.basedir || "./",
externalRequireName: opts.externalRequireName || "require",
hasExports: opts.hasExports || false,
prelude: opts.prelude || undefined,
preludePath: opts.preludePath || undefined,
raw: opts.raw || false,
sourceMapPrefix: opts.sourceMapPrefix || '//#',
standalone: opts.standalone || undefined,
standaloneModule: opts.standaloneModule || undefined,
};
var res = browserPack(); // 'opts' are optional
var res2 = browserPack(packOpts);
// ensure return value is a stream
var res3 = res.pipe(res2);
res.on("error", function (err: any) {
console.error("browser-pack error: ", err);
});
}
}
export = BrowserPackTest;
+61
View File
@@ -0,0 +1,61 @@
// Type definitions for browser-pack v6.0.1
// Project: https://github.com/substack/browser-pack
// Definitions by: TeamworkGuy2 <https://github.com/TeamworkGuy2>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
/** pack node-style source files from a json stream into a browser bundle
*/
declare module BrowserPack {
export interface Options {
/** Whether the bundle should include require= (or the opts.externalRequireName) so that
* require() is available outside the bundle
*/
hasExports?: boolean;
/** A string to use in place of 'require' if opts.hasExports is specified, default is 'require'
*/
externalRequireName?: string;
/** Specify a custom prelude, but know what you're doing first. See the prelude.js file in
* this repo for the default prelude. If you specify a custom prelude, you must also specify
* a valid opts.preludePath to the prelude source file for sourcemaps to work
*/
prelude?: string;
/** prelude.js path if a custom opts.prelude is specified
*/
preludePath?: string;
/** Used if opts.preludePath is undefined, this is used to resolve the prelude.js file location, default: 'process.cwd()'
*/
basedir?: string;
/** if given, the writable end of the stream will expect objects to be written to
* it instead of expecting a stream of json text it will need to parse, default false
*/
raw?: boolean;
/** External string name to use for UMD, if not provided, UMD declaration is not wrapped around output
*/
standalone?: string;
/** Sets the internal module name to export for standalone
*/
standaloneModule?: string;
/** If given and source maps are computed, the opts.sourceMapPrefix string will be used instead of default: '//#'
*/
sourceMapPrefix?: string;
}
}
declare module "browser-pack" {
/** pack node-style source files from a json stream into a browser bundle
*/
function browserPack(opts?: BrowserPack.Options): NodeJS.ReadWriteStream;
export = browserPack;
}
+39
View File
@@ -0,0 +1,39 @@
/// <reference path="./browser-resolve.d.ts" />
import * as browserResolve from 'browser-resolve';
function basic_test_async(callback: (err?: Error, resolved?: string) => void) {
browserResolve('typescript', function(error, resolved) {
if (error) {
return callback(error);
}
callback(null, resolved);
});
}
function basic_test_sync() {
var resolved = browserResolve.sync('typescript');
}
function options_test_async() {
browserResolve('typescript', {
browser: 'jsnext:main',
filename: './browser-resolve/browser-resolve.js',
modules: {
fs: './fs-shim.js'
}
}, function(error, resolved) {
if (error) {
console.error(error);
return;
}
console.log(resolved);
});
}
function options_test_sync() {
var resolved = browserResolve.sync('typescript', {
filename: './browser-resolve/browser-resolve.js',
modules: {}
});
}
+61
View File
@@ -0,0 +1,61 @@
// Type definitions for browser-resolve
// Project: https://github.com/defunctzombie/node-browser-resolve
// Definitions by: Mario Nebl <https://github.com/marionebl/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../resolve/resolve.d.ts" />
declare module 'browser-resolve' {
import * as resolve from 'resolve';
/**
* Callback invoked when resolving asynchronously
*
* @param error
* @param resolved Absolute path to resolved identifier
*/
type resolveCallback = (err?: Error, resolved?: string) => void;
/**
* Resolve a module path and call cb(err, path [, pkg])
*
* @param id Identifier to resolve
* @param callback
*/
function browserResolve(id: string, cb: resolveCallback): void;
/**
* Resolve a module path and call cb(err, path [, pkg])
*
* @param id Identifier to resolve
* @param options Options to use for resolving, optional.
* @param callback
*/
function browserResolve(id: string, opts: browserResolve.AsyncOpts, cb: resolveCallback): void;
/**
* Returns a module path
*
* @param id Identifier to resolve
* @param options Options to use for resolving, optional.
*/
function browserResolveSync(id: string, opts?: browserResolve.SyncOpts): string;
namespace browserResolve {
interface Opts {
// the 'browser' property to use from package.json (defaults to 'browser')
browser?: string;
// the calling filename where the require() call originated (in the source)
filename?: string;
// modules object with id to path mappings to consult before doing manual resolution (use to provide core modules)
modules?: any;
}
export interface AsyncOpts extends resolve.AsyncOpts, Opts {}
export interface SyncOpts extends resolve.SyncOpts, Opts {}
export var sync: typeof browserResolveSync;
}
export = browserResolve
}
+6 -1
View File
@@ -23,6 +23,11 @@ declare class ByteBuffer
*/
static DEFAULT_CAPACITY: number;
/**
* Default endianess of false for big endian.
*/
static DEFAULT_ENDIAN: boolean;
/**
* Default no assertions flag of false.
*/
@@ -96,7 +101,7 @@ declare class ByteBuffer
/**
* Allocates a new ByteBuffer backed by a buffer of the specified capacity.
*/
static allocate( capacity?: number, littleEndian?: number, noAssert?: boolean ): ByteBuffer;
static allocate( capacity?: number, littleEndian?: boolean, noAssert?: boolean ): ByteBuffer;
/**
* Decodes a base64 encoded string to binary like window.atob does.
+51
View File
@@ -0,0 +1,51 @@
/// <reference path="cache-manager.d.ts" />
import * as cacheManager from 'cache-manager'
const memoryCache = cacheManager.caching({ store: 'memory', max: 100, ttl: 10/*seconds*/ });
const ttl = 5;
memoryCache.set('foo', 'bar', { ttl: ttl }, (err) => {
if (err) {
throw err;
}
memoryCache.get('foo', (err, result) => {
// console.log(result);
memoryCache.del('foo', (err) => {
});
});
});
function getUser(id: number, cb: Function) {
cb(null, { id: id, name: 'Bob' });
}
const userId = 123;
const key = 'user_' + userId;
// Note: ttl is optional in wrap()
memoryCache.wrap<{ id: number, name: string }>(key, (cb) => {
getUser(userId, cb);
}, { ttl: ttl }, (err, user) => {
//console.log(user);
// Second time fetches user from memoryCache
memoryCache.wrap<{ id: number, name: string }>(key, (cb) => {
getUser(userId, cb);
}, (err, user) => {
//console.log(user);
});
});
+36
View File
@@ -0,0 +1,36 @@
// Type definitions for cache-manager v1.2.0
// Project: https://github.com/BryanDonovan/node-cache-manager
// Definitions by: Simon Gausmann <https://github.com/GausSim/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module 'cache-manager' {
interface CachingConfig {
ttl: number;
}
interface StoreConfig extends CachingConfig {
store: string;
max?: number;
isCacheableValue?: (value: any) => boolean;
}
interface Cache {
set<T>(key: string, value: T, options: CachingConfig, callback?: (error: any) => void): void;
set<T>(key: string, value: T, ttl: number, callback?: (error: any) => void): void;
wrap<T>(key: string, wrapper: (callback: (error: any, result: T) => void) => void, options: CachingConfig, callback: (error: any, result: T) => void): void;
wrap<T>(key: string, wrapper: (callback: (error: any, result: T) => void) => void, callback: (error: any, result: T) => void): void;
get<T>(key: string, callback: (error: any, result: T) => void): void;
del(key: string, callback?: (error: any) => void): void;
}
module cacheManager {
function caching(ICongig: StoreConfig): Cache;
function multiCaching(Caches: Cache[]): Cache;
}
export = cacheManager;
}
+761
View File
@@ -0,0 +1,761 @@
// Type definitions for nodejs-driver v0.8.2
// Project: https://github.com/datastax/nodejs-driver
// Definitions by: Marc Fisher <http://github.com/Svjard>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
/// <reference path="../long/long.d.ts" />
declare module "cassandra-driver" {
type Callback = Function;
type ResultCallback = (err: Error, result: types.ResultSet) => void;
import * as events from "events";
import * as stream from "stream";
import _Long = require("long");
namespace policies {
namespace addressResolution {
var EC2MultiRegionTranslator: EC2MultiRegionTranslatorStatic;
interface AddressTranslator {
translate(address: string, port: number, callback: Callback): void;
}
interface EC2MultiRegionTranslatorStatic {
new(): EC2MultiRegionTranslator;
}
interface EC2MultiRegionTranslator extends AddressTranslator {
logError(address: string, err: Error): void;
}
}
namespace loadBalancing {
var DCAwareRoundRobinPolicy: DCAwareRoundRobinPolicyStatic;
var RoundRobinPolicy: RoundRobinPolicyStatic;
var TokenAwarePolicy: TokenAwarePolicyStatic;
var WhiteListPolicy: WhiteListPolicyStatic;
interface LoadBalancingPolicy {
init(client: Client, hosts: HostMap, callback: Callback): void;
getDistance(host: Host): types.distance;
newQueryPlan(keyspace: string, queryOptions: any, callback: Callback): void;
}
interface DCAwareRoundRobinPolicyStatic {
new(localDc?: string, usedHostsPerRemoteDc?: number): DCAwareRoundRobinPolicy;
}
interface DCAwareRoundRobinPolicy extends LoadBalancingPolicy {
localHostsArray: Array<Host>;
remoteHostsArray: Array<Host>;
}
interface RoundRobinPolicyStatic {
new(): RoundRobinPolicy;
}
interface RoundRobinPolicy extends LoadBalancingPolicy {}
interface TokenAwarePolicyStatic {
new(childPolicy: LoadBalancingPolicy): TokenAwarePolicy;
}
interface TokenAwarePolicy extends LoadBalancingPolicy {}
interface WhiteListPolicyStatic {
new(childPolicy: LoadBalancingPolicy, whiteList: Array<string>): WhiteListPolicy;
}
interface WhiteListPolicy extends LoadBalancingPolicy {}
}
namespace reconnection {
var ConstantReconnectionPolicy: ConstantReconnectionPolicyStatic;
var ExponentialReconnectionPolicy: ExponentialReconnectionPolicyStatic;
interface ReconnectionPolicy {
newSchedule(): {next: Function};
}
interface ConstantReconnectionPolicyStatic {
new(delay: number): ConstantReconnectionPolicy;
}
interface ConstantReconnectionPolicy extends ReconnectionPolicy {}
interface ExponentialReconnectionPolicyStatic {
new(baseDelay: number, maxDelay: number, startWithNoDelay: boolean): ExponentialReconnectionPolicy;
}
interface ExponentialReconnectionPolicy extends ReconnectionPolicy {}
}
namespace retry {
var RetryPolicy: RetryPolicyStatic;
interface DecisionInfo {
decision: number;
consistency: number;
}
interface RequestInfo {
request: any,
nbRetry: number
}
enum retryDecision {
rethrow = 0,
retry,
ignore
}
interface RetryPolicyStatic {
new (): RetryPolicy;
retryDecision: any;
}
interface RetryPolicy {
onReadTimeout(requestInfo: RequestInfo, consistency: types.consistencies, received: number, blockFor: number, isDataPresent: boolean): DecisionInfo;
onUnavailable(requestInfo: RequestInfo, consistency: types.consistencies, required: number, alive: number): DecisionInfo;
onWriteTimeout(requestInfo: RequestInfo, consistency: types.consistencies, received: number, blockFor: number, writeType: string): DecisionInfo;
rethrowResult(): { decision: retryDecision };
retryResult(): { decision: retryDecision, consistency: types.consistencies, useCurrentHost: boolean };
}
}
}
namespace types {
var BigDecimal: BigDecimalStatic;
var InetAddress: InetAddressStatic;
var Integer: IntegerStatic;
var LocalDate: LocalDateStatic;
var LocalTime: LocalTimeStatic;
var Long: _Long;
var ResultSet: ResultSetStatic;
var ResultStream: ResultStreamStatic;
var Row: RowStatic;
var TimeUuid: TimeUuidStatic;
var Tuple: TupleStatic;
var Uuid: UuidStatic;
enum consistencies {
any = 0,
one,
two,
three,
quorum,
all,
localQuorm,
eachQuorum,
serial,
localSerial,
localOne
}
enum dataTypes {
custom = 0,
ascii,
bigint,
blob,
boolean,
counter,
decimal,
double,
float,
int,
text,
timestamp,
uuid,
varchar,
varint,
timeuuid,
inet,
date,
time,
smallint,
tinyint,
list,
map,
set,
udt,
tuple
}
enum distance {
local = 0,
remote,
ignored
}
interface responseErrorCodes { [key:string]:number; }
interface unset { unset: boolean; }
function generateTimestamp(date?: Date, microseconds?: number): _Long;
function timeuuid(options?: {msecs: number | Date, node: Buffer, clockseq: number, nsecs: number}, buffer?: Buffer, offset?: number): string;
interface BigDecimalStatic {
new (unscaledValue: number, scale: number): BigDecimal;
fromBuffer(buf: Buffer): BigDecimal;
toBuffer(value: BigDecimal): Buffer;
fromString(value: string): BigDecimal;
fromNumber(value: number): BigDecimal;
}
interface BigDecimal {
equals(other: BigDecimal): boolean;
inspect(): string;
notEquals(other: BigDecimal): boolean;
compare(other: BigDecimal): number;
subtract(other: BigDecimal): BigDecimal;
add(other: BigDecimal): BigDecimal;
greaterThan(other: BigDecimal): boolean;
isNegative(): boolean;
isZero(): boolean;
toString(): string;
toNumber(): number;
toJSON(): string;
}
interface InetAddressStatic {
new(buffer: Buffer): InetAddress;
fromString(value: string): InetAddress;
}
interface InetAddress {
equals(other: InetAddress): boolean;
getBuffer(): Buffer;
inspect(): string;
toString(): string;
toJSON(): string;
length: number;
version: number;
}
interface IntegerStatic {
new(bits: Array<number>, sign: number): Integer;
fromInt(value: number): Integer;
fromNumber(value: number): Integer;
fromBits(bits: Array<number>): Integer;
fromString(str: string, opt_radix?: number): Integer;
fromBuffer(bits: Buffer): Integer;
toBuffer(value: Integer): Buffer;
ZERO: Integer;
ONE: Integer;
}
interface Integer {
toInt(): number;
toNumber(): number;
toString(opt_radix?: number): string;
getBits(index: number): number;
getBitsUnsigned(index: number): number;
getSign(): number;
isZero(): boolean;
isNegative(): boolean;
isOdd(): boolean;
equals(other: Integer): boolean;
notEquals(other: Integer): boolean;
greaterThan(other: Integer): boolean;
greaterThanOrEqual(other: Integer): boolean;
lessThan(other: Integer): boolean;
lessThanOrEqual(other: Integer): boolean;
compare(other: Integer): number;
shorten(numBits: number): Integer;
negate(): Integer;
add(other: Integer): Integer;
subtract(other: Integer): Integer;
multiply(other: Integer): Integer;
divide(other: Integer): Integer;
modulo(other: Integer): Integer;
not(): Integer;
and(other: Integer): Integer;
or(other: Integer): Integer;
xor(other: Integer): Integer;
shiftLeft(numBits: number): Integer;
shiftRight(numBits: number): Integer;
inspect(): string;
abs(): Integer;
toJSON(): string;
}
interface LocalDateStatic {
new(year: number, month: number, day: number): LocalDate;
now(): LocalDate;
utcNow(): LocalDate;
fromDate(date: Date): LocalDate;
fromString(value: string): LocalDate;
fromBuffer(buffer: Buffer): LocalDate;
}
interface LocalDate {
_value: number;
year: number;
month: number;
day: number;
equals(other: LocalDate): boolean;
inspect(): string;
toBuffer(): Buffer;
toString(): string;
toJSON(): string;
}
interface LocalTimeStatic {
new (totalNanoseconds: _Long): LocalTime;
fromString(value: string): LocalTime;
now(nanoseconds?: number): LocalTime;
fromDate(date: Date, nanoseconds: number): LocalTime;
fromMilliseconds(milliseconds: number, nanoseconds?: number): LocalTime;
fromBuffer(value: Buffer): LocalTime;
}
interface LocalTime {
hour: number;
minute: number;
second: number;
nanosecond: number;
compare(other: LocalTime): boolean;
equals(other: LocalTime): boolean;
getTotalNanoseconds(): _Long;
inspect(): string;
toBuffer(): Buffer;
toString(): string;
toJSON(): string;
}
interface ResultSetStatic {
new(response: any, host: string, triedHost: { [key:string]: any }, consistency: consistencies): ResultSet;
}
interface ResultSet {
info: {
queriedHost: Host,
triedHosts: { [key:string]:string; },
achievedConsistency: consistencies,
traceId: Uuid,
warnings: Array<string>,
customPayload: any
};
rows: Array<Row>;
rowLength: number;
columns: Array<{ [key:string]:string; }>;
pageState: string;
nextPage: any; // function
first(): Row;
getPageState(): string;
getColumns(): Array<{ [key:string]:string; }>;
}
interface ResultStreamStatic {
new (opt: any): ResultSet;
}
interface ResultStream extends stream.Readable {
buffer: Buffer;
paused: boolean;
_read(): void;
_valve(readNext: Function): void;
add(chunk: Buffer): void;
}
interface RowStatic {
new(columns: Array<{ [key:string]:string; }>): Row;
}
interface Row {
get(columnName: string|number): { [key:string]:any; };
values(): Array<{ [key:string]:any; }>;
keys(): Array<string>;
forEach(callback: Callback): void;
}
interface TimeUuidStatic {
new (value?: Date, ticks?: number, nodeId?: string|Buffer, clockId?: string|Buffer): TimeUuid;
fromDate(date: Date, ticks?: number, nodeId?: string|Buffer, clockId?: string|Buffer): TimeUuid;
fromString(value: string): TimeUuid;
min(date: Date, ticks?: number): TimeUuid;
max(date: Date, ticks?: number): TimeUuid;
now(nodeId?: string|Buffer, clockId?: string|Buffer): TimeUuid;
}
interface TimeUuid extends Uuid {
getDatePrecision(): { date: Date, ticks: number };
getDate(): Date;
getNodeId(): Buffer;
getNodeIdString(): string;
}
interface TupleStatic {
new (...arguments: Array<any>): Tuple;
fromArray(elements: Array<any>): Tuple;
}
interface Tuple {
elements: Array<any>;
length: number;
get(index: number): any;
toString(): string;
toJSON(): string;
values(): Array<any>;
}
interface UuidStatic {
new (buffer: Buffer): Uuid;
fromString(value: string): Uuid;
random(): Uuid;
}
interface Uuid {
buffer: Buffer;
getBuffer(): Buffer;
equals(other: types.Uuid): boolean;
toString(): string;
inspect(): string;
toJSON(): string;
}
}
var Client: ClientStatic;
var Host: HostStatic;
var HostMap: HostMapStatic;
var Encoder: EncoderStatic;
interface ClientOptions {
contactPoints: Array<string>,
keyspace: string,
policies?: {
addressResolution?: policies.addressResolution.AddressTranslator,
loadBalancing?: policies.loadBalancing.LoadBalancingPolicy,
reconnection?: policies.reconnection.ReconnectionPolicy,
retry?: policies.retry.RetryPolicy
},
queryOptions?: QueryOptions,
pooling?: {
heartBeatInterval: number,
coreConnectionsPerHost: { [key:number]:number; },
warmup: boolean;
},
protocolOptions?: {
port: number,
maxSchemaAgreementWaitSeconds: number,
maxVersion: number
},
socketOptions?: {
connectTimeout: number,
defunctReadTimeoutThreshold: number,
keepAlive: boolean,
keepAliveDelay: number,
readTimeout: number,
tcpNoDelay: boolean,
coalescingThreshold: number
},
authProvider?: auth.AuthProvider,
sslOptions?: any,
encoding?: {
map: Function,
set: Function,
copyBuffer: boolean,
useUndefinedAsUnset: boolean
}
}
interface QueryOptions {
autoPage?: boolean;
captureStackTrace?: boolean;
consistency: number;
customPayload?: any;
fetchSize?: number;
hints: Array<string> | Array<Array<string>>;
logged?: boolean;
pageState?: Buffer|string;
prepare?: boolean;
readTimeout?: number;
retry?: policies.retry.RetryPolicy;
retryOnTimeout?: boolean;
routingIndexes?: Array<number>;
routingKey?: Buffer | Array<Buffer>;
routingNames?: Array<string>;
serialConsistency?: number;
timestamp?: number | _Long;
traceQuery?: boolean;
}
interface ClientStatic {
new(options?: ClientOptions): Client;
}
interface Client extends events.EventEmitter {
hosts: HostMap;
keyspace: string;
metadata: metadata.Metadata;
batch(queries: Array<string>|Array<{query: string, params?: any}>, options: QueryOptions, callback: ResultCallback): void;
connect(callback: Callback): void;
eachRow(query: string, params?: any, options?: QueryOptions, rowCallback?: Callback, callback?: Callback): void;
execute(query: string, params?: any, options?: QueryOptions, callback?: ResultCallback): void;
getReplicas(keyspace: string, token: Buffer): Array<any>; // TODO: Should this be a more explicit return?
shutdown(callback?: Callback): void;
stream(query: string, params?: any, options?: QueryOptions, callback?: Callback): void;
}
interface HostStatic {
new(address: string, protocolVersion: number, options: ClientOptions): Host;
}
interface Host extends events.EventEmitter {
address: string;
cassandraVersion: string;
dataCenter: string;
rack: string;
tokens: Array<string>;
canBeConsideredAsUp(): boolean;
getCassandraVersion(): Array<number>;
isUp(): boolean;
}
interface HostMapStatic {
new (): HostMap;
}
interface HostMap extends events.EventEmitter {
length: number;
forEach(callback: Callback): void;
get(key: string): Host;
keys(): Array<string>;
remove(key: string): void;
removeMultiple(keys: Array<string>): void;
set(key: string, value: Host): void;
values(): Array<Host>;
}
interface EncoderStatic {
new(protocolVersion: number, options: ClientOptions) : Encoder;
}
interface Encoder {
decode(buffer: Buffer, type: {code: number, info?: any}): void;
encode(value: any, typeInfo?: string|number|{code: number, info?: any}): Buffer;
}
namespace auth {
var Authenticator: AuthenticatorStatic;
var PlainTextAuthProvider: PlainTextAuthProviderStatic;
interface AuthenticatorStatic {
new (): Authenticator;
}
interface Authenticator {
evaluateChallenge(challenge: Buffer, callback: Callback): void;
initialResponse(callback: Callback): void;
onAuthenticationSuccess(token?: Buffer): void;
}
interface AuthProvider {
newAuthenticator(endpoint: string, name: string): void;
}
interface PlainTextAuthProviderStatic {
new (username: string, password: string): PlainTextAuthProvider;
}
interface PlainTextAuthProvider extends AuthProvider {
newAuthenticator(endpoint: string, name: string): void;
}
}
namespace errors {
abstract class DriverError {
constructor(message: string, constructor?: any);
}
class ArgumentError extends DriverError {
constructor(message: string);
}
class AuthenticationError extends DriverError {
constructor(message: string);
}
class DriverInternalError extends DriverError {
constructor(message: string);
}
class NoHostAvailableError extends DriverError {
constructor(innerErrors: any, message?: string);
}
class NotSupportedError extends DriverError {
constructor(message: string);
}
class OperationTimedOutError extends DriverError {}
class ResponseError extends DriverError {
constructor(code: number, message: string);
}
}
namespace metadata {
var Aggregate: AggregateStatic;
var Index: IndexStatic;
var MaterializedView: MaterializedViewStatic;
var Metadata: MetadataStatic;
var SchemaFunction: SchemaFunctionStatic;
var TableMetadata: TableMetadataStatic;
type caching = "all" | "keys_only" | "rows_only" | "none";
interface AggregateStatic {
new (): Aggregate;
}
interface Aggregate {
argumentTypes: Array<{ code: number, info: any}>;
finalFunction: string;
initCondition: string;
keyspaceName: string,
returnType: string;
signature: Array<string>;
stateFunction: string;
stateType: string;
}
interface DataTypeInfo {
code: number,
info: string | DataTypeInfo | Array<DataTypeInfo>,
options: {
frozen: boolean,
reversed: boolean
}
}
interface ColumnInfo {
name: string,
type: DataTypeInfo
}
interface DataCollection {
bloomFilterFalsePositiveChance: number;
caching: caching;
clusterKeys: Array<{ c: ColumnInfo, index: number, order: string }>;
clusteringOrder: Array<string>;
columns: Array<ColumnInfo>;
columnsByName: { [key: string]: ColumnInfo };
comment: string;
compactionClass: string;
compactionOptions: any;
compression: any;
crcCheckChange?: number;
defaultTtl: number;
extensions: any;
gcGraceSeconds: number;
localReadRepairChance: number;
maxIndexInterval?: number;
minIndexInterval?: number;
name: string;
partitionKeys: Array<{ c: ColumnInfo, index: number }>
populateCacheOnFlush: boolean;
readRepairChance: number;
speculateRetry: string;
}
enum IndexType {
custom = 0,
keys,
composites
}
interface IndexStatic {
new (name: string, target: string, kind: IndexType, options: Object): Index;
fromRows(indexRows: Array<types.Row>): Array<Index>;
fromColumnRows(columnRows: Array<types.Row>, columnsByName: { [key:string]: ColumnInfo }): Array<Index>;
}
interface Index {
kind: IndexType;
name: string;
options: Object;
target: string;
isCompositesKind(): boolean;
isCustomKind(): boolean;
isKeysKind(): boolean;
}
interface MaterializedViewStatic {
new (name: string): MaterializedView;
}
interface MaterializedView extends DataCollection {}
interface MetadataStatic {
new (options: ClientOptions, controlConnection: any): Metadata;
}
interface Metadata {
clearPrepared(): void;
getAggregate(keyspaceName: string, name: string, signature: Array<string> | Array<{ code: number, info: any }>, callback: Callback): void;
getAggregates(keyspaceName: string, name: string, callback: Callback): void;
getFunction(keyspaceName: string, name: string, signature: Array<string> | Array<{ code: number, info: any }>, callback: Callback): void;
getFunctions(keyspaceName: string, name: string, callback: Callback): void;
getMaterializedView(keyspaceName: string, name: string, callback: Callback): void;
getReplicas(keyspaceName: string, tokenBuffer: Buffer): Array<any>;
getTable(keyspaceName: string, name: string, callback: Callback): void;
getTrace(traceId: types.Uuid, callback: Callback): void;
getUdt(keyspaceName: string, name: string, callback: Callback): void;
refreshKeyspace(name: string, callback?: Callback): void;
refreshKeyspaces(callback?: Callback): void;
}
interface SchemaFunctionStatic {
new (): SchemaFunction;
}
interface SchemaFunction {
argumentNames: Array<string>;
argumentTypes: Array<{ code: number, info: any}>;
body: string;
calledOnNullInput: boolean;
keyspaceName: string,
language: string;
name: string;
returnType: string;
signature: Array<string>;
}
interface TableMetadataStatic {
new (name: string): TableMetadata;
}
interface TableMetadata extends DataCollection {
indexes: Array<Index>;
indexInterval?: number;
isCompact: boolean;
memtableFlushPeriod: number;
replicateOnWrite: boolean;
}
}
}
@@ -0,0 +1,11 @@
/// <reference path="cassandra-driver.d.ts" />
import * as cassandra from 'cassandra-driver';
import * as util from 'util';
var client = new cassandra.Client({ contactPoints: ['h1', 'h2'], keyspace: 'ks1'});
var query = 'SELECT email, last_name FROM user_profiles WHERE key=?';
client.execute(query, ['guy'], function(err, result) {
console.log('got user profile with email ' + result.rows[0].email);
});
+5 -5
View File
@@ -1,7 +1,7 @@
// Type definitions for chai-things
// Project: https://github.com/chaijs/chai-things
// Definitions by: David Broder-Rodgers <https://github.com/DavidBR-SW/>
// Definitions: https://github.com/DavidBR-SW/DefinitelyTyped
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../chai/chai.d.ts" />
@@ -25,14 +25,14 @@ declare namespace Chai {
interface Anything extends Assertion {
(): any;
that: Assertion
with: Assertion
that: Assertion;
with: Assertion;
}
interface Something extends Assertion {
(): any;
that: Assertion
with: Assertion
that: Assertion;
with: Assertion;
}
interface Item {
+18
View File
@@ -1930,6 +1930,24 @@ suite('assert', () => {
}, 'expected 5 to be below 5');
});
test('isAtLeast', () => {
assert.isAtLeast(5, 3);
assert.isAtLeast(5, 5);
err(() => {
assert.isAtLeast(3, 5);
}, 'expected 3 to be greater than or equal to 5');
});
test('isAtMost', () => {
assert.isAtMost(3, 5);
assert.isAtMost(5, 5);
err(() => {
assert.isAtMost(5, 3);
}, 'expected 5 to be less than or equal to 3');
});
test('extensible', () => { assert.extensible({}); });
test('isExtensible', () => { assert.isExtensible({}); });
test('notExtensible', () => { assert.notExtensible(Object.preventExtensions({})); });
+3
View File
@@ -271,6 +271,9 @@ declare namespace Chai {
isAbove(val: number, abv: number, msg?: string): void;
isBelow(val: number, blw: number, msg?: string): void;
isAtMost(val: number, atmst: number, msg?: string): void;
isAtLeast(val: number, atlst: number, msg?: string): void;
isFunction(val: any, msg?: string): void;
isNotFunction(val: any, msg?: string): void;
+13
View File
@@ -378,7 +378,20 @@ declare namespace Chai {
}
export interface Config {
/**
* Default: false
*/
includeStack: boolean;
/**
* Default: true
*/
showDiff: boolean;
/**
* Default: 40
*/
truncateThreshold: number;
}
export class AssertionError {
+1 -1
View File
@@ -105,7 +105,7 @@ declare namespace Chartist {
plugins?: Array<any>; // all of these plugins seem to be functions with options, but keeping type any for now
update(data: Object, options?: T, override?: boolean): void;
detatch(): void;
detach(): void;
/**
* Use this function to register event handlers. The handler callbacks are synchronous and will run in the main thread rather than the event loop.
+1 -1
View File
@@ -641,7 +641,7 @@ declare namespace CKEDITOR {
filebrowserImageBrowseLinkUrl?: string;
filebrowserImageBrowseUrl?: string;
filebrowserImageUploadUrl?: string;
filebrowserUploadUr?: string;
filebrowserUploadUrl?: string;
filebrowserWindowFeatures?: string;
filebrowserWindowHeight?: number | string;
filebrowserWindowWidth?: number | string;
+14
View File
@@ -0,0 +1,14 @@
// Type definitions for cliff 0.1.10
// Project: https://github.com/flatiron/cliff
// Definitions by: bryn austin bellomy <https://github.com/brynbellomy>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "cliff" {
export function inspect(obj:any): string;
export function stringifyRows(rows:string[][], colors?:string[]): string;
export function stringifyObjectRows(rows:Array<{}>, keys:string[], colors?:string[]): string;
export function putRows(level:string, rows:string[][], colors?:string[]): void;
export function putObjectRows(level:string, rows:Array<{}>, keys:string[], colors?:string[]): void;
export function putObject(level:string, object:any, rewriters?:any, padding?:any): void;
}
+10 -8
View File
@@ -220,14 +220,7 @@ declare namespace CodeMirror {
/** Get an { left , top , width , height , clientWidth , clientHeight } object that represents the current scroll position, the size of the scrollable area,
and the size of the visible area(minus scrollbars). */
getScrollInfo(): {
left: any;
top: any;
width: any;
height: any;
clientWidth: any;
clientHeight: any;
}
getScrollInfo(): CodeMirror.ScrollInfo;
/** Scrolls the given element into view. pos is a { line , ch } position, referring to a given character, null, to refer to the cursor.
The margin parameter is optional. When given, it indicates the amount of pixels around the given area that should be made visible as well. */
@@ -609,6 +602,15 @@ declare namespace CodeMirror {
text: string;
}
interface ScrollInfo {
left: any;
top: any;
width: any;
height: any;
clientWidth: any;
clientHeight: any;
}
interface TextMarker {
/** Remove the mark. */
clear(): void;
+73
View File
@@ -0,0 +1,73 @@
// Type definitions for Commangular Mock 0.9.0
// Project: http://commangular.org
// Definitions by: Hiraash Thawfeek <https://github.com/hiraash>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module commangular {
///////////////////////////////////////////////////////////////////////////
// Commangular Static
// see http://commangular.org/docs/#commangular-namespace
///////////////////////////////////////////////////////////////////////////
interface ICommAngularStatic {
/**
* Mock dispatch function for testing commands.
*/
dispatch( ec: ICommandCall, callback: Function ): void;
}
interface ICommandCall {
/**
* Name of the command that needs to
* execute
*/
command: string;
/**
* Data that needs to be passed to the command
*/
data?: any;
}
/**
* Object type expected to be passed into the callback function
* of the dispatch() function
*/
interface ICommandInfo {
/**
* The data that was passed into the command
* @param key The property name that is in the object that was passed
*/
dataPassed( key : string ) : any;
/**
* The data that was returned by the command
* @param key The result key that was defined in the command. If no result
* was defined use 'lastResult' as the key
*/
resultKey( key: string ): any;
/**
* Indicates if the command execution was cancelled.
*/
canceled( ): boolean;
/**
* Indicates if the command was executed????
*/
commandExecuted( ): boolean;
}
}
/**
* Mock dispatch function for testing commands.
* @param ec an ICommandCall object
* @param callback The function that will be called upon the completion of the command
* function should expecte an ICommandInfo paramter.
*/
declare function dispatch( ec: commangular.ICommandCall, callback: Function ): void;
+273
View File
@@ -0,0 +1,273 @@
// Type definitions for Commangular 0.9.0
// Project: http://commangular.org
// Definitions by: Hiraash Thawfeek <https://github.com/hiraash>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path='../angularjs/angular.d.ts' />
declare var commangular: commangular.ICommAngularStatic;
declare module commangular {
///////////////////////////////////////////////////////////////////////////
// Commangular Static
// see http://commangular.org/docs/#commangular-namespace
///////////////////////////////////////////////////////////////////////////
interface ICommAngularStatic {
/**
* Use this function to create and register a command with Commangular
*
* @param commandName It's the name of the command you are creating. It's useful to reference the command from the command provider.
* @param commandFunction It's the command class that will be executed when commangular runs this command.
* It has to be something that implements ICommand. Same as angular syntax
* @param commandConfig It's and object with paramaters to configure the command execution.
*/
create (commandName: string, commandFunction: Function, commandConfig?:ICommandConfig) : void;
command (commandName: string, commandFunction: Function, commandConfig?:ICommandConfig) : void;
/**
* This function allows you to hijack the execution before or after and
* execute some cross cutting functionality.
* see http://commangular.org/docs/#command-aspects
* @param aspectDescriptor The interceptor descriptor has two parts 'Where' and 'What'.
* Where do you want to intercept? you've 5 options :
* - @Before : The interceptor will be executed before the command. You will be able to
* cancel the command or modify the data that will be injected in the command or do
* some other operation you need before the command execution.
* - @After : The interceptor will be executed just after the command and before any other next
* command. You can get the lastResult from the command, cancel execution etc etc.
* - @AfterExecution : This intercetor is executed just after the command execute method and
* it can get the result from the command and update it before the onResult method is executed.
* - @AfterThrowing : This interceptor will be executed if the command or any interceptor of
* the command throws an exception. You can get the error throwed injected to do what you need.
* - @Around : The interceptor is executed around a command.That means that a especial
* object 'processor' will be injected in the interceptor and you can invoke the command
* or the next interceptor. It will be better explained below.
* @param aspectFunction It's the command class execute function that will be run for the given aspect.
* @param order You can chain any number of interceptors to the same command, so if you need to executed
* the interceptor in a specific order you can indicate it here. An order of 0 is assigned by default.
*/
aspect ( aspectDescriptor: string, aspectFunction: ICommand, order: number ) : void;
/**
* Event aspects work the same way command aspects do, but they intercept all the command groups instead,
* so you can run some function before the command group starts it's execution , after or when any
* command or interceptor in the group throw an exception.
* see http://commangular.org/docs/#event-aspects
* @param aspectDescriptor The interceptor descriptor has two parts 'Where' and 'What'.
* Where do you want to intercept? you've 3 options :
* - @Before : The interceptor will be executed before the command. You will be able to
* cancel the command or modify the data that will be injected in the command or do
* some other operation you need before the command execution.
* - @After : The interceptor will be executed just after the command and before any other next
* command. You can get the lastResult from the command, cancel execution etc etc.
* - @AfterThrowing : This interceptor will be executed if the command or any interceptor of
* the command throws an exception. You can get the error throwed injected to do what you need.
* @param aspectFunction It's the command class execute function that will be run for the given aspect.
* @param order You can chain any number of interceptors to the same command, so if you need to executed
* the interceptor in a specific order you can indicate it here. An order of 0 is assigned by default.
*/
eventAspect( aspectDescriptor: string, aspectFunction: ICommand, order: number ) : void;
/**
* TBD
*/
resolver( commandName: string, resolverFunction : Function ) : void;
/**
* Clears all commands and aspects registered with commangular.
*/
reset() : void;
/**
* Can be used to enable/disable debug
*/
debug( enableDebug : boolean ) : void;
/**
* TBD
*/
build() : void;
}
/**
* The command function/object
* see http://commangular.org/docs/#commangular-namespace
*/
interface ICommand {
/**
* This function is what gets called when the command executes.
* It can take parameters in as injected by angular
*/
execute() : any;
}
interface IResultCommand extends ICommand{
/**
* Is executed after the execute method and the interception chain and can receive
* the result from the execute method of the same command.
*
* @param result Value/object returned by the execution.
*/
onResult ( result: any ) : void;
/**
* Is executed when the executed method ends with an error. Can receive the error throw by the execute method.
* @param error The error that occured during execution
*/
onError ( error: Error ) : void;
}
/**
* The result object expected in the promise returned by the dispatch function
* This must be extended to add custom result keys
* see http://commangular.org/docs/#returning-result-from-commands
*/
interface ICommandResult {
/**
* By defualt the result of the command will be found in this property
*/
lastResult : any;
}
/**
* Command creation configuration
* see http://commangular.org/docs/#the-command-config-object
*/
interface ICommandConfig {
/**
* This property instruct commangular to keep the value returned by the command in the value
* key passed in 'resultKey'. It has to be a string. It means that after the execution of this
* commands you will be able to inject on the next command using that key and the result of the command will be injected.
*/
resultKey : string;
}
/**
* All the command configuration of your application is done in an angular config block and
* with the $commangularProvider. The provider is responsible to build the command strutures and
* map them to the desired event names. You can create multiple configs blocks in angular, so you
* can have multiple command config blocks to separate functional parts of your application.
* see http://commangular.org/docs/#using-the-provider
*/
interface ICommAngularProvider {
/**
* This function lets you map a even name to a command sequence
* @param eventName An event that will be watched by commangular
*/
mapTo( eventName: string ) : ICommAngularDescriptor;
/**
* Used along with mapTo function. Creates a sequence of commands that
* execute after one and other
* see http://commangular.org/docs/#building-command-sequences
*/
asSequence(): ICommAngularDescriptor;
/**
* Used along with mapTo function. Maps commands to be executed parallel
* see http://commangular.org/docs/#building-parallel-commands
*/
asParallel(): ICommAngularDescriptor;
/**
* A command flow is a decision point inside the command group.You can have any number
* of flows inside a command group and nesting them how you perfer.
* see http://commangular.org/docs/#building-command-flows
*/
asFlow(): ICommAngularDescriptor;
findCommand( eventName: string ): ICommAngularDescriptor;
}
/**
* The service that enables the execution of commands
* see http://commangular.org/docs/#dispatching-events
*/
interface ICommAngularService {
/**
* This function executes the given command sequence.
* see http://commangular.org/docs/#dispatching-events
* @param eventName Name of the even that will trigger a command sequence
* @param data Data of any type that will be passed to the command.
*/
dispatch( eventName: string, data?: any ) : ng.IPromise<any>;
}
interface ICommAngularDescriptor {
/**
* Used along with mapTo function. Creates a sequence of commands that
* execute after one and other
* see http://commangular.org/docs/#building-command-sequences
*/
asSequence (): ICommAngularDescriptor;
/**
* Used along with mapTo function. Maps commands to be executed parallel
* see http://commangular.org/docs/#building-parallel-commands
*/
asParallel(): ICommAngularDescriptor;
/**
* A command flow is a decision point inside the command group.You can have any number
* of flows inside a command group and nesting them how you perfer.
* see http://commangular.org/docs/#building-command-flows
*/
asFlow(): ICommAngularDescriptor;
/**
* Add commands to a descriptor.
* @param command The name that was used to create the command.
*/
add ( command: string ): ICommAngularDescriptor;
/**
* Add descriptor to a descriptor.
* @param descriptor Another descriptor attached to a sequnce of commands.
*/
add ( descriptor: ICommAngularDescriptor ): ICommAngularDescriptor;
/**
* This is to be used with flowing commands to attach an expression that
* evaluates using Angular $parse.
* see http://commangular.org/docs/#building-command-flows
* @param expression A string form expression that can make use of services to validate conditions.
* @param services A comma seperated list of services that are used in the above expression
*/
link ( expression: string, services?: string ): ICommAngularDescriptor;
/**
* Works with the <code>link</code> function to attach a command to the flow if the
* expression becomes truthy.
* see http://commangular.org/docs/#building-command-flows
* @param command The name that was used to create the command.
*/
to ( command: string ): ICommAngularDescriptor;
}
}
/**
* Extending the angular rootScope to include the dispatch function in all scopes.
*/
declare module angular {
interface IRootScopeService {
/**
* Commangular method to execute a command.
* @param eventName Name of the even that will trigger a command sequence
* @param data Data of any type that will be passed to the command.
*/
dispatch( eventName: string, data?: any ) : ng.IPromise<any>;
}
}
+156
View File
@@ -0,0 +1,156 @@
/// <reference path="common-tags.d.ts" />
import * as commonTags from 'common-tags';
/* Test Built-in Tags */
commonTags.commaLists `
I like ${['apples', 'bananas', 'watermelons']}
They're good!
`;
commonTags.commaListsAnd`
I like ${['apples', 'bananas', 'watermelons']}
They're good!
`;
commonTags.commaListsOr`
I like ${['apples', 'bananas', 'watermelons']}
They're good!
`;
let fruits = ['apple', 'orange', 'watermelon'];
commonTags.html`
<div class="list">
<ul>
${fruits.map(fruit => `<li>${fruit}</li>`)}
${'<li>kiwi</li>\n<li>guava</li>'}
</ul>
</div>
`;
commonTags.codeBlock`
<div class="list">
<ul>
${fruits.map(fruit => `<li>${fruit}</li>`)}
${'<li>kiwi</li>\n<li>guava</li>'}
</ul>
</div>
`;
commonTags.source`
<div class="list">
<ul>
${fruits.map(fruit => `<li>${fruit}</li>`)}
${'<li>kiwi</li>\n<li>guava</li>'}
</ul>
</div>
`;
commonTags.oneLine`
foo
bar
baz
`;
commonTags.oneLineTrim`
https://news.com/article
?utm_source=designernews.co
`;
commonTags.oneLineCommaLists`
I like ${['apples', 'bananas', 'watermelons']}
They're good!
`;
commonTags.oneLineCommaListsOr`
I like ${['apples', 'bananas', 'watermelons']}
They're good!
`;
commonTags.oneLineCommaListsAnd`
I like ${['apples', 'bananas', 'watermelons']}
They're good!
`;
commonTags.inlineLists`
I like ${['apples', 'bananas', 'watermelons']}
They're good!
`;
commonTags.oneLineInlineLists`
I like ${['apples', 'bananas', 'watermelons']}
They're good!
`;
let verb = 'notice';
commonTags.stripIndent`
This is a multi-line string.
You'll ${verb} that it is indented.
We don't want to output this indentation.
But we do want to keep this line indented.
`;
commonTags.stripIndents`
This is a multi-line string.
You'll ${verb} that it is indented.
We don't want to output this indentation.
We don't want to keep this line indented either.
`;
/* Test Tag Constructor */
new commonTags.TemplateTag();
const substitutionReplacer = (oldValue : string, newValue : string) => ({
onSubstitution(substitution : string, resultSoFar : string) {
if (substitution === oldValue) {
return newValue;
}
return substitution;
}
});
new commonTags.TemplateTag(substitutionReplacer('fizz', 'buzz'));
new commonTags.TemplateTag(
substitutionReplacer('fizz', 'buzz'),
substitutionReplacer('foo', 'bar')
);
new commonTags.TemplateTag([
substitutionReplacer('fizz', 'buzz'),
substitutionReplacer('foo', 'bar')
]);
new commonTags.TemplateTag({});
new commonTags.TemplateTag({
onEndResult: endResult => `${endResult}!`
});
new commonTags.TemplateTag({
onSubstitution: substitution => `${substitution}!`,
onEndResult: endResult => `${endResult}!`
});
/* Tests Built-in Transformers */
new commonTags.TemplateTag(commonTags.trimResultTransformer());
new commonTags.TemplateTag(commonTags.trimResultTransformer('left'));
new commonTags.TemplateTag(commonTags.trimResultTransformer('right'));
new commonTags.TemplateTag(commonTags.stripIndentTransformer());
new commonTags.TemplateTag(commonTags.stripIndentTransformer('initial'));
new commonTags.TemplateTag(commonTags.stripIndentTransformer('all'));
new commonTags.TemplateTag(commonTags.replaceResultTransformer('foo', 'bar'));
new commonTags.TemplateTag(commonTags.inlineArrayTransformer());
new commonTags.TemplateTag(commonTags.inlineArrayTransformer({}));
new commonTags.TemplateTag(commonTags.inlineArrayTransformer({separator: 'foo'}));
new commonTags.TemplateTag(commonTags.inlineArrayTransformer({conjunction: 'bar'}));
new commonTags.TemplateTag(commonTags.splitStringTransformer('foo'));
+62
View File
@@ -0,0 +1,62 @@
// Type definitions for common-tags v1.2.1
// Project: https://github.com/declandewet/common-tags
// Definitions by: Viktor Zozuliak <https://github.com/zuzusik>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module 'common-tags' {
type TemplateTag = (literals: string[], ...placeholders: any[]) => string;
type TemplateTransformer = {
onSubstitution?: (substitution: string, resultSoFar: string) => string;
onEndResult?: (endResult : string) => string;
}
/* Built-in Tags */
export var commaLists: TemplateTag;
export var commaListsAnd: TemplateTag;
export var commaListsOr: TemplateTag;
export var html: TemplateTag;
export var codeBlock: TemplateTag;
export var source: TemplateTag;
export var oneLine: TemplateTag;
export var oneLineTrim: TemplateTag;
export var oneLineCommaLists: TemplateTag;
export var oneLineCommaListsOr: TemplateTag;
export var oneLineCommaListsAnd: TemplateTag;
export var inlineLists: TemplateTag;
export var oneLineInlineLists: TemplateTag;
export var stripIndent: TemplateTag;
export var stripIndents: TemplateTag;
/* New Tag Constructor */
export var TemplateTag: {
new(): TemplateTag;
new(...transformers: TemplateTransformer[]): TemplateTag;
new(transformers: TemplateTransformer[]): TemplateTag;
};
/* Built-in Transformers */
export var trimResultTransformer: (side?: 'left'|'right') => TemplateTransformer;
export var stripIndentTransformer: (type?: 'initial'|'all') => TemplateTransformer;
export var replaceResultTransformer: (replaceWhat: string, replaceWith: string) => TemplateTransformer;
export var inlineArrayTransformer: (opts?: {separator?: string, conjunction?: string}) => TemplateTransformer;
export var splitStringTransformer: (splitBy: string) => TemplateTransformer;
}
@@ -0,0 +1,52 @@
/// <reference path='../node/node.d.ts' /> // only for require
/// <reference path='component-emitter.d.ts' />
// These are all of the examples from https://www.npmjs.com/package/component-emitter as of June 18, 2016
// These are all of the examples from https://www.npmjs.com/package/component-emitter as of June 18, 2016
var Emitter = require('component-emitter');
var emitter = new Emitter;
emitter.emit('something');
var user = { name: 'tobi' };
Emitter(user);
(<Emitter>user).emit('im a user');
// this example modified from the one on https://www.npmjs.com/package/component-emitter
var User = Object.create({
someUserFunction: () => {console.log('someUserFunction called!')}
})
var another_user = Emitter(User);
another_user.someUserFunction()
another_user.on('hi', () => {console.log('Hi called')})
another_user.emit('hi')
// Additional sample code for this test
function handleSomeRecurringEvent(event_data: any) {
console.log('handle some-recurring-event')
}
emitter.on('some-recurring-event', handleSomeRecurringEvent)
emitter.once('some-single-shot-event', (event_data: any) => {console.log('handle some-single-shot-event')})
emitter.off()
emitter.off('some-recurring-event')
emitter.off('some-recurring-event', handleSomeRecurringEvent)
var event_data = {some: 'data'}
emitter.emit('some-recurring-event')
emitter.emit('some-recurring-event', event_data)
emitter.listeners('some-recurring-event')
emitter.hasListeners('some-recurring-event')
+19
View File
@@ -0,0 +1,19 @@
// Type definitions for component-emitter v1.2.1
// Project: https://www.npmjs.com/package/component-emitter
// Definitions by: Peter Snider <https://github.com/psnider/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped/emitter-component
interface Emitter {
(obj?: Object): Emitter;
on(event: string, listener: Function): Emitter;
once(event: string, listener: Function): Emitter;
off(event?: string, listener?: Function): Emitter;
emit(event: string, ...args: any[]): boolean;
listeners(event: string): Function[];
hasListeners(event: string): boolean;
}
declare module 'component-emitter' {
var Emitter: Emitter;
}
+7
View File
@@ -0,0 +1,7 @@
/// <reference path="./connect-redis.d.ts" />
/// <reference path="../express-session/express-session.d.ts" />
import * as connectRedis from "connect-redis";
import * as session from "express-session";
let RedisStore = connectRedis(session);
+43
View File
@@ -0,0 +1,43 @@
// Type definitions for connect-redis
// Project: https://npmjs.com/package/connect-redis
// Definitions by: Xavier Stouder <https://github.com/xstoudi>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../express/express.d.ts" />
/// <reference path="../express-session/express-session.d.ts" />
/// <reference path="../redis/redis.d.ts" />
declare module "connect-redis" {
import * as express from "express";
import * as session from "express-session";
import * as redis from "redis";
function s(options: (options?: session.SessionOptions) => express.RequestHandler): s.RedisStore;
namespace s {
interface RedisStore extends session.Store {
new (options: RedisStoreOptions): session.Store;
}
interface RedisStoreOptions {
client?: redis.RedisClient;
host?: string;
port?: number;
socket?: string;
url?: string;
ttl?: number;
disableTTL?: boolean;
db?: number;
pass?: string;
prefix?: string;
unref?: boolean;
serializer?: Serializer | JSON;
}
interface Serializer {
stringify: Function;
parse: Function;
}
}
export = s;
}
+2 -1
View File
@@ -16,7 +16,8 @@ declare namespace BeaconPlugin {
export interface LocationManager {
delegate: Delegate;
BeaconRegion: BeaconRegion;
onDomDelegateReady(): void;
Region: Region;
onDomDelegateReady(): Q.Promise<void>;
startMonitoringForRegion(region: Region): Q.Promise<void>;
stopMonitoringForRegion(region: Region): Q.Promise<void>;
requestStateForRegion(region: Region): Q.Promise<void>;
@@ -9,6 +9,18 @@ interface Plugins {
declare module SocialSharingPlugin {
interface ShareOptions {
message: string;
subject?: string;
files?: string | string[];
url?: string;
}
interface ShareResult {
completed: boolean;
app: any;
}
export interface SocialSharing {
/**
@@ -23,6 +35,8 @@ declare module SocialSharingPlugin {
share(message: string, subject?: string, fileOrFileArray?: string | string[], url?: string, successCallback?: (succeeded: boolean) => void, errorCallback?: (errormsg: string) => void): void;
shareWithOptions(options: ShareOptions, successCallback?: (result: ShareResult) => void, errorCallback?: (errormsg: string) => void): void;
shareViaTwitter(message: string, file?: string, url?: string, successCallback?: (succeeded: boolean) => void, errorCallback?: (errormsg: string) => void): void;
shareViaFacebook(message: string, fileOrFileArray?: string | string[], url?: string, successCallback?: (succeeded: boolean) => void, errorCallback?: (errormsg: string) => void): void;
@@ -47,4 +61,4 @@ declare module SocialSharingPlugin {
saveToPhotoAlbum(fileOrFileArray: string | string[], successCallback?: (succeeded: boolean) => void, errorCallback?: (errormsg: string) => void): void;
}
}
}
+14 -2
View File
@@ -29,8 +29,20 @@ declare namespace cucumber {
}
interface HookScenario{
attach(text: string, mimeType?: string, callback?: (err?:any) => void): void;
isFailed() : boolean;
getKeyword():string;
getName():string;
getDescription():string;
getUri():string;
getLine():number;
getTags():string[];
getException():Error;
getAttachments():any[];
attach(data:any, mimeType?:string, callback?:(err?:any) => void):void;
isSuccessful():boolean;
isFailed():boolean;
isPending():boolean;
isUndefined():boolean;
isSkipped():boolean;
}
interface HookCode {
Vendored
+9 -8
View File
@@ -292,17 +292,17 @@ declare namespace d3 {
*/
datum(): Datum;
/**
* Set the data item for each node in the selection.
* @param value the constant element to use for each node
*/
datum<NewDatum>(value: NewDatum): Update<NewDatum>;
/**
* Derive the data item for each node in the selection. Useful for situations such as the HTML5 'dataset' attribute.
* @param value the function to compute data for each node
*/
datum<NewDatum>(value: (datum: Datum, index: number, outerIndex: number) => NewDatum): Update<NewDatum>;
/**
* Set the data item for each node in the selection.
* @param value the constant element to use for each node
*/
datum<NewDatum>(value: NewDatum): Update<NewDatum>;
/**
* Reorders nodes in the selection based on the given comparator. Nodes are re-inserted into the document once sorted.
@@ -1111,8 +1111,7 @@ declare namespace d3 {
export function deviation(array: number[]): number;
export function deviation<T>(array: T[], accessor: (datum: T, index: number) => number): number;
export function bisectLeft(array: number[], x: number, lo?: number, hi?: number): number;
export function bisectLeft(array: string[], x: string, lo?: number, hi?: number): number;
export function bisectLeft<T>(array: T[], x: T, lo?: number, hi?: number): number;
export var bisect: typeof bisectRight;
@@ -3064,6 +3063,8 @@ declare namespace d3 {
}
export interface Partition<T extends partition.Node> {
(root: T): T[];
nodes(root: T): T[];
links(nodes: T[]): partition.Link<T>[];
+1112
View File
File diff suppressed because it is too large Load Diff
+155
View File
@@ -0,0 +1,155 @@
// Type definitions for d3Kit v1.1.0
// Project: https://www.npmjs.com/package/d3kit
// Definitions by: Morgan Benton <https://github.com/morphatic/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../d3/d3.d.ts" />
declare namespace d3kit {
export interface ChartMargin {
top?: number;
right?: number;
bottom?: number;
left?: number;
}
export interface ChartOptions {
margin?: ChartMargin;
offset?: [number,number];
initialWidth?: number;
initialHeight?: number;
[name: string]: any;
}
export interface ChartMixin {
[name: string]: any;
}
export class Skeleton {
constructor(selector: string|Element, options?: ChartOptions, customEvents?: Array<string>);
// Getters
getCustomEventNames(): Array<string>;
getDispatcher(): any; // should be d3.Dispatch but this throws error for user-created events
getInnerWidth(): number;
getInnerHeight(): number;
getLayerOrganizer(): LayerOrganizer;
getRootG(): d3.Selection<any>;
getSvg(): d3.Selection<any>;
// Getter/Setters
data(): any;
data(data?: any, doNotDispatch?: boolean): Skeleton;
options(): any; // wish this could be ChartOptions
options(options: ChartOptions, doNotDispatch?: boolean): Skeleton;
margin(): ChartMargin;
margin(margin: ChartMargin, doNotDispatch?: boolean): Skeleton;
offset(): [number, number];
offset(offset: Array<number>, doNotDispatch?: boolean): Skeleton;
width(): number;
width(value: number|string, doNotDispatch?: boolean): Skeleton;
height(): number;
height(value: number|string, doNotDispatch?: boolean): Skeleton;
dimension(): [number, number];
dimension(dimension: [number|string, number|string], doNotDispatch?: boolean): Skeleton;
autoResize(mode?: string|boolean): string|boolean|void;
autoResizeDetection(method?:string): string|void;
autoResizeToAspectRatio(ratio?: number|boolean): number|boolean|void;
// Other functions
on(eventName: string, listener: (...args: Array<any>) => void): void;
hasData(): boolean;
hasNonZeroArea(): boolean;
mixin(fn: ChartMixin): void;
resizeToFitContainer(mode: string|boolean, doNotDispatch?: boolean): void;
resizeToAspectRatio(ratio: number, doNotDispatch?: boolean): void;
}
interface ChartletPropertyCallback {
(datum?: any, datum_index?: number): any;
}
export interface ChartletEventFunction {
(sel?: d3.Selection<any>, done?: string): (sel: d3.Selection<any>) => void;
}
export class Chartlet {
constructor(
enterFunction?: ChartletEventFunction,
updateFunction?: ChartletEventFunction,
exitFunction?: ChartletEventFunction,
customEventName?: Array<string>);
// Getter functions
getDispatcher(): d3.Dispatch;
getCustomEventNames(): Array<string>;
getPropertyValue(name: string, datum: any, datum_index: number): any;
// Getter/Setter functions
property(name: string): ChartletPropertyCallback;
property(name: string, value: any): Chartlet;
// Enter/Update/Exit functions
enter( sel?: d3.Selection<any>, done?: string): (sel: d3.Selection<any>) => void;
update(sel?: d3.Selection<any>, done?: string): (sel: d3.Selection<any>) => void;
exit( sel?: d3.Selection<any>, done?: string): (sel: d3.Selection<any>) => void;
// Inheritance functions
inheritPropertyFrom(parent_chartlet: Chartlet, parent_property_name: string, child_property_name?: string): void;
inheritPropertiesFrom(parent_chartlet: Chartlet, parent_property_names: Array<string>, child_property_names?: Array<string>): void;
publishEventsTo(dispatcher: d3.Dispatch): Chartlet;
// Events
on(eventName: string, handlerFunction: ChartletEventFunction): void;
}
interface LayerConfig {
name?: string,
names?: Array<string>,
sublayers?: LayerConfig
}
export class LayerOrganizer {
constructor(container: d3.Selection<any>, tag?: string);
create(config: string|Array<string>|LayerConfig|Array<LayerConfig>): d3.Selection<any>|Array<d3.Selection<any>>;
get(name: string): d3.Selection<any>;
has(name: string): boolean;
}
export namespace factory {
export function createChart(
defaultOptions: ChartOptions,
customEvents: Array<string>,
constructor: (skeleton: Skeleton) => void
): (selector: string|Element, options?: ChartOptions, customEvents?: Array<string>) => Skeleton;
}
export namespace helper {
export function debounce(fn: (...args: Array<any>) => void, wait: number, immediate: boolean): (...args: Array<any>) => void;
export function extend(target: Object, ...args: Object[]): Object;
export function deepExtend(target: Object, ...args: Object[]): Object;
export function bindMouseEventsToDispatcher(selection: d3.Selection<any>, dispatch: d3.Dispatch, prefix: string): void;
export function removeAllChildren(selection: d3.Selection<any>, noTransition: boolean): d3.Selection<any>;
export function on(element: Element, type: string, listener: (...args: Array<any>) => void): void;
export function off(element: Element, type: string, listener: (...args: Array<any>) => void): void;
export function trim(str: string, characters: string): string;
export function dasherize(str: string): string;
export function $(s: Element|string): Element;
export function $$(s: Array<Node>|NodeList): Array<Element>;
export function isArray(value: any): boolean;
export function isNumber(value: any): boolean;
export function isObject(value: any): boolean;
export function isElement(o: any): boolean;
export function isFunction(functionToCheck: any): boolean;
}
}
declare module 'd3kit' {
export = d3kit;
}
+146
View File
@@ -0,0 +1,146 @@
/// <reference path='d3pie.d.ts' />
let chart = new d3pie('test',
{
header: {
title: {
text: '',
color: '#333333',
fontSize: 18,
font: 'arial'
},
subtitle: {
color: '#666666',
fontSize: 14,
font: 'arial'
},
location: 'top-center',
titleSubtitlePadding: 8
},
footer: {
text: '',
color: '#666666',
fontSize: 14,
font: 'arial',
location: 'left'
},
size: {
canvasHeight: 500,
canvasWidth: 500,
pieInnerRadius: 0,
pieOuterRadius: null
},
data: {
sortOrder: 'none',
smallSegmentGrouping: {
enabled: false,
value: 1,
valueType: 'percentage',
label: 'Other',
color: '#cccccc'
},
content: []
},
labels: {
outer: {
format: 'label',
hideWhenLessThanPercentage: null,
pieDistance: 30
},
inner: {
format: 'percentage',
hideWhenLessThanPercentage: null
},
mainLabel: {
color: '#333333',
font: 'arial',
fontSize: 10
},
percentage: {
color: '#dddddd',
font: 'arial',
fontSize: 10,
decimalPlaces: 0
},
value: {
color: '#cccc44',
font: 'arial',
fontSize: 10
},
lines: {
enabled: true,
style: 'curved',
color: 'segment' // 'segment' or a hex color
}
},
effects: {
load: {
effect: 'default', // none / default
speed: 1000
},
pullOutSegmentOnClick: {
effect: 'bounce', // none / linear / bounce / elastic / back
speed: 300,
size: 10
},
highlightSegmentOnMouseover: true,
highlightLuminosity: -0.2
},
tooltips: {
enabled: false,
type: 'placeholder', // caption|placeholder
string: '',
placeholderParser: null,
styles: {
fadeInSpeed: 250,
backgroundColor: '#000000',
backgroundOpacity: 0.5,
color: '#efefef',
borderRadius: 2,
font: 'arial',
fontSize: 10,
padding: 4
}
},
misc: {
colors: {
background: null, // transparent
segments: [
'#2484c1', '#65a620', '#7b6888', '#a05d56', '#961a1a',
'#d8d23a', '#e98125', '#d0743c', '#635222', '#6ada6a',
'#0c6197', '#7d9058', '#207f33', '#44b9b0', '#bca44a',
'#e4a14b', '#a3acb2', '#8cc3e9', '#69a6f9', '#5b388f',
'#546e91', '#8bde95', '#d2ab58', '#273c71', '#98bf6e',
'#4daa4b', '#98abc5', '#cc1010', '#31383b', '#006391',
'#c2643f', '#b0a474', '#a5a39c', '#a9c2bc', '#22af8c',
'#7fcecf', '#987ac6', '#3d3b87', '#b77b1c', '#c9c2b6',
'#807ece', '#8db27c', '#be66a2', '#9ed3c6', '#00644b',
'#005064', '#77979f', '#77e079', '#9c73ab', '#1f79a7'
],
segmentStroke: '#ffffff'
},
gradient: {
enabled: false,
percentage: 95,
color: '#000000'
},
canvasPadding: {
top: 5,
right: 5,
bottom: 5,
left: 5
},
pieCenterOffset: {
x: 0,
y: 0
},
cssPrefix: null
},
callbacks: {
onload: null,
onMouseoverSegment: null,
onMouseoutSegment: null,
onClickSegment: null
}
})
+146
View File
@@ -0,0 +1,146 @@
// Type definitions for d3pie 0.1.9
// Project: https://github.com/benkeen/d3pie
// Definitions by: Petryshyn Sergii <https://github.com/mc-petry>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace d3pie {
interface ID3PieChart {
redraw(): void
openSegment(index: number): void
closeSegment(index: void): void
getOpenSegment(): any
updateProp(propKey: string, value: any): void
destroy(): void
}
interface ID3PieStyleOptions {
color?: string
fontSize?: number
font?: string
}
interface ID3PieTextOptions extends ID3PieStyleOptions {
text?: string
}
interface ID3PieLabelsOptions {
format?: 'label' | 'value' | 'percentage' | 'label-value1' | 'label-value2' | 'label-percentage1' | 'label-percentage2'
hideWhenLessThanPercentage?: number
}
interface ID3PieOptions {
header?: {
title?: ID3PieTextOptions
subtitle?: ID3PieTextOptions
location?: 'top-center' | 'top-left' | 'pie-center'
titleSubtitlePadding?: number
}
footer?: { location?: 'left' } & ID3PieTextOptions
size?: {
canvasHeight?: number
canvasWidth?: number
pieOuterRadius?: string | number
pieInnerRadius?: string | number
}
data: {
sortOrder?: 'none' | 'random' | 'value-asc' | 'value-desc' | 'label-asc' | 'label-desc'
smallSegmentGrouping?: {
enabled?: boolean
value?: number
valueType?: 'percentage' | 'value'
label?: string
color?: string
}
content: {
label: string
value: number
color?: string
}[]
}
labels?: {
outer?: { pieDistance?: number } & ID3PieLabelsOptions
inner?: ID3PieLabelsOptions
mainLabel?: ID3PieStyleOptions
percentage?: { decimalPlaces?: number } & ID3PieStyleOptions
value?: ID3PieStyleOptions
lines?: {
enabled?: boolean
style?: 'curved' | 'straight'
color?: string
}
truncation?: {
enabled?: boolean
truncateLength?: number
}
formatter?: (context: {
section: 'outer' | 'inner'
value: number
label: string
}) => string
}
effects?: {
load?: {
effect?: 'none' | 'default'
speed?: number
}
pullOutSegmentOnClick?: {
effect?: 'none' | 'linear' | 'bounce' | 'elastic' | 'back'
speed?: number
size?: number
}
highlightSegmentOnMouseover?: boolean
highlightLuminosity?: number
}
tooltips?: {
enabled?: boolean
type?: 'placeholder' | 'caption'
string?: string
placeholderParser?: (index: number, data: { label?: string, percentage?: number, value?: number }) => void
styles?: {
fadeInSpeed?: number
backgroundColor?: string
backgroundOpacity?: number
color?: string
borderRadius?: number
font?: string
fontSize?: number
padding?: number
}
}
misc?: {
colors?: {
background?: string
segments?: string[]
segmentStroke?: string
}
gradient?: {
enabled?: boolean
percentage?: number
color?: string
}
canvasPadding?: {
top?: number
right?: number
bottom?: number
left?: number
}
pieCenterOffset?: {
x?: number
y?: number
}
cssPrefix?: string
}
callbacks?: {
onload?: Function
onMouseoverSegment?: Function
onMouseoutSegment?: Function
onClickSegment?: Function
}
}
interface ID3PieClass {
new (id: string | HTMLElement, options: ID3PieOptions): ID3PieChart
}
}
declare const d3pie: d3pie.ID3PieClass
+3
View File
@@ -11,6 +11,9 @@ namespace DagreD3Tests {
predecessors["a"] = graph.predecessors("a");
successors["a"] = graph.successors("a");
graph.transition = (selection: d3.Selection<any>) => {
return d3.transition();
};
const render = new dagreD3.render();
const svg = d3.select("svg");
+2
View File
@@ -19,6 +19,8 @@ declare namespace Dagre {
height: number;
predecessors(id: string): string[];
successors(id: string): string[];
// see source of http://cpettitt.github.io/project/dagre-d3/latest/demo/interactive-demo.html
transition?(selection: d3.Selection<any>): d3.Transition<any>;
width: number;
}
@@ -1,4 +1,4 @@
/// <reference path="DataStream.js.d.ts" />
/// <reference path="datastream.js.d.ts" />
var buf = new ArrayBuffer(100);
var ds = new DataStream(buf);
+7
View File
@@ -0,0 +1,7 @@
# DevExpress ASP.NET/MVC TypeScript definitions #
You can use these TypeScript definitions for your web projects, which contain DevExpress ASP.NET or MVC controls. For this, simply add <reference path="TypeScript/devexpress-web.d.ts" /> at the top of your code.
 
The API enclosed into the DevExpress ASP.NET/MVC TypeScript definition file fully corresponds to the API described in the DevExpress ASP.NET/MVC Documentation: [Reference](https://documentation.devexpress.com/#AspNet/DevExpressWebScripts).
 
If you have any issues while using the DevExpress ASP.NET/MVC TypeScript definitions, please refer to our [Support Center](https://www.devexpress.com/Support/Center/Question/List/1).
+414 -59
View File
@@ -1,75 +1,430 @@
/// <reference path="../jquery/jquery.d.ts" />
/// <reference path="devexpress-web.d.ts" />
namespace Tests.Globals {
function ASPxTest(): void {
ASPx.RunStartupScripts();
}
declare var hiddenField: ASPxClientHiddenField;
declare var mainCallbackPanel: ASPxClientCallbackPanel;
declare var loginPopup: ASPxClientPopupControl;
declare var searchButton: ASPxClientButton;
declare var searchComboBox: ASPxClientComboBox;
declare var roomsNumberSpinEdit: ASPxClientSpinEdit;
declare var adultsNumberSpinEdit: ASPxClientSpinEdit;
declare var childrenNumberSpinEdit: ASPxClientSpinEdit;
declare var checkInDateEdit: ASPxClientDateEdit;
declare var checkOutDateEdit: ASPxClientDateEdit;
declare var backSlider: ASPxClientImageSlider;
declare var locationComboBox: ASPxClientComboBox;
declare var nightyRateTrackBar: ASPxClientTrackBar;
declare var customerRatingTrackBar: ASPxClientTrackBar;
declare var ourRatingCheckBoxList: ASPxClientCheckBoxList;
declare var startFilterPopupControl: ASPxClientPopupControl;
declare var imagePopupControl: ASPxClientPopupControl;
declare var emailTextBox: ASPxClientTextBox;
declare var creditCardEmailTextBox: ASPxClientTextBox;
declare var accountEmailTextBox: ASPxClientTextBox;
declare var bookingPageControl: ASPxClientPageControl;
declare var paymentTypePageControl: ASPxClientPageControl;
declare var offerFormPopup: ASPxClientPopupControl;
declare var roomsSpinEdit: ASPxClientSpinEdit;
declare var adultsSpinEdit: ASPxClientSpinEdit;
declare var childrenSpinEdit: ASPxClientSpinEdit;
declare var hotelDetailsCallbackPanel: ASPxClientCallbackPanel;
declare var leftPanel: ASPxClientPanel;
declare var menuButton: ASPxClientButton;
declare var aboutWindow: ASPxClientPopupControl;
declare var offersZone: ASPxClientDockZone;
function ASPxClientControlTest(): void {
ASPxClientControl.AdjustControls();
let controls: DevExpress.Web.Scripts.ASPxClientControlCollection = ASPxClientControl.GetControlCollection();
controls.GetByName("myControl");
module DXDemo {
function showPage(page: string, params: { [key: string]: any }, skipHistory?: boolean): void {
var queryString = getQueryString(params || {});
hiddenField.Set("page", page);
hiddenField.Set("parameters", queryString);
hideMenu();
var uri = queryString.length ? (page + "?" + queryString) : page;
try {
if (!skipHistory && window.history && window.history.pushState)
window.history.pushState(uri, "", uri || "Default.aspx");
} catch (e) { }
mainCallbackPanel.PerformCallback(uri);
};
let elements: DevExpress.Web.Scripts.ASPxClientControl[] = controls.elements;
for (let element of elements) {
let name: string = element.name;
element.AdjustControl();
let mainElement = element.GetMainElement();
if (mainElement) {
mainElement.focus();
}
let isVisible: boolean = element.GetVisible();
let inCallback: boolean = element.InCallback();
element.SetWidth(600);
element.SetHeight(400);
let initEventHandler: (s: DevExpress.Web.Scripts.ASPxClientControl, e: DevExpress.Web.Scripts.ASPxClientEventArgs) => void = (s: DevExpress.Web.Scripts.ASPxClientControl, e: DevExpress.Web.Scripts.ASPxClientEventArgs) => { };
element.Init.AddHandler(initEventHandler);
element.Init.RemoveHandler(initEventHandler);
element.Init.ClearHandlers();
export function onMainMenuItemClick(s: ASPxClientMenu, e: ASPxClientMenuItemClickEventArgs): void {
switch (e.item.name) {
case "login":
hideMenu();
setTimeout(function () { loginPopup.ShowAtElementByID("MainCallbackPanel_ContentPane"); }, 300);
break;
case "offers":
showPage("SpecialOffers", {});
break;
default:
hideMenu();
setTimeout(function () { showAboutWindow(); }, 300);
break;
}
}
};
function ASPxClientUtilsTest(): void {
ASPxClientUtils.AttachEventToElement(document.getElementById("btnSubmit"), "click", () => { });
export function onLoginButtonClick(s: ASPxClientButton, e: ASPxClientButtonClickEventArgs): void {
loginPopup.Hide();
showAboutWindow();
};
let htmlEvent: Event;
let x: number = ASPxClientUtils.GetEventX(htmlEvent);
let y: number = ASPxClientUtils.GetEventY(htmlEvent);
export function onSearchButtonClick(): void {
if (ASPxClientEdit.ValidateGroup("DateEditors")) {
showPage("ShowHotels", {
location: searchComboBox.GetValue(),
checkin: getFormattedDate(<Date>checkInDateEdit.GetValue()),
checkout: getFormattedDate(<Date>checkOutDateEdit.GetValue()),
rooms: roomsNumberSpinEdit.GetValue() || 1,
adults: adultsNumberSpinEdit.GetValue() || 1,
children: childrenNumberSpinEdit.GetValue() || 0
});
}
};
let control: DevExpress.Web.Scripts.ASPxClientControl;
let controlExists: boolean = ASPxClientUtils.IsExists(control);
}
export function onSearchComboBoxIndexChanged(s: ASPxClientComboBox, e: ASPxClientProcessingModeEventArgs): void {
hideMenu();
$("#IndexContent").addClass("search-extend");
searchButton.AdjustControl();
};
function MVCxClientGlobalEventsTest(): void {
ASPxClientGlobalEvents.AddControlsInitializedEventHandler((s: any, e: DevExpress.Web.Scripts.ASPxClientControlsInitializedEventArgs) => {});
}
export function onIndexOfferCloseClick(index: number): void {
var panel = <ASPxClientDockPanel>ASPxClientControl.GetControlCollection().GetByName("OfferDockPanel" + index);
var sibPanel = <ASPxClientDockPanel>ASPxClientControl.GetControlCollection().GetByName("OfferDockPanel" + (index == 1 ? 2 : 1));
panel.Hide();
sibPanel.MakeFloat();
sibPanel.SetWidth(offersZone.GetWidth());
sibPanel.Dock(offersZone);
};
function ASPxClientEditTest(): void {
let editorsValid: boolean = ASPxClientEdit.AreEditorsValid();
export function onLogoClick(): void {
showPage("", null, false);
};
let container: HTMLElement = document.getElementById("form1");
let editorsInContainerGroupValid: boolean = ASPxClientEdit.AreEditorsValid(container, "group1", false);
export function onMenuNavButtonCheckedChanged(s: ASPxClientCheckBox, e: ASPxClientProcessingModeEventArgs): void {
var mainContainer = mainCallbackPanel.GetMainElement();
if (s.GetChecked()) {
backSlider.Pause();
showMenu();
}
else {
hideMenu();
backSlider.Play();
}
};
ASPxClientEdit.ClearEditorsInContainer(container, "group1", false);
ASPxClientEdit.ClearGroup("group1", false);
export function onBackNavButtonClick(s: ASPxClientButton, e: ASPxClientButtonClickEventArgs): void {
var params = getCurrentQueryParams();
switch (getCurrentPage()) {
case "PrintInvoice":
showPage("Booking", params, false);
break;
case "Booking":
if (bookingPageControl.GetActiveTabIndex() > 0)
bookingPageControl.SetActiveTabIndex(bookingPageControl.GetActiveTabIndex() - 1);
else
showPage("ShowRooms", params, false);
break;
case "ShowRooms":
showPage("ShowHotels", params, false);
break;
case "ShowDetails":
showPage("ShowHotels", params, false);
break;
case "ShowHotels":
case "SpecialOffers":
showPage("", null, false);
break;
}
};
let editorsInContainerValid: boolean = ASPxClientEdit.ValidateEditorsInContainer(container, "group1", false);
let editorsInGroupValid: boolean =ASPxClientEdit.ValidateGroup("group1", false);
}
}
export function updateSearchResults(): void {
var params = getCurrentQueryParams();
params["location"] = locationComboBox.GetValue();
params["minprice"] = nightyRateTrackBar.GetPositionStart();
params["maxprice"] = nightyRateTrackBar.GetPositionEnd();
params["custrating"] = customerRatingTrackBar.GetPosition();
params["ourrating"] = ourRatingCheckBoxList.GetSelectedValues().join(",");
showPage("ShowHotels", params);
};
namespace Tests.Controls {
declare var comboBox: DevExpress.Web.Scripts.ASPxClientComboBox;
export function onBookHotelButtonClick(hotelID: string): void {
var queryParams = getCurrentQueryParams();
queryParams["hotelID"] = hotelID;
showPage("ShowRooms", queryParams);
};
function ASPxClientComboBoxTest() {
let selectedIndex: number = comboBox.GetSelectedIndex();
comboBox.SetSelectedIndex(1);
export function onDetailsHotelButtonClick(hotelID: string): void {
var queryParams = getCurrentQueryParams();
queryParams["hotelID"] = hotelID;
showPage("ShowDetails", queryParams);
};
let selectedIndexChangedEventHandler: (s: DevExpress.Web.Scripts.ASPxClientControl, e: DevExpress.Web.Scripts.ASPxClientEventArgs) => void = (s: DevExpress.Web.Scripts.ASPxClientControl, e: DevExpress.Web.Scripts.ASPxClientEventArgs) => { };
comboBox.SelectedIndexChanged.AddHandler(selectedIndexChangedEventHandler);
comboBox.SelectedIndexChanged.RemoveHandler(selectedIndexChangedEventHandler);
comboBox.SelectedIndexChanged.ClearHandlers();
}
}
export function onShowStartFilterButtonClick(s: ASPxClientButton, e: ASPxClientButtonClickEventArgs): void {
startFilterPopupControl.ShowAtElementByID("MainCallbackPanel_ContentPane");
};
export function onChangeStartFilterButtonClick(s: ASPxClientButton, e: ASPxClientButtonClickEventArgs): void {
if (ASPxClientEdit.ValidateGroup("DateEditors")) {
var params = getCurrentQueryParams();
params["checkin"] = getFormattedDate(<Date>checkInDateEdit.GetValue());
params["checkout"] = getFormattedDate(<Date>checkOutDateEdit.GetValue());
params["rooms"] = roomsNumberSpinEdit.GetValue() || 1;
params["adults"] = adultsNumberSpinEdit.GetValue() || 1;
params["children"] = childrenNumberSpinEdit.GetValue() || 0;
startFilterPopupControl.Hide();
showPage(hiddenField.Get("page").toString(), params);
}
};
export function onBookRoomButtonClick(roomID: string): void {
var params = getCurrentQueryParams();
params["roomID"] = roomID;
showPage("Booking", params);
};
export function onShowRoomsButtonClick(): void {
var queryParams = getCurrentQueryParams();
showPage("ShowRooms", queryParams);
};
export function onShowDetailsButtonClick(): void {
var queryParams = getCurrentQueryParams();
showPage("ShowDetails", queryParams);
};
export function onRoomImageNavItemClick(roomID: string, pictureName: string): void {
setTimeout(function () {
imagePopupControl.PerformCallback(roomID + "|" + pictureName);
imagePopupControl.ShowAtElementByID("MainCallbackPanel_ContentPane");
}, 500);
};
export function onRoomsNavBarExpandedChanged(s: ASPxClientNavBar, e: ASPxClientNavBarGroupEventArgs): void {
ASPxClientControl.AdjustControls(s.GetMainElement());
};
export function onNextBookingStepButtonClick(step: number): void {
var valid = true;
var validationGroup = "";
if (step == 1)
validationGroup = "Account";
if (step == 2)
validationGroup = "RoomDetails";
if (step == 3)
validationGroup = "PaymentDetails";
switch (step) {
case 1:
valid = ASPxClientEdit.ValidateEditorsInContainer(bookingPageControl.GetMainElement(), "Account");
if (valid) {
emailTextBox.SetValue(accountEmailTextBox.GetValue());
creditCardEmailTextBox.SetValue(accountEmailTextBox.GetValue());
showPage("Booking", getCurrentQueryParams());
return;
}
break;
case 2:
valid = ASPxClientEdit.ValidateEditorsInContainer(bookingPageControl.GetMainElement(), "RoomDetails");
emailTextBox.SetValue(accountEmailTextBox.GetValue());
break;
case 3:
var paymentType = paymentTypePageControl.GetActiveTabIndex();
if (paymentType == 0)
valid = ASPxClientEdit.ValidateEditorsInContainer(bookingPageControl.GetMainElement(), "CreditCard");
else if (paymentType == 1)
valid = ASPxClientEdit.ValidateEditorsInContainer(bookingPageControl.GetMainElement(), "Cash");
else if (paymentType == 2)
valid = ASPxClientEdit.ValidateEditorsInContainer(bookingPageControl.GetMainElement(), "PayPal");
break;
}
if (valid) {
bookingPageControl.GetTab(step).SetEnabled(true);
bookingPageControl.SetActiveTabIndex(step);
}
};
export function onAccountCaptchaHiddenFieldInit(s: ASPxClientHiddenField, e: ASPxClientEventArgs): void {
if (s.Get("IsCaptchaValid")) {
bookingPageControl.GetTab(1).SetEnabled(true);
bookingPageControl.SetActiveTabIndex(1);
}
};
export function onFinishBookingStepButtonClick(): void {
showAboutWindow();
};
export function OnPrintInvoiceButtonClick(): void {
showPage("PrintInvoice", getCurrentQueryParams());
};
export function onOfferClick(offerID: string): void {
offerFormPopup.SetContentHtml("");
offerFormPopup.PerformCallback(offerID);
var panel = <ASPxClientDockPanel>ASPxClientControl.GetControlCollection().GetByName("DockPanel" + offerID);
var panelElement = <HTMLElement>panel.GetMainElement();
if (panelElement.offsetWidth < 330 || panelElement.offsetHeight < 250) {
offerFormPopup.SetWidth(400);
offerFormPopup.SetHeight(280);
offerFormPopup.ShowAtElementByID("SpecialOffersContainer");
}
else {
offerFormPopup.SetWidth(panelElement.offsetWidth);
offerFormPopup.SetHeight(panelElement.offsetHeight);
offerFormPopup.ShowAtElement(panelElement);
}
};
export function onSpecialOfferCheckButtonClick(hotelID: string, locationID: string): void {
if (ASPxClientEdit.ValidateGroup("DateEditors")) {
var queryParams: { [key: string]: any } = {
location: locationID,
hotelID: hotelID,
checkin: getFormattedDate(<Date>checkInDateEdit.GetValue()),
checkout: getFormattedDate(<Date>checkOutDateEdit.GetValue()),
rooms: roomsSpinEdit.GetValue() || 1,
adults: adultsSpinEdit.GetValue() || 1,
children: childrenSpinEdit.GetValue() || 0
};
showPage("ShowRooms", queryParams);
}
};
export function onIndexOfferClick(): void {
showPage("SpecialOffers", {});
};
export function onControlsInit(): void {
ASPxClientUtils.AttachEventToElement(window, 'popstate', onHistoryPopState);
var pathParts = document.location.href.split("/");
var url = pathParts[pathParts.length - 1];
try {
if (window.history)
window.history.replaceState(url, "");
} catch (e) { }
ASPxClientUtils.AttachEventToElement(window, "resize", onWindowResize);
if (ASPxClientUtils.iOSPlatform) {
$("form :input").blur(function () {
$('html, body').animate({ scrollTop: 0 }, 0);
});
}
};
export function updateRatingLabels(ratingControl: ASPxClientTrackBar) {
$("#cpLeftLabelID").html(ratingControl.GetPositionStart().toString());
$("#cpRightLabelID").html(ratingControl.GetPositionEnd().toString());
};
export function onAboutWindowCloseUp(): void {
$(mainCallbackPanel.GetMainElement()).removeClass("show-about");
};
export function onRatingControlItemClick(s: ASPxClientRatingControl, e: ASPxClientRatingControlItemClickEventArgs): void {
hotelDetailsCallbackPanel.PerformCallback(s.GetValue().toString());
};
export function onInputKeyDown(s: ASPxClientTextBox, e: ASPxClientEditKeyEventArgs): void {
var keyCode = ASPxClientUtils.GetKeyCode(e.htmlEvent);
if (keyCode == 13) {
(<any>jQuery).event.fix(e.htmlEvent).preventDefault();
(<HTMLElement>s.GetInputElement()).blur();
}
};
function getCurrentPage(): string {
var hfPage = <string>hiddenField.Get("page");
if (hfPage)
return hfPage;
var pathParts = document.location.pathname.split("/");
return pathParts[pathParts.length - 1];
};
function showAboutWindow(): void {
$(mainCallbackPanel.GetMainElement()).addClass("show-about");
aboutWindow.ShowAtElementByID("MainCallbackPanel_ContentPane");
};
function hideMenu(): void {
leftPanel.Collapse();
if (menuButton.GetMainElement() && menuButton.GetChecked())
menuButton.SetChecked(false);
};
function showMenu(): void {
leftPanel.Expand();
};
var _resizeSpecialOffersTimeoutID = -1;
function onWindowResize(): void {
switch (<string>hiddenField.Get("page")) {
case "SpecialOffers":
if (_resizeSpecialOffersTimeoutID == -1)
_resizeSpecialOffersTimeoutID = setTimeout(resizeSpecialOffers, 200);
break;
}
hidePopups("AboutWindow", "StartFilterPopupControl", "LoginPopup", "OfferFormPopup", "ImagePopupControl");
};
function hidePopups(...names: string[]): void {
for (var i = 0; i < names.length; i++) {
var popupControl = <ASPxClientPopupControl>ASPxClientControl.GetControlCollection().GetByName(names[i]);
popupControl.Hide();
}
};
function resizeSpecialOffers(): void {
for (var i = 1; i <= 4; i++) {
var panel = <ASPxClientDockPanel>ASPxClientControl.GetControlCollection().GetByName("DockPanel" + i);
if (panel && panel.IsVisible()) {
var zone = panel.GetOwnerZone();
zone.SetWidth((<HTMLElement>(<HTMLElement>zone.GetMainElement()).parentNode).offsetWidth)
}
}
_resizeSpecialOffersTimeoutID = -1;
};
function getFormattedDate(date: Date): string {
return (date.getMonth() + 1) + "-" + date.getDate() + "-" + date.getFullYear();
};
function getCurrentQueryParams(): { [key:string]: any } {
var hfParams = <string>hiddenField.Get("parameters");
if (hfParams)
return getParamsByQueryString(hfParams);
var query = document.location.search;
if (query[0] === "?")
query = query.substr(1);
return getParamsByQueryString(query);
};
function getQueryString(params: { [key:string]: any }): string {
var queryItems: any[] = [];
for (var key in params) {
if (!params.hasOwnProperty(key)) continue;
queryItems.push(key + "=" + params[key]);
}
if (queryItems.length > 0)
return queryItems.join("&");
return "";
};
function getParamsByQueryString(queryString: string): { [key: string]: string } {
var result: { [key: string]: any } = {};
if (queryString) {
var queryStringArray = queryString.split("&");
for (var i = 0; i < queryStringArray.length; i++) {
var part = queryStringArray[i].split('=');
if (part.length != 2) continue;
result[part[0]] = decodeURIComponent(part[1].replace(/\+/g, " "));
}
}
return result;
};
function onHistoryPopState(evt: any): void {
if (evt.state !== null && evt.state !== undefined) {
var uriParts = evt.state.split("?");
showPage(uriParts[0], getParamsByQueryString(uriParts[1]), true);
}
};
}
+26968 -550
View File
File diff suppressed because it is too large Load Diff
+4
View File
@@ -39,6 +39,10 @@ declare class Dexie {
static shallowClone(obj: Object): Object;
static deepClone(obj: Object): Object;
static delete(databaseName : string): Dexie.Promise<void>;
static exists(databaseName : string): Dexie.Promise<boolean>;
version(versionNumber: Number): Dexie.Version
+1 -1
View File
@@ -43,7 +43,7 @@ declare namespace createjs {
export class Bitmap extends DisplayObject {
constructor(imageOrUrl: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | string);
constructor(imageOrUrl: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | Object | string);
// properties
image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement;
+133
View File
@@ -0,0 +1,133 @@
// Type definitions for echarts
// Project: http://echarts.baidu.com/
// Definitions by: Xie Jingyang <https://github.com/xieisabug>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace ECharts {
function init(dom:HTMLDivElement|HTMLCanvasElement, theme?:Object|string, opts?:{
devicePixelRatio?: number
renderer?: string
}):ECharts;
function connect(group:string|Array<string>):void;
function disConnect(group:string):void;
function dispose(target:ECharts|HTMLDivElement|HTMLCanvasElement):void;
function getInstanceByDom(target:HTMLDivElement|HTMLCanvasElement):void;
function registerMap(mapName:string, geoJson:Object, specialAreas?:Object):void;
function registerTheme(themeName:string, theme:Object):void;
class ECharts {
group:string;
setOption(option:EChartOption, notMerge?:boolean, notRefreshImmediately?:boolean):void
getWidth():number
getHeight():number
getDom():HTMLCanvasElement|HTMLDivElement
getOption():Object
resize():void
dispatchAction(payload:Object):void
on(eventName:string, handler:Function, context?:Object):void
off(eventName:string, handler?:Function):void
showLoading(type?:string, opts?:Object):void
hideLoading():void
getDataURL(opts:{
// 导出的格式,可选 png, jpeg
type?: string,
// 导出的图片分辨率比例,默认为 1。
pixelRatio?: number,
// 导出的图片背景色,默认使用 option 里的 backgroundColor
backgroundColor?: string
}):string
getConnectedDataURL(opts:{
// 导出的格式,可选 png, jpeg
type: string,
// 导出的图片分辨率比例,默认为 1。
pixelRatio: number,
// 导出的图片背景色,默认使用 option 里的 backgroundColor
backgroundColor: string
}):string
clear():void
isDisposed():boolean
dispose():void
}
interface EChartOption {
title?: EChartTitleOption
legend?: Object,
grid?: Object,
xAxis?: Object,
yAxis?: Object,
polar?: Object,
radiusAxis?: Object,
angleAxis?: Object,
radar?: Object,
dataZoom?: Array<Object>,
visualMap?: Array<Object>,
tooltip?: Object,
toolbox?: Object,
geo?: Object,
parallel?: Object,
parallelAxis?: Object,
timeline?: Object,
series?: Array<Object>,
color?: Array<Object>,
backgroundColor?: string,
textStyle?: Object,
animation?: boolean,
animationDuration?: number,
animationEasing?: string,
animationDurationUpdate?: number,
animationEasingUpdate?: string
}
interface EChartTitleOption {
show?: boolean;
text?: string;
link?: string,
target?: string,
textStyle?: Object,
subtext?: string,
sublink?: string,
subtarget?: string,
subtextStyle?: Object,
padding?: number,
itemGap?: number,
zlevel?: number,
z?: number,
left?: string,
top?: string,
right?: string,
bottom?: string,
backgroundColor?: string,
borderColor?: string,
borderWidth?: number,
shadowBlur?: number,
shadowColor?: number,
shadowOffsetX?: number,
shadowOffsetY?: number,
}
}
declare module "echarts" {
export = ECharts;
}
+35
View File
@@ -0,0 +1,35 @@
/// <reference path="elasticsearch.d.ts"/>
import elasticsearch = require("elasticsearch");
var client = new elasticsearch.Client({
host: 'localhost:9200',
log: 'trace'
});
client = new elasticsearch.Client({
hosts: [
'box1.server.org',
'box2.server.org'
],
selector: function (hosts: any) { }
});
client.ping({
requestTimeout: 30000,
hello: "elasticsearch"
}, function (error) {
});
client.search({
q: 'pants'
}).then(function (body) {
var hits = body.hits.hits;
}, function (error) {
});
client.indices.delete({
index: 'test_index',
ignore: [404]
}).then(function (body) {
}, function (error) {
});
+274
View File
@@ -0,0 +1,274 @@
// Type definitions for elasticsearch
// Project: https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/index.html
// Definitions by: Casper Skydt <https://github.com/CasperSkydt/DefinitelyTyped>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module Elasticsearch {
export class Client {
constructor(params: ConfigOptions);
indices: Indices;
bulk(params: BulkIndexDocumentsParams): PromiseLike<any>;
bulk(params: BulkIndexDocumentsParams, callback: (error: any, response: any) => void): void;
delete(params: DeleteDocumentParams): PromiseLike<any>;
delete(params: DeleteDocumentParams, callback: (error: any, response: any) => void): void;
get(params: GetParams, callback: (error: any, response: any) => void): void;
get<T>(params: GetParams): PromiseLike<GetResponse<T>>;
index<T>(params: IndexDocumentParams<T>): PromiseLike<any>;
index<T>(params: IndexDocumentParams<T>, callback: (error: any, response: any) => void): void;
mget(params: MGetParams, callback: (error: any, response: any) => void): void;
mget<T>(params: MGetParams): PromiseLike<GetResponse<T>>;
msearch(params: MSearchParams, callback: (error: any, response: any) => void): void;
msearch<T>(params: MSearchParams): PromiseLike<GetResponse<T>>;
ping(params: PingParams): PromiseLike<any>;
ping(params: PingParams, callback: (err: any, response: any, status: any) => void): void;
scroll(params: ScrollParams): PromiseLike<any>;
scroll(params: ScrollParams, callback: (error: any, response: any) => void): void;
search(params: SearchParams): PromiseLike<any>;
search(params: SearchParams, callback: (error: any, response: any) => void): void;
suggest(params: SuggestParams): PromiseLike<any>;
suggest(params: SuggestParams, callback: (error: any, response: any) => void): void;
update(params: UpdateDocumentParams): PromiseLike<any>;
update(params: UpdateDocumentParams, callback: (error: any, response: any) => void): void;
}
export class Indices {
delete(params: IndicesDeleteParams, callback: (error: any, response: any, status: any) => void): void;
delete(params: IndicesDeleteParams): PromiseLike<any>;
create(params: IndicesCreateParams, callback: (error: any, response: any, status: any) => void): void;
create(params: IndicesCreateParams): PromiseLike<any>;
exists(params: IndicesIndexExitsParams, callback: (error: any, response: any, status: any) => void): void;
exists(params: IndicesIndexExitsParams): PromiseLike<any>;
get(params: IndicesGetParams, callback: (error: any, response: any, status: any) => void): void;
get(params: IndicesGetParams): PromiseLike<any>;
getAlias(params: IndicesGetAliasParams, callback: (error: any, response: any, status: any) => void): void;
getAlias(params: IndicesGetAliasParams): PromiseLike<any>;
putAlias(params: IndicesPutAliasParams, callback: (error: any, response: any, status: any) => void): void;
putAlias(params: IndicesPutAliasParams): PromiseLike<any>;
putTemplate(params: IndicesPutTemplateParams, callback: (error: any, response: any) => void): void;
putTemplate(params: IndicesPutTemplateParams): PromiseLike<any>;
refresh(params: IndicesRefreshParams, callback: (error: any, response: any) => void): void;
refresh(params: IndicesRefreshParams): PromiseLike<any>;
}
export interface ConfigOptions{
host?: any;
hosts?: any;
log?: any;
apiVersion?: string;
plugins?: any;
sniffOnStart?: boolean;
sniffInterval?: number;
sniffOnConnectionFault?: boolean;
maxRetries?: number;
requestTimeout?: number;
deadTimeout?: number;
pingTimeout?: number;
keepAlive?: boolean;
maxSockets?: number;
suggestCompression?: boolean;
connectionClass?: string;
sniffedNodesProtocol?: string;
ssl?: Object;
selector?: any;
defer?: () => void;
nodesToHostCallback?: any;
createNodeAgent?: any;
}
export interface GenericParams {
requestTimeout?: number;
maxRetries?: number;
method?: string;
body?: any;
ignore?: number | number[];
}
export interface BulkIndexDocumentsParams extends GenericParams {
refresh?: boolean;
routing? : string;
timeout?: number | Date;
type?: string;
fields?: string | string[] | boolean;
index?: string;
}
export interface IndicesGetParams extends GenericParams {
ignoreUnavailable?: boolean;
index: string | string[] | boolean;
}
export interface IndicesRefreshParams extends GenericParams {
force?: boolean;
ignoreUnavailable?: boolean;
index: string | string[] | boolean;
}
export interface IndicesDeleteParams extends GenericParams {
index: string | string[] | boolean;
timeout?: Date | number;
masterTimeout?: Date | number;
}
export interface IndicesCreateParams extends GenericParams {
index: string | string[] | boolean;
timeout?: Date | number;
masterTimeout?: Date | number;
}
export interface IndicesPutTemplateParams extends GenericParams {
order?: number;
create?: boolean;
timeout?: Date | number;
masterTimeout?: Date | number;
flatSettings?: boolean;
name: string;
body: string | any;
}
export interface IndicesGetAliasParams extends GenericParams {
ignoreUnavailable?: boolean;
allowNoIndices?: boolean;
expandWildcards?: string;
local?: boolean;
index?: string | string[] | boolean;
name: string | string[] | boolean;
}
export interface IndicesPutAliasParams extends GenericParams {
index?: string | string[] | boolean;
name: string | string[] | boolean;
}
export interface GetParams extends GenericParams {
index: string;
type: string;
id: string;
fields?: string | string[] | boolean;
parent?: string;
preference?: string;
realtime?: boolean;
refresh?: boolean;
routing?: string;
_source?: string | string[] | boolean;
_sourceExclude?: string | string[] | boolean;
_sourceInclude?: string | string[] | boolean;
version?: number;
versionType?: string;
}
export interface GetResponse<T> extends GenericParams {
_type: string;
_id: string;
_version: number;
found: boolean;
_source: T;
}
export interface IndexDocumentParams<T> extends GenericParams {
index: string;
type: string;
id: string;
body: T;
consistensy?: string;
parent?: string;
replication?: string;
routing?: string;
timeout?: Date | number;
timestamp?: Date | number;
version?: number;
versionType?: string;
}
export interface ScrollParams extends GenericParams {
scroll: string;
scrollId: string;
}
export interface SearchParams extends GenericParams {
index?: string;
type?: string | string[] | number;
body?: any;
q?: string;
scroll?: string;
search_type?: string;
fields?: string[];
size?: number;
sort?: string | string[] | boolean;
_source?: string | string[] | boolean;
_sourceExclude?: string | string[] | boolean;
_sourceInclude?: string | string[] | boolean;
stats?: string | string[] | boolean;
suggestField?: string;
suggestSize?: number;
suggestText?: string;
timeout?: Date | number;
}
export interface MSearchParams extends GenericParams {
index?: string | string[] | Boolean;
type?: string | string[] | Boolean;
search_type?: string;
}
export interface MGetParams extends GenericParams {
fields?: string | string[] | Boolean;
preference?: string;
realtime?: Boolean;
refresh?: Boolean;
_sourceExclude?: string | string[] | boolean;
_sourceInclude?: string | string[] | boolean;
index?: string;
type?: string;
}
export interface IndicesIndexExitsParams extends GenericParams {
index: string | string[] | boolean;
ignoreUnavailable?: boolean;
}
export interface PingParams extends GenericParams {
requestTimeout?: number;
hello?: string;
}
export interface DeleteDocumentParams extends GenericParams {
index: string;
type: string;
id: string;
refresh?: boolean;
}
export interface UpdateDocumentParams extends GenericParams {
index: string;
type: string;
id: string;
body?: string | any;
version?: Number;
timesstamp?: Date | Number;
scriptedUpsert?: Boolean;
scriptId?: any;
script?: any;
routing?: string;
retryOnConflict?: Number;
refresh?: Boolean;
parent?: string;
lang?:string;
fields?: string | string[] | Boolean;
consistensy?: string;
}
export interface SuggestParams extends GenericParams {
ignoreUnavailable?: boolean;
allowNoIndices?: boolean;
expandWildcards?: string;
preference?: string;
routing?: string;
source?: string;
body: string | any;
index: string | string[] | boolean;
}
}
declare module "elasticsearch" {
export = Elasticsearch;
}
+1
View File
@@ -71,6 +71,7 @@ declare namespace esprima {
LabeledStatement: string,
LogicalExpression: string,
MemberExpression: string,
MetaProperty: string,
MethodDefinition: string,
NewExpression: string,
ObjectExpression: string,
+15
View File
@@ -0,0 +1,15 @@
/// <reference path="exorcist.d.ts" />
import exorcist = require("exorcist");
module ExorcistTest {
function pullSourceMaps(srcPath: string, projRoot: string) {
exorcist(srcPath, undefined, projRoot);
exorcist(srcPath, null, projRoot, null, true);
exorcist(srcPath, null, projRoot, "./");
}
}
export = ExorcistTest;
+21
View File
@@ -0,0 +1,21 @@
// Type definitions for exorcist v0.4.0
// Project: https://github.com/thlorenz/exorcist
// Definitions by: TeamworkGuy2 <https://github.com/TeamworkGuy2>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../through/through.d.ts" />
declare module 'exorcist' {
import through = require("through");
/** Externalizes the source map found inside a stream to an external .map file.
* Works with both JavaScript and CSS input streams
* @param file full path to the map file to which to write the extracted source map
* @param [url] full URL to the map file, set as sourceMappingURL in the streaming output (default: file)
* @param [root] root URL for loading relative source paths, set as sourceRoot in the source map (default: "")
* @param [base] base path for calculating relative source paths (default: use absolute paths)
* @param [errorOnMissing] when truthy, causes 'error' to be emitted instead of 'missing-map' if no map was found in the stream (default: falsey)
*/
function exorcist(file: string, url?: string, root?: string, base?: string, errorOnMissing?: boolean): through.ThroughStream;
export = exorcist;
}
+24 -5
View File
@@ -1,10 +1,29 @@
/// <reference path="./express-graphql.d.ts" />
/// <reference path="../express/express.d.ts" />
/// <reference path="../express-session/express-session.d.ts" />
var express = require("express");
var graphqlHTTP = require("express-graphql");
var app = express();
import * as express from "express";
import * as graphqlHTTP from "express-graphql";
var schema = {};
const app = express();
const schema = {};
app.use("/graphql", graphqlHTTP({ schema: schema, graphiql: true }));
const graphqlOption: graphqlHTTP.OptionsObj = {
graphiql: true,
schema: schema,
formatError: (error:Error) => ({
message: error.message,
})
};
const graphqlOptionRequest = (request: express.Request): graphqlHTTP.OptionsObj => ({
graphiql: true,
schema: schema,
context: request.session,
});
app.use("/graphql1", graphqlHTTP(graphqlOption));
app.use("/graphql2", graphqlHTTP(graphqlOptionRequest));
app.listen(8080);
+37 -29
View File
@@ -8,45 +8,53 @@
declare module "express-graphql" {
import { Request, Response } from "express";
/**
* Used to configure the graphQLHTTP middleware by providing a schema
* and other configuration options.
*/
export type Options = ((req: Request) => OptionsObj) | OptionsObj
export type OptionsObj = {
namespace graphqlHTTP {
/**
* A GraphQL schema from graphql-js.
* Used to configure the graphQLHTTP middleware by providing a schema
* and other configuration options.
*/
schema: Object,
export type Options = ((req:Request) => OptionsObj) | OptionsObj
export type OptionsObj = {
/**
* A GraphQL schema from graphql-js.
*/
schema:Object,
/**
* An object to pass as the rootValue to the graphql() function.
*/
rootValue?: Object,
/**
* A value to pass as the context to the graphql() function.
*/
context?:Object,
/**
* A boolean to configure whether the output should be pretty-printed.
*/
pretty?: boolean,
/**
* An object to pass as the rootValue to the graphql() function.
*/
rootValue?:Object,
/**
* An optional function which will be used to format any errors produced by
* fulfilling a GraphQL operation. If no function is provided, GraphQL's
* default spec-compliant `formatError` function will be used.
*/
formatError?: Function,
/**
* A boolean to configure whether the output should be pretty-printed.
*/
pretty?:boolean,
/**
* A boolean to optionally enable GraphiQL mode.
*/
graphiql?: boolean,
};
/**
* An optional function which will be used to format any errors produced by
* fulfilling a GraphQL operation. If no function is provided, GraphQL's
* default spec-compliant `formatError` function will be used.
*/
formatError?:Function,
type Middleware = (request: Request, response: Response) => void;
/**
* A boolean to optionally enable GraphiQL mode.
*/
graphiql?:boolean,
};
type Middleware = (request:Request, response:Response) => void;
}
/**
* Middleware for express; takes an options object or function as input to
* configure behavior, and returns an express middleware.
*/
export default function graphqlHTTP(options: Options): Middleware;
function graphqlHTTP(options: graphqlHTTP.Options): graphqlHTTP.Middleware;
export = graphqlHTTP;
}
+20 -18
View File
@@ -17,21 +17,23 @@ declare namespace Express {
declare module "express-serve-static-core" {
import * as http from "http";
type RequestHandlerParams = RequestHandler | RequestHandler[];
interface IRoute {
path: string;
stack: any;
all(...handler: RequestHandler[]): IRoute;
get(...handler: RequestHandler[]): IRoute;
post(...handler: RequestHandler[]): IRoute;
put(...handler: RequestHandler[]): IRoute;
delete(...handler: RequestHandler[]): IRoute;
patch(...handler: RequestHandler[]): IRoute;
options(...handler: RequestHandler[]): IRoute;
head(...handler: RequestHandler[]): IRoute;
all(...handler: RequestHandlerParams[]): IRoute;
get(...handler: RequestHandlerParams[]): IRoute;
post(...handler: RequestHandlerParams[]): IRoute;
put(...handler: RequestHandlerParams[]): IRoute;
delete(...handler: RequestHandlerParams[]): IRoute;
patch(...handler: RequestHandlerParams[]): IRoute;
options(...handler: RequestHandlerParams[]): IRoute;
head(...handler: RequestHandlerParams[]): IRoute;
}
interface IRouterMatcher<T> {
(name: string | RegExp, ...handlers: RequestHandler[]): T;
(name: string | RegExp, ...handlers: RequestHandlerParams[]): T;
}
interface IRouter<T> extends RequestHandler {
@@ -86,15 +88,15 @@ declare module "express-serve-static-core" {
options: IRouterMatcher<T>;
head: IRouterMatcher<T>;
route(path: string): IRoute;
route(path: string | RegExp): IRoute;
use(...handler: RequestHandler[]): T;
use(handler: ErrorRequestHandler | RequestHandler): T;
use(path: string, ...handler: RequestHandler[]): T;
use(path: string, handler: ErrorRequestHandler | RequestHandler): T;
use(path: string[], ...handler: RequestHandler[]): T;
use(...handler: RequestHandlerParams[]): T;
use(handler: ErrorRequestHandler | RequestHandlerParams): T;
use(path: string, ...handler: RequestHandlerParams[]): T;
use(path: string, handler: ErrorRequestHandler | RequestHandlerParams): T;
use(path: string[], ...handler: RequestHandlerParams[]): T;
use(path: string[], handler: ErrorRequestHandler): T;
use(path: RegExp, ...handler: RequestHandler[]): T;
use(path: RegExp, ...handler: RequestHandlerParams[]): T;
use(path: RegExp, handler: ErrorRequestHandler): T;
use(path: string, router: Router): T;
}
@@ -860,7 +862,7 @@ declare module "express-serve-static-core" {
set(setting: string, val: any): Application;
get: {
(name: string): any; // Getter
(name: string | RegExp, ...handlers: RequestHandler[]): Application;
(name: string | RegExp, ...handlers: RequestHandlerParams[]): Application;
};
/**
@@ -1006,7 +1008,7 @@ declare module "express-serve-static-core" {
listen(path: string, callback?: Function): http.Server;
listen(handle: any, listeningListener?: Function): http.Server;
route(path: string): IRoute;
route(path: string | RegExp): IRoute;
router: string;
+6 -2
View File
@@ -3,7 +3,7 @@
// Definitions by: kmxz <https://github.com/kmxz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module 'fbemitter' {
declare namespace FBEmitter {
export class EventSubscription {
@@ -64,4 +64,8 @@ declare module 'fbemitter' {
}
}
}
declare module 'fbemitter' {
export = FBEmitter;
}
+1
View File
@@ -150,6 +150,7 @@ interface FBSDKCanvas{
}
interface FBResponseObject {
data: any;
error: any;
}
+2 -2
View File
@@ -30,7 +30,7 @@
percentPosition: false,
prevNextButtons: false,
selectedAttraction: 0.050,
useSetGallerySize: true,
setGallerySize: true,
watchCSS: true,
wrapAround: true,
resize: true,
@@ -64,7 +64,7 @@
percentPosition: false,
prevNextButtons: false,
selectedAttraction: 0.050,
useSetGallerySize: true,
setGallerySize: true,
watchCSS: true,
wrapAround: true,
resize: true,
+1 -1
View File
@@ -269,7 +269,7 @@ interface FlickityOptions {
*
* default: true
*/
useSetGallerySize?: boolean;
setGallerySize?: boolean;
/**
* Adjusts sizes and positions when window is resized.
+3 -3
View File
@@ -1,5 +1,5 @@
/// <reference path="flux.d.ts" />
/// <reference path="../react/react.d.ts" />
/// <reference path="../react/react.d.ts" />
import flux = require('flux')
import FluxUtils = require('flux/utils')
@@ -88,7 +88,7 @@ export = customDispatcher
// Sample Reduce Store
class CounterStore extends FluxUtils.ReduceStore<number> {
class CounterStore extends FluxUtils.ReduceStore<number, Action> {
getInitialState(): number {
return 0;
}
@@ -126,4 +126,4 @@ class CounterContainer extends Component<any, any> {
}
}
const container = Container.create(CounterContainer);
const container = Container.create<CounterContainer>(CounterContainer);
+35 -13
View File
@@ -4,6 +4,8 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../react/react.d.ts" />
/// <reference path="../fbemitter/fbemitter.d.ts" />
/// <reference path="../immutable/immutable.d.ts" />
declare namespace Flux {
@@ -71,6 +73,29 @@ declare module "flux" {
declare namespace FluxUtils {
import React = __React;
import fbEmitter = FBEmitter;
import immutable = Immutable;
/**
* Default options to create a Container with
*
* @interface RealOptions
*/
interface RealOptions {
/**
* Default value: true
*
* @type {boolean}
*/
pure?: boolean;
/**
* Default value: false
*
* @type {boolean}
*/
withProps?: boolean;
}
export class Container {
constructor();
/**
@@ -78,14 +103,13 @@ declare namespace FluxUtils {
* that updates its state when relevant stores change.
* The provided base class must have static methods getStores() and calculateState().
*/
static create(base: React.ComponentClass<any>, options?: any): React.ComponentClass<any>;
static create<TComponent>(base: React.ComponentClass<TComponent>, options?: RealOptions): React.ComponentClass<TComponent>;
}
/**
* This class extends ReduceStore and defines the state as an immutable map.
*/
// TODO: Change <any> to <Immutable.Map<K, V>>
export class MapStore<K extends string | number, V> extends ReduceStore<any> {
export class MapStore<K extends string | number, V, TPayload> extends ReduceStore<immutable.Map<K, V>, TPayload> {
/**
* Access the value at the given key.
* Throws an error if the key does not exist in the cache.
@@ -108,12 +132,10 @@ declare namespace FluxUtils {
* it allows providing a previous result to update instead of generating a new map.
* Providing a previous result allows the possibility of keeping the same reference if the keys did not change.
*/
// TODO: Update with Immutable interface.
// getAll(keys: Immutable.IndexedIterable<K>, prev?: Immutable.Map<K, V>): Immutable.Map<K, V>;
getAll(keys: any, prev?: any): any;
getAll(keys: immutable.Iterable.Indexed<K>, prev?: immutable.Map<K, V>): immutable.Map<K, V>;
}
export class ReduceStore<T> extends Store {
export class ReduceStore<T, TPayload> extends Store<TPayload> {
/**
* Getter that exposes the entire state of this store.
* If your state is not immutable you should override this and not expose state directly.
@@ -131,7 +153,7 @@ declare namespace FluxUtils {
* All subclasses must implement this method.
* This method should be pure and have no side-effects.
*/
reduce(state: T, action: any): T;
reduce(state: T, action: TPayload): T;
/**
* Checks if two versions of state are the same.
@@ -141,24 +163,24 @@ declare namespace FluxUtils {
}
export class Store {
export class Store<TPayload> {
/**
* Constructs and registers an instance of this store with the given dispatcher.
*/
constructor(dispatcher: Flux.Dispatcher<any>);
constructor(dispatcher: Flux.Dispatcher<TPayload>);
/**
* Adds a listener to the store, when the store changes the given callback will be called.
* A token is returned that can be used to remove the listener.
* Calling the remove() function on the returned token will remove the listener.
*/
addListener(callback: Function): { remove: Function };
addListener(callback: Function): fbEmitter.EventSubscription;
/**
* Returns the dispatcher this store is registered with.
*/
getDispatcher(): Flux.Dispatcher<any>;
getDispatcher(): Flux.Dispatcher<TPayload>;
/**
* Returns the dispatch token that the dispatcher recognizes this store by.
@@ -185,7 +207,7 @@ declare namespace FluxUtils {
* This is how the store receives actions from the dispatcher.
* All state mutation logic must be done during this method.
*/
__onDispatch(payload: any): void;
__onDispatch(payload: TPayload): void;
}
}
-179
View File
@@ -2,50 +2,16 @@
/// <reference path="../node/node.d.ts" />
import fs = require('fs-extra');
import stream = require('stream');
var stats: fs.Stats;
var str: string;
var strArr: string[];
var bool: boolean;
var num: number;
var src: string;
var dest: string;
var file: string;
var filename: string;
var dir: string;
var path: string;
var data: any;
var object: Object;
var buffer: NodeBuffer;
var modeNum: number;
var modeStr: string;
var encoding: string;
var type: string;
var flags: string;
var srcpath: string;
var dstpath: string;
var oldPath: string;
var newPath: string;
var cache: string;
var offset: number;
var length: number;
var position: number;
var cacheBool: boolean;
var cacheStr: string;
var fd: number;
var len: number;
var uid: number;
var gid: number;
var atime: number;
var mtime: number;
var statsCallback: (err: Error, stats: fs.Stats) => void;
var errorCallback: (err: Error) => void;
var openOpts: fs.OpenOptions;
var watcher: fs.FSWatcher;
var readStreeam: stream.Readable;
var writeStream: stream.Writable;
var outputStream: stream.Writable;
fs.copy(src, dest, errorCallback);
fs.copy(src, dest, (src: string) => {
@@ -125,130 +91,6 @@ fs.writeJSON(file, object, openOpts, errorCallback);
fs.writeJsonSync(file, object, openOpts);
fs.writeJSONSync(file, object, openOpts);
fs.rename(oldPath, newPath, errorCallback);
fs.renameSync(oldPath, newPath);
fs.truncate(fd, len, errorCallback);
fs.truncateSync(fd, len);
fs.chown(path, uid, gid, errorCallback);
fs.chownSync(path, uid, gid);
fs.fchown(fd, uid, gid, errorCallback);
fs.fchownSync(fd, uid, gid);
fs.lchown(path, uid, gid, errorCallback);
fs.lchownSync(path, uid, gid);
fs.chmod(path, modeNum, errorCallback);
fs.chmod(path, modeStr, errorCallback);
fs.chmodSync(path, modeNum);
fs.chmodSync(path, modeStr);
fs.fchmod(fd, modeNum, errorCallback);
fs.fchmod(fd, modeStr, errorCallback);
fs.fchmodSync(fd, modeNum);
fs.fchmodSync(fd, modeStr);
fs.lchmod(path, modeStr, errorCallback);
fs.lchmod(path, modeNum, errorCallback);
fs.lchmodSync(path, modeNum);
fs.lchmodSync(path, modeStr);
fs.stat(path, statsCallback);
fs.lstat(path, statsCallback);
fs.fstat(fd, statsCallback);
stats = fs.statSync(path);
stats = fs.lstatSync(path);
stats = fs.fstatSync(fd);
fs.link(srcpath, dstpath, errorCallback);
fs.linkSync(srcpath, dstpath);
fs.symlink(srcpath, dstpath, type, errorCallback);
fs.symlinkSync(srcpath, dstpath, type);
fs.readlink(path, (err: Error, linkString: string) => {
});
fs.realpath(path, (err: Error, resolvedPath: string) => {
});
fs.realpath(path, cache, (err: Error, resolvedPath: string) => {
});
str = fs.realpathSync(path, cacheBool);
fs.unlink(path, errorCallback);
fs.unlinkSync(path);
fs.rmdir(path, errorCallback);
fs.rmdirSync(path);
fs.mkdir(path, modeNum, errorCallback);
fs.mkdir(path, modeStr, errorCallback);
fs.mkdirSync(path, modeNum);
fs.mkdirSync(path, modeStr);
fs.readdir(path, (err: Error, files: string[]) => {
});
strArr = fs.readdirSync(path);
fs.close(fd, errorCallback);
fs.closeSync(fd);
fs.open(path, flags, modeStr, (err: Error, fd: number) => {
});
num = fs.openSync(path, flags, modeStr);
fs.utimes(path, atime, mtime, errorCallback);
fs.utimesSync(path, atime, mtime);
fs.futimes(fd, atime, mtime, errorCallback);
fs.futimesSync(fd, atime, mtime);
fs.fsync(fd, errorCallback);
fs.fsyncSync(fd);
fs.write(fd, buffer, offset, length, position, (err: Error, written: number, buffer: NodeBuffer) => {
});
num = fs.writeSync(fd, buffer, offset, length, position);
fs.read(fd, buffer, offset, length, position, (err: Error, bytesRead: number, buffer: NodeBuffer) => {
});
num = fs.readSync(fd, buffer, offset, length, position);
fs.readFile(filename, (err: Error, data: NodeBuffer) => {
});
fs.readFile(filename, encoding, (err: Error, data: string) => {
});
fs.readFile(filename, openOpts, (err: Error, data: string) => {
});
fs.readFile(filename, (err: Error, data: NodeBuffer) => {
});
buffer = fs.readFileSync(filename);
str = fs.readFileSync(filename, encoding);
str = fs.readFileSync(filename, openOpts);
fs.writeFile(filename, data, errorCallback);
fs.writeFile(filename, data, encoding, errorCallback);
fs.writeFile(filename, data, openOpts, errorCallback);
fs.writeFileSync(filename, data);
fs.writeFileSync(filename, data, encoding);
fs.writeFileSync(filename, data, openOpts);
fs.appendFile(filename, data, errorCallback);
fs.appendFile(filename, data, encoding, errorCallback);
fs.appendFile(filename, data, openOpts, errorCallback);
fs.appendFileSync(filename, data);
fs.appendFileSync(filename, data, encoding);
fs.appendFileSync(filename, data, openOpts);
fs.watchFile(filename, {
curr: stats,
prev: stats
});
fs.watchFile(filename, {
persistent: bool,
interval: num
}, {
curr: stats,
prev: stats
});
fs.unwatchFile(filename);
watcher = fs.watch(filename, { persistent: bool }, (event: string, filename: string) => {
});
fs.exists(path, (exists: boolean) => {
});
bool = fs.existsSync(path);
fs.ensureDir(path, errorCallback);
fs.ensureDirSync(path);
fs.ensureFile(path, errorCallback);
@@ -259,24 +101,3 @@ fs.ensureSymlink(path, errorCallback);
fs.ensureSymlinkSync(path);
fs.emptyDir(path, errorCallback);
fs.emptyDirSync(path);
readStreeam = fs.createReadStream(path);
readStreeam = fs.createReadStream(path, {
flags: str,
encoding: str,
fd: num,
mode: num,
bufferSize: num
});
writeStream = fs.createWriteStream(path);
writeStream = fs.createWriteStream(path, {
flags: str,
encoding: str,
string: str
});
outputStream = fs.createOutputStream(path);
outputStream = fs.createOutputStream(path, {
flags: str,
encoding: str,
string: str
});
+7 -131
View File
@@ -8,39 +8,8 @@
///<reference path="../node/node.d.ts"/>
declare module "fs-extra" {
import stream = require("stream");
export * from "fs";
export interface Stats {
isFile(): boolean;
isDirectory(): boolean;
isBlockDevice(): boolean;
isCharacterDevice(): boolean;
isSymbolicLink(): boolean;
isFIFO(): boolean;
isSocket(): boolean;
dev: number;
ino: number;
mode: number;
nlink: number;
uid: number;
gid: number;
rdev: number;
size: number;
blksize: number;
blocks: number;
atime: Date;
mtime: Date;
ctime: Date;
}
export interface FSWatcher {
close(): void;
}
export class ReadStream extends stream.Readable { }
export class WriteStream extends stream.Writable { }
//extended methods
export function copy(src: string, dest: string, callback?: (err: Error) => void): void;
export function copy(src: string, dest: string, filter: CopyFilter, callback?: (err: Error) => void): void;
export function copy(src: string, dest: string, options: CopyOptions, callback?: (err: Error) => void): void;
@@ -77,8 +46,6 @@ declare module "fs-extra" {
export function remove(dir: string, callback?: (err: Error) => void): void;
export function removeSync(dir: string): void;
// export function delete(dir: string, callback?: (err: Error) => void): void;
// export function deleteSync(dir: string): void;
export function writeJson(file: string, object: any, callback?: (err: Error) => void): void;
export function writeJson(file: string, object: any, options?: OpenOptions, callback?: (err: Error) => void): void;
@@ -88,98 +55,22 @@ declare module "fs-extra" {
export function writeJsonSync(file: string, object: any, options?: OpenOptions): void;
export function writeJSONSync(file: string, object: any, options?: OpenOptions): void;
export function rename(oldPath: string, newPath: string, callback?: (err: Error) => void): void;
export function renameSync(oldPath: string, newPath: string): void;
export function truncate(fd: number, len: number, callback?: (err: Error) => void): void;
export function truncateSync(fd: number, len: number): void;
export function chown(path: string, uid: number, gid: number, callback?: (err: Error) => void): void;
export function chownSync(path: string, uid: number, gid: number): void;
export function fchown(fd: number, uid: number, gid: number, callback?: (err: Error) => void): void;
export function fchownSync(fd: number, uid: number, gid: number): void;
export function lchown(path: string, uid: number, gid: number, callback?: (err: Error) => void): void;
export function lchownSync(path: string, uid: number, gid: number): void;
export function chmod(path: string, mode: number, callback?: (err: Error) => void): void;
export function chmod(path: string, mode: string, callback?: (err: Error) => void): void;
export function chmodSync(path: string, mode: number): void;
export function chmodSync(path: string, mode: string): void;
export function fchmod(fd: number, mode: number, callback?: (err: Error) => void): void;
export function fchmod(fd: number, mode: string, callback?: (err: Error) => void): void;
export function fchmodSync(fd: number, mode: number): void;
export function fchmodSync(fd: number, mode: string): void;
export function lchmod(path: string, mode: string, callback?: (err: Error) => void): void;
export function lchmod(path: string, mode: number, callback?: (err: Error) => void): void;
export function lchmodSync(path: string, mode: number): void;
export function lchmodSync(path: string, mode: string): void;
export function stat(path: string, callback?: (err: Error, stats: Stats) => void): void;
export function lstat(path: string, callback?: (err: Error, stats: Stats) => void): void;
export function fstat(fd: number, callback?: (err: Error, stats: Stats) => void): void;
export function statSync(path: string): Stats;
export function lstatSync(path: string): Stats;
export function fstatSync(fd: number): Stats;
export function link(srcpath: string, dstpath: string, callback?: (err: Error) => void): void;
export function linkSync(srcpath: string, dstpath: string): void;
export function symlink(srcpath: string, dstpath: string, type?: string, callback?: (err: Error) => void): void;
export function symlinkSync(srcpath: string, dstpath: string, type?: string): void;
export function readlink(path: string, callback?: (err: Error, linkString: string) => void): void;
export function realpath(path: string, callback?: (err: Error, resolvedPath: string) => void): void;
export function realpath(path: string, cache: string, callback: (err: Error, resolvedPath: string) => void): void;
export function realpathSync(path: string, cache?: boolean): string;
export function unlink(path: string, callback?: (err: Error) => void): void;
export function unlinkSync(path: string): void;
export function rmdir(path: string, callback?: (err: Error) => void): void;
export function rmdirSync(path: string): void;
export function mkdir(path: string, mode?: number, callback?: (err: Error) => void): void;
export function mkdir(path: string, mode?: string, callback?: (err: Error) => void): void;
export function mkdirSync(path: string, mode?: number): void;
export function mkdirSync(path: string, mode?: string): void;
export function readdir(path: string, callback?: (err: Error, files: string[]) => void ): void;
export function readdirSync(path: string): string[];
export function close(fd: number, callback?: (err: Error) => void): void;
export function closeSync(fd: number): void;
export function open(path: string, flags: string, mode?: string, callback?: (err: Error, fs: number) => void): void;
export function openSync(path: string, flags: string, mode?: string): number;
export function utimes(path: string, atime: number, mtime: number, callback?: (err: Error) => void): void;
export function utimesSync(path: string, atime: number, mtime: number): void;
export function futimes(fd: number, atime: number, mtime: number, callback?: (err: Error) => void): void;
export function futimesSync(fd: number, atime: number, mtime: number): void;
export function fsync(fd: number, callback?: (err: Error) => void): void;
export function fsyncSync(fd: number): void;
export function write(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number, callback?: (err: Error, written: number, buffer: NodeBuffer) => void): void;
export function writeSync(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number): number;
export function read(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number, callback?: (err: Error, bytesRead: number, buffer: NodeBuffer) => void ): void;
export function readSync(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number): number;
export function readFile(filename: string, encoding: string, callback: (err: Error, data: string) => void ): void;
export function readFile(filename: string, options: OpenOptions, callback: (err: Error, data: string) => void ): void;
export function readFile(filename: string, callback: (err: Error, data: NodeBuffer) => void ): void;
export function readFileSync(filename: string): NodeBuffer;
export function readFileSync(filename: string, encoding: string): string;
export function readFileSync(filename: string, options: OpenOptions): string;
export function writeFile(filename: string, data: any, encoding?: string, callback?: (err: Error) => void): void;
export function writeFile(filename: string, data: any, options?: OpenOptions, callback?: (err: Error) => void): void;
export function writeFileSync(filename: string, data: any, encoding?: string): void;
export function writeFileSync(filename: string, data: any, option?: OpenOptions): void;
export function appendFile(filename: string, data: any, encoding?: string, callback?: (err: Error) => void): void;
export function appendFile(filename: string, data: any,option?: OpenOptions, callback?: (err: Error) => void): void;
export function appendFileSync(filename: string, data: any, encoding?: string): void;
export function appendFileSync(filename: string, data: any, option?: OpenOptions): void;
export function watchFile(filename: string, listener: { curr: Stats; prev: Stats; }): void;
export function watchFile(filename: string, options: { persistent?: boolean; interval?: number; }, listener: { curr: Stats; prev: Stats; }): void;
export function unwatchFile(filename: string, listener?: Stats): void;
export function watch(filename: string, options?: { persistent?: boolean; }, listener?: (event: string, filename: string) => any): FSWatcher;
export function exists(path: string, callback?: (exists: boolean) => void ): void;
export function existsSync(path: string): boolean;
export function ensureDir(path: string, cb: (err: Error) => void): void;
export function ensureDirSync(path: string): void;
export function ensureFile(path: string, cb: (err: Error) => void): void;
export function ensureFileSync(path: string): void;
export function ensureLink(path: string, cb: (err: Error) => void): void;
export function ensureLinkSync(path: string): void;
export function ensureSymlink(path: string, cb: (err: Error) => void): void;
export function ensureSymlinkSync(path: string): void;
export function emptyDir(path: string, callback?: (err: Error) => void): void;
export function emptyDirSync(path: string): boolean;
export interface CopyFilterFunction {
export interface CopyFilterFunction {
(src: string): boolean
}
@@ -188,6 +79,7 @@ declare module "fs-extra" {
export interface CopyOptions {
clobber?: boolean
preserveTimestamps?: boolean
dereference?: boolean
filter?: CopyFilter
}
@@ -200,20 +92,4 @@ declare module "fs-extra" {
fs?: any;
mode?: number;
}
export interface ReadStreamOptions {
flags?: string;
encoding?: string;
fd?: number;
mode?: number;
bufferSize?: number;
}
export interface WriteStreamOptions {
flags?: string;
encoding?: string;
string?: string;
}
export function createReadStream(path: string, options?: ReadStreamOptions): ReadStream;
export function createWriteStream(path: string, options?: WriteStreamOptions): WriteStream;
export function createOutputStream(path: string, options?: WriteStreamOptions): WriteStream;
}
+6 -6
View File
@@ -599,17 +599,17 @@ $('#calendar').fullCalendar({
});
$('#calendar').fullCalendar({
events: function (start, end, callback) {
events: function (start: moment.Moment, end: moment.Moment, timezone: string | boolean, callback: (events: FullCalendar.EventObject[]) => void) {
$.ajax({
url: 'myxmlfeed.php',
dataType: 'xml',
data: {
// our hypothetical feed requires UNIX timestamps
start: Math.round(start.getTime() / 1000),
end: Math.round(end.getTime() / 1000)
start: Math.round(start.toDate().getTime() / 1000),
end: Math.round(end.toDate().getTime() / 1000)
},
success: function (doc) {
var events = [];
var events: any[] = [];
$(doc).find('event').each(function () {
events.push({
title: $(this).attr('title'),
@@ -628,7 +628,7 @@ $('#calendar').fullCalendar({
// your event source
{
events: function (start, end, callback) {
events: function (start: moment.Moment, end: moment.Moment, timezone: string | boolean, callback: (events: FullCalendar.EventObject[]) => void) {
// ...
},
color: 'yellow', // an option!
@@ -681,7 +681,7 @@ $('#calendar').fullCalendar({
}
// more events here
],
eventRender: function (event: EventWithDescription, element) {
eventRender: function (event: EventWithDescription, element: any, view: any) {
element.qtip({
content: event.description
});
+33 -58
View File
@@ -1,5 +1,5 @@
// Type definitions for FullCalendar 1.6.1
// Project: http://arshaw.com/fullcalendar/
// Type definitions for FullCalendar 2.7.2
// Project: http://fullcalendar.io/
// Definitions by: Neil Stalker <https://github.com/nestalk>, Marcelo Camargo <https://github.com/hasellcamargo>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -8,27 +8,6 @@
declare namespace FullCalendar {
export interface Calendar {
/**
* Formats a Date object into a string.
*/
formatDate(date: Date, format: string, options?: Options): string;
/**
* Formats a date range (two Date objects) into a string.
*/
formatDates(date1: Date, date2: Date, format: string, options?: Options): string;
/**
* Parses a string into a Date object.
*/
parseDate(dateString: string, ignoreTimezone?: boolean): Date;
/**
* Parses an ISO8601 string into a Date object.
*/
parseISO8601(dateString: string, ignoreTimezone?: boolean): Date;
/**
* Gets the version of Fullcalendar
*/
@@ -47,8 +26,7 @@ declare namespace FullCalendar {
}
export interface Options extends AgendaOptions, EventDraggingResizingOptions, DroppingExternalElementsOptions, SelectionOptions {
// General display - http://arshaw.com/fullcalendar/docs/display/
// General display - http://fullcalendar.io/docs/display/
header?: {
left: string;
@@ -72,6 +50,7 @@ declare namespace FullCalendar {
contentHeight?: number;
aspectRatio?: number;
handleWindowResize?: boolean;
views?: ViewSpecificOptions;
viewRender?: (view: ViewObject, element: JQuery) => void;
viewDestroy?: (view: ViewObject, element: JQuery) => void;
dayRender?: (date: Date, cell: HTMLTableDataCellElement) => void;
@@ -81,22 +60,22 @@ declare namespace FullCalendar {
timezone?: string | boolean;
now?: moment.Moment | Date | string | (() => moment.Moment)
// Views - http://arshaw.com/fullcalendar/docs/views/
// Views - http://fullcalendar.io/docs/views/
defaultView?: string;
// Current Date - http://arshaw.com/fullcalendar/docs/current_date/
// Current Date - http://fullcalendar.io/docs/current_date/
defaultDate?: moment.Moment | Date | string;
year?: number;
month?: number;
date?: number;
// Text/Time Customization - http://arshaw.com/fullcalendar/docs/text/
// Text/Time Customization - http://fullcalendar.io/docs/text/
timeFormat?: any; // String/ViewOptionHash
columnFormat?: any; // String/ViewOptionHash
titleFormat?: any; // String/ViewOptionHash
timeFormat?: any; // String
columnFormat?: any; // String
titleFormat?: any; // String
buttonText?: ButtonTextObject;
monthNames?: Array<string>;
@@ -105,21 +84,21 @@ declare namespace FullCalendar {
dayNamesShort?: Array<string>;
weekNumberTitle?: string;
// Clicking & Hovering - http://arshaw.com/fullcalendar/docs/mouse/
// Clicking & Hovering - http://fullcalendar.io/docs/mouse/
dayClick?: (date: Date, allDay: boolean, jsEvent: MouseEvent, view: ViewObject) => void;
eventClick?: (event: EventObject, jsEvent: MouseEvent, view: ViewObject) => any; // return type boolean or void
eventMouseover?: (event: EventObject, jsEvent: MouseEvent, view: ViewObject) => void;
eventMouseout?: (event: EventObject, jsEvent: MouseEvent, view: ViewObject) => void;
// Event Data - http://arshaw.com/fullcalendar/docs/event_data/
// Event Data - http://fullcalendar.io/docs/event_data/
/**
* This has one of the following types:
*
* - EventObject[]
* - string (JSON feed)
* - (start: Date | string, end: Date | string, callback: {(events: EventObject[]) => void;}) => void;
* - (start: moment.Moment, end: moment.Moment, timezone: string | boolean, callback: {(events: EventObject[]) => void;}) => void;
*/
events?: any;
@@ -129,19 +108,18 @@ declare namespace FullCalendar {
* - EventSource
* - EventObject[]
* - string (JSON feed)
* - (start: Date | string, end: Date | string, callback: {(events: EventObject[]) => void;}) => void;
* - (start: moment.Moment, end: moment.Moment, timezone: string | boolean, callback: {(events: EventObject[]) => void;}) => void;
*/
eventSources?: any[];
allDayDefault?: boolean;
ignoreTimezone?: boolean;
startParam?: string;
endParam?: string
lazyFetching?: boolean;
eventDataTransform?: (eventData: any) => EventObject;
loading?: (isLoading: boolean, view: ViewObject) => void;
// Event Rendering - http://arshaw.com/fullcalendar/docs/event_rendering/
// Event Rendering - http://fullcalendar.io/docs/event_rendering/
eventColor?: string;
eventBackgroundColor?: string;
@@ -151,25 +129,10 @@ declare namespace FullCalendar {
eventAfterRender?: (event: EventObject, element: HTMLDivElement, view: ViewObject) => void;
eventAfterAllRender?: (view: ViewObject) => void;
eventDestroy?: (event: EventObject, element: JQuery, view: ViewObject) => void;
}
export interface ViewOptionHash {
month?: any;
week?: any;
day?: any;
agenda?: any;
agendaDay?: any;
agendaWeek?: any;
basic?: any;
basicDay?: any;
basicWeek?: any;
''?: any;
}
/**
* Agenda Options - http://arshaw.com/fullcalendar/docs/agenda/
* Agenda Options - http://fullcalendar.io/docs/agenda/
*/
export interface AgendaOptions {
allDaySlot?: boolean;
@@ -204,7 +167,7 @@ declare namespace FullCalendar {
eventResize?: (event: EventObject, delta: moment.Duration, revertFunc: Function, jsEvent: Event, ui: any, view: ViewObject) => void;
}
/*
* Selection - http://arshaw.com/fullcalendar/docs/selection/
* Selection - http://fullcalendar.io/docs/selection/
*/
export interface SelectionOptions {
selectable?: boolean;
@@ -258,13 +221,12 @@ declare namespace FullCalendar {
}
export interface EventSource extends JQueryAjaxSettings {
/**
* This has one of the following types:
*
* - EventObject[]
* - string (JSON feed)
* - (start: Date | string, end: Date | string, callback: {(events: EventObject[]) => void;}) => void;
* - (start: moment.Moment, end: moment.Moment, timezone: string | boolean, callback: {(events: EventObject[]) => void;}) => void;
*/
events?: any;
@@ -281,10 +243,23 @@ declare namespace FullCalendar {
endParam?: string
}
/*
* View Specific Options - http://fullcalendar.io/docs/views/View-Specific-Options/
*/
export interface ViewSpecificOptions {
basic?: Options;
agenda?: Options;
week?: Options;
day?: Options;
month?: Options;
basicWeek?: Options;
basicDay?: Options;
agendaWeek?: Options;
agendaDay?: Options;
}
}
interface JQuery {
/**
* Get/Set option value
*/
@@ -428,4 +403,4 @@ interface JQuery {
interface JQueryStatic {
fullCalendar: FullCalendar.Calendar;
}
}
+836
View File
@@ -0,0 +1,836 @@
/// <reference path="fullCalendar.d.ts" />
/// <reference path="../../jquery/jquery.d.ts"/>
/// <reference path="../../jqueryui/jqueryui.d.ts"/>
// All examples from http://arshaw.com/fullcalendar/docs/
$('#calendar').fullCalendar({});
$('#calendar').fullCalendar({
weekends: false
});
$('#calendar').fullCalendar({
dayClick: function () {
alert('a day has been clicked!');
}
});
$('#calendar').fullCalendar('next');
$('#calendar').fullCalendar({
events: 'http://www.google.com/your_feed_url/'
});
$('#calendar').fullCalendar({
events: {
url: 'http://www.google.com/your_feed_url/',
className: 'gcal-event', // an option!
currentTimezone: 'America/Chicago' // an option!
}
});
$('#calendar').fullCalendar({
eventSources: [
// source with no options
"http://www.google.com/your_feed_url1/",
// source with no options
"http://www.google.com/your_feed_url2/",
// source WITH options
{
url: "http://www.google.com/your_feed_url3/",
className: 'nice-event'
}
]
});
$('#calendar').fullCalendar({
height: 650
});
$('#calendar').fullCalendar('option', 'height', 700);
$('#calendar').fullCalendar({
contentHeight: 600
});
$('#calendar').fullCalendar('option', 'contentHeight', 650);
$('#calendar').fullCalendar({
aspectRatio: 2
});
$('#calendar').fullCalendar('option', 'aspectRatio', 1.8);
$('#calendar').fullCalendar({
viewRender: function (view) {
alert('The new title of the view is ' + view.title);
}
});
$('#calendar').fullCalendar({
windowResize: function (view) {
alert('The calendar has adjusted to a window resize');
}
});
$('#calendar').fullCalendar('render');
$('#calendar').fullCalendar({
dragOpacity: .5
});
var view = $('#calendar').fullCalendar('getView');
alert("The view's title is " + view.title);
$(document).ready(function () {
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,basicWeek,basicDay'
},
editable: true,
events: [
{
title: 'All Day Event',
start: new Date(y, m, 1)
},
{
title: 'Long Event',
start: new Date(y, m, d - 5),
end: new Date(y, m, d - 2)
},
{
id: 999,
title: 'Repeating Event',
start: new Date(y, m, d - 3, 16, 0),
allDay: false
},
{
id: 999,
title: 'Repeating Event',
start: new Date(y, m, d + 4, 16, 0),
allDay: false
},
{
title: 'Meeting',
start: new Date(y, m, d, 10, 30),
allDay: false
},
{
title: 'Lunch',
start: new Date(y, m, d, 12, 0),
end: new Date(y, m, d, 14, 0),
allDay: false
},
{
title: 'Birthday Party',
start: new Date(y, m, d + 1, 19, 0),
end: new Date(y, m, d + 1, 22, 30),
allDay: false
},
{
title: 'Click for Google',
start: new Date(y, m, 28),
end: new Date(y, m, 29),
url: 'http://google.com/'
}
]
});
});
$(document).ready(function () {
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,basicWeek,basicDay'
},
defaultView: 'basicWeek',
editable: true,
events: [
{
title: 'All Day Event',
start: new Date(y, m, 1)
},
{
title: 'Long Event',
start: new Date(y, m, d - 5),
end: new Date(y, m, d - 2)
},
{
id: 999,
title: 'Repeating Event',
start: new Date(y, m, d - 3, 16, 0),
allDay: false
},
{
id: 999,
title: 'Repeating Event',
start: new Date(y, m, d + 4, 16, 0),
allDay: false
},
{
title: 'Meeting',
start: new Date(y, m, d, 10, 30),
allDay: false
},
{
title: 'Lunch',
start: new Date(y, m, d, 12, 0),
end: new Date(y, m, d, 14, 0),
allDay: false
},
{
title: 'Birthday Party',
start: new Date(y, m, d + 1, 19, 0),
end: new Date(y, m, d + 1, 22, 30),
allDay: false
},
{
title: 'Click for Google',
start: new Date(y, m, 28),
end: new Date(y, m, 29),
url: 'http://google.com/'
}
]
});
});
$(document).ready(function () {
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,basicWeek,basicDay'
},
defaultView: 'basicDay',
editable: true,
events: [
{
id: 1,
title: "Long Event",
start: new Date(y, m, d, 14, 0),
end: new Date(y, m, d + 3),
allDay: false
},
{
id: 2,
title: "Repeating Event",
start: new Date(y, m, d - 1),
allDay: true
},
{
id: 2,
title: "Repeating Event",
start: new Date(y, m, d + 6),
allDay: true
},
{
id: 3,
title: "Meeting",
start: new Date(y, m, d, 9, 0),
allDay: false
},
{
id: 4,
title: "Click for Facebook",
start: new Date(y, m, d, 16),
end: new Date(y, m, d),
url: "http://facebook.com/",
allDay: false
}
]
});
});
$(document).ready(function () {
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
$('#calendar').fullCalendar({
editable: true,
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
defaultView: 'agendaWeek',
events: [
{
title: 'All Day Event',
start: new Date(y, m, 1)
},
{
title: 'Long Event',
start: new Date(y, m, d - 5),
end: new Date(y, m, d - 2)
},
{
id: 999,
title: 'Repeating Event',
start: new Date(y, m, d - 3, 16, 0),
allDay: false
},
{
id: 999,
title: 'Repeating Event',
start: new Date(y, m, d + 4, 16, 0),
allDay: false
},
{
title: 'Meeting',
start: new Date(y, m, d, 10, 30),
allDay: false
},
{
title: 'Lunch',
start: new Date(y, m, d, 12, 0),
end: new Date(y, m, d, 14, 0),
allDay: false
},
{
title: 'Birthday Party',
start: new Date(y, m, d + 1, 19, 0),
end: new Date(y, m, d + 1, 22, 30),
allDay: false
},
{
title: 'Click for Google',
start: new Date(y, m, 28),
end: new Date(y, m, 29),
url: 'http://google.com/'
}
]
});
});
$(document).ready(function () {
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
defaultView: 'agendaDay',
editable: true,
events: [
{
id: 1,
title: "Long Event",
start: new Date(y, m, d),
end: new Date(y, m, d + 3),
allDay: true
},
{
id: 2,
title: "Repeating Event",
start: new Date(y, m, d - 1),
allDay: true
},
{
id: 2,
title: "Repeating Event",
start: new Date(y, m, d + 6),
allDay: true
},
{
id: 3,
title: "Meeting",
start: new Date(y, m, d, 10, 0),
allDay: false
},
{
id: 4,
title: "Click for Facebook",
start: new Date(y, m, d, 11, 30),
end: new Date(y, m, d),
url: "http://facebook.com/",
allDay: false
}
]
});
});
$('#my-prev-button').click(function () {
$('#calendar').fullCalendar('prev');
});
$('#my-next-button').click(function () {
$('#calendar').fullCalendar('next');
});
$('#my-today-button').click(function () {
$('#calendar').fullCalendar('today');
});
$('#calendar').fullCalendar('gotoDate', 1, 0, 1);
$('#my-button').click(function () {
var d = $('#calendar').fullCalendar('getDate');
alert("The current date of the calendar is " + d);
});
$('#calendar').fullCalendar({
events: [
{
title: 'My Event',
start: '2010-01-01T14:30:00',
allDay: false
}
// other events here...
],
timeFormat: 'H(:mm)' // uppercase H for 24-hour clock
});
$('#calendar').fullCalendar({
buttonText: {
prev: '&lt;',
next: '&gt;'
}
});
$('#calendar').fullCalendar({
dayClick: function (date, allDay, jsEvent, view) {
if (allDay) {
alert('Clicked on the entire day: ' + date);
} else {
alert('Clicked on the slot: ' + date);
}
alert('Coordinates: ' + jsEvent.pageX + ',' + jsEvent.pageY);
alert('Current view: ' + view.name);
// change the day's background color just for fun
$(this).css('background-color', 'red');
}
});
$('#calendar').fullCalendar({
eventClick: function (calEvent, jsEvent, view) {
alert('Event: ' + calEvent.title);
alert('Coordinates: ' + jsEvent.pageX + ',' + jsEvent.pageY);
alert('View: ' + view.name);
// change the border color just for fun
$(this).css('border-color', 'red');
}
});
$('#calendar').fullCalendar({
events: [
{
title: 'My Event',
start: '2010-01-01',
url: 'http://google.com/'
}
// other events here
],
eventClick: function (event) {
if (event.url) {
window.open(event.url);
return false;
}
}
});
$('#calendar').fullCalendar({
eventSources: [
// your event source
{
url: '/myfeed.php',
type: 'POST',
data: {
custom_param1: 'something',
custom_param2: 'somethingelse'
},
error: function () {
alert('there was an error while fetching events!');
},
color: 'yellow', // a non-ajax option
textColor: 'black' // a non-ajax option
}
// any other sources...
]
});
$('#calendar').fullCalendar({
events: {
url: '/myfeed.php',
type: 'POST',
data: {
custom_param1: 'something',
custom_param2: 'somethingelse'
},
error: function () {
alert('there was an error while fetching events!');
},
color: 'yellow', // a non-ajax option
textColor: 'black' // a non-ajax option
}
});
$('#calendar').fullCalendar({
events: {
url: '/myfeed.php',
cache: true
}
});
$('#calendar').fullCalendar({
eventSources: [
// your event source
{
url: '/myfeed.php', // use the `url` property
color: 'yellow', // an option!
textColor: 'black' // an option!
}
// any other sources...
]
});
$('#calendar').fullCalendar({
events: '/myfeed.php'
});
$('#calendar').fullCalendar({
events: [
{
title: 'event1',
start: '2010-01-01'
},
{
title: 'event2',
start: '2010-01-05',
end: '2010-01-07'
},
{
title: 'event3',
start: '2010-01-09 12:30:00',
allDay: false // will make the time show
}
]
});
$('#calendar').fullCalendar({
eventSources: [
// your event source
{
events: [ // put the array in the `events` property
{
title: 'event1',
start: '2010-01-01'
},
{
title: 'event2',
start: '2010-01-05',
end: '2010-01-07'
},
{
title: 'event3',
start: '2010-01-09 12:30:00',
}
],
color: 'black', // an option!
textColor: 'yellow' // an option!
}
// any other event sources...
]
});
$('#calendar').fullCalendar({
events: function (start: any, end: any, callback: any) {
$.ajax({
url: 'myxmlfeed.php',
dataType: 'xml',
data: {
// our hypothetical feed requires UNIX timestamps
start: Math.round(start.getTime() / 1000),
end: Math.round(end.getTime() / 1000)
},
success: function (doc) {
var events: any[] = [];
$(doc).find('event').each(function () {
events.push({
title: $(this).attr('title'),
start: $(this).attr('start') // will be parsed
});
});
callback(events);
}
});
}
});
$('#calendar').fullCalendar({
eventSources: [
// your event source
{
events: function (start: any, end: any, callback: any) {
// ...
},
color: 'yellow', // an option!
textColor: 'black' // an option!
}
// any other sources...
]
});
$('#calendar').fullCalendar({
eventSources: [
'/feed1.php',
'/feed2.php'
]
});
$('#calendar').fullCalendar({
eventClick: function (event, element) {
event.title = "CLICKED!";
$('#calendar').fullCalendar('updateEvent', event);
}
});
$('#calendar').fullCalendar({
events: [
// my event data
],
eventColor: '#378006'
});
interface EventWithDescription extends FullCalendar.EventObject {
description: string;
}
interface JQuery {
qtip: any; // dummy plugin interface
}
$('#calendar').fullCalendar({
events: [
{
title: 'My Event',
start: '2010-01-01',
description: 'This is a cool event'
}
// more events here
],
eventRender: function (event: EventWithDescription, element: any) {
element.qtip({
content: event.description
});
}
});
$('#my-draggable').draggable({
revert: true, // immediately snap back to original position
revertDuration: 0 //
});
$('#calendar').fullCalendar({
droppable: true,
drop: function (date, allDay) {
alert("Dropped on " + date + " with allDay=" + allDay);
}
});
$('#calendar').fullCalendar({
droppable: true,
dropAccept: '.cool-event',
drop: function () {
alert('dropped!');
}
});
$('#draggable1').draggable();
$('#draggable2').draggable();
$(document).ready(function () {
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
$('#calendar').fullCalendar({
theme: true,
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
editable: true,
events: [
{
title: 'All Day Event',
start: new Date(y, m, 1)
},
{
title: 'Long Event',
start: new Date(y, m, d - 5),
end: new Date(y, m, d - 2)
},
{
id: 999,
title: 'Repeating Event',
start: new Date(y, m, d - 3, 16, 0),
allDay: false
},
{
id: 999,
title: 'Repeating Event',
start: new Date(y, m, d + 4, 16, 0),
allDay: false
},
{
title: 'Meeting',
start: new Date(y, m, d, 10, 30),
allDay: false
},
{
title: 'Lunch',
start: new Date(y, m, d, 12, 0),
end: new Date(y, m, d, 14, 0),
allDay: false
},
{
title: 'Birthday Party',
start: new Date(y, m, d + 1, 19, 0),
end: new Date(y, m, d + 1, 22, 30),
allDay: false
},
{
title: 'Click for Google',
start: new Date(y, m, 28),
end: new Date(y, m, 29),
url: 'http://google.com/'
}
]
});
});
$(document).ready(function () {
/* initialize the external events
-----------------------------------------------------------------*/
$('#external-events div.external-event').each(function () {
// create an Event Object (http://arshaw.com/fullcalendar/docs/event_data/Event_Object/)
// it doesn't need to have a start or end
var eventObject = {
title: $.trim($(this).text()) // use the element's text as the event title
};
// store the Event Object in the DOM element so we can get to it later
$(this).data('eventObject', eventObject);
// make the event draggable using jQuery UI
$(this).draggable({
zIndex: 999,
revert: true, // will cause the event to go back to its
revertDuration: 0 // original position after the drag
});
});
/* initialize the calendar
-----------------------------------------------------------------*/
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
editable: true,
droppable: true, // this allows things to be dropped onto the calendar !!!
drop: function (date, allDay) { // this function is called when something is dropped
// retrieve the dropped element's stored Event Object
var originalEventObject = $(this).data('eventObject');
// we need to copy it, so that multiple events don't have a reference to the same object
var copiedEventObject: any = $.extend({}, originalEventObject);
// assign it the date that was reported
copiedEventObject.start = date;
copiedEventObject.allDay = allDay;
// render the event on the calendar
// the last `true` argument determines if the event "sticks" (http://arshaw.com/fullcalendar/docs/event_rendering/renderEvent/)
$('#calendar').fullCalendar('renderEvent', copiedEventObject, true);
// is the "remove after drop" checkbox checked?
if ($('#drop-remove').is(':checked')) {
// if so, remove the element from the "Draggable Events" list
$(this).remove();
}
}
});
});
$('#calendar').fullCalendar('refetchEvents');
+431
View File
@@ -0,0 +1,431 @@
// Type definitions for FullCalendar 1.6.1
// Project: http://arshaw.com/fullcalendar/
// Definitions by: Neil Stalker <https://github.com/nestalk>, Marcelo Camargo <https://github.com/hasellcamargo>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../../jquery/jquery.d.ts"/>
/// <reference path="../../moment/moment.d.ts"/>
declare namespace FullCalendar {
export interface Calendar {
/**
* Formats a Date object into a string.
*/
formatDate(date: Date, format: string, options?: Options): string;
/**
* Formats a date range (two Date objects) into a string.
*/
formatDates(date1: Date, date2: Date, format: string, options?: Options): string;
/**
* Parses a string into a Date object.
*/
parseDate(dateString: string, ignoreTimezone?: boolean): Date;
/**
* Parses an ISO8601 string into a Date object.
*/
parseISO8601(dateString: string, ignoreTimezone?: boolean): Date;
/**
* Gets the version of Fullcalendar
*/
version: string;
}
export interface BusinessHours {
start: moment.Duration;
end: moment.Duration;
dow: Array<number>;
}
export interface Timespan {
start: moment.Moment;
end: moment.Moment;
}
export interface Options extends AgendaOptions, EventDraggingResizingOptions, DroppingExternalElementsOptions, SelectionOptions {
// General display - http://arshaw.com/fullcalendar/docs/display/
header?: {
left: string;
center: string;
right: string;
}
theme?: boolean
buttonIcons?: {
prev: string;
next: string;
}
firstDay?: number;
isRTL?: boolean;
weekends?: boolean;
hiddenDays?: number[];
weekMode?: string;
weekNumbers?: boolean;
weekNumberCalculation?: any; // String/Function
businessHours?: boolean | BusinessHours;
height?: number;
contentHeight?: number;
aspectRatio?: number;
handleWindowResize?: boolean;
viewRender?: (view: ViewObject, element: JQuery) => void;
viewDestroy?: (view: ViewObject, element: JQuery) => void;
dayRender?: (date: Date, cell: HTMLTableDataCellElement) => void;
windowResize?: (view: ViewObject) => void;
// Timezone
timezone?: string | boolean;
now?: moment.Moment | Date | string | (() => moment.Moment)
// Views - http://arshaw.com/fullcalendar/docs/views/
defaultView?: string;
// Current Date - http://arshaw.com/fullcalendar/docs/current_date/
defaultDate?: moment.Moment | Date | string;
year?: number;
month?: number;
date?: number;
// Text/Time Customization - http://arshaw.com/fullcalendar/docs/text/
timeFormat?: any; // String/ViewOptionHash
columnFormat?: any; // String/ViewOptionHash
titleFormat?: any; // String/ViewOptionHash
buttonText?: ButtonTextObject;
monthNames?: Array<string>;
monthNamesShort?: Array<string>;
dayNames?: Array<string>;
dayNamesShort?: Array<string>;
weekNumberTitle?: string;
// Clicking & Hovering - http://arshaw.com/fullcalendar/docs/mouse/
dayClick?: (date: Date, allDay: boolean, jsEvent: MouseEvent, view: ViewObject) => void;
eventClick?: (event: EventObject, jsEvent: MouseEvent, view: ViewObject) => any; // return type boolean or void
eventMouseover?: (event: EventObject, jsEvent: MouseEvent, view: ViewObject) => void;
eventMouseout?: (event: EventObject, jsEvent: MouseEvent, view: ViewObject) => void;
// Event Data - http://arshaw.com/fullcalendar/docs/event_data/
/**
* This has one of the following types:
*
* - EventObject[]
* - string (JSON feed)
* - (start: Date | string, end: Date | string, callback: {(events: EventObject[]) => void;}) => void;
*/
events?: any;
/**
* An array, each element being one of the following types:
*
* - EventSource
* - EventObject[]
* - string (JSON feed)
* - (start: Date | string, end: Date | string, callback: {(events: EventObject[]) => void;}) => void;
*/
eventSources?: any[];
allDayDefault?: boolean;
ignoreTimezone?: boolean;
startParam?: string;
endParam?: string
lazyFetching?: boolean;
eventDataTransform?: (eventData: any) => EventObject;
loading?: (isLoading: boolean, view: ViewObject) => void;
// Event Rendering - http://arshaw.com/fullcalendar/docs/event_rendering/
eventColor?: string;
eventBackgroundColor?: string;
eventBorderColor?: string;
eventTextColor?: string;
eventRender?: (event: EventObject, element: HTMLDivElement, view: ViewObject) => void;
eventAfterRender?: (event: EventObject, element: HTMLDivElement, view: ViewObject) => void;
eventAfterAllRender?: (view: ViewObject) => void;
eventDestroy?: (event: EventObject, element: JQuery, view: ViewObject) => void;
}
export interface ViewOptionHash {
month?: any;
week?: any;
day?: any;
agenda?: any;
agendaDay?: any;
agendaWeek?: any;
basic?: any;
basicDay?: any;
basicWeek?: any;
''?: any;
}
/**
* Agenda Options - http://arshaw.com/fullcalendar/docs/agenda/
*/
export interface AgendaOptions {
allDaySlot?: boolean;
allDayText?: string;
slotDuration?: moment.Duration;
slotLabelFormat?: string;
slotLabelInterval?: moment.Duration;
snapDuration?: moment.Duration;
scrollTime?: moment.Duration;
minTime?: moment.Duration; // Integer/String
maxTime?: moment.Duration; // Integer/String
slotEventOverlap?: boolean;
}
/*
* Event Dragging & Resizing
*/
export interface EventDraggingResizingOptions {
editable?: boolean;
eventStartEditable?: boolean;
eventDurationEditable?: boolean;
dragRevertDuration?: number; // integer, milliseconds
dragOpacity?: number; // float
dragScroll?: boolean;
eventOverlap?: boolean | ((stillEvent: EventObject, movingEvent: EventObject) => boolean);
eventConstraint?: BusinessHours | Timespan;
eventDragStart?: (event: EventObject, jsEvent: MouseEvent, ui: any, view: ViewObject) => void;
eventDragStop?: (event: EventObject, jsEvent: MouseEvent, ui: any, view: ViewObject) => void;
eventDrop?: (event: EventObject, delta: moment.Duration, revertFunc: Function, jsEvent: Event, ui: any, view: ViewObject) => void;
eventResizeStart?: (event: EventObject, jsEvent: MouseEvent, ui: any, view: ViewObject) => void;
eventResizeStop?: (event: EventObject, jsEvent: MouseEvent, ui: any, view: ViewObject) => void;
eventResize?: (event: EventObject, delta: moment.Duration, revertFunc: Function, jsEvent: Event, ui: any, view: ViewObject) => void;
}
/*
* Selection - http://arshaw.com/fullcalendar/docs/selection/
*/
export interface SelectionOptions {
selectable?: boolean;
selectHelper?: boolean | ((start: moment.Moment, end: moment.Moment) => HTMLElement);
unselectAuto?: boolean;
unselectCancel?: string;
selectOverlap?: boolean | ((event: EventObject) => boolean);
selectConstraint?: Timespan | BusinessHours;
select?: (start: moment.Moment, end: moment.Moment, jsEvent: MouseEvent, view: ViewObject, resource?: any) => void;
unselect?: (view: ViewObject, jsEvent: Event) => void;
}
export interface DroppingExternalElementsOptions {
droppable?: boolean;
dropAccept?: string | ((draggable: any) => boolean);
drop?: (date: moment.Moment, jsEvent: MouseEvent, ui: any) => void;
eventReceive?: (event: EventObject) => void
}
export interface ButtonTextObject {
prev?: string;
next?: string;
prevYear?: string;
nextYear?: string;
today?: string;
month?: string;
week?: string;
day?: string;
}
export interface EventObject extends Timespan {
id?: any // String/number
title: string;
allDay?: boolean;
url?: string;
className?: any; // string/Array<string>
editable?: boolean;
source?: EventSource;
color?: string;
backgroundColor?: string;
borderColor?: string;
textColor?: string;
rendering?: string;
}
export interface ViewObject extends Timespan {
name: string;
title: string;
intervalStart: moment.Moment;
intervalEnd: moment.Moment;
}
export interface EventSource extends JQueryAjaxSettings {
/**
* This has one of the following types:
*
* - EventObject[]
* - string (JSON feed)
* - (start: Date | string, end: Date | string, callback: {(events: EventObject[]) => void;}) => void;
*/
events?: any;
color?: string;
backgroundColor?: string;
borderColor?: string;
textColor?: string;
className?: any; // string/Array<string>
editable?: boolean;
allDayDefault?: boolean;
ignoreTimezone?: boolean;
eventTransform?: any;
startParam?: string;
endParam?: string
}
}
interface JQuery {
/**
* Get/Set option value
*/
fullCalendar(method: 'option', option: string, value?: any): void;
/**
* Immediately forces the calendar to render and/or readjusts its size.
*/
fullCalendar(method: 'render'): void;
/**
* Restores the element to the state before FullCalendar was initialized.
*/
fullCalendar(method: 'destroy'): void;
/**
* Returns the View Object for the current view.
*/
fullCalendar(method: 'getView'): FullCalendar.ViewObject;
/**
* Immediately switches to a different view.
*/
fullCalendar(method: 'changeView', viewName: string): void;
/**
* Moves the calendar one step back (either by a month, week, or day).
*/
fullCalendar(method: 'prev'): void;
/**
* Moves the calendar one step forward (either by a month, week, or day).
*/
fullCalendar(method: 'next'): void;
/**
* Moves the calendar back one year.
*/
fullCalendar(method: 'prevYear'): void;
/**
* Moves the calendar forward one year.
*/
fullCalendar(method: 'nextYear'): void;
/**
* Moves the calendar to the current date.
*/
fullCalendar(method: 'today'): void;
/**
* Moves the calendar to an arbitrary year/month/date.
*/
fullCalendar(method: 'gotoDate', year: number, month?: number, date?: number): void;
/**
* Moves the calendar to an arbitrary date.
*/
fullCalendar(method: 'gotoDate', date: Date | string): void;
/**
* Moves the calendar forward/backward an arbitrary amount of time.
*/
fullCalendar(method: 'incrementDate', year: number, month?: number, date?: number): void;
/**
* Returns a Date object for the current date of the calendar.
*/
fullCalendar(method: 'getDate'): Date;
/**
* A method for programmatically selecting a period of time.
*/
fullCalendar(method: 'select', startDate: Date, endDate: Date, allDay: boolean): void;
/**
* A method for programmatically clearing the current selection.
*/
fullCalendar(method: 'unselect'): void;
/**
* Reports changes to an event and renders them on the calendar.
*/
fullCalendar(method: 'updateEvent', event: FullCalendar.EventObject): void;
/**
* Retrieves events that FullCalendar has in memory.
*/
fullCalendar(method: 'clientEvents', idOrfilter?: any): Array<FullCalendar.EventObject>;
/**
* Retrieves events that FullCalendar has in memory.
*/
fullCalendar(method: 'clientEvents', idOrfilter?: (e: FullCalendar.EventObject) => boolean): Array<FullCalendar.EventObject>;
/**
* Removes events from the calendar.
*/
fullCalendar(method: 'removeEvents', idOrfilter?: any): void;
/**
* Removes events from the calendar.
*/
fullCalendar(method: 'removeEvents', idOrfilter?: (e: FullCalendar.EventObject) => boolean): void;
/**
* Refetches events from all sources and rerenders them on the screen.
*/
fullCalendar(method: 'refetchEvents'): void;
/**
* Dynamically adds an event source.
*/
fullCalendar(method: 'addEventSource', source: any): void;
/**
* Dynamically removes an event source.
*/
fullCalendar(method: 'removeEventSource', source: any): void;
/**
* Renders a new event on the calendar.
*/
fullCalendar(method: 'renderEvent', event: FullCalendar.EventObject, stick?: boolean): void;
/**
* Rerenders all events on the calendar.
*/
fullCalendar(method: 'rerenderEvents'): void;
/**
* Create calendar object
*/
fullCalendar(options: FullCalendar.Options): JQuery;
/**
* Generic method function
*/
fullCalendar(method: string, arg1: any, arg2: any, arg3: any): void;
}
interface JQueryStatic {
fullCalendar: FullCalendar.Calendar;
}
+4 -3
View File
@@ -1,4 +1,4 @@
// Type definitions for Fuse.js 1.1.5
// Type definitions for Fuse.js 2.2.0
// Project: https://github.com/krisk/Fuse
// Definitions by: Greg Smith <https://github.com/smrq/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -11,12 +11,13 @@ declare class Fuse {
declare namespace fuse {
interface IFuseOptions extends ISearchOptions {
caseSensitive?: boolean;
includeScore?: boolean;
include?: string[];
shouldSort?: boolean;
searchFn?: any;
sortFn?: (a: {score: number}, b: {score: number}) => number;
getFn?: (obj: any, path: string) => any;
keys?: string[];
keys?: string[] | { name:string; weight:number} [];
verbose?:boolean;
}
interface ISearchOptions {

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