Merge branch 'master' of https://github.com/DefinitelyTyped/DefinitelyTyped into threeConstructorVsNotConstructor

This commit is contained in:
Erik Krogh Kristensen
2016-01-29 15:54:28 +01:00
106 changed files with 7350 additions and 2092 deletions
+7 -7
View File
@@ -101,13 +101,13 @@ declare module AngularFormly {
type?: string;
//expression types
onBlur?: string;
onChange?: string;
onClick?: string;
onFocus?: string;
onKeydown?: string;
onKeypress?: string;
onKeyup?: string;
onBlur?: string | IExpressionFunction;
onChange?: string | IExpressionFunction;
onClick?: string | IExpressionFunction;
onFocus?: string | IExpressionFunction;
onKeydown?: string | IExpressionFunction;
onKeypress?: string | IExpressionFunction;
onKeyup?: string | IExpressionFunction;
//Bootstrap types
label?: string;
@@ -174,6 +174,7 @@ var user = odataResourceClass.odata()
.skip(10)
.take(20)
.orderBy("Name", "desc")
.transformUrl((s)=>s)
.single();
user.$save();
+1
View File
@@ -281,6 +281,7 @@ declare module OData {
constructor(callback: ProviderCallback<T>);
filter(operand1: any, operand2?: any, operand3?: any): Provider<T>;
orderBy(arg1: string, arg2?: string): Provider<T>;
transformUrl(transformMethod : (url:string)=>string): Provider<T>;
take(amount: number): Provider<T>;
skip(amount: number): Provider<T>;
private execute();
+11 -1
View File
@@ -406,9 +406,19 @@ function TestElementArrayFinder() {
elementArrayFinder.each(function(element: protractor.ElementFinder){
// nothing
});
stringPromise = elementArrayFinder.map(function(element: protractor.ElementFinder, index: number){
return 'abc';
})
});
stringPromise = elementArrayFinder.map<string>(function(element: protractor.ElementFinder, index: number): string {
return 'abc';
});
stringPromise = elementArrayFinder.map<string, webdriver.promise.Promise<string>>(function(element: protractor.ElementFinder, index: number): webdriver.promise.Promise<string> {
return element.getText();
});
elementArrayFinder = elementArrayFinder.filter(function(element: protractor.ElementFinder, index: number){
return element.getText().then((text: string) => {
return text === "foo";
+1
View File
@@ -992,6 +992,7 @@ declare module protractor {
* of values returned by the map function.
*/
map<T>(mapFn: (element: ElementFinder, index: number) => T): webdriver.promise.Promise<T[]>;
map<T, T2>(mapFn: (element: ElementFinder, index: number) => T2): webdriver.promise.Promise<T[]>;
/**
* Apply a filter function to each element within the ElementArrayFinder. Returns
+104
View File
@@ -0,0 +1,104 @@
/// <reference path="asana.d.ts" />
/// <reference path="../request/request.d.ts" />
import * as asana from 'asana';
import * as util from 'util';
let version: string = asana.VERSION;
// https://github.com/Asana/node-asana#usage
// Usage
var client = asana.Client.create().useAccessToken('my_access_token');
client.users.me().then(function(me) {
console.log(me);
});
client = asana.Client.create({
clientId: 123,
clientSecret: 'my_client_secret',
redirectUri: 'my_redirect_uri'
});
client.useOauth({
credentials: 'my_access_token'
});
var credentials = {
// access_token: 'my_access_token',
refresh_token: 'my_refresh_token'
};
client.useOauth({
credentials: credentials
});
// https://github.com/Asana/node-asana#collections
// Collections
let tagId: string = null;
client.tasks.findByTag(tagId, { limit: 5 }).then((collection: any) => {
console.log(collection.data);
// [ .. array of up to 5 task objects .. ]
client.tasks.findByTag(tagId).then((firstPage: any) => {
console.log(firstPage.data);
collection.nextPage().then((secondPage: any) => {
console.log(secondPage.data);
});
});
});
client.tasks.findByTag(tagId).then((collection: any) => {
// Fetch up to 200 tasks, using multiple pages if necessary
collection.fetch(200).then((tasks: any) => {
console.log(tasks);
});
});
client.tasks.findByTag(tagId).then((collection: any) => {
collection.stream().on('data', (task: any) => {
console.log(task);
});
});
// https://github.com/Asana/node-asana#examples
// Examples
var Asana = asana;
// Using the API key for basic authentication. This is reasonable to get
// started with, but Oauth is more secure and provides more features.
var client = Asana.Client.create().useBasicAuth(process.env.ASANA_API_KEY);
client.users.me()
.then((user: any) => {
var userId = user.id;
// The user's "default" workspace is the first one in the list, though
// any user can have multiple workspaces so you can't always assume this
// is the one you want to work with.
var workspaceId = user.workspaces[0].id;
return client.tasks.findAll({
assignee: userId,
workspace: workspaceId,
completed_since: 'now',
opt_fields: 'id,name,assignee_status,completed'
});
})
.then((response: any) => {
// There may be more pages of data, we could stream or return a promise
// to request those here - for now, let's just return the first page
// of items.
return response.data;
})
.filter((task: any) => {
return task.assignee_status === 'today' ||
task.assignee_status === 'new';
})
.then((list: any) => {
console.log(util.inspect(list, {
colors: true,
depth: null
}));
});
+2199
View File
File diff suppressed because it is too large Load Diff
+13 -13
View File
@@ -14,31 +14,31 @@ interface Blazy {
interface BlazyOptions {
breakpoints: Breakpoint[];
breakpoints?: Breakpoint[];
container: string;
container?: string;
error: (ele: Element|HTMLElement, msg: string) => void;
error?: (ele: Element|HTMLElement, msg: string) => void;
errorClass: string;
errorClass?: string;
loadInvisible: boolean;
loadInvisible?: boolean;
offset: number;
offset?: number;
saveViewportOffsetDelay: number;
saveViewportOffsetDelay?: number;
selector: string;
selector?: string;
separator: string;
separator?: string;
src: string;
src?: string;
success: (ele: Element|HTMLElement) => void;
success?: (ele: Element|HTMLElement) => void;
successClass: string;
successClass?: string;
validateDelay: number;
validateDelay?: number;
}
+2 -2
View File
@@ -80,7 +80,7 @@ declare module CKEDITOR {
function getTemplate(name: string): template;
function getUrl(resource: string): string;
function inline(element: string, instanceConfig?: config): editor;
function inline(element: HTMLTextAreaElement, instanceConfig?: config): editor;
function inline(element: HTMLElement, instanceConfig?: config): editor;
function inlineAll(): void;
function loadFullCore(): void;
function replace(element: string, config?: config): editor;
@@ -1147,4 +1147,4 @@ declare module CKEDITOR {
function load(languageCode: string, defaultLanguage: string, callback: Function): void;
function detect(defaultLanguage: string, probeLanguage: string): string;
}
}
}
-26
View File
@@ -180,32 +180,6 @@ interface Date {
format(mask?: string, utc?: boolean) : string;
}
declare var Date: {
new (): Date;
new (value: number): Date;
new (value: string): Date;
new (year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date;
(): string;
prototype: Date;
/**
* Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970.
* @param s A date string
*/
parse(s: string): number;
/**
* Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date.
* @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year.
* @param month The month as an number between 0 and 11 (January to December).
* @param date The date as an number between 1 and 31.
* @param hours Must be supplied if minutes is supplied. An number from 0 to 23 (midnight to 11pm) that specifies the hour.
* @param minutes Must be supplied if seconds is supplied. An number from 0 to 59 that specifies the minutes.
* @param seconds Must be supplied if milliseconds is supplied. An number from 0 to 59 that specifies the seconds.
* @param ms An number from 0 to 999 that specifies the milliseconds.
*/
UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number;
now(): number;
};
// Some common format strings
interface DateFormatMasks {
"default": string;
+40 -30
View File
@@ -1,4 +1,4 @@
// Type definitions for DevExtreme 15.2.3
// Type definitions for DevExtreme 15.2.4
// Project: http://js.devexpress.com/
// Definitions by: DevExpress Inc. <http://devexpress.com/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -35,7 +35,7 @@ declare module DevExpress {
brokenRules: any[];
validators: IValidator[];
}
export interface GroupConfig extends EventsMixin<GroupConfig> {
export interface GroupConfig extends EventsMixin<GroupConfig> {
group: any;
validators: IValidator[];
validate(): ValidationGroupValidationResult;
@@ -56,7 +56,7 @@ declare module DevExpress {
/** Validates the rules that are defined within the dxValidator objects that are registered for the specified ViewModel. */
export function validateModel(model: Object): ValidationGroupValidationResult;
/** Registers all the dxValidator objects by which the fields of the specified ViewModel are extended. */
export function registerModelForValidation(model: Object) : void;
export function registerModelForValidation(model: Object): void;
}
export var hardwareBackButton: JQueryCallback;
/** Processes the hardware back button click. */
@@ -2401,7 +2401,7 @@ declare module DevExpress.ui {
scrollPosition(): number;
}
export interface dxSwitchOptions extends EditorOptions {
activeStateEnabled?: boolean;
activeStateEnabled?: boolean;
/** Text displayed when the widget is in a disabled state. */
offText?: string;
/** Text displayed when the widget is in an enabled state. */
@@ -2534,6 +2534,7 @@ declare module DevExpress.ui {
/** Specifies whether or not the drop-down menu is displayed. */
opened?: boolean;
hoverStateEnabled?: boolean;
activeStateEnabled?: boolean;
}
/** A drop-down menu widget. */
export class dxDropDownMenu extends Widget {
@@ -4479,11 +4480,11 @@ declare module DevExpress.viz.core {
font?: viz.core.Font;
/** Specifies the widget title's horizontal position. */
horizontalAlignment?: string;
/** Specifies the widget title's position in the vertical direction. */
/** Specifies the widget title's position in the vertical direction. */
verticalAlignment?: string;
/** Specifies the distance between the title and surrounding widget elements in pixels. */
margin?: viz.core.Margins;
/** Specifies the height of the space reserved for the title. */
/** Specifies the height of the space reserved for the title. */
placeholderSize?: number;
/** Specifies text for the title. */
text?: string;
@@ -4491,7 +4492,7 @@ declare module DevExpress.viz.core {
subtitle?: {
/** Specifies font options for the subtitle. */
font?: viz.core.Font;
/** Specifies text for the subtitle. */
/** Specifies text for the subtitle. */
text?: string;
}
}
@@ -4602,16 +4603,16 @@ declare module DevExpress.viz.core {
}) => void;
/** A handler for the incidentOccurred event. */
onIncidentOccurred?: (
component: BaseWidget,
element: Element,
target: {
id: string;
type: string;
args: any;
text: string;
widget: string;
version: string;
}
component: BaseWidget,
element: Element,
target: {
id: string;
type: string;
args: any;
text: string;
widget: string;
version: string;
}
) => void;
/** Notifies a widget that it is embedded into an HTML page that uses a path modifier. */
pathModified?: boolean;
@@ -5152,10 +5153,6 @@ declare module DevExpress.viz.charts {
valueField?: string;
}
export interface CommonPieSeriesSettings extends CommonPieSeriesConfig {
/**
* Sets a series type for all series.
* @deprecated use the 'type' option instead
*/
type?: string;
}
export interface PieSeriesConfig extends CommonPieSeriesConfig {
@@ -6389,8 +6386,12 @@ declare module DevExpress.viz.rangeSelector {
};
/** Specifies the value to be raised to a power when generating ticks for a logarithmic scale. */
logarithmBase?: number;
/** Specifies an interval between major ticks. */
/**
* Specifies an interval between major ticks.
* @deprecated ..\tickInterval\tickInterval.md
*/
majorTickInterval?: any;
tickInterval?: any;
/** Specifies options for the date-time scale's markers. */
marker?: {
/** Defines the options that can be set for the text that is displayed by the scale markers. */
@@ -6425,7 +6426,10 @@ declare module DevExpress.viz.rangeSelector {
setTicksAtUnitBeginning?: boolean;
/** Specifies whether or not to show ticks for the boundary scale values, when neither major ticks nor minor ticks are created for these values. */
showCustomBoundaryTicks?: boolean;
/** Indicates whether or not to show minor ticks on the scale. */
/**
* Indicates whether or not to show minor ticks on the scale.
* @deprecated minorTick\visible.md
*/
showMinorTicks?: boolean;
/** Specifies the scale's start value. */
startValue?: any;
@@ -6438,14 +6442,20 @@ declare module DevExpress.viz.rangeSelector {
/** Specifies the width of the scale's ticks (both major and minor ticks). */
width?: number;
};
minorTick?: {
color?: string;
opacity?: number;
width?: number;
visible?: boolean;
};
/** Specifies the type of the scale. */
type?: string;
/** Specifies whether or not to expand the current tick interval if labels overlap each other. */
useTicksAutoArrangement?: boolean;
/** Specifies the type of values on the scale. */
valueType?: string;
/** Specifies the order of arguments on a discrete scale. */
categories?: Array<any>;
/** Specifies the order of arguments on a discrete scale. */
categories?: Array<any>;
};
/** Specifies the range to be selected when displaying the dxRangeSelector. */
selectedRange?: {
@@ -6583,7 +6593,7 @@ declare module DevExpress.viz.map {
selected(): boolean;
/** Sets the selection state of the layer element. */
selected(state: boolean): void;
/** Applies the layer element settings and updates the element appearance. */
/** Applies the layer element settings and updates element appearance. */
applySettings(settings: any): void;
}
/**
@@ -6680,7 +6690,7 @@ declare module DevExpress.viz.map {
type?: string;
/** Specifies the type of a marker element. Setting this option makes sense only if the layer type is "marker". */
elementType?: string;
/** Specifies a data source for the layer element. */
/** Specifies a data source for the layer. */
data?: any;
/** Specifies the width of the layer elements border in pixels. */
borderWidth?: number;
@@ -7040,9 +7050,9 @@ declare module DevExpress.viz.map {
center?: Array<number>;
/** A handler for the centerChanged event. */
onCenterChanged?: (e: {
center: Array<number>;
component: dxVectorMap;
element: Element;
center: Array<number>;
component: dxVectorMap;
element: Element;
}) => void;
/** A handler for the tooltipShown event. */
onTooltipShown?: (e: {
+27 -30
View File
@@ -1,17 +1,36 @@
// Type definitions for Drop v1.3.0
// Type definitions for Drop v1.4
// Project: http://github.hubspot.com/drop/
// Definitions by: Adi Dahiya <https://github.com/adidahiya>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
///<reference path="../tether/tether.d.ts" />
declare module drop {
// global Drop constructor
declare class Drop {
constructor(options: Drop.IDropOptions);
interface DropStatic {
new(options: IDropOptions): Drop;
createContext(options: IDropContextOptions): DropStatic;
}
public content: HTMLElement;
public element: HTMLElement;
public tether: Tether;
public open(): void;
public close(): void;
public remove(): void;
public toggle(): void;
public isOpened(): boolean;
public position(): void;
public destroy(): void;
/*
* Drop instances fire "open" and "close" events.
*/
public on(event: string, handler: Function, context?: any): void;
public once(event: string, handler: Function, context?: any): void;
public off(event: string, handler?: Function): void;
public static createContext(options: Drop.IDropContextOptions): Drop;
}
declare module Drop {
interface IDropContextOptions {
classPrefix?: string;
defaults?: IDropOptions;
@@ -27,33 +46,11 @@ declare module drop {
constrainToScrollParent?: boolean;
remove?: boolean;
beforeClose?: () => boolean;
tetherOptions?: tether.ITetherOptions;
tetherOptions?: Tether.ITetherOptions;
}
interface Drop {
content: HTMLElement;
element: HTMLElement;
tether: tether.Tether;
open(): void;
close(): void;
remove(): void;
toggle(): void;
isOpened(): boolean;
position(): void;
destroy(): void;
/*
* Drop instances fire "open" and "close" events.
*/
on(event: string, handler: Function, context?: any): void;
once(event: string, handler: Function, context?: any): void;
off(event: string, handler?: Function): void;
}
}
declare module "drop" {
export = drop;
export = Drop;
}
declare var Drop: drop.DropStatic;
+5
View File
@@ -0,0 +1,5 @@
/// <reference path="fromjs.d.ts" />
var array = [1, 2, 3, 4];
from(array).each(function (value, key) {
console.log('Value ' + value + ' at index ' + key);
});
+46
View File
@@ -0,0 +1,46 @@
// Type definitions for fromjs v2.1.6.1
// Project: https://github.com/suckgamony/fromjs
// Definitions by: Glenn Dierckx <https://github.com/glenndierckx>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare function from<T>(results: Array<T>): FromJS.IQueryable<T>;
declare function from<T>(results: any): FromJS.IQueryable<any>;
declare module FromJS {
export interface IOrderedQueryable<T> extends IQueryable<T> {
thenBy<TResult>(item: (item: T) => TResult): IOrderedQueryable<T>;
thenByDesc<TResult>(item: (item: T) => TResult): IOrderedQueryable<T>;
}
export interface IQueryable<T> {
where(predicate: (item: T) => boolean): IQueryable<T>;
select<TResult>(item: (item: T) => TResult): IQueryable<TResult>;
orderByDesc<TResult>(item: (item: T) => TResult): IOrderedQueryable<T>;
orderBy<TResult>(item: (item: T) => TResult): IOrderedQueryable<T>;
selectMany<TResult>(item: (item: T) => Array<TResult>): IQueryable<TResult>;
skip<TResult>(count: Number): IQueryable<TResult>;
take<TResult>(count: Number): IQueryable<TResult>;
single(): T;
single(predicate: (item: T) => boolean): T;
singleOrDefault(): T;
singleOrDefault(predicate: (item: T) => boolean): T;
first(): T;
last(): T;
max(): T;
distinct(): IQueryable<T>;
count(): number;
contains(item: T): boolean;
first(predicate: (item: T) => boolean): T;
firstOrDefault(): T;
each(action: (item: T) => void): void;
each<TKey>(action: (value: T, key: TKey) => void): void;
each(action: (item: T) => void, a: boolean): void;
toArray(): Array<T>;
concat(second: Array<T>): IQueryable<T>;
sum(): T;
distinct(): IQueryable<T>;
any(): boolean;
any(predicate: (item: T) => boolean): boolean;
all(predicate: (item: T) => boolean): boolean;
}
}
+8
View File
@@ -0,0 +1,8 @@
/// <reference path="gandi-livedns.d.ts" />
let zone: ZoneRecord = {
rrset_name: "MyZone",
rrset_type: "AAAA",
rrset_ttl: 10800,
rrset_values: []
}
+42
View File
@@ -0,0 +1,42 @@
// Type definitions for Gandi LiveDNS
// Project: http://doc.livedns.gandi.net/
// Definitions by: Xavier Stouder <https://github.com/xstoudi/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface Zone {
uuid: string;
name: string;
primary_ns: string;
apex_alias: string;
email: string;
serial: number;
refresh: number;
retry: number;
expire: number;
minimum: number;
}
interface ZoneRecord {
rrset_name: string;
/**
* One of A, AAA, CNAME, MX, NS, TXT, WKS, SRV, LOC, SPF, SSHFP, DNAME
*/
rrset_type: string;
rrset_ttl: number;
rrset_values: string[];
}
interface Domain {
fqdn: string;
zone_uuid: string;
}
interface Snapshot {
serial: number;
zone_uuid: string;
/**
* Can be used as a date with "new Date(change_time);"
*/
change_time: string;
zone_data: ZoneRecord[];
}
+1 -1
View File
@@ -353,7 +353,7 @@ declare module google.maps {
setDraggable(flag: boolean): void;
setIcon(icon: string|Icon|Symbol): void;
setMap(map: Map|StreetViewPanorama): void;
getOpacity(opacity: number): void;
setOpacity(opacity: number): void;
setOptions(options: MarkerOptions): void;
setPlace(place: Place): void;
setPosition(latlng: LatLng|LatLngLiteral): void;
+51 -3
View File
@@ -135,6 +135,51 @@ function originalTests() {
var multipleYAxisOptions: HighchartsOptions = {
yAxis: [{}, {}]
};
var renderToIdChart = new Highcharts.Chart("container", {
xAxis: {},
series: [<HighchartsLineChartSeriesOptions>{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4],
type: "line",
allowPointSelect: true
}]
});
var renderToElementChart = new Highcharts.Chart(div, {
xAxis: {},
series: [<HighchartsLineChartSeriesOptions>{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4],
type: "line",
allowPointSelect: true
}]
});
var createWithFunction = Highcharts.chart({
xAxis: {},
series: [<HighchartsLineChartSeriesOptions>{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4],
type: "line",
allowPointSelect: true
}]
});
var createWithFunctionRenderToId = Highcharts.chart("container", {
xAxis: {},
series: [<HighchartsLineChartSeriesOptions>{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4],
type: "line",
allowPointSelect: true
}]
});
var createWithFunctionRenderToElement = Highcharts.chart(div, {
xAxis: {},
series: [<HighchartsLineChartSeriesOptions>{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4],
type: "line",
allowPointSelect: true
}]
});
}
function test_alldefaults() {
@@ -1554,15 +1599,18 @@ function test_Line() {
series: [<HighchartsLineChartSeriesOptions>{
data: [1, 2, 3, 4, null, 6, 7, null, 9],
step: 'right',
name: 'Right'
name: 'Right',
linecap: 'round'
}, <HighchartsLineChartSeriesOptions>{
data: [5, 6, 7, 8, null, 10, 11, null, 13],
step: 'center',
name: 'Center'
name: 'Center',
linecap: 'round'
}, <HighchartsLineChartSeriesOptions>{
data: [9, 10, 11, 12, null, 14, 15, null, 17],
step: 'left',
name: 'Left'
name: 'Left',
linecap: 'round'
}]
});
}
+45 -7
View File
@@ -117,6 +117,13 @@ interface HighchartsAxisLabels {
* @default 5
*/
padding?: number;
/**
* Whether to reserve space for the labels. This can be turned off when for example the labels are rendered inside
* the plot area instead of outside.
* @default true
* @since 4.1.10
*/
reserveSpace?: boolean;
/**
* Rotation of the labels in degrees.
* @default 0
@@ -3666,6 +3673,11 @@ interface HighchartsSeriesChart {
* @default 2
*/
lineWidth?: number;
/**
* The line cap used for line ends and line joins on the graph.
* @default 'round'
*/
linecap?: string;
/**
* The id of another series to link to. Additionally, the value can be ':previous' to link to the previous series.
* When two series are linked, only the first one appears in the legend. Toggling the visibility of this also
@@ -4432,12 +4444,6 @@ interface HighchartsLineChart extends HighchartsSeriesChart {
* @since 1.2.5
*/
step?: boolean|string;
/**
* The line cap used for line ends and line joins on the graph.
* @default 'round'
*/
linecap?: string;
}
/**
@@ -4445,7 +4451,9 @@ interface HighchartsLineChart extends HighchartsSeriesChart {
*/
interface HighchartsPieChart extends HighchartsSeriesChart {
/**
* The color of the border surrounding each column or bar.
* The color of the border surrounding each slice. When null, the border takes the same color as the slice fill.
* This can be used together with a borderWidth to fill drawing gaps created by antialiazing artefacts in
* borderless pies.
* @default '#FFFFFF'
*/
borderColor?: string;
@@ -4724,6 +4732,11 @@ interface HighchartsTreeMapChart extends HighchartsSeriesChart {
* @since 4.1.8
*/
maxPointWidth?: number;
/**
* The sort index of the point inside the treemap level.
* @since 4.1.10
*/
sortIndex?: number;
/**
* A wrapper object for all the series options in specific states.
*/
@@ -5789,6 +5802,21 @@ interface HighchartsChart {
* @return {HighchartsChartObject}
*/
new (options: HighchartsOptions, callback: (chart: HighchartsChartObject) => void): HighchartsChartObject;
/**
* This is the constructor for creating a new chart object.
* @param {string|HTMLElement} renderTo The id or a reference to a DOM element where the chart should be rendered (since v4.2.0).
* @param {HighchartsOptions} options The chart options
* @return {HighchartsChartObject}
*/
new (renderTo: string | HTMLElement, options: HighchartsOptions): HighchartsChartObject;
/**
* This is the constructor for creating a new chart object.
* @param {string|HTMLElement} renderTo The id or a reference to a DOM element where the chart should be rendered (since v4.2.0).
* @param {HighchartsOptions} options The chart options
* @param callback A function to execute when the chart object is finished loading and rendering. In most cases the chart is built in one thread, but in Internet Explorer version 8 or less the chart is sometimes initiated before the document is ready, and in these cases the chart object will not be finished directly after callingnew Highcharts.Chart(). As a consequence, code that relies on the newly built Chart object should always run in the callback. Defining a chart.event.load handler is equivalent.
* @return {HighchartsChartObject}
*/
new (renderTo: string | HTMLElement, options: HighchartsOptions, callback: (chart: HighchartsChartObject) => void): HighchartsChartObject;
}
/**
@@ -5970,6 +5998,16 @@ interface HighchartsStatic {
Renderer: HighchartsRenderer;
Color(color: string | HighchartsGradient): string | HighchartsGradient;
/**
* As Highcharts.Chart, but without need for the new keyword.
* @since 4.2.0
*/
chart(options: HighchartsOptions, callback?: (chart: HighchartsChartObject) => void): HighchartsChartObject;
/**
* As Highcharts.Chart, but without need for the new keyword.
* @since 4.2.0
*/
chart(renderTo: string | HTMLElement, options: HighchartsOptions, callback?: (chart: HighchartsChartObject) => void): HighchartsChartObject;
/**
* An array containing the current chart objects in the page. A chart's position in the array is preserved
* throughout the page's lifetime. When a chart is destroyed, the array item becomes undefined.
+8 -3
View File
@@ -1,4 +1,4 @@
// Type definitions for highlight.js v8.2.0
// Type definitions for highlight.js v9.1.0
// Project: https://github.com/isagalaev/highlight.js
// Definitions by: Niklas Mollenhauer <https://github.com/nikeee/>, Jeremy Hull <https://github.com/sourrust>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -35,6 +35,11 @@ declare module hljs
export function inherit(parent: Object, obj: Object): Object;
export function COMMENT(
begin: (string|RegExp),
end: (string|RegExp),
inherits: IModeBase): IMode;
// Common regexps
export var IDENT_RE: string;
export var UNDERSCORE_IDENT_RE: string;
@@ -111,8 +116,8 @@ declare module hljs
{
className?: string;
aliases?: string[];
begin?: string;
end?: string;
begin?: (string|RegExp);
end?: (string|RegExp);
case_insensitive?: boolean;
beginKeyword?: string;
endsWithParent?: boolean;
+10
View File
@@ -0,0 +1,10 @@
/// <reference path="jsend.d.ts" />
import jsend = require('jsend');
var valid: boolean = jsend.isValid({ status: 'success' });
var success = jsend.success('data');
var error = jsend.error('some error');
error = jsend.error({ message: 'nessage', code: 123 });
+46
View File
@@ -0,0 +1,46 @@
// Type definitions for jsend 1.0.2
// Project: https://github.com/Prestaul/jsend
// Definitions by: Federico Caselli <https://github.com/CaselIT>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module Express {
export interface Response {
jsend: jsend.jsendExpress;
}
}
declare module jsend {
interface JSendObject {
status: string;
code?: number;
data?: any;
message?: string;
}
interface jsendCore {
success(data: Object): JSendObject;
fail(data: Object): JSendObject;
error(message: string | { message: string, code?: number, data?: Object }): JSendObject;
}
interface jsendExpress extends jsendCore {
(err: string | Object, json?: Object): void
}
interface jsend extends jsendCore {
isValid(json: Object): boolean;
forward(json: Object, done: (err: any, data: any) => any):void;
fromArguments(err: string | Object, json?: Object): JSendObject;
middleware(req: any, res: any, next: Function): any;
}
interface jsendExport extends jsend {
(config?: { strict: boolean }, host?: Object): jsend
}
var jsend: jsendExport;
}
declare module "jsend" {
export = jsend.jsend;
}
+29 -5
View File
@@ -43,12 +43,16 @@ declare module "jsonwebtoken" {
maxAge?: string;
}
export interface VerifyCallbak {
export interface VerifyCallback {
(err: Error, decoded: any): void;
}
export interface SignCallback {
(err: Error, encoded: string): void;
}
/**
* Sign the given payload into a JSON Web Token string
* Synchronously sign the given payload into a JSON Web Token string
* @param {String|Object|Buffer} payload - Payload to sign, could be an literal, buffer or string
* @param {String|Buffer} secretOrPrivateKey - Either the secret for HMAC algorithms, or the PEM encoded private key for RSA and ECDSA.
* @param {SignOptions} [options] - Options for the signature
@@ -57,14 +61,34 @@ declare module "jsonwebtoken" {
export function sign(payload: string | Buffer | Object, secretOrPrivateKey: string | Buffer, options?: SignOptions): string;
/**
* Verify given token using a secret or a public key to get a decoded token
* Sign the given payload into a JSON Web Token string
* @param {String|Object|Buffer} payload - Payload to sign, could be an literal, buffer or string
* @param {String|Buffer} secretOrPrivateKey - Either the secret for HMAC algorithms, or the PEM encoded private key for RSA and ECDSA.
* @param {SignOptions} [options] - Options for the signature
* @param {Function} callback - Callback to get the encoded token on
*/
export function sign(payload: string | Buffer | Object, secretOrPrivateKey: string | Buffer, callback: SignCallback): void;
export function sign(payload: string | Buffer | Object, secretOrPrivateKey: string | Buffer, options: SignOptions, callback: SignCallback): void;
/**
* Synchronously verify given token using a secret or a public key to get a decoded token
* @param {String} token - JWT string to verify
* @param {String|Buffer} secretOrPublicKey - Either the secret for HMAC algorithms, or the PEM encoded public key for RSA and ECDSA.
* @param {VerifyOptions} [options] - Options for the verification
* @returns The decoded token.
*/
function verify(token: string, secretOrPublicKey: string | Buffer): any;
function verify(token: string, secretOrPublicKey: string | Buffer, options?: VerifyOptions): any;
/**
* Asynchronously verify given token using a secret or a public key to get a decoded token
* @param {String} token - JWT string to verify
* @param {String|Buffer} secretOrPublicKey - Either the secret for HMAC algorithms, or the PEM encoded public key for RSA and ECDSA.
* @param {VerifyOptions} [options] - Options for the verification
* @param {Function} callback - Callback to get the decoded token on
*/
function verify(token: string, secretOrPublicKey: string | Buffer, callback?: VerifyCallbak): void;
function verify(token: string, secretOrPublicKey: string | Buffer, options?: VerifyOptions, callback?: VerifyCallbak): void;
function verify(token: string, secretOrPublicKey: string | Buffer, callback?: VerifyCallback): void;
function verify(token: string, secretOrPublicKey: string | Buffer, options?: VerifyOptions, callback?: VerifyCallback): void;
/**
* Returns the decoded payload without verifying if the signature is valid.
+24 -14
View File
@@ -9953,6 +9953,29 @@ module TestNoop {
}
}
namespace TestNthArg {
type SampleFunc = (...args: any[]) => any;
{
let result: SampleFunc;
result = _.nthArg<SampleFunc>();
result = _.nthArg<SampleFunc>(1);
}
{
let result: _.LoDashImplicitObjectWrapper<SampleFunc>;
result = _(1).nthArg<SampleFunc>();
}
{
let result: _.LoDashExplicitObjectWrapper<SampleFunc>;
result = _(1).chain().nthArg<SampleFunc>();
}
}
// _.over
namespace TestOver {
{
@@ -10173,26 +10196,14 @@ module TestTimes {
let result: number[];
result = _.times(42);
result = _(42).times();
}
{
let result: TResult[];
result = _.times(42, iteratee);
result = _.times(42, iteratee, any);
}
{
let result: _.LoDashImplicitArrayWrapper<number>;
result = _(42).times();
}
{
let result: _.LoDashImplicitArrayWrapper<TResult>;
result = _(42).times(iteratee);
result = _(42).times(iteratee, any);
}
{
@@ -10205,7 +10216,6 @@ module TestTimes {
let result: _.LoDashExplicitArrayWrapper<TResult>;
result = _(42).chain().times(iteratee);
result = _(42).chain().times(iteratee, any);
}
}
+32 -11
View File
@@ -16308,6 +16308,31 @@ declare module _ {
noop(...args: any[]): _.LoDashExplicitWrapper<void>;
}
//_.nthArg
interface LoDashStatic {
/**
* Creates a function that returns its nth argument.
*
* @param n The index of the argument to return.
* @return Returns the new function.
*/
nthArg<TResult extends Function>(n?: number): TResult;
}
interface LoDashImplicitWrapper<T> {
/**
* @see _.nthArg
*/
nthArg<TResult extends Function>(): LoDashImplicitObjectWrapper<TResult>;
}
interface LoDashExplicitWrapper<T> {
/**
* @see _.nthArg
*/
nthArg<TResult extends Function>(): LoDashExplicitObjectWrapper<TResult>;
}
//_.over
interface LoDashStatic {
/**
@@ -16632,18 +16657,16 @@ declare module _ {
//_.times
interface LoDashStatic {
/**
* Invokes the iteratee function n times, returning an array of the results of each invocation. The iteratee is
* bound to thisArg and invoked with one argument; (index).
* Invokes the iteratee function n times, returning an array of the results of each invocation. The iteratee
* is invoked with one argument; (index).
*
* @param n The number of times to invoke iteratee.
* @param iteratee The function invoked per iteration.
* @param thisArg The this binding of iteratee.
* @return Returns the array of results.
*/
times<TResult>(
n: number,
iteratee: (num: number) => TResult,
thisArg?: any
iteratee: (num: number) => TResult
): TResult[];
/**
@@ -16657,14 +16680,13 @@ declare module _ {
* @see _.times
*/
times<TResult>(
iteratee: (num: number) => TResult,
thisArgs?: any
): LoDashImplicitArrayWrapper<TResult>;
iteratee: (num: number) => TResult
): TResult[];
/**
* @see _.times
*/
times(): LoDashImplicitArrayWrapper<number>;
times(): number[];
}
interface LoDashExplicitWrapper<T> {
@@ -16672,8 +16694,7 @@ declare module _ {
* @see _.times
*/
times<TResult>(
iteratee: (num: number) => TResult,
thisArgs?: any
iteratee: (num: number) => TResult
): LoDashExplicitArrayWrapper<TResult>;
/**
+7
View File
@@ -77,3 +77,10 @@ var mockedFS = mock.fs({
if (mockedFS.readFileSync('/file', { encoding: 'utf8' }) === 'blah') {
console.log('woo');
}
mock({
'path/to/file.txt': 'file content here'
}, {
createTmp: true,
createCwd: false
});
+10 -4
View File
@@ -1,6 +1,6 @@
// Type definitions for mock-fs 2.5.0
// Type definitions for mock-fs 3.6.0
// Project: https://github.com/tschaub/mock-fs
// Definitions by: Wim Looman <https://github.com/Nemo157>
// Definitions by: Wim Looman <https://github.com/Nemo157>, Qubo <https://github.com/tkqubo>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
@@ -8,7 +8,7 @@
declare module "mock-fs" {
import fs = require("fs");
function mock(config?: mock.Config): void;
function mock(config?: mock.Config, options?: mock.Options): void;
module mock {
function file(config: FileConfig): File;
@@ -17,12 +17,17 @@ declare module "mock-fs" {
function restore(): void;
function fs(config?: Config): typeof fs;
function fs(config?: Config, options?: Options): typeof fs;
interface Config {
[path: string]: string | Buffer | File | Directory | Symlink | Config;
}
interface Options {
createCwd?: boolean;
createTmp?: boolean;
}
interface CommonConfig {
mode?: number;
uid?: number;
@@ -30,6 +35,7 @@ declare module "mock-fs" {
atime?: Date;
ctime?: Date;
mtime?: Date;
birthtime?: Date;
}
interface FileConfig extends CommonConfig {
+3 -2
View File
@@ -18,7 +18,7 @@ declare module moment {
seconds?: number;
milliseconds?: number;
}
interface MomentInput {
/** Year */
years?: number;
@@ -313,6 +313,7 @@ declare module moment {
* @since 2.10.7+
*/
isSameOrBefore(b: MomentComparable, granularity?: string): boolean;
isSameOrAfter(b: MomentComparable, granularity?: string): boolean;
/**
* @deprecated since version 2.8.0
@@ -344,7 +345,7 @@ declare module moment {
get(unit: string): number;
set(unit: string, value: number): Moment;
set(objectLiteral: MomentInput): Moment;
/**
* This returns an object containing year, month, day-of-month, hour, minute, seconds, milliseconds.
* @since 2.10.5+
+13
View File
@@ -0,0 +1,13 @@
/// <reference path="once.d.ts" />
import once from "once";
once(() => 3);
once(() => 3)();
let s = once(() => ({foo: 1}))();
s.foo;
once.proto();
once(() => 3).called && true;
once(() => ({foo: 1})).value.foo;
+23
View File
@@ -0,0 +1,23 @@
// Type definitions for once v1.3.3
// Project: https://github.com/isaacs/once
// Definitions by: Denis Sokolov <https://github.com/denis-sokolov>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface SimpleFunction<Result> {
(...args: any[]): Result;
}
interface OnceFunction<Result> extends SimpleFunction<Result> {
called: boolean;
value: Result;
}
interface Once {
<Result>(f: SimpleFunction<Result>): OnceFunction<Result>;
proto: Function;
}
declare module "once" {
var once: Once;
export default once;
}
@@ -0,0 +1,60 @@
/// <reference path="./passport-http-bearer.d.ts"/>
/**
* Created by Isman Usoh <https://github.com/isman-usoh>.
*/
import express = require("express");
import passport = require("passport");
import httpBearer = require("passport-http-bearer");
//#region Test Models
interface IUser {
token: string;
}
class User implements IUser {
public token: string;
static findOne(user: IUser, callback: (err: Error, user: User) => void): void {
callback(null, new User());
}
}
//#endregion
passport.use(new httpBearer.Strategy((token: string, done: any) => {
User.findOne({ token: token }, function(err, user) {
if (err) {
return done(err);
}
if (!user) {
return done(null, false);
}
return done(null, user);
});
}));
passport.use(new httpBearer.Strategy({
scope: ["read", "write"],
realm: "User",
passReqToCallback: true
}, function(req: express.Request, token: string, done: any) {
User.findOne({ token: token }, function(err, user) {
if (err) {
return done(err, null, { message: "Access Denied" });
}
if (!user) {
return done(null, false, "Access Denied");
}
return done(null, user);
});
}));
let app = express();
app.post("/login", passport.authenticate("bearer", { failureRedirect: "/login" }), function(req, res) {
res.redirect("/");
});
+40
View File
@@ -0,0 +1,40 @@
// Type definitions for passport-http-bearer 1.0.1
// Project: https://github.com/jaredhanson/passport-http-bearer
// Definitions by: Isman Usoh <https://github.com/isman-usoh>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../passport/passport.d.ts"/>
/// <reference path="../express/express.d.ts"/>
declare module "passport-http-bearer" {
import passport = require("passport");
import express = require("express");
interface IStrategyOptions {
scope: string | Array<string>;
realm: string;
passReqToCallback: boolean;
}
interface IVerifyOptions {
message: string;
scope: string | Array<string>;
}
interface VerifyFunction {
(token: string, done: (error: any, user?: any, options?: IVerifyOptions | string) => void): void;
}
interface VerifyFunctionWithRequest {
(req: express.Request, token: string, done: (error: any, user?: any, options?: IVerifyOptions | string) => void): void;
}
class Strategy implements passport.Strategy {
constructor(verify: VerifyFunction);
constructor(options: IStrategyOptions, verify: VerifyFunction);
constructor(options: IStrategyOptions, verify: VerifyFunctionWithRequest);
name: string;
authenticate: (req: express.Request, options?: Object) => void;
}
}
+1
View File
@@ -1,4 +1,5 @@
/// <reference path="prettyjson.d.ts" />
import prettyjson = require("prettyjson");
var options: prettyjson.RendererOptions,
input: string,
+1 -1
View File
@@ -4,7 +4,7 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module prettyjson {
declare module "prettyjson" {
/**
* Defines prettyjson version
@@ -20,3 +20,17 @@ function MyComponent() {
}
DayPicker2.DateUtils.clone(new Date());
DayPicker2.DateUtils.isDayInRange(new Date(), { from: new Date() });
// test interface for captionElement prop
interface MyCaptionProps extends ReactDayPicker.CaptionElementProps { }
class Caption extends React.Component<MyCaptionProps, {}> {
render() {
const { date, locale, localeUtils, onClick } = this.props;
return (
<div className="DayPicker-Caption" onClick={ onClick }>
{ localeUtils.formatMonthTitle(date, locale) }
</div>
);
}
}
<DayPicker captionElement={<Caption/>}/>
+21 -9
View File
@@ -1,4 +1,4 @@
// Type definitions for react-day-picker v1.1.4
// Type definitions for react-day-picker v1.2.0
// Project: https://github.com/gpbl/react-day-picker
// Definitions by: Giampaolo Bellavite <https://github.com/gpbl>, Jason Killian <https://github.com/jkillian>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -13,18 +13,28 @@ declare module "react-day-picker" {
declare var DayPicker: typeof ReactDayPicker.DayPicker;
declare namespace ReactDayPicker {
import React = __React;
interface LocaleUtils {
formatMonthTitle: (month: Date, locale: string) => string;
formatWeekdayShort: (weekday: number, locale: string) => string;
formatWeekdayLong: (weekday: number, locale: string) => string;
getFirstDayOfWeek: (locale: string) => number;
getMonths: (locale: string) => string[];
}
interface Modifiers {
[name: string]: (date: Date) => boolean;
}
interface Props extends __React.Props<DayPicker>{
interface CaptionElementProps extends React.Props<any> {
date?: Date;
localeUtils?: LocaleUtils;
locale?: string;
onClick?: React.MouseEventHandler;
}
interface Props extends React.Props<DayPicker>{
modifiers?: Modifiers;
initialMonth?: Date;
numberOfMonths?: number;
@@ -35,18 +45,19 @@ declare namespace ReactDayPicker {
toMonth?: Date;
localeUtils?: LocaleUtils;
locale?: string;
onDayClick?: (e: __React.SyntheticEvent, day: Date, modifiers: string[]) => any;
onDayTouchTap?: (e: __React.SyntheticEvent, day: Date, modifiers: string[]) => any;
onDayMouseEnter?: (e: __React.SyntheticEvent, day: Date, modifiers: string[]) => any;
onDayMouseLeave?: (e: __React.SyntheticEvent, day: Date, modifiers: string[]) => any;
captionElement?: React.ReactElement<CaptionElementProps>;
onDayClick?: (e: React.SyntheticEvent, day: Date, modifiers: string[]) => any;
onDayTouchTap?: (e: React.SyntheticEvent, day: Date, modifiers: string[]) => any;
onDayMouseEnter?: (e: React.SyntheticEvent, day: Date, modifiers: string[]) => any;
onDayMouseLeave?: (e: React.SyntheticEvent, day: Date, modifiers: string[]) => any;
onMonthChange?: (month: Date) => any;
onCaptionClick?: (e: __React.SyntheticEvent, month: Date) => any;
onCaptionClick?: (e: React.SyntheticEvent, month: Date) => any;
className?: string;
style?: __React.CSSProperties;
style?: React.CSSProperties;
tabIndex?: number;
}
class DayPicker extends __React.Component<Props, {}> {
class DayPicker extends React.Component<Props, {}> {
showMonth(month: Date): void;
showPreviousMonth(): void;
showNextMonth(): void;
@@ -55,6 +66,7 @@ declare namespace ReactDayPicker {
namespace DayPicker {
var LocaleUtils: LocaleUtils;
namespace DateUtils {
function addMonths(d: Date, n: number): Date;
function clone(d: Date): Date;
function isSameDay(d1?: Date, d2?: Date): boolean;
function isPastDay(d: Date): boolean;
+1 -1
View File
@@ -2712,7 +2712,7 @@ declare namespace __React {
* Fires at most once per frame during scrolling.
* The frequency of the events can be contolled using the scrollEventThrottle prop.
*/
onScroll?: () => void
onScroll?: (event?: { nativeEvent: NativeScrollEvent }) => void
/**
* Experimental: When true offscreen child views (whose `overflow` value is
@@ -0,0 +1,20 @@
/// <reference path="./react-router-redux.d.ts" />
/// <reference path="../redux/redux.d.ts" />
/// <reference path="../react-router/react-router.d.ts" />
import { createStore, combineReducers, applyMiddleware } from 'redux';
import { browserHistory } from 'react-router';
import { syncHistory, routeReducer } from 'react-router-redux';
const reducer = combineReducers({ routing: routeReducer });
// Sync dispatched route actions to the history
const reduxRouterMiddleware = syncHistory(browserHistory);
const createStoreWithMiddleware = applyMiddleware(reduxRouterMiddleware)(createStore);
const store = createStoreWithMiddleware(reducer);
// Required for replaying actions from devtools to
reduxRouterMiddleware.listenForReplays(store);
+48
View File
@@ -0,0 +1,48 @@
// Type definitions for react-router-redux v2.1.0
// Project: https://github.com/rackt/react-router-redux
// Definitions by: Isman Usoh <http://github.com/isman-usoh>, Noah Shipley <https://github.com/noah79>, Dimitri Rosenberg <https://github.com/rosendi>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../redux/redux.d.ts" />
/// <reference path="../react-router/react-router.d.ts"/>
declare namespace ReactRouterRedux {
import R = Redux;
import H = HistoryModule;
const TRANSITION: string;
const UPDATE_LOCATION: string;
const push: PushAction;
const replace: ReplaceAction;
const go: GoAction;
const goBack: GoForwardAction;
const goForward: GoBackAction;
const routeActions: RouteActions;
type LocationDescriptor = H.Location | H.Path;
type PushAction = (nextLocation: LocationDescriptor) => void;
type ReplaceAction = (nextLocation: LocationDescriptor) => void;
type GoAction = (n: number) => void;
type GoForwardAction = () => void;
type GoBackAction = () => void;
interface RouteActions {
push: PushAction;
replace: ReplaceAction;
go: GoAction;
goForward: GoForwardAction;
goBack: GoBackAction;
}
interface HistoryMiddleware extends R.Middleware {
listenForReplays(store: R.Store, selectLocationState?: Function): void;
unsubscribe(): void;
}
function routeReducer(state?: any, options?: any): R.Reducer;
function syncHistory(history: H.History): HistoryMiddleware;
}
declare module "react-router-redux" {
export = ReactRouterRedux;
}
+8 -3
View File
@@ -146,9 +146,10 @@ var StatelessComponent = (props: SCProps) => {
return React.DOM.div(null, props.foo);
};
// Must explicitly type-annotate to add defaultProps/contextTypes
// Must explicitly type-annotate to add displayName/defaultProps/contextTypes
var StatelessComponent2: React.StatelessComponent<SCProps> =
(props: SCProps) => React.DOM.div(null, props.foo);
StatelessComponent2.displayName = "StatelessComponent2";
StatelessComponent2.defaultProps = {
foo: 42
};
@@ -405,7 +406,8 @@ var mappedChildrenArray: number[] =
React.Children.map<number>(children, (child) => { return 42; });
React.Children.forEach(children, (child) => {});
var nChildren: number = React.Children.count(children);
var onlyChild = React.Children.only([null, [[["Hallo"], true]], false]);
var onlyChild: React.ReactElement<any> = React.Children.only(React.DOM.div()); // ok
onlyChild = React.Children.only([null, [[["Hallo"], true]], false]); // error
var childrenToArray: React.ReactChild[] = React.Children.toArray(children);
//
@@ -521,7 +523,10 @@ React.createClass({
//
// TestUtils addon
// --------------------------------------------------------------------------
var node: Element;
var inst: ModernComponent = TestUtils.renderIntoDocument<ModernComponent>(element);
var node: Element = TestUtils.renderIntoDocument(React.DOM.div());
TestUtils.Simulate.click(node);
TestUtils.Simulate.change(node);
TestUtils.Simulate.keyDown(node, { key: "Enter" });
+2 -1
View File
@@ -149,6 +149,7 @@ declare namespace __React {
propTypes?: ValidationMap<P>;
contextTypes?: ValidationMap<any>;
defaultProps?: P;
displayName?: string;
}
interface ComponentClass<P> {
@@ -2077,7 +2078,7 @@ declare namespace __React {
map<T>(children: ReactNode, fn: (child: ReactChild, index: number) => T): T[];
forEach(children: ReactNode, fn: (child: ReactChild, index: number) => any): void;
count(children: ReactNode): number;
only(children: ReactNode): ReactChild;
only(children: ReactNode): ReactElement<any>;
toArray(children: ReactNode): ReactChild[];
}
+42
View File
@@ -0,0 +1,42 @@
/// <reference path="reselect.d.ts" />
import {createSelector, defaultMemoize} from "reselect";
type Item1 = {
prop1: number;
}
type Item2 = {
prop2: number;
}
type State = {
item1: Item1,
item2: Item2
}
function getItem1(state: State, props: any): Item1 {
return state.item1;
}
function getItem2(state: State, props: any): Item2 {
return state.item2;
}
const selector = createSelector(
getItem1,
getItem2,
(item1: Item1, item2: Item2) => {
return item1.prop1 + item2.prop2;
}
);
const state = {
item1: { prop1: 10 },
item2: { prop2: 20 }
}
const props = { multiplier: 10 };
const total: number = selector(state, props);
const getItem2Memoized = defaultMemoize(getItem2);
const memItem: Item2 = getItem2Memoized(state, {});
+36
View File
@@ -0,0 +1,36 @@
// Type definitions for reselect v2.0.2
// Project: https://github.com/rackt/reselect
// Definitions by: Frank Wallis <https://github.com/frankwallis>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module Reselect {
type Selector<TInput, TOutput> = (state: TInput, props?: any) => TOutput;
function createSelector<TInput, TOutput, T1>(selector1: Selector<TInput, T1>, combiner: (arg1: T1) => TOutput): Selector<TInput, TOutput>;
function createSelector<TInput, TOutput, T1, T2>(selector1: Selector<TInput, T1>, selector2: Selector<TInput, T2>, combiner: (arg1: T1, arg2: T2) => TOutput): Selector<TInput, TOutput>;
function createSelector<TInput, TOutput, T1, T2, T3>(selector1: Selector<TInput, T1>, selector2: Selector<TInput, T2>, selector3: Selector<TInput, T3>, combiner: (arg1: T1, arg2: T2, arg3: T3) => TOutput): Selector<TInput, TOutput>;
function createSelector<TInput, TOutput, T1, T2, T3, T4>(selector1: Selector<TInput, T1>, selector2: Selector<TInput, T2>, selector3: Selector<TInput, T3>, selector4: Selector<TInput, T4>, combiner: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => TOutput): Selector<TInput, TOutput>;
function createSelector<TInput, TOutput, T1, T2, T3, T4, T5>(selector1: Selector<TInput, T1>, selector2: Selector<TInput, T2>, selector3: Selector<TInput, T3>, selector4: Selector<TInput, T4>, selector5: Selector<TInput, T5>, combiner: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => TOutput): Selector<TInput, TOutput>;
function createSelector<TInput, TOutput, T1, T2, T3, T4, T5, T6>(selector1: Selector<TInput, T1>, selector2: Selector<TInput, T2>, selector3: Selector<TInput, T3>, selector4: Selector<TInput, T4>, selector5: Selector<TInput, T5>, selector6: Selector<TInput, T6>, combiner: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => TOutput): Selector<TInput, TOutput>;
function createSelector<TInput, TOutput, T1, T2, T3, T4, T5, T6, T7>(selector1: Selector<TInput, T1>, selector2: Selector<TInput, T2>, selector3: Selector<TInput, T3>, selector4: Selector<TInput, T4>, selector5: Selector<TInput, T5>, selector6: Selector<TInput, T6>, selector7: Selector<TInput, T7>, combiner: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7) => TOutput): Selector<TInput, TOutput>;
function createSelector<TInput, TOutput, T1, T2, T3, T4, T5, T6, T7, T8>(selector1: Selector<TInput, T1>, selector2: Selector<TInput, T2>, selector3: Selector<TInput, T3>, selector4: Selector<TInput, T4>, selector5: Selector<TInput, T5>, selector6: Selector<TInput, T6>, selector7: Selector<TInput, T7>, selector8: Selector<TInput, T8>, combiner: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8) => TOutput): Selector<TInput, TOutput>;
function createSelector<TInput, TOutput, T1, T2, T3, T4, T5, T6, T7, T8, T9>(selector1: Selector<TInput, T1>, selector2: Selector<TInput, T2>, selector3: Selector<TInput, T3>, selector4: Selector<TInput, T4>, selector5: Selector<TInput, T5>, selector6: Selector<TInput, T6>, selector7: Selector<TInput, T7>, selector8: Selector<TInput, T8>, selector9: Selector<TInput, T9>, combiner: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8, arg9: T9) => TOutput): Selector<TInput, TOutput>;
function createSelector<TInput, TOutput, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(selector1: Selector<TInput, T1>, selector2: Selector<TInput, T2>, selector3: Selector<TInput, T3>, selector4: Selector<TInput, T4>, selector5: Selector<TInput, T5>, selector6: Selector<TInput, T6>, selector7: Selector<TInput, T7>, selector8: Selector<TInput, T8>, selector9: Selector<TInput, T9>, selector10: Selector<TInput, T10>, combiner: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8, arg9: T9, arg10: T10) => TOutput): Selector<TInput, TOutput>;
function createSelector<TInput, TOutput, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(selector1: Selector<TInput, T1>, selector2: Selector<TInput, T2>, selector3: Selector<TInput, T3>, selector4: Selector<TInput, T4>, selector5: Selector<TInput, T5>, selector6: Selector<TInput, T6>, selector7: Selector<TInput, T7>, selector8: Selector<TInput, T8>, selector9: Selector<TInput, T9>, selector10: Selector<TInput, T10>, selector11: Selector<TInput, T11>, combiner: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8, arg9: T9, arg10: T10, arg11: T11) => TOutput): Selector<TInput, TOutput>;
function createSelector<TInput, TOutput, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(selector1: Selector<TInput, T1>, selector2: Selector<TInput, T2>, selector3: Selector<TInput, T3>, selector4: Selector<TInput, T4>, selector5: Selector<TInput, T5>, selector6: Selector<TInput, T6>, selector7: Selector<TInput, T7>, selector8: Selector<TInput, T8>, selector9: Selector<TInput, T9>, selector10: Selector<TInput, T10>, selector11: Selector<TInput, T11>, selector12: Selector<TInput, T12>, combiner: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8, arg9: T9, arg10: T10, arg11: T11, arg12: T12) => TOutput): Selector<TInput, TOutput>;
function createSelector<TInput, TOutput, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(selector1: Selector<TInput, T1>, selector2: Selector<TInput, T2>, selector3: Selector<TInput, T3>, selector4: Selector<TInput, T4>, selector5: Selector<TInput, T5>, selector6: Selector<TInput, T6>, selector7: Selector<TInput, T7>, selector8: Selector<TInput, T8>, selector9: Selector<TInput, T9>, selector10: Selector<TInput, T10>, selector11: Selector<TInput, T11>, selector12: Selector<TInput, T12>, selector13: Selector<TInput, T13>, combiner: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8, arg9: T9, arg10: T10, arg11: T11, arg12: T12, arg13: T13) => TOutput): Selector<TInput, TOutput>;
function createSelector<TInput, TOutput, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(selector1: Selector<TInput, T1>, selector2: Selector<TInput, T2>, selector3: Selector<TInput, T3>, selector4: Selector<TInput, T4>, selector5: Selector<TInput, T5>, selector6: Selector<TInput, T6>, selector7: Selector<TInput, T7>, selector8: Selector<TInput, T8>, selector9: Selector<TInput, T9>, selector10: Selector<TInput, T10>, selector11: Selector<TInput, T11>, selector12: Selector<TInput, T12>, selector13: Selector<TInput, T13>, selector14: Selector<TInput, T14>, combiner: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, arg7: T7, arg8: T8, arg9: T9, arg10: T10, arg11: T11, arg12: T12, arg13: T13, arg14: T14) => TOutput): Selector<TInput, TOutput>;
function createStructuredSelector(inputSelectors: any, selectorCreator?: any): any;
type EqualityChecker = <T>(arg1: T, arg2: T) => boolean;
type Memoizer = <TFunc extends Function>(func: TFunc, equalityCheck?: EqualityChecker) => TFunc;
const defaultMemoize: Memoizer;
function createSelectorCreator(memoize: Memoizer, ...memoizeOptions: any[]): any;
}
declare module "reselect" {
export = Reselect
}
+7 -7
View File
@@ -51,37 +51,37 @@ declare module "tabtab" {
* Holds interesting values to drive the output of the completion.
*/
interface Data {
/**
* full command being completed
*/
line: string;
/**
* number of words
*/
words: number;
/**
* cursor position
*/
point: number;
/**
* tabing in the middle of a word: foo bar baz bar foobarrrrrrr
*/
partial: string;
/**
* last word of the line
*/
last: string;
/**
* last partial of the line
*/
lastPartial: string;
/**
* the previous word
*/
+73 -73
View File
@@ -15,13 +15,13 @@ declare module 'tedious' {
*/
name: string;
}
export interface ColumnMetaData {
/**
* The column's name
*/
colName: string;
/**
* The column type.
*/
@@ -31,18 +31,18 @@ declare module 'tedious' {
* The precision. Only applicable to numeric and decimal.
*/
precision?: number;
/**
* The scale. Only applicable to numeric, decimal, time, datetime2 and datetimeoffset.
*/
scale?: number;
/**
* The length, for char, varchar, nvarchar and varbinary.
* The length, for char, varchar, nvarchar and varbinary.
*/
dataLength?: number;
}
export interface DebugOptions {
/**
* A boolean, controlling whether debug events will be emitted with text describing packet details (default: false).
@@ -58,13 +58,13 @@ declare module 'tedious' {
* A boolean, controlling whether debug events will be emitted with text describing packet payload details (default: false).
*/
payload?: boolean;
/**
* A boolean, controlling whether debug events will be emitted with text describing token stream tokens (default: false).
*/
token?: boolean;
}
export enum ISOLATION_LEVEL {
NO_CHANGE = 0x00,
READ_UNCOMMITTED = 0x01,
@@ -73,7 +73,7 @@ declare module 'tedious' {
SERIALIZABLE = 0x04,
SNAPSHOT = 0x05
}
/**
* Unfortunately these aren't valid JavaScript identifiers
* so I cannot list the values here as enum values
@@ -89,7 +89,7 @@ declare module 'tedious' {
type: string;
name: string;
}
export interface TediousTypes {
BigInt: TediousType;
Binary: TediousType;
@@ -130,82 +130,82 @@ declare module 'tedious' {
VarChar: TediousType;
Xml: TediousType;
}
export var TYPES: TediousTypes;
export interface ConnectionOptions {
/**
* Port to connect to (default: 1433). Mutually exclusive with options.instanceName.
*/
port?: number;
/**
* The instance name to connect to. The SQL Server Browser service must be running on the database server,
* and UDP port 1444 on the database server must be reachable. (no default) Mutually exclusive with options.port.
*/
instanceName?: string;
/**
* Database to connect to (default: dependent on server configuration).
*/
database?: string;
/**
* By default, if the database requestion by options.database cannot be accessed,
* the connection will fail with an error. However, if options.fallbackToDefaultDb is set to true,
* By default, if the database requestion by options.database cannot be accessed,
* the connection will fail with an error. However, if options.fallbackToDefaultDb is set to true,
* then the user's default database will be * used instead (Default: false).
*/
fallbackToDefaultDb?: boolean;
/**
* The number of milliseconds before the attempt to connect is considered failed (default: 15000).
*/
connectTimeout?: number;
/**
* The number of milliseconds before a request is considered failed, or 0 for no timeout (default: 15000).
*/
requestTimeout?: number;
/**
* The number of milliseconds before the cancel (abort) of a request is considered failed (default: 5000).
*/
cancelTimeout?: number;
/**
* The size of TDS packets (subject to negotiation with the server). Should be a power of 2. (default: 4096).
*/
packetSize?: number;
/**
* A boolean determining whether to pass time values in UTC or local time. (default: true).
*/
useUTC?: boolean;
/**
* A boolean determining whether to rollback a transaction automatically if any error is encountered
* during the given transaction's execution. This sets the value for SET XACT_ABORT during the initial
* during the given transaction's execution. This sets the value for SET XACT_ABORT during the initial
* SQL phase of a connection (documentation).
*/
abortTransactionOnError?: boolean;
/**
* A string indicating which network interface (ip addres) to use when connecting to SQL Server.
*/
localAddress?: string;
/**
* A boolean determining whether to return rows as arrays or key-value collections. (default: false).
*/
useColumnNames?: boolean;
/**
* A boolean, controlling whether the column names returned will have the first letter converted
* to lower case (true) or not. This value is ignored if you provide a columnNameReplacer. (default: false).
*/
camelCaseColumns?: boolean;
/**
* A function with parameters (columnName, index, columnMetaData) and returning a string. If provided,
* this will be called once per column per result-set. The returned value will be used instead of the
@@ -213,56 +213,56 @@ declare module 'tedious' {
* naming conventions. (default: null).
*/
columnNameReplacer?: (columnName: string, index: number, columnMetaData: ColumnMetaData) => string;
/**
* Debug options
*/
debug?: DebugOptions;
/**
* The default isolation level that transactions will be run with. (default: READ_COMMITED).
*/
isolationLevel?: ISOLATION_LEVEL;
/**
* The default isolation level for new connections. All out-of-transaction queries are executed with this setting. (default: READ_COMMITED)
*/
connectionIsolationLevel?: ISOLATION_LEVEL;
/**
* A boolean, determining whether the connection will request read only access from a SQL Server Availability Group. For more information, see here. (default: false).
*/
readOnlyIntent?: boolean;
/**
* A boolean determining whether or not the connection will be encrypted. Set to true if you're on Windows Azure. (default: false).
*/
encrypt?: boolean;
/**
* When encryption is used, an object may be supplied that will be used for the first argument when calling tls.createSecurePair (default: {}).
*/
cryptoCredentialsDetails?: Object;
/**
* A boolean, that when true will expose received rows in Requests' done* events. See done, doneInProc and doneProc. (default: false)
* Caution: If many row are received, enabling this option could result in excessive memory usage.
*/
rowCollectionOnDone?: boolean;
/**
* A boolean, that when true will expose received rows in Requests' completion callback. See new Request. (default: false)
* Caution: If many row are received, enabling this option could result in excessive memory usage.
*/
rowCollectionOnRequestCompletion?: boolean;
/**
* The version of TDS to use. If server doesn't support specified version, negotiated version is used instead. (default: 7_4).
* Take this from tedious.TDS_VERSION.7_4 .
*/
tdsVersion?: number;
}
export interface ConnectionConfig {
/**
* User name to use for authentication.
@@ -283,13 +283,13 @@ declare module 'tedious' {
* Once you set domain, driver will connect to SQL Server using domain login.
*/
domain?: string;
/**
* Further options
*/
options?: ConnectionOptions;
}
export interface ParameterOptions {
// for VarChar, NVarChar, VarBinary
length?: number;
@@ -298,7 +298,7 @@ declare module 'tedious' {
// scale for Numeric, Decimal, Time, DateTime2, DateTimeOffset
scale?: number;
}
/**
* Type of each column in the Request#row event
*/
@@ -306,7 +306,7 @@ declare module 'tedious' {
metadata: ColumnMetaData;
value: any;
}
/**
* A Request instance represents a request that can be executed on a connection
* @event 'columnMetadata' This event, describing result set columns, will be emitted before row events are emitted. This event may be emited multiple times when more than one recordset is produced by the statement.
@@ -317,7 +317,7 @@ declare module 'tedious' {
* @event 'returnValue' A value for an output parameter (that was added to the request with addOutputParameter(...)). See also Using Parameters.
*/
export class Request extends events.EventEmitter {
/**
* Constructor
* @param sql The SQL statement to be executed (or a procedure name, if the request is to be used with connection.callProcedure).
@@ -327,7 +327,7 @@ declare module 'tedious' {
* rows: Rows as a result of executing the SQL statement. Will only be avaiable if Connection's config.options.rowCollectionOnRequestCompletion is true.
*/
constructor(sql: string, callback: (error: Error, rowCount: number, rows: any[]) => void);
/**
* Add an input parameter to the request.
* @param name The parameter name. This should correspond to a parameter in the SQL, or a parameter that a called procedure expects. The name should not start '@'.
@@ -336,26 +336,26 @@ declare module 'tedious' {
* @param options Additional type options. Optional.
*/
addParameter(name: string, type: TediousType, value: any, options?: ParameterOptions): void;
/**
* Add an output parameter to the request. The parameter's value will be provide by an emitted returnValue event.
* Add an output parameter to the request. The parameter's value will be provide by an emitted returnValue event.
* @param name The parameter name. This should correspond to a parameter in the SQL, or a parameter that a called procedure expects.
* @param type One of the supported data types.
* @param value The value that the parameter is to be given. The Javascript type of the argument should match that documented for data types. Optional.
* @param options Additional type options. Optional.
* @param options Additional type options. Optional.
*/
addOutputParameter(name: string, type: TediousType, value?: any, options?: ParameterOptions): void;
}
export interface BulkLoadColumnOpts extends ParameterOptions {
// indicates whether the column accepts NULL values.
nullable: boolean;
nullable: boolean;
// If the name of the column is different from the name of the property found on rowObj arguments passed to , then you can use this option to specify the property name.
objName?: string;
}
export interface BulkLoad {
/**
* Adds a column to the bulk load. The column definitions should match the table you are trying to insert into. Attempting to call addColumn after the first row has been added will throw an exception.
* @param name The name of the column.
@@ -363,7 +363,7 @@ declare module 'tedious' {
* @param options Additional column type information. At a minimum, nullable must be set to true or false.
*/
addColumn(name: string, type: TediousType, options: BulkLoadColumnOpts): void;
/**
* Adds a row to the bulk insert. This method accepts arguments in three different formats:
* @param rowObj An object of key/value pairs representing column name (or objName) and value.
@@ -392,30 +392,30 @@ declare module 'tedious' {
export interface InfoObject {
/**
* Error number
*/
*/
number: number;
/**
* The error state, used as a modifier to the error number.
*/
*/
state: any;
/**
* The class (severity) of the error. A class of less than 10 indicates an informational message.
*/
*/
class: number;
/**
* The message text.
*/
*/
message: string;
/**
* The stored procedure name (if a stored procedure generated the message).
*/
*/
procName: string;
/**
* The line number in the SQL batch or stored procedure that caused the error. Line numbers begin at 1; therefore, if the line number is not applicable to the message, the value of LineNumber will be 0.
*/
*/
lineNumber: number;
}
/**
* Connection
* @event 'connect' The attempt to connect and validate has completed.
@@ -430,26 +430,26 @@ declare module 'tedious' {
* @event 'secure' A secure connection has been established.
*/
export class Connection extends events.EventEmitter {
constructor(config: ConnectionConfig);
/**
* Start a transaction. As only one request at a time may be executed on
* Start a transaction. As only one request at a time may be executed on
* a connection, another request should not be initiated until this callback is called.
* @param callback The callback is called when the request to start the transaction has completed, either successfully or with an error. If an error occured then err will describe the error.
* @param name A string representing a name to associate with the transaction. Optional, and defaults to an empty string. Required when isolationLevel is present.
* @param isolationLevel The isolation level that the transaction is to be run with.
*/
beginTransaction(callback: (error?: Error) => void, name?: string, isolationLevel?: ISOLATION_LEVEL): void;
/**
* Commit a transaction.
* Commit a transaction.
* There should be an active transaction. That is, beginTransaction should have been previously called.
* @param callback The callback is called when the request to commit the transaction has completed, either successfully or with an error. If an error occured then err will describe the error.
* As only one request at a time may be executed on a connection, another request should not be initiated until this callback is called.
*/
commitTransaction(callback: (error: Error) => void): void;
/**
* Rollback a transaction. There should be an active transaction. That is, beginTransaction should have been previously called.
* @param callback The callback is called when the request to rollback the transaction has completed, either successfully or with an error. If an error occured then err will describe the error.
@@ -462,7 +462,7 @@ declare module 'tedious' {
* @param request A Request object representing the request. Parameters only require a name and type. Parameter values are ignored.
*/
prepare(request: Request): void;
/**
* Release the SQL Server resources associated with a previously prepared request.
*/
@@ -472,20 +472,20 @@ declare module 'tedious' {
* Call a stored procedure represented by request.
*/
callProcedure(request: Request): void;
/**
* Execute the SQL represented by request.
* As sp_executesql is used to execute the SQL, if the same SQL is executed multiples times using this function, the SQL Server query optimizer is likely to reuse the execution plan it generates for the first execution.
* Beware of the way that scoping rules apply, and how they may affect local temp tables. If you're running in to scoping issues, then execSqlBatch may be a better choice. See also issue #24.
*/
execSql(request: Request): void;
/**
* Execute the SQL batch represented by request. There is no param support, and unlike execSql, it is not likely that SQL Server will reuse the execution plan it generates for the SQL.
* In almost all cases, execSql will be a better choice.
*/
execSqlBatch(request: Request): void;
/**
* Execute previously prepared SQL, using the supplied parameters.
* @param request A previously prepared Request.
@@ -499,7 +499,7 @@ declare module 'tedious' {
* @param callback A function which will be called after the BulkLoad finishes executing. rowCount will equal the number of rows inserted.
*/
newBulkLoad(tableName: string, callback: (error: Error, rowCount: number) => void): BulkLoad;
/**
* Executes a BulkLoad.
*/
@@ -508,19 +508,19 @@ declare module 'tedious' {
/**
* Reset the connection to its initial state. Can be useful for connection pool implementations.
* @param callback The callback is called when the connection reset has completed, either successfully or with an error. If an error occured then err will describe the error.
* As only one request at a time may be executed on a connection, another request should not be initiated until this callback is called.
* As only one request at a time may be executed on a connection, another request should not be initiated until this callback is called.
*/
reset(callback: (error: Error) => void): void;
/**
* Cancel currently executed request.
*/
cancel(): void;
/**
* Closes the connection to the database. The end will be emmited once the connection has been closed.
*/
close(): void;
}
}
+1 -1
View File
@@ -316,7 +316,7 @@ declare module Tee {
calc(value: number): number;
fromPos(position: number): number;
fromSize(size: number): number;
hasAnySeries(): boolean;
scroll(delta: number): void;
setMinMax(minimum: number, maximum: number): void;
+14 -17
View File
@@ -1,14 +1,22 @@
// Type definitions for Tether v0.6
// Type definitions for Tether v1.1
// Project: http://github.hubspot.com/tether/
// Definitions by: Adi Dahiya <https://github.com/adidahiya>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module tether {
// global Tether constructor
declare class Tether {
constructor(options: Tether.ITetherOptions);
interface TetherStatic {
new(options: ITetherOptions): Tether;
}
public setOptions(options: Tether.ITetherOptions): void;
public disable(): void;
public enable(): void;
public destroy(): void;
public position(): void;
public static position(): void;
}
declare namespace Tether {
interface ITetherOptions {
attachment?: string;
classes?: {[className: string]: boolean};
@@ -31,20 +39,9 @@ declare module tether {
pinnedClass?: string;
to?: string | HTMLElement | number[];
}
interface Tether {
setOptions(options: ITetherOptions): void;
disable(): void;
enable(): void;
destroy(): void;
position(): void;
}
}
declare module "tether" {
export = tether;
export = Tether;
}
declare var Tether: tether.TetherStatic;
+1 -1
View File
@@ -8,7 +8,7 @@ interface DetectorStatic {
webgl: boolean;
workers: boolean;
fileapi: boolean;
getWebGLErrorMessage(): HTMLElement;
addGetWebGLMessage(parameters?: {id?: string; parent?: HTMLElement}): void;
}
+1 -1
View File
@@ -17,7 +17,7 @@ declare module THREE {
readBuffer: WebGLRenderTarget;
passes: any[];
copyPass: ShaderPass;
swapBuffers(): void;
addPass(pass: any): void;
insertPass(pass: any, index: number): void;
+1 -1
View File
@@ -18,7 +18,7 @@ declare module THREE {
render(renderer: WebGLRenderer, writeBuffer: WebGLRenderTarget, readBuffer: WebGLRenderTarget, delta: number): void;
}
export class ClearMaskPass {
constructor();
+2 -2
View File
@@ -51,11 +51,11 @@ declare module THREE {
reset(): void;
getPolarAngle(): number;
getAzimuthalAngle(): number;
// EventDispatcher mixins
addEventListener(type: string, listener: (event: any) => void): void;
hasEventListener(type: string, listener: (event: any) => void): void;
removeEventListener(type: string, listener: (event: any) => void): void;
dispatchEvent(event: { type: string; target: any; }): void;
}
}
}
+4 -4
View File
@@ -72,7 +72,7 @@ declare module THREE {
*/
export class Projector {
constructor();
// deprecated.
projectVector(vector: Vector3, camera: Camera): Vector3;
@@ -88,10 +88,10 @@ declare module THREE {
* @param sort select whether to sort elements using the Painter's algorithm.
*/
projectScene(scene: Scene, camera: Camera, sortObjects: boolean, sortElements?: boolean): {
objects: Object3D[]; // Mesh, Line or other object
sprites: Object3D[]; // Sprite or Particle
objects: Object3D[]; // Mesh, Line or other object
sprites: Object3D[]; // Sprite or Particle
lights: Light[];
elements: Face3[]; // Line, Particle, Face3 or Face4
};
}
}
}
+1 -1
View File
@@ -8,7 +8,7 @@
declare module 'through2' {
import stream = require('stream');
type TransfofmCallback = (err?: any, data?: any) => void;
type TransformFunction = (chunk: any, enc: string, callback: TransfofmCallback) => void;
type FlashCallback = (flushCallback: () => void) => void;
+6 -7
View File
@@ -275,27 +275,27 @@ declare module '__timezonecomplete/basics' {
/**
* Year, 1970-...
*/
year?: number,
year?: number,
/**
* Month 1-12
*/
month?: number,
month?: number,
/**
* Day of month, 1-31
*/
day?: number,
day?: number,
/**
* Hour 0-23
*/
hour?: number,
hour?: number,
/**
* Minute 0-59
*/
minute?: number,
minute?: number,
/**
* Seconds, 0-59
*/
second?: number,
second?: number,
/**
* Milliseconds 0-999
*/
@@ -1517,4 +1517,3 @@ declare module '__timezonecomplete/globals' {
*/
export function abs(d: Duration): Duration;
}
+1 -1
View File
@@ -329,7 +329,7 @@ interface tinycolorInstance {
* Gets the complement of the current color
*/
complement(): tinycolorInstance;
/**
* Gets a new instance with the current color
*/
+5 -5
View File
@@ -6,13 +6,13 @@ function test_window() {
backgroundColor: 'white',
borderRadius: 10
});
window.setBackgroundColor('blue');
window.opacity = 0.92;
var matrix = Ti.UI.create2DMatrix().scale(1.1, 1);
window.transform = matrix;
var label: Ti.UI.Label;
label = Ti.UI.createLabel({
color: '#900',
@@ -100,7 +100,7 @@ function test_map() {
mountainView.setTitle('Appcelerator');
mountainView.setSubtitle('Mountain View, CA');
mountainView.setPincolor(Ti.Map.ANNOTATION_RED);
var mapview = Ti.Map.createView({
mapType: Ti.Map.STANDARD_TYPE,
region: {
@@ -118,4 +118,4 @@ function test_map() {
});
win.add(mapview);
win.open();
}
}
+2 -2
View File
@@ -6342,8 +6342,8 @@ declare class ErrorCallbackArgs {
}
declare class FailureResponse {
code: Number;
error: string;
code: Number;
error: string;
success: boolean;
}
+4 -4
View File
@@ -9,7 +9,7 @@ declare module "tmp" {
interface Options extends SimpleOptions {
mode?: number;
}
interface SimpleOptions {
prefix?: string;
postfix?: string;
@@ -19,7 +19,7 @@ declare module "tmp" {
keep?: boolean;
unsafeCleanup?: boolean;
}
interface SynchrounousResult {
name: string;
fd: number;
@@ -28,9 +28,9 @@ declare module "tmp" {
function file(callback: (err: any, path: string, fd: number, cleanupCallback: () => void) => void): void;
function file(config: Options, callback?: (err: any, path: string, fd: number, cleanupCallback: () => void) => void): void;
function fileSync(config?: Options): SynchrounousResult;
function dir(callback: (err: any, path: string, cleanupCallback: () => void) => void): void;
function dir(config: Options, callback?: (err: any, path: string, cleanupCallback: () => void) => void): void;
+13 -13
View File
@@ -13,7 +13,7 @@ declare module JQueryTooltipster {
export interface ITooltipsterOptions {
/**
* Determines how the tooltip will animate in and out. Feel free to modify or create custom transitions in the tooltipster.css file.
* Determines how the tooltip will animate in and out. Feel free to modify or create custom transitions in the tooltipster.css file.
* In IE9 and 8, all animations default to a JavaScript generated, fade animation. Default: 'fade'
*/
animation?: string;
@@ -39,7 +39,7 @@ declare module JQueryTooltipster {
content?: string;
/**
* If the content of the tooltip is provided as a string, it is displayed as plain text by default.
* If the content of the tooltip is provided as a string, it is displayed as plain text by default.
* If this content should actually be interpreted as HTML, set this option to true. Default: false
*/
contentAsHTML?: boolean;
@@ -127,13 +127,13 @@ declare module JQueryTooltipster {
iconTouch?: boolean;
/**
* Give users the possibility to interact with the tooltip. Unless autoClose is set to false, the tooltip will still close if the user moves away from or clicks out of the tooltip.
* Give users the possibility to interact with the tooltip. Unless autoClose is set to false, the tooltip will still close if the user moves away from or clicks out of the tooltip.
* Default: false
*/
interactive?: boolean;
/**
* If the tooltip is interactive and activated by a hover event, set the amount of time (milliseconds) allowed for a user to hover off
* If the tooltip is interactive and activated by a hover event, set the amount of time (milliseconds) allowed for a user to hover off
* of the tooltip activator (origin) on to the tooltip itself - keeping the tooltip from closing. Default: 350
*/
interactiveTolerance?: number;
@@ -170,14 +170,14 @@ declare module JQueryTooltipster {
positionTracker?: boolean;
/**
* Called after the tooltip has been repositioned by the position tracker (if enabled).
* Called after the tooltip has been repositioned by the position tracker (if enabled).
* Default: A function that will close the tooltip if the trigger is 'hover' and autoClose is false.
*/
positionTrackerCallback?: Function;
/**
* Specify if a TITLE attribute should be restored on the HTML element after a call to the 'destroy' method.
* This attribute may be omitted, or be restored with the value that existed before Tooltipster was initialized, or be restored with the stringified value of the current content.
* Specify if a TITLE attribute should be restored on the HTML element after a call to the 'destroy' method.
* This attribute may be omitted, or be restored with the value that existed before Tooltipster was initialized, or be restored with the stringified value of the current content.
* Note: in case of multiple tooltips on a single element, only the last destroyed tooltip may trigger a restoration. Default: 'current'
*
* Possible values: 'none', 'previous' or 'current'
@@ -200,8 +200,8 @@ declare module JQueryTooltipster {
theme?: string;
/**
*
* If set to false, tooltips will not show on pure-touch devices, unless you open them yourself with the 'show' method.
*
* If set to false, tooltips will not show on pure-touch devices, unless you open them yourself with the 'show' method.
* Touch gestures on devices which also have a mouse will still open the tooltips though. Default: true
*/
touchDevices?: boolean;
@@ -225,8 +225,8 @@ declare module JQueryTooltipster {
/**
* Updates the content of the tooltip.
* @param value
* @returns {}
* @param value
* @returns {}
*/
content(value: string): JQuery;
@@ -254,7 +254,7 @@ declare module JQueryTooltipster {
* Destroy the tooltip and its listeners.
*/
destroy(): void;
/**
* Reposition and resize the tooltip.
*/
@@ -275,4 +275,4 @@ declare module JQueryTooltipster {
interface JQuery {
tooltipster(options?: JQueryTooltipster.ITooltipsterOptions): JQuery|JQueryTooltipster.ITooltipsterInstance[];
}
}
+2 -2
View File
@@ -4,7 +4,7 @@
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module tv4 {
// Note that every top-level property is optional in json-schema
export interface JsonSchema {
[key: string]: any;
@@ -15,7 +15,7 @@ declare module tv4 {
type?: string;
items?: any;
properties?: any;
patternProperties?: any;
patternProperties?: any;
additionalProperties?: boolean;
required?: string[];
definitions?: any;
+1 -1
View File
@@ -10,7 +10,7 @@ declare module TWEEN {
export function add(tween:Tween): void;
export function remove(tween:Tween): void;
export function update(time?:number): boolean;
export class Tween {
constructor(object?:any);
to(properties:any, duration:number): Tween;
+1 -1
View File
@@ -67,7 +67,7 @@ declare module createjs {
static sineInOut: (amount: number) => number;
static sineOut: (amount: number) => number;
}
export class MotionGuidePlugin {
constructor();
+1 -1
View File
@@ -80,7 +80,7 @@ function bindLoadedEvent() {
);
}
function bindRenderedEvent() {
function bindRenderedEvent() {
twttr.events.bind(
"rendered",
event => {
+79 -79
View File
@@ -712,19 +712,19 @@ interface JQuery {
declare module Twitter.Typeahead {
interface Options {
/**
* If true, when suggestions are rendered, pattern matches for the current query in text nodes will be wrapped in a strong element with its class set to {{classNames.highlight}}.
* If true, when suggestions are rendered, pattern matches for the current query in text nodes will be wrapped in a strong element with its class set to {{classNames.highlight}}.
* Defaults to false.
*/
highlight?: boolean;
/**
* If false, the typeahead will not show a hint.
* If false, the typeahead will not show a hint.
* Defaults to true.
*/
hint?: boolean;
/**
* The minimum character length needed before suggestions start getting rendered.
* The minimum character length needed before suggestions start getting rendered.
* Defaults to 1.
*/
minLength?: number;
@@ -736,14 +736,14 @@ declare module Twitter.Typeahead {
}
/**
* A typeahead is composed of one or more datasets. When an end-user
* modifies the value of a typeahead, each dataset will attempt to render
* A typeahead is composed of one or more datasets. When an end-user
* modifies the value of a typeahead, each dataset will attempt to render
* suggestions for the new value.
* For most use cases, one dataset should suffice. It's only in the scenario
* where you want rendered suggestions to be grouped based on some sort of
* categorical relationship that you'd need to use multiple datasets. For
* example, on twitter.com, the search typeahead groups results into recent
* searches, trends, and accounts – that would be a great use case for using
* example, on twitter.com, the search typeahead groups results into recent
* searches, trends, and accounts – that would be a great use case for using
* multiple datasets.
*/
interface Dataset<T> {
@@ -751,23 +751,23 @@ declare module Twitter.Typeahead {
* The backing data source for suggestions.
* Expected to be a function with the signature (query, syncResults, asyncResults).
* syncResults should be called with suggestions computed synchronously and
* asyncResults should be called with suggestions computed asynchronously
* asyncResults should be called with suggestions computed asynchronously
* (e.g. suggestions that come for an AJAX request).
* source can also be a Bloodhound instance.
* source can also be a Bloodhound instance.
*/
source: Bloodhound<T> | ((query: string, syncResults: (result: T[]) => void, asyncResults?: (result: T[]) => void) => void);
/**
* Lets the dataset know if async suggestions should be expected.
* If not set, this information is inferred from the signature of
* source i.e. if the source function expects 3 arguments, async will
* Lets the dataset know if async suggestions should be expected.
* If not set, this information is inferred from the signature of
* source i.e. if the source function expects 3 arguments, async will
* be set to true.
*/
async?: boolean;
/**
* The name of the dataset.
* This will be appended to {{classNames.dataset}} - to form the class name of the containing DOM element.
* This will be appended to {{classNames.dataset}} - to form the class name of the containing DOM element.
* Must only consist of underscores, dashes, letters (a-z), and numbers.
* Defaults to a random number.
*/
@@ -779,16 +779,16 @@ declare module Twitter.Typeahead {
limit?: number;
/**
* For a given suggestion, determines the string representation of it.
* This will be used when setting the value of the input control after
* a suggestion is selected. Can be either a key string or a function
* that transforms a suggestion object into a string.
* For a given suggestion, determines the string representation of it.
* This will be used when setting the value of the input control after
* a suggestion is selected. Can be either a key string or a function
* that transforms a suggestion object into a string.
* Defaults to stringifying the suggestion.
*/
display?: string | ((obj: T) => string);
/**
* A hash of templates to be used when rendering the dataset. Note a
* A hash of templates to be used when rendering the dataset. Note a
* precompiled template is a function that takes a JavaScript object as
* its first argument and returns a HTML string.
*/
@@ -796,7 +796,7 @@ declare module Twitter.Typeahead {
}
/**
* A hash of templates to be used when rendering the dataset. Note a
* A hash of templates to be used when rendering the dataset. Note a
* precompiled template is a function that takes a JavaScript object as
* its first argument and returns a HTML string.
*/
@@ -816,22 +816,22 @@ declare module Twitter.Typeahead {
pending?: string | ((query: string) => string);
/**
* Rendered at the top of the dataset when suggestions are present. Can be either a HTML string or
* a precompiled template. If it's a precompiled template, the passed in context will contain
* Rendered at the top of the dataset when suggestions are present. Can be either a HTML string or
* a precompiled template. If it's a precompiled template, the passed in context will contain
* query and suggestions.
*/
header?: string | ((query: string, suggestions: T[]) => string);
/**
* Rendered at the bottom of the dataset when suggestions are present. Can be either a HTML string or
* a precompiled template. If it's a precompiled template, the passed in context will contain
* a precompiled template. If it's a precompiled template, the passed in context will contain
* query and suggestions.
*/
footer?: string | ((query: string, suggestions: T[]) => string);
/**
* Used to render a single suggestion. If set, this has to be a precompiled template.
* The associated suggestion object will serve as the context.
* Used to render a single suggestion. If set, this has to be a precompiled template.
* The associated suggestion object will serve as the context.
* Defaults to the value of display wrapped in a div tag i.e. <div>{{value}}</div>.
*/
suggestion?: (suggestion: T) => string;
@@ -854,16 +854,16 @@ declare module Twitter.Typeahead {
/**
* Added to menu element.Defaults to tt- menu.
*/
menu?: string;
menu?: string;
/**
* Added to dataset elements.to Defaults to tt- dataset.
*/
dataset?: string;
dataset?: string;
/**
* Added to suggestion elements.Defaults to tt- suggestion.
*/
suggestion?: string;
suggestion?: string;
/**
* Added to menu element when it contains no content.Defaults to tt- empty.
@@ -873,7 +873,7 @@ declare module Twitter.Typeahead {
/**
* Added to menu element when it is opened.Defaults to tt- open.
*/
open?: string;
open?: string;
/**
* Added to suggestion element when menu cursor moves to said suggestion.Defaults to tt- cursor.
@@ -891,7 +891,7 @@ declare module Bloodhound {
interface BloodhoundOptions<T> {
/**
* Transforms a datum into an array of string tokens.
*
*
* @param datum Suggestion.
* @returns An array of string tokens.
*/
@@ -899,38 +899,38 @@ declare module Bloodhound {
/**
* Transforms a query into an array of string tokens.
*
*
* @param quiery Query.
* @returns An array of string tokens.
*/
queryTokenizer: (query: string) => string[];
/**
* If set to false, the Bloodhound instance will not be implicitly
* If set to false, the Bloodhound instance will not be implicitly
* initialized by the constructor function. Defaults to true.
*/
initialize?: boolean;
/**
* Given a datum, returns a unique id for it.
* Defaults to JSON.stringify. Note that it is highly recommended
* Given a datum, returns a unique id for it.
* Defaults to JSON.stringify. Note that it is highly recommended
* to override this option.
*
*
* @param datum Suggestion.
* @returns Unique id for the suggestion.
*/
identify?: (datum: T) => number;
/**
* If the number of datums provided from the internal search index is
* less than sufficient, remote will be used to backfill search
* If the number of datums provided from the internal search index is
* less than sufficient, remote will be used to backfill search
* requests triggered by calling #search. Defaults to 5.
*/
sufficient?: number;
/**
* A compare function used to sort data returned from the internal search index.
*
*
* @param a First suggestion.
* @param b Second suggestion.
* @returns Comparison result.
@@ -938,20 +938,20 @@ declare module Bloodhound {
sorter?: (a: T, b: T) => number;
/**
* An array of data or a function that returns an array of data.
* An array of data or a function that returns an array of data.
* The data will be added to the internal search index when #initialize is called.
*/
local?: T[] | (() => T[]);
/**
* Can be a URL to a JSON file containing an array of data or,
* Can be a URL to a JSON file containing an array of data or,
* if more configurability is needed, a prefetch options hash.
*/
prefetch?: string | PrefetchOptions<T>;
/**
* Can be a URL to fetch data from when the data provided by the internal
* search index is insufficient or, if more configurability is needed,
* search index is insufficient or, if more configurability is needed,
* a remote options hash.
*/
remote?: string | RemoteOptions<T>;
@@ -962,7 +962,7 @@ declare module Bloodhound {
* supports local storage, the processed data will be cached there to prevent
* additional network requests on subsequent page loads.
*
* WARNING: While it's possible to get away with it for smaller data sets,
* WARNING: While it's possible to get away with it for smaller data sets,
* prefetched data isn't meant to contain entire sets of data. Rather, it should
* act as a first-level cache. Ignoring this warning means you'll run the risk
* of hitting local storage limits.
@@ -974,31 +974,31 @@ declare module Bloodhound {
url: string;
/**
* If false, will not attempt to read or write to local storage and
* If false, will not attempt to read or write to local storage and
* will always load prefetch data from url on initialization. Defaults to true.
*/
cache?: boolean;
/**
* The time (in milliseconds) the prefetched data should be cached in
* The time (in milliseconds) the prefetched data should be cached in
* local storage. Defaults to 86400000 (1 day).
*/
ttl?: number;
/**
* The key that data will be stored in local storage under.
* The key that data will be stored in local storage under.
* Defaults to value of url.
*/
cacheKey?: string;
/**
* A string used for thumbprinting prefetched data. If this doesn't
* A string used for thumbprinting prefetched data. If this doesn't
* match what's stored in local storage, the data will be refetched.
*/
thumbprint?: string;
/**
* A function that provides a hook to allow you to prepare the settings
* A function that provides a hook to allow you to prepare the settings
* object passed to transport when a request is about to be made.
* Defaults to the identity function.
*
@@ -1008,10 +1008,10 @@ declare module Bloodhound {
prepare?: (settings: JQueryAjaxSettings) => JQueryAjaxSettings;
/**
* A function with the signature transform(response) that allows you to
* transform the prefetch response before the Bloodhound instance operates
* A function with the signature transform(response) that allows you to
* transform the prefetch response before the Bloodhound instance operates
* on it. Defaults to the identity function.
*
*
* @param response Prefetch response.
* @returns Transform response.
*/
@@ -1019,8 +1019,8 @@ declare module Bloodhound {
}
/**
* Bloodhound only goes to the network when the internal search engine cannot
* provide a sufficient number of results. In order to prevent an obscene
* Bloodhound only goes to the network when the internal search engine cannot
* provide a sufficient number of results. In order to prevent an obscene
* number of requests being made to the remote endpoint, requests are rate-limited.
*/
interface RemoteOptions<T> {
@@ -1030,13 +1030,13 @@ declare module Bloodhound {
url: string;
/**
* A function that provides a hook to allow you to prepare the settings
* object passed to transport when a request is about to be made.
* A function that provides a hook to allow you to prepare the settings
* object passed to transport when a request is about to be made.
* The function signature should be prepare(query, settings), where query
* is the query #search was called with and settings is the default settings
* object created internally by the Bloodhound instance. The prepare function
* should return a settings object. Defaults to the identity function.
*
*
* @param query The query #search was called with.
* @param settings The default settings object created internally by Bloodhound.
* @returns A JqueryAjaxSettings object.
@@ -1050,22 +1050,22 @@ declare module Bloodhound {
wildcard?: string;
/**
* The method used to rate-limit network requests.
* The method used to rate-limit network requests.
* Can be either debounce or throttle. Defaults to debounce.
*/
rateLimitby?: string;
/**
* The time interval in milliseconds that will be used by rateLimitBy.
* The time interval in milliseconds that will be used by rateLimitBy.
* Defaults to 300.
*/
rateLimitWait?: number;
/**
* A function with the signature transform(response) that allows you to
* transform the remote response before the Bloodhound instance operates on it.
* transform the remote response before the Bloodhound instance operates on it.
* Defaults to the identity function.
*
*
* @param response Prefetch response.
* @returns Transform response.
*/
@@ -1080,7 +1080,7 @@ declare module Bloodhound {
* Split a given string on whitespace characters.
*/
whitespace(str: string): string[];
/**
* Split a given string on non-word characters.
*/
@@ -1106,21 +1106,21 @@ declare module Bloodhound {
}
/**
* Bloodhound is the typeahead.js suggestion engine. Bloodhound is robust,
* flexible, and offers advanced functionalities such as prefetching,
* Bloodhound is the typeahead.js suggestion engine. Bloodhound is robust,
* flexible, and offers advanced functionalities such as prefetching,
* intelligent caching, fast lookups, and backfilling with remote data.
*/
declare class Bloodhound<T> {
/**
* The constructor function.
*
*
* @constructor
* @param options Options hash.
*/
constructor(options: Bloodhound.BloodhoundOptions<T>);
/**
* Returns a reference to Bloodhound and reverts window.Bloodhound to its
* Returns a reference to Bloodhound and reverts window.Bloodhound to its
* previous value. Can be used to avoid naming collisions.
*/
public static noConflict(): Bloodhound<any>;
@@ -1132,17 +1132,17 @@ declare class Bloodhound<T> {
public static tokenizers: Bloodhound.Tokenizers;
/**
* Kicks off the initialization of the suggestion engine. Initialization
* entails adding the data provided by local and prefetch to the internal
* search index as well as setting up transport mechanism used by remote.
* Kicks off the initialization of the suggestion engine. Initialization
* entails adding the data provided by local and prefetch to the internal
* search index as well as setting up transport mechanism used by remote.
* Before #initialize is called, the #get and #search methods will effectively be no-ops.
*
* Note, unless the initialize option is false, this method is implicitly called by the constructor.
*
* After initialization, how subsequent invocations of #initialize behave depends on
* the reinitialize argument. If reinitialize is falsy, the method will not execute the
* initialization logic and will just return the same jQuery promise returned
* by the initial invocation. If reinitialize is truthy, the method will behave
*
* After initialization, how subsequent invocations of #initialize behave depends on
* the reinitialize argument. If reinitialize is falsy, the method will not execute the
* initialization logic and will just return the same jQuery promise returned
* by the initial invocation. If reinitialize is truthy, the method will behave
* as if it were being called for the first time.
*
* @param reinitialize How subsequent invocations of #initialize will behave.
@@ -1151,7 +1151,7 @@ declare class Bloodhound<T> {
public initialize(reinitialize?: boolean): JQueryPromise<T>;
/**
* Takes one argument, data, which is expected to be an array.
* Takes one argument, data, which is expected to be an array.
* The data passed in will get added to the internal search index.
*
* @param data Data to be added to the internal search index.
@@ -1167,11 +1167,11 @@ declare class Bloodhound<T> {
public get(ids: number[]): T[];
/**
* Returns the data that matches query. Matches found in the local search
* index will be passed to the sync callback. If the data passed to sync
* doesn't contain at least sufficient number of datums, remote data will
* Returns the data that matches query. Matches found in the local search
* index will be passed to the sync callback. If the data passed to sync
* doesn't contain at least sufficient number of datums, remote data will
* be requested and then passed to the async callback.
*
*
* @param query Query.
* @param sync Sync callback
* @param async Async callback.
+1 -1
View File
@@ -42,6 +42,6 @@ declare module "typescript-deferred" {
export function create<T>(): DeferredInterface<T>;
export function when<T>(value?: ThenableInterface<T>): PromiseInterface<T>;
export function when<T>(value?: T): PromiseInterface<T>;
}
+8 -1
View File
@@ -1,6 +1,8 @@
/// <reference path='ua-parser-js.d.ts' />
function test_parser(){
import {UAParser} from 'ua-parser-js';
function test_parser() {
var ua = 'Mozilla/5.0 (Windows NT 6.2) AppleWebKit/536.6 (KHTML, like Gecko) Chrome/20.0.1090.0 Safari/536.6';
var parser = new UAParser(ua);
var result = parser.getResult();
@@ -41,4 +43,9 @@ function test_parser(){
result.cpu.architecture
parser.getCPU().architecture
// Extensions
var uaString = 'ownbrowser/1.3';
var ownBrowser = [[/(ownbrowser)\/([\w\.]+)/i], [UAParser.BROWSER.NAME, UAParser.BROWSER.VERSION]];
var parser = new UAParser(uaString, { browser: ownBrowser });
}
+87 -47
View File
@@ -1,6 +1,6 @@
// Type definitions for js-cookie v2.0
// Type definitions for ua-parser-js v0.7.10
// Project: https://github.com/faisalman/ua-parser-js
// Definitions by: Viktor Miroshnikov <https://github.com/superduper>
// Definitions by: Viktor Miroshnikov <https://github.com/superduper>, Lucas Woo <https://github.com/legendecas>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module UAParser {
@@ -61,7 +61,7 @@ declare module UAParser {
version: string;
}
export interface IOS{
export interface IOS {
/**
* Possible 'os.name'
* AIX, Amiga OS, Android, Arch, Bada, BeOS, BlackBerry, CentOS, Chromium OS, Contiki,
@@ -78,7 +78,7 @@ declare module UAParser {
version: string;
}
export interface ICPU{
export interface ICPU {
/**
* Possible architecture:
* 68k, amd64, arm, arm64, avr, ia32, ia64, irix, irix64, mips, mips64, pa-risc,
@@ -87,7 +87,7 @@ declare module UAParser {
architecture: string;
}
export interface IResult{
export interface IResult {
ua: string;
browser: IBrowser;
device: IDevice;
@@ -95,56 +95,96 @@ declare module UAParser {
os: IOS;
cpu: ICPU;
}
export interface BROWSER {
NAME: string,
// Deprecated
MAJOR: string,
VERSION: string
}
export interface CPU {
ARCHITECTURE: string
}
export interface DEVICE {
MODEL: string,
VENDOR: string,
TYPE: string,
CONSOLE: string,
MOBILE: string,
SMARTTV: string,
TABLET: string,
WEARABLE: string,
EMBEDDED: string
}
export interface ENGINE {
NAME: string,
VERSION: string
}
export interface OS {
NAME: string,
VERSION: string
}
}
declare class UAParser {
/**
* Returns browser information
*/
getBrowser(): UAParser.IBrowser;
/**
* Returns OS information
*/
getOS(): UAParser.IOS;
declare module "ua-parser-js" {
/**
* Returns browsers engine information
*/
getEngine(): UAParser.IEngine;
export class UAParser {
static VERSION: string;
static BROWSER: UAParser.BROWSER;
static CPU: UAParser.CPU;
static DEVICE: UAParser.DEVICE;
static ENGINE: UAParser.ENGINE;
static OS: UAParser.OS;
/**
* Returns browser information
*/
getBrowser(): UAParser.IBrowser;
/**
* Returns OS information
*/
getOS(): UAParser.IOS;
/**
* Returns device information
*/
getDevice(): UAParser.IDevice;
/**
* Returns browsers engine information
*/
getEngine(): UAParser.IEngine;
/**
* Returns parsed CPU information
*/
getCPU(): UAParser.ICPU;
/**
* Returns device information
*/
getDevice(): UAParser.IDevice;
/**
* Returns UA string of current instance
*/
getUA(): string;
/**
* Returns parsed CPU information
*/
getCPU(): UAParser.ICPU;
/**
* Set & parse UA string
*/
setUA(ua: string): void;
/**
* Returns UA string of current instance
*/
getUA(): string;
/**
* Returns parse result
*/
getResult(): UAParser.IResult;
/**
* Set & parse UA string
*/
setUA(uastring: string): UAParser;
/**
* Create a new parser
*/
constructor ();
/**
* Create a new parser with UA prepopulated
*/
constructor (ua: string);
/**
* Returns parse result
*/
getResult(): UAParser.IResult;
/**
* Create a new parser with UA prepopulated and extensions extended
*/
constructor(uastring?: string, extensions?: any);
}
}
+19 -19
View File
@@ -535,9 +535,9 @@ declare module uiGrid {
}
export type IGridOptions = IGridOptionsOf<any>;
export interface IGridOptionsOf<TEntity> extends cellNav.IGridOptions, edit.IGridOptions, expandable.IGridOptions,
exporter.IGridOptions<TEntity>, grouping.IGridOptions, importer.IGridOptions<TEntity>,
exporter.IGridOptions<TEntity>, grouping.IGridOptions, importer.IGridOptions<TEntity>,
infiniteScroll.IGridOptions, moveColumns.IGridOptions, pagination.IGridOptions, pinning.IGridOptions,
resizeColumns.IGridOptions, rowEdit.IGridOptions, saveState.IGridOptions, selection.IGridOptions,
resizeColumns.IGridOptions, rowEdit.IGridOptions, saveState.IGridOptions, selection.IGridOptions,
treeBase.IGridOptions<TEntity>, treeView.IGridOptions {
/**
* Default time in milliseconds to throttle aggregation calcuations, defaults to 500ms
@@ -610,8 +610,8 @@ declare module uiGrid {
*/
enableFiltering?: boolean;
/**
* False by default. When enabled, this adds a settings icon in the top right of the grid,
* which floats above the column header. The menu by default gives access to show/hide columns,
* False by default. When enabled, this adds a settings icon in the top right of the grid,
* which floats above the column header. The menu by default gives access to show/hide columns,
* but can be customized to show additional actions.
* @default false
*/
@@ -1117,8 +1117,8 @@ declare module uiGrid {
export interface sortChangedHandler<TEntity> {
/**
* Sort change event callback
* @param {IGridInstance} grid instance
* Sort change event callback
* @param {IGridInstance} grid instance
* @param {IGridColumn} array of gridColumns that have sorting on them, sorted in priority order
*/
(grid: IGridInstanceOf<TEntity>, columns: Array<IGridColumnOf<TEntity>>): void;
@@ -1342,8 +1342,8 @@ declare module uiGrid {
reader.readAsText( files[0] );
}
*/
editFileChooserCallback?: (gridRow: uiGrid.IGridRowOf<TEntity>,
gridCol: IGridColumnOf<TEntity>,
editFileChooserCallback?: (gridRow: uiGrid.IGridRowOf<TEntity>,
gridCol: IGridColumnOf<TEntity>,
files: FileList) => void;
/**
* A bindable string value that is used when binding to edit controls instead of colDef.field
@@ -1558,7 +1558,7 @@ declare module uiGrid {
*/
(row: IGridRowOf<TEntity>): void;
}
/**
* GridRow settings for expandable
*/
@@ -1632,9 +1632,9 @@ declare module uiGrid {
* @param {any} value The cell value
* @returns {any} Formatted value
*/
exporterFieldCallback?: (grid: IGridInstanceOf<TEntity>,
row: uiGrid.IGridRowOf<TEntity>,
col: IGridColumnOf<TEntity>,
exporterFieldCallback?: (grid: IGridInstanceOf<TEntity>,
row: uiGrid.IGridRowOf<TEntity>,
col: IGridColumnOf<TEntity>,
value: any) => any;
/**
* A function to apply to the header displayNames before exporting. Useful for internationalisation,
@@ -2079,7 +2079,7 @@ declare module uiGrid {
* This callback can be used to change the decoded value back into a code.
* Defaults to angular.identity.
* @param {IGridInstance} grid The grid
* @param {TEntity} newObject The new object as importer has created it. Modify it and return modified
* @param {TEntity} newObject The new object as importer has created it. Modify it and return modified
* version
* @returns {TEntity} The modified object
* @default angular.identity
@@ -3218,7 +3218,7 @@ declare module uiGrid {
export interface rowCollapsedHandler<TEntity> {
/**
* Row Collapsed callback
* @param {IGridRow} row The row that was collapsed. You can also retrieve the grid from this row with
* @param {IGridRow} row The row that was collapsed. You can also retrieve the grid from this row with
* row.grid
*/
(row: IGridRowOf<TEntity>): void;
@@ -3227,7 +3227,7 @@ declare module uiGrid {
export interface rowExpandedHandler<TEntity> {
/**
* Row Expanded callback
* @param {IGridRow} row The row that was expanded. You can also retrieve the grid from this row with
* @param {IGridRow} row The row that was expanded. You can also retrieve the grid from this row with
* row.grid
*/
(row: IGridRowOf<TEntity>): void;
@@ -3429,7 +3429,7 @@ declare module uiGrid {
new(entity: TEntity, index: number, reference: IGridInstanceOf<TEntity>): IGridRowOf<TEntity>;
}
export type IGridRow = IGridRowOf<any>;
export interface IGridRowOf<TEntity> extends cellNav.IGridRow, edit.IGridRow, exporter.IGridRow,
export interface IGridRowOf<TEntity> extends cellNav.IGridRow, edit.IGridRow, exporter.IGridRow,
selection.IGridRow, expandable.IGridRow {
/** A reference to an item in gridOptions.data[] */
entity: TEntity;
@@ -3611,7 +3611,7 @@ declare module uiGrid {
*/
export type IColumnDef = IColumnDefOf<any>;
export interface IColumnDefOf<TEntity> extends cellNav.IColumnDef, edit.IColumnDef<TEntity>, exporter.IColumnDef,
grouping.IColumnDef, moveColumns.IColumnDef, pinning.IColumnDef, resizeColumns.IColumnDef,
grouping.IColumnDef, moveColumns.IColumnDef, pinning.IColumnDef, resizeColumns.IColumnDef,
treeBase.IColumnDef<TEntity> {
/**
* defaults to false
@@ -3767,10 +3767,10 @@ declare module uiGrid {
*/
sortCellFiltered?: boolean;
/**
*(optional) An array of sort directions, specifying the order that they should cycle through as
*(optional) An array of sort directions, specifying the order that they should cycle through as
* the user repeatedly clicks on the column heading. The default is [null, uiGridConstants.ASC, uiGridConstants.DESC].
* Null refers to the unsorted state. This does not affect the initial sort direction; use the sort property for that.
* If suppressRemoveSort is also set, the unsorted state will be skipped even if it is listed here. Each direction may
* If suppressRemoveSort is also set, the unsorted state will be skipped even if it is listed here. Each direction may
* not appear in the list more than once (e.g. [ASC, DESC, DESC] is not allowed), and the list may not be empty.*
*/
sortDirectionCycle?: Array<IUiGridConstants>;
+4 -4
View File
@@ -9,10 +9,10 @@ myApp.config(($stateProvider: angular.ui.IStateProvider, $stickyStateProvider: a
dsr: {
default: 'substate',
params: ['param1', 'param2'],
fn: function ($dsr$) {
fn: function ($dsr$) {
return $dsr$.to;
}
}
},
onInactivate: function ($state: angular.ui.IState) {
var iAmInjectedByInjector = $state;
@@ -36,10 +36,10 @@ myApp.config(($stateProvider: angular.ui.IStateProvider, $stickyStateProvider: a
'stateParam1': ['value1', 'value2'],
'stateParam2': 'value'
});
},
},
views: {
//named views are mandatory
'name1': {}
'name1': {}
}
};
+1 -1
View File
@@ -300,7 +300,7 @@ interface UnderscoreStringStaticExports {
* @param delimiter
*/
words(str: string): string[];
/**
* Split string by delimiter (String or RegExp).
* /\s+/ by default.
+6 -1
View File
@@ -295,6 +295,10 @@ var exclaim = function (statement) { return statement + "!"; };
var welcome = _.compose(exclaim, greet);
welcome('moe');
var partialApplicationTestFunction = (a: string, b: number, c: boolean, d: string, e: number, f: string) => { }
var partialApplicationResult = _.partial(partialApplicationTestFunction, "", 1);
var parametersCanBeStubbed = _.partial(partialApplicationResult, _, _, _, "");
///////////////////////////////////////////////////////////////////////////////////////
_.keys({ one: 1, two: 2, three: 3 });
@@ -432,6 +436,7 @@ var template2 = _.template("Hello {{ name }}!");
template2({ name: "Mustache" });
_.template("Using 'with': <%= data.answer %>", oldTemplateSettings)({ variable: 'data' });
_.template("Using 'with': <%= data.answer %>", { variable: 'data' })({ answer: 'no' });
_(['test', 'test']).pick(['test2', 'test2']);
@@ -462,7 +467,7 @@ function chain_tests() {
.flatten()
.find(num => num % 2 == 0)
.value();
var firstVal: number = _.chain([1, 2, 3])
.first()
.value();
+2307 -25
View File
File diff suppressed because it is too large Load Diff
+5 -6
View File
@@ -41,11 +41,11 @@ interface UnityMediaPlayer {
setCanGoPrev(cangoprev:Boolean);
setCanPlay(canplay:Boolean);
setCanPause(canpause:Boolean);
}
}
interface UnityNotification {
showNotification (summary:String, body:String, iconUrl?:String);
}
}
declare class UnityIndicatorProperties {
public count:Number;
@@ -63,7 +63,7 @@ interface UnityMessagingIndicator {
removeAction(name:String);
removeActions();
onPresenceChanged(onPresenceChanged:Function);
// This is suppose to be readonly, but i'm not sure how to do this
// in a definition file.
presence:String;
@@ -72,7 +72,7 @@ interface UnityMessagingIndicator {
interface UnityLauncher {
setCount(count:number);
clearCount();
setProgress(progress:number);
clearProgress();
@@ -81,7 +81,7 @@ interface UnityMessagingIndicator {
addAction(name:String, onActionInvoked:Function);
removeAction(name:String);
removeActions();
}
}
interface Unity {
init(settings:UnitySettings);
@@ -98,4 +98,3 @@ interface Unity {
interface BrowserPublic {
getUnityObject(version:number):Unity;
}
+97 -97
View File
@@ -27,56 +27,56 @@ declare module UrbanAirshipPlugin {
/**
* Enables or disables user notifications on the device.
* This will prompt users to opt-in to notifications on iOS.
*
*
* @param enabled Set to true to enable notifications, false to disable.
* @param callback The function to call on completion.
*/
setUserNotificationsEnabled(enabled: boolean, callback: (status: string) => void): void;
/**
* Checks if user notifications are enabled or not.
*
*
* @param callback The function to call on completion.
*/
isUserNotificationsEnabled(callback: (enabled: boolean) => void): void;
/**
* Get the push identifier for the device. The channel ID is used to send
* messages to the device for testing, and is the canonical identifier for
* the device in Urban Airship.
*
*
* @param callback The function to call on completion.
*/
getChannelID(callback: (id: string) => void): void;
/**
* Returns the push message object that contains the data associated with a
* push notification. The extras dictionary can contain arbitrary key/value
* data that you use in your application.
*
*
* @param clear Set to true to clear the notification.
* @param callback The function to call on completion.
*/
getLaunchNotification(clear: boolean, callback: (push: UrbanAirshipPlugin.PushEvent) => void): void;
/**
* Enables or disables quiet time.
*
*
* @param enabled Set to true to enable quiet time, false to disable.
* @param callback The function to call on completion.
*/
setQuietTimeEnabled(enabled: boolean, callback: () => void): void;
/**
* Checks if quiet time is enabled or not.
*
*
* @param callback The function to call on completion.
*/
isQuietTimeEnabled(callback: (enabled: boolean) => void): void;
/**
* Set the quiet time for the device.
*
*
* @param startHour The start hour for quiet time.
* @param startMinute The start minute for quiet time.
* @param endHour The end hour for quiet time.
@@ -84,260 +84,260 @@ declare module UrbanAirshipPlugin {
* @param callback The function to call on completion.
*/
setQuietTime(startHour: number, startMinute: number, endHour: number, endMinute: number, callback: () => void): void;
/**
* Get the current quiet time. The quietTime object represents a timespan
* during which notifications should be silenced. The typical use case is
* to expose a preference to your users so that they can enable this setting
* and specify an interval during which they do not wish to be disturbed.
*
*
* @param callback The function to call on completion.
*/
getQuietTime(callback: (quietTime: UrbanAirshipPlugin.QuietTimeTimeSpan) => void): void;
/**
* Checks if quiet time is currently in effect.
*
*
* @param callback The function to call on completion.
*/
isInQuietTime(callback: (inQuietTime: boolean) => void): void;
/**
* (iOS Only)
*
*
* On iOS, registration for push requires specifying what
* combination of badges, sound and alerts are desired. This function
* must be explicitly called in order to begin the registration process.
*
*
* For example:
*
*
* UAirship.setNotificationTypes(UAirship.notificationType.sound |
* UAirship.notificationType.alert);
*
*
* @param bitmask The notification types to set.
* @param callback The function to call on completion.
*/
setNotificationTypes(bitmask: number, callback: () => void): void;
/**
* (iOS Only)
*
*
* Set whether the UA Autobadge feature is enabled.
*
*
* @param enabled Set to true to enable Autobadge, false to disable.
* @param callback The function to call on completion.
*/
setAutobadgeEnabled(enabled: boolean, callback: () => void): void;
/**
* (iOS Only)
*
*
* Set the current application badge number.
*
*
* @param badge The number to use for the badge.
* @param callback The function to call on completion.
*/
setBadgeNumber(badge: number, callback: () => void): void;
/**
* (iOS Only)
*
*
* Gets the current application badge number.
*
*
* @param callback The function to call on completion.
*/
getBadgeNumber(callback: (badgeNumber: number) => void): void;
/**
* (iOS Only)
*
*
* Reset the badge number to zero.
*
*
* @param callback The function to call on completion.
*/
resetBadge(callback: () => void): void;
/**
* (Android Only)
*
*
* Clears the notifications posted by the application.
*
*
* @param callback The function to call on completion.
*/
clearNotifications(callback: () => void): void;
/**
* (Android only, iOS sound settings come in the push)
*
*
* Set whether the device makes sound on push.
*
*
* @param enabled Set to true to enable sound, false to disable.
* @param callback The function to call on completion.
*/
setSoundEnabled(enabled: boolean, callback: () => void): void;
/**
* (Android Only)
*
*
* Checks if sound is enabled or not.
*
*
* @param callback The function to call on completion.
*/
isSoundEnabled(callback: (enabled: boolean) => void): void;
/**
* (Android Only)
*
*
* Set whether the device vibrates on push.
*
*
* @param enabled Set to true to enable vibration, false to disable.
* @param callback The function to call on completion.
*/
setVibrateEnabled(enabled: boolean, callback: () => void): void;
/**
* (Android Only)
*
*
* Checks if vibration is enabled or not.
*
*
* @param callback The function to call on completion.
*/
isVibrateEnabled(callback: (enabled: boolean) => void): void;
/**
* Sets tags for the device.
*
*
* @param tags An array of tags.
* @param callback The function to call on completion.
*/
setTags(tags: string[], callback: () => void): void;
/**
* Returns the tags for the device.
*
*
* @param callback The function to call on completion.
*/
getTags(callback: (tags: string[]) => void): void;
/**
* Set alias for the device.
*
*
* @param alias The alias to set for this device.
* @param callback The function to call on completion.
*/
setAlias(alias: string, callback: () => void): void;
/**
* Gets the alias for this device.
*
*
* @param callback The function to call on completion.
*/
getAlias(callback: (alias: string) => void): void;
/**
* Set the named user ID for this device.
*
*
* @param namedUser The named user ID.
* @param callback The function to call on completion.
*/
setNamedUser(namedUserId: string, callback: () => void): void;
/**
* Gets the named user ID for this device.
*
*
* @param callback The function to call on completion.
*/
getNamedUser(callback: (namedUserId: string) => void): void;
/**
* Fluent API to edit the named user tag groups by adding or removing
* tags, then applying the changes.
*
*
* For example:
*
*
* UAirship.editNamedUserTagGroups()
* .addTags("loyalty", ["platinum-member", "gold-member"])
* .removeTags("loyalty", ["silver-member", "bronze-member"])
* .apply()
*
*
* @returns The chainable API instance.
*/
editNamedUserTagGroups(): UrbanAirshipPlugin.EditNamedUserTagGroupsApi;
/**
* Fluent API to edit the channel tag groups by adding or removing tags,
* then applying the changes.
*
*
* For exmaple:
*
*
* UAirship.editChannelTagGroups()
* .addTags("loyalty", ["platinum-member", "gold-member"])
* .removeTags("loyalty", ["silver-member", "bronze-member"])
* .apply()
*/
editChannelTagGroups(): UrbanAirshipPlugin.EditChannelTagGroupsApi;
/**
* Enables or disables analytics. Disabling analytics will delete any
* locally stored events and prevent any events from uploading. Features
* that depend on analytics being enabled may not work properly if its
* disabled (reports, region triggers, location segmentation, push to
* local time).
*
*
* @param enabled Set to true to enable analytics, false to disable.
* @param callback The function to call on completion.
*/
setAnalyticsEnabled(enabled: boolean, callback: () => void): void;
/**
* Checks if analytics is enabled or not.
*
*
* @param callback The function to call on completion.
*/
isAnalyticsEnabled(callback: (enabled: boolean) => void): void;
/**
* Runs an Urban Airship action.
*
*
* @param actionName The name of the action to run.
* @param actionValue The value for the action.
* @param callback The function to call on completion.
*/
runAction(actionName: string, actionValue: string, callback: (result: UrbanAirshipPlugin.RunActionResult) => void): void;
/**
* Enables or disables Urban Airship location services on the device.
*
*
* @param enabled Set to true to enable location, false to disable.
* @param callback The function to call on completion.
*/
setLocationEnabled(enabled: boolean, callback: () => void): void;
/**
* Checks if location is enabled or not.
*
*
* @param callback The function to call on completion.
*/
isLocationEnabled(callback: (enabled: boolean) => void): void;
/**
* Enables or disables background location on the device.
*
*
* @param enabled Set to true to enable background location, false to disable.
* @param callback The function to call on completion.
*/
setBackgroundLocationEnabled(enabled: boolean, callback: () => void): void;
/**
* Checks if background location updates are enabled or not.
*
*
* @param callback The function to call on completion.
*/
isBackgroundLocationEnabled(callback: () => void): void;
/**
* Records the current location of the device.
*
*
* @param callback The function to call on completion.
*/
recordCurrentLocation(callback: () => void): void;
@@ -350,27 +350,27 @@ declare module UrbanAirshipPlugin {
/**
* Used to add the given tags to the given tag group.
*
*
* @param tagGroup The tag group to add tags to.
* @param tags The tags to add to the group.
*
*
* @returns The chainable API instance.
*/
addTags: (tagGroup: string, tags: string[]) => EditNamedUserTagGroupsApi;
/**
* Used to remove the given tags from the given tag group.
*
*
* @param tagGroup The tag group to remove tags from.
* @param tags The tags to remove from the group.
*
*
* @returns The chainable API instance.
*/
removeTags: (tagGroup: string, tags: string[]) => EditNamedUserTagGroupsApi;
/**
* Used to apply the changes from the chained API call.
*
*
* @param callback The optional function to call on completion.
*/
apply: (callback?: () => void) => void;
@@ -383,27 +383,27 @@ declare module UrbanAirshipPlugin {
/**
* Used to add the given tags to the given tag group.
*
*
* @param tagGroup The tag group to add tags to.
* @param tags The tags to add to the group.
*
*
* @returns The chainable API instance.
*/
addTags: (tagGroup: string, tags: string[]) => EditChannelTagGroupsApi;
/**
* Used to remove the given tags from the given tag group.
*
*
* @param tagGroup The tag group to remove tags from.
* @param tags The tags to remove from the group.
*
*
* @returns The chainable API instance.
*/
removeTags: (tagGroup: string, tags: string[]) => EditChannelTagGroupsApi;
/**
* Used to apply the changes from the chained API call.
*
*
* @param callback The optional function to call on completion.
*/
apply: (callback?: () => void) => void;
@@ -429,7 +429,7 @@ declare module UrbanAirshipPlugin {
/**
* (iOS Only)
*
*
* The push token for the device.
*/
deviceToken: string;
@@ -437,7 +437,7 @@ declare module UrbanAirshipPlugin {
/**
* Represents a timespan during which notifications should be silenced.
*
*
* For example, 10PM - 6AM would be:
* { startHour: 22, startMinute: 0, endHour: 6, endMinute: 0 }
*/
@@ -474,4 +474,4 @@ interface Document {
addEventListener(type: "urbanairship.registration", listener: (ev: UrbanAirshipPlugin.RegistrationEvent) => void, useCapture?: boolean): void;
}
//#endregion
//#endregion
+2 -2
View File
@@ -6,13 +6,13 @@
declare module "username" {
/**
* Tries to get the username from the LOGNAME, USER, LNAME or USERNAME environment variables.
* Falls back to `id -un` on OS X / Linux and `whoami` on Windows in the rare case none of the environment
* Falls back to `id -un` on OS X / Linux and `whoami` on Windows in the rare case none of the environment
* variables are set. The result is cached.
*
* @param callback The callback function to call asynchronously with the result.
*/
function username(callback: (err: Error, result: string) => void): void;
module username {
/**
* Tries to get the username from the LOGNAME, USER, LNAME or USERNAME environment variables. Falls back
+1 -1
View File
@@ -294,7 +294,7 @@ function ModelValidation() {
var validatedModel = valerie.validatableModel(model)
.validateAll()
.end();
}
function UtilsStaticTests() {
+6 -6
View File
@@ -255,7 +255,7 @@ declare module Valerie {
/*
//TODO: additional namespaces/statics not yet used
dom: DomStatic;
dom: DomStatic;
formatting: FormattingStatic;
koBindingsHelper: KoBindingsHelperStatic;
koExtras: KoExtrasStatic;
@@ -278,7 +278,7 @@ declare module Valerie {
// Contains converters, always singletons.
interface ConvertersStatic {
//TODO: other converters to be added
passThrough: Valerie.IConverter;
@@ -365,19 +365,19 @@ declare module Valerie {
*/
clearSummary(valueOrFunction: any): ModelValidationState;
/***
/***
* Gets whether the model has failed validation.
* @return {boolean}
*/
failed(): boolean;
/***
/***
* Gets the validation states that belong to the model that are in a failure state.
* @return {Valerie.IValidationState[]}
*/
failedStates(): Valerie.IValidationState[];
/***
/***
* Gets the name of the model.
* @return {string}
*/
@@ -387,7 +387,7 @@ declare module Valerie {
message(): string;
passed(): boolean;
/***
/***
* Gets or sets whether the computation that updates the validation result has been paused.
* @param {boolean} [value = false] true if the computation should be paused, false if the computation should not be paused
* @return {boolean} true if computation is paused, false otherwise
+2 -2
View File
@@ -9,7 +9,7 @@ declare module "vec3" {
constructor(location: number[]);
constructor(location: {x: number; y: number; z: number});
constructor(locationStr: string);
set(x: number, y: number, z: number): Vec3;
update(other: Vec3): Vec3;
floored(): Vec3;
@@ -31,4 +31,4 @@ declare module "vec3" {
min(other: Vec3): Vec3;
max(other: Vec3): Vec3;
}
}
}
+3 -3
View File
@@ -65,7 +65,7 @@ declare namespace Vega {
props?: string;
items?: any;
duration?: number;
ease?: string;
ease?: string;
}
export interface Bounds {
@@ -518,7 +518,7 @@ declare namespace vg {
export namespace scene {
export function item(mark: Vega.Node): Vega.Node;
}
export class Bounds implements Vega.Bounds {
x1: number;
y1: number;
@@ -540,4 +540,4 @@ declare namespace vg {
}
// TODO: classes for View, Model, etc.
}
}
+127 -127
View File
@@ -4,10 +4,10 @@
// Definitions: https://github.com/borisyankov/DefinitelyTyped
//inconsistent namespace: this is a helper funtion from tables.js and should not pollute the global namespace!
declare function sanitizeDuration(duration : string) : string;
declare function sanitizeDuration(duration : string) : string;
declare namespace Vex {
function L(block : string, args : any[]) : void;
function Merge<T extends Object>(destination : T, source : Object) : T;
function Min(a : number, b : number) : number;
@@ -20,15 +20,15 @@ declare namespace Vex {
function drawDot(ctx : IRenderContext, x : number, y : number, color? : string) : void;
function BM(s : number, f : Function) : void;
function Inherit<T extends Object>(child : T, parent : Object, object : Object) : T;
class RuntimeError {
constructor(code : string, message : string);
}
class RERR {
constructor(code : string, message : string);
}
/**
* Helper interface for handling the different rendering contexts (i.e. CanvasContext, RaphaelContext, SVGContext). Not part of VexFlow!
*/
@@ -61,13 +61,13 @@ declare namespace Vex {
fillText(text : string, x : number, y : number) : IRenderContext;
save() : IRenderContext;
restore() : IRenderContext;
/**
* canvas returns TextMetrics, SVG returns SVGRect, Raphael returns {width : number, height : number}. Only width is used throughout VexFlow.
*/
measureText(text : string) : {width : number};
}
/**
* Helper interface for handling the Vex.Flow.Font object in Vex.Flow.Glyph. Not part of VexFlow!
*/
@@ -83,17 +83,17 @@ declare namespace Vex {
familyName : string;
lineHeight : number;
underlineThickness : number;
/**
* This property is missing in vexflow_font.js, but present in gonville_original.js and gonville_all.js.
*/
original_font_information? : {postscript_name : string, version_string : string, vendor_url : string, full_font_name : string, font_family_name : string, copyright : string, description : string, trademark : string, designer : string, designer_url : string, unique_font_identifier : string, license_url : string, license_description : string, manufacturer_name : string, font_sub_family_name : string};
}
namespace Flow {
const RESOLUTION : number;
// from tables.js:
const STEM_WIDTH : number;
const STEM_HEIGHT : number;
@@ -115,10 +115,10 @@ declare namespace Vex {
function durationToNumber(duration : string) : number;
function durationToTicks(duration : string) : number;
function durationToGlyph(duration : string, type : string) : {head_width : number, stem : boolean, stem_offset : number, flag : boolean, stem_up_extension : number, stem_down_extension : number, gracenote_stem_up_extension : number, gracenote_stem_down_extension : number, tabnote_stem_up_extension : number, tabnote_stem_down_extension : number, dot_shiftY : number, line_above : number, line_below : number, code_head? : string, rest? : boolean, position? : string};
// from glyph.js:
function renderGlyph(ctx : IRenderContext, x_pos : number, y_pos : number, point : number, val : string, nocache : boolean) : void;
// from vexflow_font.js / gonville_original.js / gonville_all.js
var Font : {
glyphs : {x_min : number, x_max : number, ha : number, o : string[]}[];
@@ -132,15 +132,15 @@ declare namespace Vex {
familyName : string;
lineHeight : number;
underlineThickness : number;
//inconsistent member : this is missing in vexflow_font.js, but present in gonville_original.js and gonville_all.js
original_font_information : {postscript_name : string, version_string : string, vendor_url : string, full_font_name : string, font_family_name : string, copyright : string, description : string, trademark : string, designer : string, designer_url : string, unique_font_identifier : string, license_url : string, license_description : string, manufacturer_name : string, font_sub_family_name : string};
}
class Accidental extends Modifier {
//TODO remove the following lines once TypeScript allows subclass overrides with type changes
setNote(note : Note) : Modifier;
constructor(type : string);
static DEBUG : boolean;
static format(accidentals : Accidental[], state : {left_shift : number, right_shift : number, text_line : number}) : void;
@@ -149,11 +149,11 @@ declare namespace Vex {
draw() : void;
static applyAccidentals(voices : Voice[], keySignature? : string) : void;
}
namespace Accidental {
const CATEGORY : string;
}
class Annotation extends Modifier {
constructor(text : string);
static DEBUG : boolean;
@@ -165,24 +165,24 @@ declare namespace Vex {
setJustification(justification : Annotation.Justify) : Annotation;
draw() : void;
}
namespace Annotation {
const enum Justify {LEFT, CENTER, RIGHT, CENTER_STEM}
const enum VerticalJustify {TOP, CENTER, BOTTOM, CENTER_STEM}
const CATEGORY : string;
}
class Articulation extends Modifier {
constructor(type : string);
static DEBUG : boolean;
static format(articulations : Articulation[], state : {left_shift : number, right_shift : number, text_line : number}) : boolean;
draw() : void;
}
namespace Articulation {
const CATEGORY : string;
}
class BarNote extends Note {
static DEBUG : boolean;
getType() : Barline.type;
@@ -192,11 +192,11 @@ declare namespace Vex {
preFormat() : BarNote;
draw() : void;
}
namespace Barline {
const enum type {SINGLE, DOUBLE, END, REPEAT_BEGIN, REPEAT_END, REPEAT_BOTH, NONE}
}
class Barline extends StaveModifier {
constructor(type : Barline.type, x : number);
getCategory() : string;
@@ -206,7 +206,7 @@ declare namespace Vex {
drawVerticalEndBar(stave : Stave, x : number) : void;
drawRepeatBar(stave : Stave, x : number, begin : boolean) : void;
}
class Beam {
constructor(notes : StemmableNote[], auto_stem? : boolean);
setContext(context : IRenderContext) : Beam;
@@ -227,7 +227,7 @@ declare namespace Vex {
static applyAndGetBeams(voice : Voice, stem_direction : number, groups : Fraction[]) : Beam[];
static generateBeams(notes : StemmableNote[], config? : {groups? : Fraction[], stem_direction? : number, beam_rests? : boolean, beam_middle_only? : boolean, show_stemlets? : boolean, maintain_stem_directions? : boolean}) : Beam[];
}
class Bend extends Modifier {
constructor(text : string, release? : boolean, phrase? : {type : number, text : string, width : number}[]);
static UP : number;
@@ -239,11 +239,11 @@ declare namespace Vex {
updateWidth() : Bend;
draw() : void;
}
namespace Bend {
const CATEGORY : string;
}
class BoundingBox {
constructor(x : number, y : number, w : number, h : number);
static copy(that : BoundingBox) : BoundingBox;
@@ -260,7 +260,7 @@ declare namespace Vex {
mergeWith(boundingBox : BoundingBox, ctx? : IRenderContext) : BoundingBox;
draw(ctx : IRenderContext, x : number, y : number) : void;
}
class CanvasContext implements IRenderContext {
//TODO remove the following lines once TypeScript allows subclass overrides with type changes or type inconsistencies mentioned below are fixed
setLineDash(dash : string) : CanvasContext;
@@ -281,7 +281,7 @@ declare namespace Vex {
fillText(text : string, x : number, y : number) : CanvasContext;
save() : CanvasContext;
restore() : CanvasContext;
constructor(context : CanvasRenderingContext2D);
static WIDTH : number;
static HEIGHT : number;
@@ -295,7 +295,7 @@ declare namespace Vex {
setShadowBlur(blur : string) : CanvasContext;
setLineWidth(width : number) : CanvasContext;
setLineCap(cap_type : string) : CanvasContext;
//inconsistent type: void -> CanvasContext
setLineDash(dash : string) : void;
scale(x : number, y : number) : void;
@@ -317,22 +317,22 @@ declare namespace Vex {
save() : void;
restore() : void;
}
class Clef extends StaveModifier {
//TODO remove the following lines once TypeScript allows subclass overrides with type changes
addModifier() : void;
addEndModifier() : void;
constructor(clef : string, size? : string, annotation? : string);
static DEBUG : boolean;
addModifier(stave : Stave) : void;
addEndModifier(stave : Stave) : void;
}
class ClefNote extends Note {
//TODO remove the following lines once TypeScript allows subclass overrides with type changes
setStave(stave : Stave) : Note;
constructor(clef : string, size? : string, annotation? : string);
setClef(clef : string, size? : string, annotation? : string) : ClefNote;
getClef() : string;
@@ -343,7 +343,7 @@ declare namespace Vex {
preFormat() : ClefNote;
draw() : void;
}
class Crescendo extends Note {
constructor(note_struct : {duration : number, line? : number});
static DEBUG : boolean;
@@ -353,7 +353,7 @@ declare namespace Vex {
preFormat() : Crescendo;
draw() : void;
}
class Curve {
constructor(from : Note, to : Note, options? : {spacing? : number, thickness? : number, x_shift? : number, y_shift : number, position : Curve.Position, invert : boolean, cps? : {x : number, y : number}[]});
static DEBUG : boolean;
@@ -363,28 +363,28 @@ declare namespace Vex {
renderCurve(params : {first_x : number, first_y : number, last_x : number, last_y : number, direction : number}) : void;
draw() : boolean;
}
namespace Curve {
const enum Position {NEAR_HEAD, NEAR_TOP}
}
class Dot extends Modifier {
//TODO remove the following lines once TypeScript allows subclass overrides with type changes or type inconsistencies mentioned below are fixed
setNote(note : Note) : Dot;
static format(dots : number, state : {left_shift : number, right_shift : number, text_line : number}) : void;
setNote(note : Note) : void; //inconsistent type: void -> Dot
setDotShiftY(y : number) : Dot;
draw() : void;
}
namespace Dot {
const CATEGORY : string;
}
class Formatter {
static DEBUG : boolean;
static FormatAndDraw(ctx : IRenderContext, stave : Stave, notes : Note[], params? : {auto_beam : boolean, align_rests : boolean}) : BoundingBox;
static FormatAndDraw(ctx : IRenderContext, stave : Stave, notes : Note[], params? : {auto_beam : boolean, align_rests : boolean}) : BoundingBox;
static FormatAndDraw(ctx : IRenderContext, stave : Stave, notes : Note[], params? : boolean) : BoundingBox;
static FormatAndDrawTab(ctx : IRenderContext, tabstave : TabStave, stave : Stave, tabnotes : TabNote[], notes : Note[], autobeam? : boolean, params? : {auto_beam : boolean, align_rests : boolean}) : void;
static FormatAndDrawTab(ctx : IRenderContext, tabstave : TabStave, stave : Stave, tabnotes : TabNote[], notes : Note[], autobeam? : boolean, params? : boolean) : void;
@@ -400,7 +400,7 @@ declare namespace Vex {
format(voices : Voice[], justifyWidth : number, options? : {align_rests? : boolean, context : IRenderContext}) : Formatter;
formatToStave(voices : Voice[], stave : Stave, options? : {align_rests? : boolean, context : IRenderContext}) : Formatter;
}
class Fraction {
constructor(numerator : number, denominator : number);
static GCD(a : number, b : number) : number;
@@ -432,7 +432,7 @@ declare namespace Vex {
toMixedString() : string;
parse(str : string) : Fraction;
}
class FretHandFinger extends Modifier {
constructor(number : number);
static format(nums : FretHandFinger[], state : {left_shift : number, right_shift : number, text_line : number}) : void;
@@ -447,15 +447,15 @@ declare namespace Vex {
setOffsetY(y : number) : FretHandFinger;
draw() : void;
}
namespace FretHandFinger {
const CATEGORY : string;
}
class GhostNote extends StemmableNote {
//TODO remove the following lines once TypeScript allows subclass overrides with type changes or type inconsistencies mentioned below are fixed
setStave(stave : Stave) : Note;
constructor(duration : string);
constructor(note_struct : {type? : string, dots? : number, duration : string}); //inconsistent name : init struct is called 'duration', should be 'params'/'options' (may be string or Object)
isRest() : boolean;
@@ -464,7 +464,7 @@ declare namespace Vex {
preFormat() : GhostNote;
draw() : void;
}
class Glyph {
constructor(code : string, point : number, options? : {cache? : boolean, font? : IFont});
setOptions(options : {cache? : boolean, font? : IFont}) : void;
@@ -481,19 +481,19 @@ declare namespace Vex {
static loadMetrics(font : IFont, code : string, cache : boolean) : {x_min : number, x_max : number, ha : number, outline : number[]};
static renderOutline(ctx : IRenderContext, outline : number[], scale : number, x_pos : number, y_pos : number) : void;
}
class GraceNote extends StaveNote {
constructor(note_struct : {slash? : boolean, type? : string, dots? : number, duration : string, clef? : string, keys : string[], octave_shift? : number, auto_stem? : boolean, stem_direction? : number});
getStemExtension() : number;
getCategory() : string;
draw() : void;
}
class GraceNoteGroup extends Modifier {
//TODO remove the following lines once TypeScript allows subclass overrides with type changes or type inconsistencies mentioned below are fixed
setWidth(width : number) : Modifier;
setNote(note : StaveNote) : Modifier;
constructor(grace_notes : GraceNote[], show_slur? : boolean); //inconsistent name: 'show_slur' is called 'config', suggesting object (is boolean)
static DEBUG : boolean;
static format(gracenote_groups : GraceNoteGroup[], state : {left_shift : number, right_shift : number, text_line : number}) : boolean;
@@ -505,11 +505,11 @@ declare namespace Vex {
setXShift(x_shift : number) : void;
draw() : void;
}
namespace GraceNoteGroup {
const CATEGORY : string;
}
class KeyManager {
constructor(key : string);
setKey(key : string) : KeyManager;
@@ -518,11 +518,11 @@ declare namespace Vex {
getAccidental(key : string) : {note : string, accidental : string};
selectNote(note : string) : {note : string, accidental : string, change : boolean};
}
class KeySignature extends StaveModifier {
//TODO remove the following lines once TypeScript allows subclass overrides with type changes
addModifier() : void;
constructor(key_spec : string);
addAccToStave(stave : Stave, acc : {type : string, line : number}, next? : {type : string, line : number}) : void;
cancelKey(spec : string) : KeySignature;
@@ -530,7 +530,7 @@ declare namespace Vex {
addToStave(stave : Stave, firstGlyph? : boolean) : KeySignature;
convertAccLines(clef : string, type : string) : void;
}
class Modifier {
static DEBUG : boolean;
getCategory() : string;
@@ -551,12 +551,12 @@ declare namespace Vex {
setXShift(x : number) : void; //inconsistent type: void -> Modifier
draw() : void;
}
namespace Modifier {
const enum Position {LEFT, RIGHT, ABOVE, BELOW}
const CATEGORY : string
}
class ModifierContext {
static DEBUG : boolean;
addModifier(modifier : Modifier) : ModifierContext;
@@ -569,7 +569,7 @@ declare namespace Vex {
preFormat() : void;
postFormat() : void;
}
class Music {
isValidNoteValue(note : number) : boolean;
isValidIntervalValue(interval : number) : boolean;
@@ -585,7 +585,7 @@ declare namespace Vex {
getIntervalBetween(note1 : number, note2 : number, direction? : number) : number;
createScaleMap(keySignature : string) : {[rootName : string] : string};
}
namespace Music {
const NUM_TONES : number;
const roots : string[];
@@ -599,7 +599,7 @@ declare namespace Vex {
const accidentals : string[];
const noteValues : {[value : string] : {root_index : number, int_val : number}};
}
class Note implements Tickable {
//from tickable interface:
getTicks() : Fraction;
@@ -616,7 +616,7 @@ declare namespace Vex {
getTickMultiplier() : Fraction;
applyTickMultiplier(numerator : number, denominator : number) : void;
setDuration(duration : Fraction) : void;
constructor(note_struct : {type? : string, dots? : number, duration : string});
getPlayNote() : any;
setPlayNote(note : any) : Note;
@@ -659,11 +659,11 @@ declare namespace Vex {
getAbsoluteX() : number;
setPreFormatted(value : boolean) : void;
}
namespace Note {
const CATEGORY : string;
}
class NoteHead extends Note {
constructor(head_options : {x? : number, y? : number, note_type? : string, duration : string, displaced? : boolean, stem_direction? : number, line : number, x_shift : number, custom_glyph_code? : string, style? : string, slashed? : boolean, glyph_font_scale? : number});
static DEBUG : boolean;
@@ -686,7 +686,7 @@ declare namespace Vex {
preFormat() : NoteHead;
draw() : void;
}
class Ornament extends Modifier {
constructor(type : string);
static DEBUG : boolean;
@@ -696,11 +696,11 @@ declare namespace Vex {
setLowerAccidental(acc : string) : Ornament;
draw() : void;
}
namespace Ornament {
const CATEGORY : string;
}
class PedalMarking {
constructor(notes : Note[]); //inconsistent name: 'notes' is called 'type', suggesting string (is Note[])
static DEBUG : boolean;
@@ -715,17 +715,17 @@ declare namespace Vex {
drawText() : void;
draw() : void;
}
namespace PedalMarking {
const enum Styles {TEXT, BRACKET, MIXED}
const GLYPHS : {[name : string] : {code : string, x_shift : number, y_shift : number}};
}
class RaphaelContext implements IRenderContext {
//TODO remove the following lines once TypeScript allows subclass overrides with type changes or type inconsistencies mentioned below are fixed
setLineWidth(width : number) : RaphaelContext;
glow() : RaphaelContext;
constructor(element : HTMLElement);
setFont(family : string, size : number, weight? : number) : RaphaelContext;
setRawFont(font : string) : RaphaelContext;
@@ -759,7 +759,7 @@ declare namespace Vex {
save() : RaphaelContext;
restore() : RaphaelContext;
}
class Renderer {
constructor(sel : HTMLElement, backend : Renderer.Backends)
static USE_CANVAS_PROXY : boolean;
@@ -772,12 +772,12 @@ declare namespace Vex {
resize(width : number, height : number) : Renderer;
getContext() : IRenderContext;
}
namespace Renderer {
const enum Backends {CANVAS, RAPHAEL, SVG, VML}
const enum LineEndType {NONE, UP, DOWN}
}
class Repetition extends StaveModifier {
constructor(type : Repetition.type, x : number, y_shift : number);
getCategory() : string;
@@ -792,7 +792,7 @@ declare namespace Vex {
namespace Repetition {
const enum type { NONE, CODA_LEFT, CODA_RIGHT, SEGNO_LEFT, SEGNO_RIGHT, DC, DC_AL_CODA, DC_AL_FINE, DS, DS_AL_CODA, DS_AL_FINE, FINE }
}
class Stave {
constructor(x : number, y : number, width : number, options? : {vertical_bar_width? : number, glyph_spacing_px? : number, num_lines? : number, fill_style? : string, spacing_between_lines_px? : number, space_above_staff_ln? : number, space_below_staff_ln? : number, top_text_position? : number});
resetLines() : void;
@@ -846,7 +846,7 @@ declare namespace Vex {
setConfigForLine(line_number : number, line_config : {visible : boolean}) : Stave;
setConfigForLines(lines_configuration : {visible : boolean}[]) : Stave;
}
class StaveConnector {
constructor(top_stave : Stave, bottom_stave : Stave);
setContext(ctx : IRenderContext) : StaveConnector;
@@ -861,7 +861,7 @@ declare namespace Vex {
namespace StaveConnector {
const enum type { SINGLE_RIGHT, SINGLE_LEFT, SINGLE, DOUBLE, BRACE, BRACKET, BOLD_DOUBLE_LEFT, BOLD_DOUBLE_RIGHT, THIN_DOUBLE }
}
class StaveHairpin {
constructor(notes : {first_note : Note, last_note : Note}, type : StaveHairpin.type);
static FormatByTicksAndDraw(ctx : IRenderContext, formatter : Formatter, notes : {first_note : Note, last_note : Note}, type : StaveHairpin.type, position : Modifier.Position, options? : {height : number, y_shift : number, left_shift_ticks : number, right_shift_ticks : number}) : void;
@@ -876,7 +876,7 @@ declare namespace Vex {
namespace StaveHairpin {
const enum type { CRESC, DECRESC }
}
class StaveLine {
constructor(notes : {first_note: Note, last_note: Note, first_indices : number[], last_indices : number[]});
setContext(context : Object) : StaveLine;
@@ -886,11 +886,11 @@ declare namespace Vex {
applyLineStyle() : void;
applyFontStyle() : void;
draw() : StaveLine;
//inconsistent API: this should be set via an options object in the constructor
render_options : {padding_left : number, padding_right : number, line_width : number, line_dash : number[], rounded_end : boolean, color : string, draw_start_arrow : boolean, draw_end_arrow : boolean, arrowhead_length : number, arrowhead_angle : number, text_position_vertical : StaveLine.TextVerticalPosition, text_justification : StaveLine.TextJustification};
}
namespace StaveLine {
const enum TextVerticalPosition { TOP, BOTTOM }
const enum TextJustification { LEFT, CENTER, RIGHT }
@@ -906,10 +906,10 @@ declare namespace Vex {
addModifier() : void;
addEndModifier() : void;
}
class StaveNote extends StemmableNote {
//TODO remove the following lines once TypeScript allows subclass overrides with type changes and/or inconsistencies mentioned below are fixed
buildStem() : StemmableNote;
buildStem() : StemmableNote;
setStave(stave : Stave) : Note;
addModifier(modifier : Modifier, index? : number) : Note;
getModifierStartXY() : {x : number, y : number};
@@ -972,11 +972,11 @@ declare namespace Vex {
const STEM_DOWN: number;
const CATEGORY: string;
}
class StaveSection extends Modifier {
//TODO remove the following lines once TypeScript allows subclass overrides with type changes
draw() : void;
constructor(section : string, x : number, shift_y : number);
getCategory() : string;
setStaveSection(section : string) : StaveSection;
@@ -984,7 +984,7 @@ declare namespace Vex {
setShiftY(y : number) : StaveSection;
draw(stave : Stave, shift_x : number) : StaveSection;
}
class StaveTempo extends StaveModifier {
constructor(tempo : {name? : string, duration : string, dots : number, bpm : number}, x : number, shift_y : number);
getCategory() : string;
@@ -993,11 +993,11 @@ declare namespace Vex {
setShiftY(y : number) : StaveTempo;
draw(stave : Stave, shift_x : number) : StaveTempo;
}
class StaveText extends Modifier {
//TODO remove the following lines once TypeScript allows subclass overrides with type changes
draw() : void;
constructor(text : string, position : Modifier.Position, options? : {shift_x? : number, shift_y? : number, justification? : TextNote.Justification});
getCategory() : string;
setStaveText(text : string) : StaveText;
@@ -1007,7 +1007,7 @@ declare namespace Vex {
setText(text : string) : void;
draw(stave : Stave) : StaveText;
}
class StaveTie {
constructor(notes : {first_note: Note, last_note: Note, first_indices : number[], last_indices : number[]}, text? : string);
setContext(context : IRenderContext) : StaveTie;
@@ -1018,7 +1018,7 @@ declare namespace Vex {
renderText(first_x_px : number, last_x_px : number) : void;
draw() : boolean;
}
class Stem {
constructor(options : {x_begin? : number, x_end? : number, y_top? : number, y_bottom? : number, y_extend? : number, stem_extension? : number, stem_direction? : number});
static DEBUG : boolean;
@@ -1035,7 +1035,7 @@ declare namespace Vex {
getStyle() : {shadowColor? : string, shadowBlur? : string, fillStyle? : string, strokeStyle? : string};
applyStyle(context : IRenderContext) : Stem;
draw() : void;
//inconsistent API: this should be set via the options object in the constructor
hide : boolean;
}
@@ -1044,11 +1044,11 @@ declare namespace Vex {
const UP: number;
const DOWN: number;
}
class StemmableNote extends Note {
//TODO remove the following lines once TypeScript allows subclass overrides with type changes
setBeam() : Note;
constructor(note_struct : {type? : string, dots? : number, duration : string});
static DEBUG : boolean;
getStem() : Stem;
@@ -1070,11 +1070,11 @@ declare namespace Vex {
postFormat() : StemmableNote;
drawStem(stem_struct : {x_begin? : number, x_end? : number, y_top? : number, y_bottom? : number, y_extend? : number, stem_extension? : number, stem_direction? : number}) : void;
}
class StringNumber extends Modifier {
//TODO remove the following lines once TypeScript allows subclass overrides with type changes
setNote(note : Note) : StringNumber;
constructor(number : number);
static format(nums : StringNumber[], state : {left_shift : number, right_shift : number, text_line : number}) : boolean;
getNote() : Note;
@@ -1095,7 +1095,7 @@ declare namespace Vex {
namespace StringNumber {
const CATEGORY: string;
}
class Stroke extends Modifier {
constructor(type : Stroke.Type, options : {all_voices? : boolean});
static format(strokes : Stroke[], state : {left_shift : number, right_shift : number, text_line : number}) : boolean;
@@ -1103,7 +1103,7 @@ declare namespace Vex {
addEndNote(note : Note) : Stroke;
draw() : void;
}
namespace Stroke {
const enum Type {BRUSH_DOWN, BRUSH_UP, ROLL_DOWN, ROLL_UP, RASQUEDO_DOWN, RASQUEDO_UP}
const CATEGORY : string;
@@ -1145,12 +1145,12 @@ declare namespace Vex {
save() : SVGContext;
restore() : SVGContext;
}
class TabNote extends StemmableNote {
//TODO remove the following lines once TypeScript allows subclass overrides with type changes
setStave(stave : Stave) : Note;
getModifierStartXY() : {x : number, y : number};
constructor(tab_struct : {positions : {str : number, fret : number}[], type? : string, dots? : number, duration : string, stem_direction? : boolean}, draw_stem? : boolean);
getCategory() : string;
setGhost(ghost : boolean) : TabNote;
@@ -1174,32 +1174,32 @@ declare namespace Vex {
drawStemThrough() : void;
draw() : void;
}
class TabSlide extends TabTie {
constructor(notes : {first_note: Note, last_note: Note, first_indices : number[], last_indices : number[]}, direction? : number);
static createSlideUp(notes : {first_note: Note, last_note: Note, first_indices : number[], last_indices : number[]}) : TabSlide;
static createSlideDown(notes : {first_note: Note, last_note: Note, first_indices : number[], last_indices : number[]}) : TabSlide;
renderTie(params : {first_ys : number[], last_ys : number[], last_x_px : number, first_x_px : number, direction : number}) : void;
}
namespace TabSlide {
const SLIDE_UP : number;
const SLIDE_DOWN : number;
}
class TabStave extends Stave {
constructor(x : number, y : number, width : number, options? : {vertical_bar_width? : number, glyph_spacing_px? : number, num_lines? : number, fill_style? : string, spacing_between_lines_px? : number, space_above_staff_ln? : number, space_below_staff_ln? : number, top_text_position? : number});
getYForGlyphs() : number;
addTabGlyph() : TabStave;
}
class TabTie extends StaveTie {
constructor(notes : {first_note: Note, last_note: Note, first_indices : number[], last_indices : number[]}, text? : string);
createHammeron(notes : {first_note: Note, last_note: Note, first_indices : number[], last_indices : number[]}) : TabTie;
createPulloff(notes : {first_note: Note, last_note: Note, first_indices : number[], last_indices : number[]}) : TabTie;
draw() : boolean;
}
class TextBracket {
constructor(bracket_data : {start : Note, stop : Note, text? : string, superscript? : string, position? : TextBracket.Positions});
static DEBUG : boolean;
@@ -1210,11 +1210,11 @@ declare namespace Vex {
setLine(line : number) : TextBracket;
draw() : void;
}
namespace TextBracket {
const enum Positions {TOP, BOTTOM}
}
class TextDynamics extends Note {
constructor(text_struct : {duration : string, text : string, line? : number});
static DEBUG : boolean;
@@ -1230,12 +1230,12 @@ declare namespace Vex {
preFormat() : void;
draw() : void;
}
namespace TextNote {
const enum Justification {LEFT, CENTER, RIGHT}
const GLYPHS : {[name : string] : {code : string, point : number, x_shift : number, y_shift : number}}
}
interface Tickable {
setContext(context : IRenderContext) : void;
getBoundingBox() : BoundingBox;
@@ -1261,7 +1261,7 @@ declare namespace Vex {
applyTickMultiplier(numerator : number, denominator : number) : void;
setDuration(duration : Fraction) : void;
}
class TickContext {
setContext(context : IRenderContext) : void;
getContext() : IRenderContext;
@@ -1285,12 +1285,12 @@ declare namespace Vex {
postFormat() : TickContext;
static getNextContext(tContext : TickContext) : TickContext;
}
class TimeSignature extends StaveModifier {
//TODO remove the following lines once TypeScript allows subclass overrides with type changes
addModifier() : void;
addEndModifier() : void;
constructor(timeSpec : string, customPadding? : number);
parseTimeSpec(timeSpec : string) : {num : number, glyph : Glyph};
makeTimeSignatureGlyph(topNums : number[], botNums : number[]) : Glyph;
@@ -1298,11 +1298,11 @@ declare namespace Vex {
addModifier(stave : Stave) : void;
addEndModifier(stave : Stave) : void;
}
namespace TimeSignature {
const glyphs : {[name : string] : {code : string, point : number, line : number}};
}
class TimeSigNote extends Note {
//TODO remove the following lines once TypeScript allows subclass overrides with type changes or type inconsistencies mentioned below are fixed
setStave(stave : Stave) : Note;
@@ -1314,26 +1314,26 @@ declare namespace Vex {
preFormat() : TimeSigNote;
draw() : void;
}
class Tremolo extends Modifier {
constructor(num : number);
getCategory() : string;
draw() : void;
}
class Tuning {
constructor(tuningString? : string);
noteToInteger(noteString : string) : number;
setTuning(tuningString : string) : void;
getValueForString(stringNum : string) : number;
getValueForFret(fretNum : string, stringNum : string) : number;
getNoteForFret(fretNum : string, stringNum : string) : string;
getNoteForFret(fretNum : string, stringNum : string) : string;
}
namespace Tuning {
const names: { [name: string]: string };
}
class Tuplet {
constructor(notes : StaveNote[], options : {num_notes? : number, beats_occupied? : number});
attach() : void;
@@ -1352,20 +1352,20 @@ declare namespace Vex {
namespace Tuplet {
const LOCATION_TOP : number;
const LOCATION_BOTTOM : number;
const LOCATION_BOTTOM : number;
}
class Vibrato extends Modifier {
static format(vibratos : Vibrato[], state : {left_shift : number, right_shift : number, text_line : number}, context : ModifierContext) : boolean;
setHarsh(harsh : boolean) : Vibrato;
setVibratoWidth(width : number) : Vibrato;
draw() : void;
draw() : void;
}
namespace Vibrato {
const CATEGORY : string;
}
class Voice {
constructor(time : {num_beats? : number, beat_value? : number, resolution? : number});
getTotalTicks() : Fraction;
@@ -1388,26 +1388,26 @@ declare namespace Vex {
preFormat() : Voice;
draw(context : IRenderContext, stave? : Stave) : void;
}
namespace Voice {
const enum Mode {STRICT, SOFT, FULL}
}
class VoiceGroup {
getVoices() : Voice[];
getModifierContexts() : ModifierContext[];
addVoice(voice : Voice) : void;
}
class Volta extends StaveModifier {
constructor(type : Volta.type, number : number, x : number, y_shift : number);
getCategory() : string;
setShiftY(y : number) : Volta;
draw(stave : Stave, x : number) : Volta;
}
namespace Volta {
const enum type {NONE, BEGIN, MID, END, BEGIN_END}
}
}
}
}
+1 -1
View File
@@ -63,7 +63,7 @@ videojs("example_video_1").ready(function(){
myPlayer.cancelFullScreen();
var myFunc = function(){
var myPlayer: VideoJSPlayer = this;
// Do something when the event is fired
+2 -2
View File
@@ -34,10 +34,10 @@ interface VideoJSPlayer {
currentTime(): number;
duration(): number;
buffered(): TimeRanges;
bufferedPercent(): number;
bufferedPercent(): number;
volume(percentAsDecimal: number): TimeRanges;
volume(): number;
width(): number;
width(): number;
width(pixels: number): VideoJSPlayer;
height(): number;
height(pixels: number): VideoJSPlayer;
+1 -1
View File
@@ -5,7 +5,7 @@ var vox: VoxImplant.Client = VoxImplant.getInstance(),
room: string;
vox.init({
micRequired: true
micRequired: true
});
vox.addEventListener(VoxImplant.Events.SDKReady, function(event: VoxImplant.Events.SDKReady) {
+61 -61
View File
@@ -3,7 +3,7 @@
// Definitions by: Alexey Aylarov <https://github.com/aylarov/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare namespace VoxImplant {
declare namespace VoxImplant {
/**
* VoxImplant.Client general events
@@ -12,7 +12,7 @@ declare namespace VoxImplant {
AuthResult,
ConnectionClosed,
ConnectionEstablished,
ConnectionFailed,
ConnectionFailed,
IncomingCall,
MicAccessResult,
NetStatsReceived,
@@ -44,14 +44,14 @@ declare namespace VoxImplant {
ChatRoomPresenceUpdate,
ChatRoomStateUpdate,
ChatRoomSubjectChange,
ChatRoomsDataReceived,
ChatRoomsDataReceived,
ChatStateUpdate,
MessageModified,
MessageNotModified,
MessageModified,
MessageNotModified,
MessageReceived,
MessageRemoved,
MessageRemoved,
MessageStatus,
PresenceUpdate,
PresenceUpdate,
RosterItemChange,
RosterPresenceUpdate,
RosterReceived,
@@ -123,7 +123,7 @@ declare namespace VoxImplant {
* Failure reason description
*/
message: string;
}
}
/**
* Event dispatched when there is a new incoming call to current user
@@ -196,7 +196,7 @@ declare namespace VoxImplant {
*/
headers?: Object;
}
/**
* Event dispatched after call was disconnected
*/
@@ -320,7 +320,7 @@ declare namespace VoxImplant {
}
}
module IMEvents {
module IMEvents {
/**
* Event dispatched when chat history received
@@ -389,7 +389,7 @@ declare namespace VoxImplant {
/**
* Event dispatched when chat room history received
*/
interface ChatRoomHistoryReceived {
interface ChatRoomHistoryReceived {
/**
* Message id specified in getInstantMessagingHistory method
*/
@@ -407,7 +407,7 @@ declare namespace VoxImplant {
/**
* Event dispatched when user joins chat room
*/
interface ChatRoomInfo {
interface ChatRoomInfo {
/**
* Room features
*/
@@ -429,7 +429,7 @@ declare namespace VoxImplant {
/**
* Event dispatched when invitation to chat room received
*/
interface ChatRoomInvitation {
interface ChatRoomInvitation {
/**
* The body of the message
*/
@@ -455,7 +455,7 @@ declare namespace VoxImplant {
/**
* Event dispatched if an invitation to chat room was declined by the invitee
*/
interface ChatRoomInviteDeclined {
interface ChatRoomInviteDeclined {
/**
* User id (invitee)
*/
@@ -473,7 +473,7 @@ declare namespace VoxImplant {
/**
* Event dispatched when chat room message modified
*/
interface ChatRoomMessageModified {
interface ChatRoomMessageModified {
/**
* New message content
*/
@@ -507,7 +507,7 @@ declare namespace VoxImplant {
/**
* Event dispatched in case of error during chat room message modification
*/
interface ChatRoomMessageNotModified {
interface ChatRoomMessageNotModified {
/**
* Error code
*/
@@ -529,7 +529,7 @@ declare namespace VoxImplant {
/**
* Event dispatched when instant message was sent to chat room
*/
interface ChatRoomMessageReceived {
interface ChatRoomMessageReceived {
/**
* Message content
*/
@@ -563,7 +563,7 @@ declare namespace VoxImplant {
/**
* Event dispatched when chat room message removed
*/
interface ChatRoomMessageRemoved {
interface ChatRoomMessageRemoved {
/**
* User id
*/
@@ -593,7 +593,7 @@ declare namespace VoxImplant {
/**
* Event dispatched when new participant joined the chat room
*/
interface ChatRoomNewParticipant {
interface ChatRoomNewParticipant {
/**
* User display name
*/
@@ -609,7 +609,7 @@ declare namespace VoxImplant {
}
/**
* Event dispatched when chat room participant was banned/unbanned
* Event dispatched when chat room participant was banned/unbanned
*/
interface ChatRoomOperation {
/**
@@ -629,7 +629,7 @@ declare namespace VoxImplant {
/**
* Event dispatched when participant left the chat room
*/
interface ChatRoomParticipantExit {
interface ChatRoomParticipantExit {
/**
* User id
*/
@@ -643,7 +643,7 @@ declare namespace VoxImplant {
/**
* Event dispatched when info about chat room participants received
*/
interface ChatRoomParticipants {
interface ChatRoomParticipants {
/**
* Participants list
*/
@@ -657,7 +657,7 @@ declare namespace VoxImplant {
/**
* Event dispatched if chat room participant presence status was updated
*/
interface ChatRoomPresenceUpdate {
interface ChatRoomPresenceUpdate {
/**
* Optional presence message
*/
@@ -679,7 +679,7 @@ declare namespace VoxImplant {
/**
* Event dispatched when chat session state updated
*/
interface ChatRoomStateUpdate {
interface ChatRoomStateUpdate {
/**
* User id
*/
@@ -687,7 +687,7 @@ declare namespace VoxImplant {
/**
* Resource name
*/
resource: string;
resource: string;
/**
* Room id
*/
@@ -701,7 +701,7 @@ declare namespace VoxImplant {
/**
* Event dispatched if chat room subject was changed
*/
interface ChatRoomSubjectChange {
interface ChatRoomSubjectChange {
/**
* User id who changed the subject
*/
@@ -709,7 +709,7 @@ declare namespace VoxImplant {
/**
* Resource name
*/
resource: string;
resource: string;
/**
* Room id
*/
@@ -723,7 +723,7 @@ declare namespace VoxImplant {
/**
* Event dispatched when information about chat rooms where user participates received
*/
interface ChatRoomsDataReceived {
interface ChatRoomsDataReceived {
/**
* Rooms list
*/
@@ -899,7 +899,7 @@ declare namespace VoxImplant {
/**
* Roster item event type. See VoxImplant.RosterItemEvent enum
*/
type: RosterItemEvent;
type: RosterItemEvent;
}
/**
@@ -987,7 +987,7 @@ declare namespace VoxImplant {
}
type VoxImplantEvent = Events.AuthResult | Events.ConnectionClosed | Events.ConnectionEstablished |
Events.ConnectionFailed | Events.IncomingCall | Events.MicAccessResult |
Events.ConnectionFailed | Events.IncomingCall | Events.MicAccessResult |
Events.NetStatsReceived | Events.PlaybackFinished | Events.SDKReady | Events.SourcesInfoUpdated;
@@ -995,17 +995,17 @@ declare namespace VoxImplant {
CallEvents.InfoReceived | CallEvents.MessageReceived | CallEvents.ProgressToneStart |
CallEvents.ProgressToneStop | CallEvents.TransferComplete | CallEvents.TransferFailed;
type VoxImplantIMEvent = IMEvents.ChatHistoryReceived | IMEvents.ChatRoomBanList |
IMEvents.ChatRoomCreated | IMEvents.ChatRoomError | IMEvents.ChatRoomHistoryReceived |
IMEvents.ChatRoomInfo | IMEvents.ChatRoomInvitation | IMEvents.ChatRoomInviteDeclined |
IMEvents.ChatRoomMessageModified | IMEvents.ChatRoomMessageNotModified | IMEvents.ChatRoomMessageReceived |
IMEvents.ChatRoomMessageRemoved | IMEvents.ChatRoomNewParticipant | IMEvents.ChatRoomOperation |
IMEvents.ChatRoomParticipantExit | IMEvents.ChatRoomParticipants | IMEvents.ChatRoomPresenceUpdate |
IMEvents.ChatRoomStateUpdate | IMEvents.ChatRoomSubjectChange | IMEvents.ChatRoomsDataReceived |
IMEvents.ChatStateUpdate | IMEvents.MessageModified | IMEvents.MessageNotModified |
IMEvents.MessageReceived | IMEvents.MessageRemoved | IMEvents.MessageStatus |
IMEvents.PresenceUpdate | IMEvents.RosterItemChange | IMEvents.RosterPresenceUpdate |
IMEvents.RosterReceived | IMEvents.SubscriptionRequest | IMEvents.SystemError |
type VoxImplantIMEvent = IMEvents.ChatHistoryReceived | IMEvents.ChatRoomBanList |
IMEvents.ChatRoomCreated | IMEvents.ChatRoomError | IMEvents.ChatRoomHistoryReceived |
IMEvents.ChatRoomInfo | IMEvents.ChatRoomInvitation | IMEvents.ChatRoomInviteDeclined |
IMEvents.ChatRoomMessageModified | IMEvents.ChatRoomMessageNotModified | IMEvents.ChatRoomMessageReceived |
IMEvents.ChatRoomMessageRemoved | IMEvents.ChatRoomNewParticipant | IMEvents.ChatRoomOperation |
IMEvents.ChatRoomParticipantExit | IMEvents.ChatRoomParticipants | IMEvents.ChatRoomPresenceUpdate |
IMEvents.ChatRoomStateUpdate | IMEvents.ChatRoomSubjectChange | IMEvents.ChatRoomsDataReceived |
IMEvents.ChatStateUpdate | IMEvents.MessageModified | IMEvents.MessageNotModified |
IMEvents.MessageReceived | IMEvents.MessageRemoved | IMEvents.MessageStatus |
IMEvents.PresenceUpdate | IMEvents.RosterItemChange | IMEvents.RosterPresenceUpdate |
IMEvents.RosterReceived | IMEvents.SubscriptionRequest | IMEvents.SystemError |
IMEvents.UCConnected | IMEvents.UCDisconnected;
/**
@@ -1115,23 +1115,23 @@ declare namespace VoxImplant {
}
enum ChatStateType {
/**
* User is actively participating in the chat session
/**
* User is actively participating in the chat session
*/
Active,
/**
/**
* User is composing a message
*/
Composing,
/**
/**
* User has effectively ended their participation in the chat session
*/
Gone,
/**
/**
* User has not been actively participating in the chat session
*/
Inactive,
/**
/**
* Invalid type
*/
Invalid,
@@ -1488,7 +1488,7 @@ declare namespace VoxImplant {
* @param direction False/true to get messages older/newer than the message with specified id
* @param count Number of messages
*/
getInstantMessagingHistory(user_id: string, message_id?: string, direction?: boolean, count?: number): void;
getInstantMessagingHistory(user_id: string, message_id?: string, direction?: boolean, count?: number): void;
/**
* Initialize SDK. SDKReady event will be dispatched after succesful SDK initialization. SDK can't be used until it's initialized
*
@@ -1524,25 +1524,25 @@ declare namespace VoxImplant {
/**
* Login into application
*
* @param username
* @param username
* @param password
* @param options Login options
* @param options Login options
*/
login(username: string, password: string, options?: LoginOptions): void;
/**
* Login into application using 'code' auth method
*
* @param username
* @param username
* @param code
* @param options Login options
* @param options Login options
*/
loginWithCode(username: string, code: string, options?: LoginOptions): void;
/**
* Login into application using 'onetimekey' auth method
*
* @param username
* @param username
* @param hash
* @param options Login options
* @param options Login options
*/
loginWithOneTimeKey(username: string, hash: string, options?: LoginOptions): void;
/**
@@ -1700,7 +1700,7 @@ declare namespace VoxImplant {
setPresenceStatus(status: UserStatuses, msg: string): void;
/**
* Set background color of flash app (only for Flash mode)
*
*
* @param color Color in web format (i.e. #000000 for black)
*/
setSwfColor(color: string): void;
@@ -1720,7 +1720,7 @@ declare namespace VoxImplant {
setVideoSettings(settings: VideoSettings | FlashVideoSettings, successCallback?: () => any, failedCallback?: () => any): void;
/**
* Show flash settings panel
*
*
* @param panel Settings type - default/microphone/camera/etc as described in SecurityPanel class
*/
showFlashSettingsPanel(panel?: string): void;
@@ -1782,18 +1782,18 @@ declare namespace VoxImplant {
* @param eventName Event name
* @param eventHandler Handler function. A single parameter is passed - object with the event information
*/
addEventListener(eventName: VoxImplant.CallEvents, eventHandler: (eventObject: VoxImplantCallEvent) => any): void;
addEventListener(eventName: VoxImplant.CallEvents, eventHandler: (eventObject: VoxImplantCallEvent) => any): void;
/**
* Answer on incoming call
*
* @param customData Set custom string associated with call session. It can be later obtained from Call History using HTTP API
* @param extraHeaders Optional custom parameters (SIP headers) that should be sent after accepting incoming call. Parameter names must start with "X-" to be processed by application
* @param extraHeaders Optional custom parameters (SIP headers) that should be sent after accepting incoming call. Parameter names must start with "X-" to be processed by application
*/
answer(customData?: string, extraHeaders?: Object): void;
/**
* Reject incoming call
*
* @param extraHeaders Optional custom parameters (SIP headers) that should be sent after accepting incoming call. Parameter names must start with "X-" to be processed by application
* @param extraHeaders Optional custom parameters (SIP headers) that should be sent after accepting incoming call. Parameter names must start with "X-" to be processed by application
*/
decline(extraHeaders?: Object): void;
/**
@@ -1944,7 +1944,7 @@ declare namespace VoxImplant {
/**
* Optional constraints object
*/
optional?: Object;
optional?: Object;
}
/**
@@ -2029,7 +2029,7 @@ declare namespace VoxImplant {
* VoxImplant Web SDK lib version
*/
function version(): String;
}
declare module "voximplant-websdk" {
+4 -4
View File
@@ -22,7 +22,7 @@ test_apis();
function test_apis() {
var webapi: webapim.WebApi = new webapim.WebApi('http://serverfoobar.com', webapim.getBasicHandler('fooser', 'barssword'));
var buildapi: buildm.IBuildApi = webapi.getBuildApi();
var qbuildapi: buildm.IQBuildApi = webapi.getQBuildApi();
var coreapi: corem.ICoreApi = webapi.getCoreApi();
@@ -43,14 +43,14 @@ function test_apis() {
var qtfvcapi: tfvcm.IQTfvcApi = webapi.getQTfvcApi();
var witapi: workitemtrackingm.IWorkItemTrackingApi = webapi.getWorkItemTrackingApi();
var qwitapi: workitemtrackingm.IQWorkItemTrackingApi = webapi.getQWorkItemTrackingApi();
var apis: basem.ClientApiBase[] = [buildapi, coreapi, filecontainerapi, galleryapi, gitapi, taskapi, agentapi, testapi, tfvcapi, witapi];
var qapis: basem.QClientApiBase[] = [qbuildapi, qcoreapi, qfilecontainerapi, qgalleryapi, qgitapi, qtaskapi, qagentapi, qtestapi, qtfvcapi, qwitapi];
for(var api in apis) {
console.log('API user agent name: ' + api.userAgent);
}
for(var qapi in qapis) {
console.log('Q API user agent name: ' + qapi.api.userAgent);
}
}
}
+5 -5
View File
@@ -126,7 +126,7 @@ namespace TestInstanceProperty {
namespace TestInscanceMethods {
"use strict";
var vm = new Vue({el: '#app'});
vm.$watch('a.b.c', function(newVal: string, oldVal: number) {});
vm.$watch(function() {return this.a + this.b}, function(newVal: string, oldVal: string) {});
@@ -141,7 +141,7 @@ namespace TestInscanceMethods {
s = vm.$interpolate('{{msg}} world!');
vm.$log();
vm.$log('item');
vm
.$on('test', (msg: any) => {})
.$once('testOnce', (msg: any) => {})
@@ -149,13 +149,13 @@ namespace TestInscanceMethods {
.$emit("event", 1, 2)
.$dispatch("event", 1, 2, 3)
.$broadcast("event", 1, 2, 3, 4)
.$appendTo(document.createElement("div"), () => {})
.$before('#app', () => {})
.$after(document.getElementById('app'))
.$remove(() => {})
.$nextTick(() => {});
vm
.$mount('#app')
.$destroy(false);
@@ -163,7 +163,7 @@ namespace TestInscanceMethods {
namespace TestVueUtil {
"use strict";
var _ = Vue.util;
var target = document.createElement('div');
var child = document.createElement('div');
+16 -16
View File
@@ -17,18 +17,18 @@ declare namespace vuejs {
twoWay?: boolean;
validator?(value: any): boolean;
}
interface ComputedOption {
get(): any;
set(value: any): void;
}
interface WatchOption {
handler(val: any, oldVal: any): void;
deep?: boolean;
immidiate?: boolean;
}
interface DirectiveOption {
bind?(): any;
update?(newVal?: any, oldVal?: any): any;
@@ -40,12 +40,12 @@ declare namespace vuejs {
priority?: number;
[key: string]: any;
}
interface FilterOption {
read: Function;
write: Function;
}
interface TransitionOption {
css?: boolean;
beforeEnter?(el: HTMLElement): void;
@@ -58,7 +58,7 @@ declare namespace vuejs {
leaveCancelled?(el: HTMLElement): void;
stagger?(index: number): number;
}
interface ComponentOption {
data?: {[key: string]: any } | Function;
props?: string[] | { [key: string]: PropOption };
@@ -89,7 +89,7 @@ declare namespace vuejs {
name?: string;
[key: string]: any;
}
// instance/api/data.js
interface $get { ( exp: string, asStatement?: boolean ): any; }
interface $set { <T>( key: string | number, value: T ): T; }
@@ -116,7 +116,7 @@ declare namespace vuejs {
interface $mount<V> { ( elementOrSelector?: ( HTMLElement | string ) ): V; }
interface $destroy { (remove?: boolean): void; }
interface $compile { (el: Element | DocumentFragment, host?: Vue): Function; }
interface Vue {
$data?: any;
$el?: HTMLElement;
@@ -126,7 +126,7 @@ declare namespace vuejs {
$children?: Vue[];
$refs?: Object;
$els?: Object;
$get?: $get;
$set?: $set;
$delete?: $delete;
@@ -148,10 +148,10 @@ declare namespace vuejs {
$mount?: $mount<this>;
$destroy?: $destroy;
$compile?: $compile;
_init(options?: ComponentOption): void;
}
interface VueConfig {
debug: boolean;
delimiters: [string, string];
@@ -160,7 +160,7 @@ declare namespace vuejs {
async: boolean;
convertAllProperties: boolean;
}
interface VueUtil {
// util/lang.js
set(obj: Object, key: string, value: any): void;
@@ -231,7 +231,7 @@ declare namespace vuejs {
// observer/index.js
defineReactive(obj: Object, key: string, val: any): void;
}
// instance/api/global.js
interface VueStatic {
new(options?: ComponentOption): Vue;
@@ -241,13 +241,13 @@ declare namespace vuejs {
set(object: Object, key: string, value: any): void;
delete(object: Object, key: string): void;
nextTick(callback: Function): any;
cid: number;
extend(options?: ComponentOption): VueStatic;
use(callback: Function | {install: Function, [key: string]: any}, option?: Object): VueStatic;
mixin(mixin: Object): void;
directive<T extends ( Function | DirectiveOption ) >(id: string, definition: T): T;
directive(id: string): any;
elementDirective<T extends ( Function | DirectiveOption ) >(id: string, definition: T): T;
+10 -10
View File
@@ -8,30 +8,30 @@
declare module wol {
export interface WakeOptions {
/**
* The ip address to which the packet is send (default: 255.255.255.255)
*/
address?:string;
/**
* Number of packets to send (default: 3)
*/
num_packets?:number;
/**
* The interval between packets (default: 100ms)
*/
interval?:number;
/**
* The port to send to (default: 9)
*/
port?:number;
}
type ErrorCallback = (Error:any) => void;
export interface Wol {
/**
* Send a sequence of Wake-on-LAN magic packets to the given MAC address.
@@ -39,7 +39,7 @@ declare module wol {
* @param {string} macAddress the mac address of the target device
*/
wake(macAddress:string):void;
/**
* Send a sequence of Wake-on-LAN magic packets to the given MAC address.
*
@@ -47,7 +47,7 @@ declare module wol {
* @param {ErrorCallback} callback is called when all packets have been sent or an error occurs.
*/
wake(macAddress:string, callback:ErrorCallback):void;
/**
* Send a sequence of Wake-on-LAN magic packets to the given MAC address.
*
@@ -56,10 +56,10 @@ declare module wol {
* @param {ErrorCallback} callback is called when all packets have been sent or an error occurs.
*/
wake(macAddress:string, opts:WakeOptions, callback?:Function):void;
/**
* Creates a buffer with a magic packet for the given MAC address.
*
*
* @param {string} macAddress mac address of the target device
* @return {Buffer} the magic packet
*/
+2 -2
View File
@@ -185,12 +185,12 @@ interface AudioContext {
}
interface MediaStreamAudioSourceNode extends AudioNode {
}
interface AudioBuffer {
copyFromChannel(destination: Float32Array, channelNumber: number, startInChannel?: number): void;
copyToChannel(source: Float32Array, channelNumber: number, startInChannel?: number): void;
}
+4 -4
View File
@@ -24,10 +24,10 @@ declare module WebFont {
fontactive?(familyName:string, fvd:string):void;
/** This event is triggered if the font can't be loaded. */
fontinactive?(familyName:string, fvd:string):void;
/** Child window or iframes to manage fonts for */
context?:Array<string>;
custom?:Custom;
google?:Google;
typekit?:Typekit;
@@ -35,7 +35,7 @@ declare module WebFont {
monotype?:Monotype;
}
export interface Google {
families:Array<string>;
families:Array<string>;
text?: string;
}
export interface Typekit {
@@ -53,7 +53,7 @@ declare module WebFont {
projectId?:string;
version?:number;
}
}
declare module "webfontloader" {
export = WebFont;
+1 -1
View File
@@ -207,7 +207,7 @@ interface Results {
var prop = props[i];
args.push(record[prop]);
}
execSqlStatements(dbState.transaction, [sqlStatement], callback);
}
+80 -80
View File
@@ -4,16 +4,16 @@
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/* *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
@@ -394,7 +394,7 @@ declare module WinJS.Binding {
/**
* Creates a List object.
* @constructor
* @constructor
* @param list The array containing the elements to initalize the list.
* @param options You can set two Boolean options: binding and proxy. If options.binding is true, the list contains the result of calling as on the element values. If options.proxy is true, the list specified as the first parameter is used as the storage for the List. This option should be used with care, because uncoordinated edits to the data storage may result in errors.
**/
@@ -954,7 +954,7 @@ declare module WinJS.Binding {
/**
* Creates a template that provides a reusable declarative binding element.
* @constructor
* @constructor
* @param element The DOM element to convert to a template.
* @param options If this parameter is supplied, the template is loaded from the URI and the content of the element parameter is ignored. You can add the following options: href.
**/
@@ -1217,7 +1217,7 @@ declare module WinJS {
/**
* Creates an Error object with the specified name and message properties.
* @constructor
* @constructor
* @param name The name of this error. The name is meant to be consumed programmatically and should not be localized.
* @param message The message for this error. The message is meant to be consumed by humans and should be localized.
**/
@@ -1249,7 +1249,7 @@ declare module WinJS {
/**
* A promise provides a mechanism to schedule work to be done on a value that has not yet been computed. It is a convenient abstraction for managing interactions with asynchronous APIs. For more information about asynchronous programming, see Asynchronous programming. For more information about promises in JavaScript, see Asynchronous programming in JavaScript. For more information about using promises, see the WinJS Promise sample.
* @constructor
* @constructor
* @param init The function that is called during construction of the Promise that contains the implementation of the operation that the Promise will represent. This can be synchronous or asynchronous, depending on the nature of the operation. Note that placing code within this function does not automatically run it asynchronously; that must be done explicitly with other asynchronous APIs such as setImmediate, setTimeout, requestAnimationFrame, and the Windows Runtime asynchronous APIs. The init function is given three arguments: completeDispatch, errorDispatch, progressDispatch. This parameter is optional.
* @param onCancel The function to call if a consumer of this promise wants to cancel its undone work. Promises are not required to support cancellation.
**/
@@ -3634,7 +3634,7 @@ declare module WinJS.UI {
/**
* Creates a new AppBar object.
* @constructor
* @constructor
* @param element The DOM element that will host the control.
* @param options The set of properties and values to apply to the new AppBar.
**/
@@ -3744,7 +3744,7 @@ declare module WinJS.UI {
//#region Properties
/**
* Gets or sets how the app bar is displayed when hidden is true.
* Gets or sets how the app bar is displayed when hidden is true.
**/
closedDisplayMode: string;
@@ -3795,7 +3795,7 @@ declare module WinJS.UI {
/**
* Creates a new AppBarCommand object.
* @constructor
* @constructor
* @param element The DOM element that will host the control.
* @param options The set of properties and values to apply to the new AppBarCommand.
**/
@@ -3953,7 +3953,7 @@ declare module WinJS.UI {
/**
* Creates a new FlipView.
* @constructor
* @constructor
* @param element The DOM element that hosts the control.
* @param options An object that contains one or more property/value pairs to apply to the new control. Each property corresponds to one of the control's properties or events. Event names must begin with "on". For example, to provide a handler for the pageselected event, add a property named "onpageselected" and set its value to the event handler.
**/
@@ -4095,7 +4095,7 @@ declare module WinJS.UI {
/**
* Creates a new GridLayout object.
* @constructor
* @constructor
* @param options The set of properties and values to apply to the new GridLayout.
**/
constructor(options?: any);
@@ -4106,15 +4106,15 @@ declare module WinJS.UI {
/**
* This method is no longer supported.
* @param beginScrollPosition
* @param wholeItem
* @param beginScrollPosition
* @param wholeItem
**/
calculateFirstVisible(beginScrollPosition: number, wholeItem: boolean): void;
/**
* This method is no longer supported.
* @param endScrollPosition
* @param wholeItem
* @param endScrollPosition
* @param wholeItem
**/
calculateLastVisible(endScrollPosition: number, wholeItem: boolean): void;
@@ -4148,22 +4148,22 @@ declare module WinJS.UI {
/**
* This method is no longer supported.
* @param itemIndex
* @param itemIndex
**/
getItemPosition(itemIndex: number): void;
/**
* This method is no longer supported.
* @param itemIndex
* @param element
* @param keyPressed
* @param itemIndex
* @param element
* @param keyPressed
**/
getKeyboardNavigatedItem(itemIndex: number, element: any, keyPressed: any): void;
/**
* This method is no longer supported.
* @param beginScrollPosition
* @param endScrollPosition
* @param beginScrollPosition
* @param endScrollPosition
**/
getScrollbarRange(beginScrollPosition: number, endScrollPosition: number): void;
@@ -4188,7 +4188,7 @@ declare module WinJS.UI {
/**
* This method is no longer supported.
* @param elements
* @param elements
**/
itemsAdded(elements: any): void;
@@ -4206,50 +4206,50 @@ declare module WinJS.UI {
/**
* This method is no longer supported.
* @param elements
* @param elements
**/
itemsRemoved(elements: any): void;
/**
* This API supports the WinJS infrastructure and is not intended to be used directly from your code.
* @param tree
* @param changedRange
* @param modifiedItems
* @param modifiedGroups
* @param tree
* @param changedRange
* @param modifiedItems
* @param modifiedGroups
**/
layout(tree: any, changedRange: any, modifiedItems: any, modifiedGroups: any): void;
/**
* This method is no longer supported.
* @param groupIndex
* @param groupIndex
* @param element A DOM element.
**/
layoutHeader(groupIndex: number, element: any): void;
/**
* This method is no longer supported.
* @param itemIndex
* @param itemIndex
* @param element A DOM element.
**/
layoutItem(itemIndex: number, element: any): void;
/**
* This method is no longer supported.
* @param element
* @param element
**/
prepareHeader(element: HTMLElement): void;
/**
* This method is no longer supported.
* @param itemIndex
* @param itemIndex
* @param element A DOM element.
**/
prepareItem(itemIndex: number, element: any): void;
/**
* This method is no longer supported.
* @param item
* @param newItem
* @param item
* @param newItem
**/
releaseItem(item: any, newItem: any): void;
@@ -4260,7 +4260,7 @@ declare module WinJS.UI {
/**
* This method is no longer supported.
* @param layoutSite
* @param layoutSite
**/
setSite(layoutSite: any): void;
@@ -4271,8 +4271,8 @@ declare module WinJS.UI {
/**
* This method is no longer supported.
* @param beginScrollPosition
* @param endScrollPositionScrollPosition
* @param beginScrollPosition
* @param endScrollPositionScrollPosition
**/
startLayout(beginScrollPosition: number, endScrollPositionScrollPosition: number): void;
@@ -4283,7 +4283,7 @@ declare module WinJS.UI {
/**
* This method is no longer supported.
* @param count
* @param count
**/
updateBackdrop(count: number): void;
@@ -4371,7 +4371,7 @@ declare module WinJS.UI {
/**
* Creates a new ItemContainer.
* @constructor
* @constructor
* @param element The DOM element hosts the new ItemContainer. For the ItemContainer to be accessible, this element must have its role attribute set to "list" or "listbox". If tapBehavior is set to none and selectionDisabled is true, then use the "list" role; otherwise, use the "listbox" role.
* @param options An object that contains one or more property/value pairs to apply to the new control. Each property of the options object corresponds to one of the control's properties or events.
**/
@@ -4489,7 +4489,7 @@ declare module WinJS.UI {
/**
* Creates a new ListLayout.
* @constructor
* @constructor
* @param options An object that contains one or more property/value pairs to apply to the new ListLayout. Each property of the options object corresponds to one of the object's properties or events. Event names must begin with "on".
**/
constructor(options?: any);
@@ -4500,15 +4500,15 @@ declare module WinJS.UI {
/**
* This method is no longer supported.
* @param beginScrollPosition
* @param wholeItem
* @param beginScrollPosition
* @param wholeItem
**/
calculateFirstVisible(beginScrollPosition: number, wholeItem: boolean): void;
/**
* This method is no longer supported.
* @param endScrollPosition
* @param wholeItem
* @param endScrollPosition
* @param wholeItem
**/
calculateLastVisible(endScrollPosition: number, wholeItem: boolean): void;
@@ -4542,22 +4542,22 @@ declare module WinJS.UI {
/**
* This method is no longer supported.
* @param itemIndex
* @param itemIndex
**/
getItemPosition(itemIndex: number): void;
/**
* This method is no longer supported.
* @param itemIndex
* @param element
* @param keyPressed
* @param itemIndex
* @param element
* @param keyPressed
**/
getKeyboardNavigatedItem(itemIndex: number, element: HTMLElement, keyPressed: any): void;
/**
* This method is no longer supported.
* @param beginScrollPosition
* @param endScrollPosition
* @param beginScrollPosition
* @param endScrollPosition
**/
getScrollbarRange(beginScrollPosition: number, endScrollPosition: number): void;
@@ -4580,14 +4580,14 @@ declare module WinJS.UI {
/**
* This method is no longer supported.
* @param elements
* @param elements
**/
itemsAdded(elements: any): void;
/**
* This API supports the WinJS infrastructure and is not intended to be used directly from your code.
* @param firstPixel
* @param lastPixel
* @param firstPixel
* @param lastPixel
**/
itemsFromRange(firstPixel: number, lastPixel: number): void;
@@ -4598,50 +4598,50 @@ declare module WinJS.UI {
/**
* This method is no longer supported.
* @param elements
* @param elements
**/
itemsRemoved(elements: any): void;
/**
* This API supports the WinJS infrastructure and is not intended to be used directly from your code.
* @param tree
* @param changedRange
* @param modifiedItems
* @param modifiedGroups
* @param tree
* @param changedRange
* @param modifiedItems
* @param modifiedGroups
**/
layout(tree: any, changedRange: any, modifiedItems: any, modifiedGroups: any): void;
/**
* This method is no longer supported.
* @param groupIndex
* @param groupIndex
* @param element A DOM element.
**/
layoutHeader(groupIndex: number, element: any): void;
/**
* This method is no longer supported.
* @param itemIndex
* @param itemIndex
* @param element A DOM element.
**/
layoutItem(itemIndex: number, element: any): void;
/**
* This method is no longer supported.
* @param element
* @param element
**/
prepareHeader(element: HTMLElement): void;
/**
* This method is no longer supported.
* @param itemIndex
* @param itemIndex
* @param element A DOM element.
**/
prepareItem(itemIndex: number, element: any): void;
/**
* This method is no longer supported.
* @param item
* @param newItem
* @param item
* @param newItem
**/
releaseItem(item: any, newItem: any): void;
@@ -4652,7 +4652,7 @@ declare module WinJS.UI {
/**
* This method is no longer supported.
* @param layoutSite
* @param layoutSite
**/
setSite(layoutSite: any): void;
@@ -4663,8 +4663,8 @@ declare module WinJS.UI {
/**
* This method is no longer supported.
* @param beginScrollPosition
* @param endScrollPositionScrollPosition
* @param beginScrollPosition
* @param endScrollPositionScrollPosition
**/
startLayout(beginScrollPosition: number, endScrollPositionScrollPosition: number): void;
@@ -4675,7 +4675,7 @@ declare module WinJS.UI {
/**
* This method is no longer supported.
* @param count
* @param count
**/
updateBackdrop(count: number): void;
@@ -4735,7 +4735,7 @@ declare module WinJS.UI {
/**
* Creates a new ListView.
* @constructor
* @constructor
* @param element The DOM element that hosts the ListView control.
* @param options An object that contains one or more property/value pairs to apply to the new control. Each property of the options object corresponds to one of the control's properties or events. Event names must begin with "on". For example, to provide a handler for the selectionchanged event, add a property named "onselectionchanged" to the options object and set its value to the event handler.
**/
@@ -4996,7 +4996,7 @@ declare module WinJS.UI {
/**
* Creates a new Pivot.
* @constructor
* @constructor
* @param element The DOM element hosts the new Pivot.
* @param options An object that contains one or more property/value pairs to apply to the new control. Each property of the options object corresponds to one of the control's properties or events. Event names must begin with "on". For example, to provide a handler for the cancel event, add a property named "oncancel" to the options object and set its value to the event handler.
**/
@@ -5102,7 +5102,7 @@ declare module WinJS.UI {
/**
* Creates a new PivotItem.
* @constructor
* @constructor
* @param element The DOM element hosts the new PivotItem.
* @param options An object that contains one or more property/value pairs to apply to the new control. Each property of the options object corresponds to one of the control's properties or events. Event names must begin with "on". For example, to provide a handler for the cancel event, add a property named "oncancel" to the options object and set its value to the event handler.
**/
@@ -5147,7 +5147,7 @@ declare module WinJS.UI {
/**
* Creates a new Repeater control.
* @constructor
* @constructor
* @param elemnt The DOM element that will host the new control. The Repeater will create an element if this value is null.
* @param options An object that contains one or more property/value pairs to apply to the new Repeater. Each property of the options object corresponds to one of the object's properties or events. Event names must begin with "on".
**/
@@ -5299,7 +5299,7 @@ declare module WinJS.UI {
/**
* Creates a new SemanticZoom.
* @constructor
* @constructor
* @param element The DOM element that hosts the SemanticZoom.
* @param options An object that contains one or more property/value pairs to apply to the new control. This object can contain these properties: initiallyZoomedOut Boolean, zoomFactor 0.20.85.
**/
@@ -5424,7 +5424,7 @@ declare module WinJS.UI {
/**
* Creates a new TabContainer.
* @constructor
* @constructor
* @param element The DOM element that hosts the TabContainer control.
* @param options An object that contains one or more property/value pairs to apply to the new control. Each property of the options object corresponds to one of the control's properties.
**/
@@ -5465,7 +5465,7 @@ declare module WinJS.UI {
/**
* Creates a new ToggleSwitch.
* @constructor
* @constructor
* @param element The DOM that hosts the control.
* @param options An object that contains one or more property/value pairs to apply to the new control. Each property of the options object corresponds to one of the control's properties or events. Event names must begin with "on". For example, to provide a handler for the change event, add a property named "onchange" to the options object and set its value to the event handler.
**/
@@ -5638,7 +5638,7 @@ declare module WinJS.UI {
/**
* Initializes the VirtualizedDataSource base class of a custom data source.
* @constructor
* @constructor
* @param listDataAdapter The object that supplies data to the VirtualizedDataSource.
* @param options An object that can contain properties that specify additional options for the VirtualizedDataSource. It supports these properties: cacheSize.
**/
@@ -6830,7 +6830,7 @@ declare module WinJS.Utilities {
/**
* Indicates whether the app is running on Windows Phone.
**/
**/
var isPhone: boolean;
//#endregion Properties
+148 -148
View File
File diff suppressed because it is too large Load Diff
+10 -10
View File
@@ -4,16 +4,16 @@
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/* *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
@@ -11606,12 +11606,12 @@ declare module Windows {
* Gets the window (app view) for the current app.
**/
static getForCurrentView(): ApplicationView;
/**
* Attempts to unsnap a previously snapped app. This call will only succeed when the app is running in the foreground.
**/
static tryUnsnap(): boolean;
/**
* Gets the state of the current app view.
**/
@@ -11661,7 +11661,7 @@ declare module Windows {
* Gets whether the current window (app view) is adjacent to the left edge of the screen.
**/
adjacentToLeftDisplayEdge: number;
/**
* Gets the title bar of the app.
**/
@@ -14857,4 +14857,4 @@ declare module Windows.UI.ViewManagement {
**/
inactiveForegroundColor: Color;
}
}
}
+1 -1
View File
@@ -47,7 +47,7 @@ declare module "winston" {
export function setLevels(target: any): any;
export function cli(): LoggerInstance;
export function addRewriter(rewriter: MetadataRewriter): void;
export interface MetadataRewriter {
(level: string, msg: string, meta: any): any;
}
+372 -372
View File
@@ -1,372 +1,372 @@
// Type definitions for Wiredep v3.0.x
// Project: https://github.com/taptapship/wiredep
// Definitions by: Abraão Alves <http://abraaoalves.github.io>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare module 'wiredep' {
interface PathFiles{
[type: string]: string[];
}
/**
* @return {PathFiles} paths to your files by extension
* @example:
* {
* js: [
* 'paths/to/your/js/files.js',
* 'in/their/order/of/dependency.js'
* ],
* css: [
* 'paths/to/your/css/files.css'
* ],
* // etc.
* }
*/
function Wiredep(config: WiredepParams): PathFiles;
module Wiredep {
export function stream(config: WiredepParams): NodeJS.ReadWriteStream;
}
interface WiredepParams {
src?: string | string[];
/**
* the directory of your Bower packages.
* Default: '.bowerrc'.directory || bower_components
*/
directory?: string;
/**
* your bower.json file contents.
* Default: require('./bower.json')
*/
bowerJson?: string;
// ----- Advanced Configuration -----
// All of the below settings are for advanced configuration, to
// give your project support for additional file types and more
// control.
//
// Out of the box, wiredep will handle HTML files just fine for
// JavaScript and CSS injection.
/**
* path to where we are pretending to be
*/
cwd?: string;
/**
* Default: true
*/
dependencies?: boolean;
/**
* Default: false
*/
devDependencies?: boolean;
/**
* Default: false
*/
includeSelf?: boolean;
/**
* @example:
* [ /jquery/, 'bower_components/modernizr/modernizr.js' ]
*/
exclude?: Array<string | RegExp>;
/**
* string or regexp to ignore from the injected filepath
* @example:
* [ /jquery/, 'bower_components/modernizr/modernizr.js' ]
*/
ignorePath?: string | RegExp;
/**
* This inline object offers another way to define your overrides if
* modifying your project's `bower.json` isn't an option.
*/
overrides?: Object;
/**
* If not overridden, an error will throw
*
* err.code can be:
* - "PKG_NOT_INSTALLED" (a Bower package was not found)
* - "BOWER_COMPONENTS_MISSING" (cannot find the `bower_components` directory)
*/
onError?: (err: Error) => void;
/**
* @param {string} filePath name of file that was updated
*/
onFileUpdated?: (filePath: string) => void;
/**
* @param {FileObject} fileObject
*/
onPathInjected?: (fileObject: FileObject) => void;
/**
* @param {string} pkg name of bower package without main
*/
onMainNotFound?: (pkg: string) => void;
fileTypes? : FileTypes;
}
interface FileObject {
/**
* type of wiredep block ('js', 'css', etc)
*/
block: string;
/**
* name of file that was updated
*/
file: string;
/**
* path to file that was injected
*/
path: string
}
interface FileTypes {
fileExtension: {
/**
* match the beginning-to-end of a bower block in this type of file
*/
block: RegExp;
detect: {
/**
* match the way this type of file is included
*/
typeOfBowerFile: RegExp;
};
replace: {
/**
* <format for this {{filePath}} to be injected>
*/
typeOfBowerFile: string;
/**
* @exemple:
* return '<script class="random-' + Math.random() + '" src="' + filePath + '"></script>'
*/
anotherTypeOfBowerFile: (filePath: string) => string;
}
};
// defaults:
html: {
/**
* @example:
* /(([ \t]*)<!--\s*bower:*(\S*)\s*-->)(\n|\r|.)*?(<!--\s*endbower\s*-->)/gi
*/
block: RegExp;
detect: {
/**
* @example:
* /<script.*src=['"]([^'"]+)/gi
*/
js: RegExp;
/**
* @example:
* /<link.*href=['"]([^'"]+)/gi
*/
css: RegExp;
};
replace: {
/**
* @example:
* '<script src="{{filePath}}"></script>'
*/
js: string;
/**
* @example:
* '<link rel="stylesheet" href="{{filePath}}" />'
*/
css: string;
};
};
jade: {
/**
* @example:
* /(([ \t]*)\/\/\s*bower:*(\S*))(\n|\r|.)*?(\/\/\s*endbower)/gi
*/
block: RegExp;
detect: {
/**
* @example:
* /script\(.*src=['"]([^'"]+)/gi
*/
js: RegExp;
/**
* @example:
* /link\(.*href=['"]([^'"]+)/gi
*/
css: RegExp;
};
replace: {
/**
* @example:
* 'script(src=\'{{filePath}}\')'
*/
js: string;
/**
* @example:
* 'link(rel=\'stylesheet\', href=\'{{filePath}}\')'
*/
css: string;
}
};
less: {
/**
* @example:
* /(([ \t]*)\/\/\s*bower:*(\S*))(\n|\r|.)*?(\/\/\s*endbower)/gi
*/
block: RegExp;
detect: {
/**
* @example:
* /@import\s['"](.+css)['"]/gi
*/
css: RegExp;
/**
* @example:
* /@import\s['"](.+less)['"]/gi
*/
less: RegExp
};
replace: {
/**
* @example:
* '@import "{{filePath}}";'
*/
css: string;
/**
* @example:
* '@import "{{filePath}}";'
*/
less: string;
};
};
scss: {
/**
* @example:
* /(([ \t]*)\/\/\s*bower:*(\S*))(\n|\r|.)*?(\/\/\s*endbower)/gi
*/
block: RegExp;
detect: {
/**
* @example:
* /@import\s['"](.+css)['"]/gi
*/
css: RegExp;
/**
* @example:
* /@import\s['"](.+sass)['"]/gi
*/
sass: RegExp;
/**
* @example:
* /@import\s['"](.+scss)['"]/gi
*/
scss: RegExp;
},
replace: {
/**
* @example:
* '@import "{{filePath}}";'
*/
css: string;
/**
* @example:
* '@import "{{filePath}}";'
*/
sass: string;
/**
* @example:
* '@import "{{filePath}}";'
*/
scss: string;
}
};
styl: {
/**
* @example:
* /(([ \t]*)\/\/\s*bower:*(\S*))(\n|\r|.)*?(\/\/\s*endbower)/gi
*/
block: RegExp;
detect: {
/**
* @example:
* /@import\s['"](.+css)['"]/gi
*/
css: RegExp;
/**
* @example:
* /@import\s['"](.+styl)['"]/gi
*/
styl: RegExp;
};
replace: {
/**
* @example:
* '@import "{{filePath}}"'
*/
css: string;
/**
* @example:
* '@import "{{filePath}}"'
*/
styl: string;
};
};
yaml: {
/**
* @example:
* /(([ \t]*)#\s*bower:*(\S*))(\n|\r|.)*?(#\s*endbower)/gi
*/
block: RegExp;
detect: {
/**
* @example:
* /-\s(.+js)/gi
*/
js: RegExp;
/**
* @example:
* /-\s(.+css)/gi
*/
css: RegExp;
};
replace: {
/**
* @example:
* '- {{filePath}}'
*/
js: string;
/**
* @example:
* '- {{filePath}}'
*/
css: string;
};
};
}
export = Wiredep;
}
// Type definitions for Wiredep v3.0.x
// Project: https://github.com/taptapship/wiredep
// Definitions by: Abraão Alves <http://abraaoalves.github.io>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare module 'wiredep' {
interface PathFiles{
[type: string]: string[];
}
/**
* @return {PathFiles} paths to your files by extension
* @example:
* {
* js: [
* 'paths/to/your/js/files.js',
* 'in/their/order/of/dependency.js'
* ],
* css: [
* 'paths/to/your/css/files.css'
* ],
* // etc.
* }
*/
function Wiredep(config: WiredepParams): PathFiles;
module Wiredep {
export function stream(config: WiredepParams): NodeJS.ReadWriteStream;
}
interface WiredepParams {
src?: string | string[];
/**
* the directory of your Bower packages.
* Default: '.bowerrc'.directory || bower_components
*/
directory?: string;
/**
* your bower.json file contents.
* Default: require('./bower.json')
*/
bowerJson?: string;
// ----- Advanced Configuration -----
// All of the below settings are for advanced configuration, to
// give your project support for additional file types and more
// control.
//
// Out of the box, wiredep will handle HTML files just fine for
// JavaScript and CSS injection.
/**
* path to where we are pretending to be
*/
cwd?: string;
/**
* Default: true
*/
dependencies?: boolean;
/**
* Default: false
*/
devDependencies?: boolean;
/**
* Default: false
*/
includeSelf?: boolean;
/**
* @example:
* [ /jquery/, 'bower_components/modernizr/modernizr.js' ]
*/
exclude?: Array<string | RegExp>;
/**
* string or regexp to ignore from the injected filepath
* @example:
* [ /jquery/, 'bower_components/modernizr/modernizr.js' ]
*/
ignorePath?: string | RegExp;
/**
* This inline object offers another way to define your overrides if
* modifying your project's `bower.json` isn't an option.
*/
overrides?: Object;
/**
* If not overridden, an error will throw
*
* err.code can be:
* - "PKG_NOT_INSTALLED" (a Bower package was not found)
* - "BOWER_COMPONENTS_MISSING" (cannot find the `bower_components` directory)
*/
onError?: (err: Error) => void;
/**
* @param {string} filePath name of file that was updated
*/
onFileUpdated?: (filePath: string) => void;
/**
* @param {FileObject} fileObject
*/
onPathInjected?: (fileObject: FileObject) => void;
/**
* @param {string} pkg name of bower package without main
*/
onMainNotFound?: (pkg: string) => void;
fileTypes? : FileTypes;
}
interface FileObject {
/**
* type of wiredep block ('js', 'css', etc)
*/
block: string;
/**
* name of file that was updated
*/
file: string;
/**
* path to file that was injected
*/
path: string
}
interface FileTypes {
fileExtension: {
/**
* match the beginning-to-end of a bower block in this type of file
*/
block: RegExp;
detect: {
/**
* match the way this type of file is included
*/
typeOfBowerFile: RegExp;
};
replace: {
/**
* <format for this {{filePath}} to be injected>
*/
typeOfBowerFile: string;
/**
* @exemple:
* return '<script class="random-' + Math.random() + '" src="' + filePath + '"></script>'
*/
anotherTypeOfBowerFile: (filePath: string) => string;
}
};
// defaults:
html: {
/**
* @example:
* /(([ \t]*)<!--\s*bower:*(\S*)\s*-->)(\n|\r|.)*?(<!--\s*endbower\s*-->)/gi
*/
block: RegExp;
detect: {
/**
* @example:
* /<script.*src=['"]([^'"]+)/gi
*/
js: RegExp;
/**
* @example:
* /<link.*href=['"]([^'"]+)/gi
*/
css: RegExp;
};
replace: {
/**
* @example:
* '<script src="{{filePath}}"></script>'
*/
js: string;
/**
* @example:
* '<link rel="stylesheet" href="{{filePath}}" />'
*/
css: string;
};
};
jade: {
/**
* @example:
* /(([ \t]*)\/\/\s*bower:*(\S*))(\n|\r|.)*?(\/\/\s*endbower)/gi
*/
block: RegExp;
detect: {
/**
* @example:
* /script\(.*src=['"]([^'"]+)/gi
*/
js: RegExp;
/**
* @example:
* /link\(.*href=['"]([^'"]+)/gi
*/
css: RegExp;
};
replace: {
/**
* @example:
* 'script(src=\'{{filePath}}\')'
*/
js: string;
/**
* @example:
* 'link(rel=\'stylesheet\', href=\'{{filePath}}\')'
*/
css: string;
}
};
less: {
/**
* @example:
* /(([ \t]*)\/\/\s*bower:*(\S*))(\n|\r|.)*?(\/\/\s*endbower)/gi
*/
block: RegExp;
detect: {
/**
* @example:
* /@import\s['"](.+css)['"]/gi
*/
css: RegExp;
/**
* @example:
* /@import\s['"](.+less)['"]/gi
*/
less: RegExp
};
replace: {
/**
* @example:
* '@import "{{filePath}}";'
*/
css: string;
/**
* @example:
* '@import "{{filePath}}";'
*/
less: string;
};
};
scss: {
/**
* @example:
* /(([ \t]*)\/\/\s*bower:*(\S*))(\n|\r|.)*?(\/\/\s*endbower)/gi
*/
block: RegExp;
detect: {
/**
* @example:
* /@import\s['"](.+css)['"]/gi
*/
css: RegExp;
/**
* @example:
* /@import\s['"](.+sass)['"]/gi
*/
sass: RegExp;
/**
* @example:
* /@import\s['"](.+scss)['"]/gi
*/
scss: RegExp;
},
replace: {
/**
* @example:
* '@import "{{filePath}}";'
*/
css: string;
/**
* @example:
* '@import "{{filePath}}";'
*/
sass: string;
/**
* @example:
* '@import "{{filePath}}";'
*/
scss: string;
}
};
styl: {
/**
* @example:
* /(([ \t]*)\/\/\s*bower:*(\S*))(\n|\r|.)*?(\/\/\s*endbower)/gi
*/
block: RegExp;
detect: {
/**
* @example:
* /@import\s['"](.+css)['"]/gi
*/
css: RegExp;
/**
* @example:
* /@import\s['"](.+styl)['"]/gi
*/
styl: RegExp;
};
replace: {
/**
* @example:
* '@import "{{filePath}}"'
*/
css: string;
/**
* @example:
* '@import "{{filePath}}"'
*/
styl: string;
};
};
yaml: {
/**
* @example:
* /(([ \t]*)#\s*bower:*(\S*))(\n|\r|.)*?(#\s*endbower)/gi
*/
block: RegExp;
detect: {
/**
* @example:
* /-\s(.+js)/gi
*/
js: RegExp;
/**
* @example:
* /-\s(.+css)/gi
*/
css: RegExp;
};
replace: {
/**
* @example:
* '- {{filePath}}'
*/
js: string;
/**
* @example:
* '- {{filePath}}'
*/
css: string;
};
};
}
export = Wiredep;
}
+10 -10
View File
@@ -10,7 +10,7 @@ interface wNumbOptions {
*/
decimals?: number;
/**
* The decimal separator.
* The decimal separator.
* Defaults to '.' if thousand isn't already set to '.'.
*/
mark?: string;
@@ -35,7 +35,7 @@ interface wNumbOptions {
*/
negativeBefore?: string;
/**This is a powerful option to manually modify the slider output.
*
*
*For example, to show a number in another currency:
* function( value ){
* return value * 1.32;
@@ -43,7 +43,7 @@ interface wNumbOptions {
*/
encoder?: (value: number) => number;
/**
* Reverse the operations set in encoder.
* Reverse the operations set in encoder.
* Use this option to undo modifications made while encoding the value.
* function( value ){
* return value / 1.32;
@@ -59,22 +59,22 @@ interface wNumbOptions {
* Applied before all other formatting options are applied.
*/
undo?: (value: number) => number;
}
}
interface wNumb {
/**
* Create a wNumb
*
* Create a wNumb
*
* @param options - the options
*/
(options?: wNumbOptions): wNumbInstance;
}
interface wNumbInstance {
/**
* format to string
*/
@@ -83,4 +83,4 @@ interface wNumbInstance {
* get number from formatted string
*/
from(val: string): number;
}
}
+31 -31
View File
@@ -8,21 +8,21 @@ declare function WordCloud(elements: HTMLElement | HTMLElement[], options: WordC
declare namespace WordCloud {
var isSupported: boolean;
var miniumFontSize: number;
interface Options {
/**
* List of words/text to paint on the canvas in a 2-d array, in the form of [word, size],
* e.g. [['foo', 12] , ['bar', 6]].
/**
* List of words/text to paint on the canvas in a 2-d array, in the form of [word, size],
* e.g. [['foo', 12] , ['bar', 6]].
*/
list?: Array<ListEntry> | any[];
/** font to use. */
fontFamily?: string;
/** font weight to use, e.g. normal, bold or 600 */
fontWeight?: string | number;
/**
* color of the text, can be any CSS color, or a callback(word, weight, fontSize, distance, theta)
* specifies different color for each item in the list. You may also specify colors with built-in
* keywords: random-dark and random-light.
/**
* color of the text, can be any CSS color, or a callback(word, weight, fontSize, distance, theta)
* specifies different color for each item in the list. You may also specify colors with built-in
* keywords: random-dark and random-light.
*/
color?: string | ((word: string, weight: string | number, fontSize: number, distance: number, theta: number) => string);
/** minimum font size to draw on the canvas. */
@@ -33,73 +33,73 @@ declare namespace WordCloud {
clearCanvas?: boolean;
/** color of the background. */
backgroundColor?: string;
/**
* size of the grid in pixels for marking the availability of the canvas the larger the grid size,
* the bigger the gap between words.
/**
* size of the grid in pixels for marking the availability of the canvas the larger the grid size,
* the bigger the gap between words.
*/
gridSize?: number;
/** origin of the “cloud” in [x, y]. */
origin?: [number, number];
/** visualize the grid by draw squares to mask the drawn areas. */
drawMask?: boolean;
/** color of the mask squares. */
maskColor?: string;
/** width of the gaps between mask squares. */
maskGapWidth?: number;
/** Wait for x milliseconds before start drawn the next item using setTimeout. */
wait?: number;
/** If the call with in the loop takes more than x milliseconds (and blocks the browser), abort immediately. */
abortThreshold?: number;
/** callback function to call when abort. */
abort?: Function;
/** If the word should rotate, the minimum rotation (in rad) the text should rotate. */
minRotation?: number;
/**
* If the word should rotate, the maximum rotation (in rad) the text should rotate. Set the two value equal
* to keep all text in one angle.
/**
* If the word should rotate, the maximum rotation (in rad) the text should rotate. Set the two value equal
* to keep all text in one angle.
*/
maxRotation?: number;
/** Shuffle the points to draw so the result will be different each time for the same list and settings. */
shuffle?: boolean;
/** Probability for the word to rotate. Set the number to 1 to always rotate. */
rotateRatio?: number;
/**
/**
* The shape of the "cloud" to draw. Can be any polar equation represented as a callback function, or a
* keyword present. Available presents are circle (default), cardioid (apple or heart shape curve, the most
* known polar equation), diamond (alias of square), triangle-forward, triangle, (alias of triangle-upright,
* pentagon, and star.
* pentagon, and star.
*/
shape?: string | ((theta: number) => number);
/** degree of "flatness" of the shape wordcloud2.js should draw. */
ellipticity?: number;
/**
/**
* callback to call when the cursor enters or leaves a region occupied by a word. The callback will take
* arugments callback(item, dimension, event), where event is the original mousemove event. This only will work
* on HTML5 canvas word clouds.
* on HTML5 canvas word clouds.
*/
hover?: EventCallback;
/**
* callback to call when the user clicks on a word. The callback will take arugments
/**
* callback to call when the user clicks on a word. The callback will take arugments
* callback(item, dimension, event), where event is the original click event. This only will work on HTML5
* canvas word clouds.
* canvas word clouds.
*/
click?: EventCallback;
}
interface Dimension {
x: number;
y: number;
w: number;
h: number;
}
type ListEntry = [string, number];
type EventCallback = (item: ListEntry, dimension: Dimension, event: MouseEvent) => void;
}
}
Vendored
+2 -2
View File
@@ -76,7 +76,7 @@ declare module "ws" {
on(event: 'pong', cb: (data: any, flags: {binary: boolean}) => void): WebSocket;
on(event: 'open', cb: () => void): WebSocket;
on(event: string, listener: () => void): WebSocket;
addListener(event: 'error', cb: (err: Error) => void): WebSocket;
addListener(event: 'close', cb: (code: number, message: string) => void): WebSocket;
addListener(event: 'message', cb: (data: any, flags: {binary: boolean}) => void): WebSocket;
@@ -119,7 +119,7 @@ declare module "ws" {
on(event: 'headers', cb: (headers: string[]) => void): Server;
on(event: 'connection', cb: (client: WebSocket) => void): Server;
on(event: string, listener: () => void): Server;
addListener(event: 'error', cb: (err: Error) => void): Server;
addListener(event: 'headers', cb: (headers: string[]) => void): Server;
addListener(event: 'connection', cb: (client: WebSocket) => void): Server;
+197 -197
View File
@@ -1,197 +1,197 @@
// Type definitions for xpath v0.0.7
// Project: https://github.com/goto100/xpath
// Definitions by: Andrew Bradley <https://github.com/cspotcode/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Some documentation prose is copied from the XPath documentation at https://developer.mozilla.org.
declare module 'xpath' {
// select1 can return any of: `Node`, `boolean`, `string`, `number`.
// select and selectWithResolver can return any of the above return types or `Array<Node>`.
// For this reason, their return types are `any`.
interface SelectFn {
/**
* Evaluate an XPath expression against a DOM node. Returns the result as one of the following:
* * Array<Node>
* * Node
* * boolean
* * number
* * string
* @param xpathText
* @param contextNode
* @param single If true and the evaluation result is one or more Nodes, will return only the first Node instead of an Array<Node>
*/
(xpathText: string, contextNode: Node, single?: boolean): any;
}
var select: SelectFn;
/**
* Evaluate an xpath expression against a DOM node, returning the first result only.
* Equivalent to `select(xpathText, contextNode, true)`
* @param xpathText
* @param contextNode
*/
function select1(xpathText: string, contextNode: Node): any;
/**
* Evaluate an XPath expression against a DOM node using a given namespace resolver. Returns the result as one of the following:
* * Array<Node>
* * Node
* * boolean
* * number
* * string
* @param xpathText
* @param contextNode
* @param resolver
* @param single If true and the evaluation result is one or more Nodes, will return only the first Node instead of an Array<Node>
*/
function selectWithResolver(xpathText: string, contextNode: Node, resolver: XPathNSResolver, single?: boolean): any;
/**
* Evaluate an xpath expression against a DOM.
* @param xpathText xpath expression as a string.
* @param contextNode xpath expression is evaluated relative to this DOM node.
* @param resolver XML namespace resolver
* @param resultType
* @param result If non-null, xpath *may* reuse this XPathResult object instead of creating a new one. However, it is not required to do so.
* @return XPathResult object containing the result of the expression.
*/
function evaluate(xpathText: string, contextNode: Node, resolver: XPathNSResolver, resultType: number, result?: XPathResult): XPathResult;
/**
* Creates a `select` function that uses the given namespace prefix to URI mappings when evaluating queries.
* @param namespaceMappings an object mapping namespace prefixes to namespace URIs. Each key is a prefix; each value is a URI.
* @return a function with the same signature as `xpath.select`
*/
function useNamespaces(namespaceMappings: NamespaceMap): typeof select;
interface NamespaceMap {
[namespacePrefix: string]: string;
}
/**
* Compile an XPath expression into an XPathExpression which can be (repeatedly) evaluated against a DOM.
* @param xpathText XPath expression as a string
* @param namespaceURLMapper Namespace resolver
* @return compiled expression
*/
function createExpression(xpathText: string, namespaceURLMapper: XPathNSResolver): XPathExpression;
/**
* Create an XPathNSResolver that resolves based on the information available in the context of a DOM node.
* @param node
*/
function createNSResolver(node: Node): XPathNSResolver;
/**
* Result of evaluating an XPathExpression.
*/
class XPathResult {
/**
* A result set containing whatever type naturally results from evaluation of the expression. Note that if the result is a node-set then UNORDERED_NODE_ITERATOR_TYPE is always the resulting type.
*/
static ANY_TYPE: number;
/**
* A result containing a single number. This is useful for example, in an XPath expression using the count() function.
*/
static NUMBER_TYPE: number;
/**
* A result containing a single string.
*/
static STRING_TYPE: number;
/**
* A result containing a single boolean value. This is useful for example, in an XPath expression using the not() function.
*/
static BOOLEAN_TYPE: number;
/**
* A result node-set containing all the nodes matching the expression. The nodes may not necessarily be in the same order that they appear in the document.
*/
static UNORDERED_NODE_ITERATOR_TYPE: number;
/**
* A result node-set containing all the nodes matching the expression. The nodes in the result set are in the same order that they appear in the document.
*/
static ORDERED_NODE_ITERATOR_TYPE: number;
/**
* A result node-set containing snapshots of all the nodes matching the expression. The nodes may not necessarily be in the same order that they appear in the document.
*/
static UNORDERED_NODE_SNAPSHOT_TYPE: number;
/**
* A result node-set containing snapshots of all the nodes matching the expression. The nodes in the result set are in the same order that they appear in the document.
*/
static ORDERED_NODE_SNAPSHOT_TYPE: number;
/**
* A result node-set containing any single node that matches the expression. The node is not necessarily the first node in the document that matches the expression.
*/
static ANY_UNORDERED_NODE_TYPE: number;
/**
* A result node-set containing the first node in the document that matches the expression.
*/
static FIRST_ORDERED_NODE_TYPE: number;
/**
* Type of this result. It is one of the enumerated result types.
*/
resultType: number;
/**
* Returns the next node in this result, if this result is one of the _ITERATOR_ result types.
*/
iterateNext(): Node;
/**
* returns the result node for a given index, if this result is one of the _SNAPSHOT_ result types.
* @param index
*/
snapshotItem(index: number): Node;
/**
* Number of nodes in this result, if this result is one of the _SNAPSHOT_ result types.
*/
snapshotLength: number;
/**
* Value of this result, if it is a BOOLEAN_TYPE result.
*/
booleanValue: boolean;
/**
* Value of this result, if it is a NUMBER_TYPE result.
*/
numberValue: number;
/**
* Value of this result, if it is a STRING_TYPE result.
*/
stringValue: string;
/**
* Value of this result, if it is a FIRST_ORDERED_NODE_TYPE result.
*/
singleNodeValue: Node;
}
/**
* A compiled XPath expression, ready to be (repeatedly) evaluated against a DOM node.
*/
interface XPathExpression {
/**
* evaluate this expression against a DOM node.
* @param contextNode
* @param resultType
* @param result
*/
evaluate(contextNode: Node, resultType: number, result?: XPathResult): XPathResult;
}
/**
* Object that can resolve XML namespace prefixes to namespace URIs.
*/
interface XPathNSResolver {
/**
* Given an XML namespace prefix, returns the corresponding XML namespace URI.
* @param prefix XML namespace prefix
* @return XML namespace URI
*/
lookupNamespaceURI(prefix: string): string;
}
}
// Type definitions for xpath v0.0.7
// Project: https://github.com/goto100/xpath
// Definitions by: Andrew Bradley <https://github.com/cspotcode/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Some documentation prose is copied from the XPath documentation at https://developer.mozilla.org.
declare module 'xpath' {
// select1 can return any of: `Node`, `boolean`, `string`, `number`.
// select and selectWithResolver can return any of the above return types or `Array<Node>`.
// For this reason, their return types are `any`.
interface SelectFn {
/**
* Evaluate an XPath expression against a DOM node. Returns the result as one of the following:
* * Array<Node>
* * Node
* * boolean
* * number
* * string
* @param xpathText
* @param contextNode
* @param single If true and the evaluation result is one or more Nodes, will return only the first Node instead of an Array<Node>
*/
(xpathText: string, contextNode: Node, single?: boolean): any;
}
var select: SelectFn;
/**
* Evaluate an xpath expression against a DOM node, returning the first result only.
* Equivalent to `select(xpathText, contextNode, true)`
* @param xpathText
* @param contextNode
*/
function select1(xpathText: string, contextNode: Node): any;
/**
* Evaluate an XPath expression against a DOM node using a given namespace resolver. Returns the result as one of the following:
* * Array<Node>
* * Node
* * boolean
* * number
* * string
* @param xpathText
* @param contextNode
* @param resolver
* @param single If true and the evaluation result is one or more Nodes, will return only the first Node instead of an Array<Node>
*/
function selectWithResolver(xpathText: string, contextNode: Node, resolver: XPathNSResolver, single?: boolean): any;
/**
* Evaluate an xpath expression against a DOM.
* @param xpathText xpath expression as a string.
* @param contextNode xpath expression is evaluated relative to this DOM node.
* @param resolver XML namespace resolver
* @param resultType
* @param result If non-null, xpath *may* reuse this XPathResult object instead of creating a new one. However, it is not required to do so.
* @return XPathResult object containing the result of the expression.
*/
function evaluate(xpathText: string, contextNode: Node, resolver: XPathNSResolver, resultType: number, result?: XPathResult): XPathResult;
/**
* Creates a `select` function that uses the given namespace prefix to URI mappings when evaluating queries.
* @param namespaceMappings an object mapping namespace prefixes to namespace URIs. Each key is a prefix; each value is a URI.
* @return a function with the same signature as `xpath.select`
*/
function useNamespaces(namespaceMappings: NamespaceMap): typeof select;
interface NamespaceMap {
[namespacePrefix: string]: string;
}
/**
* Compile an XPath expression into an XPathExpression which can be (repeatedly) evaluated against a DOM.
* @param xpathText XPath expression as a string
* @param namespaceURLMapper Namespace resolver
* @return compiled expression
*/
function createExpression(xpathText: string, namespaceURLMapper: XPathNSResolver): XPathExpression;
/**
* Create an XPathNSResolver that resolves based on the information available in the context of a DOM node.
* @param node
*/
function createNSResolver(node: Node): XPathNSResolver;
/**
* Result of evaluating an XPathExpression.
*/
class XPathResult {
/**
* A result set containing whatever type naturally results from evaluation of the expression. Note that if the result is a node-set then UNORDERED_NODE_ITERATOR_TYPE is always the resulting type.
*/
static ANY_TYPE: number;
/**
* A result containing a single number. This is useful for example, in an XPath expression using the count() function.
*/
static NUMBER_TYPE: number;
/**
* A result containing a single string.
*/
static STRING_TYPE: number;
/**
* A result containing a single boolean value. This is useful for example, in an XPath expression using the not() function.
*/
static BOOLEAN_TYPE: number;
/**
* A result node-set containing all the nodes matching the expression. The nodes may not necessarily be in the same order that they appear in the document.
*/
static UNORDERED_NODE_ITERATOR_TYPE: number;
/**
* A result node-set containing all the nodes matching the expression. The nodes in the result set are in the same order that they appear in the document.
*/
static ORDERED_NODE_ITERATOR_TYPE: number;
/**
* A result node-set containing snapshots of all the nodes matching the expression. The nodes may not necessarily be in the same order that they appear in the document.
*/
static UNORDERED_NODE_SNAPSHOT_TYPE: number;
/**
* A result node-set containing snapshots of all the nodes matching the expression. The nodes in the result set are in the same order that they appear in the document.
*/
static ORDERED_NODE_SNAPSHOT_TYPE: number;
/**
* A result node-set containing any single node that matches the expression. The node is not necessarily the first node in the document that matches the expression.
*/
static ANY_UNORDERED_NODE_TYPE: number;
/**
* A result node-set containing the first node in the document that matches the expression.
*/
static FIRST_ORDERED_NODE_TYPE: number;
/**
* Type of this result. It is one of the enumerated result types.
*/
resultType: number;
/**
* Returns the next node in this result, if this result is one of the _ITERATOR_ result types.
*/
iterateNext(): Node;
/**
* returns the result node for a given index, if this result is one of the _SNAPSHOT_ result types.
* @param index
*/
snapshotItem(index: number): Node;
/**
* Number of nodes in this result, if this result is one of the _SNAPSHOT_ result types.
*/
snapshotLength: number;
/**
* Value of this result, if it is a BOOLEAN_TYPE result.
*/
booleanValue: boolean;
/**
* Value of this result, if it is a NUMBER_TYPE result.
*/
numberValue: number;
/**
* Value of this result, if it is a STRING_TYPE result.
*/
stringValue: string;
/**
* Value of this result, if it is a FIRST_ORDERED_NODE_TYPE result.
*/
singleNodeValue: Node;
}
/**
* A compiled XPath expression, ready to be (repeatedly) evaluated against a DOM node.
*/
interface XPathExpression {
/**
* evaluate this expression against a DOM node.
* @param contextNode
* @param resultType
* @param result
*/
evaluate(contextNode: Node, resultType: number, result?: XPathResult): XPathResult;
}
/**
* Object that can resolve XML namespace prefixes to namespace URIs.
*/
interface XPathNSResolver {
/**
* Given an XML namespace prefix, returns the corresponding XML namespace URI.
* @param prefix XML namespace prefix
* @return XML namespace URI
*/
lookupNamespaceURI(prefix: string): string;
}
}

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