Merge remote-tracking branch 'upstream/master'

This commit is contained in:
MoLow
2016-10-10 17:33:59 +03:00
225 changed files with 103094 additions and 130367 deletions
+4 -3
View File
@@ -8,10 +8,11 @@ interface HeadroomOptions {
tolerance?: any;
classes?: {
initial?: string;
pinned?: string;
unpinned?: string;
top?: string;
notBottom?:string;
notTop?: string;
pinned?: string;
top?: string;
unpinned?: string;
};
scroller?: Element;
onPin?: () => void;
+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;
}
@@ -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 {
/**
+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;
}
}
+1
View File
@@ -137,6 +137,7 @@ declare module "apn" {
}
export interface NotificationAlertOptions {
title?:string;
subtitle?:string;
body:string;
"title-loc-key"?:string;
"title-loc-args"?:string[];
+64
View File
@@ -0,0 +1,64 @@
/// <reference path="async-polling.d.ts" />
import * as AsyncPolling from "async-polling";
// Tests based on examples in https://github.com/cGuille/async-polling#readme
AsyncPolling(end => {
end();
}, 3000).run();
function someAsynchroneProcess(callback: (error?: Error, response?: any) => any): any {
callback();
}
let polling = AsyncPolling(end => {
someAsynchroneProcess(function (error, response) {
if (error) {
end(error);
return;
}
end(null, response);
});
}, 3000);
polling.on("error", (error: Error) => {});
polling.on("result", (result: any) => {});
polling.run();
polling.stop();
AsyncPolling(function(end) {
this.stop();
end();
}, 3000).run();
let i = 0;
polling = AsyncPolling(function(end) {
++i;
if (i === 3) {
return end(new Error("i is " + i));
}
if (i >= 5) {
this.stop();
return end(null, `#${i} stop`);
}
end(null, `#${i} wait a second...`);
}, 1000);
const eventNames: AsyncPolling.EventName[] = ["run", "start", "end", "schedule", "stop"];
eventNames.forEach(eventName => {
polling.on(eventName, () => {
console.log("lifecycle:", eventName);
});
});
polling.on("result", (result: any) => {
console.log("result:", result);
});
polling.on("error", (error: Error) => {
console.error("error:", error);
});
polling.run();
+18
View File
@@ -0,0 +1,18 @@
// Type definitions for AsyncPolling
// Project: https://github.com/cGuille/async-polling
// Definitions by: Zlatko Andonovski <https://github.com/Goldsmith42/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module "async-polling" {
module AsyncPolling {
export type EventName = "run"|"start"|"error"|"result"|"end"|"schedule"|"stop";
}
function AsyncPolling<Result>(pollingFunc: (end: (err?: Error, result?: Result) => any) => any, delay: number): {
run: () => any;
stop: () => any;
on: (eventName: AsyncPolling.EventName, listener: Function) => any;
}
export = AsyncPolling;
}
+1 -1
View File
@@ -346,7 +346,7 @@ declare module "babel-traverse" {
getData(key: string, def?: any): any;
buildCodeFrameError(msg: string, Error: Error): Error;
buildCodeFrameError<TError extends Error>(msg: string, Error?: new (msg: string) => TError): TError;
traverse(visitor: Visitor, state?: any): void;
+1
View File
@@ -36,6 +36,7 @@ interface DatepickerOptions {
multidateSeparator?: string;
orientation?: string;
assumeNearbyYear?: any;
viewMode?: string;
}
interface DatepickerCustomFormatOptions {
+5 -2
View File
@@ -36,7 +36,10 @@ interface NotifySettings {
from?: string;
align?: string;
};
offset?: number;
offset?: number | {
x?: number;
y?: number;
};
spacing?: number;
z_index?: number;
delay?: number;
@@ -59,4 +62,4 @@ interface NotifyReturn {
$ele: JQueryStatic;
close: () => void;
update: (command: string, update: any) => void;
}
}
+12
View File
@@ -0,0 +1,12 @@
// Type definitions for Bootstrap Table v1.11.0
// Project: http://bootstrap-table.wenzhixin.net.cn/
// Definitions by: Talat Baig <https://github.com/talatbaig/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts" />
interface JQuery {
bootstrapTable(options?: any): JQuery;
}
declare var bootstrapTable: JQueryStatic;
+2 -1
View File
@@ -50,7 +50,8 @@ braintree.client.create({
selector: '#card-number'
},
cvv: {
selector: '#cvv'
selector: '#cvv',
type: 'password'
},
expirationDate: {
selector: '#expiration-date'
+3 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for Braintree-web v3.0.2
// Type definitions for Braintree-web v3.3.0
// Project: https://github.com/braintree/braintree-web
// Definitions by: Guy Shahine <https://github.com/chlela>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -540,11 +540,13 @@ declare namespace BraintreeWeb {
* @typedef {object} field
* @property {string} selector A CSS selector to find the container where the hosted field will be inserted.
* @property {string} [placeholder] Will be used as the `placeholder` attribute of the input. If `placeholder` is not natively supported by the browser, it will be polyfilled.
* @property {string} [type] Will be used as the `type` attribute of the input. To mask `cvv` input, for instance, `type: "password"` can be used.
* @property {boolean} [formatInput=true] - Enable or disable automatic formatting on this field. Note: Input formatting does not work properly on Android and iOS, so input formatting is automatically disabled on those browsers.
*/
interface HostedFieldsField {
selector: string;
placeholder?: string;
type?: string;
formatInput?: boolean;
}
+2 -2
View File
@@ -1,4 +1,4 @@
// Type definitions for bull 0.7.0
// Type definitions for bull 1.0.0
// Project: https://github.com/OptimalBits/bull
// Definitions by: Bruno Grieder <https://github.com/bgrieder>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -24,7 +24,7 @@ declare module "bull" {
export interface Job {
id: string
jobId: string
/**
* The custom data passed when the job was created
+41
View File
@@ -0,0 +1,41 @@
/// <reference path="bunyan-config.d.ts"/>
import * as bunyan from "bunyan";
import bunyanConfig = require("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 = bunyanConfig;
}
+4 -3
View File
@@ -7,8 +7,9 @@
import fs = require( 'fs' );
import byline = require( 'byline' );
//TODO can this be typed in an ambient way?
//var stream = byline( fs.createReadStream( 'sample.txt', {encoding: 'utf8'} ) );
var stream = byline();
var stream = byline( fs.createReadStream( 'sample.txt', {encoding: 'utf8'} ) );
var stream = byline.createStream( fs.createReadStream( 'sample.txt', {encoding: 'utf8'} ) );
@@ -44,4 +45,4 @@ var output = fs.createWriteStream('nolines.txt');
var lineStream:byline.LineStream = new LineStream();
input.pipe(lineStream);
lineStream.pipe(output);
lineStream.pipe(output);
+21 -25
View File
@@ -8,31 +8,27 @@
declare module "byline" {
import stream = require("stream");
export interface LineStreamOptions extends stream.TransformOptions {
keepEmptyLines?: boolean;
function bl(): bl.LineStream;
function bl(stream: NodeJS.ReadableStream, options?: bl.LineStreamOptions): bl.LineStream;
namespace bl {
export interface LineStreamOptions extends stream.TransformOptions {
keepEmptyLines?: boolean;
}
export interface LineStream extends stream.Transform {
}
export interface LineStreamCreatable extends LineStream {
new (options?: LineStreamOptions): LineStream
}
export function createStream(): LineStream;
export function createStream(stream: NodeJS.ReadableStream, options?: LineStreamOptions): LineStream;
export var LineStream: LineStreamCreatable;
}
export interface LineStream extends stream.Transform {
}
export interface LineStreamCreatable extends LineStream {
new (options?:LineStreamOptions):LineStream
}
//TODO is it possible to declare static factory functions without name (directly on the module)
//
// JS:
// // convinience API
// module.exports = function(readStream, options) {
// return module.exports.createStream(readStream, options);
// };
//
// TS:
// ():LineStream; // same as createStream():LineStream
// (stream:stream.Stream, options?:LineStreamOptions):LineStream; // same as createStream(stream, options?):LineStream
export function createStream():LineStream;
export function createStream(stream:NodeJS.ReadableStream, options?:LineStreamOptions):LineStream;
export var LineStream:LineStreamCreatable;
export = bl;
}
+68 -43
View File
@@ -7,19 +7,20 @@
declare class CamlBuilder {
constructor();
/** Generate CAML Query, starting from <Where> tag */
public Where(): CamlBuilder.IFieldExpression;
Where(): CamlBuilder.IFieldExpression;
/** Generate <View> tag for SP.CamlQuery
@param viewFields If omitted, default view fields are requested; otherwise, only values for the fields with the specified internal names are returned.
Specifying view fields is a good practice, as it decreases traffic between server and client. */
public View(viewFields?: string[]): CamlBuilder.IView;
@param viewFields If omitted, default view fields are requested; otherwise, only values for the fields with the specified internal names are returned.
Specifying view fields is a good practice, as it decreases traffic between server and client. */
View(viewFields?: string[]): CamlBuilder.IView;
/** Generate <ViewFields> tag for SPServices */
public ViewFields(viewFields: string[]): CamlBuilder.IFinalizableToString;
ViewFields(viewFields: string[]): CamlBuilder.IFinalizableToString;
/** Use for:
1. SPServices CAMLQuery attribute
2. Creating partial expressions
3. In conjunction with Any & All clauses
*/
1. SPServices CAMLQuery attribute
2. Creating partial expressions
3. In conjunction with Any & All clauses
*/
static Expression(): CamlBuilder.IFieldExpression;
static FromXml(xml: string): CamlBuilder.IRawQuery;
}
declare namespace CamlBuilder {
interface IView extends IJoinable, IFinalizable {
@@ -29,24 +30,24 @@ declare namespace CamlBuilder {
}
interface IJoinable {
/** Join the list you're querying with another list.
Joins are only allowed through a lookup field relation.
@param lookupFieldInternalName Internal name of the lookup field, that points to the list you're going to join in.
@alias alias for the joined list */
Joins are only allowed through a lookup field relation.
@param lookupFieldInternalName Internal name of the lookup field, that points to the list you're going to join in.
@alias alias for the joined list */
InnerJoin(lookupFieldInternalName: string, alias: string): IJoin;
/** Join the list you're querying with another list.
Joins are only allowed through a lookup field relation.
@param lookupFieldInternalName Internal name of the lookup field, that points to the list you're going to join in.
@alias alias for the joined list */
Joins are only allowed through a lookup field relation.
@param lookupFieldInternalName Internal name of the lookup field, that points to the list you're going to join in.
@alias alias for the joined list */
LeftJoin(lookupFieldInternalName: string, alias: string): IJoin;
}
interface IJoin extends IJoinable {
/** Select projected field for using in the main Query body
@param remoteFieldAlias By this alias, the field can be used in the main Query body. */
@param remoteFieldAlias By this alias, the field can be used in the main Query body. */
Select(remoteFieldInternalName: string, remoteFieldAlias: string): IProjectableView;
}
interface IProjectableView extends IView {
/** Select projected field for using in the main Query body
@param remoteFieldAlias By this alias, the field can be used in the main Query body. */
@param remoteFieldAlias By this alias, the field can be used in the main Query body. */
Select(remoteFieldInternalName: string, remoteFieldAlias: string): IProjectableView;
}
enum ViewScope {
@@ -57,7 +58,7 @@ declare namespace CamlBuilder {
/** */
FilesOnly = 2,
}
interface IQuery {
interface IQuery extends IGroupable {
Where(): IFieldExpression;
}
interface IFinalizableToString {
@@ -70,21 +71,21 @@ declare namespace CamlBuilder {
}
interface ISortable extends IFinalizable {
/** Adds OrderBy clause to the query
@param fieldInternalName Internal field of the first field by that the data will be sorted (ascending)
@param override This is only necessary for large lists. DON'T use it unless you know what it is for!
@param useIndexForOrderBy This is only necessary for large lists. DON'T use it unless you know what it is for!
@param fieldInternalName Internal field of the first field by that the data will be sorted (ascending)
@param override This is only necessary for large lists. DON'T use it unless you know what it is for!
@param useIndexForOrderBy This is only necessary for large lists. DON'T use it unless you know what it is for!
*/
OrderBy(fieldInternalName: string, override?: boolean, useIndexForOrderBy?: boolean): ISortedQuery;
/** Adds OrderBy clause to the query (using descending order for the first field).
@param fieldInternalName Internal field of the first field by that the data will be sorted (descending)
@param override This is only necessary for large lists. DON'T use it unless you know what it is for!
@param useIndexForOrderBy This is only necessary for large lists. DON'T use it unless you know what it is for!
@param fieldInternalName Internal field of the first field by that the data will be sorted (descending)
@param override This is only necessary for large lists. DON'T use it unless you know what it is for!
@param useIndexForOrderBy This is only necessary for large lists. DON'T use it unless you know what it is for!
*/
OrderByDesc(fieldInternalName: string, override?: boolean, useIndexForOrderBy?: boolean): ISortedQuery;
}
interface IGroupable extends ISortable {
/** Adds GroupBy clause to the query.
@param collapse If true, only information about the groups is retrieved, otherwise items are also retrieved. */
@param collapse If true, only information about the groups is retrieved, otherwise items are also retrieved. */
GroupBy(fieldInternalName: any): IGroupedQuery;
}
interface IExpression extends IGroupable {
@@ -134,17 +135,19 @@ declare namespace CamlBuilder {
DateField(internalName: string): IDateTimeFieldExpression;
/** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is DateTime */
DateTimeField(internalName: string): IDateTimeFieldExpression;
/** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is ModStat (moderation status) */
ModStatField(internalName: string): IModStatFieldExpression;
/** Used in queries for retrieving recurring calendar events.
NOTICE: DateRangesOverlap with overlapType other than Now cannot be used with SP.CamlQuery, because it doesn't support
CalendarDate and ExpandRecurrence query options. Lists.asmx, however, supports them, so you can still use DateRangesOverlap
with SPServices.
@param overlapType Defines type of overlap: return all events for a day, for a week, for a month or for a year
@param calendarDate Defines date that will be used for determining events for which exactly day/week/month/year will be returned.
This value is ignored for overlapType=Now, but for the other overlap types it is mandatory.
@param eventDateField Internal name of "Start Time" field (default: "EventDate" - all OOTB Calendar lists use this name)
@param endDateField Internal name of "End Time" field (default: "EndDate" - all OOTB Calendar lists use this name)
@param recurrenceIDField Internal name of "Recurrence ID" field (default: "RecurrenceID" - all OOTB Calendar lists use this name)
*/
NOTICE: DateRangesOverlap with overlapType other than Now cannot be used with SP.CamlQuery, because it doesn't support
CalendarDate and ExpandRecurrence query options. Lists.asmx, however, supports them, so you can still use DateRangesOverlap
with SPServices.
@param overlapType Defines type of overlap: return all events for a day, for a week, for a month or for a year
@param calendarDate Defines date that will be used for determining events for which exactly day/week/month/year will be returned.
This value is ignored for overlapType=Now, but for the other overlap types it is mandatory.
@param eventDateField Internal name of "Start Time" field (default: "EventDate" - all OOTB Calendar lists use this name)
@param endDateField Internal name of "End Time" field (default: "EndDate" - all OOTB Calendar lists use this name)
@param recurrenceIDField Internal name of "Recurrence ID" field (default: "RecurrenceID" - all OOTB Calendar lists use this name)
*/
DateRangesOverlap(overlapType: DateRangesOverlapType, calendarDate: string, eventDateField?: string, endDateField?: string, recurrenceIDField?: string): IExpression;
}
interface IBooleanFieldExpression {
@@ -201,25 +204,25 @@ declare namespace CamlBuilder {
/** Checks whether the value of the field is equal to one of the specified values */
In(arrayOfValues: Date[]): IExpression;
/** Checks whether the value of the field is equal to the specified value.
The datetime value should be defined in ISO 8601 format! */
The datetime value should be defined in ISO 8601 format! */
EqualTo(value: string): IExpression;
/** Checks whether the value of the field is not equal to the specified value.
The datetime value should be defined in ISO 8601 format! */
The datetime value should be defined in ISO 8601 format! */
NotEqualTo(value: string): IExpression;
/** Checks whether the value of the field is greater than the specified value.
The datetime value should be defined in ISO 8601 format! */
The datetime value should be defined in ISO 8601 format! */
GreaterThan(value: string): IExpression;
/** Checks whether the value of the field is less than the specified value.
The datetime value should be defined in ISO 8601 format! */
The datetime value should be defined in ISO 8601 format! */
LessThan(value: string): IExpression;
/** Checks whether the value of the field is greater than or equal to the specified value.
The datetime value should be defined in ISO 8601 format! */
The datetime value should be defined in ISO 8601 format! */
GreaterThanOrEqualTo(value: string): IExpression;
/** Checks whether the value of the field is less than or equal to the specified value.
The datetime value should be defined in ISO 8601 format! */
The datetime value should be defined in ISO 8601 format! */
LessThanOrEqualTo(value: string): IExpression;
/** Checks whether the value of the field is equal to one of the specified values.
The datetime value should be defined in ISO 8601 format! */
The datetime value should be defined in ISO 8601 format! */
In(arrayOfValues: string[]): IExpression;
}
interface ITextFieldExpression {
@@ -322,6 +325,27 @@ declare namespace CamlBuilder {
/** DEPRECATED: "Neq" operation in CAML works exactly the same as "NotIncludes". To avoid confusion, please use NotIncludes. */
NotEqualTo(value: any): IExpression;
}
interface IModStatFieldExpression {
/** Represents moderation status ID. */
ModStatId(): INumberFieldExpression;
/** Checks whether the value of the field is Approved - same as ModStatId.EqualTo(0) */
IsApproved(): IExpression;
/** Checks whether the value of the field is Rejected - same as ModStatId.EqualTo(1) */
IsRejected(): IExpression;
/** Checks whether the value of the field is Pending - same as ModStatId.EqualTo(2) */
IsPending(): IExpression;
/** Represents moderation status as localized text. In most cases it is better to use ModStatId in the queries instead of ValueAsText. */
ValueAsText(): ITextFieldExpression;
}
interface IRawQuery {
/** Change Where clause */
ReplaceWhere(): IFieldExpression;
ModifyWhere(): IRawQueryModify;
}
interface IRawQueryModify {
AppendOr(): IFieldExpression;
AppendAnd(): IFieldExpression;
}
enum DateRangesOverlapType {
/** Returns events for today */
Now = 0,
@@ -330,7 +354,7 @@ declare namespace CamlBuilder {
/** Returns events for one week, specified by CalendarDate in QueryOptions */
Week = 2,
/** Returns events for one month, specified by CalendarDate in QueryOptions.
Caution: usually also returns few days from previous and next months */
Caution: usually also returns few days from previous and next months */
Month = 3,
/** Returns events for one year, specified by CalendarDate in QueryOptions */
Year = 4,
@@ -340,6 +364,7 @@ declare namespace CamlBuilder {
static createViewFields(viewFields: string[]): IFinalizableToString;
static createWhere(): IFieldExpression;
static createExpression(): IFieldExpression;
static createRawQuery(xml: string): IRawQuery;
}
class CamlValues {
/** Dynamic value that represents Id of the current user */
+3 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for canvas-gauges
// Type definitions for canvas-gauges v2.0.8
// Project: https://github.com/Mikhus/canvas-gauges
// Definitions by: Mikhus <https://github.com/Mikhus>
// Definitions: https://github.com/Mikhus/DefinitelyTyped
@@ -78,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,
+30 -14
View File
@@ -376,7 +376,7 @@ declare namespace CanvasJS {
dataSeriesIndex: number;
}
interface ChartAxisXOptions {
interface ChartAxisOptions {
/**
* Sets the Axis Title.
* Default: null
@@ -472,18 +472,6 @@ declare namespace CanvasJS {
*/
valueFormatString?: string;
/**
* Sets the minimum value of Axis. Values smaller than minimum are clipped.
* Default: Automatically Calculated based on the data
* Example: 100, 350..
*/
minimum?: number;
/**
* Sets the maximum value permitted on Axis. Values greater than maximum are clipped.
* Default: Automatically Calculated based on the data
* Example: 100, 350..
*/
maximum?: number;
/**
* Sets the distance between Tick Marks, Grid Lines and Interlaced Colors.
* Default: Automatically Calculated
* Example: 50, 75..
@@ -638,13 +626,41 @@ declare namespace CanvasJS {
labelFontStyle?: string;
}
interface ChartAxisYOptions extends ChartAxisXOptions {
interface ChartAxisXOptions extends ChartAxisOptions {
/**
* Sets the minimum value of Axis. Values smaller than minimum are clipped.
* Default: Automatically Calculated based on the data
* Example: 100, 350..
*/
minimum?: number | Date;
/**
* Sets the maximum value permitted on Axis. Values greater than maximum are clipped.
* Default: Automatically Calculated based on the data
* Example: 100, 350..
*/
maximum?: number | Date;
}
interface ChartAxisYOptions extends ChartAxisOptions {
/**
* When includeZero is set to true, axisY sets the range in such a way that Zero is a part of it. It is set to true by default. But, whenever y values are very big and difference among dataPoints are hard to judge, setting includeZero to false makes axisY to set a range that makes the differences prominently visible.
* Default: true
* Example: true, false
*/
includeZero?: boolean;
/**
* Sets the minimum value of Axis. Values smaller than minimum are clipped.
* Default: Automatically Calculated based on the data
* Example: 100, 350..
*/
minimum?: number;
/**
* Sets the maximum value permitted on Axis. Values greater than maximum are clipped.
* Default: Automatically Calculated based on the data
* Example: 100, 350..
*/
maximum?: number;
}
interface ChartToolTipOptions {
+495
View File
@@ -0,0 +1,495 @@
// Type definitions for Cash
// Project: https://github.com/kenwheeler/cash
// Definitions by: Ashok Vishwakarma <https://github.com/akvlko>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/**
* OffsetType
* return type for cash.offset(), cash.position()
*/
interface OffsetType {
top: number;
left: number;
}
/**
* CashStatic
* Static declaration for CashJs accessible directly using Cash object or $
*/
interface CashStatic {
/**
* isArray
* Check if the argument is an array.
* @type method
* @argument any
* @return boolean
*/
isArray(n: any): boolean;
/**
* isFunction
* Check if the argument is a function.
* @type method
* @argument any
* @return boolean
*/
isFunction(n: any): boolean;
/**
* isNumeric
* Check if the argument is numeric.
* @type method
* @type method
* @argument any
* @return boolean
*/
isNumeric(n: any): boolean;
/**
* isString
* Check if the argument is a string.
* @type method
* @argument str any
* @return boolean
*/
isString(str: any): boolean;
/**
* extend
* Extends target object with properties from the source object. If no target is provided, cash itself will be extended.
* @type method
* @argument target any, source any
*/
extend(target: any, source: any): any;
/**
* matches
* Checks a selector against an element, returning a boolean value for match.
* @type method
* @argument element Cash, selector string
* @return boolean
*/
matches(element: Cash, selector: string): boolean;
/**
* parseHTML
* Returns a collection from an HTML string.
* @type method
* @argument htmlString string
* @return Cash
*/
parseHTML(htmlString: string): Cash;
/**
* each
* Iterates through a collection and calls the callback method on each.
* @type method
* @argument collection Array, callback Function
* @return Array
*/
each(collection: Array<any>, callback: Function): Array<any>;
/**
* fn: use to extend cash for plugin development
* @type property
*/
fn: any;
/**
* selector declaration for Cash to use $(<argument>)
*/
(selector: string, context?: Element|Cash): Cash;
(element: Element): Cash;
(elementArray: Element[]): Cash;
}
/**
* Cash
* Interface for CashJs
* Refer https://github.com/kenwheeler/cash for documentation and uses of the methods and properties
*/
interface Cash {
/**
* add
* Returns a new collection with the element(s) added to the end.
*/
add(selector: string|Cash|Element, context?: Element): Cash;
/**
* addClass
* Adds the className argument to collection elements.
*/
addClass(c: string): Cash;
/**
* after
* Inserts content or elements after the collection.
*/
after(selector: Element|String): Cash;
/**
* append
* Appends the target element to the each element in the collection.
*/
append(content: string|Element|Cash): Cash;
/**
* appendTo
* Adds the elements in a collection to the target element(s).
*/
appendTo(parent: string|Element|Cash): Cash;
/**
* attr
* Without attrValue, returns the attribute value of the first element in the collection.
* With attrValue, sets the attribute value of each element of the collection.
*/
attr(name: string): any;
attr(name: string, value: string): Cash;
/**
* before
* Inserts content or elements before the collection.
*/
before(selector: string|Element): Cash;
/**
* children
* Without a selector specified, returns a collection of child elements.
* With a selector, returns child elements that match the selector.
*/
children(selector?: string): Cash;
/**
* closest
* Returns the closest matching selector up the DOM tree.
*/
closest(selector?: string): Cash;
/**
* clone
* Returns a clone of the collection.
*/
clone(): Cash;
/**
* css
* Returns a CSS property value when just property is supplied.
* Sets a CSS property when property and value are supplied, and set multiple properties when an object is supplied.
* Properties will be autoprefixed if needed for the user's browser.
*/
css(prop: any): any;
css(prop: string, value: any): Cash;
/**
* data
* Link some data (string, object, array, etc.) to an element when both key and value are supplied.
* If only a key is supplied, returns the linked data and falls back to data attribute value if no data is already linked.
* Multiple data can be set when an object is supplied.
*/
data(name: any): any;
data(name: string, value: any): Cash;
/**
* each
* Iterates over a collection with callback(value, index, array).
*/
each(callback: Function): Cash;
/**
* empty
* Empties an elements interior markup.
*/
empty(): Cash;
/**
* eq
* Returns a collection with the element at index.
*/
eq(index: number): Cash;
/**
* extend
* Adds properties to the cash collection prototype.
*/
extend(target: any): any;
/**
* filter
* Returns the collection that results from applying the filter method.
*/
filter(selector: Function): Cash;
/**
* find
* Returns selector match descendants from the first element in the collection.
*/
find(selector: string): Cash;
/**
* first
* Returns the first element in the collection.
*/
first(): Cash;
/**
* get
* Returns the element at the index.
*/
get(index: number): HTMLElement;
/**
* has
* Returns boolean result of the selector argument against the collection.
*/
has(selector: string): boolean;
/**
* hasClass
* Returns the boolean result of checking if the first element in the collection has the className attribute.
*/
hasClass(c: string): boolean;
/**
* height
* Returns the height of the element.
*/
height(): number;
/**
* html
* Returns the HTML text of the first element in the collection, sets the HTML if provided.
*/
html(): string;
html(content: string): Cash;
/**
* index
* Returns the index of the element in its parent if an element or selector isn't provided.
* Returns index within element or selector if it is.
*/
index(elem?: Element): number;
/**
* innerHeight
* Returns the height of the element + padding.
*/
innerHeight(): number;
/**
* innerWidth
* Returns the width of the element + padding.
*/
innerWidth(): number;
/**
* insertAfter
* Inserts collection after specified element.
*/
insertAfter(selector: string|Element|Cash): Cash;
/**
* insertBefore
* Inserts collection before specified element.
*/
insertBefore(selector: string|Element|Cash): Cash;
/**
* is
* Returns whether the provided selector, element or collection matches any element in the collection.
*/
is(selector: string|Element|Cash): boolean;
/**
* last
* Returns last element in the collection.
*/
last(): Cash;
/**
* next
* Returns next sibling.
*/
next(): Cash;
/**
* not
* Filters collection by false match on selector.
*/
not(selector: string|Element|Cash): Cash;
/**
* off
* Removes event listener from collection elements.
*/
off(eventName: string, callback: Function): Cash;
/**
* offset
* Get the coordinates of the first element in a collection relative to the document.
*/
offset(): OffsetType;
/**
* offsetParent
* Get the first element's ancestor that's positioned.
*/
offsetParent(): OffsetType;
/**
* on
* Adds event listener to collection elements. Event is delegated if delegate is supplied.
*/
on(eventName: string|Array<string>, delegate: any, callback?: Function, runOnce?: boolean): Cash;
/**
* one
* Adds event listener to collection elements that only triggers once for each element.
* Event is delegated if delegate is supplied.
*/
one(eventName: string|Array<string>, delegate: any, callback?: Function, runOnce?: boolean): Cash;
/**
* outerHeight
* Returns the outer height of the element. Includes margins if margin is set to true.
*/
outerHeight(flag?: boolean): number;
/**
* outerWidth
* Returns the outer width of the element. Includes margins if margin is set to true.
*/
outerWidth(flag?: boolean): number;
/**
* parent
* Returns parent element.
*/
parent(): Cash;
/**
* parents
* Returns collection of elements who are parents of element. Optionally filtering by selector.
*/
parents(selector?: string): Cash;
/**
* position
* Get the coordinates of the first element in a collection relative to its offsetParent.
*/
position(): OffsetType;
/**
* prepend
* Prepends element to the each element in collection.
*/
prepend(content: string): Cash;
/**
* prependTo
* Prepends elements in a collection to the target element(s).
*/
prependTo(parent: string|Element|Cash): Cash;
/**
* prev
* Returns the previous adjacent element.
*/
prev(): Cash;
/**
* prop
* Returns a property value when just property is supplied.
* Sets a property when property and value are supplied, and sets multiple properties when an object is supplied.
*/
prop(name: string): any;
prop(name: string, value: string): Cash;
/**
* ready
* Calls callback method on DOMContentLoaded.
*/
ready(fn: Function): void;
/**
* remove
* Removes collection elements from the DOM.
*/
remove(): Cash;
/**
* removeAttr
* Removes attribute from collection elements.
*/
removeAttr(name: string): Cash;
/**
* removeClass
* Removes className from collection elements.
* Accepts space-separated classNames for removing multiple classes.
* Providing no arguments will remove all classes.
*/
removeClass(c?: string): Cash;
/**
* removeData
* Removes linked data and data-attributes from collection elements.
*/
removeData(key: string): Cash;
/**
* removeProp
* Removes property from collection elements.
*/
removeProp(name: string): Cash;
/**
* serialize
* When called on a form, serializes and returns form data.
*/
serialize(): string;
/**
* siblings
* Returns a collection of sibling elements.
*/
siblings(): Cash;
/**
* text
* Returns the inner text of the first element in the collection, sets the text if textContent is provided.
*/
text(): string;
text(content?: string): Cash;
/**
* toggleClass
* Adds or removes className from collection elements based on if the element already has the class.
* Accepts space-separated classNames for toggling multiple classes, and an optional force boolean to ensure classes are added (true) or removed (false).
*/
toggleClass(c: string, state?: boolean): Cash;
/**
* trigger
* Triggers supplied event on elements in collection. Data can be passed along as the second parameter.
*/
trigger(eventName: string, data?: any): Cash;
/**
* val
* Returns an inputs value. If value is supplied, sets all inputs in collection's value to the value argument.
*/
val(): any;
val(value?: string): Cash;
/**
* width
* Returns the width of the element.
*/
width(): number;
}
declare module "cash" {
export = CashStatic;
}
declare var cash: CashStatic;
@@ -6,6 +6,6 @@ import * as util from 'util';
var client = new cassandra.Client({ contactPoints: ['h1', 'h2'], keyspace: 'ks1'});
var query = 'SELECT email, last_name FROM user_profiles WHERE key=?';
client.execute(query, ['guy'], function(err, result) {
client.execute(query, ['guy'], function(err: any, result: any) {
console.log('got user profile with email ' + result.rows[0].email);
});
});
+1 -2
View File
@@ -135,7 +135,7 @@ declare module "cassandra-driver" {
var LocalTime: LocalTimeStatic;
var Long: _Long;
var ResultSet: ResultSetStatic;
var ResultStream: ResultStreamStatic;
// var ResultStream: ResultStreamStatic;
var Row: RowStatic;
var TimeUuid: TimeUuidStatic;
var Tuple: TupleStatic;
@@ -366,7 +366,6 @@ declare module "cassandra-driver" {
buffer: Buffer;
paused: boolean;
_read(): void;
_valve(readNext: Function): void;
add(chunk: Buffer): void;
}
+7 -6
View File
@@ -379,7 +379,7 @@ interface TimeScale extends ChartScales {
parser?: string | ((arg: any) => any);
round?: string;
tooltipFormat?: string;
unit?: TimeUnit;
unit?: string | TimeUnit;
unitStepSize?: number;
}
@@ -390,11 +390,12 @@ interface RadialLinearScale {
ticks?: TickOptions;
}
declare var Chart: {
new (context: CanvasRenderingContext2D, options: ChartConfiguration): {};
declare class Chart {
constructor (context: CanvasRenderingContext2D, options: ChartConfiguration);
config: ChartConfiguration;
destroy: () => {};
update: (duration: any, lazy: any) => {};
render: (duration: any, lazy: any) => {};
update: (duration?: any, lazy?: any) => {};
render: (duration?: any, lazy?: any) => {};
stop: () => {};
resize: () => {};
clear: () => {};
@@ -407,4 +408,4 @@ declare var Chart: {
defaults: {
global: ChartOptions;
}
};
}
+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;
+17
View File
@@ -37,6 +37,23 @@ function test_CKEDITOR() {
CKEDITOR.replaceAll((textarea, config) => false);
}
function test_config() {
var config1: CKEDITOR.config = {
toolbar: 'basic',
};
var config2: CKEDITOR.config = {
toolbar: [
[ 'mode', 'document', 'doctools' ],
[ 'clipboard', 'undo' ],
'/',
[ 'find', 'selection', 'spellchecker' ],
[ 'basicstyles', 'cleanup' ],
'/',
[ 'list', 'indent', 'blocks', 'align', 'bidi' ],
],
};
}
function test_dom_comment() {
var type = CKEDITOR.NODE_COMMENT;
var nativeNode = document.createComment('Example');
+1 -1
View File
@@ -807,7 +807,7 @@ declare namespace CKEDITOR {
templates_files?: Object;
templates_replaceContent?: boolean;
title?: string | boolean;
toolbar?: string | (string[])[];
toolbar?: string | (string | string[])[];
toolbarCanCollapse?: boolean;
toolbarGroupCycling?: boolean;
toolbarGroups?: toolbarGroups[];
+1 -1
View File
@@ -1,5 +1,5 @@
/// <reference path="./cropperjs.d.ts"/>
import * as Cropper from 'cropperjs';
import Cropper from 'cropperjs';
var image = <HTMLImageElement>document.getElementById('image');
var cropper = new Cropper(image, {
+1 -1
View File
@@ -467,5 +467,5 @@ declare module cropperjs {
declare module "cropperjs" {
const Cropper: typeof cropperjs.Cropper;
export = Cropper;
export default Cropper;
}
+6
View File
@@ -0,0 +1,6 @@
/// <reference path="defaults.d.ts" />
import defaults = require('defaults');
defaults({}, {user: 'developer', locale: 'fr-FR'});
defaults(undefined, 'hello world');
+10
View File
@@ -0,0 +1,10 @@
// Type definitions for defaults 1.0.3
// Project: https://github.com/tmpvar/defaults/
// Definitions by: Ibtihel CHNAB <https://github.com/IbtihelCHNAB/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare function defaults(options: any, defaultOptions: any): any;
declare module "defaults" {
export = defaults;
}
+15
View File
@@ -52,7 +52,22 @@ declare namespace createjs {
// methods
clone(): Bitmap;
}
export class ScaleBitmap extends DisplayObject {
constructor(imageOrUrl: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | Object | string, scale9Grid: Rectangle);
// properties
image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement;
sourceRect: Rectangle;
drawWidth: number;
drawHeight: number;
scale9Grid: Rectangle;
snapToPixel: boolean;
// methods
setDrawSize (newWidth: number, newHeight: number): void;
clone(): ScaleBitmap;
}
export class BitmapText extends DisplayObject {
constructor(text?:string, spriteSheet?:SpriteSheet);
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
+1 -2
View File
@@ -16,9 +16,8 @@ declare module "ejs" {
function renderFile(path: string, data?: Data, opts?: Options, cb?: Function): any;// TODO RenderFileCallback return type
function clearCache(): any;
function TemplateFunction(data: Data): any;
interface TemplateFunction {
dependencies: Dependencies;
(data: Data): any;
}
interface Options {
cache?: any;
+12
View File
@@ -112,6 +112,10 @@ namespace ShallowWrapperTest {
boolVal = shallowWrapper.is('.some-class');
}
function test_isEmpty() {
boolVal = shallowWrapper.isEmpty()
}
function test_not() {
elementWrapper = shallowWrapper.find('.foo').not('.bar');
}
@@ -399,6 +403,10 @@ namespace ReactWrapperTest {
boolVal = reactWrapper.is('.some-class');
}
function test_isEmpty() {
boolVal = reactWrapper.isEmpty()
}
function test_not() {
elementWrapper = reactWrapper.find('.foo').not('.bar');
}
@@ -636,6 +644,10 @@ namespace CheerioWrapperTest {
boolVal = cheerioWrapper.is('.some-class');
}
function test_isEmpty() {
boolVal = cheerioWrapper.isEmpty()
}
function test_not() {
elementWrapper = cheerioWrapper.find('.foo').not('.bar');
}
+5
View File
@@ -102,6 +102,11 @@ declare module "enzyme" {
*/
is(selector: EnzymeSelector): boolean;
/**
* Returns whether or not the current node is empty.
*/
isEmpty(): boolean;
/**
* Returns a new wrapper with only the nodes of the current wrapper that don't match the provided selector.
* This method is effectively the negation or inverse of filter.
+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) => any;
type TransformHeader = (body: http.IncomingMessage, request: Request, response: Response) => any;
/**
* 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>;
}
@@ -93,6 +93,23 @@ declare module "express-serve-static-core" {
patch: IRouterMatcher<this>;
options: IRouterMatcher<this>;
head: IRouterMatcher<this>;
checkout: IRouterMatcher<this>;
copy: IRouterMatcher<this>;
lock: IRouterMatcher<this>;
merge: IRouterMatcher<this>;
mkactivity: IRouterMatcher<this>;
mkcol: IRouterMatcher<this>;
move: IRouterMatcher<this>;
"m-search": IRouterMatcher<this>;
notify: IRouterMatcher<this>;
purge: IRouterMatcher<this>;
report: IRouterMatcher<this>;
search: IRouterMatcher<this>;
subscribe: IRouterMatcher<this>;
trace: IRouterMatcher<this>;
unlock: IRouterMatcher<this>;
unsubscribe: IRouterMatcher<this>;
use: IRouterHandler<this> & IRouterMatcher<this>;
@@ -114,6 +131,23 @@ declare module "express-serve-static-core" {
patch: IRouterHandler<this>;
options: IRouterHandler<this>;
head: IRouterHandler<this>;
checkout: IRouterHandler<this>;
copy: IRouterHandler<this>;
lock: IRouterHandler<this>;
merge: IRouterHandler<this>;
mkactivity: IRouterHandler<this>;
mkcol: IRouterHandler<this>;
move: IRouterHandler<this>;
"m-search": IRouterHandler<this>;
notify: IRouterHandler<this>;
purge: IRouterHandler<this>;
report: IRouterHandler<this>;
search: IRouterHandler<this>;
subscribe: IRouterHandler<this>;
trace: IRouterHandler<this>;
unlock: IRouterHandler<this>;
unsubscribe: IRouterHandler<this>
}
export interface Router extends IRouter { }
+9
View File
@@ -170,5 +170,14 @@ resultStr = faker.random.objectElement({foo: 'bar', field: 'foo'});
resultStr = faker.random.uuid();
resultBool = faker.random.boolean();
resultStr = faker.system.fileName( "foo", "bar" );
resultStr = faker.system.commonFileName( "foo", "bar" );
resultStr = faker.system.mimeType();
resultStr = faker.system.commonFileType();
resultStr = faker.system.commonFileExt();
resultStr = faker.system.fileType();
resultStr = faker.system.fileExt( "foo" );
resultStr = faker.system.semver();
import fakerEn = require('faker/locale/en');
resultStr = faker.name.firstName();
+13
View File
@@ -173,6 +173,19 @@ declare namespace Faker {
boolean(): boolean;
};
system: {
fileName(ext: string, type: string): string;
commonFileName(ext: string, type: string): string;
mimeType(): string;
commonFileType(): string;
commonFileExt(): string;
fileType(): string;
fileExt(mimeType: string): string;
//directoryPath(): string;
//filePath(): string;
semver(): string;
};
seed(value: number): void;
}
+22 -7
View File
@@ -3,16 +3,16 @@
window.fbAsyncInit = function() {
FB.init(
{
appId : '{your-app-id}',
appId : "{your-app-id}",
xfbml : true,
version : 'v2.0'
version : "v2.0"
}
);
FB.ui(
{
method: 'share',
href: 'https://developers.facebook.com/docs/dialogs/'
method: "share",
href: "https://developers.facebook.com/docs/dialogs/"
},
function(response) {
console.log(response);
@@ -21,9 +21,24 @@ window.fbAsyncInit = function() {
FB.api(
"/me",
"POST",
function (fbResponse){
"post",
function (fbResponse) {
console.log(fbResponse);
}
);
};
function checkAuth(response: FB.LoginStatusResponse): void {
if (response.status === "connected") {
console.log(response.authResponse.accessToken);
console.log(response.authResponse.expiresIn);
console.log(response.authResponse.signedRequest);
console.log(response.authResponse.userID);
} else if (response.status === "unknown") {
console.log("not logged in");
}
}
FB.login(checkAuth);
FB.getLoginStatus(checkAuth);
};
+34 -5
View File
@@ -171,23 +171,44 @@ interface FBResponseObject {
error: any;
}
declare type LoginStatus = "connected" | "not_authorized" | "unknown";
declare type ApiMethod = "get" | "post" | "delete";
interface AuthResponse {
accessToken: string;
expiresIn: number;
signedRequest: string;
userID: string;
}
interface FBError {
type: string;
message: string;
code: number;
error_subcode?: number;
error_user_msg?: string;
error_user_title?: string;
fbtrace_id: string;
}
interface FBSDK{
/* This method is used to initialize and setup the SDK. */
init(fbInitObject : FBInitParams) : void;
/* This method lets you make calls to the Graph API. */
api(path : string, method : string, callback : (fbResponseObject : Object) => any) : Object;
api(path : string, params : Object, callback : (fbResponseObject : FBResponseObject) => any) : Object;
api(path : string, method : string, params : Object, callback : (fbResponseObject : Object) => any) : Object;
api(path: string, callback: (response: any) => void): void;
api(path: string, method: ApiMethod, callback: (response: any) => void): void;
api(path: string, params: any, callback: (response: any) => void): void;
api(path: string, method: ApiMethod, params: any, callback: (response: any) => void): void;
/* This method is used to trigger different forms of Facebook created UI dialogs. */
ui(params : FBUIParams, handler : (fbResponseObject : Object) => any) : void;
/* Allows you to determine if a user is logged in to Facebook and has authenticated your app */
getLoginStatus(handler : Function, force?: Boolean) : void;
getLoginStatus(handler : (fbResponseObject : FB.LoginStatusResponse) => any, force?: Boolean) : void;
/* Calling FB.login prompts the user to authenticate your application using the Login Dialog. */
login(handler : (fbResponseObject : Object) => any, params?: FBLoginOptions): void;
login(handler : (fbResponseObject : FB.LoginStatusResponse) => any, params?: FBLoginOptions): void;
/* Log the user out of your site and Facebook */
logout(handler : (fbResponseObject : Object) => any) : void;
@@ -198,6 +219,7 @@ interface FBSDK{
Event : FBSDKEvents;
XFBML : FBSDKXFBML;
Canvas : FBSDKCanvas;
Error: FBError;
}
interface Window{
@@ -208,4 +230,11 @@ declare module "FB" {
export = FB;
}
declare namespace FB {
export interface LoginStatusResponse {
authResponse?: AuthResponse;
status: LoginStatus;
}
}
declare var FB : FBSDK;
+10
View File
@@ -0,0 +1,10 @@
/// <reference path="fossil-delta.d.ts" />
import * as fossilDelta from "fossil-delta";
var origin = new Array<number>(1,2,3);
var target = new Array<number>(1,2,3,4,5);
var delta = fossilDelta.create(origin, target);
var targetApplied = fossilDelta.apply(origin, delta);
var outputSize: number = fossilDelta.outputSize(delta);
+13
View File
@@ -0,0 +1,13 @@
// Type definitions for fossil-delta 0.2.5
// Project: https://github.com/dchest/fossil-delta-js
// Definitions by: Endel Dreyer <https://github.com/endel/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare module "fossil-delta" {
type ByteArray = Array<number> | Uint8Array | Buffer;
export function create(origin: ByteArray, target: ByteArray): Array<number>;
export function apply(origin: ByteArray, delta: Array<number>): Array<number>;
export function outputSize(delta: Array<number>): number;
}
+15 -7
View File
@@ -8,7 +8,7 @@
///<reference path="../node/node.d.ts"/>
declare module "fs-extra" {
export * from "fs";
export * from "fs";
export function copy(src: string, dest: string, callback?: (err: Error) => void): void;
export function copy(src: string, dest: string, filter: CopyFilter, callback?: (err: Error) => void): void;
@@ -18,6 +18,9 @@ declare module "fs-extra" {
export function copySync(src: string, dest: string, filter: CopyFilter): void;
export function copySync(src: string, dest: string, options: CopyOptions): void;
export function move(src: string, dest: string, callback?: (err: Error) => void): void;
export function move(src: string, dest: string, options: MoveOptions, callback?: (err: Error) => void): void;
export function createFile(file: string, callback?: (err: Error) => void): void;
export function createFileSync(file: string): void;
@@ -55,8 +58,8 @@ declare module "fs-extra" {
export function writeJsonSync(file: string, object: any, options?: OpenOptions): void;
export function writeJSONSync(file: string, object: any, options?: OpenOptions): void;
export function ensureDir(path: string, cb: (err: Error) => void): void;
export function ensureDirSync(path: string): void;
export function ensureDir(path: string, cb: (err: Error) => void): void;
export function ensureDirSync(path: string): void;
export function ensureFile(path: string, cb: (err: Error) => void): void;
export function ensureFileSync(path: string): void;
@@ -67,10 +70,10 @@ declare module "fs-extra" {
export function ensureSymlink(path: string, cb: (err: Error) => void): void;
export function ensureSymlinkSync(path: string): void;
export function emptyDir(path: string, callback?: (err: Error) => void): void;
export function emptyDirSync(path: string): boolean;
export interface CopyFilterFunction {
export function emptyDir(path: string, callback?: (err: Error) => void): void;
export function emptyDirSync(path: string): boolean;
export interface CopyFilterFunction {
(src: string): boolean
}
@@ -83,6 +86,11 @@ declare module "fs-extra" {
filter?: CopyFilter
recursive?: boolean
}
export interface MoveOptions {
clobber? : boolean;
limit?: number;
}
export interface OpenOptions {
encoding?: string;
+8
View File
@@ -131,6 +131,14 @@ declare namespace FullCalendar {
eventAfterRender?: (event: EventObject, element: HTMLDivElement, view: ViewObject) => void;
eventAfterAllRender?: (view: ViewObject) => void;
eventDestroy?: (event: EventObject, element: JQuery, view: ViewObject) => void;
//scheduler options
resourceAreaWidth?:number,
schedulerLicenseKey?:string,
customButtons?:any,
resourceLabelText?:any,
resourceColumns?:any,
displayEventTime?:any,
}
/**
@@ -26,7 +26,7 @@ ipcRenderer.send('asynchronous-message', 'ping');
// remote
// https://github.com/atom/electron/blob/master/docs/api/remote.md
var BrowserWindow: typeof Electron.BrowserWindow = remote.require('browser-window');
var BrowserWindow = remote.BrowserWindow;
var win = new BrowserWindow({ width: 800, height: 600 });
win.loadURL('https://github.com');
@@ -167,7 +167,7 @@ holder.ondrop = function (e) {
// nativeImage
// https://github.com/atom/electron/blob/master/docs/api/native-image.md
var Tray: Electron.Tray = remote.require('Tray');
var Tray = remote.Tray;
var appIcon2 = new Tray('/Users/somebody/images/icon.png');
var window2 = new BrowserWindow({ icon: '/Users/somebody/images/window.png' });
var image = clipboard.readImage();
@@ -187,7 +187,7 @@ process.once('loaded', function() {
// screen
// https://github.com/atom/electron/blob/master/docs/api/screen.md
var app: Electron.App = remote.require('app');
var app = remote.app;
var mainWindow: Electron.BrowserWindow = null;
+44 -30
View File
@@ -1,4 +1,4 @@
// Type definitions for Electron v1.4.1
// Type definitions for Electron v1.4.2
// 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
@@ -7,22 +7,9 @@
declare namespace Electron {
class EventEmitter extends NodeJS.EventEmitter {
addListener(event: string, listener: Function): this;
on(event: string, listener: Function): this;
once(event: string, listener: Function): this;
removeListener(event: string, listener: Function): this;
removeAllListeners(event?: string): this;
setMaxListeners(n: number): this;
getMaxListeners(): number;
listeners(event: string): Function[];
emit(event: string, ...args: any[]): boolean;
listenerCount(type: string): number;
}
interface Event {
preventDefault: Function;
sender: EventEmitter;
sender: NodeJS.EventEmitter;
}
type Point = {
@@ -42,6 +29,17 @@ declare namespace Electron {
height: number;
}
interface Destroyable {
/**
* Destroys the object.
*/
destroy(): void;
/**
* @returns Whether the object is destroyed.
*/
isDestroyed(): boolean;
}
// https://github.com/electron/electron/blob/master/docs/api/app.md
/**
@@ -740,7 +738,7 @@ declare namespace Electron {
* The BrowserWindow class gives you ability to create a browser window.
* You can also create a window without chrome by using Frameless Window API.
*/
class BrowserWindow extends EventEmitter {
class BrowserWindow extends NodeJS.EventEmitter implements Destroyable {
/**
* Emitted when the document changed its title,
* calling event.preventDefault() would prevent the native windows title to change.
@@ -1104,7 +1102,7 @@ declare namespace Electron {
* setting this, the window is still a normal window, not a toolbox window
* which can not be focused on.
*/
setAlwaysOnTop(flag: boolean): void;
setAlwaysOnTop(flag: boolean, level?: WindowLevel): void;
/**
* @returns Whether the window is always on top of other windows.
*/
@@ -1357,8 +1355,8 @@ declare namespace Electron {
getChildWindows(): BrowserWindow[];
}
type WindowLevel = 'normal' | 'floating' | 'torn-off-menu' | 'modal-panel' | 'main-menu' | 'status' | 'pop-up-menu' | 'screen-saver' | 'dock';
type SwipeDirection = 'up' | 'right' | 'down' | 'left';
type ThumbarButtonFlags = 'enabled' | 'disabled' | 'dismissonclick' | 'nobackground' | 'hidden' | 'noninteractive';
interface ThumbarButton {
@@ -1538,6 +1536,11 @@ declare namespace Electron {
* Default: false.
*/
offscreen?: boolean;
/**
* Whether to enable Chromium OS-level sandbox.
* Default: false.
*/
sandbox?: boolean;
}
interface BrowserWindowOptions {
@@ -2532,7 +2535,7 @@ declare namespace Electron {
*
* Each menu consists of multiple menu items, and each menu item can have a submenu.
*/
class Menu extends EventEmitter {
class Menu extends NodeJS.EventEmitter {
/**
* Creates a new menu.
*/
@@ -2627,7 +2630,7 @@ declare namespace Electron {
*/
getBitmap(): Buffer;
/**
* @returns string The data URL of the image.
* @returns The data URL of the image.
*/
toDataURL(): string;
/**
@@ -2637,11 +2640,11 @@ declare namespace Electron {
*/
getNativeHandle(): Buffer;
/**
* @returns boolean Whether the image is empty.
* @returns Whether the image is empty.
*/
isEmpty(): boolean;
/**
* @returns {} The size of the image.
* @returns The size of the image.
*/
getSize(): Size;
/**
@@ -2689,7 +2692,7 @@ declare namespace Electron {
interface PowerSaveBlocker {
/**
* Starts preventing the system from entering lower-power mode.
* @returns an integer identifying the power save blocker.
* @returns The blocker ID that is assigned to this power blocker.
* Note: prevent-display-sleep has higher has precedence over prevent-app-suspension.
*/
start(type: 'prevent-app-suspension' | 'prevent-display-sleep'): number;
@@ -2700,7 +2703,7 @@ declare namespace Electron {
stop(id: number): void;
/**
* @param id The power save blocker id returned by powerSaveBlocker.start.
* @returns a boolean whether the corresponding powerSaveBlocker has started.
* @returns Whether the corresponding powerSaveBlocker has started.
*/
isStarted(id: number): boolean;
}
@@ -2940,7 +2943,7 @@ declare namespace Electron {
* You can also access the session of existing pages by using
* the session property of webContents which is a property of BrowserWindow.
*/
class Session extends EventEmitter {
class Session extends NodeJS.EventEmitter {
/**
* @returns a new Session instance from partition string.
*/
@@ -3136,6 +3139,11 @@ declare namespace Electron {
}
interface Cookie {
/**
* Emitted when a cookie is changed because it was added, edited, removed, or expired.
*/
on(event: 'changed', listener: (event: Event, cookie: Cookie, cause: CookieChangedCause) => void): this;
on(event: string, listener: Function): this;
/**
* The name of the cookie.
*/
@@ -3175,6 +3183,8 @@ declare namespace Electron {
expirationDate?: number;
}
type CookieChangedCause = 'explicit' | 'overwrite' | 'expired' | 'evicted' | 'expired-overwrite';
interface CookieDetails {
/**
* The URL associated with the cookie.
@@ -3525,13 +3535,13 @@ declare namespace Electron {
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.
* @returns Whether the system is in Dark Mode.
*
* Note: This is only implemented on macOS.
*/
isDarkMode(): boolean;
/**
* @returns If the Swipe between pages setting is on.
* @returns Whether the Swipe between pages setting is on.
*
* Note: This is only implemented on macOS.
*/
@@ -3596,7 +3606,7 @@ declare namespace Electron {
/**
* A Tray represents an icon in an operating system's notification area.
*/
interface Tray extends NodeJS.EventEmitter {
class Tray extends NodeJS.EventEmitter implements Destroyable {
/**
* Emitted when the tray icon is clicked.
* Note: The bounds payload is only implemented on macOS and Windows.
@@ -3661,7 +3671,7 @@ declare namespace Electron {
/**
* Creates a new tray icon associated with the image.
*/
new(image: NativeImage|string): Tray;
constructor(image: NativeImage|string);
/**
* Destroys the tray icon immediately.
*/
@@ -3712,6 +3722,10 @@ declare namespace Electron {
* @returns The bounds of this tray icon.
*/
getBounds(): Rectangle;
/**
* @returns Whether the tray icon is destroyed.
*/
isDestroyed(): boolean;
}
interface Modifiers {
@@ -5465,7 +5479,7 @@ declare namespace Electron {
screen: Electron.Screen;
session: typeof Electron.Session;
systemPreferences: Electron.SystemPreferences;
Tray: Electron.Tray;
Tray: typeof Electron.Tray;
webContents: Electron.WebContentsStatic;
}
+29 -10
View File
@@ -1,4 +1,4 @@
// Type definitions for Google Maps JavaScript API 3.20
// Type definitions for Google Maps JavaScript API 3.25
// Project: https://developers.google.com/maps/
// Definitions by: Folia A/S <http://www.folia.dk>, Chris Wrench <https://github.com/cgwrench>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -922,6 +922,7 @@ declare namespace google.maps {
formatted_address: string;
geometry: GeocoderGeometry;
partial_match: boolean;
place_id: string;
postcode_localities: string[];
types: string[];
}
@@ -984,10 +985,11 @@ declare namespace google.maps {
avoidFerries?: boolean;
avoidHighways?: boolean;
avoidTolls?: boolean;
destination?: LatLng|LatLngLiteral|string;
durationInTraffic?: boolean;
destination?: string|LatLng|Place;
durationInTraffic?: boolean; /* Deprecated. Use drivingOptions field instead */
drivingOptions?: DrivingOptions;
optimizeWaypoints?: boolean;
origin?: LatLng|LatLngLiteral|string;
origin?: string|LatLng|Place;
provideRouteAlternatives?: boolean;
region?: string;
transitOptions?: TransitOptions;
@@ -1031,6 +1033,18 @@ declare namespace google.maps {
export interface TransitFare { }
export interface DrivingOptions {
departureTime: Date;
trafficModel: TrafficModel
}
export enum TrafficModel
{
BEST_GUESS,
OPTIMISTIC,
PESSIMISTIC
}
export interface DirectionsWaypoint {
location: LatLng|LatLngLiteral|string;
stopover: boolean;
@@ -1215,9 +1229,10 @@ declare namespace google.maps {
avoidFerries?: boolean;
avoidHighways?: boolean;
avoidTolls?: boolean;
destinations?: LatLng[]|string[];
destinations?: string[]|LatLng[]|Place[];
drivingOptions?: DrivingOptions;
durationInTraffic?: boolean;
origins?: LatLng[]|string[];
origins?: string[]|LatLng[]|Place[];
region?: string;
transitOptions?: TransitOptions;
travelMode?: TravelMode;
@@ -1237,6 +1252,7 @@ declare namespace google.maps {
export interface DistanceMatrixResponseElement {
distance: Distance;
duration: Duration;
duration_in_traffic: Duration;
fare: TransitFare;
status: DistanceMatrixElementStatus;
}
@@ -2060,7 +2076,7 @@ declare namespace google.maps {
export interface PlaceResult {
address_components: GeocoderAddressComponent[];
aspects: PlaceAspectRating[];
aspects: PlaceAspectRating[]; /* Deprecated. Will be removed May 2, 2017 */
formatted_address: string;
formatted_phone_number: string;
geometry: PlaceGeometry;
@@ -2103,7 +2119,8 @@ declare namespace google.maps {
openNow?: boolean;
radius?: number;
rankBy?: RankBy;
types?: string[];
types?: string[]; /* Deprecated. Will be removed February 16, 2017 */
type?: string;
}
export class PlacesService {
@@ -2144,7 +2161,8 @@ declare namespace google.maps {
location?: LatLng|LatLngLiteral;
name?: string;
radius?: number;
types?: string[];
types?: string[]; /* Deprecated. Will be removed February 16, 2017 */
type?: string;
}
export enum RankBy {
@@ -2168,7 +2186,8 @@ declare namespace google.maps {
location?: LatLng|LatLngLiteral;
query: string;
radius?: number;
types?: string[];
types?: string[]; /* Deprecated. Will be removed February 16, 2017 */
type?: string;
}
}
+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
+103 -121
View File
@@ -44,7 +44,7 @@ declare type TweenConfig = {
autoCSS?: boolean;
callbackScope?: Object;
}
//com.greensock.core
declare class Animation {
static ticker: IDispatcher;
@@ -198,109 +198,106 @@ declare class TimelineMax extends TimelineLite {
}
//com.greensock.easing
interface Back {
easeIn:Ease;
easeInOut:Ease;
easeOut:Ease;
declare class Ease {
constructor(func:Function, extraParams:any[], type:number, power:number);
public getRatio(p: number): number;
}
interface Bounce {
easeIn:Ease;
easeInOut:Ease;
easeOut:Ease;
}
interface Circ {
easeIn:Ease;
easeInOut:Ease;
easeOut:Ease;
}
interface Cubic {
easeIn:Ease;
easeInOut:Ease;
easeOut:Ease;
}
interface Ease {
getRatio(p:number):number;
}
interface EaseLookup {
find(name:string):Ease;
}
interface Elastic {
easeIn:Ease;
easeInOut:Ease;
easeOut:Ease;
}
interface Expo {
easeIn:Ease;
easeInOut:Ease;
easeOut:Ease;
}
interface Linear {
ease:Linear;
easeIn:Linear;
easeInOut:Linear;
easeNone:Linear;
easeOut:Linear;
}
interface Power0 {
easeIn:Ease;
easeInOut:Ease;
easeOut:Ease;
}
interface Power1 {
easeIn:Ease;
easeInOut:Ease;
easeOut:Ease;
}
interface Power2 {
easeIn:Ease;
easeInOut:Ease;
easeOut:Ease;
}
interface Power3 {
easeIn:Ease;
easeInOut:Ease;
easeOut:Ease;
}
interface Power4 {
easeIn:Ease;
easeInOut:Ease;
easeOut:Ease;
}
interface Quad {
easeIn:Ease;
easeInOut:Ease;
easeOut:Ease;
}
interface Quart {
easeIn:Ease;
easeInOut:Ease;
easeOut:Ease;
}
interface Quint {
easeIn:Ease;
easeInOut:Ease;
easeOut:Ease;
}
interface Sine {
easeIn:Ease;
easeInOut:Ease;
easeOut:Ease;
}
interface SlowMo {
ease:SlowMo;
new (linearRatio:number, power:number, yoyoMode:boolean):SlowMo;
config(linearRatio:number, power:number, yoyoMode:boolean):SlowMo;
getRatio(p:number):number;
declare class EaseLookup {
public static find(name: string): Ease;
}
interface SteppedEase {
config(steps:number):SteppedEase;
getRatio(p:number):number;
declare class Back extends Ease {
public static easeIn: Back;
public static easeInOut: Back;
public static easeOut: Back;
public config(overshoot: number): Elastic;
}
interface Strong {
easeIn:Ease;
easeInOut:Ease;
easeOut:Ease;
declare class Bounce extends Ease {
public static easeIn: Bounce;
public static easeInOut: Bounce;
public static easeOut: Bounce;
}
declare class Circ extends Ease {
public static easeIn: Circ;
public static easeInOut: Circ;
public static easeOut: Circ;
}
declare class Cubic extends Ease {
public static easeIn: Cubic;
public static easeInOut: Cubic;
public static easeOut: Cubic;
}
declare class Elastic extends Ease {
public static easeIn: Elastic;
public static easeInOut: Elastic;
public static easeOut: Elastic;
public config(amplitude: number, period: number): Elastic;
}
declare class Expo extends Ease {
public static easeIn: Expo;
public static easeInOut: Expo;
public static easeOut: Expo;
}
declare class Linear extends Ease {
public static ease: Linear;
public static easeIn: Linear;
public static easeInOut: Linear;
public static easeNone: Linear;
public static easeOut: Linear;
}
declare class Quad extends Ease {
public static easeIn: Quad;
public static easeInOut: Quad;
public static easeOut: Quad;
}
declare class Quart extends Ease {
public static easeIn: Quart;
public static easeInOut: Quart;
public static easeOut: Quart;
}
declare class Quint extends Ease {
public static easeIn: Quint;
public static easeInOut: Quint;
public static easeOut: Quint;
}
declare class Sine extends Ease {
public static easeIn: Sine;
public static easeInOut: Sine;
public static easeOut: Sine;
}
declare class SlowMo extends Ease {
public static ease: SlowMo;
public config(linearRatio: number, power: number, yoyoMode: boolean): SlowMo;
}
declare class SteppedEase extends Ease {
constructor(staps: number);
public config(steps: number): SteppedEase;
}
declare type RoughEaseConfig = {
clamp?: boolean;
points?: number;
randomize?: boolean;
strength?: number;
taper?: string; /* one of "in" | "out" | "both" | "none" */
template?: Ease;
}
declare class RoughEase extends Ease {
public static ease: RoughEase;
constructor(vars: RoughEaseConfig);
public config(steps: number): SteppedEase;
}
//com.greensock.plugins
@@ -335,27 +332,12 @@ interface TweenPlugin {
}
//com.greensock.easing
declare var Back:Back;
declare var Bounce:Bounce;
declare var Circ:Circ;
declare var Cubic:Cubic;
declare var Ease:Ease;
declare var EaseLookup:EaseLookup;
declare var Elastic:Elastic;
declare var Expo:Expo;
declare var Linear:Linear;
declare var Power0:Power0;
declare var Power1:Power1;
declare var Power2:Power2;
declare var Power3:Power3;
declare var Power4:Power4;
declare var Quad:Quad;
declare var Quart:Quart;
declare var Quint:Quint;
declare var Sine:Sine;
declare var SlowMo:SlowMo;
declare var SteppedEase:SteppedEase;
declare var Strong:Strong;
declare var Power0: typeof Linear;
declare var Power1: typeof Quad;
declare var Power2: typeof Cubic;
declare var Power3: typeof Quart;
declare var Power4: typeof Quint;
declare var Strong: typeof Quint;
//com.greensock.plugins
declare var BezierPlugin:BezierPlugin;
+37
View File
@@ -0,0 +1,37 @@
/// <reference path="gulp-cache.d.ts" />
/// <reference path="../gulp/gulp.d.ts" />
import * as fs from "fs";
import * as gulp from "gulp";
import * as cache from "gulp-cache";
import File = require("vinyl");
// Some gulp plugin
let jshint: any;
gulp.task('lint', function () {
gulp.src('./non/existent/path/*.js')
.pipe(cache(jshint('.jshintrc'), {
key: makeHashKey,
success: function (jshintedFile) {
return jshintedFile.jshint.success;
},
value: function (jshintedFile) {
return {
jshint: jshintedFile.jshint
};
}
}))
.pipe(jshint.reporter('default'));
});
var jsHintVersion = '2.4.1',
jshintOptions = fs.readFileSync('.jshintrc');
function makeHashKey(file: File) {
return [file.contents.toString('utf8'), jsHintVersion, jshintOptions].join('');
}
gulp.task('clear', function (done: any) {
return cache.clearAll(done);
});
+94
View File
@@ -0,0 +1,94 @@
// Type definitions for gulp-cache v0.4.5
// Project: https://github.com/jgable/gulp-cache
// Definitions by: Arun Aravind <https://github.com/aravindarun>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
/// <reference path="../vinyl/vinyl.d.ts" />
/// <reference path="../gulp-util/gulp-util.d.ts" />
declare module "gulp-cache" {
import File = require("vinyl");
import { Transform } from "stream";
import { PluginError } from "gulp-util";
namespace gc {
type Predicate<T> = (arg: T) => boolean;
interface IGulpCacheOptions {
/**
* The cache instance to use for caching.
*/
fileCache?: IGulpCache;
/**
* The name of the bucket which stores the cached objects.
* Default value = 'default'
*/
name?: string,
/**
* The hash generator to use.
*/
key?: (file: File, callback?: (err: any, result: string) => void) => string | Promise<string>;
/**
* Value representing the success of a task.
*/
success?: boolean | Predicate<any>;
/**
* Content that is to be cached.
*/
value?: (result: any) => Object | Promise<Object> | string;
}
interface ICacheOptions {
/**
* Specifies the name of the directory where the cache
* is to be stored.
*/
cacheDirName: string;
}
interface IGulpCacheStatic {
/**
* Caches the result of a task.
* @param task The task whose result is to be cached.
*/
(task: NodeJS.ReadWriteStream): Transform;
/**
* Caches the result of a task.
* @param task Task whose result is to be cached.
* @param options Override values for available settings.
*/
(task: NodeJS.ReadWriteStream, options: IGulpCacheOptions): Transform;
clear(options: IGulpCacheOptions): Transform;
/**
* Represents a cache store.
*/
Cache: IGulpCache;
/**
* Purges the cache.
* @param err PluginError instance in case of a plugin error.
* If callback is not specified an exception of type
* 'PluginError' is thrown.
*/
clearAll(callback?: (err: PluginError) => void): void;
}
/**
* Represents a cach store.
*/
interface IGulpCache {
new (options: ICacheOptions): any;
}
}
const _: gc.IGulpCacheStatic;
export = _;
}
+10
View File
@@ -0,0 +1,10 @@
/// <reference path="../gulp/gulp.d.ts" />
/// <reference path="gulp-copy.d.ts" />
import * as gulp from "gulp";
import * as gulpCopy from "gulp-copy";
gulp.task("copy-files", () => {
gulp.src("*.nonexistent")
.pipe(gulpCopy("remove/target/some/non/existent/path", { prefix: 2 }));
});
+39
View File
@@ -0,0 +1,39 @@
// Type definitions for gulp-copy v0.0.2
// Project: https://github.com/klaascuvelier/gulp-copy
// Definitions by: Arun Aravind <https://github.com/aravindarun>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../through/through.d.ts" />
declare module "gulp-copy" {
import through = require("through");
/**
* Copy files to destination and expose those files as source streams for the gulp pipeline.
*
* @param outDirectory The name of the destination directory. If this directory
* does not exist, it will be created atomatically.
*/
function gulpCopy(outDirectory: string): through.ThroughStream;
/**
* Copy files to destination and expose those files as source streams for the gulp pipeline.
*
* @param outDirectory The name of the destination directory. If this directory
* does not exist, it will be created atomatically.
* @param options Override values for available settings.
*/
function gulpCopy(outDirectory: string, options: gulpCopy.GulpCopyOptions): through.ThroughStream;
namespace gulpCopy {
export interface GulpCopyOptions {
/**
* Specifies the number of parts of the path to be ignored as path prefixes.
*/
prefix: number;
}
}
export = gulpCopy;
}
+44
View File
@@ -0,0 +1,44 @@
/// <reference path="../hapi/hapi.d.ts" />
/// <reference path="hapi-decorators.d.ts" />
import * as hapi from 'hapi';
import { controller, get, post, put, cache, config, route, validate, Controller } from 'hapi-decorators';
@controller('/test')
class TestController implements Controller {
baseUrl: string;
routes: () => hapi.IRouteConfiguration[];
@get('/')
@config({
auth: false
})
@cache({
expiresIn: 42000
})
@validate({
payload: false
})
getHandler(request: hapi.Request, reply: hapi.IReply) {
reply({ success: true });
}
@post('/')
postHandler(request: hapi.Request, reply: hapi.IReply) {
reply({ success: true });
}
@put('/{id}')
putHandler(request: hapi.Request, reply: hapi.IReply) {
reply({ success: true });
}
@route('delete', '/{id}')
deleteHandler(request: hapi.Request, reply: hapi.IReply) {
reply({ success: true });
}
}
const server = new hapi.Server();
server.route(new TestController().routes());
+98
View File
@@ -0,0 +1,98 @@
// Type definitions for hapi-decorators v0.4.3
// Project: https://github.com/knownasilya/hapi-decorators
// Definitions by: Ken Howard <http://github.com/kenhowardpdx>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../hapi/hapi.d.ts" />
declare module 'hapi-decorators' {
import * as hapi from 'hapi';
interface ControllerStatic {
new (): Controller;
}
export interface Controller {
baseUrl: string;
routes: () => hapi.IRouteConfiguration[];
}
export function controller(baseUrl: string): (target: ControllerStatic) => void;
interface IRouteSetup {
(target: any, key: any, descriptor: any): any;
}
interface IRouteDecorator {
(method: string, path: string): IRouteSetup;
}
interface IRouteConfig {
(path: string): IRouteSetup;
}
export const route: IRouteDecorator;
export const get: IRouteConfig;
export const post: IRouteConfig;
export const put: IRouteConfig;
// export const delete: IRouteConfig;
export const patch: IRouteConfig;
export const all: IRouteConfig;
export function config(config: hapi.IRouteAdditionalConfigurationOptions): (target: any, key: any, descriptor: any) => any;
interface IValidateConfig {
/** validation rules for incoming request headers.Values allowed:
* trueany headers allowed (no validation performed).This is the default.
falseno headers allowed (this will cause all valid HTTP requests to fail).
a Joi validation object.
a validation function using the signature function(value, options, next) where:
valuethe object containing the request headers.
optionsthe server validation options.
next(err, value)the callback function called when validation is completed.
*/
headers?: boolean | hapi.IJoi | hapi.IValidationFunction;
/** validation rules for incoming request path parameters, after matching the path against the route and extracting any parameters then stored in request.params.Values allowed:
trueany path parameters allowed (no validation performed).This is the default.
falseno path variables allowed.
a Joi validation object.
a validation function using the signature function(value, options, next) where:
valuethe object containing the path parameters.
optionsthe server validation options.
next(err, value)the callback function called when validation is completed. */
params?: boolean | hapi.IJoi | hapi.IValidationFunction;
/** validation rules for an incoming request URI query component (the key- value part of the URI between '?' and '#').The query is parsed into its individual key- value pairs (using the qs module) and stored in request.query prior to validation.Values allowed:
trueany query parameters allowed (no validation performed).This is the default.
falseno query parameters allowed.
a Joi validation object.
a validation function using the signature function(value, options, next) where:
valuethe object containing the query parameters.
optionsthe server validation options.
next(err, value)the callback function called when validation is completed. */
query?: boolean | hapi.IJoi | hapi.IValidationFunction;
/** validation rules for an incoming request payload (request body).Values allowed:
trueany payload allowed (no validation performed).This is the default.
falseno payload allowed.
a Joi validation object.
a validation function using the signature function(value, options, next) where:
valuethe object containing the payload object.
optionsthe server validation options.
next(err, value)the callback function called when validation is completed. */
payload?: boolean | hapi.IJoi | hapi.IValidationFunction;
/** an optional object with error fields copied into every validation error response. */
errorFields?: any;
/** determines how to handle invalid requests.Allowed values are:
'error'return a Bad Request (400) error response.This is the default value.
'log'log the error but continue processing the request.
'ignore'take no action.
OR a custom error handler function with the signature 'function(request, reply, source, error)` where:
requestthe request object.
replythe continuation reply interface.
sourcethe source of the invalid field (e.g. 'path', 'query', 'payload').
errorthe error object prepared for the client response (including the validation function error under error.data). */
failAction?: string | hapi.IRouteFailFunction;
/** options to pass to Joi.Useful to set global options such as stripUnknown or abortEarly (the complete list is available here: https://github.com/hapijs/joi#validatevalue-schema-options-callback ).Defaults to no options. */
options?: any;
}
export function validate(config: IValidateConfig): (target: any, key: any, descriptor: any) => any;
interface ICacheConfig {
privacy?: string;
expiresIn?: number;
expiresAt?: number;
}
export function cache(cacheConfig: ICacheConfig): (target: any, key: any, descriptor: any) => any;
export function pre(pre: {
[key: string]: any;
}): (target: any, key: any, descriptor: any) => any;
}
+6
View File
@@ -0,0 +1,6 @@
{
"compilerOptions": {
"target": "es2015",
"experimentalDecorators": true
}
}
+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;
}
+12
View File
@@ -0,0 +1,12 @@
// Type definitions for Highcharts 4.2.6 (boost module)
// Project: http://www.highcharts.com/
// Definitions by: Daniel Martin <http://github.com/inad9300>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="highcharts.d.ts" />
declare var HighchartsBoost: (H: HighchartsStatic) => HighchartsStatic;
declare module "highcharts/modules/boost" {
export = HighchartsBoost;
}
+12
View File
@@ -0,0 +1,12 @@
// Type definitions for Highcharts 4.2.6 (offline exporting module)
// Project: http://www.highcharts.com/
// Definitions by: Daniel Martin <http://github.com/inad9300>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="highcharts.d.ts" />
declare var HighchartsOfflineExporting: (H: HighchartsStatic) => HighchartsStatic;
declare module "highcharts/modules/offline-exporting" {
export = HighchartsOfflineExporting;
}
+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.
+58
View File
@@ -0,0 +1,58 @@
/// <reference path="./hyperscript.d.ts" />
import * as h from 'hyperscript'
// Test/example code adapted from https://github.com/dominictarr/hyperscript/blob/master/README.md
// example
h('div#page',
h('div#header',
h('h1.classy', 'h', { style: {'background-color': '#22f'} })),
h('div#menu', { style: {'background-color': '#2f2'} },
h('ul',
h('li', 'one'),
h('li', 'two'),
h('li', 'three'))),
h('h2', 'content title', { style: {'background-color': '#f22'} }),
h('p',
"so it's just like a templating engine,\n",
"but easy to use inline with javascript\n"),
h('p',
"the intension is for this to be used to create\n",
"reusable, interactive html widgets. "))
// event
h('a', {href: '#',
onclick: function (e: Event) {
alert('you are 1,000,000th visitor!')
e.preventDefault()
}
}, 'click here to win a prize')
// array of children
const obj: {[id: string]: string} = {
a: 'Apple',
b: 'Banana',
c: 'Cherry',
d: 'Durian',
e: 'Elder Berry'
}
h('table',
h('tr', h('th', 'letter'), h('th', 'fruit')),
Object.keys(obj).map(function (k) {
return h('tr',
h('th', k),
h('td', obj[k])
)
})
)
// new context
const h2 = h.context()
h2('a', {href: '#',
onclick: function (e: Event) {
alert('you are 1,000,000th visitor!')
e.preventDefault()
}
}, "Click this")
h2.cleanup()
+19
View File
@@ -0,0 +1,19 @@
// Type definitions for hyperscript
// Project: https://github.com/dominictarr/hyperscript
// Definitions by: Mike Linkovich <https://github.com/spacejack>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module 'hyperscript' {
interface HyperScript {
/** Creates an HTML element */
(tagName: string, ...args: any[]): HTMLElement;
/** Cleans up any event handlers created by this hyperscript context */
cleanup(): void;
/** Creates a new hyperscript context */
context(): HyperScript;
}
const h: HyperScript;
export = h;
}
+17
View File
@@ -904,6 +904,23 @@ describe("Custom matcher: 'toBeGoofy'", function () {
});
});
describe("Randomize Tests", function() {
it("should allow randomization of the order of tests", function() {
expect(function() {
var env = jasmine.getEnv();
return env.randomizeTests(true);
}).not.toThrow();
});
it("should allow a seed to be passed in for randomization", function() {
expect(function() {
var env = jasmine.getEnv();
env.randomizeTests(true);
return env.seed(1234);
}).not.toThrow();
});
});
(() => {
// from boot.js
var env = jasmine.getEnv();
+38 -2
View File
@@ -1,4 +1,4 @@
// Type definitions for Jasmine 2.2
// Type definitions for Jasmine 2.5
// Project: http://jasmine.github.io/
// Definitions by: Boris Yankov <https://github.com/borisyankov/>, Theodore Brown <https://github.com/theodorejb>, David Pärsson <https://github.com/davidparsson/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -65,6 +65,7 @@ declare namespace jasmine {
function addMatchers(matchers: CustomMatcherFactories): void;
function stringMatching(str: string): Any;
function stringMatching(str: RegExp): Any;
function formatErrorMsg(domain: string, usage: string) : (msg: string) => string
interface Any {
@@ -115,6 +116,7 @@ declare namespace jasmine {
/** Calls to any registered callback are triggered when the clock is ticked forward via the jasmine.clock().tick function, which takes a number of milliseconds. */
tick(ms: number): void;
mockDate(date?: Date): void;
withMock(func: () => void): void;
}
interface CustomEqualityTester {
@@ -180,6 +182,12 @@ declare namespace jasmine {
addMatchers(matchers: CustomMatcherFactories): void;
specFilter(spec: Spec): boolean;
throwOnExpectationFailure(value: boolean): void;
seed(seed: string | number): string | number;
provideFallbackReporter(reporter: Reporter): void;
throwingExpectationFailures(): boolean;
allowRespy(allow: boolean): void;
randomTests(): boolean;
randomizeTests(b: boolean): void;
}
interface FakeTimer {
@@ -234,6 +242,26 @@ declare namespace jasmine {
trace: Trace;
}
interface Order {
new (options: {random: boolean, seed: string}): any;
random: boolean;
seed: string;
sort<T>(items: T[]) : T[];
}
namespace errors {
class ExpectationFailed extends Error {
constructor();
stack: any;
}
}
interface TreeProcessor {
new (attrs: any): any;
execute: (done: Function) => void;
processTree() : any;
}
interface Trace {
name: string;
message: string;
@@ -301,7 +329,9 @@ declare namespace jasmine {
toHaveBeenCalledTimes(expected: number): boolean;
toContain(expected: any, expectationFailOutput?: any): boolean;
toBeLessThan(expected: number, expectationFailOutput?: any): boolean;
toBeLessThanOrEqual(expected: number, expectationFailOutput?: any): boolean;
toBeGreaterThan(expected: number, expectationFailOutput?: any): boolean;
toBeGreaterThanOrEqual(expected: number, expectationFailOutput?: any): boolean;
toBeCloseTo(expected: number, precision?: any, expectationFailOutput?: any): boolean;
toThrow(expected?: any): boolean;
toThrowError(message?: string | RegExp): boolean;
@@ -371,6 +401,7 @@ declare namespace jasmine {
runs(func: SpecFunction): Spec;
addToQueue(block: Block): void;
addMatcherResult(result: Result): void;
getResult(): any;
expect(actual: any): any;
waits(timeout: number): Spec;
waitsFor(latchFunction: SpecFunction, timeoutMessage?: string, timeout?: number): Spec;
@@ -380,11 +411,12 @@ declare namespace jasmine {
finishCallback(): void;
finish(onComplete?: () => void): void;
after(doAfter: SpecFunction): void;
execute(onComplete?: () => void): any;
execute(onComplete?: () => void, enabled?: boolean): any;
addBeforesAndAftersToQueue(): void;
explodes(): void;
spyOn(obj: any, methodName: string, ignoreMethodDoesntExist: boolean): Spy;
removeAllSpies(): void;
throwOnExpectationFailure: boolean;
}
interface XSpec {
@@ -484,6 +516,10 @@ declare namespace jasmine {
finished: boolean;
result: any;
messages: any;
runDetails: {
failedExpectations: ExpectationResult[];
order: jasmine.Order
}
new (): any;
@@ -0,0 +1,79 @@
/// <reference path="jquery-alertable.d.ts" />
/// <reference path="../jquery/jquery.d.ts" />
//
// Examples from https://github.com/claviska/jquery-alertable
//
function example_alerts_tests() {
// Basic example
$.alertable.alert('Howdy!');
// Example with action when the modal is dismissed
$.alertable.alert('Howdy!').always(function() {
// Modal was dismissed
});
}
function example_confirmations_tests() {
// Basic example
$.alertable.confirm('You sure?').then(function() {
// OK was selected
});
// Example with then/always
$.alertable.confirm('You sure?').then(function() {
// OK was selected
}, function() {
// Cancel was selected
}).always(function() {
// Modal was dismissed
});
}
function example_prompts_tests() {
// Basic example
$.alertable.prompt('How many?').then(function(data) {
// Prompt was submitted
});
// Example with then/always
$.alertable.prompt('How many?').then(function(data) {
// Prompt was submitted
}, function() {
// Prompt was canceled
}).always(function() {
// Modal was dismissed
});
}
function options_tests() {
$.alertable.alert('Howdy!', {
container: 'body',
html: false,
cancelButton: '<button class="alertable-cancel" type="button">Cancel</button>',
okButton: '<button class="alertable-ok" type="button">OK</button>',
overlay: '<div class="alertable-overlay"></div>',
prompt: '<input class="alertable-input" type="text" name="value">',
modal: `<form class="alertable">
<div class="alertable-message"></div>
<div class="alertable-prompt"></div>
<div class="alertable-buttons"></div>
</form>`,
hide: () => $(this.modal).add(this.overlay).fadeOut(100),
show: () => $(this.modal).add(this.overlay).fadeIn(100)
});
$.alertable.confirm('You sure?', {
container: 'body'
});
$.alertable.prompt('How many?', {
container: 'body'
});
$.alertable.defaults.container = 'body';
}
+29
View File
@@ -0,0 +1,29 @@
// Type definitions for jquery-alertable 1.0.2
// Project: https://github.com/claviska/jquery-alertable
// Definitions by: Steven Robertson <https://github.com/stever>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts"/>
interface JQueryStatic {
alertable: Alertable;
}
interface Alertable {
alert(message: string, options?: AlertableOptions): JQueryPromise<void>;
confirm(message: string, options?: AlertableOptions): JQueryPromise<void>;
prompt(message: string, options?: AlertableOptions): JQueryPromise<void>;
defaults: AlertableOptions;
}
interface AlertableOptions {
container?: string;
html?: boolean;
cancelButton?: string;
okButton?: string;
overlay?: string;
prompt?: string;
modal?: string;
hide?: Function;
show?: Function;
}
+1 -1
View File
@@ -1,6 +1,6 @@
/// <reference path="../jquery/jquery.d.ts"/>
/// <reference path="jquery-mockjax.d.ts"/>
/// <reference path="../qunit/qunit.d.ts" />
/// <reference path="../qunit/qunit-1.16.d.ts" />
class Tests {
private _noErrorCallbackExpected: (jqXHR: JQueryXHR, textStatus: string, errorThrown: string) => any;
+1 -1
View File
@@ -1,4 +1,4 @@
/// <reference path="../qunit/qunit.d.ts" />
/// <reference path="../qunit/qunit-1.16.d.ts" />
/// <reference path="jquery.bbq.d.ts" />
+8 -6
View File
@@ -8,12 +8,12 @@
interface JQueryColorpickerOptions {
// Events
// TODO: Figure out actual types.
cancel: Function,
close: Function,
init: Function,
select: Function,
ok: Function,
open: Function,
cancel?: Function,
close?: Function,
init?: Function,
select?: Function,
ok?: Function,
open?: Function,
alpha?: boolean;
altAlpha?: boolean;
@@ -32,6 +32,8 @@ interface JQueryColorpickerOptions {
colorFormat?: string;
draggable?: boolean;
duration?: string;
format?: string;
horizontal?: boolean;
hsv?: boolean;
inline?: boolean;
inlineFrame?: boolean;
+1 -1
View File
@@ -147,7 +147,7 @@ $(document).ready(function () {
var infoCallbackFunc: DataTables.FunctionInfoCallback = function (settings, start, end, total, pre) { };
var initCallbackFunc: DataTables.FunctionInitComplete = function (settings, json) { };
var preDrawFunc: DataTables.FunctionPreDrawCallback = function (settings) { };
var rowCallbackFunc: DataTables.FunctionRowCallback = function (row, data) { };
var rowCallbackFunc: DataTables.FunctionRowCallback = function (row, data, index) { };
var stateLoadCallbackFunc: DataTables.FunctionStateLoadCallback = function (settings) { };
var stateLoadedCallbackFunc: DataTables.FunctionStateLoaded = function (settings, data) { };
var stateSaveCallbackFunc: DataTables.FunctionStateSaveCallback = function (settings, data) { };
+8 -1
View File
@@ -902,6 +902,13 @@ declare namespace DataTables {
* @param d Data to use for the row.
*/
data(d: any[] | Object): DataTable;
/**
* Get the id of the selected row.
*
* @param hash Set to true to append a hash (#) to the start of the row id.
*/
id(hash?: boolean): string;
/**
* Get the row index of the row column.
@@ -1636,7 +1643,7 @@ declare namespace DataTables {
}
interface FunctionRowCallback {
(row: Node, data: any[] | Object): void;
(row: Node, data: any[] | Object, index: number): void;
}
interface FunctionStateLoadCallback {
@@ -0,0 +1,77 @@
///<reference path="../jquery/jquery.d.ts" />
///<reference path="jquery.flagstrap.d.ts" />
class TestObject {
}
$(function () {
// basic test
// written in according to basic example from documentation
var htmlSelect = '<form class="form-horizontal">' +
' <div class="form-group">' +
' <label>Select Country</label><br>' +
' <div class="flagstrap" data-input-name="country"></div>' +
' </div>' +
'</form>';
$('body').html(htmlSelect);
$('#flagstrap').flagStrap();
// for this test we expect more than 30 thousands of characters
console.log('characters count: ' + $('#flagstrap').html().length + '\n' + $('#flagstrap').html());
// options test
// options -> data attributes
// written in according to options -> data attributes example from documentation
htmlSelect = '<form>' +
' <div class="form-group">' +
' <label>Select Country</label><br>' +
' <div id="flagstrap2"' +
' data-input-name="country2"' +
' data-selected-country="DE"' +
' data-button-size="btn-md"' +
' data-button-type="btn-default"' +
' data-scrollable-height="250px"' +
' data-scrollable="true">' +
' </div>' +
' </div>' +
'</form>';
$('body').html(htmlSelect);
$('#flagstrap2').flagStrap();
console.log('\n\ncharacters count: ' + $('#flagstrap2').html().length + '\n' + $('#flagstrap2').html());
// options test
// options -> instance options
// written in according to options -> instance options example from documentation
htmlSelect = '<form>' +
' <div class="form-group">' +
' <label>Select Country</label><br>' +
' <div id="flagstrap3"></div>' +
' </div>' +
'</form>';
$('body').html(htmlSelect);
$('#flagstrap3').flagStrap({
countries: {
"AU": "Australia",
"GB": "United Kingdom",
"US": "United States"
},
inputName: 'country',
buttonSize: "btn-lg",
buttonType: "btn-primary",
labelMargin: "20px",
scrollable: false,
scrollableHeight: "350px",
onSelect: function(value: any, element: any) {
//
},
placeholder: {
value: "",
text: "Please select a country"
}
});
console.log('\n\ncharacters count: ' + $('#flagstrap3').html().length + '\n' + $('#flagstrap3').html());
})
+84
View File
@@ -0,0 +1,84 @@
// Type definitions for jQuery Flagstrap Plugin v1.0
// Project: https://github.com/blazeworx/flagstrap
// Definitions by: Felipe de Sena Garcia <https://github.com/felipedgarcia>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
///<reference path="../jquery/jquery.d.ts" />
declare module jQueryFlagStrap {
interface FlagStrapOptions {
/**
* Default: uniquely generated
* the `name` attribute for the actual `select` input
*/
inputName: string;
/**
* Default: uniquely generated
* the `id` attribute for the actual `select` input
*/
inputId?: string;
/**
* Default: "btn-md"
* The bootstrap button size `class` for this drop down
*/
buttonSize: string;
/**
* Default: "btn-default"
* The bootstrap button type `class` for this drop down
*/
buttonType: string;
/**
* Default: "20px"
* The `margin` between `flag` and `text label`
*/
labelMargin: string;
/**
* Default: false
* Scrollable or full height drop down
*/
scrollable: boolean;
/**
* Default: "250px"
* `max-height` for the scrollable drop down
*/
scrollableHeight?: string;
/**
* Default: (all)
* Only show specific countries
* Example:
*
* {"GB": "United Kingdom", "US": "United States"}
*
* will only show the USA and UK.
*/
countries?: Object;
/**
* Default: {value: "", text: "Please select a country"}
* Set the placeholder value and text. To disable the placeholder define as (boolean) false.
*/
placeholder: boolean | FlagStrapPlaceholderOptions;
/**
* Default: null
* This callback gets called each time the select is changed. It receives two parameters, the new value, and the select element.
*/
onSelect?(value: any, element: any): void;
}
interface FlagStrapStatic {
flagStrap?: void;
}
interface FlagStrapPlaceholderOptions {
value: string;
text: string;
}
}
interface JQuery {
/**
* A lightwieght jQuery plugin for creating Bootstrap 3 compatible country select boxes with flags.
*/
flagStrap(): void;
flagStrap(options: jQueryFlagStrap.FlagStrapOptions): void;
}
+44
View File
@@ -209,6 +209,50 @@ function test_ajax() {
url: "test.js"
});
jqXHR.abort('aborting because I can');
//Test the promise exposed by the jqXHR object
// done method
$.ajax({
url: "test.js"
}).promise().done((data, textStatus, jqXHR) => {
console.log(data, textStatus, jqXHR);
});
// fail method
$.ajax({
url: "test.js"
}).promise().fail((jqXHR, textStatus, errorThrown) => {
console.log(jqXHR, textStatus, errorThrown);
});
// always method with successful request
$.ajax({
url: "test.js"
}).promise().always((data, textStatus, jqXHR) => {
console.log(data, textStatus, jqXHR);
});
// always method with failed request
$.ajax({
url: "test.js"
}).promise().always((jqXHR, textStatus, errorThrown) => {
console.log(jqXHR, textStatus, errorThrown);
});
// then method (as of 1.8)
$.ajax({
url: "test.js"
}).promise().then((data, textStatus, jqXHR) => {
console.log(data, textStatus, jqXHR);
}, (jqXHR, textStatus, errorThrown) => {
console.log(jqXHR, textStatus, errorThrown);
});
// generic then method
var p: JQueryPromise<number> = $.ajax({ url: "test.js" }).promise()
.then(() => "Hello")
.then((x) => x.length);
}
function test_ajaxComplete() {
+7
View File
@@ -344,6 +344,13 @@ interface JQueryPromise<T> extends JQueryGenericPromise<T> {
// Deprecated - given no typings
pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise<any>;
/**
* Return a Deferred's Promise object.
*
* @param target Object onto which the promise methods have to be attached
*/
promise(target?: any): JQueryPromise<T>;
}
/**
+32 -30
View File
@@ -19,34 +19,36 @@ add methods:
- [ ] noConflict
*/
interface Base64 {
/**
* .encode
* @param {String} string
* @return {String}
*/
encode(base64: string): string;
/**
* .encodeURI
* @param {String} string
* @return {String}
*/
encodeURI(base64: string): string
/**
* .decode
* @param {String} string
* @return {String}
*/
decode(base64: string): string
/**
* Library version
*/
VERSION:string
}
declare module 'js-base64' {
const Base64: Base64
}
namespace JSBase64 {
const Base64: Base64Static
interface Base64Static {
/**
* .encode
* @param {String} string
* @return {String}
*/
encode(base64: string): string;
/**
* .encodeURI
* @param {String} string
* @return {String}
*/
encodeURI(base64: string): string
/**
* .decode
* @param {String} string
* @return {String}
*/
decode(base64: string): string
/**
* Library version
*/
VERSION:string
}
}
export = JSBase64
}
@@ -0,0 +1,5 @@
/// <reference path="jstimezonedetect.d.ts" />
import * as jstz from 'jstimezonedetect';
jstz.determine().name() === 'America/Montreal';
+16
View File
@@ -0,0 +1,16 @@
// Type definitions for jsTimezoneDetect
// Project: https://bitbucket.org/pellepim/jstimezonedetect
// Definitions by: Olivier Lamothe <https://github.com/olamothe/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface JsTimezoneDetect {
determine: ()=> {
name: ()=> string;
}
}
declare var jstimezonedetect: JsTimezoneDetect;
declare module "jstimezonedetect" {
export = jstimezonedetect;
}
+1 -1
View File
@@ -99,7 +99,7 @@ var treeWithNewCoreProperties = $('#treeWithNewCoreProperties').jstree({
// tree with new checkbox properties
var treeWithNewCheckboxProperties = $('#treeWithNewCheckboxProperties').jstree({
checkbox: {
cascade: true,
cascade: '',
tie_selection: true
}
});
+9
View File
@@ -1529,6 +1529,15 @@ declare namespace kendo.drawing.pdf {
}
declare namespace kendo.ui {
class AgendaView implements kendo.ui.SchedulerView {
static fn: AgendaView;
startDate(): Date;
endDate(): Date;
static extend(proto: Object): AgendaView;
}
class Alert extends kendo.ui.Widget {
static fn: Alert;
+23
View File
@@ -0,0 +1,23 @@
/// <reference path="../koa/koa.d.ts" />
/// <reference path="koa-send.d.ts" />
import * as Koa from "koa";
import * as send from "koa-send";
const app = new Koa();
app.use(async (ctx: Koa.Context) => {
const path: string = await send(ctx, 'stimpy.html');
});
app.use(async (ctx: Koa.Context) => {
await send(ctx, 'stimpy.html', {
root: '../static-files',
index: 'index.html',
maxAge: 10,
hidden: true,
format: true,
gzip: true,
setHeaders: () => {},
});
});
+27
View File
@@ -0,0 +1,27 @@
// Type definitions for koa-send v3.x
// Project: https://github.com/koajs/send
// Definitions by: Peter Safranek <https://github.com/pe8ter>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../koa/koa.d.ts" />
declare module "koa-send" {
import * as Koa from "koa";
interface ISendOptions {
root?: string;
index?: string;
maxAge?: number;
hidden?: boolean;
format?: boolean;
gzip?: boolean;
setHeaders?: Function;
}
function send(ctx: Koa.Context, path: string, opts?: ISendOptions): Promise<string>;
namespace send {}
export = send;
}
+2 -2
View File
@@ -237,8 +237,8 @@ map = map
.panTo(latLngTuple, panOptions)
.panBy(point)
.panBy(pointTuple)
.setMaxBounds(bounds) // investigate if this really receives Bounds instead of LatLngBounds
.setMaxBounds(boundsLiteral)
.setMaxBounds(latLngBounds)
.setMaxBounds(latLngBoundsLiteral)
.setMinZoom(5)
.setMaxZoom(10)
.panInsideBounds(latLngBounds)
+33 -26
View File
@@ -3,6 +3,8 @@
// Definitions by: Alejandro Sánchez <https://github.com/alejo90>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../geojson/geojson.d.ts" />
declare namespace L {
export interface CRS {
latLngToPoint(latlng: LatLng, zoom: number): Point;
@@ -523,8 +525,7 @@ declare namespace L {
noClip?: boolean;
}
export interface Polyline extends Path {
toGeoJSON(): Object; // should import GeoJSON typings
interface InternalPolyline extends Path {
getLatLngs(): Array<LatLng>;
setLatLngs(latlngs: Array<LatLng>): this;
setLatLngs(latlngs: Array<LatLngLiteral>): this;
@@ -540,6 +541,10 @@ declare namespace L {
addLatLng(latlng: Array<LatLngTuple>): this;
}
export interface Polyline extends InternalPolyline {
toGeoJSON(): GeoJSON.LineString | GeoJSON.MultiLineString;
}
export function polyline(latlngs: Array<LatLng>, options?: PolylineOptions): Polyline;
export function polyline(latlngs: Array<LatLngLiteral>, options?: PolylineOptions): Polyline;
@@ -552,8 +557,8 @@ declare namespace L {
export function polyline(latlngs: Array<Array<LatLngTuple>>, options?: PolylineOptions): Polyline;
export interface Polygon extends Polyline {
toGeoJSON(): Object; // should import GeoJSON typings
export interface Polygon extends InternalPolyline {
toGeoJSON(): GeoJSON.Polygon | GeoJSON.MultiPolygon;
}
export function polygon(latlngs: Array<LatLng>, options?: PolylineOptions): Polygon;
@@ -582,7 +587,7 @@ declare namespace L {
}
export interface CircleMarker extends Path {
toGeoJSON(): Object; // should import GeoJSON typings
toGeoJSON(): GeoJSON.Point;
setLatLng(latLng: LatLng): this;
setLatLng(latLng: LatLngLiteral): this;
setLatLng(latLng: LatLngTuple): this;
@@ -650,7 +655,7 @@ declare namespace L {
/**
* Returns a GeoJSON representation of the layer group (as a GeoJSON GeometryCollection).
*/
toGeoJSON(): Object; // should import GeoJSON typings
toGeoJSON(): GeoJSON.GeometryCollection;
/**
* Adds the given layer to the group.
@@ -747,7 +752,7 @@ declare namespace L {
*/
export function featureGroup(layers?: Array<Layer>): FeatureGroup;
type StyleFunction = (feature: any) => PathOptions;
type StyleFunction = (feature: GeoJSON.Feature<GeoJSON.GeometryObject>) => PathOptions;
export interface GeoJSONOptions extends LayerOptions {
/**
@@ -763,7 +768,7 @@ declare namespace L {
* }
* ```
*/
pointToLayer?: (geoJsonPoint: Object, latlng: LatLng) => Layer; // should import GeoJSON typings
pointToLayer?: (geoJsonPoint: GeoJSON.Point, latlng: LatLng) => Layer; // should import GeoJSON typings
/**
* A Function defining the Path options for styling GeoJSON lines and polygons,
@@ -777,7 +782,7 @@ declare namespace L {
* }
* ```
*/
style?: (geoJsonFeature: Object) => PathOptions;
style?: StyleFunction;
/**
* A Function that will be called once for each created Feature, after it
@@ -789,7 +794,7 @@ declare namespace L {
* function (feature, layer) {}
* ```
*/
onEachFeature?: (feature: Object, layer: Layer) => void;
onEachFeature?: (feature: GeoJSON.Feature<GeoJSON.GeometryObject>, layer: Layer) => void;
/**
* A Function that will be used to decide whether to show a feature or not.
@@ -802,7 +807,7 @@ declare namespace L {
* }
* ```
*/
filter?: (geoJsonFeature: Object) => boolean;
filter?: (geoJsonFeature: GeoJSON.Feature<GeoJSON.GeometryObject>) => boolean;
/**
* A Function that will be used for converting GeoJSON coordinates to LatLngs.
@@ -815,36 +820,36 @@ declare namespace L {
* Represents a GeoJSON object or an array of GeoJSON objects.
* Allows you to parse GeoJSON data and display it on the map. Extends FeatureGroup.
*/
export interface GeoJSON extends FeatureGroup {}
export namespace GeoJSON {
export interface GeoJSON extends FeatureGroup {
/**
* Adds a GeoJSON object to the layer.
*/
export function addData(data: Object): Layer;
addData(data: GeoJSON.GeoJsonObject): Layer;
/**
* Resets the given vector layer's style to the original GeoJSON style,
* useful for resetting style after hover events.
*/
export function resetStyle(layer: Layer): Layer;
resetStyle(layer: Layer): Layer;
/**
* Changes styles of GeoJSON vector layers with the given style function.
*/
export function setStyle(style: PathOptions | StyleFunction): Layer;
setStyle(style: StyleFunction): this;
/**
* Creates a Layer from a given GeoJSON feature. Can use a custom pointToLayer
* and/or coordsToLatLng functions if provided as options.
*/
export function geometryToLayer(featureData: Object, options?: GeoJSONOptions): Layer;
geometryToLayer(featureData: GeoJSON.Feature<GeoJSON.GeometryObject>, options?: GeoJSONOptions): Layer;
/**
* Creates a LatLng object from an array of 2 numbers (longitude, latitude) or
* 3 numbers (longitude, latitude, altitude) used in GeoJSON for points.
*/
export function coordsToLatLng(coords: [number, number] | [number, number, number]): LatLng;
coordsToLatLng(coords: [number, number]): LatLng;
coordsToLatLng(coords: [number, number, number]): LatLng;
/**
* Creates a multidimensional array of LatLngs from a GeoJSON coordinates array.
@@ -852,24 +857,26 @@ declare namespace L {
* arrays of points, etc., 0 by default).
* Can use a custom coordsToLatLng function.
*/
export function coordsToLatLngs(coords: Array<number>, levelsDeep?: number, coordsToLatLng?: (coords: [number, number] | [number, number, number]) => LatLng): LatLng[]; // Not entirely sure how to define arbitrarily nested arrays
coordsToLatLngs(coords: Array<number>, levelsDeep?: number, coordsToLatLng?: (coords: [number, number] | [number, number, number]) => LatLng): LatLng[]; // Not entirely sure how to define arbitrarily nested arrays
/**
* Reverse of coordsToLatLng
*/
export function latLngToCoords(latlng: LatLng): [number, number] | [number, number, number];
latLngToCoords(latlng: LatLng): [number, number] | [number, number, number];
/**
* Reverse of coordsToLatLngs closed determines whether the first point should be
* appended to the end of the array to close the feature, only used when levelsDeep is 0.
* False by default.
*/
export function latLngsToCoords(latlngs: Array<LatLng>, levelsDeep?: number, closed?: boolean): [number, number] | [number, number, number];
latLngsToCoords(latlngs: Array<LatLng>, levelsDeep?: number, closed?: boolean): [number, number] | [number, number, number];
/**
* Normalize GeoJSON geometries/features into GeoJSON features.
*/
export function asFeature(geojson: Object): Object;
asFeature(geojson: GeoJSON.GeometryObject): GeoJSON.Feature<GeoJSON.GeometryObject>;
asFeature(geojson: GeoJSON.Feature<GeoJSON.GeometryObject>): GeoJSON.Feature<GeoJSON.GeometryObject>;
}
/**
@@ -879,7 +886,7 @@ declare namespace L {
* map (you can alternatively add it later with addData method) and
* an options object.
*/
export function geoJSON(geojson?: Object, options?: GeoJSONOptions): GeoJSON;
export function geoJSON(geojson?: GeoJSON.GeoJsonObject, options?: GeoJSONOptions): GeoJSON;
type Zoom = boolean | 'center';
@@ -1233,8 +1240,8 @@ declare namespace L {
panTo(latlng: LatLngTuple, options?: PanOptions): this;
panBy(offset: Point): this;
panBy(offset: PointTuple): this;
setMaxBounds(bounds: Bounds): this; // is this really bounds and not lanlngbounds?
setMaxBounds(bounds: BoundsLiteral): this;
setMaxBounds(bounds: LatLngBounds): this;
setMaxBounds(bounds: LatLngBoundsLiteral): this;
setMinZoom(zoom: number): this;
setMaxZoom(zoom: number): this;
panInsideBounds(bounds: LatLngBounds, options?: PanOptions): this;
+53 -32
View File
@@ -1,65 +1,86 @@
/// <reference path="localForage.d.ts" />
declare var localForage: LocalForage;
declare let localForage: LocalForage;
() => {
namespace LocalForageTest {
localForage.clear((err: any) => {
var newError: any = err;
let newError: any = err;
});
localForage.iterate((str: string, key: string, num: number) => {
var newStr: string = str;
var newKey: string = key;
var newNum: number = num;
let newStr: string = str;
let newKey: string = key;
let newNum: number = num;
});
localForage.length((err: any, num: number) => {
var newError: any = err;
var newNumber: number = num;
let newError: any = err;
let newNumber: number = num;
});
localForage.key(0, (err: any, value: string) => {
var newError: any = err;
var newValue: string = value;
let newError: any = err;
let newValue: string = value;
});
localForage.keys((err: any, keys: Array<string>) => {
var newError: any = err;
var newArray: Array<string> = keys;
let newError: any = err;
let newArray: Array<string> = keys;
});
localForage.getItem("key",(err: any, str: string) => {
var newError: any = err;
var newStr: string = str
let newError: any = err;
let newStr: string = str
});
localForage.getItem<string>("key").then((str: string) => {
var newStr: string = str;
let newStr: string = str;
});
localForage.setItem("key", "value",(err: any, str: string) => {
var newError: any = err;
var newStr: string = str
let newError: any = err;
let newStr: string = str
});
localForage.setItem("key", "value").then((str: string) => {
var newStr: string = str;
let newStr: string = str;
});
localForage.removeItem("key",(err: any) => {
var newError: any = err;
let newError: any = err;
});
localForage.removeItem("key").then(() => {
});
var config = localForage.config({
name: "testyo",
driver: localForage.LOCALSTORAGE
});
var store = localForage.createInstance({
name: "da instance",
driver: localForage.LOCALSTORAGE
});
}
{
let config: boolean;
config = localForage.config({
name: "testyo",
driver: localForage.LOCALSTORAGE
});
}
{
let store: LocalForage;
store = localForage.createInstance({
name: "da instance",
driver: localForage.LOCALSTORAGE
});
}
{
let testSerializer: LocalForageSerializer;
localForage.getSerializer()
.then((serializer: LocalForageSerializer) => {
testSerializer = serializer;
});
localForage.getSerializer((serializer: LocalForageSerializer) => {
testSerializer = serializer;
});
}
}

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