Merge pull request #3 from DefinitelyTyped/master

Pull latest changes
This commit is contained in:
Christopher Cortes
2016-09-30 16:48:32 +02:00
committed by GitHub
207 changed files with 106509 additions and 132476 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ declare module "acl" {
type Callback = (err: Error) => any;
type AnyCallback = (err: Error, obj: any) => any;
type AllowedCallback = (err: Error, allowed: boolean) => any;
type GetUserId = (req: http.ServerRequest, res: http.ServerResponse) => Value;
type GetUserId = (req: http.IncomingMessage, res: http.ServerResponse) => Value;
interface AclStatic {
new (backend: Backend<any>, logger: Logger, options: Option): Acl;
@@ -0,0 +1,136 @@
/// <reference path="../node/node.d.ts" />
///<reference path="./algoliasearch-client-js.d.ts"/>
var algoliasearch = require('algoliasearch');
var _clientOptions: ClientOptions = {
timeout : 12,
protocol: "",
httpAgent: ""
};
var _synonymOption: SynonymOption = {
forwardToSlaves: false,
replaceExistingSynonyms: false
};
var _algoliaUserKeyOptions : AlgoliaUserKeyOptions = {
validity: 0,
maxQueriesPerIPPerHour: 0,
indexes: [""],
queryParameters: { attributesToRetrieve: ["algolia"] },
description: ""
};
var _searchSynonymOptions : SearchSynonymOptions = {
query: "",
page: 0,
type: "",
hitsPerPage: 0
};
var _algoliaSecuredApiOptions: AlgoliaSecuredApiOptions = {
filters: "",
validUntil: 0,
restrictIndices: "",
userToken: ""
};
var _algoliaIndexSettings : AlgoliaIndexSettings = {
attributesToIndex: [""],
attributesforFaceting: [""],
unretrievableAttributes: [""],
attributesToRetrieve: [""],
ranking: [""],
customRanking: [""],
slaves: [""],
maxValuesPerFacet: '',
attributesToHighlight: [""],
attributesToSnippet: [""],
highlightPreTag: '',
highlightPostTag: '',
snippetEllipsisText: '',
restrictHighlightAndSnippetArrays: false,
hitsPerPage: 0,
minWordSizefor1Typo: 0,
minWordSizefor2Typos: 0,
typoTolerance: false,
allowTyposOnNumericTokens: false,
ignorePlurals: false,
disableTypoToleranceOnAttributes: '',
separatorsToIndex: '',
queryType: '',
removeWordsIfNoResults: '',
advancedSyntax: false,
optionalWords: [""],
removeStopWords: [""],
disablePrefixOnAttributes: [""],
disableExactOnAttributes: [""],
exactOnSingleWordQuery: '',
alternativesAsExact: false,
attributeForDistinct: "",
distinct: false,
numericAttributesToIndex: [""],
allowCompressionOfIntegerArray: false,
altCorrections: [{}],
minProximity: 0,
placeholders: ''
};
var _algoliaQueryParameters : AlgoliaQueryParameters = {
query: '',
filters: '',
attributesToRetrieve: [""],
restrictSearchableAttributes: [""],
facets: '',
maxValuesPerFacet: '',
attributesToHighlight: [''],
attributesToSnippet: [''],
highlightPreTag: '',
highlightPostTag: '',
snippetEllipsisText: '',
restrictHighlightAndSnippetArrays: false,
hitsPerPage: 0,
page: 0,
offset: 0,
length: 0,
minWordSizefor1Typo: 0,
minWordSizefor2Typos: 0,
typoTolerance: false,
allowTyposOnNumericTokens: false,
ignorePlurals: false,
disableTypoToleranceOnAttributes: '',
aroundLatLng: '',
aroundLatLngViaIP: '',
aroundRadius: '',
aroundPrecision: 0,
minimumAroundRadius: 0,
insideBoundingBox: '',
queryType: '',
insidePolygon: '',
removeWordsIfNoResults: '',
advancedSyntax: false,
optionalWords: [''],
removeStopWords: [''],
disableExactOnAttributes: [''],
exactOnSingleWordQuery: '',
alternativesAsExact: true,
distinct: 0,
getRankingInfo: false,
numericAttributesToIndex: [''],
numericFilters: [''],
tagFilters: '',
facetFilters: '',
analytics: false,
analyticsTags: [''],
synonyms: true,
replaceSynonymsInHighlight: false,
minProximity: 0
};
var index: AlgoliaIndex = algoliasearch('', '').initIndex('');
var search = index.search({query: ""});
index.search({query: ""}, function(err, res){});
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -14,7 +14,7 @@ declare namespace angular.ui {
/**
* Override the parent state (only for the breadcrumb)
**/
parent?: string;
parent?: string|Function;
/**
* When defined to true, the state is never included in the chain of states and never appears in the breadcrumb
**/
@@ -76,4 +76,4 @@ declare namespace ncy {
**/
getLastStep(): angular.ui.IState;
}
}
}
+1
View File
@@ -20,6 +20,7 @@ declare namespace angular.dynamicLocale {
interface tmhDynamicLocaleProvider extends angular.IServiceProvider {
localeLocationPattern(location: string): tmhDynamicLocaleProvider;
localeLocationPattern(): string;
storageKey(storageKey: string): void;
useStorage(storageName: string): void;
useCookieStorage(): void;
}
@@ -20,6 +20,13 @@ myApp.config((
.warnPalette('red')
.dark(true);
var browserColors: ng.material.IBrowserColors = {
theme: 'default',
palette: 'neonRed',
hue: '500'
};
$mdThemingProvider.enableBrowserColor(browserColors);
$mdIconProvider
.defaultIconSet('my/app/icons.svg') // Register a default set of SVG icons
.iconSet('social', 'my/app/social.svg') // Register a named icon set of SVGs
@@ -41,6 +48,25 @@ myApp.controller('BottomSheetController', ($scope: ng.IScope, $mdBottomSheet: ng
$scope['cancelBottomSheet'] = $mdBottomSheet.cancel.bind($mdBottomSheet, 'cancel');
});
myApp.controller('ColorController', ($scope: ng.IScope, $mdColor: ng.material.IColorService) => {
var colorExpression : ng.material.IColorExpression;
var element : Element;
colorExpression = { color: '#FFFFFF' }
element = new Element();
$scope['applyThemeColors'] = () => {
$mdColor.applyThemeColors(element, colorExpression);
};
$scope['getThemeColor'] = () => {
$mdColor.getThemeColor('default-neonRed')
};
$scope['hasTheme'] = () => {
$mdColor.hasTheme();
};
});
myApp.controller('DialogController', ($scope: ng.IScope, $mdDialog: ng.material.IDialogService) => {
$scope['openDialog'] = () => {
$mdDialog.show({
+30 -6
View File
@@ -73,6 +73,16 @@ declare namespace angular.material {
initialValue(initialValue: string): IPromptDialog;
}
interface IColorExpression {
[cssPropertyName: string]: string
}
interface IColorService {
applyThemeColors(element: Element|JQuery, colorExpression: IColorExpression): void;
getThemeColor(expression: string): string;
hasTheme(): boolean;
}
interface IDialogOptions {
templateUrl?: string;
template?: string;
@@ -216,6 +226,12 @@ declare namespace angular.material {
hues: IThemeHues;
}
interface IBrowserColors{
theme: string;
palette: string;
hue: string;
}
interface IThemeColors {
accent: IThemePalette;
background: IThemePalette;
@@ -245,12 +261,14 @@ declare namespace angular.material {
}
interface IThemingProvider {
theme(name: string, inheritFrom?: string): ITheme;
definePalette(name: string, palette: IPalette): IThemingProvider;
extendPalette(name: string, palette: IPalette): IPalette;
setDefaultTheme(theme: string): void;
alwaysWatchTheme(alwaysWatch: boolean): void;
definePalette(name: string, palette: IPalette): IThemingProvider;
enableBrowserColor(browserColors: IBrowserColors): Function;
extendPalette(name: string, palette: IPalette): IPalette;
registerStyles(styles: String): void;
setDefaultTheme(theme: string): void;
setNonce(nonce: string): void;
theme(name: string, inheritFrom?: string): ITheme;
}
interface IDateLocaleProvider {
@@ -337,6 +355,9 @@ declare namespace angular.material {
removeClass(oldClass: string): void;
toggleClass(toggleClass: string): void;
updatePosition(position: IPanelPosition): void;
registerInterceptor(type: string, callback: () => angular.IPromise<any>): IPanelRef;
removeInterceptor(type: string, callback: () => angular.IPromise<any>): IPanelRef;
removeAllInterceptors(type?: string): IPanelRef;
}
interface IPanelPosition {
@@ -352,8 +373,8 @@ declare namespace angular.material {
centerVertically(): IPanelPosition;
center(): IPanelPosition;
addPanelPosition(xPosition: string, yPosition: string): IPanelPosition;
withOffsetX(offsetX: string): IPanelPosition;
withOffsetY(offsetY: string): IPanelPosition;
withOffsetX(offsetX: string|((panel: IPanelPosition) => string)): IPanelPosition;
withOffsetY(offsetY: string|((panel: IPanelPosition) => string)): IPanelPosition;
}
interface IPanelAnimation {
@@ -386,5 +407,8 @@ declare namespace angular.material {
SCALE: string,
FADE: string,
};
interceptorTypes: {
CLOSE: string,
};
}
}
@@ -1,5 +1,5 @@
/// <reference path='angular-signalr-hub.d.ts' />
/// <reference path='../angularjs/angular.d.ts' />
/// <reference path='angular-signalr-hub.d.ts' />
angular
.module('app', ['SignalR'])
+6
View File
@@ -3,8 +3,14 @@
// Definitions by: Adam Santaniello <https://github.com/AdamSantaniello>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path='../angularjs/angular.d.ts' />
/// <reference path='../signalr/signalr.d.ts' />
declare module "angular-signalr-hub" {
let _: string;
export = _;
}
declare namespace ngSignalr {
interface HubFactory {
/**
+3 -3
View File
@@ -2,9 +2,9 @@
/// <reference path='angular-touchspin.d.ts' />
angular
.module('touchspin-tests', ['lm.touchspin'])
.config(function(touchspinConfigProvider: angularTouchSpin.ITouchSpinConfigProvider) {
touchspinConfigProvider.defaults(<angularTouchSpin.ITouchSpinOptions>{
.module('touchspin-tests', ['nk.touchspin'])
.config(function(touchspinConfigProvider: angular.touchspin.ITouchSpinConfigProvider) {
touchspinConfigProvider.defaults(<angular.touchspin.ITouchSpinOptions>{
min: 0,
max: 0,
step: 0,
+1 -1
View File
@@ -11,7 +11,7 @@ declare module "angular-touchspin" {
export = _;
}
declare namespace angularTouchSpin {
declare namespace angular.touchspin {
interface ITouchSpinOptions {
min?: number;
max?: number;
+28 -6
View File
@@ -1,10 +1,32 @@
/// <reference path="angular-sanitize.d.ts" />
var shouldBeString: string;
///////////////////////////////////////////////////////////////////////////////
// Variables
///////////////////////////////////////////////////////////////////////////////
let shouldBeString: string;
let testInputText: string = 'TEST';
declare var $sanitizeService: ng.sanitize.ISanitizeService;
shouldBeString = $sanitizeService(shouldBeString);
///////////////////////////////////////////////////////////////////////////////
// Test sanitize service
///////////////////////////////////////////////////////////////////////////////
declare let $sanitizeService: ng.sanitize.ISanitizeService;
shouldBeString = $sanitizeService(testInputText);
declare var $linky: ng.sanitize.filter.ILinky;
shouldBeString = $linky(shouldBeString);
shouldBeString = $linky(shouldBeString, shouldBeString);
///////////////////////////////////////////////////////////////////////////////
// Test `linky` filter
///////////////////////////////////////////////////////////////////////////////
declare let $linky: ng.sanitize.filter.ILinky;
// Should be string for simple text and target parameters
shouldBeString = $linky(testInputText, testInputText);
// Should be string for simple text, target and attributes parameters
let attributesAsFunction = () => {
};
shouldBeString = $linky(shouldBeString, testInputText, {
"attributeKey1": "attributeValue1",
"attributeKey2": "attributeValue2"
});
shouldBeString = $linky(shouldBeString, testInputText, (url: string) => {
return {"attributeKey1": "attributeValue1"}
});
+18 -5
View File
@@ -29,12 +29,25 @@ declare namespace angular.sanitize {
// see https://github.com/angular/angular.js/tree/v1.2.0/src/ngSanitize/filter
///////////////////////////////////////////////////////////////////////////
export module filter {
// Finds links in text input and turns them into html links.
// Supports http/https/ftp/mailto and plain email address links.
// see http://code.angularjs.org/1.2.0/docs/api/ngSanitize.filter:linky
/**
* Finds links in text input and turns them into html links. Supports http/https/ftp/mailto and plain email address links.
* @param text Input text.
* @param target ILinkyTargetType Window (_blank|_self|_parent|_top) or named frame to open links in.
* @param attributes Add custom attributes to the link element.
* @return Html-linkified and sanitized text.
* see https://docs.angularjs.org/api/ngSanitize/filter/linky
*/
interface ILinky {
(text: string, target?: string): string;
(text: string, target: string, attributes?: { [attribute: string]: string } | ((url: string) => { [attribute: string]: string })): string;
}
}
}
///////////////////////////////////////////////////////////////////////////////
// Extend angular $filter declarations to include filters from angular.sanitize module
///////////////////////////////////////////////////////////////////////////////
declare namespace angular {
interface IFilterService {
(name: 'linky'): angular.sanitize.filter.ILinky;
}
}
+35 -9
View File
@@ -180,25 +180,51 @@ namespace My.Namespace {
// IModule Registering Test
var mod = angular.module('tests', []);
mod.controller('name', function ($scope: ng.IScope) { })
mod.controller('name', ['$scope', <any>function ($scope: ng.IScope) { }])
mod.controller(My.Namespace);
mod.controller('name', function ($scope: ng.IScope) { });
mod.controller('name', ['$scope', function ($scope: ng.IScope) { }]);
mod.controller('name', class {
// Uncommenting the next line should lead to a type error because this signature isn't compatible
// with the signature of the `$onChanges` hook:
// $onChanges(x: number) { }
});
mod.controller({
MyCtrl: class{},
MyCtrl2: function() {},
MyCtrl3: ['$fooService', function($fooService: any) { }]
});
mod.directive('name', <any>function ($scope: ng.IScope) { })
mod.directive('name', ['$scope', <any>function ($scope: ng.IScope) { }])
mod.directive(My.Namespace);
mod.directive({
myFooDir: () => ({
template: 'my-foo-dir.tpl.html'
}),
myBarDir: ['$fooService', ($fooService: any) => ({
template: 'my-bar-dir.tpl.html'
})]
});
mod.factory('name', function ($scope: ng.IScope) { })
mod.factory('name', ['$scope', <any>function ($scope: ng.IScope) { }])
mod.factory(My.Namespace);
mod.factory('name', ['$scope', function ($scope: ng.IScope) { }])
mod.factory({
name1: function (foo: any) { },
name2: ['foo', function (foo: any) { }]
});
mod.filter('name', function ($scope: ng.IScope) { })
mod.filter('name', ['$scope', <any>function ($scope: ng.IScope) { }])
mod.filter(My.Namespace);
mod.filter('name', ['$scope', function ($scope: ng.IScope) { }])
mod.filter({
name1: function (foo: any) { },
name2: ['foo', function (foo: any) { }]
});
mod.provider('name', function ($scope: ng.IScope) { return { $get: () => { } } })
mod.provider('name', TestProvider);
mod.provider('name', ['$scope', <any>function ($scope: ng.IScope) { }])
mod.provider(My.Namespace);
mod.service('name', function ($scope: ng.IScope) { })
mod.service('name', ['$scope', <any>function ($scope: ng.IScope) { }])
mod.service(My.Namespace);
mod.service({
MyCtrl: class{},
MyCtrl2: function() {},
MyCtrl3: ['$fooService', function($fooService: any) { }]
});
mod.constant('name', 23);
mod.constant('name', "23");
mod.constant(My.Namespace);
+74 -104
View File
@@ -25,6 +25,8 @@ declare module 'angular' {
///////////////////////////////////////////////////////////////////////////////
declare namespace angular {
type Injectable<T extends Function> = T | (string | T)[];
// not directly implemented, but ensures that constructed class implements $get
interface IServiceProviderClass {
new (...args: any[]): IServiceProvider;
@@ -214,50 +216,26 @@ declare namespace angular {
* @param name Controller name, or an object map of controllers where the keys are the names and the values are the constructors.
* @param controllerConstructor Controller constructor fn (optionally decorated with DI annotations in the array notation).
*/
controller(name: string, controllerConstructor: Function): IModule;
/**
* The $controller service is used by Angular to create new controllers.
*
* This provider allows controller registration via the register method.
*
* @param name Controller name, or an object map of controllers where the keys are the names and the values are the constructors.
* @param controllerConstructor Controller constructor fn (optionally decorated with DI annotations in the array notation).
*/
controller(name: string, inlineAnnotatedConstructor: any[]): IModule;
controller(object: Object): IModule;
controller(name: string, controllerConstructor: Injectable<IControllerConstructor>): IModule;
controller(object: {[name: string]: Injectable<IControllerConstructor>}): IModule;
/**
* Register a new directive with the compiler.
*
* @param name Name of the directive in camel-case (i.e. ngBind which will match as ng-bind)
* @param directiveFactory An injectable directive factory function.
*/
directive(name: string, directiveFactory: IDirectiveFactory): IModule;
/**
* Register a new directive with the compiler.
*
* @param name Name of the directive in camel-case (i.e. ngBind which will match as ng-bind)
* @param directiveFactory An injectable directive factory function.
*/
directive(name: string, inlineAnnotatedFunction: any[]): IModule;
directive(object: Object): IModule;
directive(name: string, directiveFactory: Injectable<IDirectiveFactory>): IModule;
directive(object: {[directiveName: string]: Injectable<IDirectiveFactory>}): IModule;
/**
* Register a service factory, which will be called to return the service instance. This is short for registering a service where its provider consists of only a $get property, which is the given service factory function. You should use $provide.factory(getFn) if you do not need to configure your service in a provider.
*
* @param name The name of the instance.
* @param $getFn The $getFn for the instance creation. Internally this is a short hand for $provide.provider(name, {$get: $getFn}).
*/
factory(name: string, $getFn: Function): IModule;
/**
* Register a service factory, which will be called to return the service instance. This is short for registering a service where its provider consists of only a $get property, which is the given service factory function. You should use $provide.factory(getFn) if you do not need to configure your service in a provider.
*
* @param name The name of the instance.
* @param inlineAnnotatedFunction The $getFn for the instance creation. Internally this is a short hand for $provide.provider(name, {$get: $getFn}).
*/
factory(name: string, inlineAnnotatedFunction: any[]): IModule;
factory(object: Object): IModule;
filter(name: string, filterFactoryFunction: Function): IModule;
filter(name: string, inlineAnnotatedFunction: any[]): IModule;
filter(object: Object): IModule;
factory(name: string, $getFn: Injectable<Function>): IModule;
factory(object: {[name: string]: Injectable<Function>}): IModule;
filter(name: string, filterFactoryFunction: Injectable<Function>): IModule;
filter(object: {[name: string]: Injectable<Function>}): IModule;
provider(name: string, serviceProviderFactory: IServiceProviderFactory): IModule;
provider(name: string, serviceProviderConstructor: IServiceProviderClass): IModule;
provider(name: string, inlineAnnotatedConstructor: any[]): IModule;
@@ -266,26 +244,15 @@ declare namespace angular {
/**
* Run blocks are the closest thing in Angular to the main method. A run block is the code which needs to run to kickstart the application. It is executed after all of the service have been configured and the injector has been created. Run blocks typically contain code which is hard to unit-test, and for this reason should be declared in isolated modules, so that they can be ignored in the unit-tests.
*/
run(initializationFunction: Function): IModule;
/**
* Run blocks are the closest thing in Angular to the main method. A run block is the code which needs to run to kickstart the application. It is executed after all of the service have been configured and the injector has been created. Run blocks typically contain code which is hard to unit-test, and for this reason should be declared in isolated modules, so that they can be ignored in the unit-tests.
*/
run(inlineAnnotatedFunction: any[]): IModule;
run(initializationFunction: Injectable<Function>): IModule;
/**
* Register a service constructor, which will be invoked with new to create the service instance. This is short for registering a service where its provider's $get property is a factory function that returns an instance instantiated by the injector from the service constructor function.
*
* @param name The name of the instance.
* @param serviceConstructor An injectable class (constructor function) that will be instantiated.
*/
service(name: string, serviceConstructor: Function): IModule;
/**
* Register a service constructor, which will be invoked with new to create the service instance. This is short for registering a service where its provider's $get property is a factory function that returns an instance instantiated by the injector from the service constructor function.
*
* @param name The name of the instance.
* @param inlineAnnotatedConstructor An injectable class (constructor function) that will be instantiated.
*/
service(name: string, inlineAnnotatedConstructor: any[]): IModule;
service(object: Object): IModule;
service(name: string, serviceConstructor: Injectable<Function>): IModule;
service(object: {[name: string]: Injectable<Function>}): IModule;
/**
* Register a value service with the $injector, such as a string, a number, an array, an object or a function. This is short for registering a service where its provider's $get property is a factory function that takes no arguments and returns the value service.
@@ -302,8 +269,7 @@ declare namespace angular {
* @param name The name of the service to decorate
* @param decorator This function will be invoked when the service needs to be instantiated and should return the decorated service instance. The function is called using the injector.invoke method and is therefore fully injectable. Local injection arguments: $delegate - The original service instance, which can be monkey patched, configured, decorated or delegated to.
*/
decorator(name:string, decoratorConstructor: Function): IModule;
decorator(name:string, inlineAnnotatedConstructor: any[]): IModule;
decorator(name: string, decorator: Injectable<Function>): IModule;
// Properties
name: string;
@@ -613,11 +579,11 @@ declare namespace angular {
/**
* calling stopPropagation function will cancel further event propagation (available only for events that were $emit-ed).
*/
stopPropagation?: Function;
stopPropagation?(): void;
/**
* calling preventDefault sets defaultPrevented flag to true.
*/
preventDefault: Function;
preventDefault(): void;
/**
* true if preventDefault was called.
*/
@@ -1221,19 +1187,12 @@ declare namespace angular {
// see http://docs.angularjs.org/api/ng.$compileProvider
///////////////////////////////////////////////////////////////////////////
interface ICompileService {
(element: string, transclude?: ITranscludeFunction, maxPriority?: number): ITemplateLinkingFunction;
(element: Element, transclude?: ITranscludeFunction, maxPriority?: number): ITemplateLinkingFunction;
(element: JQuery, transclude?: ITranscludeFunction, maxPriority?: number): ITemplateLinkingFunction;
(element: string | Element | JQuery, transclude?: ITranscludeFunction, maxPriority?: number): ITemplateLinkingFunction;
}
interface ICompileProvider extends IServiceProvider {
directive(name: string, directiveFactory: Function): ICompileProvider;
directive(directivesMap: Object, directiveFactory: Function): ICompileProvider;
directive(name: string, inlineAnnotatedFunction: any[]): ICompileProvider;
directive(directivesMap: Object, inlineAnnotatedFunction: any[]): ICompileProvider;
// Undocumented, but it is there...
directive(directivesMap: any): ICompileProvider;
directive(name: string, directiveFactory: Injectable<IDirectiveFactory>): ICompileProvider;
directive(object: {[directiveName: string]: Injectable<IDirectiveFactory>}): ICompileProvider;
component(name: string, options: IComponentOptions): ICompileProvider;
@@ -1243,7 +1202,8 @@ declare namespace angular {
imgSrcSanitizationWhitelist(): RegExp;
imgSrcSanitizationWhitelist(regexp: RegExp): ICompileProvider;
debugInfoEnabled(enabled?: boolean): any;
debugInfoEnabled(): boolean;
debugInfoEnabled(enabled: boolean): ICompileProvider;
}
interface ICloneAttachFunction {
@@ -1256,12 +1216,16 @@ declare namespace angular {
(scope: IScope, cloneAttachFn?: ICloneAttachFunction): JQuery;
}
// This corresponds to $transclude (and also the transclude function passed to link).
/**
* This corresponds to $transclude passed to controllers and to the transclude function passed to link functions.
* https://docs.angularjs.org/api/ng/service/$compile#-controller-
* http://teropa.info/blog/2015/06/09/transclusion.html
*/
interface ITranscludeFunction {
// If the scope is provided, then the cloneAttachFn must be as well.
(scope: IScope, cloneAttachFn: ICloneAttachFunction, futureParentElement?: JQuery, slotName?: string): JQuery;
// If one argument is provided, then it's assumed to be the cloneAttachFn.
(cloneAttachFn?: ICloneAttachFunction): JQuery;
(cloneAttachFn?: ICloneAttachFunction, futureParentElement?: JQuery, slotName?: string): JQuery;
}
///////////////////////////////////////////////////////////////////////////
@@ -1413,12 +1377,12 @@ declare namespace angular {
*/
url: string;
/**
* Event listeners to be bound to the XMLHttpRequest object.
* Event listeners to be bound to the XMLHttpRequest object.
* To bind events to the XMLHttpRequest upload object, use uploadEventHandlers. The handler will be called in the context of a $apply block.
*/
eventHandlers?: { [type: string]: EventListenerOrEventListenerObject };
/**
* Event listeners to be bound to the XMLHttpRequest upload object.
* Event listeners to be bound to the XMLHttpRequest upload object.
* To bind events to the XMLHttpRequest object, use eventHandlers. The handler will be called in the context of a $apply block.
*/
uploadEventHandlers?: { [type: string]: EventListenerOrEventListenerObject };
@@ -1549,7 +1513,7 @@ declare namespace angular {
* Register service factories (names or implementations) for interceptors which are called before and after
* each request.
*/
interceptors: (string|IHttpInterceptorFactory|(string|IHttpInterceptorFactory)[])[];
interceptors: (string | Injectable<IHttpInterceptorFactory>)[];
useApplyAsync(): boolean;
useApplyAsync(value: boolean): IHttpProvider;
@@ -1697,11 +1661,10 @@ declare namespace angular {
* controller if passed as a string. Empty function by default.
* Use the array form to define dependencies (necessary if strictDi is enabled and you require dependency injection)
*/
controller?: string | Function | (string | Function)[] | IComponentController;
controller?: string | Injectable<IControllerConstructor>;
/**
* An identifier name for a reference to the controller. If present, the controller will be published to scope under
* the controllerAs name. If not present, this will default to be the same as the component name.
* @default "$ctrl"
* An identifier name for a reference to the controller. If present, the controller will be published to its scope under
* the specified name. If not present, this will default to '$ctrl'.
*/
controllerAs?: string;
/**
@@ -1712,24 +1675,24 @@ declare namespace angular {
* $attrs - Current attributes object for the element
* Use the array form to define dependencies (necessary if strictDi is enabled and you require dependency injection)
*/
template?: string | Function | (string | Function)[];
template?: string | Injectable<(...args: any[]) => string>;
/**
* path or function that returns a path to an html template that should be used as the contents of this component.
* Path or function that returns a path to an html template that should be used as the contents of this component.
* If templateUrl is a function, then it is injected with the following locals:
* $element - Current element
* $attrs - Current attributes object for the element
* Use the array form to define dependencies (necessary if strictDi is enabled and you require dependency injection)
*/
templateUrl?: string | Function | (string | Function)[];
templateUrl?: string | Injectable<(...args: any[]) => string>;
/**
* Define DOM attribute binding to component properties. Component properties are always bound to the component
* controller and not to the scope.
*/
bindings?: IComponentBindings;
bindings?: {[boundProperty: string]: string};
/**
* Whether transclusion is enabled. Enabled by default.
* Whether transclusion is enabled. Disabled by default.
*/
transclude?: boolean | string | {[slot: string]: string};
transclude?: boolean | {[slot: string]: string};
/**
* Requires the controllers of other directives and binds them to this component's controller.
* The object keys specify the property names under which the required controllers (object values) will be bound.
@@ -1739,26 +1702,33 @@ declare namespace angular {
require?: {[controller: string]: string};
}
interface IComponentBindings {
[binding: string]: string;
}
interface IComponentTemplateFn {
( $element?: JQuery, $attrs?: IAttributes ): string;
}
type IControllerConstructor =
(new (...args: any[]) => IController) |
// Instead of classes, plain functions are often used as controller constructors, especially in examples.
((...args: any[]) => (void | IController));
/**
* Components have a well-defined lifecycle Each component can implement "lifecycle hooks". These are methods that
* will be called at certain points in the life of the component.
* @url https://docs.angularjs.org/guide/component
* Directive controllers have a well-defined lifecycle. Each controller can implement "lifecycle hooks". These are methods that
* will be called by Angular at certain points in the life cycle of the directive.
* https://docs.angularjs.org/api/ng/service/$compile#life-cycle-hooks
* https://docs.angularjs.org/guide/component
*/
interface IComponentController {
interface IController {
/**
* Called on each controller after all the controllers on an element have been constructed and had their bindings
* initialized (and before the pre & post linking functions for the directives on this element). This is a good
* place to put initialization code for your controller.
*/
$onInit?(): void;
/**
* Called on each turn of the digest cycle. Provides an opportunity to detect and act on changes.
* Any actions that you wish to take in response to the changes that you detect must be invoked from this hook;
* implementing this has no effect on when `$onChanges` is called. For example, this hook could be useful if you wish
* to perform a deep equality check, or to check a `Dat`e object, changes to which would not be detected by Angular's
* change detector and thus not trigger `$onChanges`. This hook is invoked with no arguments; if detecting changes,
* you must store the previous value(s) for comparison to the current values.
*/
$doCheck?(): void;
/**
* Called whenever one-way bindings are updated. The onChangesObj is a hash whose keys are the names of the bound
* properties that have changed, and the values are an {@link IChangesObject} object of the form
@@ -1781,14 +1751,14 @@ declare namespace angular {
*/
$postLink?(): void;
}
interface IOnChangesObject {
[property: string]: IChangesObject;
[property: string]: IChangesObject<any>;
}
interface IChangesObject {
currentValue: any;
previousValue: any;
interface IChangesObject<T> {
currentValue: T;
previousValue: T;
isFirstChange(): boolean;
}
@@ -1828,16 +1798,12 @@ declare namespace angular {
* that is passed to the link function instead.
*/
transclude: ITranscludeFunction
): void | IDirectivePrePost;
}
interface IDirectiveScope {
[property: string]: string;
): void | IDirectiveLinkFn | IDirectivePrePost;
}
interface IDirective {
compile?: IDirectiveCompileFn;
controller?: any;
controller?: string | Injectable<IControllerConstructor>;
controllerAs?: string;
/**
* @deprecated
@@ -1845,10 +1811,9 @@ declare namespace angular {
* the controller constructor is called, this use is now deprecated. Please place initialization code that
* relies upon bindings inside a $onInit method on the controller, instead.
*/
bindToController?: boolean | Object;
bindToController?: boolean | {[boundProperty: string]: string};
link?: IDirectiveLinkFn | IDirectivePrePost;
multiElement?: boolean;
directiveName?: string;
priority?: number;
/**
* @deprecated
@@ -1856,12 +1821,12 @@ declare namespace angular {
replace?: boolean;
require?: string | string[] | {[controller: string]: string};
restrict?: string;
scope?: boolean | IDirectiveScope;
template?: string | Function;
scope?: boolean | {[boundProperty: string]: string};
template?: string | ((tElement: JQuery, tAttrs: IAttributes) => string);
templateNamespace?: string;
templateUrl?: string | Function;
templateUrl?: string | ((tElement: JQuery, tAttrs: IAttributes) => string);
terminal?: boolean;
transclude?: boolean | string | {[slot: string]: string};
transclude?: boolean | 'element' | {[slot: string]: string};
}
/**
@@ -1874,6 +1839,11 @@ declare namespace angular {
interface IAugmentedJQueryStatic extends JQueryStatic {}
interface IAugmentedJQuery extends JQuery {}
/**
* Same as IController. Keeping it for compatibility with older versions of these type definitions.
*/
interface IComponentController extends IController {}
///////////////////////////////////////////////////////////////////////////
// AUTO module (angular.js)
///////////////////////////////////////////////////////////////////////////
+4 -4
View File
@@ -346,24 +346,24 @@ interface Client {
* 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 request The http.IncomingMessage 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?: {
trackRequest(request: any /* http.IncomingMessage */, 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 request The http.IncomingMessage 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?: {
trackRequestSync(request: any /*http.IncomingMessage */, response: any /*http.ServerResponse */, ellapsedMilliseconds?: number, properties?: {
[key: string]: string;}, error?: any) : void;
/**
+435 -45
View File
@@ -1,4 +1,4 @@
// Type definitions for ArcGIS API for JavaScript v3.17
// Type definitions for ArcGIS API for JavaScript v3.18
// Project: http://js.arcgis.com
// Definitions by: Esri <http://www.esri.com>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -44,6 +44,7 @@ declare module "esri" {
import QueryTask = require("esri/tasks/QueryTask");
import TextSymbol = require("esri/symbols/TextSymbol");
import StandardGeographyQueryTask = require("esri/tasks/geoenrichment/StandardGeographyQueryTask");
import WCSConnection = require("esri/layers/WCSConnection");
import WMSLayerInfo = require("esri/layers/WMSLayerInfo");
import WMTSLayerInfo = require("esri/layers/WMTSLayerInfo");
@@ -483,12 +484,14 @@ declare module "esri" {
featureLayers: FeatureLayer[];
/** Reference to the map object. */
map?: Map;
/** The point feature layer containing the origin points. */
originsLayer: FeatureLayer;
/** The point feature layers containing the origin points. */
originsLayers: FeatureLayer[];
/** The name of the output layer to be shown in the Result layer name input box. */
outputLayerName?: string;
/** The url to the ArcGIS.com site or in-house portal where the GP server is hosted. */
portalUrl?: string;
/** Indicates whether to display a drop down menu listing valid input analysis layers. */
showSelectAnalysisLayer?: boolean;
}
export interface CoordinatesLocationProviderOptions {
/** The attribute field in the graphic object that contains the longitude (X) values. */
@@ -563,12 +566,14 @@ declare module "esri" {
export interface CreateWatershedsOptions {
/** The URL to the GPServer used to execute an analysis job. */
analysisGpServer?: string;
/** The feature layer containing input points used for calculating watersheds. */
inputLayer: FeatureLayer;
/** The feature layers containing input points used for calculating watersheds. */
inputLayers: FeatureLayer[];
/** Reference to the map object. */
map?: Map;
/** The url to the ArcGIS.com site or in-house portal where the GP server is hosted. */
portalUrl?: string;
/** Indicates whether to display a drop down menu listing valid input analysis layers. */
showSelectAnalysisLayer?: boolean;
}
export interface CutOptions {
/** The feature(s) added to the feature layer by the cut operation. */
@@ -939,6 +944,10 @@ declare module "esri" {
outFields?: string[];
/** Displays or hides the attachment column. */
showAttachments?: boolean;
/** Displays or hides tooltips for column headers. */
showColumnHeaderTooltips?: boolean;
/** Shows or hides cyclical relationship. */
showCyclicalRelationships?: boolean;
/** Displays the data type of the field right under the field label. */
showDataTypes?: boolean;
/** Displays or hides total number of features and selected number of features in the grid header. */
@@ -947,6 +956,8 @@ declare module "esri" {
showGridHeader?: boolean;
/** Displays or hides 'Options' drop-down menu of the FeatureTable. */
showGridMenu?: boolean;
/** Displays or hides the option to show related records in a table if the layer has pre-established relationship. */
showRelatedRecords?: boolean;
/** Displays or hides the 'Statistics' option in column menus for numeric fields. */
showStatistics?: boolean;
/** Enables an interaction between the map and the feature table. */
@@ -1996,6 +2007,30 @@ declare module "esri" {
/** The URL to use for connecting to a socket. */
socketUrl?: string;
}
export interface StretchFilterOptions {
/** Indicates whether to perform dynamic range adjustment using the current pixel data. */
dra?: boolean;
/** An array of gamma values, for example [0.8, 0.8, 0.8]. */
gamma?: number[];
/** The maximum value of stretched pixels. */
max?: number;
/** Percent of pixels clipped on the right histogram tail, for example 0.25. */
maxPercent?: number;
/** The minimum value of stretched pixels. */
min?: number;
/** Percent of pixels clipped on the left histogram tail, for example 1.5. */
minPercent?: number;
/** The number of standard deviations for StandardDeviation stretch, for example 2.5. */
numberOfStandardDeviations?: number;
/** The output pixel type. */
outputPixelType?: string;
/** An array of arrays containing custom statistics objects. */
statistics?: any[][];
/** See the constants table for a list of possible stretchType values. */
stretchType?: number;
/** Indicates whether to perform non-linear gamma stretch. */
useGamma?: boolean;
}
export interface SummarizeNearbyOptions {
/** The URL to the GPServer used to execute an analysis job. */
analysisGpServer?: string;
@@ -2023,6 +2058,8 @@ declare module "esri" {
showCredits?: boolean;
/** When true, the help links will be shown. */
showHelp?: boolean;
/** Indicates whether to display a drop down menu listing valid input analysis layers. */
showSelectAnalysisLayer?: boolean;
/** When true, the select folder dropdown will be shown. */
showSelectFolder?: boolean;
/** An array of possible statistics attribute field names and summary types that you wish to calculate for all nearby features. */
@@ -2031,8 +2068,8 @@ declare module "esri" {
summaryLayer?: FeatureLayer;
/** An array of possible feature layers summarizing toward. */
summaryLayers: FeatureLayer[];
/** The point, line, or polygon feature layer from which distances will be measured to features in summarizeLayer. */
sumNearbyLayer: FeatureLayer;
/** The point, line, or polygon feature layers from which distances will be measured to features in summarizeLayer. */
sumNearbyLayers: FeatureLayer[];
/** If true. */
sumShape?: boolean;
/** Type of units shown as the defeault value in the Find nearest features using a option. */
@@ -2184,27 +2221,37 @@ declare module "esri" {
/** Region of preview scale thumbnails. */
region?: string;
}
export interface WCSConnectionOptions {
/** The coverage identifier, defaults to the first coverage. */
coverageId?: string;
/** The version of WCSLayer, can be: 1.0.01.1.01.1.11.1.22.0.1 */
version?: string;
}
export interface WCSLayerOptions {
/** The coverage identifier, defaults to the first coverage. */
coverageId?: string;
/** Sets the layer's draw mode. */
drawMode?: boolean;
/** Sets the context of the Canvas. */
drawType?: string;
/** A function that takes a pixelData object as input and processes it. */
pixelFilter?: Function;
/** The version of WCSLayer, can be: 1.0.01.1.01.1.11.1.22.0.1 */
version?: string;
/** A WCS Connection object. */
wcsConnection?: WCSConnection;
}
export interface WFSLayerOptions {
/** Full WFS body request sent to WFS server via POST method. */
getFeatureRequest?: string;
/** URL used when executing getFeature request. */
getFeatureUrl?: string;
/** Use this to append custom parameters to WFS requests. */
customParameters?: any;
/** The template that defines the content to display in the map info window when the user clicks on a feature. */
infoTemplate?: InfoTemplate;
/** For "ondemand" mode only. */
inverseFilter?: boolean;
/** When true, the XY coordinates should be swapped (this is required for some WFS vendors, versions, and WKIDS). */
inverseResponse?: boolean;
/** Specifies the maximum number of features to return in one response. */
maxFeatures?: number;
/** The query mode for the WFS layer. */
mode?: string;
/** For "ondemand" mode only. */
nsGeometryFieldName?: string;
/** The full layer name including the namespace as a prefix. */
nsLayerName?: string;
/** When true, more details will be printed to console when the first connection to a WFS server is established. */
showDetails?: boolean;
/** The simple layer name (excluding the namespace). */
name?: string;
/** URL to the WFS server. */
url: string;
/** OGC WFS version number. */
@@ -2235,6 +2282,10 @@ declare module "esri" {
title?: string;
}
export interface WMSLayerOptions {
/** The customLayerParameters object used for the WMS Layer. */
customLayerParameters?: any;
/** The customParameters object used for the WMS Layer. */
customParameters?: any;
/** Specify the map image format, valid options are png,jpg,bmp,gif,svg. */
format?: string;
/** An optional resourceInfo object. */
@@ -2267,6 +2318,10 @@ declare module "esri" {
title?: string;
}
export interface WMTSLayerOptions {
/** The customLayerParameters object used for the WMTS Layer. */
customLayerParameters?: any;
/** The customParameters object used for the WMTS Layer. */
customParameters?: any;
/** A WMTSLayerInfo object that when ResourceInfo options are not specified the map will display the first layer in the WMTS capabilities that matches the properties specified by WMTSLayerInfo. */
layerInfo?: WMTSLayerInfo;
/** When true, tile resampling is enabled. */
@@ -2783,7 +2838,7 @@ declare module "esri/TimeExtent" {
* Returns a new time extent indicating the intersection between "this" and the argument time extent.
* @param timeExtent The input time extent.
*/
intersection(timeExtent: number): TimeExtent;
intersection(timeExtent: TimeExtent): TimeExtent;
/**
* Returns a new time extent with the given offset from "this' time extent.
* @param offsetValue The length of time to offset from "this" time extent.
@@ -2946,7 +3001,7 @@ declare module "esri/arcgis/Portal" {
/** The prefix selected by the organization's administrator to be used with the customBaseURL. */
urlKey: string;
/** User information for the accessing user is returned only when a token is passed in. */
user: any;
user: PortalUser;
/** If true, only simple where clauses that are complaint with SQL92 can be used when querying layers and tables. */
useStandardizedQuery: boolean;
/**
@@ -3951,6 +4006,8 @@ declare module "esri/dijit/ElevationProfile" {
startup(): void;
/** Fires when the elevation profile is cleared. */
on(type: "clear-profile", listener: (event: { target: ElevationProfile }) => void): esri.Handle;
/** Fires after the profile is generated. */
on(type: "elevation-values", listener: (event: { data: any; target: ElevationProfile }) => void): esri.Handle;
/** Fires when the widget has fully loaded. */
on(type: "load", listener: (event: { target: ElevationProfile }) => void): esri.Handle;
/** Fires when the title of the elevation profile is changed */
@@ -3967,6 +4024,7 @@ declare module "esri/dijit/FeatureTable" {
import FeatureLayer = require("esri/layers/FeatureLayer");
import Map = require("esri/map");
import FeatureEditResult = require("esri/layers/FeatureEditResult");
import Graphic = require("esri/graphic");
/** Creates an instance of the FeatureTable widget within the provided DOM node. */
class FeatureTable {
@@ -4012,6 +4070,10 @@ declare module "esri/dijit/FeatureTable" {
selectedRows: any[];
/** Displays or hides the attachment column. */
showAttachments: boolean;
/** Displays or hides tooltips for column headers. */
showColumnHeaderTooltips: boolean;
/** Relies on showRelatedRecords property. */
showCyclicalRelationships: boolean;
/** Displays or hides the data type of the field right under the field label in the column header. */
showDataTypes: boolean;
/** Displays or hides total number of features and selected number of features in the grid header. */
@@ -4020,6 +4082,8 @@ declare module "esri/dijit/FeatureTable" {
showGridHeader: boolean;
/** Displays or hides 'Options' drop-down menu of the FeatureTable. */
showGridMenu: boolean;
/** Displays or hides the option to show related records in a table if the layer has pre-established relationship. */
showRelatedRecords: boolean;
/** Displays or hides the 'Statistics' option in column menus for numeric fields. */
showStatistics: boolean;
/** Enables an interaction between the map and the feature table. */
@@ -4032,35 +4096,55 @@ declare module "esri/dijit/FeatureTable" {
* @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into.
*/
constructor(params: esri.FeatureTableOptions, srcNodeRef: Node | string);
/** Removes all current selections including subsets from filterSelectedRecords(). */
/** Centers the map on combined extent of selected rows. */
centerOnSelection(): void;
/** Removes all filters and selections in the table. */
clearFilter(): void;
/** Removes all selections. */
clearSelection(): void;
/** Destroys the FeatureTable widget. */
destroy(): void;
/**
* Allows users to see the sub-set of currently selected records (uses dGrid.query).
* @param toggle When true only a subset of currently selected features will be displayed in the FeatureTable.
* Filters the table based on the provided row ids.
* @param ids Array of row ids.
*/
filterSelectedRecords(toggle: boolean): void;
filterRecordsByIds(ids: number[]): void;
/** Allows users to see the sub-set of records. */
filterSelectedRecords(): void;
/**
* Queries and gets selected features from the FeatureLayer instead of the store.
* @param id Array of row ids
* @param id Row id or an array of row ids
*/
getFeatureDataById(id: number[]): any;
getFeatureDataById(id: number | number[]): any;
/**
* Gets row object by the row ID.
* @param id row ID
*/
getRowDataById(id: number): any;
/** Refreshes the data in the grid. */
/** Refreshes the data in the table. */
refresh(): void;
/** Resizes the grid's container. */
resize(): void;
/**
* Allows users to select rows(s) based on row id(s).
* @param ids Row id or an array of row ids
* @param scrollToRow Indicates whether the table should scroll to selected rows.
*/
selectRows(ids: number | number[], scrollToRow?: boolean): void;
/**
* Sorts a given field in ascending or descending order.
* @param field Name of the field
* @param descending Defines whether the specified field will be sorted in ascending or descending order.
*/
sort(field: string, descending?: boolean): void;
/** Finalizes the creation of the widget. */
startup(): void;
/** This event fires in response to clearSelection() method. */
on(type: "clear-selection", listener: (event: { target: FeatureTable }) => void): esri.Handle;
/** Fires when the grid column is resized. */
on(type: "column-resize", listener: (event: { target: FeatureTable }) => void): esri.Handle;
on(type: "column-resize", listener: (event: { resizeEvent: any; target: FeatureTable }) => void): esri.Handle;
/** Fires when a column is hidden or shown via 'Options' drop-down menu. */
on(type: "column-state-change", listener: (event: { target: FeatureTable }) => void): esri.Handle;
on(type: "column-state-change", listener: (event: { stateChangeEvent: any; target: FeatureTable }) => void): esri.Handle;
/** Fires when grid editor field loses focus after being changed. */
on(type: "data-change", listener: (event: { target: FeatureTable }) => void): esri.Handle;
/** Fires when grid editor is hidden. */
@@ -4072,19 +4156,23 @@ declare module "esri/dijit/FeatureTable" {
/** Fires when an error occurs in the grid. */
on(type: "error", listener: (event: { target: FeatureTable }) => void): esri.Handle;
/** Fires when grid is filtered. */
on(type: "filter", listener: (event: { target: FeatureTable }) => void): esri.Handle;
on(type: "filter", listener: (event: { ids: number[]; target: FeatureTable }) => void): esri.Handle;
/** Fires when the FeatureTable is loaded. */
on(type: "load", listener: (event: { target: FeatureTable }) => void): esri.Handle;
/** Fires when the grid is refreshed. */
on(type: "refresh", listener: (event: { target: FeatureTable }) => void): esri.Handle;
/** Fires when a row is deselected. */
on(type: "row-deselect", listener: (event: { target: FeatureTable }) => void): esri.Handle;
on(type: "row-deselect", listener: (event: { event: any; target: FeatureTable }) => void): esri.Handle;
/** Fires when a row is selected. */
on(type: "row-select", listener: (event: { target: FeatureTable }) => void): esri.Handle;
on(type: "row-select", listener: (event: { event: any; target: FeatureTable }) => void): esri.Handle;
/** Fires when attachment is displayed in the table. */
on(type: "show-attachments", listener: (event: { attachments: any; dialog: any; featureId: number; target: FeatureTable }) => void): esri.Handle;
/** Fires when related records are displayed in the table. */
on(type: "show-related-records", listener: (event: { features: Graphic[]; relationship: any; row: any; target: FeatureTable }) => void): esri.Handle;
/** Fires when the statistics dialog box shows the calculated statistics on a column with numeric data. */
on(type: "show-statistics", listener: (event: { statistics: any; target: FeatureTable }) => void): esri.Handle;
/** Fires when a column is sorted. */
on(type: "sort", listener: (event: { target: FeatureTable }) => void): esri.Handle;
on(type: "sort", listener: (event: { sortEvent: any; target: FeatureTable }) => void): esri.Handle;
on(type: string, listener: (event: any) => void): esri.Handle;
}
export = FeatureTable;
@@ -4168,7 +4256,7 @@ declare module "esri/dijit/Geocoder" {
import GraphicsLayer = require("esri/layers/GraphicsLayer");
import Symbol = require("esri/symbols/Symbol");
/** Starting with version 3.13, the Search Widget supersedes the Geocoder Widget and is deprecated. */
/** The Geocoder widget was deprecated in version 3.13 and replaced by the Search widget. */
class Geocoder {
/** Currently selected locator object. */
activeGeocoder: any;
@@ -9403,6 +9491,8 @@ declare module "esri/layers/FeatureLayer" {
labelingInfo: LabelClass[];
/** Unique ID of the layer that the FeatureLayer was constructed against. */
layerId: number;
/** The maximum allowable offset, only applicable for layers that are not editable. */
maxAllowableOffset: number;
/** The maximum number of results that will be returned from a query. */
maxRecordCount: number;
/** Maximum visible scale for the layer. */
@@ -10914,7 +11004,7 @@ declare module "esri/layers/VectorTileLayer" {
import SpatialReference = require("esri/SpatialReference");
import TileInfo = require("esri/layers/TileInfo");
/** A VectorTileLayer accesses cached tiles of data and renders it in vector format. */
/** A VectorTileLayer renders cached tiles of data. */
class VectorTileLayer extends Layer {
/** The full extent of the layer. */
fullExtent: Extent;
@@ -10946,6 +11036,224 @@ declare module "esri/layers/VectorTileLayer" {
export = VectorTileLayer;
}
declare module "esri/layers/WCSConnection" {
import esri = require("esri");
import WCSCoverageDescription = require("esri/layers/WCSCoverageDescription");
import DimensionalDefinition = require("esri/layers/DimensionalDefinition");
/** (Currently in beta), a helper class to discover available coverages in an OGC Web Coverage Service. */
class WCSConnection {
/** Resamples pixel by bilinear interpolation. */
static INTERPOLATION_BILINEAR: any;
/** Resamples pixel by cubic convolution. */
static INTERPOLATION_CUBICCONVOLUTION: any;
/** Resamples pixel by nearest neighbor. */
static INTERPOLATION_NEARESTNEIGHBOR: any;
/** An array of coverages offered by the WCS server. */
coverages: WCSCoverageDescription[];
/** Multiple dimensional definitions are usually used to filter data. */
multidimensionalDefinition: DimensionalDefinition[];
/** The name of the WCS server. */
name: string;
/** Key-value pairs for URLs of different WCS operations: GetCapabilitiesDescribeCoverage */
onlineResources: any;
/** An array of string values indicating WCS 2.0.1 profiles. */
profiles: string[];
/** An array of supported formats by the server. */
supportedFormats: string[];
/** The interpolation method affects how the raster dataset is transformed when it undergoes warping or when it changes coordinate space. */
supportedInterpolations: number[];
/** An array of supported WCS versions by the server. */
supportedVersions: string[];
/** URL to a WCS Server endpoint. */
url: string;
/** The version of WCSLayer, can be: 1.0.01.1.01.1.11.1.22.0.1 */
version: string;
/**
* Creates a new WCSConnection.
* @param url URL to a WCS Server endpoint.
* @param options Optional parameters.
*/
constructor(url: string, options?: esri.WCSConnectionOptions);
/** Triggered when successfully retrieved list of coverages. */
on(type: "onConnected", listener: (event: { target: WCSConnection }) => void): esri.Handle;
/** Triggered when an error occurred. */
on(type: "onConnectionFailed", listener: (event: { error: Error; target: WCSConnection }) => void): esri.Handle;
on(type: string, listener: (event: any) => void): esri.Handle;
}
export = WCSConnection;
}
declare module "esri/layers/WCSCoverageDescription" {
import Extent = require("esri/geometry/Extent");
import Point = require("esri/geometry/Point");
import TimeInfo = require("esri/layers/TimeInfo");
/** (Currently in beta), the WCSCoverageDescription models the coverage properties offered by the WCS Server. */
class WCSCoverageDescription {
/** Resamples pixel by bilinear interpolation. */
static INTERPOLATION_BILINEAR: any;
/** Resamples pixel by cubic convolution. */
static INTERPOLATION_CUBICCONVOLUTION: any;
/** Resamples pixel by nearest neighbor. */
static INTERPOLATION_NEARESTNEIGHBOR: any;
/** An array of band names. */
bandInfo: string[];
/** Number of columns at the source resolution. */
columns: number;
/** The coverage description text. */
description: string;
/** Coverage extent in the native spatial reference. */
extent: Extent;
/** The coverage id. */
id: string;
/** Coverage extent in WGS84. */
lonLatEnvelope: Extent;
/** A parsed multidimensional object that describes variables and dimensions. */
multiDimensionalInfo: any;
/** A parsed coverage description object in a structure similar to WCS Coverage Description schema. */
nativeCoverageDescription: any;
/** Coverage's source resolution. */
resolution: Point;
/** Number of rows at the source resolution. */
rows: number;
/** Generalized from the following properties:SupportedFormats for WCS 1.0.0 and 1.1.xserviceParameters.supportedFormats for WCS 2.0.1. */
supportedFormats: string[];
/** The interpolation method affects how the raster dataset is transformed when it undergoes warping or when it changes coordinate space. */
supportedInterpolations: number[];
/** Temporal information for the layer, such as time extent. */
timeInfo: TimeInfo;
/** The current version of the coverage. */
version: string;
/**
* Creates a new WCSCoverageDescription.
* @param coverageDocument The coverage description XML.
* @param version The version of the coverage description document.
*/
constructor(coverageDocument: string, version: string);
}
export = WCSCoverageDescription;
}
declare module "esri/layers/WCSLayer" {
import esri = require("esri");
import WCSCoverageDescription = require("esri/layers/WCSCoverageDescription");
import Extent = require("esri/geometry/Extent");
import DimensionalDefinition = require("esri/layers/DimensionalDefinition");
import TimeInfo = require("esri/layers/TimeInfo");
import WCSConnection = require("esri/layers/WCSConnection");
import Point = require("esri/geometry/Point");
import Layer = require("esri/layers/layer");
/** (Currently in beta) The WCSLayer works with OGC Web Coverage Services. */
class WCSLayer {
/** Resamples pixel by bilinear interpolation. */
static INTERPOLATION_BILINEAR: any;
/** Resamples pixel by cubic convolution. */
static INTERPOLATION_CUBICCONVOLUTION: any;
/** Resamples pixel by nearest neighbor. */
static INTERPOLATION_NEARESTNEIGHBOR: any;
/** Zero-based array of current band selections. */
bandIds: number[];
/** A reference to a WCSCoverageDescription object. */
coverageDescription: WCSCoverageDescription;
/** The coverage identifier, defaults to the first coverage. */
coverageId: string;
/** The extent of the full coverage. */
extent: Extent;
/** Raster format of the layer. */
format: string;
/** Current interpolation method. */
interpolation: number;
/** When the layer is loaded, the value becomes "true", and layer properties can be accessed. */
loaded: boolean;
/** Multiple dimensional definitions are usually used to filter data. */
multidimensionalDefinition: DimensionalDefinition[];
/** Opacity or transparency of layer. */
opacity: number;
/** A function that takes a pixelData object as input and processes it. */
pixelFilter: Function;
/** The pixel type of the image service. */
pixelType: string;
/** The projected extent in the map's spatial reference. */
projectedFullExtent: Extent;
/** When true, the layer is suspended. */
suspended: boolean;
/** Temporal information for the layer, such as time extent. */
timeInfo: TimeInfo;
/** URL to a WCS Server endpoint. */
url: string;
/** The version of WCSLayer, can be: 1.0.01.1.01.1.11.1.22.0.1 */
version: string;
/** The visibility of the layer. */
visible: boolean;
/** A WCS Connection object. */
wcsConnection: WCSConnection;
/**
* Creates a new WCSLayer.
* @param url URL to a WCS Server endpoint.
* @param options Optional parameters.
*/
constructor(url: string, options?: esri.WCSLayerOptions);
/** Returns the context of the Canvas. */
getContext(): any;
/**
* Returns an array of graphics as a Promise.
* @param mapPoint The map point location in which to identify.
*/
identify(mapPoint: Point): any;
/** Resumes layer drawing. */
resume(): void;
/**
* Sets the opacity of the layer.
* @param opacity Value from 0 to 1, where 0 is 100% transparent and 1 has no transparency.
*/
setOpacity(opacity: number): void;
/**
* Sets a pixelFilter on the layer.
* @param pixelFilter The function defining the PixelFilter to set on the layer.
* @param doNotRefresh When true the layer will not refresh the map image.
*/
setPixelFilter(pixelFilter: Function, doNotRefresh?: boolean): void;
/**
* Determines if the layer will update its content based on the map's current time extent.
* @param use Use true to update the layer's content based on the map's current time extent.
*/
setUseMapTime(use: boolean): void;
/**
* Sets the visibility of the layer.
* @param isVisible Indicate whether to set layer visibility.
*/
setVisibility(isVisible: boolean): void;
/** Suspends layer drawing. */
suspend(): void;
/** Fires when there is a problem retrieving a layer. */
on(type: "error", listener: (event: { error: Error; target: WCSLayer }) => void): esri.Handle;
/** Fires after layer properties for the layer are successfully populated. */
on(type: "load", listener: (event: { layer: Layer; target: WCSLayer }) => void): esri.Handle;
/** Fires when the layer opacity has been changed, and returns an object with the opacity value. */
on(type: "opacity-change", listener: (event: { opacity: number; target: WCSLayer }) => void): esri.Handle;
/** This event is fired when the layer's refreshInterval is modified. */
on(type: "refresh-interval-change", listener: (event: { target: WCSLayer }) => void): esri.Handle;
/** Fires when a layer resumes drawing. */
on(type: "resume", listener: (event: { target: WCSLayer }) => void): esri.Handle;
/** Fires when a layer's minScale and/or maxScale is changed. */
on(type: "scale-range-change", listener: (event: { target: WCSLayer }) => void): esri.Handle;
/** Fires when a layer's scale visibility changes. */
on(type: "scale-visibility-change", listener: (event: { target: WCSLayer }) => void): esri.Handle;
/** Fires when a layer suspends drawing */
on(type: "suspend", listener: (event: { target: WCSLayer }) => void): esri.Handle;
/** Fires when a layer has finished updating its content. */
on(type: "update-end", listener: (event: { error: Error; target: WCSLayer }) => void): esri.Handle;
/** Fires when a layer begins to update its content. */
on(type: "update-start", listener: (event: { target: WCSLayer }) => void): esri.Handle;
/** Fires when the layer visibility has been changed, and returns an object with a Boolean visible property containing the new visibility value of the layer. */
on(type: "visibility-change", listener: (event: { visible: boolean; target: WCSLayer }) => void): esri.Handle;
on(type: string, listener: (event: any) => void): esri.Handle;
}
export = WCSLayer;
}
declare module "esri/layers/WFSLayer" {
import esri = require("esri");
import GraphicsLayer = require("esri/layers/GraphicsLayer");
@@ -10957,6 +11265,8 @@ declare module "esri/layers/WFSLayer" {
/** (Currently in beta) A layer for OGC Web Feature Services (WFS). */
class WFSLayer extends GraphicsLayer {
/** Use this to append custom parameters to WFS requests. */
customParameters: any;
/** An array of fields in the layer. */
fields: Field[];
/** The full extent of the layer. */
@@ -10987,6 +11297,11 @@ declare module "esri/layers/WFSLayer" {
redraw(): void;
/** Refreshes the features in the WFS layer. */
refresh(): void;
/**
* Sets the custom parameters used on the WFS layer.
* @param customParameters The customParameters object used append WFS requests.
*/
setCustomParameters(customParameters: any): void;
/** Sets the default line symbol to be used if no renderer is specified. */
setLineSymbol(): void;
/** Sets the default point symbol to be used if no renderer is specified. */
@@ -11012,12 +11327,20 @@ declare module "esri/layers/WMSLayer" {
allExtents: Extent[];
/** Copyright of the WMS service. */
copyright: string;
/** Use this to append different custom parameters to WMS layer requests. */
customLayerParameters: any;
/** Use this to append custom parameters to all WMS requests. */
customParameters: any;
/** Description of the WMS service. */
description: string;
/** Extent of the WMS service. */
extent: Extent;
/** Feature info MIME type to request. */
featureInfoFormat: string;
/** The URL for the WMS GetFeatureInfo call. */
getFeatureInfoURL: string;
/** The URL for the WMS GetMap call. */
getMapUrl: string;
getMapURL: string;
/** The map image format. */
imageFormat: string;
/** List of layers in the WMS service. */
@@ -11034,12 +11357,22 @@ declare module "esri/layers/WMSLayer" {
title: string;
/** Version of the WMS service. */
version: string;
/** A list of layer names that represent the layers to include in the exported map. */
visibleLayers: string[];
/**
* Creates a new WMSLayer object.
* @param url URL to the OGC Web Map Service.
* @param options Optional parameters.
*/
constructor(url: string, options?: esri.WMSLayerOptions);
/** Returns the current map image format. */
getImageFormat(): string;
/**
* Sets the custom parameters used on the WMS layer.
* @param customParameters The customParameters object used append WMS requests.
* @param customLayerParameters The customLayerParameters object used append specific WMS layer requests.
*/
setCustomParameters(customParameters: any, customLayerParameters?: any): void;
/**
* Set the map image format; valid values are "png", "jpg", "pdf", "bmp", "gif" and "svg".
* @param format The image format.
@@ -11106,6 +11439,10 @@ declare module "esri/layers/WMTSLayer" {
class WMTSLayer extends TiledMapServiceLayer {
/** Copyright information for the service. */
copyright: string;
/** Use this to append different custom parameters to a WMTS tile request. */
customLayerParameters: any;
/** Use this to append custom parameters to all WMTS requests. */
customParameters: any;
/** The description of the active layer if specified in the capabilties file or the resource info. */
description: string;
/** The tile format. */
@@ -11137,6 +11474,12 @@ declare module "esri/layers/WMTSLayer" {
* @param WMTSLayerInfo The WMTSLayerInfo for the layer to make active.
*/
setActiveLayer(WMTSLayerInfo: WMTSLayerInfo): void;
/**
* Sets the custom parameters used on the WMTS layer.
* @param customParameters The customParameters object used append WMTS requests.
* @param customLayerParameters The customLayerParameters object used append specific WMTS layer requests.
*/
setCustomParameters(customParameters: any, customLayerParameters?: any): void;
}
export = WMTSLayer;
}
@@ -11315,6 +11658,47 @@ declare module "esri/layers/layer" {
export = Layer;
}
declare module "esri/layers/pixelfilters/StretchFilter" {
import esri = require("esri");
/** A stretch filter used to work with client -side pixel data to enhance raster/image appearances. */
class StretchFilter {
/** Indicates whether to perform dynamic range adjustment using the current pixel data. */
dra: boolean;
/** An array of gamma values, for example [0.8, 0.8, 0.8]. */
gamma: number[];
/** The maximum value of stretched pixels. */
max: number;
/** Percent of pixels clipped on the right histogram tail, for example 0.25. */
maxPercent: number;
/** The minimum value of stretched pixels. */
min: number;
/** Percent of pixels clipped on the left histogram tail, for example 1.5. */
minPercent: number;
/** The number of standard deviations for StandardDeviation stretch, for example 2.5. */
numberOfStandardDeviations: number;
/** The output pixel type. */
outputPixelType: string;
/** An array of arrays containing custom statistics objects. */
statistics: any[][];
/** Number indicating the various stretch types. */
stretchType: number;
/** Indicates whether to perform non-linear gamma stretch. */
useGamma: boolean;
/**
* Creates an instance of a StretchFilter.
* @param options Optional parameters.
*/
constructor(options?: esri.StretchFilterOptions);
/**
* It takes a pixelData object as input and processes it.
* @param pixelData The pixelData object used as filter input.
*/
filter(pixelData: any): void;
}
export = StretchFilter;
}
declare module "esri/map" {
import esri = require("esri");
import Attribution = require("esri/dijit/Attribution");
@@ -11779,8 +12163,8 @@ declare module "esri/opsdashboard/ExtensionBase" {
static POLYLINE: any;
/** Read-only: Indicates if the host application is the Windows Operations Dashboard. */
isNative: boolean;
/** Read Only: It will list all of the Portal helper services. */
portalHelperServices: string;
/** Read-only: It will list all of the Portal helper services. */
portalHelperServices: any;
/** Read-only: The URL to the ArcGIS.com site or in-house portal that you are currently signed in to. */
portalUrl: string;
/** Get the collection of data sources from the host application. */
@@ -11838,8 +12222,11 @@ declare module "esri/opsdashboard/ExtensionConfigurationBase" {
class ExtensionConfigurationBase extends ExtensionBase {
/** The object that will store the Widget/MapTool/FeatureAction configuration. */
config: any;
/** Indicates that the configuration is ready to be persisted or not. */
readyToPersistConfig: boolean;
/**
* Indicates if the configuration is ready to be persisted or not.
* @param ready Indicates that the configuration is ready to be persisted or not.
*/
readyToPersistConfig(ready: boolean): void;
}
export = ExtensionConfigurationBase;
}
@@ -14127,6 +14514,8 @@ declare module "esri/tasks/FeatureSet" {
features: Graphic[];
/** Set of name-value pairs for the attribute's field and alias names. */
fieldAliases: any;
/** The array of fields. */
fields: any[];
/** The geometry type of the FeatureSet. */
geometryType: string;
/** When a FeatureSet is used as input to Geoprocessor, the spatial reference is set to the map's spatial reference by default. */
@@ -14379,7 +14768,7 @@ declare module "esri/tasks/GeometryService" {
url: string;
/**
* Creates a new GeometryService object.
* @param url URL to the ArcGIS Server REST resource that represents a GeometryService, e.g., http://sampleserver6.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer.
* @param url URL to the ArcGIS Server REST resource that represents a GeometryService, https://utility.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer.
*/
constructor(url: string);
/**
@@ -15165,6 +15554,7 @@ declare module "esri/tasks/PrintParameters" {
declare module "esri/tasks/PrintTask" {
import esri = require("esri");
import PrintParameters = require("esri/tasks/PrintParameters");
import DataFile = require("esri/tasks/DataFile");
/** The PrintTask class generates a printer-ready version of the map using an Export Web Map Task available with ArGIS Server 10.1 and later. */
class PrintTask {
@@ -15184,7 +15574,7 @@ declare module "esri/tasks/PrintTask" {
*/
execute(printParameters: PrintParameters, callback?: Function, errback?: Function): any;
/** Fired when the print operation is complete. */
on(type: "complete", listener: (event: { url: string; target: PrintTask }) => void): esri.Handle;
on(type: "complete", listener: (event: { result: DataFile; target: PrintTask }) => void): esri.Handle;
/** Fired when an error occurs while executing the print task. */
on(type: "error", listener: (event: { error: Error; target: PrintTask }) => void): esri.Handle;
on(type: string, listener: (event: any) => void): esri.Handle;
+1 -1
View File
@@ -211,7 +211,7 @@ declare namespace autobahn {
retry_delay_jitter?: number;
url?: string;
protocols?: string[];
onchallenge?: (session: Session, method: string, extra: any) => OnChallengeHandler;
onchallenge?: OnChallengeHandler;
realm?: string;
authmethods?: string[];
authid?: string;
+260
View File
@@ -22,6 +22,27 @@ declare module "aws-sdk" {
constructor(profile: string);
}
export module CognitoIdentity {
export interface CognitoIdentityCredentialsParams {
IdentityPoolId?: string;
AccountId?: string;
Logins?: {[k: string]: any};
RoleArn?: string;
RoleSessionName?: string;
WebIdentityToken?: string;
ProviderId?: string;
Policy?: string;
DurationSeconds?: number;
IdentityId?: string;
}
}
export class CognitoIdentityCredentials extends Credentials {
constructor(params: CognitoIdentity.CognitoIdentityCredentialsParams);
}
export interface Logger {
write?: (chunk: any, encoding?: string, callback?: () => void) => void;
log?: (...messages: any[]) => void;
@@ -163,6 +184,37 @@ declare module "aws-sdk" {
region: string;
}
export class CloudFormation {
constructor(options?: CloudFormation.Options);
endpoint: Endpoint;
cancelUpdateStack(params: CloudFormation.CancelUpdateStackParams, callback: (err: AwsError, data: any) => void): void;
continueUpdateRollback(params: CloudFormation.ContinueUpdateRollbackParams, callback: (err: AwsError, data: any) => void): void;
createChangeSet(params: CloudFormation.CreateChangeSetParams, callback: (err: AwsError, data: any) => void): void;
createStack(params: CloudFormation.CreateStackParams, callback: (err: AwsError, data: any) => void): void;
deleteChangeSet(params: CloudFormation.DeleteChangeSetParams, callback: (err: AwsError, data: any) => void): void;
deleteStack(params: CloudFormation.DeleteStackParams, callback: (err: AwsError, data: any) => void): void;
describeAccountLimits(params: CloudFormation.DescribeAccountLimitsParams, callback: (err: AwsError, data: any) => void): void;
describeChangeSet(params: CloudFormation.DescribeChangeSetParams, callback: (err: AwsError, data: any) => void): void;
describeStackEvents(params: CloudFormation.DescribeStackEventsParams, callback: (err: AwsError, data: any) => void): void;
describeStackResource(params: CloudFormation.DescribeStackResourceParams, callback: (err: AwsError, data: any) => void): void;
describeStackResources(params: CloudFormation.DescribeStackResourcesParams, callback: (err: AwsError, data: any) => void): void;
describeStacks(params: CloudFormation.DescribeStacksParams, callback: (err: AwsError, data: any) => void): void;
estimateTemplateCost(params: CloudFormation.EstimateTemplateCostParams, callback: (err: AwsError, data: any) => void): void;
executeChangeSet(params: CloudFormation.ExecuteChangeSetParams, callback: (err: AwsError, data: any) => void): void;
getStackPolicy(params: CloudFormation.GetStackPolicyParams, callback: (err: AwsError, data: any) => void): void;
getTemplate(params: CloudFormation.GetTemplateParams, callback: (err: AwsError, data: any) => void): void;
getTemplateSummary(params: CloudFormation.GetTemplateSummaryParams, callback: (err: AwsError, data: any) => void): void;
listChangeSets(params: CloudFormation.ListChangeSetsParams, callback: (err: AwsError, data: any) => void): void;
listStackResources(params: CloudFormation.ListStackResourcesParams, callback: (err: AwsError, data: any) => void): void;
listStacks(params: CloudFormation.ListStacksParams, callback: (err: AwsError, data: any) => void): void;
setStackPolicy(params: CloudFormation.SetStackPolicyParams, callback: (err: AwsError, data: any) => void): void;
signalResource(params: CloudFormation.SignalResourceParams, callback: (err: AwsError, data: any) => void): void;
updateStack(params: CloudFormation.UpdateStackParams, callback: (err: AwsError, data: any) => void): void;
validateTemplate(params: CloudFormation.ValidateTemplateParams, callback: (err: AwsError, data: any) => void): void;
waitFor(state: string, params: CloudFormation.WaitForParams, callback: (err: AwsError, data: any) => void): void;
}
export class Lambda {
constructor(options?: any);
endpoint: Endpoint;
@@ -532,6 +584,214 @@ declare module "aws-sdk" {
// ===========================================================
export module CloudFormation {
export interface CancelUpdateStackParams {
StackName: string;
}
export interface ContinueUpdateRollbackParams {
StackName: string;
}
export interface CreateChangeSetParams {
StackName: string;
TemplateBody?: string; // specify either TemplateBody or TemplateURL
TemplateURL?: string; // specify either TemplateBody or TemplateURL
UsePreviousTemplate?: boolean;
Parameters?: CloudFormation.Parameter[];
Capabilities?: string[]; // CAPABILITY_IAM | CAPABILITY_NAMED_IAM
ResourceTypes?: string[];
NotificationARNs?: string[];
Tags?: CloudFormation.Tag[];
ChangeSetName: string;
ClientToken?: string;
Description?: string;
}
export interface CreateStackParams {
StackName: string;
TemplateBody?: string; // specify either TemplateBody or TemplateURL
TemplateURL?: string; // specify either TemplateBody or TemplateURL
Parameters?: CloudFormation.Parameter[];
DisableRollback?: boolean; // cannot specify both DisableRollback and OnFailure
TimeoutInMinutes?: number;
NotificationARNs?: string[];
Capabilities?: string[];
ResourceTypes?: string[];
OnFailure?: string[]; // cannot specify both DisableRollback and OnFailure
// DO_NOTHING | ROLLBACK | DELETE
StackPolicyBody?: string[]; // cannot specify both StackPolicyBody and StackPolicyURL
StackPolicyURL?: string[]; // cannot specify both StackPolicyBody and StackPolicyURL
Tags?: CloudFormation.Tag[];
}
export interface DeleteChangeSetParams {
ChangeSetName: string;
StackName?: string;
}
export interface DeleteStackParams {
StackName: string;
RetainResources?: string[];
}
export interface DescribeAccountLimitsParams {
NextToken?: string;
}
export interface DescribeChangeSetParams {
ChangeSetName: string;
StackName?: string;
NextToken?: string;
}
export interface DescribeStackEventsParams {
StackName?: string;
NextToken?: string;
}
export interface DescribeStackResourceParams {
StackName: string;
LogicalResourceId: string;
}
export interface DescribeStackResourcesParams {
StackName?: string; // must specify either StackName or PhysicalResourceId
LogicalResourceId?: string;
PhysicalResourceId?: string; // must specify either StackName or PhysicalResourceId
}
export interface DescribeStacksParams {
StackName?: string;
NextToken?: string;
}
export interface EstimateTemplateCostParams {
TemplateBody?: string; // must specify either TemplateBody or TemplateURL
// if both are passed, only TemplateBody is used
TemplateURL?: string; // must specify either TemplateBody or TemplateURL
Parameters?: CloudFormation.Parameter[];
}
export interface ExecuteChangeSetParams {
ChangeSetName: string;
StackName?: string;
}
export interface GetStackPolicyParams {
StackName: string;
}
export interface GetTemplateParams {
StackName: string;
}
export interface GetTemplateSummaryParams {
// must specify one of the three
TemplateBody?: string;
TemplateURL?: string;
StackName?: string;
}
export interface ListChangeSetsParams {
StackName: string;
NextToken?: string;
}
export interface ListStackResourcesParams {
StackName: string;
NextToken?: string;
}
export interface ListStacksParams {
NextToken?: string;
StackStatusFilter?: string[];
}
export interface SetStackPolicyParams {
StackName: string;
StackPolicyBody?: string; // cannot set both StackPolicyBody and StackPolicyURL
StackPolicyURL?: string; // cannot set both StackPolicyBody and StackPolicyURL
}
export interface SignalResourceParams {
StackName: string;
LogicalResourceId: string;
UniqueId: string;
Status: string; // SUCCESS | FAILURE
}
export interface UpdateStackParams {
StackName: string;
TemplateBody?: string; // specify either TemplateBody or TemplateURL, not both
TemplateURL?: string; // specify either TemplateBody or TemplateURL, not both
UsePreviousTemplate?: boolean;
StackPolicyDuringUpdateBody?: string; // cannot set both StackPolicyDuringUpdateBody and StackPolicyDuringUpdateURL
StackPolicyDuringUpdateURL?: string; // cannot set both StackPolicyDuringUpdateBody and StackPolicyDuringUpdateURL
Parameters?: CloudFormation.Parameter[];
Capabilities?: string[]; // CAPABILITY_IAM | CAPABILITY_NAMED_IAM
ResourceTypes?: string[];
StackPolicyBody?: string; // cannot set both StackPolicyBody and StackPolicyURL
StackPolicyURL?: string; // cannot set both StackPolicyBody and StackPolicyURL
NotificationARNs?: string[];
Tags?: CloudFormation.Tag[];
}
export interface ValidateTemplateParams {
TemplateBody?: string; // must pass either TemplateBody or TemplateURL
// if both are specified, only TemplateBody is used
TemplateURL?: string; // must pass either TemplateBody or TemplateURL
}
export interface WaitForParams {
StackName: string;
NextToken?: string;
}
export interface Options {
params?: any;
endpoint?: string;
accessKeyId?: string;
secretAccessKey?: string;
sessionToken?: any;
credentials?: any;
credentialProvider?: any;
region?: string;
maxRetries?: number;
maxRedirects?: number;
sslEnabled?: boolean;
paramValidation?: any;
computeChecksums?: boolean;
convertResponseTypes?: boolean;
correctClockSkew?: boolean;
s3ForcePathStyle?: boolean;
s3BucketEndpoint?: boolean;
s3DisableBodySigning?: boolean;
retryDelayOptions?: any;
httpOptions?: any;
apiVersion?: any;
apiVersions?: any;
logger?: any;
systemClockOffset?: number;
signatureVersion?: string;
signatureCache?: boolean;
}
export interface Parameter {
ParameterKey: string;
ParameterValue: string;
UsePreviousValue?: boolean; // if you specify true, do not specify ParameterValue
}
export interface Tag {
Key: string;
Value: string;
}
}
// ===========================================================
export module Lambda {
export interface AddPermissionParams {
+30 -9
View File
@@ -8,7 +8,7 @@ import queries = require('azure-mobile-apps/src/query');
var app = express(),
mobileApp = mobileApps();
// various configuration permutations
// various configuration permutations
mobileApps({
debug: true,
data: {
@@ -17,7 +17,8 @@ mobileApps({
user: '',
database: '',
password: ''
}
},
webhook: { url: 'http://localhost/' }
});
mobileApps({
@@ -29,7 +30,7 @@ mobileApps({
// it would be nice to integrate with winston
mobileApps({ logging: { level: 'silly', transports: [{}] } })
// various custom middleware syntaxes
// various custom middleware syntaxes
mobileApp.use(function (req: any, res: any, next: any) { next(); });
mobileApp.use([function () {}, function () {}]);
mobileApp.use(function () {}, function () {});
@@ -43,6 +44,9 @@ mobileApp.tables.import('tables');
mobileApp.api.add('api', { authorize: true, get: function () {}, delete: function () {} });
mobileApp.api.import('api');
// ensure the mobile app instance can be correctly mounted as an express router
app.use(mobileApp);
// Express.Table, instantiated from the mobile app
var table = mobileApp.table()
table.use(function (req: Express.Request, res: Express.Response, next: any) {
@@ -61,16 +65,18 @@ table.read(function (context: Azure.MobileApps.Context) {
table.insert(function (context: Azure.MobileApps.Context) {
context.query.id = 'anotherId';
context.query.single = true;
context.item.userId = context.user.id;
context.item.userId = context.user.id;
context.push.send('tag', {}, function (error, result) {});
context.push.gcm.send('tag', {}, function (error, result) {});
context.push.apns.send('tag', { payload: { } }, function (error, result) {});
context.push.wns.sendToastText01('tag', '', { headers: { } }, function (error, result) {});
context.next(new Error());
context.next('An error occurred');
});
table.read.use(function () {});
table.read.use([function () {}, function () {}]);
table.read.use(function () {}, function () {});
table.use(function () {}).use(function () {}).read(function () {}).use(function () {})
table.use(function () {}).use(function () {}).read(function () {}).use(function () {});
table.access = undefined;
table.access = 'authenticated';
@@ -79,10 +85,25 @@ table.update.access = 'disabled';
table.delete.access = 'authenticated';
table.insert.access = 'authenticated';
table.filters = [function (query, context) { }];
table.transforms = [function (item, context) { }];
table.hooks = [function (results, context) { }];
table.perUser = true;
table.recordsExpire = { milliseconds: 1, seconds: 1, minutes: 1, hours: 1, days: 1, weeks: 1, months: 1, years: 1 };
table.webhook = { url: 'http://localhost/' }
table.webhook = true;
// Express.Table, instantiated from the static require('azure-mobile-apps').table()
// This is going to be interesting if we ever support more than one provider
var table2 = mobileApps.table();
table2.read(function (context: Azure.MobileApps.Context) {})
table2.read(function (context: Azure.MobileApps.Context) {});
// ApiDefinition, from the static require('azure-mobile-apps').api()
var api2 = mobileApps.api({
get: function (req, res, next) { }
});
api2.post = function (req, res, next) {};
// Logger
logger.silly('test', 'message');
@@ -90,10 +111,10 @@ logger.error('Something happened', new Error());
mobileApps.logger.debug('a debug message')
// Query
queries.create('table').where({ x: 10 }).select('col1,col2');
queries.create('table').where({ x: 10 }).select('col1,col2').includeDeleted().includeTotalCount();
mobileApps.query.create('table');
// custom sql query
// Custom SQL query
mobileApp.api.add('query', { authorize: true, get: (req, res, next) => {
req.azureMobile.data.execute({
sql: "SELECT * FROM TODOITEM WHERE COMPLETE = :complete",
@@ -101,4 +122,4 @@ mobileApp.api.add('query', { authorize: true, get: (req, res, next) => {
{ name: 'complete', value: 1 }
]
}).then(x => {});
}, delete: function () {} });
}, delete: function () {} });
+47 -19
View File
@@ -1,4 +1,4 @@
// Type definitions for azure-mobile-apps v2.0.0-beta3
// Type definitions for azure-mobile-apps v2.1.7
// Project: https://github.com/Azure/azure-mobile-apps-node/
// Definitions by: Microsoft Azure <https://github.com/Azure/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -10,6 +10,7 @@ declare module "azure-mobile-apps" {
interface AzureMobileApps {
(configuration?: Azure.MobileApps.Configuration): Azure.MobileApps.Platforms.Express.MobileApp;
table(): Azure.MobileApps.Platforms.Express.Table;
api(definition?: Azure.MobileApps.ApiDefinition): Azure.MobileApps.ApiDefinition;
logger: Azure.MobileApps.Logger;
query: Azure.MobileApps.Query;
}
@@ -31,7 +32,7 @@ declare namespace Azure.MobileApps {
// the additional Platforms namespace is required to avoid collisions with the main Express namespace
export module Platforms {
export module Express {
interface MobileApp {
interface MobileApp extends Middleware {
configuration: Configuration;
tables: Tables;
table(): Table;
@@ -45,15 +46,7 @@ declare namespace Azure.MobileApps {
import(fileOrFolder: string): void;
}
interface Table {
authorize?: boolean;
access?: AccessType;
autoIncrement?: boolean;
dynamicSchema?: boolean;
name: string;
columns?: any;
schema: string;
interface Table extends TableDefinition {
use(...middleware: Middleware[]): Table;
use(middleware: Middleware[]): Table;
read: TableOperation;
@@ -67,11 +60,9 @@ declare namespace Azure.MobileApps {
(operationHandler: (context: Context) => void): Table;
use(...middleware: Middleware[]): Table;
use(middleware: Middleware[]): Table;
access: AccessType;
access?: AccessType;
}
type AccessType = 'anonymous' | 'authenticated' | 'disabled';
interface Tables {
configuration: Configuration;
add(name: string, definition?: Table | TableDefinition): void;
@@ -136,6 +127,7 @@ declare namespace Azure.MobileApps {
auth?: Configuration.Auth;
cors?: Configuration.Cors;
notifications?: Configuration.Notifications;
webhook?: Webhook;
}
export module Configuration {
@@ -152,6 +144,7 @@ declare namespace Azure.MobileApps {
options?: { encrypt: boolean };
schema?: string;
dynamicSchema?: boolean;
filename?: string;
}
interface Auth {
@@ -167,8 +160,9 @@ declare namespace Azure.MobileApps {
interface LoggingTransport { }
interface Cors {
exposeHeaders: string;
maxAge?: number;
origins: string[];
hostnames: string[];
}
interface Notifications {
@@ -188,7 +182,8 @@ declare namespace Azure.MobileApps {
}
interface QueryJs {
includeTotalCount?: boolean;
includeTotalCount(): QueryJs;
includeDeleted(): QueryJs;
orderBy(properties: string): QueryJs;
orderByDescending(properties: string): QueryJs;
select(properties: string): QueryJs;
@@ -213,6 +208,7 @@ declare namespace Azure.MobileApps {
// general
var nh: Azure.ServiceBus.NotificationHubService;
interface Context {
query: QueryJs;
id: string | number;
@@ -225,6 +221,7 @@ declare namespace Azure.MobileApps {
push: typeof nh;
logger: Logger;
execute(): Thenable<any>;
next(error: string|Error): any;
}
interface ContextData {
@@ -240,15 +237,46 @@ declare namespace Azure.MobileApps {
interface SqlParameterDefinition {
name: string;
value: any;
}
}
interface TableDefinition {
access?: AccessType;
authorize?: boolean;
autoIncrement?: boolean;
dynamicSchema?: boolean;
name?: string;
columns?: any;
databaseTableName?: string;
dynamicSchema?: boolean;
maxTop?: number;
name?: string;
pageSize?: number;
schema?: string;
softDelete?: boolean;
userIdColumn?: string;
filters?: [(query: QueryJs, context: Context) => void | QueryJs];
transforms?: [(item: any, context: Context) => void | any];
hooks?: [(results: any, context: Context) => void];
perUser?: boolean;
recordsExpire?: Duration;
webhook?: Webhook | boolean;
}
type AccessType = 'anonymous' | 'authenticated' | 'disabled';
interface Duration {
milliseconds?: number;
seconds?: number;
minutes?: number;
hours?: number;
days?: number;
weeks?: number;
months?: number;
years?: number;
}
interface Webhook {
url: string;
}
interface ApiDefinition {
+38 -30
View File
@@ -329,32 +329,32 @@ var CORE_PARSER_TESTS: ParserTest[] = [
}
},
// {
// description: "Comment with non-default character",
// input: 'a,b,c\n!Comment goes here\nd,e,f',
// config: { comments: '!' },
// expected: {
// data: [['a', 'b', 'c'], ['d', 'e', 'f']],
// errors: []
// }
// description: "Comment with non-default character",
// input: 'a,b,c\n!Comment goes here\nd,e,f',
// config: { comments: '!' },
// expected: {
// data: [['a', 'b', 'c'], ['d', 'e', 'f']],
// errors: []
// }
// },
// {
// description: "Bad comments value specified",
// notes: "Should silently disable comment parsing",
// input: 'a,b,c\n5comment\nd,e,f',
// config: { comments: 5 },
// expected: {
// data: [['a', 'b', 'c'], ['5comment'], ['d', 'e', 'f']],
// errors: []
// }
// description: "Bad comments value specified",
// notes: "Should silently disable comment parsing",
// input: 'a,b,c\n5comment\nd,e,f',
// config: { comments: 5 },
// expected: {
// data: [['a', 'b', 'c'], ['5comment'], ['d', 'e', 'f']],
// errors: []
// }
// },
// {
// description: "Multi-character comment string",
// input: 'a,b,c\n=N(Comment)\nd,e,f',
// config: { comments: "=N(" },
// expected: {
// data: [['a', 'b', 'c'], ['d', 'e', 'f']],
// errors: []
// }
// description: "Multi-character comment string",
// input: 'a,b,c\n=N(Comment)\nd,e,f',
// config: { comments: "=N(" },
// expected: {
// data: [['a', 'b', 'c'], ['d', 'e', 'f']],
// errors: []
// }
// },
{
description: "Input with only a commented line",
@@ -419,13 +419,13 @@ var CORE_PARSER_TESTS: ParserTest[] = [
}
},
// {
// description: "Fast mode with comments",
// input: '// Commented line\na,b,c',
// config: { fastMode: true, comments: "//" },
// expected: {
// data: [['a', 'b', 'c']],
// errors: []
// }
// description: "Fast mode with comments",
// input: '// Commented line\na,b,c',
// config: { fastMode: true, comments: "//" },
// expected: {
// data: [['a', 'b', 'c']],
// errors: []
// }
// },
{
description: "Fast mode with preview",
@@ -1091,7 +1091,7 @@ function compare(actualData: any[], actualErrors: any[], expected: ParserTestExp
}
}
if (passed) // final check will catch any other differences
if (passed) // final check will catch any other differences
passed = JSON.stringify(actual) == JSON.stringify(expected);
// We pass back an object right now, even though it only contains
@@ -1228,3 +1228,11 @@ var parser = new Baby.Parser({})
parser.getCharIndex();
parser.abort();
parser.parse("");
/**
* Parse Files
*/
Baby.parseFiles('example.csv')
Baby.parseFiles('example.csv', {encoding: 'utf-8'})
Baby.parseFiles(['example1.csv', 'example2.txt'])
Baby.parseFiles(['example1.csv', 'example2.txt'], {encoding: 'utf-8'})
+10
View File
@@ -9,6 +9,11 @@ declare namespace BabyParse {
* Parse a csv string or a csv file
*/
parse(csvString: string, config?: ParseConfig): ParseResult;
/**
* Parse single file or multiple files
*/
parseFiles(input: string | string[] | FileObject | FileObject[], config?: ParseConfig): ParseResult;
/**
* Unparses javascript data objects and returns a csv string
@@ -86,6 +91,11 @@ declare namespace BabyParse {
data: string | Array<any>;
}
interface FileObject {
file: string
config?: ParseConfig
}
interface ParseError {
type: string; // A generalization of the error
code: string; // Standardized error code
+10
View File
@@ -0,0 +1,10 @@
/// <reference path="bit-array.d.ts" />
import BitArray = require("bit-array");
const a = new BitArray(32);
a.set(0, true);
a.set(31, true);
a.toString(); // "10000000000000000000000000000001"
a.get(1); // false
a.get(31); // true
+1
View File
@@ -0,0 +1 @@
--noImplicitAny --module commonjs
+105
View File
@@ -0,0 +1,105 @@
// Type definitions for bit-array v0.2.2
// Project: https://github.com/bramstein/bit-array
// Definitions by: Mudkip <https://github.com/mudkipme>
// Definitions: https://github.com/mudkipme/DefinitelyTyped
declare module "bit-array" {
class BitArray {
/**
* Creates a new empty BitArray with the given length or initialises the BitArray with the given hex representation.
*/
constructor(size: number, hex?: string);
/**
* Returns the total number of bits in this BitArray.
*/
size(): number;
/**
* Sets the bit at index to a value (boolean.)
*/
set(index: number, value: boolean): BitArray;
/**
* Toggles the bit at index. If the bit is on, it is turned off. Likewise, if the bit is off it is turned on.
*/
toggle(index: number): BitArray;
/**
* Returns the value of the bit at index (boolean.)
*/
get(index: number): boolean;
/**
* Resets the BitArray so that it is empty and can be re-used.
*/
reset(): BitArray;
/**
* Returns a copy of this BitArray.
*/
copy(): BitArray;
/**
* Returns true if this BitArray equals another. Two BitArrays are considered
* equal if both have the same length and bit pattern.
*/
equals(x: BitArray): boolean;
/**
* Returns the JSON representation of this BitArray.
*/
toJSON(): string;
/**
* Returns a string representation of the BitArray with bits
* in mathemetical order.
*/
toBinaryString(): string;
/**
* Returns a hexadecimal string representation of the BitArray
* with bits in logical order.
*/
toHexString(): string;
/**
* Returns a string representation of the BitArray with bits
* in logical order.
*/
toString(): string;
/**
* Convert the BitArray to an Array of boolean values (slow).
*/
toArray(): boolean[];
/**
* Returns the total number of bits set to one in this BitArray.
*/
count(): number;
/**
* Inverts this BitArray.
*/
not(): BitArray;
/**
* Bitwise OR on the values of this BitArray using BitArray x.
*/
or(x: BitArray): BitArray;
/**
* Bitwise AND on the values of this BitArray using BitArray x.
*/
and(x: BitArray): BitArray;
/**
* Bitwise XOR on the values of this BitArray using BitArray x.
*/
xor(x: BitArray): BitArray;
}
export = BitArray;
}
+7
View File
@@ -317,6 +317,13 @@ class Bluebird<R> implements Bluebird.Thenable<R>, Bluebird.Inspection<R> {
*/
cancel(): void;
/**
* Basically sugar for doing: somePromise.catch(function(){});
*
* Which is needed in case error handlers are attached asynchronously to the promise later, which would otherwise result in premature unhandled rejection reporting.
*/
suppressUnhandledRejections(): void;
/**
* Start the chain of promises with `Promise.try`. Any synchronous exceptions will be turned into rejections on the returned promise.
*
+6
View File
@@ -71,6 +71,12 @@ class Tag extends bookshelf.Model<Tag> {
get tableName() { return 'tags'; }
}
User.where<User>('id', 1).fetch({withRelated: ['posts.tags']}).then(function(user) {
console.log(user.related('posts').toJSON());
}).catch(function(err) {
console.error(err);
});
new User().where('id', 1).fetch({withRelated: ['posts.tags']})
.then(user => {
const posts = user.related<Post>('posts');
+2
View File
@@ -93,6 +93,8 @@ declare module 'bookshelf' {
static fetchAll<T extends Model<any>>() : Promise<Collection<T>>;
/** @deprecated should use `new` objects instead. */
static forge<T>(attributes? : any, options? : ModelOptions) : T;
static where<T>(properties: { [key: string]: any }): T;
static where<T>(key: string, operatorOrValue: string | number | boolean, valueIfOperator?: string | number | boolean): T;
belongsTo<R extends Model<any>>(target : {new(...args : any[]) : R}, foreignKey? : string) : R;
belongsToMany<R extends Model<any>>(target : {new(...args : any[]) : R}, table? : string, foreignKey? : string, otherKey? : string) : Collection<R>;
+2 -2
View File
@@ -288,11 +288,11 @@ declare module "browser-sync" {
middleware?: MiddlewareHandler;
ws: boolean;
reqHeaders: (config: any) => Hash<any>;
proxyRes: (res: http.ServerResponse, req: http.ServerRequest, next: Function) => any;
proxyRes: (res: http.ServerResponse, req: http.IncomingMessage, next: Function) => any;
}
interface MiddlewareHandler {
(req: http.ServerRequest, res: http.ServerResponse, next: Function): any;
(req: http.IncomingMessage, res: http.ServerResponse, next: Function): any;
}
interface PerRouteMiddleware {
+1 -1
View File
@@ -104,7 +104,7 @@ declare module 'bufferstream/postbuffer' {
http client buffer
*/
constructor(req: http.ServerRequest);
constructor(req: http.IncomingMessage);
/*
set a callback to get all post data from a http server request
*/
+41
View File
@@ -0,0 +1,41 @@
/// <reference path="bunyan-config.d.ts"/>
import * as bunyan from "bunyan";
import bunyanConfig from "bunyan-config";
var jsonConfig = {
name: "myLogger",
streams: [{
stream: "stdout"
}, {
stream: { name: "stderr" }
}, {
type: "raw",
stream: {
name: "bunyan-logstash",
params: {
host: "localhost",
port: 5005
}
}
}, {
type: "raw",
stream: {
name: "bunyan-redis",
params: {
host: "localhost",
port: 6379
}
}
}], serializers: {
req: "bunyan:stdSerializers.req",
fromNodeModules: "someNodeModule",
fromNodeModulesWithProps: "someNodeModule:a.b.c",
custom: "./lib/customSerializers:custom",
another: "./lib/anotherSerializer",
absolutePath: "/path/to/serializer:xyz"
}
};
var config = bunyanConfig(jsonConfig);
var logger = require("bunyan").createLogger(bunyanConfig);
+31
View File
@@ -0,0 +1,31 @@
// Type definitions for bunyan-config 0.2.0
// Project: https://github.com/LSEducation/bunyan-config
// Definitions by: Cyril Schumacher <https://github.com/cyrilschumacher>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../bunyan/bunyan.d.ts"/>
declare module "bunyan-config" {
import * as bunyan from "bunyan";
/**
* Configuration.
* @interface
*/
interface Configuration {
name: string;
streams?: bunyan.Stream[];
level?: string | number;
stream?: NodeJS.WritableStream;
serializers?: {};
src?: boolean;
}
/**
* Constructor.
* @param {Configuration} [jsonConfig] A JSON configuration.
* @return {LoggerOptions} A logger options.
*/
function bunyanConfig(jsonConfig?: Configuration): bunyan.LoggerOptions;
export default bunyanConfig;
}
+1 -1
View File
@@ -5,7 +5,7 @@ import * as Busboy from 'busboy';
import * as http from 'http';
import * as util from 'util';
function serverFn(req: http.ServerRequest, res: http.ServerResponse) {
function serverFn(req: http.IncomingMessage, res: http.ServerResponse) {
if (req.method === 'POST') {
var busboy = new Busboy({ headers: req.headers });
busboy.on('file', function(fieldname, file, filename, encoding, mimetype) {
Vendored
+4 -4
View File
@@ -385,10 +385,10 @@ declare namespace c3 {
* - d is the data where mouse cursor moves out. In this callback, this will be the Chart object.
*/
onmouseout?: (d: any, element?: any) => void;
// onselected?: any;
// onunselected?: any;
// ondragstart?: any;
// ondragend?: any;
onselected?: (d: any, element?: any) => void;
onunselected?: (d: any, element?: any) => void;
}
interface Axis {
+4 -2
View File
@@ -8,10 +8,12 @@ import {
} from 'canvas-gauges';
let linearOptions: LinearGaugeOptions = {
renderTo: document.createElement('canvas')
renderTo: document.createElement('canvas'),
fontNumbersStyle: 'italic'
};
let radialOptions: RadialGaugeOptions = {
renderTo: 'gauge-id'
renderTo: 'gauge-id',
fontNumbersWeight: 'bold'
};
new LinearGauge(linearOptions);
+16 -1
View File
@@ -4,6 +4,10 @@
// Definitions: https://github.com/Mikhus/DefinitelyTyped
declare namespace CanvasGauges {
export type FontStyle = 'normal' | 'italic' | 'oblique';
export type FontWeight = 'normal' | 'bold' | 'bolder' | 'lighter' |
'100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900';
export type RenderTarget = string|HTMLElement;
export interface AnimationRule {
@@ -30,6 +34,7 @@ declare namespace CanvasGauges {
minorTicks?: number,
strokeTicks?: boolean,
animatedValue?: boolean,
animateOnInit?: boolean,
title?: string|boolean,
borders?: boolean,
valueInt?: number,
@@ -73,11 +78,13 @@ declare namespace CanvasGauges {
borderInnerWidth?: number,
borderShadowWidth?: number,
valueBox?: boolean,
valueBoxWidth?: number,
valueBoxStroke?: number,
valueText?: string,
valueTextShadow?: boolean,
valueBoxBorderRadius?: number,
highlights?: Highlight[],
highlightsWidth?: number,
fontNumbers?: string,
fontTitle?: string,
fontUnits?: string,
@@ -85,7 +92,15 @@ declare namespace CanvasGauges {
fontTitleSize?: number,
fontValueSize?: number,
fontUnitsSize?: number,
fontNumbersSize?: number
fontNumbersSize?: number,
fontTitleStyle?: FontStyle,
fontValueStyle?: FontStyle,
fontUnitsStyle?: FontStyle,
fontNumbersStyle?: FontStyle,
fontTitleWeight?: FontWeight,
fontValueWeight?: FontWeight,
fontUnitsWeight?: FontWeight,
fontNumbersWeight?: FontWeight
}
export interface RadialGaugeOptions extends GenericOptions {
+63
View File
@@ -0,0 +1,63 @@
/// <reference path="cheap-ruler.d.ts"/>
import * as cheapRuler from 'cheap-ruler'
// -- Fixtures --
const bbox = [30.5, 50.5, 31, 51]
const point1 = [30.5, 50.5]
const point2 = [30.51, 50.49]
const unit = 'miles'
const lineString = {
"type": "Feature",
"properties": {},
"geometry": {
"type": "LineString",
"coordinates": [
[-77.031669, 38.878605],
[-77.029609, 38.881946],
[-77.020339, 38.884084],
[-77.025661, 38.885821],
[-77.021884, 38.889563],
[-77.019824, 38.892368]
]
}
}
const line = lineString.geometry.coordinates
const polygon = [[
[-67.031, 50.458], [-67.031, 50.534], [-66.929, 50.534],
[-66.929, 50.458], [-67.031, 50.458]
]]
const points = [
[-67.031, 50.458], [-67.031, 50.534],
[-66.929, 50.534], [-66.929, 50.458]
]
// -- Test initiators --
cheapRuler(35.05)
cheapRuler(35.05, 'miles')
cheapRuler(35.05, unit)
cheapRuler.fromTile(1567, 12)
cheapRuler.fromTile(1567, 12, 'miles')
cheapRuler.fromTile(1567, 12, unit)
// -- Test units --
cheapRuler.units
cheapRuler.units.miles
cheapRuler.units.kilometers
50 * cheapRuler.units.yards / cheapRuler.units.meters
// -- Test cheapRuler --
const ruler = cheapRuler(35.05)
ruler.distance(point1, point2)
ruler.bearing(point1, point2)
ruler.destination(point1, 0.1, 90)
ruler.lineDistance(points)
ruler.area(polygon)
ruler.along(line, 2.5)
ruler.pointOnLine(line, point1).point
ruler.lineSlice(point1, point2, line)
ruler.lineSliceAlong(10, 20, line)
ruler.bufferPoint(point1, 0.01)
ruler.bufferBBox(bbox, 0.2)
ruler.insideBBox(point1, bbox)
+216
View File
@@ -0,0 +1,216 @@
// Type definitions for cheap-ruler 2.4.1
// Project: https://github.com/mapbox/cheap-ruler
// Definitions by: Denis Carriere <https://github.com/DenisCarriere>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module "cheap-ruler" {
type BBox = [number, number, number, number] | number[]
type Point = [number, number] | number[]
type Line = Array<Point>
type Points = Array<Point>
type Polygon = Array<Array<Point>>
interface TemplateUnits {
kilometers: number
miles: number
nauticalmiles: number
meters: number
metres: number
yards: number
feet: number
inches: number
}
interface InterfacePointOnLine {
point: Point
index: number
t: number
}
class CheapRuler {
/**
* Given two points of the form [longitude, latitude], returns the distance.
*
* @param {Point} a point [longitude, latitude]
* @param {Point} b point [longitude, latitude]
* @returns {number} distance
* @example
* var distance = ruler.distance([30.5, 50.5], [30.51, 50.49]);
* //=distance
*/
distance(a: Point, b: Point): number;
/**
* Returns the bearing between two points in angles.
*
* @param {Point} a point [longitude, latitude]
* @param {Point} b point [longitude, latitude]
* @returns {number} bearing
* @example
* var bearing = ruler.bearing([30.5, 50.5], [30.51, 50.49]);
* //=bearing
*/
bearing(a: Point, b: Point): number;
/**
* Returns a new point given distance and bearing from the starting point.
*
* @param {Point} p point [longitude, latitude]
* @param {number} dist distance
* @param {number} bearing
* @returns {Point} point [longitude, latitude]
* @example
* var point = ruler.destination([30.5, 50.5], 0.1, 90);
* //=point
*/
destination(p: Point, dist: number, bearing: number): Point;
/**
* Given a line (an array of points), returns the total line distance.
*
* @param {Points} points [longitude, latitude]
* @returns {number} total line distance
* @example
* var length = ruler.lineDistance([
* [-67.031, 50.458], [-67.031, 50.534],
* [-66.929, 50.534], [-66.929, 50.458]
* ]);
* //=length
*/
lineDistance(points: Points): number;
/**
* Given a polygon (an array of rings, where each ring is an array of points), returns the area.
*
* @param {Polygon} polygon
* @returns {number} area value in the specified units (square kilometers by default)
* @example
* var area = ruler.area([[
* [-67.031, 50.458], [-67.031, 50.534], [-66.929, 50.534],
* [-66.929, 50.458], [-67.031, 50.458]
* ]]);
* //=area
*/
area(polygon: Polygon): number;
/**
* Returns the point at a specified distance along the line.
*
* @param {Line} line
* @param {number} dist distance
* @returns {Point} point [longitude, latitude]
* @example
* var point = ruler.along(line, 2.5);
* //=point
*/
along(line: Line, dist: number): Point
/**
* Returns an object of the form {point, index} where point is closest point on the line from the given point, and index is the start index of the segment with the closest point.
*
* @pointOnLine
* @param {Line} line
* @param {Point} p point [longitude, latitude]
* @returns {Object} {point, index}
* @example
* var point = ruler.pointOnLine(line, [-67.04, 50.5]).point;
* //=point
*/
pointOnLine(line: Line, p: Point): InterfacePointOnLine
/**
* Returns a part of the given line between the start and the stop points (or their closest points on the line).
*
* @param {Point} start point [longitude, latitude]
* @param {Point} stop point [longitude, latitude]
* @param {Line} line
* @returns {Line} line part of a line
* @example
* var line2 = ruler.lineSlice([-67.04, 50.5], [-67.05, 50.56], line1);
* //=line2
*/
lineSlice(start: Point, stop: Point, line: Line): Line
/**
* Returns a part of the given line between the start and the stop points indicated by distance along the line.
*
* @param {number} start distance
* @param {number} stop distance
* @param {Line} line
* @returns {Line} line part of a line
* @example
* var line2 = ruler.lineSliceAlong(10, 20, line1);
* //=line2
*/
lineSliceAlong(start: number, stop: number, line: Line): Line
/**
* Given a point, returns a bounding box object ([w, s, e, n]) created from the given point buffered by a given distance.
*
* @param {Point} p point [longitude, latitude]
* @param {number} buffer
* @returns {BBox} box object ([w, s, e, n])
* @example
* var bbox = ruler.bufferPoint([30.5, 50.5], 0.01);
* //=bbox
*/
bufferPoint(p: Point, buffer: number): BBox
/**
* Given a bounding box, returns the box buffered by a given distance.
*
* @param {BBox} box object ([w, s, e, n])
* @param {number} buffer
* @returns {BBox} box object ([w, s, e, n])
* @example
* var bbox = ruler.bufferBBox([30.5, 50.5, 31, 51], 0.2);
* //=bbox
*/
bufferBBox(bbox: BBox, buffer: number): BBox
/**
* Returns true if the given point is inside in the given bounding box, otherwise false.
*
* @param {Point} p point [longitude, latitude]
* @param {Point} box object ([w, s, e, n])
* @returns {boolean}
* @example
* var inside = ruler.insideBBox([30.5, 50.5], [30, 50, 31, 51]);
* //=inside
*/
insideBBox(p: Point, bbox: BBox): boolean
}
/**
* A collection of very fast approximations to common geodesic measurements. Useful for performance-sensitive code that measures things on a city scale.
*
* @param {number} lat latitude
* @param {string} [units='kilometers']
* @returns {CheapRuler}
* @example
* var ruler = cheapRuler(35.05, 'miles');
* //=ruler
*/
function cheapRuler(lat: number, units?: string): CheapRuler;
namespace cheapRuler {
/**
* Multipliers for converting between units.
*
* @example
* // convert 50 meters to yards
* 50 * cheapRuler.units.yards / cheapRuler.units.meters;
*/
const units: TemplateUnits
/**
* Creates a ruler object from tile coordinates (y and z). Convenient in tile-reduce scripts.
*
* @param {number} y
* @param {number} z
* @param {string} [units='kilometers']
* @returns {CheapRuler}
* @example
* var ruler = cheapRuler.fromTile(1567, 12);
* //=ruler
*/
function fromTile(y: number, z: number, units?: string): CheapRuler;
}
export = cheapRuler
}
+6
View File
@@ -20,6 +20,12 @@ cheerio(html);
cheerio('ul', html);
cheerio('li', 'ul', html);
const $fromElement = cheerio.load($("ul").get(0));
if ($fromElement("ul > li").length !== 3) {
throw new Error("Expecting 3 elements when passing `CheerioElement` to `load()`");
}
$ = cheerio.load(html, {
normalizeWhitespace: true,
xmlMode: true
+1
View File
@@ -259,6 +259,7 @@ interface CheerioElement {
interface CheerioAPI extends CheerioSelector {
load(html: string, options?: CheerioOptionsInterface): CheerioStatic;
load(element: CheerioElement, options?: CheerioOptionsInterface): CheerioStatic;
}
declare var cheerio:CheerioAPI;
+19
View File
@@ -300,3 +300,22 @@ function test_adding_widget() {
});
}
}
function test_focusManager() {
var textarea = document.createElement('textarea');
var instance = CKEDITOR.replace(textarea);
var element = CKEDITOR.document.getById('myElement');
instance.focusManager.focus();
instance.focusManager.focus(element);
instance.focusManager.lock();
instance.focusManager.unlock();
instance.focusManager.blur();
instance.focusManager.blur(true);
instance.focusManager.add(element, true);
instance.focusManager.remove(element);
var focusManager = new CKEDITOR.focusManager(instance);
var object: CKEDITOR.dom.domObject = focusManager.currentActive;
var bool: boolean = focusManager.hasFocus;
}
+12 -1
View File
@@ -544,8 +544,19 @@ declare namespace CKEDITOR {
}
interface focusManager {
class focusManager {
// Properties
currentActive: dom.domObject;
hasFocus: boolean;
// Methods
constructor(editor: editor);
focus(currentActive?: dom.element): void;
lock(): void;
unlock(): void;
blur(noDelay?: boolean): void;
add(element: dom.element, isCapture: boolean): void;
remove(element: dom.element): void;
}
interface keystrokeHandler {
+6
View File
@@ -78,6 +78,12 @@ declare module "connect-mongo" {
* (Default: 10)
*/
autoRemoveInterval?: number;
/**
* don't save session if unmodified
*/
touchAfter?: number;
}
export interface MongoUrlOptions extends DefaultOptions {
+6 -1
View File
@@ -1,6 +1,6 @@
// Type definitions for CrossFilter
// Project: https://github.com/square/crossfilter
// Definitions by: Schmulik Raskin <https://github.com/schmuli>
// Definitions by: Schmulik Raskin <https://github.com/schmuli>, Izaak Baker <https://github.com/iebaker>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace CrossFilter {
@@ -111,3 +111,8 @@ declare namespace CrossFilter {
}
declare var crossfilter: CrossFilter.CrossFilterStatic;
declare module "crossfilter" {
var crossfilter: CrossFilter.CrossFilterStatic;
export = crossfilter;
}
@@ -0,0 +1,174 @@
/// <reference path="./css-modules-require-hook.d.ts" />
/// <reference path="../node/node.d.ts" />
import * as hook from 'css-modules-require-hook';
import * as path from 'path';
//
// https://github.com/css-modules/css-modules-require-hook/blob/master/README.md#usage
//
hook({ generateScopedName: '[name]__[local]___[hash:base64:5]' });
//
// https://github.com/css-modules/css-modules-require-hook/blob/master/README.md#adding-custom-postcss-plugins
//
hook({
prepend: [
() => {
// my prepender
},
],
});
//
// https://github.com/css-modules/css-modules-require-hook/blob/master/README.md#specify-custom-pattern-to-build-generic-names
//
hook({ generateScopedName: '[name]__[local]___[hash:base64:5]' });
//
// https://github.com/css-modules/css-modules-require-hook/blob/master/README.md#using-stylus-as-a-preprocessor
//
hook({
extensions: ['.styl'],
preprocessCss: (css: string, filepath: string) => {
// my preprocesser
},
});
//
// https://github.com/css-modules/css-modules-require-hook/blob/master/README.md#tuning-options
//
hook({ /* my option */ });
//
// https://github.com/css-modules/css-modules-require-hook/blob/master/README.md#devmode-boolean
//
hook({ devMode: false });
//
// https://github.com/css-modules/css-modules-require-hook/blob/master/README.md#extensions-array
//
hook({ extensions: ['.scss', '.sass'] });
//
// https://github.com/css-modules/css-modules-require-hook/blob/master/README.md#ignore-functionregexstring
//
hook({ ignore: (file: string) => false });
hook({ ignore: 'unused' });
hook({ ignore: /\.test\.(css|scss|sass)/$ });
//
// https://github.com/css-modules/css-modules-require-hook/blob/master/README.md#preprocesscss-function
//
hook({ preprocessCss: (css: string, filepath: string) => css });
//
// https://github.com/css-modules/css-modules-require-hook/blob/master/README.md#processcss-function
//
hook({ processCss: (css: string, filepath: string) => css });
//
// https://github.com/css-modules/css-modules-require-hook/blob/master/README.md#processoropts-object
//
hook({
extensions: '.scss',
processorOpts: {
parser: () => {
// my parser
},
},
});
//
// https://github.com/css-modules/css-modules-require-hook/blob/master/README.md#camelcase-boolean
//
hook({ camelCase: true });
//
// https://github.com/css-modules/css-modules-require-hook/blob/master/README.md#append-array
//
hook({
append: [
() => {
// another plugin
},
],
});
//
// https://github.com/css-modules/css-modules-require-hook/blob/master/README.md#prepend-array
//
hook({
prepend: [
() => {
// again, another plugin
},
],
});
//
// https://github.com/css-modules/css-modules-require-hook/blob/master/README.md#use-array
//
hook({
use: [
() => {
// they like plugins very much
},
],
});
//
// https://github.com/css-modules/css-modules-require-hook/blob/master/README.md#createimportedname-function
//
hook({
createImportedName: (css: string, filepath: string) => {
// my import name creator
},
});
//
// https://github.com/css-modules/css-modules-require-hook/blob/master/README.md#generatescopedname-stringfunction
//
hook({ generateScopedName: '[name]__[local]___[hash:base64:5]' });
hook({
generateScopedName: () => {
// should generate something
},
});
//
// https://github.com/css-modules/css-modules-require-hook/blob/master/README.md#hashprefix-string
//
hook({ hashPrefix: 'awesome_' });
//
// https://github.com/css-modules/css-modules-require-hook/blob/master/README.md#mode-string
//
hook({ mode: 'global' });
hook({ mode: 'local' });
hook({ mode: 'pure' });
//
// https://github.com/css-modules/css-modules-require-hook/blob/master/README.md#rootdir-string
//
hook({ rootDir: path.resolve('./my-folder') });
+43
View File
@@ -0,0 +1,43 @@
// Type definitions for css-modules-require-hook 4.0.3
// Project: https://github.com/css-modules/css-modules-require-hook
// Definitions by: Cedric van Putten <https://bycedric.com>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module 'css-modules-require-hook' {
interface Options {
/** Helps you to invalidate cache of all require calls. */
devMode?: boolean;
/** Attach the require hook to additional file extensions. */
extensions?: string | string[];
/** Provides possibility to exclude particular files from processing. */
ignore?: string | RegExp | ((filepath: string) => boolean);
/** In rare cases you may want to precompile styles, before they will be passed to the PostCSS pipeline. */
preprocessCss?: Function;
/** In rare cases you may want to get compiled styles in runtime, so providing this option helps. */
processCss?: Function;
/** Provides possibility to pass custom options to the LazyResult instance. */
processorOpts?: Object;
/** Camelizes exported class names. */
camelCase?: boolean;
/** Appends custom plugins to the end of the PostCSS pipeline. */
append?: any[];
/** Prepends custom plugins to the beginning of the PostCSS pipeline. */
prepend?: any[];
/** Provides the full list of PostCSS plugins to the pipeline. */
use?: any[];
/** Short alias for the postcss-modules-extract-imports plugin's createImportedName option. */
createImportedName?: Function;
/** Short alias for the postcss-modules-scope plugin's option. */
generateScopedName?: string | Function;
/** Short alias for the generic-names helper option. */
hashPrefix?: string;
/** Short alias for the postcss-modules-local-by-default plugin's option. */
mode?: string;
/** Provides absolute path to the project directory. */
rootDir?: string;
}
var requireHook: (options?: Options) => void;
export = requireHook;
}
+53
View File
@@ -0,0 +1,53 @@
/// <reference path="../d3/d3.d.ts" />
/// <reference path="d3-tip.d.ts" />
// test variables
interface dataType {
Title: string,
Number: number
}
let data: dataType[] = [ { Title: "one", Number: 1 }, { Title: "two", Number: 2} ];
let svgElement: SVGElement;
let root: HTMLElement;
// start tests
let d3tip: d3.Tooltip = d3.tip();
d3tip = d3tip.hide();
d3tip = d3tip.show();
d3tip = d3tip.show(data);
d3tip = d3tip.show(svgElement);
d3tip = d3tip.show(data, svgElement);
let attributeValue: string = d3tip.attr("library");
d3tip = d3tip.attr("library","d3");
d3tip = d3tip.attr("library", (d, i, o) => (d as dataType).Title);
d3tip = d3tip.attr<dataType>("library", (d, i, o) => d.Title);
let styleValue: string = d3tip.style("library");
d3tip = d3tip.style("library","d3");
d3tip = d3tip.style("library", (d, i, o) => (d as dataType).Title);
d3tip = d3tip.style<dataType>("library", (d, i, o) => d.Title);
let offsetValue: [number, number] = d3tip.offset();
d3tip = d3tip.offset([-1, -1]);
d3tip = d3tip.offset((d, i, o) => [-1, -1]);
let directionValue: ("n" | "s" | "e" | "w" | "nw" | "ne" | "sw" | "se") = d3tip.direction();
d3tip = d3tip.direction("n");
d3tip = d3tip.direction((d, i ,o) => "n");
let htmlValue: string = d3tip.html();
d3tip = d3tip.html("<html><html/>");
d3tip = d3tip.html((d, i ,o) => "<html><html/>");
let rootElementValue: HTMLElement = d3tip.rootElement();
d3tip = d3tip.rootElement(root);
d3tip = d3tip.rootElement<dataType>((d, i ,o) => root);
d3tip = d3tip.destroy();
+40
View File
@@ -0,0 +1,40 @@
// Type definitions for d3-tip
// Project: https://github.com/Caged/d3-tip
// Definitions by: Gert Braspenning <https://github.com/brspnnggrt>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../d3/d3.d.ts" />
declare namespace d3 {
type TooltipDirection = ("n" | "s" | "e" | "w" | "nw" | "ne" | "sw" | "se");
interface Tooltip {
hide(): Tooltip;
show(): Tooltip;
show<Datum>(data: Datum[]): Tooltip;
show(target: SVGElement): Tooltip;
show<Datum>(data: Datum[], target: SVGElement): Tooltip;
attr(name: string): string;
attr(name: string, value: Primitive): Tooltip;
attr<Datum>(name: string, value: (datum: Datum, index: number, outerIndex: number) => Primitive): Tooltip;
attr<Datum>(obj: { [key: string]: Primitive | ((datum: Datum, index: number, outerIndex: number) => Primitive) }): Tooltip;
style(name: string): string;
style(name: string, value: Primitive, priority?: string): Tooltip;
style<Datum>(name: string, value: (datum: Datum, index: number, outerIndex: number) => Primitive, priority?: string): Tooltip;
style<Datum>(obj: { [key: string]: Primitive | ((datum: Datum, index: number, outerIndex: number) => Primitive) }, priority?: string): Tooltip;
offset(): [number, number];
offset(tuple: [number, number]): Tooltip;
offset<Datum>(func: (datum: Datum, index: number, outerIndex: number) => [number, number]): Tooltip;
direction(): TooltipDirection;
direction(direction: TooltipDirection): Tooltip;
direction<Datum>(func: (datum: Datum, index: number, outerIndex: number) => TooltipDirection): Tooltip;
html(): string;
html(content: string): Tooltip;
html<Datum>(func: (datum: Datum, index: number, outerIndex: number) => string): Tooltip;
rootElement(): HTMLElement;
rootElement(element: HTMLElement): Tooltip;
rootElement<Datum>(func: (datum: Datum, index: number, outerIndex: number) => HTMLElement): Tooltip;
destroy(): Tooltip;
}
export function tip(): Tooltip;
}
+58
View File
@@ -0,0 +1,58 @@
/// <reference path='dateformat.d.ts' />
/**
* https://github.com/felixge/node-dateformat#usage
*/
import * as dateFormat from 'dateformat'
const now = new Date()
// Basic usage
dateFormat(now, 'dddd, mmmm dS, yyyy, h:MM:ss TT')
// Saturday, June 9th, 2007, 5:46:21 PM
// You can use one of several named masks
dateFormat(now, 'isoDateTime')
// 2007-06-09T17:46:21
// ...Or add your own
dateFormat.masks['hammerTime'] = `HH:MM! "Can't touch this!"`
dateFormat(now, 'hammerTime')
// 17:46! Can't touch this!
// When using the standalone dateFormat function,
// you can also provide the date as a string
dateFormat('Jun 9 2007', 'fullDate')
// Saturday, June 9, 2007
// Note that if you don't include the mask argument,
// dateFormat.masks.default is used
dateFormat(now)
// Sat Jun 09 2007 17:46:21
// And if you don't include the date argument,
// the current date and time is used
dateFormat()
// Sat Jun 09 2007 17:46:22
// You can also skip the date argument (as long as your mask doesn't
// contain any numbers), in which case the current date/time is used
dateFormat('longTime')
// 5:46:22 PM EST
// And finally, you can convert local time to UTC time. Simply pass in
// true as an additional argument (no argument skipping allowed in this case):
dateFormat(now, 'longTime', true)
// 10:46:21 PM UTC
// ...Or add the prefix 'UTC:' or 'GMT:' to your mask.
dateFormat(now, 'UTC:h:MM:ss TT Z')
// 10:46:21 PM UTC
// You can also get the ISO 8601 week of the year:
dateFormat(now, 'W')
// 42
// and also get the ISO 8601 numeric representation of the day of the week:
dateFormat(now, 'N')
// 6
+77
View File
@@ -0,0 +1,77 @@
// Type definitions for dateformat v1.0.12
// Project: https://github.com/felixge/node-dateformat
// Definitions by: Kombu <https://github.com/aicest>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/**
* dateFormat.masks
*
* Predefined Formats
*
* https://github.com/felixge/node-dateformat/blob/master/lib/dateformat.js#L107
*/
interface DateFormatMasks {
default: string;
shortDate: string;
mediumDate: string;
longDate: string;
fullDate: string;
shortTime: string;
mediumTime: string;
longTime: string;
isoDate: string;
isoTime: string;
isoDateTime: string;
isoUtcDateTime: string;
expiresHeaderFormat: string;
[key: string]: string;
}
/**
* dateFormat.i18n
*
* Internationalization strings
*
* Example:
*
* ```
* dateFormat.i18n = {
* dayNames: [
* 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat',
* 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'
* ],
* monthNames: [
* 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec',
* 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'
* ]
* }
* ```
*
* https://github.com/felixge/node-dateformat/blob/master/lib/dateformat.js#L124
*/
interface DateFormatI18n {
dayNames: string[];
monthNames: string[];
}
/**
* dateFormat()
*
* Accepts a date, a mask, or a date and a mask.
* Returns a formatted version of the given date.
* The date defaults to the current date/time.
* The mask defaults to dateFormat.masks.default.
*
* https://github.com/felixge/node-dateformat/blob/master/lib/dateformat.js#L18
*/
interface DateFormatStatic {
(date?: Date | string | number, mask?: string, utc?: boolean, gmt?: boolean): string;
(mask?: string, utc?: boolean, gmt?: boolean): string;
masks: DateFormatMasks;
i18n: DateFormatI18n;
}
declare module 'dateformat' {
const dateFormat: DateFormatStatic;
export = dateFormat;
}
+417 -182
View File
File diff suppressed because it is too large Load Diff
+29 -31
View File
@@ -3,12 +3,12 @@
// Definitions by: Maksim Kozhukh <http://github.com/mkozhukh>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface SchedulerCallback { (...args: any[]) : any }
interface SchedulerCallback { (...args: any[]): any }
interface SchedulerFilterCallback { (id: string | number, event: any): boolean }
type SchedulerEventName ='onAfterEventDisplay'|'onAfterFolderToggle'|'onAfterLightbox'|'onAfterSchedulerResize'|'onBeforeCollapse'|'onBeforeDrag'|'onBeforeEventChanged'|'onBeforeEventCreated'|'onBeforeEventDelete'|'onBeforeEventDisplay'|'onBeforeEventDragIn'|'onBeforeEventDragOut'|'onBeforeExpand'|'onBeforeExternalDragIn'|'onBeforeFolderToggle'|'onBeforeLightbox'|'onBeforeSectionRender'|'onBeforeTodayDisplayed'|'onBeforeTooltip'|'onBeforeViewChange'|'onCellClick'|'onCellDblClick'|'onClearAll'|'onClick'|'onCollapse'|'onConfirmedBeforeEventDelete'|'onContextMenu'|'onDblClick'|'onDragEnd'|'onEmptyClick'|'onEventAdded'|'onEventCancel'|'onEventChanged'|'onEventCollision'|'onEventCopied'|'onEventCreated'|'onEventCut'|'onEventDeleted'|'onEventDrag'|'onEventDragIn'|'onEventDragOut'|'onEventDropOut'|'onEventIdChange'|'onEventLoading'|'onEventPasted'|'onEventSave'|'onExpand'|'onExternalDragIn'|'onLightbox'|'onLightboxButton'|'onLimitViolation'|'onLoadError'|'onLocationError'|'onMouseDown'|'onMouseMove'|'onOptionsLoad'|'onOptionsLoadFinal'|'onOptionsLoadStart'|'onSaveError'|'onScaleAdd'|'onScaleDblClick'|'onSchedulerReady'|'onSchedulerResize'|'onTemplatesReady'|'onTimelineCreated'|'onViewChange'|'onViewMoreClick'|'onXLE'|'onXLS'|'onXScaleClick'|'onXScaleDblClick'|'onYScaleClick'|'onYScaleDblClick';
type SchedulerEventName = 'onAfterEventDisplay' | 'onAfterFolderToggle' | 'onAfterLightbox' | 'onAfterSchedulerResize' | 'onBeforeCollapse' | 'onBeforeDrag' | 'onBeforeEventChanged' | 'onBeforeEventCreated' | 'onBeforeEventDelete' | 'onBeforeEventDisplay' | 'onBeforeEventDragIn' | 'onBeforeEventDragOut' | 'onBeforeExpand' | 'onBeforeExternalDragIn' | 'onBeforeFolderToggle' | 'onBeforeLightbox' | 'onBeforeSectionRender' | 'onBeforeTodayDisplayed' | 'onBeforeTooltip' | 'onBeforeViewChange' | 'onCellClick' | 'onCellDblClick' | 'onClearAll' | 'onClick' | 'onCollapse' | 'onConfirmedBeforeEventDelete' | 'onContextMenu' | 'onDblClick' | 'onDragEnd' | 'onEmptyClick' | 'onEventAdded' | 'onEventCancel' | 'onEventChanged' | 'onEventCollision' | 'onEventCopied' | 'onEventCreated' | 'onEventCut' | 'onEventDeleted' | 'onEventDrag' | 'onEventDragIn' | 'onEventDragOut' | 'onEventDropOut' | 'onEventIdChange' | 'onEventLoading' | 'onEventPasted' | 'onEventSave' | 'onExpand' | 'onExternalDragIn' | 'onLightbox' | 'onLightboxButton' | 'onLimitViolation' | 'onLoadError' | 'onLocationError' | 'onMouseDown' | 'onMouseMove' | 'onOptionsLoad' | 'onOptionsLoadFinal' | 'onOptionsLoadStart' | 'onSaveError' | 'onScaleAdd' | 'onScaleDblClick' | 'onSchedulerReady' | 'onSchedulerResize' | 'onTemplatesReady' | 'onTimelineCreated' | 'onViewChange' | 'onViewMoreClick' | 'onXLE' | 'onXLS' | 'onXScaleClick' | 'onXScaleDblClick' | 'onYScaleClick' | 'onYScaleDblClick';
interface SchedulerTemplates{
interface SchedulerTemplates {
/**
* specifies the date in the header of the view
* @param start the start date of the view
@@ -458,7 +458,7 @@ interface SchedulerTemplates{
}
interface SchedulerConfigOptions{
interface SchedulerConfigOptions {
/**
* 'says' to present the numbers of days in the Month view as clickable links that open the related day in the specified view
*/
@@ -477,12 +477,12 @@ interface SchedulerConfigOptions{
/**
* specifies how to display the default error notification in case the XML data loading failed
*/
ajax_error: string|boolean;
ajax_error: string | boolean;
/**
* 'says' to show multi-day events in the regular way (as one-day events are displayed)
*/
all_timed: boolean|string;
all_timed: boolean | string;
/**
* sets the date format that will be used by the addEvent() method to parse the start_date, end_date properties in case they are specified as strings
@@ -812,7 +812,7 @@ interface SchedulerConfigOptions{
/**
* sets the height of the area that displays multi-day events
*/
multi_day_height_limit: number|boolean;
multi_day_height_limit: number | boolean;
/**
* enables the possibility to render the same events in several sections of the Timeline or Units view
@@ -942,12 +942,12 @@ interface SchedulerConfigOptions{
/**
* enables/disables the touch support in the scheduler
*/
touch: boolean|string;
touch: boolean | string;
/**
* defines the time period in milliseconds that is used to differ the long touch gesture from the scroll gesture
*/
touch_drag: number|boolean;
touch_drag: number | boolean;
/**
* enables/disables prompting messages in the right top corner of the screen
@@ -996,7 +996,7 @@ interface SchedulerConfigOptions{
}
interface SchedulerDateHelpers{
interface SchedulerDateHelpers {
add(origin: Date, count: number, unit: string): Date;
copy(origin: Date): Date;
@@ -1017,19 +1017,19 @@ interface SchedulerDateHelpers{
to_fixed(value: number): string;
}
interface SchedulerHotkeys{
interface SchedulerHotkeys {
edit_save: number;
edit_cancel: number;
}
interface SchedulerLocaleDate{
interface SchedulerLocaleDate {
month_full: string[];
month_short: string[];
day_full: string[];
day_short: string[];
}
interface SchedulerLocaleLabels{
interface SchedulerLocaleLabels {
dhx_cal_today_button: string;
day_tab: string;
week_tab: string;
@@ -1046,13 +1046,13 @@ interface SchedulerLocaleLabels{
section_time: string;
}
interface SchedulerLocale{
interface SchedulerLocale {
date: SchedulerLocaleDate;
labels: SchedulerLocaleLabels;
}
interface SchedulerSizes{
interface SchedulerSizes {
/**
* the height of day cells in the month view
*/
@@ -1124,14 +1124,14 @@ interface SchedulerSizes{
scroll_width: number;
}
interface SchedulerEnterprise{
interface SchedulerEnterprise {
/**
* Creates a new instance of Scheduler
*/
getSchedulerInstance(): SchedulerStatic;
}
interface SchedulerStatic{
interface SchedulerStatic {
templates: SchedulerTemplates;
config: SchedulerConfigOptions;
date: SchedulerDateHelpers;
@@ -1238,7 +1238,7 @@ interface SchedulerStatic{
* @param time_points an array <b>[start_minute,end_minute,..,start_minute_N,end_minute_N]</b>, <br> where each pair sets a certain limit range. The array can have any number of <br> such pairs
* @param items defines specific items of view(s) to block
*/
blockTime(date: Date|number, time_points: any[], items?: any): void;
blockTime(date: Date | number, time_points: any[], items?: any): void;
/**
* calls an inner event
@@ -1327,7 +1327,7 @@ interface SchedulerStatic{
* deletes the specified event
* @param id the event's id
*/
deleteEvent(id: string|number): void;
deleteEvent(id: string | number): void;
/**
* removes marking/blocking set by the addMarkedTimespan() and blockTime() methods
@@ -1393,39 +1393,39 @@ interface SchedulerStatic{
* returns the event object by its id
* @param event_id the event's id
*/
getEvent(event_id: string|number): void;
getEvent(event_id: string | number): any;
/**
* gets the event's end date
* @param id the event's id
*/
getEventEndDate(id: string): Date;
getEventEndDate(id: string | number): Date;
/**
* gets the event's start date
* @param id the event's id
*/
getEventStartDate(id: string): Date;
getEventStartDate(id: string | number): Date;
/**
* gets the event's text
* @param id the event's id
*/
getEventText(id: string): string;
getEventText(id: string | number): string;
/**
* returns a collection of events which occur during the specified period
* @param from the start date of the period
* @param to the end date of the period
*/
getEvents(from?: Date, to?: Date): void;
getEvents(from?: Date, to?: Date): any;
/**
* gets the label of a select control in the lightbox
* @param property the name of a data property that the control is mapped to
* @param key the option's id. This parameter is compared with the event's data property <br> to assign the select's option to an event
*/
getLabel(property: string, key: string|number): void;
getLabel(property: string, key: string | number): any;
/**
* gets the lightbox's HTML object element
@@ -1486,7 +1486,7 @@ interface SchedulerStatic{
* @param date the initial date of the scheduler (by default, the current date)
* @param view the name of the initial view (by default, "week")
*/
init(container: string|HTMLElement, date?: Date, view?: string): void;
init(container: string | HTMLElement, date?: Date, view?: string): void;
/**
* inverts the specified time zones
@@ -1497,7 +1497,7 @@ interface SchedulerStatic{
/**
* checks whether the calendar is currently opened in the scheduler
*/
isCalendarVisible(): boolean|HTMLElement;
isCalendarVisible(): boolean | HTMLElement;
/**
* checks whether the specified event one-day or multi-day
@@ -1607,7 +1607,7 @@ interface SchedulerStatic{
* @param id the event's id
* @param event the event object
*/
setEvent(id: string|number, event: any): void;
setEvent(id: string | number, event: any): void;
/**
* sets the event's end date
@@ -1739,7 +1739,7 @@ interface SchedulerStatic{
* removes marking/blocking set by the markTimespan() method
* @param divs a timespan to remove marking/blocking from (or an array of timespans)
*/
unmarkTimespan(divs: HTMLElement|any[]): void;
unmarkTimespan(divs: HTMLElement | any[]): void;
/**
* unselects the specified event
@@ -1776,7 +1776,5 @@ interface SchedulerStatic{
}
declare var scheduler: SchedulerStatic;
declare var Scheduler: SchedulerEnterprise;
+13
View File
@@ -5,6 +5,13 @@
declare module "diff-match-patch" {
type Diff = [number, string];
export class Patch {
diffs: Diff[];
start1: number;
start2: number;
length1: number;
length2: number;
}
export class diff_match_patch {
static new (): diff_match_patch;
@@ -31,6 +38,12 @@ declare module "diff-match-patch" {
diff_levenshtein(diffs: Diff[]): number;
diff_toDelta(diffs: Diff[]): string;
diff_fromDelta(text1: string, delta: string): Diff[];
patch_make(text1: any, text2?: string): Patch[];
patch_deepCopy(patches: Patch[]): Patch[];
patch_apply(patches: Patch[], text: string): [string, boolean[]];
patch_fromText(text: string): Patch[];
patch_toText(patches: Patch[]): string;
}
export var DIFF_DELETE: number;
+90
View File
@@ -189,4 +189,94 @@ dropzone.processFiles(addedFiles);
dropzone.processQueue();
dropzone.removeAllFiles(true);
dropzone
.on("drop", () => {
console.count('drop');
})
.on("dragstart", () => {
console.count('dragstart');
})
.on("dragend", () => {
console.count('dragend');
})
.on("dragenter", () => {
console.count('dragenter');
})
.on("dragover", () => {
console.count('dragover');
})
.on("dragleave", () => {
console.count('dragleave');
})
.on("paste", () => {
console.count('paste');
})
.on("reset", () => {
console.count('reset');
})
.on("addedfile", () => {
console.count('addedfile');
})
.on("addedfiles", () => {
console.count('addedfiles');
})
.on("removedfile", () => {
console.count('removedfile');
})
.on("thumbnail", () => {
console.count('thumbnail');
})
.on("error", () => {
console.count('error');
})
.on("errormultiple", () => {
console.count('errormultiple');
})
.on("processing", () => {
console.count('processing');
})
.on("processingmultiple", () => {
console.count('processingmultiple');
})
.on("uploadprogress", () => {
console.count('uploadprogress');
})
.on("totaluploadprogress", () => {
console.count('totaluploadprogress');
})
.on("sending", () => {
console.count('sending');
})
.on("sendingmultiple", () => {
console.count('sendingmultiple');
})
.on("success", () => {
console.count('success');
})
.on("successmultiple", () => {
console.count('successmultiple');
})
.on("canceled", () => {
console.count('canceled');
})
.on("canceledmultiple", () => {
console.count('canceledmultiple');
})
.on("complete", () => {
console.count('complete');
})
.on("completemultiple", () => {
console.count('completemultiple');
})
.on("maxfilesexceeded", () => {
console.count('maxfilesexceeded');
})
.on("maxfilesreached", () => {
console.count('maxfilesreached');
})
.on("queuecomplete", () => {
console.count('queuecomplete');
});
dropzone.destroy();
+89
View File
@@ -197,4 +197,93 @@ dropzone.processFiles(addedFiles);
dropzone.processQueue();
dropzone.removeAllFiles(true);
dropzone
.on("drop", () => {
console.count('drop');
})
.on("dragstart", () => {
console.count('dragstart');
})
.on("dragend", () => {
console.count('dragend');
})
.on("dragenter", () => {
console.count('dragenter');
})
.on("dragover", () => {
console.count('dragover');
})
.on("dragleave", () => {
console.count('dragleave');
})
.on("paste", () => {
console.count('paste');
})
.on("reset", () => {
console.count('reset');
})
.on("addedfile", () => {
console.count('addedfile');
})
.on("addedfiles", () => {
console.count('addedfiles');
})
.on("removedfile", () => {
console.count('removedfile');
})
.on("thumbnail", () => {
console.count('thumbnail');
})
.on("error", () => {
console.count('error');
})
.on("errormultiple", () => {
console.count('errormultiple');
})
.on("processing", () => {
console.count('processing');
})
.on("processingmultiple", () => {
console.count('processingmultiple');
})
.on("uploadprogress", () => {
console.count('uploadprogress');
})
.on("totaluploadprogress", () => {
console.count('totaluploadprogress');
})
.on("sending", () => {
console.count('sending');
})
.on("sendingmultiple", () => {
console.count('sendingmultiple');
})
.on("success", () => {
console.count('success');
})
.on("successmultiple", () => {
console.count('successmultiple');
})
.on("canceled", () => {
console.count('canceled');
})
.on("canceledmultiple", () => {
console.count('canceledmultiple');
})
.on("complete", () => {
console.count('complete');
})
.on("completemultiple", () => {
console.count('completemultiple');
})
.on("maxfilesexceeded", () => {
console.count('maxfilesexceeded');
})
.on("maxfilesreached", () => {
console.count('maxfilesreached');
})
.on("queuecomplete", () => {
console.count('queuecomplete');
});
dropzone.destroy();
+61 -61
View File
@@ -176,91 +176,91 @@ declare class Dropzone {
createThumbnailFromUrl(file:DropzoneFile, url:string, callback?:(...args:any[]) => void):any;
on(eventName:string, callback:(...args:any[]) => void):void;
on(eventName:string, callback:(...args:any[]) => void):Dropzone;
off(eventName:string):void;
off(eventName:string):Dropzone;
emit(eventName:string, ...args:any[]):void;
emit(eventName:string, ...args:any[]):Dropzone;
on(eventName:"drop", callback:(e:DragEvent) => any):void;
on(eventName:"dragstart", callback:(e:DragEvent) => any):void;
on(eventName:"dragend", callback:(e:DragEvent) => any):void;
on(eventName:"dragenter", callback:(e:DragEvent) => any):void;
on(eventName:"dragover", callback:(e:DragEvent) => any):void;
on(eventName:"dragleave", callback:(e:DragEvent) => any):void;
on(eventName:"paste", callback:(e:DragEvent) => any):void;
on(eventName:"drop", callback:(e:DragEvent) => any):Dropzone;
on(eventName:"dragstart", callback:(e:DragEvent) => any):Dropzone;
on(eventName:"dragend", callback:(e:DragEvent) => any):Dropzone;
on(eventName:"dragenter", callback:(e:DragEvent) => any):Dropzone;
on(eventName:"dragover", callback:(e:DragEvent) => any):Dropzone;
on(eventName:"dragleave", callback:(e:DragEvent) => any):Dropzone;
on(eventName:"paste", callback:(e:DragEvent) => any):Dropzone;
on(eventName:"reset"):void;
on(eventName:"reset"):Dropzone;
on(eventName:"addedfile", callback:(file:DropzoneFile) => any):void;
on(eventName:"addedfiles", callback:(files:DropzoneFile[]) => any):void;
on(eventName:"removedfile", callback:(file:DropzoneFile) => any):void;
on(eventName:"thumbnail", callback:(file:DropzoneFile, dataUrl:string) => any):void;
on(eventName:"addedfile", callback:(file:DropzoneFile) => any):Dropzone;
on(eventName:"addedfiles", callback:(files:DropzoneFile[]) => any):Dropzone;
on(eventName:"removedfile", callback:(file:DropzoneFile) => any):Dropzone;
on(eventName:"thumbnail", callback:(file:DropzoneFile, dataUrl:string) => any):Dropzone;
on(eventName:"error", callback:(file:DropzoneFile, message:string|Error) => any):void;
on(eventName:"errormultiple", callback:(files:DropzoneFile[], message:string|Error) => any):void;
on(eventName:"error", callback:(file:DropzoneFile, message:string|Error) => any):Dropzone;
on(eventName:"errormultiple", callback:(files:DropzoneFile[], message:string|Error) => any):Dropzone;
on(eventName:"processing", callback:(file:DropzoneFile) => any):void;
on(eventName:"processingmultiple", callback:(files:DropzoneFile[]) => any):void;
on(eventName:"processing", callback:(file:DropzoneFile) => any):Dropzone;
on(eventName:"processingmultiple", callback:(files:DropzoneFile[]) => any):Dropzone;
on(eventName:"uploadprogress", callback:(file:DropzoneFile, progress:number, bytesSent:number) => any):void;
on(eventName:"totaluploadprogress", callback:(totalProgress:number, totalBytes:number, totalBytesSent:number) => any):void;
on(eventName:"uploadprogress", callback:(file:DropzoneFile, progress:number, bytesSent:number) => any):Dropzone;
on(eventName:"totaluploadprogress", callback:(totalProgress:number, totalBytes:number, totalBytesSent:number) => any):Dropzone;
on(eventName:"sending", callback:(file:DropzoneFile, xhr:XMLHttpRequest, formData:FormData) => any):void;
on(eventName:"sendingmultiple", callback:(files:DropzoneFile[], xhr:XMLHttpRequest, formData:FormData) => any):void;
on(eventName:"sending", callback:(file:DropzoneFile, xhr:XMLHttpRequest, formData:FormData) => any):Dropzone;
on(eventName:"sendingmultiple", callback:(files:DropzoneFile[], xhr:XMLHttpRequest, formData:FormData) => any):Dropzone;
on(eventName:"success", callback:(file:DropzoneFile) => any):void;
on(eventName:"successmultiple", callback:(files:DropzoneFile[]) => any):void;
on(eventName:"success", callback:(file:DropzoneFile) => any):Dropzone;
on(eventName:"successmultiple", callback:(files:DropzoneFile[]) => any):Dropzone;
on(eventName:"canceled", callback:(file:DropzoneFile) => any):void;
on(eventName:"canceledmultiple", callback:(file:DropzoneFile[]) => any):void;
on(eventName:"canceled", callback:(file:DropzoneFile) => any):Dropzone;
on(eventName:"canceledmultiple", callback:(file:DropzoneFile[]) => any):Dropzone;
on(eventName:"complete", callback:(file:DropzoneFile) => any):void;
on(eventName:"completemultiple", callback:(file:DropzoneFile[]) => any):void;
on(eventName:"complete", callback:(file:DropzoneFile) => any):Dropzone;
on(eventName:"completemultiple", callback:(file:DropzoneFile[]) => any):Dropzone;
on(eventName:"maxfilesexceeded", callback:(file:DropzoneFile) => any):void;
on(eventName:"maxfilesreached", callback:(files:DropzoneFile[]) => any):void;
on(eventName:"queuecomplete"):void;
on(eventName:"maxfilesexceeded", callback:(file:DropzoneFile) => any):Dropzone;
on(eventName:"maxfilesreached", callback:(files:DropzoneFile[]) => any):Dropzone;
on(eventName:"queuecomplete"):Dropzone;
emit(eventName:"drop", e:DragEvent):void;
emit(eventName:"dragstart", e:DragEvent):void;
emit(eventName:"dragend", e:DragEvent):void;
emit(eventName:"dragenter", e:DragEvent):void;
emit(eventName:"dragover", e:DragEvent):void;
emit(eventName:"dragleave", e:DragEvent):void;
emit(eventName:"paste", e:DragEvent):void;
emit(eventName:"drop", e:DragEvent):Dropzone;
emit(eventName:"dragstart", e:DragEvent):Dropzone;
emit(eventName:"dragend", e:DragEvent):Dropzone;
emit(eventName:"dragenter", e:DragEvent):Dropzone;
emit(eventName:"dragover", e:DragEvent):Dropzone;
emit(eventName:"dragleave", e:DragEvent):Dropzone;
emit(eventName:"paste", e:DragEvent):Dropzone;
emit(eventName:"reset"):void;
emit(eventName:"reset"):Dropzone;
emit(eventName:"addedfile", file:DropzoneFile):void;
emit(eventName:"addedfiles", files:DropzoneFile[]):void;
emit(eventName:"removedfile", file:DropzoneFile):void;
emit(eventName:"thumbnail", file:DropzoneFile, dataUrl:string):void;
emit(eventName:"addedfile", file:DropzoneFile):Dropzone;
emit(eventName:"addedfiles", files:DropzoneFile[]):Dropzone;
emit(eventName:"removedfile", file:DropzoneFile):Dropzone;
emit(eventName:"thumbnail", file:DropzoneFile, dataUrl:string):Dropzone;
emit(eventName:"error", file:DropzoneFile, message:string|Error):void;
emit(eventName:"errormultiple", files:DropzoneFile[], message:string|Error):void;
emit(eventName:"error", file:DropzoneFile, message:string|Error):Dropzone;
emit(eventName:"errormultiple", files:DropzoneFile[], message:string|Error):Dropzone;
emit(eventName:"processing", file:DropzoneFile):void;
emit(eventName:"processingmultiple", files:DropzoneFile[]):void;
emit(eventName:"processing", file:DropzoneFile):Dropzone;
emit(eventName:"processingmultiple", files:DropzoneFile[]):Dropzone;
emit(eventName:"uploadprogress", file:DropzoneFile, progress:number, bytesSent:number):void;
emit(eventName:"totaluploadprogress", totalProgress:number, totalBytes:number, totalBytesSent:number):void;
emit(eventName:"uploadprogress", file:DropzoneFile, progress:number, bytesSent:number):Dropzone;
emit(eventName:"totaluploadprogress", totalProgress:number, totalBytes:number, totalBytesSent:number):Dropzone;
emit(eventName:"sending", file:DropzoneFile, xhr:XMLHttpRequest, formData:FormData):void;
emit(eventName:"sendingmultiple", files:DropzoneFile[], xhr:XMLHttpRequest, formData:FormData):void;
emit(eventName:"sending", file:DropzoneFile, xhr:XMLHttpRequest, formData:FormData):Dropzone;
emit(eventName:"sendingmultiple", files:DropzoneFile[], xhr:XMLHttpRequest, formData:FormData):Dropzone;
emit(eventName:"success", file:DropzoneFile):void;
emit(eventName:"successmultiple", files:DropzoneFile[]):void;
emit(eventName:"success", file:DropzoneFile):Dropzone;
emit(eventName:"successmultiple", files:DropzoneFile[]):Dropzone;
emit(eventName:"canceled", file:DropzoneFile):void;
emit(eventName:"canceledmultiple", file:DropzoneFile[]):void;
emit(eventName:"canceled", file:DropzoneFile):Dropzone;
emit(eventName:"canceledmultiple", file:DropzoneFile[]):Dropzone;
emit(eventName:"complete", file:DropzoneFile):void;
emit(eventName:"completemultiple", file:DropzoneFile[]):void;
emit(eventName:"complete", file:DropzoneFile):Dropzone;
emit(eventName:"completemultiple", file:DropzoneFile[]):Dropzone;
emit(eventName:"maxfilesexceeded", file:DropzoneFile):void;
emit(eventName:"maxfilesreached", files:DropzoneFile[]):void;
emit(eventName:"queuecomplete"):void;
emit(eventName:"maxfilesexceeded", file:DropzoneFile):Dropzone;
emit(eventName:"maxfilesreached", files:DropzoneFile[]):Dropzone;
emit(eventName:"queuecomplete"):Dropzone;
}
+599
View File
@@ -0,0 +1,599 @@
// These tests are copied more or less directly from http://dygraphs.com/tests/
/// <reference path="dygraphs.d.ts" />
function demo() {
const g14 = new Dygraph(
document.getElementById("div_g14"),
'data', {
rollPeriod: 14,
errorBars: true,
labelsDivWidth: 100,
labelsDivStyles: {
'boxShadow': '4px 4px 4px #888'
},
labelsSeparateLines: true,
}
);
}
function twoAxes() {
var data = [] as number[][];
var g = new Dygraph(
document.getElementById("demodiv"),
data,
{
labels: [ 'Date', 'Y1', 'Y2', 'Y3', 'Y4' ],
series: {
'Y3': {
axis: 'y2'
},
'Y4': {
axis: 'y2'
},
},
axes: {
y2: {
// set axis-related properties here
labelsKMB: true
},
y: {
axisLabelWidth: 60
}
},
ylabel: 'Primary y-axis',
y2label: 'Secondary y-axis',
}
);
var g2 = new Dygraph(
document.getElementById("demodiv_y2_primary"),
data,
{
labels: [ 'Date', 'Y1', 'Y2', 'Y3', 'Y4' ],
ylabel: 'Primary y-axis',
y2label: 'Secondary y-axis',
series : {
'Y3': {
axis: 'y2'
},
'Y4': {
axis: 'y2'
}
},
axes: {
y: {
// set axis-related properties here
drawGrid: false,
independentTicks: false
},
y2: {
// set axis-related properties here
labelsKMB: true,
drawGrid: true,
independentTicks: true
}
}
}
);
var g3 = new Dygraph(
document.getElementById("demodiv_two_grids"),
data,
{
labels: [ 'Date', 'Y1', 'Y2', 'Y3', 'Y4' ],
ylabel: 'Primary y-axis',
y2label: 'Secondary y-axis',
series : {
'Y3': {
axis: 'y2'
},
'Y4': {
axis: 'y2'
}
},
axes: {
y2: {
// set axis-related properties here
labelsKMB: true,
drawGrid: true,
independentTicks: true,
gridLinePattern: [2,2]
}
}
}
);
var g4 = new Dygraph(
document.getElementById("demodiv_one"),
data,
{
labels: [ 'Date', 'Y1', 'Y2', 'Y3', 'Y4' ],
labelsKMB: true,
ylabel: 'Primary y-axis',
y2label: 'Secondary y-axis',
}
);
var g5 = new Dygraph(
document.getElementById("demodiv_one_right"),
data,
{
labels: [ 'Date', 'Y1', 'Y2', 'Y3', 'Y4' ],
ylabel: 'Primary y-axis',
y2label: 'Secondary y-axis',
series : {
'Y1': {
axis: 'y2'
},
'Y2': {
axis: 'y2'
},
'Y3': {
axis: 'y2'
},
'Y4': {
axis: 'y2'
}
},
axes: {
y: {
// set axis-related properties here
drawGrid: false,
independentTicks: false
},
y2: {
// set axis-related properties here
labelsKMB: true,
drawGrid: true,
independentTicks: true
}
}
}
);
function update(el: HTMLInputElement) {
g.updateOptions( { fillGraph: el.checked } );
g2.updateOptions( { fillGraph: el.checked } );
g3.updateOptions( { fillGraph: el.checked } );
g4.updateOptions( { fillGraph: el.checked } );
g5.updateOptions( { fillGraph: el.checked } );
}
}
function perSeries() {
var data = '1234';
var g = new Dygraph(
document.getElementById("demodiv"),
data,
{
strokeWidth: 2,
series : {
'parabola': {
strokeWidth: 0.0,
drawPoints: true,
pointSize: 4,
highlightCircleSize: 6
},
'line': {
strokeWidth: 1.0,
drawPoints: true,
pointSize: 1.5
},
'sine wave': {
strokeWidth: 3,
highlightCircleSize: 10
},
'sine wave2': {
strokePattern: [10, 2, 5, 2],
strokeWidth: 2,
highlightCircleSize: 3
}
}
}
);
var g2 = new Dygraph(
document.getElementById("demodiv2"),
data,
{
legend: 'always',
strokeWidth: 2,
series: {
'parabola': {
strokePattern: null,
drawPoints: true,
pointSize: 4,
highlightCircleSize: 6
},
'line': {
strokePattern: Dygraph.DASHED_LINE,
strokeWidth: 1.0,
drawPoints: true,
pointSize: 1.5
},
'another line': {
strokePattern: [25, 5]
},
'sine wave': {
strokePattern: Dygraph.DOTTED_LINE,
strokeWidth: 3,
highlightCircleSize: 10
},
'sine wave2': {
strokePattern: Dygraph.DOT_DASH_LINE,
strokeWidth: 2,
highlightCircleSize: 3
}
}
}
);
var g3 = new Dygraph(
document.getElementById("demodiv3"),
data,
{
strokeWidth: 2,
series: {
'parabola': {
strokeWidth: 0.0,
drawPoints: true,
pointSize: 4,
highlightCircleSize: 6
},
'line': {
strokeWidth: 1.0,
drawPoints: true,
pointSize: 1.5
},
'sine wave': {
strokeWidth: 3,
highlightCircleSize: 10
},
'sine wave2': {
strokePattern: [10, 2, 5, 2],
strokeWidth: 2,
highlightCircleSize: 3
}
}
}
);
}
function highlightedRegion() {
var highlight_start = 0, highlight_end = 0;
var g = new Dygraph(
document.getElementById("div_g"),
[],
{
labels: ['X', 'Est.', 'Actual'],
animatedZooms: true,
underlayCallback: function(canvas, area, g) {
var bottom_left = g.toDomCoords(highlight_start, -20);
var top_right = g.toDomCoords(highlight_end, +20);
var left = bottom_left[0];
var right = top_right[0];
canvas.fillStyle = "rgba(255, 255, 102, 1.0)";
canvas.fillRect(left, area.y, right - left, area.h);
}
}
);
}
function makeGraph(className: string, numSeries: number, numRows: number, isStacked: boolean) {
var div = document.createElement('div');
div.className = className;
div.style.display = 'inline-block';
document.body.appendChild(div);
var labels = ['x'];
for (var i = 0; i < numSeries; ++i) {
var label = '' + i;
label = 's' + '000'.substr(label.length) + label;
labels[i + 1] = label;
}
var g = new Dygraph(
div,
'data',
{
width: 480,
height: 320,
labels: labels.slice(),
stackedGraph: isStacked,
highlightCircleSize: 2,
strokeWidth: 1,
strokeBorderWidth: isStacked ? null : 1,
highlightSeriesOpts: {
strokeWidth: 3,
strokeBorderWidth: 1,
highlightCircleSize: 5,
},
});
g.setSelection(false, 's005');
};
function linearRegressionAddSeries() {
var labels = ['X', 'Y1', 'Y2'];
var orig_colors = [] as string[];
var g = new Dygraph(
document.getElementById("demodiv"),
'data',
{
labels: labels,
drawPoints: true,
strokeWidth: 0.0,
drawCallback: function(g, is_initial) {
if (!is_initial) return;
var c = g.getColors();
for (var i = 0; i < c.length; i++) orig_colors.push(c[i]);
}
}
);
}
function callbacks() {
var s = document.getElementById("status");
var g: Dygraph = null;
var pts_info = function(e: MouseEvent, x: number, pts: dygraphs.Point[], row?: number) {
var str = "(" + x + ") ";
for (var i = 0; i < pts.length; i++) {
var p = pts[i];
if (i) str += ", ";
str += p.name + ": " + p.yval;
}
var x = e.offsetX;
var y = e.offsetY;
var dataXY = g.toDataCoords(x, y);
str += ", (" + x + ", " + y + ")";
str += " -> (" + dataXY[0] + ", " + dataXY[1] + ")";
str += ", row #"+row;
return str;
};
g = new Dygraph(
document.getElementById("div_g"),
'NoisyData', {
rollPeriod: 7,
showRoller: true,
errorBars: true,
highlightCallback: function(e, x, pts, row) {
s.innerHTML += "<b>Highlight</b> " + pts_info(e,x,pts,row) + "<br/>";
},
unhighlightCallback: function(e) {
s.innerHTML += "<b>Unhighlight</b><br/>";
},
clickCallback: function(e, x, pts) {
s.innerHTML += "<b>Click</b> " + pts_info(e,x,pts) + "<br/>";
},
pointClickCallback: function(e, p) {
s.innerHTML += "<b>Point Click</b> " + p.name + ": " + p.x + "<br/>";
},
zoomCallback: function(minX, maxX, yRanges) {
s.innerHTML += "<b>Zoom</b> [" + minX + ", " + maxX + ", [" + yRanges + "]]<br/>";
},
drawCallback: function(g) {
s.innerHTML += "<b>Draw</b> [" + g.xAxisRange() + "]<br/>";
}
}
);
}
function valueAxisFormatters() {
function formatDate(d: Date) {
var yyyy = d.getFullYear(),
mm = d.getMonth() + 1,
dd = d.getDate();
return yyyy + '-' + (mm < 10 ? '0' : '') + mm + (dd < 10 ? '0' : '') + dd;
}
var g = new Dygraph(
document.getElementById("demodiv"),
'data',
{
labels: [ 'Date', 'Y1', 'Y2', 'Y3', 'Y4' ],
width: 640,
height: 350,
series: {
'Y3': { axis: 'y2' },
'Y4': { axis: 'y2' }
},
axes: {
x: {
valueFormatter: function(ms) {
return 'xvf(' + formatDate(new Date(ms)) + ')';
},
axisLabelFormatter: function(d: Date) {
return 'xalf(' + formatDate(d) + ')';
},
pixelsPerLabel: 100,
axisLabelWidth: 100,
},
y: {
valueFormatter: function(y) {
return 'yvf(' + y.toPrecision(2) + ')';
},
axisLabelFormatter: function(y: number) {
return 'yalf(' + y.toPrecision(2) + ')';
},
axisLabelWidth: 100,
},
y2: {
valueFormatter: function(y2) {
return 'y2vf(' + y2.toPrecision(2) + ')';
},
axisLabelFormatter: function(y2: number) {
return 'y2alf(' + y2.toPrecision(2) + ')';
}
}
}
});
}
function annotation() {
var eventDiv = document.getElementById("events");
function nameAnnotation(ann: dygraphs.Annotation) {
return "(" + ann.series + ", " + ann.x + ")";
}
var annotations = [] as dygraphs.Annotation[];
var graph_initialized = false;
var g = new Dygraph(
document.getElementById("g_div"),
function() {
var zp = function(x: number) { if (x < 10) return "0"+x; else return ''+x; };
var r = "date,parabola,line,another line,sine wave\n";
for (var i=1; i<=31; i++) {
r += "200610" + zp(i);
r += "," + 10*(i*(31-i));
r += "," + 10*(8*i);
r += "," + 10*(250 - 8*i);
r += "," + 10*(125 + 125 * Math.sin(0.3*i));
r += "\n";
}
return r;
},
{
rollPeriod: 1,
showRoller: true,
width: 480,
height: 320,
drawCallback: function(g, is_initial) {
if (is_initial) {
graph_initialized = true;
if (annotations.length > 0) {
g.setAnnotations(annotations);
}
}
var ann = g.annotations();
var html = "";
for (var i = 0; i < ann.length; i++) {
var name = nameAnnotation(ann[i]);
html += "<span id='" + name + "'>"
html += name + ": " + (ann[i].shortText || '(icon)')
html += " -> " + ann[i].text + "</span><br/>";
}
document.getElementById("list").innerHTML = html;
}
}
);
var last_ann = 0;
for (var x = 10; x < 15; x += 2) {
annotations.push( {
series: 'sine wave',
x: "200610" + x,
shortText: '' + x,
text: 'Stock Market Crash ' + x
} );
last_ann = x;
}
annotations.push( {
series: 'another line',
x: "20061013",
icon: 'dollar.png',
width: 18,
height: 23,
tickHeight: 4,
text: 'Another one',
cssClass: 'annotation',
clickHandler: function() {
document.getElementById("events").innerHTML += "special handler<br/>";
}
} );
annotations.push( {
series: 'parabola',
x: '20061012',
shortText: 'P',
text: 'Parabola Annotation at same x-coord'
} );
if (graph_initialized) {
g.setAnnotations(annotations);
}
function add() {
var x = last_ann + 2;
var annnotations = g.annotations();
annotations.push({
series: 'line',
x: "200610" + x,
shortText: ''+x,
text: 'Line ' + x,
tickHeight: 10
} );
last_ann = x;
g.setAnnotations(annotations);
}
function bottom(el: HTMLInputElement) {
var to_bottom = true;
if (el.value != 'Shove to bottom') to_bottom = false;
var anns = g.annotations();
for (var i = 0; i < anns.length; i++) {
anns[i].attachAtBottom = to_bottom;
}
g.setAnnotations(anns);
if (to_bottom) {
el.value = 'Lift back up';
} else {
el.value = 'Shove to bottom';
}
}
var saveBg = '';
var num = 0;
g.updateOptions( {
annotationClickHandler: function(ann, point, dg, event) {
eventDiv.innerHTML += "click: " + nameAnnotation(ann) + "<br/>";
},
annotationDblClickHandler: function(ann, point, dg, event) {
eventDiv.innerHTML += "dblclick: " + nameAnnotation(ann) + "<br/>";
},
annotationMouseOverHandler: function(ann, point, dg, event) {
document.getElementById(nameAnnotation(ann)).style.fontWeight = 'bold';
saveBg = ann.div.style.backgroundColor;
ann.div.style.backgroundColor = '#ddd';
},
annotationMouseOutHandler: function(ann, point, dg, event) {
document.getElementById(nameAnnotation(ann)).style.fontWeight = 'normal';
ann.div.style.backgroundColor = saveBg;
},
pointClickCallback: function(event, p) {
// Check if the point is already annotated.
if (p.annotation) return;
// If not, add one.
var ann = {
series: p.name,
xval: p.xval,
shortText: '' + num,
text: "Annotation #" + num
};
var anns = g.annotations();
anns.push(ann);
g.setAnnotations(anns);
num++;
}
});
}
+1270
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
+56236
View File
File diff suppressed because it is too large Load Diff
-336
View File
@@ -1,336 +0,0 @@
/// <reference path="../jquery/jquery.d.ts" />
/// <reference path="ej.mobile.all.d.ts" />
$(document).ready(function () {
$("#CoreLinearGauge").ejLinearGauge({
labelColor: "#8c8c8c", width: 500,
scales: [{
width: 4, border: { color: "transparent",width:0 }, showBarPointers: false, showRanges: true, length: 310,
position: { x: 52, y: 50 }, markerPointers: [{
value: 50, length: 10, width: 10, backgroundColor: "#4D4D4D", border: { color: "#4D4D4D" }
}],
labels: [{ font: { size: "11px", fontFamily: "Segoe UI", fontStyle: "bold" }, distanceFromScale:{x: -13} }],
ticks: [{ type: "majorinterval", width: 1, color: "#8c8c8c" }],
ranges: [{
endValue: 60,
startValue: 0,
backgroundColor: "#F6B53F",
border: { color: "#F6B53F" }, startWidth: 4, endWidth: 4
}, {
endValue: 100,
startValue: 60,
backgroundColor: "#E94649",
border: { color: "#E94649" }, startWidth: 4, endWidth: 4
}]
}],
init:onLinearGaugeinit,
mouseClick:onLinearGaugemouseClick
});
});
function onLinearGaugeinit()
{
console.log("init");
}
function onLinearGaugemouseClick()
{
console.log("mouseClick");
}
$(document).ready(function () {
$("#CoreCircularGauge").ejCircularGauge({
backgroundColor: "transparent", width: 500,
scales: [{
showRanges: true,
startAngle: 122, sweepAngle: 296, radius: 130, showScaleBar: true, size: 1, maximum: 120, majorIntervalValue: 20, minorIntervalValue: 10,
border: {
width: 0.5,
},
pointers: [{
value: 60,
showBackNeedle: true,
backNeedleLength: 20,
length: 95,
width: 7,
pointerCap: { radius: 12 }
}],
ticks: [{
type: "major",
distanceFromScale: 2,
height: 16,
width: 1, color: "#8c8c8c"
}, { type: "minor", height: 8, width: 1, distanceFromScale: 2, color: "#8c8c8c" }],
labels: [{
color: "#8c8c8c"
}],
ranges: [{
distanceFromScale: -30,
startValue: 0,
endValue: 70
}, {
distanceFromScale: -30,
startValue: 70,
endValue: 110,
backgroundColor: "#fc0606",
border: { color: "#fc0606" }
},
{
distanceFromScale: -30,
startValue: 110,
endValue: 120,
backgroundColor: "#f5b43f",
border: { color: "#f5b43f" }
}]
}],
mouseClick:onCircularMouseClick
});
});
function onCircularMouseClick()
{
console.log("Mouse click..");
}
$(document).ready(function () {
$("#DigitalCore").ejDigitalGauge({
width: 525,
height: 305,
items: [{
segmentSettings: {
width: 1,
spacing: 0,
color: "#8c8c8c"
},
characterSettings: {
opacity: 0.8,
},
value: "123456789",
position: { x: 52, y: 52 }
}],
init:onDigitalGaugeinit,
itemRendering:onDigitalGaugeItemRendering
});
});
function onDigitalGaugeinit()
{
console.log("init");
}
function onDigitalGaugeItemRendering()
{
console.log("itemRendering");
}
$(document).ready(function () {
$("#container").ejChart(
{
//Initializing Common Properties for all the series
commonSeriesOptions:
{
type: 'line', enableAnimation: true,
tooltip:{ visible :true, template:'Tooltip'},
marker:
{
shape: 'circle',
size:
{
height: 10, width: 10
},
visible: true
},
border : {width: 2}
},
title :{text: 'Efficiency of oil-fired power production'},
size: { height: "600" },
legend: { visible: true},
create:onChartCreate
});
});
function onChartCreate()
{
console.log("create");
}
$(document).ready(function () {
$("#scrollcontent").ejRangeNavigator({
enableDeferredUpdate: true,
padding: "15",
allowSnapping:true,
selectedRangeSettings: {
start:"2015/5/25", end:"2016/5/25"
},
})
});
$(document).ready(function () {
$("#BulletGraph1").ejBulletGraph({
qualitativeRangeSize: 32,
quantitativeScaleLength: 475, tooltipSettings: {template: "Tooltip", visible: true}, orientation: ej.datavisualization.BulletGraph.Orientation.Horizontal,
flowDirection: ej.datavisualization.BulletGraph.FlowDirection.Forward,
quantitativeScaleSettings: {
location: { x: 110, y: 10 },
minimum: 0,
maximum: 10,
interval: 1,
minorTicksPerInterval: 4,
majorTickSettings:{ size: 13, width: 1, stroke: 'gray'},
minorTickSettings:{ size: 5, width: 1, stroke: 'gray'},
labelSettings: {
position: ej.datavisualization.BulletGraph.LabelPosition.Below, offset: 14, size: 10
},
featuredMeasureSettings: { width: 6 },
comparativeMeasureSettings:{
width: 5
},
featureMeasures: [{ value: 8, comparativeMeasureValue: 6.7, category: ""}]
},
qualitativeRanges: [{
rangeEnd: 4.3
}, {
rangeEnd: 7.3
}, {
rangeEnd: 10
}],
captionSettings: { textAngle: 0,
location: { x: 17, y: 20 }, text: "Revenue YTD", font: { color: null, fontFamily: 'Segoe UI', fontStyle: ej.datavisualization.BulletGraph.FontStyle.Normal, size: '12px', fontWeight: ej.datavisualization.BulletGraph.FontWeight.Normal, opacity: 1 }, //'#707070'
subTitle: { textAngle: 0,
text: "$ in Thousands", location: { x: 10, y: 35 }, font: { color: null, fontFamily: 'Segoe UI', fontStyle: ej.datavisualization.BulletGraph.FontStyle.Normal, size: '12px', fontWeight: ej.datavisualization.BulletGraph.FontWeight.Normal, opacity: 1} //'#707070'
}
}
});
$("#BulletGraph2").ejBulletGraph({ qualitativeRangeSize: 32, height:140,
quantitativeScaleLength: 475, orientation: ej.datavisualization.BulletGraph.Orientation.Horizontal,
flowDirection: ej.datavisualization.BulletGraph.FlowDirection.Forward,
quantitativeScaleSettings: {
location: { x: 110, y: 10 },
minimum: -10,
maximum: 10,
interval: 2,
minorTicksPerInterval: 4,
majorTickSettings:{ size: 13, width: 1},
minorTickSettings:{ size: 5, width: 1},
labelSettings: {
position: ej.datavisualization.BulletGraph.LabelPosition.Below, offset: 14, size: 10, labelSuffix: ' %'
},
featuredMeasureSettings: { width: 6 },
comparativeMeasureSettings:{ width: 5 },
featureMeasures: [{ value: 8, comparativeMeasureValue: 6.7}]
},
qualitativeRanges: [{
rangeEnd: -4, rangeStroke: "#61a301"
}, {
rangeEnd: 3, rangeStroke: "#fcda21"
}, {
rangeEnd: 10, rangeStroke: "#d61e3f"
}],
captionSettings: { textAngle: 0,
location: { x: 60, y: 25 }, text: "Profit", font: { color: null, fontFamily: 'Segoe UI', fontStyle: ej.datavisualization.BulletGraph.FontStyle.Normal, size: '13px', fontWeight: ej.datavisualization.BulletGraph.FontWeight.Normal, opacity: 1 }, //'#707070'
//subTitle: { textAngle: 0,
// text: "profit in %", location: { x: 35, y: 35 }, font: { color: null, fontFamily: 'Segoe UI', fontStyle: ej.datavisualization.BulletGraph.FontStyle.Normal, size: '12px', fontWeight: ej.datavisualization.BulletGraph.FontWeight.Normal, opacity: 1} //'#707070'
//}
},
drawLabels:onBulletDrawLabel
});
});
function onBulletDrawLabel()
{
console.log("drawLabel");
}
$(document).ready(function () {
$("#barcode").ejBarcode({ text: "HTTP://WWW.SYNCFUSION.COM", symbologyType: "qrbarcode", xDimension: 8, displayText: true, load:onBarcodeLoad });
});
function onBarcodeLoad()
{
console.log("load");
}
jQuery(function ($) {
$("#container").ejMap({
mouseover:MapMouseOver,
onRenderComplete:MapOnRenderComplete,
navigationControl:{enableNavigation:true,orientation:'vertical',absolutePosition:{x:5,y:15},dockPosition: 'none'},
background:'white',
enableAnimation: true,
layers: [
{
layerType: "geometry",
enableSelection: false,
enableMouseHover:false,
showMapItems: false,
markerTemplate: 'template',
shapeSettings: {
fill: "#626171",
strokeThickness: "1",
stroke: "#6F6F79",
highlightStroke:"#6F6F79",
valuePath: "name",
highlightColor: "gray"
},
}
]
});
});
function MapMouseOver() {
console.log("mouseover");
}
function MapOnRenderComplete() {
console.log("onRenderComplete");
}
jQuery(function ($) {
$("#treemapContainer").ejTreeMap({
treeMapItemSelected:onTreeMapItemSelected,
levels: [
{ groupPath: "Continent", groupGap: 5}
],
colorValuePath: "Growth",
rangeColorMapping: [
{ color: "#DC562D", from: "0", to: "1" },
{ color: "#FED124", from: "1", to: "1.5" },
{ color: "#487FC1", from: "1.5", to: "2" },
{ color: "#0E9F49", from: "2", to: "3" }
],
showTooltip:true,
leafItemSettings: { labelPath: "Region" }
});
});
function onTreeMapItemSelected() {
console.log("TreeMapItemSelected");
}
-19908
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-47109
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-49995
View File
File diff suppressed because it is too large Load Diff
+16 -1
View File
@@ -15,6 +15,8 @@ declare module Elasticsearch {
create(params: CreateDocumentParams, callback: (err: any, response: any, status: any) => void): void;
delete(params: DeleteDocumentParams): PromiseLike<any>;
delete(params: DeleteDocumentParams, callback: (error: any, response: any) => void): void;
exists(params: ExistsParams): PromiseLike<any>;
exists(params: ExistsParams, callback: (error: any, response: any, status?: any) => void): void;
get<T>(params: GetParams, callback: (error: any, response: GetResponse<T>) => void): void;
get<T>(params: GetParams): PromiseLike<GetResponse<T>>;
index<T>(params: IndexDocumentParams<T>): PromiseLike<any>;
@@ -95,6 +97,7 @@ declare module Elasticsearch {
method?: string;
body?: any;
ignore?: number | number[];
filterPath?: string | string[];
}
export interface BulkIndexDocumentsParams extends GenericParams {
@@ -109,7 +112,7 @@ declare module Elasticsearch {
export interface CreateDocumentParams extends GenericParams {
consistency?: "one" | "quorum" | "all";
parent?: string;
refressh?: boolean;
refresh?: boolean;
routing?: string;
timeout?: number | Date;
timestamp?: number | Date;
@@ -205,6 +208,17 @@ declare module Elasticsearch {
_source: T;
}
export interface ExistsParams extends GenericParams {
id: string;
index: string;
parent?: string;
preference?: string;
realtime?: boolean;
refresh?: boolean;
routing?: string;
type: string;
}
export interface IndexDocumentParams<T> extends GenericParams {
index: string;
type: string;
@@ -313,6 +327,7 @@ declare module Elasticsearch {
index: string;
type: string;
id: string;
parent?: string;
refresh?: boolean;
}
@@ -0,0 +1,20 @@
/// <reference path="../github-electron/github-electron.d.ts" />
/// <reference path="electron-devtools-installer.d.ts" />
import installExtension, {
EMBER_INSPECTOR, REACT_DEVELOPER_TOOLS,
BACKBONE_DEBUGGER, JQUERY_DEBUGGER,
ANGULARJS_BATARANG, VUEJS_DEVTOOLS,
REDUX_DEVTOOLS, REACT_PERF,
} from 'electron-devtools-installer';
installExtension(EMBER_INSPECTOR);
installExtension(REACT_DEVELOPER_TOOLS);
installExtension(BACKBONE_DEBUGGER);
installExtension(JQUERY_DEBUGGER);
installExtension(ANGULARJS_BATARANG);
installExtension(VUEJS_DEVTOOLS);
installExtension(REDUX_DEVTOOLS);
installExtension(REACT_PERF);
installExtension('abcdefghijkl');
@@ -0,0 +1,24 @@
// Type definitions for electron-devtools-installer v2.0.1
// Project: https://github.com/MarshallOfSound/electron-devtools-installer
// Definitions by: Robin Van den Broeck <https://github.com/gamesmaxed>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module "electron-devtools-installer" {
interface ExtensionReference {
id: string,
electron: string,
}
// Default installation function
export default function (extensionReference: ExtensionReference | string, forceDownload?: boolean): Promise<string>;
// Devtools themself
export const EMBER_INSPECTOR: ExtensionReference;
export const REACT_DEVELOPER_TOOLS: ExtensionReference;
export const BACKBONE_DEBUGGER: ExtensionReference;
export const JQUERY_DEBUGGER: ExtensionReference;
export const ANGULARJS_BATARANG: ExtensionReference;
export const VUEJS_DEVTOOLS: ExtensionReference;
export const REDUX_DEVTOOLS: ExtensionReference;
export const REACT_PERF: ExtensionReference;
}
+1 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for empower
// Type definitions for empower 1.2.1
// Project: https://github.com/twada/empower
// Definitions by: vvakame <https://github.com/vvakame>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+9
View File
@@ -0,0 +1,9 @@
/// <reference path="express-mung.d.ts"/>
import { Request, Response } from "express";
import * as mung from "express-mung";
function redact(body: Object, req: Request, res: Response) {
    return body;
}
mung.json(redact);
+43
View File
@@ -0,0 +1,43 @@
// Type definitions for express-mung 0.4.2
// Project: https://github.com/richardschneider/express-mung
// Definitions by: Cyril Schumacher <https://github.com/cyrilschumacher>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../express/express.d.ts"/>
/// <reference path="../node/node.d.ts"/>
declare module "express-mung" {
import { Request, Response } from "express";
import * as http from "http";
type Transform = (body: {}, request: Request, response: Response) => {};
type TransformHeader = (body: http.IncomingMessage, request: Request, response: Response) => {};
/**
* Transform the JSON body of the response.
* @param {Transform} fn A transformation function.
* @return {any} The body.
*/
export function json(fn: Transform): any;
/**
* Transform the JSON body of the response.
* @param {Transform} fn A transformation function.
* @return {any} The body.
*/
export function jsonAsync(fn: Transform): PromiseLike<any>;
/**
* Transform the HTTP headers of the response.
* @param {Transform} fn A transformation function.
* @return {any} The body.
*/
export function headers(fn: TransformHeader): any;
/**
* Transform the HTTP headers of the response.
* @param {Transform} fn A transformation function.
* @return {any} The body.
*/
export function headersAsync(fn: TransformHeader): PromiseLike<any>;
}
+13 -3
View File
@@ -22,7 +22,7 @@ declare module "express-serve-static-core" {
}
interface RequestHandler {
(req: Request, res: Response, next?: NextFunction): any;
(req: Request, res: Response, next: NextFunction): any;
}
interface ErrorRequestHandler {
@@ -97,6 +97,10 @@ declare module "express-serve-static-core" {
use: IRouterHandler<this> & IRouterMatcher<this>;
route(prefix: PathParams): IRoute;
/**
* Stack of configured routes
*/
stack: any[];
}
interface IRoute {
@@ -126,7 +130,7 @@ declare module "express-serve-static-core" {
interface Errback { (err: Error): void; }
interface Request extends http.ServerRequest, Express.Request {
interface Request extends http.IncomingMessage, Express.Request {
/**
* Return request header.
@@ -818,6 +822,12 @@ declare module "express-serve-static-core" {
}
interface Application extends IRouter, Express.Application {
/**
* Express instance itself is a request handler, which could be invoked without
* third argument.
*/
(req: Request, res: Response): any;
/**
* Initialize the server.
*
@@ -1048,7 +1058,7 @@ declare module "express-serve-static-core" {
routes: any;
/**
* Using to all registered routes in Express Application
* Used to get all registered routes in Express Application
*/
_router: any;
}
+2
View File
@@ -10,10 +10,12 @@ declare namespace Express {
export interface Request {
session?: Session;
sessionID?: string;
}
export interface Session {
[key: string]: any;
id: string;
regenerate: (callback: (err: any) => void) => void;
destroy: (callback: (err: any) => void) => void;
+1
View File
@@ -123,6 +123,7 @@ resultStr = faker.internet.mac();
resultStr = faker.internet.password();
resultStr = faker.internet.password(0, false, '#', 'foo');
resultStr = faker.lorem.word();
resultStr = faker.lorem.words();
resultStr = faker.lorem.words(0);
resultStr = faker.lorem.sentence();
+2 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for faker
// Type definitions for faker v3.1
// Project: http://marak.com/faker.js/
// Definitions by: Bas Pennings <https://github.com/basp/>, Yuki Kokubun <https://github.com/Kuniwak>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -135,6 +135,7 @@ declare namespace Faker {
};
lorem: {
word(): string;
words(num?: number): string;
sentence(wordCount?: number, range?: number): string;
sentences(sentenceCount?: number): string;
+4 -4
View File
@@ -78,10 +78,10 @@ interface FlexSliderOptions {
// Callback API
start?: (slider: SliderObject) => any; //Callback: function(slider) - Fires when the slider loads the first slide
before?: (slider: SliderObject) => any; //Callback: function(slider) - Fires asynchronously with each slider animation
after?: () => any; //Callback: function(slider) - Fires after each slider animation completes
end?: () => any; //Callback: function(slider) - Fires when the slider reaches the last slide (asynchronous)
added?: () => any; //{NEW} Callback: function(slider) - Fires after a slide is added
removed?: () => any;
after?: (slider: SliderObject) => any; //Callback: function(slider) - Fires after each slider animation completes
end?: (slider: SliderObject) => any; //Callback: function(slider) - Fires when the slider reaches the last slide (asynchronous)
added?: (slider: SliderObject) => any; //{NEW} Callback: function(slider) - Fires after a slide is added
removed?: (slider: SliderObject) => any;
}
+1 -1
View File
@@ -48,7 +48,7 @@ if (form.bytesReceived > 100) {
if (form.bytesExpected > 100) {
}
var req: http.ServerRequest;
var req: http.IncomingMessage;
form.parse(req);
form.parse(req, (err: any, fields: formidable.Fields, files: formidable.Files) => {
+54 -8
View File
@@ -1,4 +1,4 @@
// Type definitions for Electron v1.3.6
// Type definitions for Electron v1.4.1
// Project: http://electron.atom.io/
// Definitions by: jedmao <https://github.com/jedmao/>, rhysd <https://rhysd.github.io>, Milan Burda <https://github.com/miniak/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -176,7 +176,7 @@ declare namespace Electron {
/**
* Emitted when the gpu process crashes.
*/
on(event: 'gpu-process-crashed', listener: Function): this;
on(event: 'gpu-process-crashed', listener: (event: Event, killed: boolean) => void): this;
/**
* Emitted when Chrome's accessibility support changes.
*
@@ -841,6 +841,11 @@ declare namespace Electron {
* Note: This is only implemented on macOS.
*/
on(event: 'scroll-touch-end', listener: Function): this;
/**
* Emitted when scroll wheel event phase filed upon reaching the edge of element.
* Note: This is only implemented on macOS.
*/
on(event: 'scroll-touch-edge', listener: Function): this;
/**
* Emitted on 3-finger swipe.
* Note: This is only implemented on macOS.
@@ -2589,6 +2594,7 @@ declare namespace Electron {
static createEmpty(): NativeImage;
/**
* Creates a new NativeImage instance from file located at path.
* This method returns an empty image if the path does not exist, cannot be read, or is not a valid image.
*/
static createFromPath(path: string): NativeImage;
/**
@@ -2769,8 +2775,18 @@ declare namespace Electron {
referrer: string;
method: string;
uploadData?: {
/**
* Content being sent.
*/
bytes: Buffer,
file: string
/**
* Path of file being uploaded.
*/
file: string,
/**
* UUID of blob data. Use session.getBlobData method to retrieve the data.
*/
blobUUID: string;
}[];
}
@@ -3016,6 +3032,10 @@ declare namespace Electron {
* @returns The user agent for this session.
*/
getUserAgent(): string;
/**
* Returns the blob data associated with the identifier.
*/
getBlobData(identifier: string, callback: (result: Buffer) => void): void;
/**
* The webRequest API set allows to intercept and modify contents of a request at various stages of its lifetime.
*/
@@ -3317,6 +3337,10 @@ declare namespace Electron {
* Path of file being uploaded.
*/
file: string;
/**
* UUID of blob data. Use session.getBlobData method to retrieve the data.
*/
blobUUID: string;
}
interface BeforeRequestDetails extends Details {
@@ -3495,6 +3519,11 @@ declare namespace Electron {
* Get system preferences.
*/
interface SystemPreferences {
/**
* Note: This is only implemented on Windows.
*/
on(event: 'accent-color-changed', listener: (event: Event, newColor: string) => void): this;
on(event: string, listener: Function): this;
/**
* @returns If the system is in Dark Mode.
*
@@ -3549,13 +3578,17 @@ declare namespace Electron {
*/
getUserDefault(key: string, type: 'string' | 'boolean' | 'integer' | 'float' | 'double' | 'url' | 'array' | 'dictionary'): any;
/**
* This method returns true if DWM composition (Aero Glass) is enabled,
* and false otherwise. You can use it to determine if you should create
* a transparent window or not (transparent windows won’t work correctly when DWM composition is disabled).
* @returns Whether DWM composition (Aero Glass) is enabled.
*
* Note: This is only implemented on Windows.
*/
isAeroGlassEnabled(): boolean;
/**
* @returns The users current system wide color preference in the form of an RGBA hexadecimal string.
*
* Note: This is only implemented on Windows.
*/
getAccentColor(): string;
}
// https://github.com/electron/electron/blob/master/docs/api/tray.md
@@ -3822,7 +3855,7 @@ declare namespace Electron {
/**
* Emitted when the renderer process has crashed.
*/
on(event: 'crashed', listener: Function): this;
on(event: 'crashed', listener: (event: Event, killed: boolean) => void): this;
/**
* Emitted when a plugin process has crashed.
*/
@@ -4237,6 +4270,10 @@ declare namespace Electron {
* If offscreen rendering is enabled returns the current frame rate.
*/
getFrameRate(): number;
/**
* If offscreen rendering is enabled invalidates the frame and generates a new one through the 'paint' event.
*/
invalidate(): void;
/**
* Sets the item as dragging item for current drag-drop operation.
*/
@@ -4438,7 +4475,7 @@ declare namespace Electron {
[key: string]: string;
}
type NewWindowDisposition = 'default' | 'foreground-tab' | 'background-tab' | 'new-window' | 'other';
type NewWindowDisposition = 'default' | 'foreground-tab' | 'background-tab' | 'new-window' | 'save-to-disk' | 'other';
/**
* Specifies the action to take place when ending webContents.findInPage request.
@@ -4881,6 +4918,15 @@ declare namespace Electron {
* A list of strings which specifies the blink features to be disabled separated by ,.
*/
disableblinkfeatures: string;
/**
* A value that links the webview to a specific webContents.
* When a webview first loads a new webContents is created and this attribute is set
* to its instance identifier. Setting this attribute on a new or existing webview connects
* it to the existing webContents that currently renders in a different webview.
*
* The existing webview will see the destroy event and will then create a new webContents when a new url is loaded.
*/
guestinstance: string;
/**
* Loads the url in the webview, the url must contain the protocol prefix, e.g. the http:// or file://.
*/
+1
View File
@@ -2131,6 +2131,7 @@ declare module "graphene-pk11" {
SO_PIN_FINAL_TRY,
SO_PIN_LOCKED,
SO_PIN_TO_BE_CHANGED,
ERROR_STATE,
}
class Token extends HandleObject {
+184
View File
@@ -0,0 +1,184 @@
/// <reference path="graphql.d.ts" />
import * as graphql from 'graphql';
///////////////////////////
// graphql //
///////////////////////////
namespace graphql_tests {
// TODO
}
///////////////////////////
// graphql/language //
///////////////////////////
namespace language_ast_tests {
// TODOS
}
namespace language_index_tests {
// TODOS
}
namespace language_kinds_tests {
// TODOS
}
namespace language_lexer_tests {
// TODOS
}
namespace language_location_tests {
// TODOS
}
namespace language_parser_tests {
// TODOS
}
namespace language_printer_tests {
// TODOS
}
namespace language_source_tests {
// TODOS
}
namespace language_visitor_tests {
// TODOS
}
///////////////////////////
// graphql/type //
///////////////////////////
namespace type_definition_tests {
// TODO
}
namespace type_directives_tests {
// TODO
}
namespace type_introspection_tests {
// TODO
}
namespace type_scalars_tests {
// TODO
}
namespace type_schema_tests {
// TODO
}
///////////////////////////
// graphql/validation //
///////////////////////////
namespace validation_specifiedRules_tests {
}
namespace validation_validate_tests {
}
///////////////////////////
// graphql/execution //
///////////////////////////
namespace execution_execute_tests {
// TODOS
}
namespace execution_values_tests {
// TODOS
}
///////////////////////////
// graphql/error //
///////////////////////////
namespace error_GraphQLError {
}
namespace error_formatError {
}
namespace error_locatedError {
}
namespace error_syntaxError {
}
///////////////////////////
// graphql/utilities //
///////////////////////////
namespace utilities_TypeInfo_tests {
//TODOS
}
namespace utilities_assertValidName_tests {
//TODOS
}
namespace utilities_astFromValue_tests {
//TODOS
}
namespace utilities_buildASTSchema_tests {
//TODOS
}
namespace utilities_buildClientSchema_tests {
//TODOS
}
namespace utilities_concatAST_tests {
//TODOS
}
namespace utilities_extendSchema_tests {
//TODOS
}
namespace utilities_getOperationAST_tests {
//TODOS
}
namespace utilities_index_tests {
//TODOS
}
namespace utilities_introspectionQuery_tests {
//TODOS
}
namespace utilities_isValidJSValue_tests {
//TODOS
}
namespace utilities_isValidLiteralValue_tests {
//TODOS
}
namespace utilities_schemaPrinter_tests {
//TODOS
}
namespace utilities_separateOperations_tests {
//TODOS
}
namespace utilities_typeComparators_tests {
//TODOS
}
namespace utilities_typeFromAST_tests {
//TODOS
}
namespace utilities_valueFromAST_tests {
//TODOS
}
+2390
View File
File diff suppressed because it is too large Load Diff
+34 -3
View File
@@ -13,7 +13,38 @@ interface IDispatcher {
declare type Tween = TweenLite | TweenMax;
declare type Timeline = SimpleTimeline | TimelineLite | TimelineMax;
declare type TweenConfig = {
[tweenProp: string]: any;
delay?: number;
ease?: Ease;
repeat?: number;
repeatDelay?: number;
yoyo?: boolean;
paused?: boolean;
overwrite?: string|number;
onComplete?: Function;
immediateRender?: boolean;
onCompleteParams?: any[];
onCompleteScope?: Object;
onRepeat?: Function;
onRepeatScope?: Object;
onReverseComplete?: Function;
onReverseCompleteParams?: any[];
onReverseCompleteScope?: Object;
onStart?: Function;
onStartParams?: any[];
onStartScope?: Object;
onUpdate?: Function;
onUpdateParams?: any[];
onUpdateScope?: Object;
startAt?: Object;
useFrames?: boolean;
lazy?: boolean;
onOverwrite?: Function;
autoCSS?: boolean;
callbackScope?: Object;
}
//com.greensock.core
declare class Animation {
static ticker: IDispatcher;
@@ -86,7 +117,7 @@ declare class TweenLite extends Animation {
static killTweensOf(target: Object, onlyActive?: boolean, vars?: Object): void;
static lagSmoothing(threshold: number, adjustedLag: number): void;
static set(target: Object, vars: Object): TweenLite;
static to(target: Object, duration: number, vars: Object): TweenLite;
static to(target: Object, duration: number, vars: TweenConfig): TweenLite;
}
declare class TweenMax extends TweenLite {
@@ -112,7 +143,7 @@ declare class TweenMax extends TweenLite {
static staggerFrom(targets: any, duration: number, vars: Object, stagger: number, onCompleteAll?: Function, onCompleteAllParams?: any[], onCompleteAllScope?: any): any[];
static staggerFromTo(targets: any, duration: number, fromVars: Object, toVars: Object, stagger: number, onCompleteAll?: Function, onCompleteAllParams?: any[], onCompleteAllScope?: any): any[];
static staggerTo(targets: any, duration: number, vars: Object, stagger: number, onCompleteAll?: Function, onCompleteAllParams?: any[], onCompleteAllScope?: any): any[];
static to(target:Object, duration:number, vars:Object):TweenMax;
static to(target:Object, duration:number, vars:TweenConfig):TweenMax;
updateTo(vars: Object, resetDuration?: boolean): TweenMax;
yoyo(): boolean;
yoyo(value?: boolean): TweenMax;
+6 -2
View File
@@ -300,8 +300,12 @@ declare module "hapi" {
}
export interface ISessionHandler {
(request: Request, reply: IReply): void;
}
export interface IStrictSessionHandler{
<T>(request: Request, reply: IStrictReply<T>): void;
}
export interface IRequestHandler<T> {
(request: Request): T;
}
@@ -464,7 +468,7 @@ declare module "hapi" {
};
/** an alternative location for the route handler option. */
handler?: ISessionHandler | string | IRouteHandlerConfig;
handler?: ISessionHandler | IStrictSessionHandler | string | IRouteHandlerConfig;
/** an optional unique identifier used to look up the route using server.lookup(). */
id?: number;
/** optional arguments passed to JSON.stringify() when converting an object or error response to a string payload.Supports the following: */
@@ -834,7 +838,7 @@ declare module "hapi" {
/** - an optional domain string or an array of domain strings for limiting the route to only requests with a matching host header field.Matching is done against the hostname part of the header only (excluding the port).Defaults to all hosts.*/
vhost?: string;
/** - (required) the function called to generate the response after successful authentication and validation.The handler function is described in Route handler.If set to a string, the value is parsed the same way a prerequisite server method string shortcut is processed.Alternatively, handler can be assigned an object with a single key using the name of a registered handler type and value with the options passed to the registered handler.*/
handler: ISessionHandler | string | IRouteHandlerConfig;
handler: ISessionHandler | IStrictSessionHandler | string | IRouteHandlerConfig;
/** - additional route options.*/
config?: IRouteAdditionalConfigurationOptions;
}
+10
View File
@@ -124,5 +124,15 @@ server.route([{
}
}]);
// Implict handler
server.route({
method: 'GET',
path: '/hello6',
handler: function (request, reply) {
request.log('info', { route: '/hello' }, Date.now());
reply('hello world');
}
});
// Start the server
server.start();
+10
View File
@@ -112,6 +112,16 @@ server.route([{
}
}]);
// Implict handler
server.route({
method: 'GET',
path: '/hello6',
handler: function (request, reply) {
request.log('info', { route: '/hello' }, Date.now());
reply('hello world');
}
});
// config.validate parameters should be optional
server.route([{
method: 'GET',
+9 -3
View File
@@ -330,8 +330,12 @@ declare module "hapi" {
export interface ISessionHandler {
(request: Request, reply: IReply): void;
}
export interface IStrictSessionHandler {
<T>(request: Request, reply: IStrictReply<T>): void;
}
export interface IRequestHandler<T> {
(request: Request): T;
}
@@ -495,7 +499,7 @@ declare module "hapi" {
};
/** an alternative location for the route handler option. */
handler?: ISessionHandler | string | IRouteHandlerConfig;
handler?: ISessionHandler | IStrictSessionHandler | string | IRouteHandlerConfig;
/** an optional unique identifier used to look up the route using server.lookup(). */
id?: number;
/** optional arguments passed to JSON.stringify() when converting an object or error response to a string payload.Supports the following: */
@@ -894,7 +898,7 @@ declare module "hapi" {
/** - an optional domain string or an array of domain strings for limiting the route to only requests with a matching host header field.Matching is done against the hostname part of the header only (excluding the port).Defaults to all hosts.*/
vhost?: string;
/** - (required) the function called to generate the response after successful authentication and validation.The handler function is described in Route handler.If set to a string, the value is parsed the same way a prerequisite server method string shortcut is processed.Alternatively, handler can be assigned an object with a single key using the name of a registered handler type and value with the options passed to the registered handler.*/
handler?: ISessionHandler | string | IRouteHandlerConfig;
handler?: ISessionHandler | IStrictSessionHandler | string | IRouteHandlerConfig;
/** - additional route options.*/
config?: IRouteAdditionalConfigurationOptions;
}
@@ -1872,7 +1876,9 @@ declare module "hapi" {
}
}
});*/
strategy(name: string, scheme: any, mode?: boolean | string, options?: any): void;
strategy(name: string, scheme: string, mode?: boolean | string, options?: any): void;
strategy(name: string, scheme: string, mode?: boolean | string): void;
strategy(name: string, scheme: string, options?:any): void;
/** server.auth.test(strategy, request, next)
Tests a request against an authentication strategy where:
+147 -144
View File
@@ -4,172 +4,175 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../express/express.d.ts" />
declare module "helmet" {
declare module 'helmet' {
import express = require('express');
import express = require('express');
interface IHelmetConfiguration {
contentSecurityPolicy? : boolean | IHelmetContentSecurityPolicyConfiguration,
dnsPrefetchControl?: boolean | IHelmetDnsPrefetchControlConfiguration,
frameguard?: boolean | IHelmetFrameguardConfiguration,
hidePoweredBy?: boolean | IHelmetHidePoweredByConfiguration,
hpkp?: boolean | IHelmetHpkpConfiguration,
hsts?: boolean | IHelmetHstsConfiguration,
ieNoOpen?: boolean,
noCache?: boolean,
noSniff?: boolean,
xssFilter?: boolean | IHelmetXssFilterConfiguration
}
namespace helmet {
interface IHelmetContentSecurityPolicyDirectiveFunction {
(req: express.Request, res: express.Response): string;
}
type HelmetCspDirectiveValue = string | IHelmetContentSecurityPolicyDirectiveFunction;
export interface IHelmetConfiguration {
contentSecurityPolicy? : boolean | IHelmetContentSecurityPolicyConfiguration,
dnsPrefetchControl?: boolean | IHelmetDnsPrefetchControlConfiguration,
frameguard?: boolean | IHelmetFrameguardConfiguration,
hidePoweredBy?: boolean | IHelmetHidePoweredByConfiguration,
hpkp?: boolean | IHelmetHpkpConfiguration,
hsts?: boolean | IHelmetHstsConfiguration,
ieNoOpen?: boolean,
noCache?: boolean,
noSniff?: boolean,
xssFilter?: boolean | IHelmetXssFilterConfiguration
}
interface IHelmetContentSecurityPolicyDirectives {
baseUri? : HelmetCspDirectiveValue[],
childSrc? : HelmetCspDirectiveValue[],
connectSrc? : HelmetCspDirectiveValue[],
defaultSrc? : HelmetCspDirectiveValue[],
fontSrc? : HelmetCspDirectiveValue[],
formAction? : HelmetCspDirectiveValue[],
frameAncestors? : HelmetCspDirectiveValue[],
frameSrc? : HelmetCspDirectiveValue[],
imgSrc? : HelmetCspDirectiveValue[],
mediaSrc? : HelmetCspDirectiveValue[],
objectSrc? : HelmetCspDirectiveValue[],
pluginTypes? : HelmetCspDirectiveValue[],
reportUri?: string,
sandbox? : HelmetCspDirectiveValue[],
scriptSrc? : HelmetCspDirectiveValue[],
styleSrc? : HelmetCspDirectiveValue[]
}
export interface IHelmetContentSecurityPolicyDirectiveFunction {
(req: express.Request, res: express.Response): string;
}
export type HelmetCspDirectiveValue = string | IHelmetContentSecurityPolicyDirectiveFunction;
interface IHelmetContentSecurityPolicyConfiguration {
reportOnly? : boolean;
setAllHeaders? : boolean;
disableAndroid? : boolean;
browserSniff?: boolean;
directives? : IHelmetContentSecurityPolicyDirectives
}
export interface IHelmetContentSecurityPolicyDirectives {
baseUri? : HelmetCspDirectiveValue[],
childSrc? : HelmetCspDirectiveValue[],
connectSrc? : HelmetCspDirectiveValue[],
defaultSrc? : HelmetCspDirectiveValue[],
fontSrc? : HelmetCspDirectiveValue[],
formAction? : HelmetCspDirectiveValue[],
frameAncestors? : HelmetCspDirectiveValue[],
frameSrc? : HelmetCspDirectiveValue[],
imgSrc? : HelmetCspDirectiveValue[],
mediaSrc? : HelmetCspDirectiveValue[],
objectSrc? : HelmetCspDirectiveValue[],
pluginTypes? : HelmetCspDirectiveValue[],
reportUri?: string,
sandbox? : HelmetCspDirectiveValue[],
scriptSrc? : HelmetCspDirectiveValue[],
styleSrc? : HelmetCspDirectiveValue[]
}
interface IHelmetDnsPrefetchControlConfiguration {
allow? : boolean;
}
export interface IHelmetContentSecurityPolicyConfiguration {
reportOnly? : boolean;
setAllHeaders? : boolean;
disableAndroid? : boolean;
browserSniff?: boolean;
directives? : IHelmetContentSecurityPolicyDirectives
}
interface IHelmetFrameguardConfiguration {
action? : string,
domain? : string
}
export interface IHelmetDnsPrefetchControlConfiguration {
allow? : boolean;
}
interface IHelmetHidePoweredByConfiguration {
setTo? : string
}
export interface IHelmetFrameguardConfiguration {
action? : string,
domain? : string
}
interface IHelmetSetIfFunction {
(req: express.Request, res: express.Response): boolean;
}
export interface IHelmetHidePoweredByConfiguration {
setTo? : string
}
interface IHelmetHpkpConfiguration {
maxAge : number;
sha256s : string[];
includeSubdomains? : boolean;
reportUri? : string;
reportOnly? : boolean;
setIf?: IHelmetSetIfFunction
}
export interface IHelmetSetIfFunction {
(req: express.Request, res: express.Response): boolean;
}
interface IHelmetHstsConfiguration {
maxAge: number;
includeSubdomains? : boolean;
preload? : boolean;
setIf? : IHelmetSetIfFunction,
force? : boolean;
}
export interface IHelmetHpkpConfiguration {
maxAge : number;
sha256s : string[];
includeSubdomains? : boolean;
reportUri? : string;
reportOnly? : boolean;
setIf?: IHelmetSetIfFunction
}
interface IHelmetXssFilterConfiguration {
setOnOldIE? : boolean;
}
export interface IHelmetHstsConfiguration {
maxAge: number;
includeSubdomains? : boolean;
preload? : boolean;
setIf? : IHelmetSetIfFunction,
force? : boolean;
}
/**
* @summary Interface for helmet class.
* @interface
*/
interface Helmet {
/**
* @summary Constructor.
* @return {RequestHandler} The Request handler.
*/
(options ?: IHelmetConfiguration): express.RequestHandler;
export interface IHelmetXssFilterConfiguration {
setOnOldIE? : boolean;
}
/**
* @summary Set policy around third-party content via headers
* @param {IHelmetContentSecurityPolicyConfiguration} options The options
* @return {RequestHandler} The Request handler
*/
contentSecurityPolicy(options ?: IHelmetContentSecurityPolicyConfiguration): express.RequestHandler;
/**
* @summary Interface for helmet class.
* @interface
*/
export interface Helmet {
/**
* @summary Constructor.
* @return {RequestHandler} The Request handler.
*/
(options ?: IHelmetConfiguration): express.RequestHandler;
/**
* @summary Stop browsers from doing DNS prefetching.
* @param {IHelmetDnsPrefetchControlConfiguration} options The options
* @return {RequestHandler} The Request handler
*/
dnsPrefetchControl(options ?: IHelmetDnsPrefetchControlConfiguration): express.RequestHandler;
/**
* @summary Set policy around third-party content via headers
* @param {IHelmetContentSecurityPolicyConfiguration} options The options
* @return {RequestHandler} The Request handler
*/
contentSecurityPolicy(options ?: IHelmetContentSecurityPolicyConfiguration): express.RequestHandler;
/**
* @summary Prevent clickjacking.
* @param {IHelmetFrameguardConfiguration} options The options
* @return {RequestHandler} The Request handler
*/
frameguard(options ?: IHelmetFrameguardConfiguration): express.RequestHandler;
/**
* @summary Stop browsers from doing DNS prefetching.
* @param {IHelmetDnsPrefetchControlConfiguration} options The options
* @return {RequestHandler} The Request handler
*/
dnsPrefetchControl(options ?: IHelmetDnsPrefetchControlConfiguration): express.RequestHandler;
/**
* @summary Hide "X-Powered-By" header.
* @param {IHelmetHidePoweredByConfiguration} options The options
* @return {RequestHandler} The Request handler.
*/
hidePoweredBy(options ?: IHelmetHidePoweredByConfiguration): express.RequestHandler;
/**
* @summary Prevent clickjacking.
* @param {IHelmetFrameguardConfiguration} options The options
* @return {RequestHandler} The Request handler
*/
frameguard(options ?: IHelmetFrameguardConfiguration): express.RequestHandler;
/**
* @summary Adds the "Public-Key-Pins" header.
* @param {IHelmetHpkpConfiguration} options The options
* @return {RequestHandler} The Request handler.
*/
hpkp(options ?: IHelmetHpkpConfiguration): express.RequestHandler;
/**
* @summary Hide "X-Powered-By" header.
* @param {IHelmetHidePoweredByConfiguration} options The options
* @return {RequestHandler} The Request handler.
*/
hidePoweredBy(options ?: IHelmetHidePoweredByConfiguration): express.RequestHandler;
/**
* @summary Adds the "Strict-Transport-Security" header.
* @param {IHelmetHstsConfiguration} options The options
* @return {RequestHandler} The Request handler.
*/
hsts(options ?: IHelmetHstsConfiguration): express.RequestHandler;
/**
* @summary Adds the "Public-Key-Pins" header.
* @param {IHelmetHpkpConfiguration} options The options
* @return {RequestHandler} The Request handler.
*/
hpkp(options ?: IHelmetHpkpConfiguration): express.RequestHandler;
/**
* @summary Add the "X-Download-Options" header.
* @return {RequestHandler} The Request handler.
*/
ieNoOpen(): express.RequestHandler;
/**
* @summary Adds the "Strict-Transport-Security" header.
* @param {IHelmetHstsConfiguration} options The options
* @return {RequestHandler} The Request handler.
*/
hsts(options ?: IHelmetHstsConfiguration): express.RequestHandler;
/**
* @summary Add the "Cache-Control" and "Pragma" headers to stop caching.
* @return {RequestHandler} The Request handler.
*/
noCache(options ?: Object): express.RequestHandler;
/**
* @summary Add the "X-Download-Options" header.
* @return {RequestHandler} The Request handler.
*/
ieNoOpen(): express.RequestHandler;
/**
* @summary Adds the "X-Content-Type-Options" header.
* @return {RequestHandler} The Request handler.
*/
noSniff(): express.RequestHandler;
/**
* @summary Add the "Cache-Control" and "Pragma" headers to stop caching.
* @return {RequestHandler} The Request handler.
*/
noCache(options ?: Object): express.RequestHandler;
/**
* @summary Mitigate cross-site scripting attacks with the "X-XSS-Protection" header.
* @param {IHelmetXssFilterConfiguration} options The options
* @return {RequestHandler} The Request handler.
*/
xssFilter(options ?: IHelmetXssFilterConfiguration): express.RequestHandler;
}
/**
* @summary Adds the "X-Content-Type-Options" header.
* @return {RequestHandler} The Request handler.
*/
noSniff(): express.RequestHandler;
var helmet: Helmet;
export = helmet;
/**
* @summary Mitigate cross-site scripting attacks with the "X-XSS-Protection" header.
* @param {IHelmetXssFilterConfiguration} options The options
* @return {RequestHandler} The Request handler.
*/
xssFilter(options ?: IHelmetXssFilterConfiguration): express.RequestHandler;
}
}
var helmet: helmet.Helmet;
export = helmet;
}
+15 -2
View File
@@ -240,7 +240,7 @@ interface HighchartsPlotBands {
* Border color for the plot band. Also requires borderWidth to be set.
* @default null
*/
borderColor?: string | HighchartsGradient;
borderColor?: Color;
/**
* Border width for the plot band. Also requires borderColor to be set.
* @default 0
@@ -249,7 +249,7 @@ interface HighchartsPlotBands {
/**
* The color of the plot band.
*/
color?: string | HighchartsGradient;
color?: Color;
/**
* An object defining mouse events for the plot band. Supported properties are click, mouseover, mouseout,
* mousemove.
@@ -1309,6 +1309,11 @@ interface HighchartsGradient {
setOpacity?(alpha: number): HighchartsGradient;
}
/**
* Type equivalent to the 'Color' type mentioned throughout the documentation.
*/
type Color = string | HighchartsGradient;
interface HighchartsChartOptions3dFrame {
/**
* The color of the panel.
@@ -3248,11 +3253,19 @@ interface HighchartsLineStates {
}
interface HighchartsBarStates {
/**
* A specific border color for the hovered point. Defaults to inherit the normal state border color.
*/
borderColor?: string | HighchartsGradient;
/**
* How much to brighten the point on interaction. Requires the main color to be defined in hex or rgb(a) format.
* @default 0.1
*/
brightness?: number;
/**
*
*/
color?: string | HighchartsGradient;
/**
* Enable separate styles for the hovered series to visualize that the user hovers either the series itself or the
* legend.
@@ -0,0 +1,21 @@
/// <reference path="../i18next/i18next"/>
/// <reference path="i18next-xhr-backend.d.ts"/>
import * as i18next from 'i18next';
import XHR from 'i18next-xhr-backend';
let options = {
loadPath: '',
addPath: '',
allowMultiLoading: false,
parse: function(data:string) { return data.replace(/a/g, ''); },
crossDomain: false,
withCredentials: false,
ajax: function (url:string, options:Object, callback: Function, data: Object) {}
};
i18next.use(XHR).init({
backend: options
});
let xhr = new XHR(null, options);
+36
View File
@@ -0,0 +1,36 @@
// Type definitions for i18next-xhr-backend 1.2.0
// Project: https://github.com/i18next/i18next-xhr-backend
// Definitions by: Jan Mühlemann <https://github.com/jamuhl>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module 'i18next-xhr-backend' {
interface Interpolator {
interpolate: () => string
}
interface Services {
interpolator: Interpolator
}
interface BackendOptions {
loadPath?: string | Function,
addPath?: string,
allowMultiLoading?: boolean,
parse?: Function,
crossDomain?: boolean,
withCredentials?: boolean,
ajax?: Function
}
export default class Backend {
type: 'backend';
services: Services;
options: BackendOptions;
constructor(services?: Services, options?: BackendOptions);
init(services?: Services, options?: BackendOptions): void;
readMulti(languages: any[], namespaces: any[], callback: Function): void;
read(language: {}, namespace: {}, callback: Function): void;
loadUrl(url: string, callback: Function): void;
create(languages: any[], namespace: string, key: string, fallbackValue: string): void;
}
}
+85
View File
@@ -0,0 +1,85 @@
/// <reference path="./imap-simple.d.ts" />
import * as imaps from "imap-simple";
let config = {
imap: {
user: "your@email.address",
password: "yourpassword",
host: "imap.gmail.com",
port: 993,
tls: true,
authTimeout: 3000
}
};
imaps.connect(config).then(function (connection) {
return connection.openBox("INBOX").then(function () {
let searchCriteria = [
"UNSEEN"
];
let fetchOptions = {
bodies: ["HEADER", "TEXT"],
markSeen: false
};
return connection.search(searchCriteria, fetchOptions).then(function (results) {
let subjects = results.map(function (res) {
return res.parts.filter(function (part) {
return part.which === "HEADER";
})[0].body.subject[0];
});
console.log(subjects);
// =>
// [ "Hey Chad, long time no see!",
// "Your amazon.com monthly statement",
// "Hacker Newsletter Issue #445" ]
});
});
});
imaps.connect(config).then(function (connection) {
connection.openBox("INBOX").then(function () {
// Fetch emails from the last 24h
let delay = 24 * 3600 * 1000;
let yesterday = new Date();
yesterday.setTime(Date.now() - delay);
let yesterdayString = yesterday.toISOString();
let searchCriteria = ["UNSEEN", ["SINCE", yesterdayString]];
let fetchOptions = { bodies: ["HEADER.FIELDS (FROM TO SUBJECT DATE)"], struct: true };
// retrieve only the headers of the messages
return connection.search(searchCriteria, fetchOptions);
}).then(function (messages) {
let attachments: Promise<{filename: string, data: any}>[] = [];
messages.forEach(function (message) {
let parts = imaps.getParts(message.attributes.struct);
attachments = attachments.concat(parts.filter(function (part) {
return part.disposition && part.disposition.type === "ATTACHMENT";
}).map(function (part) {
// retrieve the attachments only of the messages with attachments
return connection.getPartData(message, part)
.then(function (partData) {
return {
filename: part.disposition.params.filename,
data: partData
};
});
}));
});
return Promise.all<{filename: string, data: any}>(attachments);
}).then(function (attachments: {filename: string, data: any}[]) {
console.log(attachments);
// =>
// [ { filename: "cats.jpg", data: Buffer() },
// { filename: "pay-stub.pdf", data: Buffer() } ]
});
});
+75
View File
@@ -0,0 +1,75 @@
// Type definitions for imap-simple v1.6.3
// Project: https://github.com/chadxz/imap-simple
// Definitions by: Jeffery Grajkowski <https://github.com/pushplay/>
// Definitions: https://github.com/psnider/DefinitelyTyped/imap-simple
/// <reference path="../imap/imap.d.ts" />
declare namespace IMAPS {
export interface ImapSimpleOptions {
/** Options to pass to node-imap constructor. */
imap: IMAP.Config;
/** Time in milliseconds to wait before giving up on a connection attempt. (Deprecated: please use options.imap.authTimeout instead) */
connectTimeout?: number;
}
export interface MessageBodyPart extends IMAP.ImapMessageBodyInfo {
/** string type where which=='TEXT', complex Object where which=='HEADER' */
body: any;
}
export interface Message {
attributes: IMAP.ImapMessageAttributes;
parts: MessageBodyPart[];
}
export class ImapSimple {
constructor(imap: IMAP.Connection);
/** Open a mailbox, calling the provided callback with signature (err, boxName), or resolves the returned promise with boxName. */
openBox(boxName: string, callback: (err: Error, boxName: string) => void): void;
openBox(boxName: string): Promise<string>;
/** Search for and retrieve mail in the previously opened mailbox. */
search(searchCriteria: any[], fetchOptions: IMAP.FetchOptions, callback: (err: Error, messages: Message[]) => void): void;
search(searchCriteria: any[], fetchOptions: IMAP.FetchOptions): Promise<Message[]>;
/** Close the connection to the imap server. */
end(): void;
/** Downloads part data (which is either part of the message body, or an attachment). Upon success, either the provided callback will be called with signature (err, data), or the returned promise will be resolved with data. The data will be automatically decoded based on its encoding. If the encoding of the part is not supported, an error will occur. */
getPartData(message: Message, part: any, callback: (err: Error, data: any) => void): void;
getPartData(message: Message, part: any): Promise<any>;
/** Adds the provided label(s) to the specified message(s). source corresponds to a node-imap MessageSource which specifies the messages to be moved. label is either a string or array of strings indicating the labels to add. When completed, either calls the provided callback with signature (err), or resolves the returned promise. */
addMessageLabel(source: string | string[], label: string | string[], callback: (err: Error) => void): void;
addMessageLabel(source: string | string[], label: string | string[]): Promise<void>;
/** Moves the specified message(s) in the currently open mailbox to another mailbox. source corresponds to a node-imap MessageSource which specifies the messages to be moved. When completed, either calls the provided callback with signature (err), or resolves the returned promise. */
moveMessage(source: string | string[], boxName: string, callback: (err: Error) => void): void;
moveMessage(source: string | string[], boxName: string): Promise<void>;
}
/** Error thrown when a connection attempt has timed out. */
export class ConnectionTimeoutError extends Error {
timeout: number;
constructor(timeout: number);
}
}
declare module "imap-simple" {
/** Main entry point. Connect to an Imap server. */
export function connect(options: IMAPS.ImapSimpleOptions, callback: (err: Error, connection: IMAPS.ImapSimple) => void): void;
export function connect(options: IMAPS.ImapSimpleOptions): Promise<IMAPS.ImapSimple>;
export namespace errors {
export import ConnectionTimeoutError = IMAPS.ConnectionTimeoutError;
}
export import ImapSimple = IMAPS.ImapSimple;
/** Given the message.attributes.struct, retrieve a flattened array of parts objects that describe the structure of the different parts of the message's body. Useful for getting a simple list to iterate for the purposes of, for example, finding all attachments. */
export function getParts(struct: any[]): any[];
}
+1
View File
@@ -19,3 +19,4 @@ var buff:any = ip.toBuffer(myIP);
ip.toString(buff);
ip.subnet('192.168.1.134', '255.255.255.192');
ip.cidrSubnet('192.168.1.134/26');
ip.cidrSubnet('192.168.1.134/26').contains('192.168.1.134');
Vendored
+2 -1
View File
@@ -14,6 +14,7 @@ interface SubnetInfo {
subnetMaskLength: number;
numHosts: number;
length: number;
contains(ip: string): boolean;
}
declare module "ip" {
@@ -112,4 +113,4 @@ declare module "ip" {
* @param cidr CIDR address.
*/
export function cidrSubnet(cidr: string): SubnetInfo;
}
}
@@ -311,6 +311,9 @@ $(document).ready(function () {
var initSettings = dt.init();
var i18n: string = dt.i18n('buttons.copy', 'Copy to clipboard');
i18n = dt.i18n('select.rows', { _: '%d rows selected', 1: '1 row selected' }, 0);
var off = dt.off("event");
off = dt.off("event", function () { });
off.$("");
@@ -901,5 +904,7 @@ $(document).ready(function () {
//#region "Methods-Util"
var util_1: boolean = dt.any();
//#endregion "Methods-Util"
});
+17 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for JQuery DataTables 1.10.6
// Type definitions for JQuery DataTables 1.10.7
// Project: http://www.datatables.net
// Definitions by: Kiarash Ghiaseddin <https://github.com/Silver-Connection/DefinitelyTyped>, Omid Rad <https://github.com/omidkrad>, Armin Sander <https://github.com/pragmatrix/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -188,6 +188,17 @@ declare namespace DataTables {
*/
draw(reset?: boolean): DataTable;
/*
* Look up a language token that was defined in the DataTables' language initialisation object.
*
* @param token The language token to lookup from the language object.
* @param def The default value to use if the DataTables initialisation has not specified a value.
* @param numeric If handling numeric output, the number to be presented should be given in this parameter. If not numeric operator is required (for example button label text) this parameter is not required.
*
* @returns Resulting internationalised string.
*/
i18n(token: string, def: any | string, numeric?: number): string;
/*
* Get the initialisation options used for the table. Since: DataTables 1.10.6
*/
@@ -412,6 +423,11 @@ declare namespace DataTables {
//#region "util-methods"
interface UtilityMethods {
/*
* Get a boolean value to indicate if there are any entries in the API instance's result set (i.e. any data, selected rows, etc).
*/
any(): boolean;
/**
* Concatenate two or more API instances together
*
+2 -2
View File
@@ -223,7 +223,7 @@ function test_pnotify() {
});
var type = "error";
var stack_bottomright = {"dir1": "up", "dir2": "left", "firstpos1": 25, "firstpos2": 25};
var stack_bottomright = { "dir1": "up", "dir2": "left", "firstpos1": 25, "firstpos2": 25 };
var opts = {
title: "Over Here",
@@ -233,8 +233,8 @@ function test_pnotify() {
width: "100%",
stack: stack_bottomright,
type: "error"
} as PNotifyOptions;
};
new PNotify(opts);
new PNotify({
+6 -8
View File
@@ -4,11 +4,9 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts"/>
// could not pass the Travis Test if enabled
//type NoticeTypeOptions = "notice" | "info" | "success" | "error";
//type StylingOptions = "brighttheme" | "jqueryui" | "bootstrap2" | "bootstrap3" | "fontawesome";
//type StateOptions = "initializing" | "opening" | "open" | "closing" | "closed";
type NoticeTypeOptions = "notice" | "info" | "success" | "error";
type StylingOptions = "brighttheme" | "jqueryui" | "bootstrap2" | "bootstrap3" | "fontawesome";
type StateOptions = "initializing" | "opening" | "open" | "closing" | "closed";
interface PNotifyStack {
dir1?: string;
@@ -137,7 +135,7 @@ interface PNotifyOptions {
/**
* What styling classes to use. (Can be either "brighttheme", "jqueryui", "bootstrap2", "bootstrap3", or "fontawesome".)
*/
styling?: string;
styling?: StylingOptions;
/**
* Additional classes to be added to the notice. (For custom styling.)
*/
@@ -182,7 +180,7 @@ interface PNotifyOptions {
/**
* Type of the notice. "notice", "info", "success", or "error".
*/
type?: string;
type?: NoticeTypeOptions;
/**
* Set icon to true to use the default icon for the selected style/type, false for no icon, or a string for your own icon class.
*/
@@ -263,7 +261,7 @@ interface PNotify {
/**
* The state can be "initializing", "opening", "open", "closing", and "closed"
*/
state?: string;
state?: StateOptions;
/**
* This function is for updating the notice.

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