mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-20 12:00:53 +08:00
Merge branch 'master' of https://github.com/DefinitelyTyped/DefinitelyTyped into add_react-tagcloud
This commit is contained in:
+21
@@ -250,4 +250,25 @@ declare namespace angular.material {
|
||||
interface IMenuService {
|
||||
hide(response?: any, options?: any): angular.IPromise<any>;
|
||||
}
|
||||
|
||||
interface IColorPalette {
|
||||
red: IPalette;
|
||||
pink: IPalette;
|
||||
'deep-purple': IPalette;
|
||||
indigo: IPalette;
|
||||
blue: IPalette;
|
||||
'light-blue': IPalette;
|
||||
cyan: IPalette;
|
||||
teal: IPalette;
|
||||
green: IPalette;
|
||||
'light-green': IPalette;
|
||||
lime: IPalette;
|
||||
yellow: IPalette;
|
||||
amber: IPalette;
|
||||
orange: IPalette;
|
||||
'deep-orange': IPalette;
|
||||
brown: IPalette;
|
||||
grey: IPalette;
|
||||
'blue-grey': IPalette;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,6 +141,8 @@ class UrlLocatorTestService implements IUrlLocatorTestService {
|
||||
private $state: ng.ui.IStateService
|
||||
) {
|
||||
$rootScope.$on("$locationChangeSuccess", (event: ng.IAngularEvent) => this.onLocationChangeSuccess(event));
|
||||
$rootScope.$on('$stateNotFound', (event: ng.IAngularEvent, unfoundState: ng.ui.IUnfoundState, fromState: ng.ui.IState, fromParams: {}) =>
|
||||
this.onStateNotFound(event, unfoundState, fromState, fromParams));
|
||||
}
|
||||
|
||||
public currentUser: any;
|
||||
@@ -162,6 +164,15 @@ class UrlLocatorTestService implements IUrlLocatorTestService {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private onStateNotFound(event: ng.IAngularEvent,
|
||||
unfoundState: ng.ui.IUnfoundState,
|
||||
fromState: ng.ui.IState,
|
||||
fromParams: {}) {
|
||||
var unfoundTo: string = unfoundState.to;
|
||||
var unfoundToParams: {} = unfoundState.toParams;
|
||||
var unfoundOptions: ng.ui.IStateOptions = unfoundState.options
|
||||
}
|
||||
|
||||
private stateServiceTest() {
|
||||
this.$state.go("myState");
|
||||
|
||||
+6
@@ -100,6 +100,12 @@ declare namespace angular.ui {
|
||||
cache?: boolean;
|
||||
}
|
||||
|
||||
interface IUnfoundState {
|
||||
to: string,
|
||||
toParams: {},
|
||||
options: IStateOptions
|
||||
}
|
||||
|
||||
interface IStateProvider extends angular.IServiceProvider {
|
||||
state(name:string, config:IState): IStateProvider;
|
||||
state(config:IState): IStateProvider;
|
||||
|
||||
@@ -87,6 +87,15 @@ logCall = logService.warn;
|
||||
|
||||
logs = logCall.logs;
|
||||
|
||||
///////////////////////////////////////
|
||||
// ControllerService mock
|
||||
///////////////////////////////////////
|
||||
var $controller: ng.IControllerService;
|
||||
$controller(class TestController {}, {}, {myBinding: 'works!'});
|
||||
$controller(function TestController() {}, {someLocal: 42}, {myBinding: 'works!'});
|
||||
$controller('TestController', {}, {myBinding: 'works!'});
|
||||
|
||||
|
||||
///////////////////////////////////////
|
||||
// IComponentControllerService
|
||||
///////////////////////////////////////
|
||||
|
||||
Vendored
+12
@@ -97,6 +97,18 @@ declare namespace angular {
|
||||
logs: string[];
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// ControllerService mock
|
||||
// see https://docs.angularjs.org/api/ngMock/service/$controller
|
||||
// This interface extends http://docs.angularjs.org/api/ng.$controller
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
interface IControllerService {
|
||||
// Although the documentation doesn't state this, locals are optional
|
||||
<T>(controllerConstructor: new (...args: any[]) => T, locals?: any, bindings?: any): T;
|
||||
<T>(controllerConstructor: Function, locals?: any, bindings?: any): T;
|
||||
<T>(controllerName: string, locals?: any, bindings?: any): T;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// ComponentControllerService
|
||||
// see https://docs.angularjs.org/api/ngMock/service/$componentController
|
||||
|
||||
@@ -98,9 +98,7 @@ resource = resourceClass.save({ key: 'value' }, { key: 'value' }, function () {
|
||||
|
||||
var promise : angular.IPromise<IMyResource>;
|
||||
var arrayPromise : angular.IPromise<IMyResource[]>;
|
||||
var json: {
|
||||
[index: string]: any;
|
||||
};
|
||||
var json: IMyResource;
|
||||
|
||||
promise = resource.$delete();
|
||||
promise = resource.$delete({ key: 'value' });
|
||||
|
||||
Vendored
+1
-3
@@ -153,9 +153,7 @@ declare namespace angular.resource {
|
||||
/** the promise of the original server interaction that created this instance. **/
|
||||
$promise : angular.IPromise<T>;
|
||||
$resolved : boolean;
|
||||
toJSON: () => {
|
||||
[index: string]: any;
|
||||
}
|
||||
toJSON(): T;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Vendored
+2
-2
@@ -204,7 +204,7 @@ declare namespace angular {
|
||||
* @param name The name of the constant.
|
||||
* @param value The constant value.
|
||||
*/
|
||||
constant(name: string, value: any): IModule;
|
||||
constant<T>(name: string, value: T): IModule;
|
||||
constant(object: Object): IModule;
|
||||
/**
|
||||
* The $controller service is used by Angular to create new controllers.
|
||||
@@ -294,7 +294,7 @@ declare namespace angular {
|
||||
* @param name The name of the instance.
|
||||
* @param value The value.
|
||||
*/
|
||||
value(name: string, value: any): IModule;
|
||||
value<T>(name: string, value: T): IModule;
|
||||
value(object: Object): IModule;
|
||||
|
||||
/**
|
||||
|
||||
Vendored
+1
-1
@@ -311,7 +311,7 @@ declare namespace Backbone {
|
||||
start(options?: HistoryOptions): boolean;
|
||||
|
||||
getHash(window?: Window): string;
|
||||
getFragment(fragment?: string, forcePushState?: boolean): string;
|
||||
getFragment(fragment?: string): string;
|
||||
stop(): void;
|
||||
route(route: string, callback: Function): number;
|
||||
checkUrl(e?: any): void;
|
||||
|
||||
Vendored
+3
@@ -20,6 +20,9 @@ declare module "bunyan" {
|
||||
level(value: number | string):void;
|
||||
levels(name: number | string, value: number | string):void;
|
||||
|
||||
fields:any;
|
||||
src:boolean;
|
||||
|
||||
trace(error:Error, format?:any, ...params:any[]):void;
|
||||
trace(buffer:Buffer, format?:any, ...params:any[]):void;
|
||||
trace(obj:Object, format?:any, ...params:any[]):void;
|
||||
|
||||
Vendored
+4
@@ -557,3 +557,7 @@ declare namespace Chartist {
|
||||
}
|
||||
|
||||
declare var Chartist: Chartist.ChartistStatic;
|
||||
|
||||
declare module 'chartist' {
|
||||
export = Chartist;
|
||||
}
|
||||
|
||||
Vendored
+28
-2
@@ -2,20 +2,46 @@
|
||||
// Project: https://github.com/js-coder/cookie.js
|
||||
// Definitions by: Boltmade <https://github.com/Boltmade>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/**
|
||||
* Shortcut for cookie.get()
|
||||
*/
|
||||
declare function cookie(key : string, fallback?: string) : string;
|
||||
declare function cookie(keys : string[], fallback?: string) : string;
|
||||
|
||||
declare namespace cookie {
|
||||
/**
|
||||
* Create a cookie. The value will automatically be escaped.
|
||||
*/
|
||||
export function set(key : string, value : string, options? : any) : void;
|
||||
/**
|
||||
* Set several cookies at once
|
||||
*/
|
||||
export function set(obj : any, options? : any) : void;
|
||||
/**
|
||||
* Remove cookies
|
||||
*/
|
||||
export function remove(key : string) : void;
|
||||
export function remove(keys : string[]) : void;
|
||||
export function remove(...args : string[]) : void;
|
||||
/**
|
||||
* Remove all cookies
|
||||
*/
|
||||
export function empty() : void;
|
||||
/**
|
||||
* Retrieve the value of the cookie
|
||||
*/
|
||||
export function get(key : string, fallback?: string) : string;
|
||||
export function get(keys : string[], fallback?: string) : string;
|
||||
/**
|
||||
* Retrieve values of several cookies
|
||||
*/
|
||||
export function get(keys : string[], fallback?: string) : any;
|
||||
/**
|
||||
* Get all currently saved cookies
|
||||
*/
|
||||
export function all() : any;
|
||||
/**
|
||||
* Test if cookies are enabled
|
||||
*/
|
||||
export function enabled() : boolean;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
/// <reference path='../cordova/cordova.d.ts' />
|
||||
/// <reference path='./cordova-plugin-background-mode.d.ts' />
|
||||
|
||||
cordova.plugins.backgroundMode.setDefaults({ silent: true });
|
||||
|
||||
cordova.plugins.backgroundMode.enable();
|
||||
cordova.plugins.backgroundMode.isEnabled();
|
||||
cordova.plugins.backgroundMode.isActivated();
|
||||
|
||||
cordova.plugins.backgroundMode.configure({ text: 'Insane Title' });
|
||||
|
||||
cordova.plugins.backgroundMode.onactivate = () => { }
|
||||
cordova.plugins.backgroundMode.ondeactivate = () => { }
|
||||
cordova.plugins.backgroundMode.onfailure = (errorCode) => { }
|
||||
@@ -0,0 +1,76 @@
|
||||
// Type definitions for Apache Background Mode plugin
|
||||
// Project: https://github.com/katzer/cordova-plugin-background-mode
|
||||
// Definitions by: Paul Thiel <https://github.com/Lordnoname>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/**
|
||||
* The plugin prevent the app from going to sleep while in background
|
||||
*/
|
||||
interface CordovaPluginBackgroundMode {
|
||||
|
||||
/**
|
||||
* The background mode can be enabled
|
||||
*/
|
||||
enable(): void;
|
||||
/**
|
||||
* The background mode can be disabled
|
||||
*/
|
||||
disable(): void;
|
||||
/**
|
||||
* Checks if the background mode is enabled or not
|
||||
*/
|
||||
isEnabled(): boolean;
|
||||
/**
|
||||
* Checks if the background mode is activated or not
|
||||
*/
|
||||
isActivated(): boolean;
|
||||
/**
|
||||
* Function to get notified when the background mode has been activated
|
||||
*/
|
||||
onactivate(): void;
|
||||
/**
|
||||
* Function to get notified when the background mode has been deactivated
|
||||
*/
|
||||
ondeactivate(): void;
|
||||
/**
|
||||
* Function to get notified when the background could not benn activated
|
||||
*/
|
||||
onfailure(callback: (errorCode: number) => void): void;
|
||||
/**
|
||||
* Customize default title, ticker and text for the notification
|
||||
*/
|
||||
setDefaults(item: ICordovaPluginBackgroundModeNotificationItem): void;
|
||||
/**
|
||||
* Configure the default background notification
|
||||
*/
|
||||
configure(item: ICordovaPluginBackgroundModeNotificationItem): void;
|
||||
}
|
||||
|
||||
interface ICordovaPluginBackgroundModeNotificationItem {
|
||||
|
||||
/**
|
||||
* The title of the notification displayed in background mode
|
||||
*/
|
||||
title?: string,
|
||||
/**
|
||||
* The ticker of the notification displayed in background mode
|
||||
*/
|
||||
ticker?: string,
|
||||
/**
|
||||
* The body of the notification displayed in background mode
|
||||
*/
|
||||
text?: string,
|
||||
/**
|
||||
* Handles if app is coming to foreground when tapping on the notification
|
||||
*/
|
||||
resume?: boolean,
|
||||
/**
|
||||
* Handles if there is a notification when background is activated
|
||||
*/
|
||||
silent?: boolean
|
||||
}
|
||||
|
||||
interface CordovaPlugins {
|
||||
|
||||
backgroundMode: CordovaPluginBackgroundMode
|
||||
}
|
||||
Vendored
+7429
File diff suppressed because it is too large
Load Diff
Vendored
+41
-27
@@ -1,11 +1,11 @@
|
||||
// Type definitions for DevExtreme 15.2.7
|
||||
// Type definitions for DevExtreme 15.2.9
|
||||
// Project: http://js.devexpress.com/
|
||||
// Definitions by: DevExpress Inc. <http://devexpress.com/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../jquery/jquery.d.ts" />
|
||||
|
||||
declare namespace DevExpress {
|
||||
declare module DevExpress {
|
||||
/** A mixin that provides a capability to fire and subscribe to events. */
|
||||
export interface EventsMixin<T> {
|
||||
/** Subscribes to a specified event. */
|
||||
@@ -427,6 +427,9 @@ declare namespace DevExpress {
|
||||
/** A handler for the loadError event. */
|
||||
onLoadError?: (e?: Error) => void;
|
||||
}
|
||||
export interface OperationPromise<T> extends JQueryPromise<T> {
|
||||
operationId: number;
|
||||
}
|
||||
/** An object that provides access to a data web service or local data storage for collection container widgets. */
|
||||
export class DataSource implements EventsMixin<DataSource> {
|
||||
constructor(url: string);
|
||||
@@ -454,9 +457,9 @@ declare namespace DevExpress {
|
||||
/** Returns the key expression. */
|
||||
key(): any;
|
||||
/** Starts loading data. */
|
||||
load(): JQueryPromise<Array<any>>;
|
||||
load(): OperationPromise<Array<any>>;
|
||||
/** Clears currently loaded DataSource items and calls the load() method. */
|
||||
reload(): JQueryPromise<Array<any>>;
|
||||
reload(): OperationPromise<Array<any>>;
|
||||
/** Returns an object that would be passed to the load() method of the underlying Store according to the current data shaping option values of the current DataSource instance. */
|
||||
loadOptions(): Object;
|
||||
/** Returns the current pageSize option value. */
|
||||
@@ -499,6 +502,7 @@ declare namespace DevExpress {
|
||||
store(): Store;
|
||||
/** Returns the number of data items available in an underlying Store after the last load() operation without paging. */
|
||||
totalCount(): number;
|
||||
cancel(operationId: number): boolean;
|
||||
on(eventName: "loadingChanged", eventHandler: (isLoading: boolean) => void): DataSource;
|
||||
on(eventName: "loadError", eventHandler: (e?: Error) => void): DataSource;
|
||||
on(eventName: "changed", eventHandler: () => void): DataSource;
|
||||
@@ -831,7 +835,7 @@ declare namespace DevExpress {
|
||||
export function registerPalette(paletteName: string, palette: Object): void;
|
||||
}
|
||||
}
|
||||
declare namespace DevExpress.ui {
|
||||
declare module DevExpress.ui {
|
||||
export interface dxValidatorOptions extends DOMComponentOptions {
|
||||
/** An array of validation rules to be checked for the editor with which the dxValidator object is associated. */
|
||||
validationRules?: Array<any>;
|
||||
@@ -1369,7 +1373,7 @@ declare namespace DevExpress.ui {
|
||||
constructor(element: Element, options?: dxMultiViewOptions);
|
||||
}
|
||||
export interface dxMapOptions extends WidgetOptions {
|
||||
/** Specifies whether or not the widget automatically adjusts center and zoom option values when adding a new marker or route or when creating a widget if it initially contains markers or routes. */
|
||||
/** Specifies whether or not the widget automatically adjusts center and zoom option values when adding a new marker or route, or when creating a widget if it initially contains markers or routes. */
|
||||
autoAdjust?: boolean;
|
||||
center?: {
|
||||
/** The latitude location displayed in the center of the widget. */
|
||||
@@ -2157,7 +2161,7 @@ declare namespace DevExpress.ui {
|
||||
requiredMark?: string;
|
||||
/** The text displayed for optional fields. */
|
||||
optionalMark?: string;
|
||||
/** Specifies the message that is shown for end-users a required field value is not specified. */
|
||||
/** Specifies the message that is shown for end-users if a required field value is not specified. */
|
||||
requiredMessage?: string;
|
||||
/** Specifies whether or not the total validation summary is displayed on the form. */
|
||||
showValidationSummary?: boolean;
|
||||
@@ -2406,10 +2410,10 @@ interface JQuery {
|
||||
dxForm(options: "instance"): DevExpress.ui.dxForm;
|
||||
dxForm(options: string): any;
|
||||
dxForm(options: string, ...params: any[]): any;
|
||||
dxForm(options: DevExpress.ui.dxForm): JQuery;
|
||||
dxForm(options: DevExpress.ui.dxFormOptions): JQuery;
|
||||
}
|
||||
|
||||
declare namespace DevExpress.ui {
|
||||
declare module DevExpress.ui {
|
||||
export interface dxTileViewOptions extends CollectionWidgetOptions {
|
||||
/** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */
|
||||
activeStateEnabled?: boolean;
|
||||
@@ -2646,7 +2650,7 @@ interface JQuery {
|
||||
dxDropDownMenu(options: string, ...params: any[]): any;
|
||||
dxDropDownMenu(options: DevExpress.ui.dxDropDownMenuOptions): JQuery;
|
||||
}
|
||||
declare namespace DevExpress.data {
|
||||
declare module DevExpress.data {
|
||||
export interface XmlaStoreOptions {
|
||||
/** The HTTP address to an XMLA OLAP server. */
|
||||
url?: string;
|
||||
@@ -2693,11 +2697,11 @@ declare namespace DevExpress.data {
|
||||
groupName?: string;
|
||||
/** The index of the field within a group. */
|
||||
groupIndex?: number;
|
||||
/** Specifies the initial sort order of field values. */
|
||||
/** Specifies the sort order of field values. */
|
||||
sortOrder?: string;
|
||||
/** Specifies how field data should be sorted. Can be used for the XmlaStore store type only. */
|
||||
sortBy?: string;
|
||||
/** Specifies the data field against which the header items of this field should be sorted. */
|
||||
/** Sorts the header items of this field by the summary values of another field. */
|
||||
sortBySummaryField?: string;
|
||||
/** The array of field names that specify a path to column/row whose summary field is used for sorting of this field's header items. */
|
||||
sortBySummaryPath?: Array<any>;
|
||||
@@ -2843,7 +2847,7 @@ declare namespace DevExpress.data {
|
||||
off(eventName: string, eventHandler: Function): PivotGridDataSource;
|
||||
}
|
||||
}
|
||||
declare namespace DevExpress.ui {
|
||||
declare module DevExpress.ui {
|
||||
export interface dxSchedulerOptions extends WidgetOptions {
|
||||
/** Specifies a date displayed on the current scheduler view by default. */
|
||||
currentDate?: Date;
|
||||
@@ -2873,7 +2877,7 @@ declare namespace DevExpress.ui {
|
||||
showAllDayPanel?: boolean;
|
||||
/** Specifies cell duration in minutes. */
|
||||
cellDuration?: number;
|
||||
/** Specifies the edit mode for recurrent appointments. */
|
||||
/** Specifies the edit mode for recurring appointments. */
|
||||
recurrenceEditMode?: string;
|
||||
/** Specifies which editing operations an end-user can perform on appointments. */
|
||||
editing?: {
|
||||
@@ -2963,10 +2967,10 @@ declare namespace DevExpress.ui {
|
||||
updateAppointment(target: Object, appointment: Object): void;
|
||||
/** Deletes the appointment defined by the parameter from the the data associated with the widget. */
|
||||
deleteAppointment(appointment: Object): void;
|
||||
/** Scrolls the scheduler work space to the specified time. */
|
||||
scrollToTime(hours: number, minutes: number): void;
|
||||
/** Displays the Appointment Details popup. */
|
||||
showAppointmentPopup(appointmentData: Object, createNewAppointment?: boolean): void;
|
||||
/** Scrolls the scheduler work space to the specified time of the specified day. */
|
||||
scrollToTime(hours: number, minutes: number, date: Date): void;
|
||||
/** Displayes the Appointment Details popup. */
|
||||
showAppointmentPopup(appointmentData: Object, createNewAppointment?: boolean, currentAppointmentData?: Object): void;
|
||||
}
|
||||
export interface dxColorBoxOptions extends dxDropDownEditorOptions {
|
||||
/** Specifies the text displayed on the button that applies changes and closes the drop-down editor. */
|
||||
@@ -3771,6 +3775,8 @@ declare namespace DevExpress.ui {
|
||||
summaryType?: string;
|
||||
/** Specifies a format for the summary item value. */
|
||||
valueFormat?: string;
|
||||
/** Specifies whether or not to skip empty strings, null and undefined values when calculating a summary. */
|
||||
skipEmptyValues?: boolean;
|
||||
}>;
|
||||
/** Specifies items of the total summary. */
|
||||
totalItems?: Array<{
|
||||
@@ -3797,7 +3803,11 @@ declare namespace DevExpress.ui {
|
||||
summaryType?: string;
|
||||
/** Specifies a format for the summary item value. */
|
||||
valueFormat?: string;
|
||||
/** Specifies whether or not to skip empty strings, null and undefined values when calculating a summary. */
|
||||
skipEmptyValues?: boolean;
|
||||
}>;
|
||||
/** Specifies whether or not to skip empty strings, null and undefined values when calculating a summary. */
|
||||
skipEmptyValues?: boolean;
|
||||
/** Allows you to use a custom aggregate function to calculate the value of a summary item. */
|
||||
calculateCustomSummary?: (options: {
|
||||
component: dxDataGrid;
|
||||
@@ -4037,7 +4047,7 @@ declare namespace DevExpress.ui {
|
||||
/** The string to display as an Export to Excel file context menu item. */
|
||||
exportToExcel?: string;
|
||||
};
|
||||
/** The Load panel configuration options. */
|
||||
/** Specifies options configuring the load panel. */
|
||||
loadPanel?: {
|
||||
/** Enables or disables the load panel. */
|
||||
enabled?: boolean;
|
||||
@@ -4189,7 +4199,7 @@ interface JQuery {
|
||||
dxScheduler(options: string, ...params: any[]): any;
|
||||
dxScheduler(options: DevExpress.ui.dxSchedulerOptions): JQuery;
|
||||
}
|
||||
declare namespace DevExpress.framework {
|
||||
declare module DevExpress.framework {
|
||||
/** An object used to store information on the views displayed in an application. */
|
||||
export class ViewCache {
|
||||
viewRemoved: JQueryCallback;
|
||||
@@ -4471,7 +4481,7 @@ declare namespace DevExpress.framework {
|
||||
}
|
||||
}
|
||||
}
|
||||
declare namespace DevExpress.viz.core {
|
||||
declare module DevExpress.viz.core {
|
||||
/**
|
||||
* Applies a theme for the entire page with several DevExtreme visualization widgets.
|
||||
* @deprecated Use the DevExpress.viz.currentTheme(theme) method instead.
|
||||
@@ -4707,7 +4717,7 @@ declare namespace DevExpress.viz.core {
|
||||
svg(): string;
|
||||
}
|
||||
}
|
||||
declare namespace DevExpress.viz.charts {
|
||||
declare module DevExpress.viz.charts {
|
||||
/** This section describes the fields and methods that can be used in code to manipulate the Series object. */
|
||||
export interface BaseSeries {
|
||||
/** Provides information about the state of the series object. */
|
||||
@@ -5738,6 +5748,8 @@ declare namespace DevExpress.viz.charts {
|
||||
equalBarWidth?: boolean;
|
||||
/** Specifies a common bar width as a percentage from 0 to 1. */
|
||||
barWidth?: number;
|
||||
/** Forces the widget to treat negative values as zeroes. Applies to stacked-like series only. */
|
||||
negativesAsZeroes?: boolean;
|
||||
}
|
||||
export interface Legend extends AdvancedLegend {
|
||||
/** Specifies whether the legend is located outside or inside the chart's plot. */
|
||||
@@ -5799,7 +5811,7 @@ declare namespace DevExpress.viz.charts {
|
||||
customizeText?: (info: { value: any; valueText: string; point: ChartPoint; }) => string;
|
||||
}
|
||||
};
|
||||
/** Specifies a default pane for the chart's series. */
|
||||
/** Specifies a default pane for the chart series. */
|
||||
defaultPane?: string;
|
||||
/** Specifies a coefficient determining the diameter of the largest bubble. */
|
||||
maxBubbleSize?: number;
|
||||
@@ -5956,7 +5968,7 @@ interface JQuery {
|
||||
dxPolarChart(methodName: string, ...params: any[]): any;
|
||||
dxPolarChart(methodName: "instance"): DevExpress.viz.charts.dxPolarChart;
|
||||
}
|
||||
declare namespace DevExpress.viz.gauges {
|
||||
declare module DevExpress.viz.gauges {
|
||||
export interface BaseRangeContainer {
|
||||
/** Specifies a range container's background color. */
|
||||
backgroundColor?: string;
|
||||
@@ -6373,7 +6385,7 @@ interface JQuery {
|
||||
dxBarGauge(methodName: string, ...params: any[]): any;
|
||||
dxBarGauge(methodName: "instance"): DevExpress.viz.gauges.dxBarGauge;
|
||||
}
|
||||
declare namespace DevExpress.viz.rangeSelector {
|
||||
declare module DevExpress.viz.rangeSelector {
|
||||
export interface dxRangeSelectorOptions extends viz.core.BaseWidgetOptions {
|
||||
/** Specifies the options for the range selector's background. */
|
||||
background?: {
|
||||
@@ -6425,6 +6437,8 @@ declare namespace DevExpress.viz.rangeSelector {
|
||||
equalBarWidth?: boolean;
|
||||
/** Specifies a common bar width as a percentage from 0 to 1. */
|
||||
barWidth?: number;
|
||||
/** Forces the widget to treat negative values as zeroes. Applies to stacked-like series only. */
|
||||
negativesAsZeroes?: boolean;
|
||||
/** Sets the name of the palette to be used in the range selector's chart. Alternatively, an array of colors can be set as a custom palette to be used within this chart. */
|
||||
palette?: any;
|
||||
/** An object defining the chart’s series. */
|
||||
@@ -6667,7 +6681,7 @@ interface JQuery {
|
||||
dxRangeSelector(methodName: string, ...params: any[]): any;
|
||||
dxRangeSelector(methodName: "instance"): DevExpress.viz.rangeSelector.dxRangeSelector;
|
||||
}
|
||||
declare namespace DevExpress.viz.map {
|
||||
declare module DevExpress.viz.map {
|
||||
/** This section describes the fields and methods that can be used in code to manipulate the Layer object. */
|
||||
export interface MapLayer {
|
||||
/** The name of the layer. */
|
||||
@@ -7306,7 +7320,7 @@ interface JQuery {
|
||||
dxVectorMap(methodName: string, ...params: any[]): any;
|
||||
dxVectorMap(methodName: "instance"): DevExpress.viz.map.dxVectorMap;
|
||||
}
|
||||
declare namespace DevExpress.viz.sparklines {
|
||||
declare module DevExpress.viz.sparklines {
|
||||
export interface SparklineTooltip extends viz.core.Tooltip {
|
||||
/**
|
||||
* Specifies how a tooltip is horizontally aligned relative to the graph.
|
||||
|
||||
Vendored
+3
-18
@@ -9,21 +9,6 @@ interface ParentNode {
|
||||
*/
|
||||
children: HTMLCollection;
|
||||
|
||||
/**
|
||||
* Returns the first child that is an element, and null otherwise.
|
||||
*/
|
||||
firstElementChild: Element;
|
||||
|
||||
/**
|
||||
* Returns the last child that is an element, and null otherwise.
|
||||
*/
|
||||
lastElementChild: Element;
|
||||
|
||||
/**
|
||||
* Returns the number of children that are elements.
|
||||
*/
|
||||
childElementCount: number;
|
||||
|
||||
/**
|
||||
* Returns the first element that is a descendant of node that matches relativeSelectors.
|
||||
*/
|
||||
@@ -47,11 +32,11 @@ interface Element extends ParentNode {
|
||||
matches(selectors: string): boolean;
|
||||
}
|
||||
|
||||
interface Elements extends ParentNode, Array<Element> {
|
||||
interface Elements extends ElementTraversal, ParentNode, Array<Element> {
|
||||
}
|
||||
|
||||
interface Document extends ParentNode {
|
||||
interface Document extends ElementTraversal, ParentNode {
|
||||
}
|
||||
|
||||
interface DocumentFragment extends ParentNode {
|
||||
interface DocumentFragment extends ElementTraversal, ParentNode {
|
||||
}
|
||||
|
||||
@@ -4,6 +4,9 @@ import Dropzone = require("dropzone");
|
||||
|
||||
const dropzoneFromString = new Dropzone(".test");
|
||||
const dropzoneFromElement = new Dropzone(document.getElementById("test"));
|
||||
const dropzoneRenameFunction = function(name: string){
|
||||
return name;
|
||||
};
|
||||
|
||||
const dropzoneWithOptions = new Dropzone(".test", {
|
||||
url: "/some/url",
|
||||
@@ -25,10 +28,12 @@ const dropzoneWithOptions = new Dropzone(".test", {
|
||||
clickable: true,
|
||||
ignoreHiddenFiles: true,
|
||||
acceptedFiles: "image/*",
|
||||
renameFilename: dropzoneRenameFunction,
|
||||
autoProcessQueue: true,
|
||||
autoQueue: true,
|
||||
addRemoveLinks: true,
|
||||
previewsContainer: "<div></div>",
|
||||
hiddenInputContainer: document.createElement("input"),
|
||||
capture: "camera",
|
||||
|
||||
dictDefaultMessage: "",
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
|
||||
const dropzoneFromString = new Dropzone(".test");
|
||||
const dropzoneFromElement = new Dropzone(document.getElementById("test"));
|
||||
const dropzoneRenameFunction = function (name:string):string {
|
||||
return name + 'new';
|
||||
};
|
||||
|
||||
const dropzoneWithOptions = new Dropzone(".test", {
|
||||
url: "/some/url",
|
||||
@@ -26,10 +29,12 @@ const dropzoneWithOptions = new Dropzone(".test", {
|
||||
clickable: true,
|
||||
ignoreHiddenFiles: true,
|
||||
acceptedFiles: "image/*",
|
||||
renameFilename: dropzoneRenameFunction,
|
||||
autoProcessQueue: true,
|
||||
autoQueue: true,
|
||||
addRemoveLinks: true,
|
||||
previewsContainer: "<div></div>",
|
||||
hiddenInputContainer: document.createElement("input"),
|
||||
capture: "camera",
|
||||
|
||||
dictDefaultMessage: "",
|
||||
|
||||
Vendored
+4
-2
@@ -1,6 +1,6 @@
|
||||
// Type definitions for Dropzone 4.0.1
|
||||
// Type definitions for Dropzone 4.3.0
|
||||
// Project: http://www.dropzonejs.com/
|
||||
// Definitions by: Natan Vivo <https://github.com/nvivo>, Andy Hawkins <https://github.com/a904guy/,http://a904guy.com/,http://www.bmbsqd.com>, Vasya Aksyonov <https://github.com/outring>
|
||||
// Definitions by: Natan Vivo <https://github.com/nvivo>, Andy Hawkins <https://github.com/a904guy/,http://a904guy.com/,http://www.bmbsqd.com>, Vasya Aksyonov <https://github.com/outring>, Simon Huber <https://github.com/renuo>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../jquery/jquery.d.ts"/>
|
||||
@@ -45,10 +45,12 @@ interface DropzoneOptions {
|
||||
clickable?: boolean|string|HTMLElement|(string|HTMLElement)[];
|
||||
ignoreHiddenFiles?: boolean;
|
||||
acceptedFiles?: string;
|
||||
renameFilename?(name:string): string;
|
||||
autoProcessQueue?: boolean;
|
||||
autoQueue?: boolean;
|
||||
addRemoveLinks?: boolean;
|
||||
previewsContainer?: boolean|string|HTMLElement;
|
||||
hiddenInputContainer?: HTMLElement;
|
||||
capture?: string;
|
||||
|
||||
dictDefaultMessage?: string;
|
||||
|
||||
+13
-8
@@ -6,7 +6,16 @@
|
||||
/// <reference path="../express/express.d.ts" />
|
||||
|
||||
declare namespace Express {
|
||||
interface ExpressUserAgent {
|
||||
|
||||
interface Request {
|
||||
useragent?: ExpressUseragent.UserAgent;
|
||||
}
|
||||
}
|
||||
|
||||
declare namespace ExpressUseragent {
|
||||
import express = Express;
|
||||
|
||||
interface UserAgent {
|
||||
isMobile: boolean;
|
||||
isTablet: boolean;
|
||||
isiPad: boolean;
|
||||
@@ -55,14 +64,10 @@ declare namespace Express {
|
||||
source: string;
|
||||
}
|
||||
|
||||
interface Request {
|
||||
useragent?: ExpressUserAgent;
|
||||
}
|
||||
function parse(source: string): UserAgent;
|
||||
function express(): (req: express.Request, res: express.Response, next?: Function) => void;
|
||||
}
|
||||
|
||||
declare module "express-useragent" {
|
||||
import express = require("express");
|
||||
|
||||
export function parse(source: string): Express.ExpressUserAgent;
|
||||
export function express(): (req: express.Request, res: express.Response, next?: Function) => void;
|
||||
export = ExpressUseragent;
|
||||
}
|
||||
|
||||
+6
@@ -179,6 +179,12 @@ declare namespace ExpressValidator {
|
||||
/**
|
||||
* Decode HTML entities
|
||||
*/
|
||||
|
||||
/**
|
||||
* Convert the input string to a date, or null if the input is not a date.
|
||||
*/
|
||||
toDate(): Sanitizer;
|
||||
|
||||
entityDecode(): Sanitizer;
|
||||
entityEncode(): Sanitizer;
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
/// <reference path="../express/express.d.ts" />
|
||||
/// <reference path="../falcor/falcor.d.ts" />
|
||||
/// <reference path="../falcor-router/falcor-router.d.ts" />
|
||||
/// <reference path="falcor-express.d.ts" />
|
||||
|
||||
import express = require('express');
|
||||
import Router = require('falcor-router');
|
||||
import falcorExpress = require('falcor-express')
|
||||
|
||||
const app = express();
|
||||
class MyRouter extends Router.createClass([{
|
||||
route: 'greeting',
|
||||
get() {
|
||||
return {json: {greeting: 'Hello, world'}};
|
||||
}
|
||||
}]){
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
app.use('/model.json', falcorExpress.dataSourceRoute((req, res) => new MyRouter()));
|
||||
|
||||
app.listen(3000);
|
||||
|
||||
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
// Type definitions for falcor-express 0.1.2
|
||||
// Project: https://github.com/Netflix/falcor-express
|
||||
// Definitions by: Quramy <https://github.com/Quramy/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../falcor/falcor.d.ts" />
|
||||
/// <reference path="../express/express.d.ts" />
|
||||
|
||||
declare module 'falcor-express' {
|
||||
import {Request, Response, Handler} from 'express';
|
||||
import {DataSource} from 'falcor';
|
||||
function dataSourceRoute(getDataSource: (req: Request, res: Response) => DataSource): Handler;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
///<reference path="falcor-http-datasource.d.ts" />
|
||||
|
||||
import HttpDataSource from 'falcor-http-datasource';
|
||||
import {Model} from 'falcor';
|
||||
|
||||
const model = new Model({
|
||||
source: new HttpDataSource('/model.json')
|
||||
});
|
||||
@@ -0,0 +1,23 @@
|
||||
// Type definitions for falcor-http-datasource 0.1.3
|
||||
// Project: https://github.com/Netflix/falcor-http-datasource
|
||||
// Definitions by: Quramy <https://github.com/Quramy/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../falcor/falcor.d.ts" />
|
||||
|
||||
declare namespace FalcorHttpDataSource {
|
||||
|
||||
/**
|
||||
* A HttpDataSource object is a {@link DataSource} can be used to retrieve data from a remote JSONGraph object using the browser's XMLHttpRequest.
|
||||
**/
|
||||
class XMlHttpSource extends FalcorModel.DataSource {
|
||||
constructor(jsonGraphUrl: string);
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'falcor-http-datasource' {
|
||||
import XMlHttpSource = FalcorHttpDataSource.XMlHttpSource;
|
||||
export {XMlHttpSource};
|
||||
export default XMlHttpSource;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
/// <reference path="falcor-json-graph.d.ts" />
|
||||
|
||||
import {Key, KeySet, Path, PathSet, ref, atom, error, pathValue, pathInvalidation} from 'falcor-json-graph';
|
||||
|
||||
const stringKey: Key = "productsById";
|
||||
const numberKey: Key = 10;
|
||||
const booleanKey: Key = true;
|
||||
|
||||
const keySet01: KeySet = stringKey;
|
||||
const keySet02: KeySet = [stringKey];
|
||||
const KeySet03: KeySet = {from: 1, to: 10};
|
||||
const KeySet04: KeySet = ["name", {from: 0, length: 10}];
|
||||
|
||||
const path0: Path = ["productsById", "1234", "name"];
|
||||
const path1: Path = [stringKey, numberKey, booleanKey];
|
||||
|
||||
const pathSet01: PathSet = ["productsById", ["1234", "5678"], ["name", "price"]];
|
||||
const pathSet02: PathSet = ["products", [{from: 0, length: 10}, "length"], ["name", "price"]];
|
||||
|
||||
var ref01 = ref(['hoge']);
|
||||
var ref02 = ref(['hoge'], {$expires: 1000});
|
||||
console.log(ref02.$type, ref02.value, ref02.$expires);
|
||||
|
||||
var atom01 = atom('hoge');
|
||||
var atom02 = atom('hoge', {$expires: 1000});
|
||||
console.log(atom02.$type, atom02.value, atom02.$expires);
|
||||
|
||||
var err01 = error('some error!');
|
||||
var err02 = error('some error!', {$expires: 1000});
|
||||
console.log(err02.$type === 'error', ref02.value, ref02.$expires);
|
||||
|
||||
var pv01 = pathValue('hoge', 'FOO');
|
||||
var pv02 = pathValue('hoge[0].bar', 'FOO');
|
||||
var pv03 = pathValue('hoge[0...100].bar', 'FOO');
|
||||
var pv04 = pathValue(['hoge', {from: 0, to: 100}, 'bar'], 'FOO');
|
||||
console.log(pv04.path, pv04.value);
|
||||
|
||||
var ip01 = pathInvalidation('hoge');
|
||||
console.log(ip01.path, ip01.invalidate);
|
||||
+104
@@ -0,0 +1,104 @@
|
||||
// Type definitions for falcor-json-graph 1.1.7
|
||||
// Project: https://github.com/Netflix/falcor-json-graph
|
||||
// Definitions by: Quramy <https://github.com/Quramy/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare namespace FalcorJsonGraph {
|
||||
|
||||
// NOTE: The following types are described at https://github.com/Netflix/falcor/tree/master/lib/typedefs .
|
||||
|
||||
/**
|
||||
* An atom allows you to treat a JSON value as atomic regardless of its type, ensuring that a JSON object or array is always returned in its entirety. The JSON value must be treated as immutable. Atoms can also be used to associate metadata with a JSON value. This metadata can be used to influence the way values are handled.
|
||||
**/
|
||||
interface Atom extends Sentinel {
|
||||
$type: 'atom';
|
||||
value: any;
|
||||
}
|
||||
|
||||
interface Error extends Sentinel {
|
||||
$type: 'error';
|
||||
value: any;
|
||||
}
|
||||
|
||||
interface InvalidPath {
|
||||
path: PathSet;
|
||||
invalidate: boolean;
|
||||
}
|
||||
/**
|
||||
* A part of a {@link Path} that can be any JSON value type. All types are coerced to string, except null. This makes the number 1 and the string "1" equivalent.
|
||||
**/
|
||||
type Key = string | number | boolean;
|
||||
|
||||
/**
|
||||
* A part of a {@link PathSet} that can be either a {@link Key}, {@link Range}, or Array of either.
|
||||
**/
|
||||
type KeySet = Key | Range | Array<Key | Range>;
|
||||
|
||||
/**
|
||||
* An ordered list of {@link Key}s that point to a value in a {@link JSONGraph}.
|
||||
**/
|
||||
type Path = Array<Key>;
|
||||
|
||||
/**
|
||||
* An ordered list of {@link KeySet}s that point to location(s) in the {@link JSONGraph}. It enables pointing to multiple locations in a more terse format than a set of {@link Path}s and is generally more efficient to evaluate.
|
||||
**/
|
||||
type PathSet = Array<KeySet>;
|
||||
|
||||
/**
|
||||
* A wrapper around a path and its value.
|
||||
**/
|
||||
interface PathValue {
|
||||
path: string | PathSet;
|
||||
value: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* An envelope that wraps a JSON object.
|
||||
**/
|
||||
interface JSONEnvelope<T> {
|
||||
json: T;
|
||||
}
|
||||
|
||||
/**
|
||||
* JavaScript Object Notation Graph (JSONGraph) is a notation for expressing graphs in JSON. For more information, see the [JSONGraph Guide]{@link http://netflix.github.io/falcor/documentation/jsongraph.html}.
|
||||
**/
|
||||
type JSONGraph = any;
|
||||
|
||||
/**
|
||||
* An envelope that wraps a {@link JSONGraph} fragment.
|
||||
**/
|
||||
interface JSONGraphEnvelope {
|
||||
jsonGraph: JSONGraph;
|
||||
paths?: Array<PathSet>;
|
||||
invalidate?: Array<PathSet>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Describe a range of integers. Must contain either a "to" or "length" property.
|
||||
**/
|
||||
interface Range {
|
||||
from?: number;
|
||||
to?: number;
|
||||
length?: number;
|
||||
}
|
||||
|
||||
interface Reference extends Sentinel {
|
||||
$type: 'reference';
|
||||
value: Path;
|
||||
}
|
||||
|
||||
interface Sentinel {
|
||||
$expires?: number;
|
||||
}
|
||||
|
||||
function ref(path: string | FalcorJsonGraph.PathSet, props?: FalcorJsonGraph.Sentinel): FalcorJsonGraph.Reference;
|
||||
function atom (value: any, props?: FalcorJsonGraph.Sentinel): FalcorJsonGraph.Atom;
|
||||
function error(errorValue: any, props?: FalcorJsonGraph.Sentinel): FalcorJsonGraph.Error;
|
||||
function pathValue(path: string | FalcorJsonGraph.PathSet, value: any): FalcorJsonGraph.PathValue;
|
||||
function pathInvalidation(path: string | FalcorJsonGraph.PathSet): FalcorJsonGraph.InvalidPath;
|
||||
}
|
||||
|
||||
declare module 'falcor-json-graph' {
|
||||
export = FalcorJsonGraph;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
/// <reference path="falcor-router.d.ts" />
|
||||
|
||||
import falcor = require('falcor');
|
||||
import Router = require('falcor-router');
|
||||
|
||||
new Router([]);
|
||||
new Router([], {});
|
||||
new Router([], {debug: true});
|
||||
new Router([], {maxPaths: 10});
|
||||
new Router([], {maxRefFollow: 10});
|
||||
new Router([{route: "greeting", get: () =>({path:["greeting"], value: "Hello World"})}]);
|
||||
|
||||
new falcor.Model({source: new Router([])});
|
||||
|
||||
class MyRouter extends Router.createClass([]) {
|
||||
constructor() {
|
||||
super({debug: true, maxPaths: 10, maxRefFollow: 10});
|
||||
}
|
||||
}
|
||||
new falcor.Model({source: new MyRouter()});
|
||||
|
||||
new Router([{
|
||||
route: 'todos.length',
|
||||
get() {
|
||||
return {path: 'todos.length', value: 10};
|
||||
},
|
||||
}]);
|
||||
|
||||
new Router([{
|
||||
route: 'todos.length',
|
||||
get() {
|
||||
return [{path: 'todos.length', value: 10}];
|
||||
},
|
||||
}]);
|
||||
|
||||
new Router([{
|
||||
route: 'todos.length',
|
||||
get() {
|
||||
return {json: { todos: {length : 10}}};
|
||||
}
|
||||
}]);
|
||||
|
||||
new Router([{
|
||||
route: 'todos.length',
|
||||
get() {
|
||||
return new Promise<falcor.PathValue>(resolve => {
|
||||
resolve({path: 'todos.length', value: 10});
|
||||
});
|
||||
},
|
||||
}]);
|
||||
|
||||
new Router([{
|
||||
route: 'todos.length',
|
||||
get() {
|
||||
return new Promise<falcor.PathValue[]>(resolve => {
|
||||
resolve([{path: 'todos.length', value: 10}]);
|
||||
});
|
||||
},
|
||||
}]);
|
||||
|
||||
new Router([{
|
||||
route: 'todos.length',
|
||||
get() {
|
||||
return new Promise<falcor.JSONEnvelope<any>>(resolve => {
|
||||
resolve({json: { todos: {length : 10}}});
|
||||
});
|
||||
}
|
||||
}]);
|
||||
|
||||
new Router([{
|
||||
route: 'todos[{integers:indicies}]',
|
||||
get(pathset: FalcorRouter.RoutePathSet & {indicies: number[]}) {
|
||||
return pathset.indicies.map(idx => {
|
||||
const id = 'id' + idx;
|
||||
return {
|
||||
path: `todos[${idx}]`,
|
||||
value: {
|
||||
$type: 'ref',
|
||||
value: `todosById.${id}`
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}]);
|
||||
|
||||
new Router([{
|
||||
route: 'todos[{integers:number}]',
|
||||
set(jsonGraph) {
|
||||
return {json: jsonGraph};
|
||||
}
|
||||
}]);
|
||||
|
||||
new Router([{
|
||||
route: 'todos.push',
|
||||
call(callpath, args) {
|
||||
return [
|
||||
{path: 'json.todos.length', value: 11},
|
||||
{path: 'json.todos[10].name', value: args[0].name}
|
||||
];
|
||||
}
|
||||
}]);
|
||||
|
||||
Vendored
+59
@@ -0,0 +1,59 @@
|
||||
// Type definitions for falcor-router 0.4.0
|
||||
// Project: https://github.com/Netflix/falcor-router
|
||||
// Definitions by: Quramy <https://github.com/Quramy/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../falcor/falcor.d.ts" />
|
||||
declare namespace FalcorRouter {
|
||||
|
||||
import DataSource = FalcorModel.DataSource;
|
||||
|
||||
class Router extends DataSource {
|
||||
|
||||
constructor(routes: Array<RouteDefinition>, options?: RouterOptions);
|
||||
|
||||
/**
|
||||
* When a route misses on a call, get, or set the unhandledDataSource will
|
||||
* have a chance to fulfill that request.
|
||||
**/
|
||||
routeUnhandledPathsTo(dataSource: DataSource): void;
|
||||
|
||||
static createClass(routes?: Array<RouteDefinition>): typeof CreatedRouter;
|
||||
}
|
||||
|
||||
class CreatedRouter extends Router {
|
||||
constructor(options?: RouterOptions);
|
||||
}
|
||||
|
||||
interface Route {
|
||||
route: string;
|
||||
}
|
||||
|
||||
type RoutePathSet = FalcorJsonGraph.PathSet;
|
||||
|
||||
interface CallRoute extends Route {
|
||||
call(callPath: RoutePathSet, args: Array<any>): RouteResult | Promise<RouteResult>;
|
||||
}
|
||||
|
||||
interface GetRoute extends Route {
|
||||
get(pathset: RoutePathSet): RouteResult | Promise<RouteResult>;
|
||||
}
|
||||
|
||||
interface SetRoute extends Route {
|
||||
set(jsonGraph: FalcorJsonGraph.JSONGraph): RouteResult | Promise<RouteResult>;
|
||||
}
|
||||
|
||||
type RouteDefinition = GetRoute | SetRoute | CallRoute;
|
||||
type RouteResult = FalcorJsonGraph.PathValue | Array<FalcorJsonGraph.PathValue> | FalcorJsonGraph.JSONEnvelope<any>;
|
||||
|
||||
interface RouterOptions {
|
||||
debug?: boolean;
|
||||
maxPaths?: number;
|
||||
maxRefFollow?: number;
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'falcor-router' {
|
||||
export = FalcorRouter.Router;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
/// <reference path="falcor-browser.d.ts" />
|
||||
|
||||
var model = new falcor.Model({source: new falcor.HttpDataSource('/model.json')});
|
||||
|
||||
model.get('greeting').then(response => {
|
||||
document.write(response.json.greeting);
|
||||
});
|
||||
|
||||
model.set({
|
||||
json: {
|
||||
someAtom: falcor.atom('value'),
|
||||
someRef: falcor.ref('someAtom'),
|
||||
someError: falcor.error('an error'),
|
||||
}
|
||||
});
|
||||
|
||||
model.set(falcor.pathValue('greeting', 'Hello, world'));
|
||||
|
||||
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
// Type definitions for falcor 0.1.17
|
||||
// Project: http://netflix.github.io/falcor/
|
||||
// Definitions by: Quramy <https://github.com/Quramy/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="falcor.d.ts" />
|
||||
/// <reference path="../falcor-http-datasource/falcor-http-datasource.d.ts" />
|
||||
|
||||
declare interface FalcorStatic {
|
||||
Model: typeof FalcorModel.Model;
|
||||
DataSource: typeof FalcorModel.DataSource;
|
||||
HttpDataSource: typeof FalcorHttpDataSource.XMlHttpSource;
|
||||
ref: typeof FalcorJsonGraph.ref;
|
||||
atom: typeof FalcorJsonGraph.atom;
|
||||
error: typeof FalcorJsonGraph.error;
|
||||
pathValue: typeof FalcorJsonGraph.pathValue;
|
||||
}
|
||||
|
||||
declare var falcor: FalcorStatic;
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
/// <reference path="falcor.d.ts" />
|
||||
|
||||
import falcor = require('falcor');
|
||||
|
||||
let dataSource: falcor.DataSource;
|
||||
dataSource.get([['someParam']]).subscribe(jsonGraphEnvelope => {
|
||||
console.log(jsonGraphEnvelope.jsonGraph);
|
||||
});
|
||||
dataSource.set({
|
||||
jsonGraph: {
|
||||
someParam: 'value',
|
||||
},
|
||||
paths: [['someParam']]
|
||||
}).subscribe(jsonGraphEnvelope => {
|
||||
console.log(jsonGraphEnvelope.jsonGraph);
|
||||
});
|
||||
|
||||
dataSource.call(['items', 'push']);
|
||||
dataSource.call(['items', 'push'], [{id: 'i003', name: 'item003'}]);
|
||||
dataSource.call(['items', 'push'], [{id: 'i003', name: 'item003'}], [['id', 'name']]);
|
||||
dataSource.call(['items', 'push'], [{id: 'i003', name: 'item003'}], [['id', 'name']], [['length']]).subscribe(jsonGraphEnvelope => {
|
||||
console.log(jsonGraphEnvelope.jsonGraph);
|
||||
console.log(jsonGraphEnvelope.invalidate);
|
||||
console.log(jsonGraphEnvelope.paths[0]);
|
||||
});
|
||||
|
||||
new falcor.Model();
|
||||
new falcor.Model({});
|
||||
new falcor.Model({
|
||||
source: dataSource,
|
||||
cache: {},
|
||||
maxSize: 100,
|
||||
collectRatio: 0.5,
|
||||
comparator: (a, b) => {
|
||||
return a === b;
|
||||
},
|
||||
errorSelector: (jsonGraphError: any) => {
|
||||
console.error(jsonGraphError);
|
||||
},
|
||||
onChange: () => {
|
||||
console.log('Changed!');
|
||||
}
|
||||
});
|
||||
|
||||
const model = new falcor.Model({
|
||||
cache: {
|
||||
itemsById: {
|
||||
i01: {id: 'i01', name: 'item 01'},
|
||||
i27: {id: 'i27', name: 'item 27'},
|
||||
},
|
||||
items: [
|
||||
{$type: 'ref', value: ['itemsById', 'i01']},
|
||||
{$type: 'ref', value: ['itemsById', 'i27']},
|
||||
],
|
||||
}
|
||||
});
|
||||
|
||||
model.get('items[0].name');
|
||||
model.get(['items', 0, 'name']);
|
||||
model.get(['items', {from: 0, to: 1}, 'name']);
|
||||
model.get(['items', {from: 0, length: 2, hoge: 3}, 'name']);
|
||||
model.get('items[0].name', 'items[1].name');
|
||||
|
||||
model.set({path: 'items[0].name', value: 'ITEM 01'}, {path: ['items', 1, 'name'], value: 'ITEM 27'});
|
||||
model.set({
|
||||
itemsById: {
|
||||
i01: {
|
||||
name: 'ITEM 01'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
model.preload();
|
||||
model.preload(['items', 0, 'name']);
|
||||
model.preload(['items', 0, 'name'], ['items', 1, 'name']);
|
||||
model.preload(['items', {from: 0, to: 1}, 'name']);
|
||||
|
||||
model.call('items.push');
|
||||
model.call(['items', 'push']);
|
||||
model.call('items.push', [{id: 'i02', name: 'item02'}], ["length"]);
|
||||
model.call('items.push', [{id: 'i02', name: 'item02'}], ["name", "length"], []);
|
||||
|
||||
model.invalidate();
|
||||
model.invalidate(['items', 0, 'name']);
|
||||
model.invalidate(['items', 0, 'name'], ['items', 1, 'name']);
|
||||
model.invalidate(['items', {from: 0, to: 1}, 'name']);
|
||||
|
||||
model.get('items[0].["name", "id"]').then(res => {
|
||||
const derefedModel = model.deref(res.json.items[0])
|
||||
derefedModel.get('name', 'id');
|
||||
});
|
||||
|
||||
model.getValue('items[0].name').subscribe();
|
||||
model.getValue(['items', 0, 'name']).subscribe();
|
||||
|
||||
model.setValue('items[0].name', 'item001').subscribe();
|
||||
model.setValue(['items', 0, 'name'], 'item001').subscribe();
|
||||
|
||||
model.setCache({itemsById: {}});
|
||||
|
||||
const cache = model.getCache();
|
||||
|
||||
let version: number;
|
||||
version = model.getVersion();
|
||||
version = model.getVersion(['items']);
|
||||
|
||||
const delayedBatchingModel: falcor.Model = model.batch(100);
|
||||
delayedBatchingModel.unbatch();
|
||||
|
||||
const teabModel: falcor.Model = model.treatErrorsAsValues();
|
||||
|
||||
const sourceFromModel: falcor.DataSource = model.asDataSource();
|
||||
|
||||
const boxingModel: falcor.Model = model.boxValues();
|
||||
const unboxingModel: falcor.Model = boxingModel.unboxValues();
|
||||
const noDataSourceModel: falcor.Model = model.withoutDataSource();
|
||||
const somePath: falcor.Path = model.getPath();
|
||||
|
||||
const modelResponse = model.get<{items: {length: number}}>('items.length');
|
||||
|
||||
modelResponse.subscribe();
|
||||
modelResponse.subscribe(res => res.json.items.length);
|
||||
modelResponse.subscribe(res => res.json.items.length, error => console.error.bind(error));
|
||||
modelResponse.subscribe(res => res.json.items.length, error => console.error.bind(error), () => null);
|
||||
|
||||
const subscription = modelResponse.subscribe(res => res);
|
||||
subscription.dispose();
|
||||
|
||||
modelResponse.then(res => res.json.items.length);
|
||||
modelResponse.then(res => res, error => console.error.bind(error));
|
||||
modelResponse.then<number>(res => res.json.items.length).then((l: number) => l + 1);
|
||||
|
||||
Vendored
+277
@@ -0,0 +1,277 @@
|
||||
// Type definitions for falcor 0.1.17
|
||||
// Project: http://netflix.github.io/falcor/
|
||||
// Definitions by: Quramy <https://github.com/Quramy/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../falcor-json-graph/falcor-json-graph.d.ts" />
|
||||
|
||||
declare namespace FalcorModel {
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
// Global types
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
export import Atom = FalcorJsonGraph.Atom;
|
||||
export import Error = FalcorJsonGraph.Error;
|
||||
export import Key = FalcorJsonGraph.Key;
|
||||
export import KeySet = FalcorJsonGraph.KeySet;
|
||||
export import Path = FalcorJsonGraph.Path;
|
||||
export import PathSet = FalcorJsonGraph.PathSet;
|
||||
export import PathValue = FalcorJsonGraph.PathValue;
|
||||
export import JSONEnvelope = FalcorJsonGraph.JSONEnvelope;
|
||||
export import JSONGraph = FalcorJsonGraph.JSONGraph;
|
||||
export import JSONGraphEnvelope = FalcorJsonGraph.JSONGraphEnvelope;
|
||||
export import Range = FalcorJsonGraph.Range;
|
||||
export import Reference = FalcorJsonGraph.Reference;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
// DataSource
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* A DataSource is an interface which can be implemented to expose JSON Graph information to a Model. Every DataSource is associated with a single JSON Graph object. Models execute JSON Graph operations (get, set, and call) to retrieve values from the DataSource’s JSON Graph object. DataSources may retrieve JSON Graph information from anywhere, including device memory, a remote machine, or even a lazily-run computation.
|
||||
**/
|
||||
abstract class DataSource {
|
||||
|
||||
/**
|
||||
* The get method retrieves values from the DataSource's associated JSONGraph object.
|
||||
**/
|
||||
get(pathSets: Array<PathSet>): Observable<JSONGraphEnvelope>;
|
||||
|
||||
|
||||
/**
|
||||
* The set method accepts values to set in the DataSource's associated JSONGraph object.
|
||||
**/
|
||||
set(jsonGraphEnvelope: JSONGraphEnvelope): Observable<JSONGraphEnvelope>;
|
||||
|
||||
|
||||
/**
|
||||
* Invokes a function in the DataSource's JSONGraph object.
|
||||
**/
|
||||
call(functionPath: Path, args?: Array<any>, refSuffixes?: Array<PathSet>, thisPaths?: Array<PathSet>): Observable<JSONGraphEnvelope>;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
// Model
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
interface ModelOptions {
|
||||
source?: DataSource;
|
||||
cache?: JSONGraph;
|
||||
maxSize?: number;
|
||||
collectRatio?: number;
|
||||
errorSelector?: ModelErrorSelector;
|
||||
onChange?: ModelOnChange;
|
||||
comparator?: ModelComparator;
|
||||
}
|
||||
|
||||
/**
|
||||
* This callback is invoked when the Model's cache is changed.
|
||||
**/
|
||||
interface ModelOnChange {
|
||||
(): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is invoked on every JSONGraph Error retrieved from the DataSource. This function allows Error objects to be transformed before being stored in the Model's cache.
|
||||
**/
|
||||
interface ModelErrorSelector {
|
||||
(jsonGraphError: any): any;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is invoked every time a value in the Model cache is about to be replaced with a new value. If the function returns true, the existing value is replaced with a new value and the version flag on all of the value's ancestors in the tree are incremented.
|
||||
**/
|
||||
interface ModelComparator {
|
||||
(existingValue: any, newValue: any): boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* A Model object is used to execute commands against a {@link JSONGraph} object. {@link Model}s can work with a local JSONGraph cache, or it can work with a remote {@link JSONGraph} object through a {@link DataSource}.
|
||||
**/
|
||||
class Model {
|
||||
constructor(options?: ModelOptions);
|
||||
|
||||
/**
|
||||
* The get method retrieves several {@link Path}s or {@link PathSet}s from a {@link Model}. The get method loads each value into a JSON object and returns in a ModelResponse.
|
||||
**/
|
||||
get(...path: Array<string | PathSet>): ModelResponse<JSONEnvelope<any>>;
|
||||
get<T>(...path: Array<string | PathSet>): ModelResponse<JSONEnvelope<T>>;
|
||||
|
||||
/**
|
||||
* Sets the value at one or more places in the JSONGraph model. The set method accepts one or more {@link PathValue}s, each of which is a combination of a location in the document and the value to place there. In addition to accepting {@link PathValue}s, the set method also returns the values after the set operation is complete.
|
||||
**/
|
||||
set(...args: Array<PathValue>): ModelResponse<JSONEnvelope<any>>;
|
||||
set<T>(...args: Array<PathValue>): ModelResponse<JSONEnvelope<T>>;
|
||||
set(jsonGraph: JSONGraph): ModelResponse<JSONEnvelope<any>>;
|
||||
set<T>(jsonGraph: JSONGraph): ModelResponse<JSONEnvelope<T>>;
|
||||
|
||||
/**
|
||||
* The preload method retrieves several {@link Path}s or {@link PathSet}s from a {@link Model} and loads them into the Model cache.
|
||||
**/
|
||||
preload(...path: Array<PathSet>): void;
|
||||
|
||||
/**
|
||||
* Invokes a function in the JSON Graph.
|
||||
**/
|
||||
// NOTE: In http://netflix.github.io/falcor/doc/Model.html#call, it says that refPaths should be an array<PathSet>.
|
||||
// However, model implementation returns an error with setting refPaths as Array<PathSet> and it works with refPaths as PathSet.
|
||||
// So refPaths is defined as a PathSet in this .d.ts.
|
||||
call(functionPath: string | Path, args?: Array<any>, refPaths?: PathSet, thisPaths?: Array<PathSet>): ModelResponse<JSONEnvelope<any>>;
|
||||
call<T>(functionPath: string | Path, args?: Array<any>, refPaths?: PathSet, thisPaths?: Array<PathSet>): ModelResponse<JSONEnvelope<T>>;
|
||||
|
||||
/**
|
||||
* The invalidate method synchronously removes several {@link Path}s or {@link PathSet}s from a {@link Model} cache.
|
||||
**/
|
||||
invalidate(...path: Array<PathSet>): void;
|
||||
|
||||
/**
|
||||
* Returns a new {@link Model} bound to a location within the {@link JSONGraph}. The bound location is never a {@link Reference}: any {@link Reference}s encountered while resolving the bound {@link Path} are always replaced with the {@link Reference}s target value. For subsequent operations on the {@link Model}, all paths will be evaluated relative to the bound path. Deref allows you to:
|
||||
* - Expose only a fragment of the {@link JSONGraph} to components, rather than the entire graph
|
||||
* - Hide the location of a {@link JSONGraph} fragment from components
|
||||
* - Optimize for executing multiple operations and path looksup at/below the same location in the {@link JSONGraph}
|
||||
**/
|
||||
deref(responseObject: any): Model;
|
||||
|
||||
/**
|
||||
* Get data for a single {@link Path}.
|
||||
**/
|
||||
getValue(path: string | Path): ModelResponse<any>;
|
||||
getValue<T>(path: string | Path): ModelResponse<T>;
|
||||
|
||||
/**
|
||||
* Set value for a single {@link Path}.
|
||||
**/
|
||||
setValue(path: string | Path, value: any): ModelResponse<any>;
|
||||
setValue<T>(path: string | Path, value: any): ModelResponse<T>;
|
||||
|
||||
/**
|
||||
* Set the local cache to a {@link JSONGraph} fragment. This method can be a useful way of mocking a remote document, or restoring the local cache from a previously stored state.
|
||||
**/
|
||||
setCache(jsonGraph: JSONGraph): void;
|
||||
|
||||
/**
|
||||
* Get the local {@link JSONGraph} cache. This method can be a useful to store the state of the cache.
|
||||
**/
|
||||
getCache(...path: Array<PathSet>): JSONGraph;
|
||||
|
||||
/**
|
||||
* Retrieves a number which is incremented every single time a value is changed underneath the Model or the object at an optionally-provided Path beneath the Model.
|
||||
**/
|
||||
getVersion(path?: Path): number;
|
||||
|
||||
/**
|
||||
* Returns a clone of the {@link Model} that enables batching. Within the configured time period, paths for get operations are collected and sent to the {@link DataSource} in a batch. Batching can be more efficient if the {@link DataSource} access the network, potentially reducing the number of HTTP requests to the server.
|
||||
**/
|
||||
batch(schedulerOrDelay?: number | Scheduler): Model; // FIXME what's a valid type for scheduler?
|
||||
|
||||
/**
|
||||
* Returns a clone of the {@link Model} that disables batching. This is the default mode. Each get operation will be executed on the {@link DataSource} separately.
|
||||
**/
|
||||
unbatch(): Model;
|
||||
|
||||
/**
|
||||
* Returns a clone of the {@link Model} that treats errors as values. Errors will be reported in the same callback used to report data. Errors will appear as objects in responses, rather than being sent to the {@link Observable~onErrorCallback} callback of the {@link ModelResponse}.
|
||||
**/
|
||||
treatErrorsAsValues(): Model;
|
||||
|
||||
/**
|
||||
* Adapts a Model to the {@link DataSource} interface.
|
||||
**/
|
||||
asDataSource(): DataSource;
|
||||
|
||||
/**
|
||||
* Returns a clone of the {@link Model} that boxes values returning the wrapper ({@link Atom}, {@link Reference}, or {@link Error}), rather than the value inside it. This allows any metadata attached to the wrapper to be inspected.
|
||||
**/
|
||||
boxValues(): Model;
|
||||
|
||||
/**
|
||||
* Returns a clone of the {@link Model} that unboxes values, returning the value inside of the wrapper ({@link Atom}, {@link Reference}, or {@link Error}), rather than the wrapper itself. This is the default mode.
|
||||
**/
|
||||
unboxValues(): Model;
|
||||
|
||||
/**
|
||||
* Returns a clone of the {@link Model} that only uses the local {@link JSONGraph} and never uses a {@link DataSource} to retrieve missing paths.
|
||||
**/
|
||||
withoutDataSource(): Model;
|
||||
|
||||
/**
|
||||
* Returns the {@link Path} to the object within the JSON Graph that this Model references.
|
||||
**/
|
||||
getPath(): Path;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
// ModelResponse
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
class ModelResponse<T> extends Observable<T>{
|
||||
constructor(observable: Observable<T>);
|
||||
progressively(): ModelResponse<JSONEnvelope<T>>;
|
||||
forEach(onNext: (value: T) => void, onError?: (error: Error) => void, onCompleted?: () => void): Subscription;
|
||||
then(onFulfilled?: (value: T) => any | Thenable<any>, onRejected?: (error: any) => void): Thenable<any>;
|
||||
then<U>(onFulfilled?: (value: T) => U | Thenable<U>, onRejected?: (error: any) => void): Thenable<U>;
|
||||
}
|
||||
|
||||
interface Thenable<T> {
|
||||
then<U>(onFulfilled?: (value: T) => U | Thenable<U>, onRejected?: (error: any) => U | Thenable<U>): Thenable<U>;
|
||||
then<U>(onFulfilled?: (value: T) => U | Thenable<U>, onRejected?: (error: any) => void): Thenable<U>;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
// Observable
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
class Observable<T>{
|
||||
|
||||
/**
|
||||
* The forEach method is a synonym for {@link Observable.prototype.subscribe} and triggers the execution of the Observable, causing the values within to be pushed to a callback. An Observable is like a pipe of water that is closed. When forEach is called, we open the valve and the values within are pushed at us. These values can be received using either callbacks or an {@link Observer} object.
|
||||
**/
|
||||
forEach(onNext?: ObservableOnNextCallback<T>, onError?: ObservableOnErrorCallback , onCompleted?: ObservableOnCompletedCallback ): Subscription;
|
||||
|
||||
/**
|
||||
* The subscribe method is a synonym for {@link Observable.prototype.forEach} and triggers the execution of the Observable, causing the values within to be pushed to a callback. An Observable is like a pipe of water that is closed. When forEach is called, we open the valve and the values within are pushed at us. These values can be received using either callbacks or an {@link Observer} object.
|
||||
**/
|
||||
subscribe(onNext?: ObservableOnNextCallback<T>, onError?: ObservableOnErrorCallback , onCompleted?: ObservableOnCompletedCallback ): Subscription;
|
||||
}
|
||||
|
||||
/**
|
||||
* This callback accepts a value that was emitted while evaluating the operation underlying the {@link Observable} stream.
|
||||
**/
|
||||
interface ObservableOnNextCallback<T> {
|
||||
(value: T): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* This callback accepts an error that occurred while evaluating the operation underlying the {@link Observable} stream. When this callback is invoked, the {@link Observable} stream ends and no more values will be received by the {@link Observable~onNextCallback}.
|
||||
**/
|
||||
interface ObservableOnErrorCallback {
|
||||
(error: Error): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* This callback is invoked when the {@link Observable} stream ends. When this callback is invoked the {@link Observable} stream has ended, and therefore the {@link Observable~onNextCallback} will not receive any more values.
|
||||
**/
|
||||
interface ObservableOnCompletedCallback {
|
||||
(): void;
|
||||
}
|
||||
|
||||
class Subscription {
|
||||
/**
|
||||
* When this method is called on the Subscription, the Observable that created the Subscription will stop sending values to the callbacks passed when the Subscription was created.
|
||||
**/
|
||||
dispose(): void;
|
||||
}
|
||||
|
||||
interface Scheduler {
|
||||
catch(handler: (exception: any) => boolean): Scheduler;
|
||||
catchException(handler: (exception: any) => boolean): Scheduler;
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'falcor' {
|
||||
export = FalcorModel;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
/// <reference path="filesize.d.ts" />
|
||||
|
||||
import filesize = require("filesize");
|
||||
|
||||
filesize(500); // "500 B"
|
||||
filesize(500, { bits: true }); // "4 Kb"
|
||||
filesize(265318, { base: 10 }); // "265.32 kB"
|
||||
filesize(265318); // "259.1 KB"
|
||||
filesize(265318, { round: 0 }); // "259 KB"
|
||||
filesize(265318, { output: "array" }); // [259.1, "KB"]
|
||||
filesize(265318, { output: "object" }); // {value: 259.1, suffix: "KB", symbol: "KB"}
|
||||
filesize(1, { symbols: { B: "Б" } }); // "1 Б"
|
||||
filesize(1024); // "1 KB"
|
||||
filesize(1024, { exponent: 0 }); // "1024 B"
|
||||
filesize(1024, { output: "exponent" }); // 1
|
||||
Vendored
+84
@@ -0,0 +1,84 @@
|
||||
// Type definitions for filesize 3.2.1
|
||||
// Project: https://github.com/avoidwork/filesize.js
|
||||
// Definitions by: Giedrius Grabauskas <https://github.com/GiedriusGrabauskas>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace Filesize {
|
||||
|
||||
export interface SiJedecBits {
|
||||
b?: string;
|
||||
Kb?: string;
|
||||
Mb?: string;
|
||||
Gb?: string;
|
||||
Tb?: string;
|
||||
Pb?: string;
|
||||
Eb?: string;
|
||||
Zb?: string;
|
||||
Yb?: string;
|
||||
}
|
||||
|
||||
export interface SiJedecBytes {
|
||||
B?: string;
|
||||
KB?: string;
|
||||
MB?: string;
|
||||
GB?: string;
|
||||
TB?: string;
|
||||
PB?: string;
|
||||
EB?: string;
|
||||
ZB?: string;
|
||||
YB?: string;
|
||||
}
|
||||
|
||||
type SiJedec = SiJedecBits & SiJedecBytes & { [name: string]: string };
|
||||
|
||||
export interface Options {
|
||||
/**
|
||||
* Enables bit sizes, default is false
|
||||
*/
|
||||
bits?: boolean;
|
||||
/**
|
||||
* Number base, default is 2
|
||||
*/
|
||||
base?: number;
|
||||
/**
|
||||
* Decimal place, default is 2
|
||||
*/
|
||||
round?: number;
|
||||
/**
|
||||
* Output of function (array, exponent, object, or string), default is string
|
||||
*/
|
||||
output?: string;
|
||||
/**
|
||||
* Dictionary of SI/JEDEC symbols to replace for localization, defaults to english if no match is found
|
||||
* @deprecated: use 'symbols'
|
||||
*/
|
||||
suffixes?: SiJedec;
|
||||
/**
|
||||
* Dictionary of SI/JEDEC symbols to replace for localization, defaults to english if no match is found
|
||||
*/
|
||||
symbols?: SiJedec;
|
||||
/**
|
||||
* Specifies the SI suffix via exponent, e.g. 2 is MB for bytes, default is -1
|
||||
*/
|
||||
exponent?: number;
|
||||
/**
|
||||
* Enables unix style human readable output, e.g ls -lh, default is false
|
||||
*/
|
||||
unix?: boolean;
|
||||
/**
|
||||
* Character between the result and suffix, default is " "
|
||||
*/
|
||||
spacer?: string;
|
||||
}
|
||||
|
||||
export interface IFilesize {
|
||||
(bytes: number): string;
|
||||
(bytes: number, options: Options): string;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
declare module "filesize" {
|
||||
let fileSize: Filesize.IFilesize;
|
||||
export = fileSize;
|
||||
}
|
||||
Vendored
+40
@@ -334,6 +334,46 @@ interface FirebaseAuthData {
|
||||
expires: number;
|
||||
auth: Object;
|
||||
google?: FirebaseAuthDataGoogle;
|
||||
twitter?: FirebaseAuthDataTwitter;
|
||||
github?: FirebaseAuthDataGithub;
|
||||
facebook?: FirebaseAuthDataFacebook;
|
||||
password?: FirebaseAuthDataPassword;
|
||||
anonymous?: any;
|
||||
}
|
||||
|
||||
interface FirebaseAuthDataPassword{
|
||||
email: string;
|
||||
isTemporaryPassword: boolean;
|
||||
profileImageURL: string;
|
||||
}
|
||||
|
||||
interface FirebaseAuthDataTwitter{
|
||||
id: string;
|
||||
accessToken: string;
|
||||
accessTokenSecret: string;
|
||||
displayName: string;
|
||||
username: string;
|
||||
profileImageURL: string;
|
||||
cachedUserProfile: any;
|
||||
}
|
||||
|
||||
interface FirebaseAuthDataGithub{
|
||||
id: string;
|
||||
accessToken: string;
|
||||
displayName: string;
|
||||
email?: string;
|
||||
username: string;
|
||||
profileImageURL: string;
|
||||
cachedUserProfile: any;
|
||||
}
|
||||
|
||||
interface FirebaseAuthDataFacebook{
|
||||
id: string;
|
||||
accessToken: string;
|
||||
displayName: string;
|
||||
email?: string;
|
||||
profileImageURL: string;
|
||||
cachedUserProfile: any;
|
||||
}
|
||||
|
||||
interface FirebaseAuthDataGoogle {
|
||||
|
||||
@@ -71,8 +71,8 @@ flowFile.cancel();
|
||||
flowFile.retry();
|
||||
flowFile.bootstrap();
|
||||
bool = flowFile.isUploading();
|
||||
bool = flowFile.isComplete;
|
||||
num = flowFile.sizeUploaded;
|
||||
num = flowFile.timeRemaining;
|
||||
str = flowFile.getExtension;
|
||||
str = flowFile.getType;
|
||||
bool = flowFile.isComplete();
|
||||
num = flowFile.sizeUploaded();
|
||||
num = flowFile.timeRemaining();
|
||||
str = flowFile.getExtension();
|
||||
str = flowFile.getType();
|
||||
|
||||
Vendored
+5
-5
@@ -76,10 +76,10 @@ declare namespace flowjs {
|
||||
retry(): void;
|
||||
bootstrap(): void;
|
||||
isUploading(): boolean;
|
||||
isComplete: boolean;
|
||||
sizeUploaded: number;
|
||||
timeRemaining: number;
|
||||
getExtension: string;
|
||||
getType: string;
|
||||
isComplete(): boolean;
|
||||
sizeUploaded(): number;
|
||||
timeRemaining(): number;
|
||||
getExtension(): string;
|
||||
getType(): string;
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+2
-1
@@ -140,8 +140,9 @@ declare namespace gapi.client {
|
||||
* @param name The name of the API to load.
|
||||
* @param version The version of the API to load
|
||||
* @param callback the function that is called once the API interface is loaded
|
||||
* @param url optional, the url of your app - if using Google's APIs, don't set it
|
||||
*/
|
||||
export function load(name: string, version: string, callback: () => any): void;
|
||||
export function load(name: string, version: string, callback: () => any, url?: string): void;
|
||||
/**
|
||||
* Creates a HTTP request for making RESTful requests.
|
||||
* An object encapsulating the various arguments for this method.
|
||||
|
||||
@@ -340,11 +340,15 @@ win.show();
|
||||
// content-tracing
|
||||
// https://github.com/atom/electron/blob/master/docs/api/content-tracing.md
|
||||
|
||||
contentTracing.startRecording('*', contentTracing.DEFAULT_OPTIONS, () => {
|
||||
console.log('Tracing started');
|
||||
const options = {
|
||||
categoryFilter: '*',
|
||||
traceOptions: 'record-until-full,enable-sampling'
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
contentTracing.stopRecording('', path => {
|
||||
contentTracing.startRecording(options, function() {
|
||||
console.log('Tracing started');
|
||||
setTimeout(function() {
|
||||
contentTracing.stopRecording('', function(path) {
|
||||
console.log('Tracing data recorded to ' + path);
|
||||
});
|
||||
}, 5000);
|
||||
|
||||
Vendored
+124
-122
@@ -25,7 +25,7 @@ declare namespace Electron {
|
||||
sender: EventEmitter;
|
||||
}
|
||||
|
||||
// https://github.com/atom/electron/blob/master/docs/api/app.md
|
||||
// https://github.com/electron/electron/blob/master/docs/api/app.md
|
||||
|
||||
/**
|
||||
* The app module is responsible for controlling the application's lifecycle.
|
||||
@@ -411,7 +411,7 @@ declare namespace Electron {
|
||||
iconIndex?: number;
|
||||
}
|
||||
|
||||
// https://github.com/atom/electron/blob/master/docs/api/auto-updater.md
|
||||
// https://github.com/electron/electron/blob/master/docs/api/auto-updater.md
|
||||
|
||||
/**
|
||||
* This module provides an interface for the Squirrel auto-updater framework.
|
||||
@@ -456,7 +456,7 @@ declare namespace Electron {
|
||||
quitAndInstall(): void;
|
||||
}
|
||||
|
||||
// https://github.com/atom/electron/blob/master/docs/api/browser-window.md
|
||||
// https://github.com/electron/electron/blob/master/docs/api/browser-window.md
|
||||
|
||||
/**
|
||||
* The BrowserWindow class gives you ability to create a browser window.
|
||||
@@ -1327,7 +1327,7 @@ declare namespace Electron {
|
||||
height?: number;
|
||||
}
|
||||
|
||||
// https://github.com/atom/electron/blob/master/docs/api/clipboard.md
|
||||
// https://github.com/electron/electron/blob/master/docs/api/clipboard.md
|
||||
|
||||
/**
|
||||
* The clipboard module provides methods to perform copy and paste operations.
|
||||
@@ -1397,7 +1397,7 @@ declare namespace Electron {
|
||||
|
||||
type ClipboardType = '' | 'selection';
|
||||
|
||||
// https://github.com/atom/electron/blob/master/docs/api/content-tracing.md
|
||||
// https://github.com/electron/electron/blob/master/docs/api/content-tracing.md
|
||||
|
||||
/**
|
||||
* The content-tracing module is used to collect tracing data generated by the underlying Chromium content module.
|
||||
@@ -1407,47 +1407,40 @@ declare namespace Electron {
|
||||
interface ContentTracing {
|
||||
/**
|
||||
* Get a set of category groups. The category groups can change as new code paths are reached.
|
||||
* @param callback Called once all child processes have acked to the getCategories request.
|
||||
*
|
||||
* @param callback Called once all child processes have acknowledged the getCategories request.
|
||||
*/
|
||||
getCategories(callback: (categoryGroups: any[]) => void): void;
|
||||
/**
|
||||
* Start recording on all processes. Recording begins immediately locally, and asynchronously
|
||||
* Start recording on all processes. Recording begins immediately locally and asynchronously
|
||||
* on child processes as soon as they receive the EnableRecording request.
|
||||
* @param categoryFilter A filter to control what category groups should be traced.
|
||||
* A filter can have an optional "-" prefix to exclude category groups that contain
|
||||
* a matching category. Having both included and excluded category patterns in the
|
||||
* same list would not be supported.
|
||||
* @param options controls what kind of tracing is enabled, it could be a OR-ed
|
||||
* combination of tracing.DEFAULT_OPTIONS, tracing.ENABLE_SYSTRACE, tracing.ENABLE_SAMPLING
|
||||
* and tracing.RECORD_CONTINUOUSLY.
|
||||
* @param callback Called once all child processes have acked to the startRecording request.
|
||||
*
|
||||
* @param callback Called once all child processes have acknowledged the startRecording request.
|
||||
*/
|
||||
startRecording(categoryFilter: string, options: number, callback: Function): void;
|
||||
startRecording(options: ContentTracingOptions, callback: Function): void;
|
||||
/**
|
||||
* Stop recording on all processes. Child processes typically are caching trace data and
|
||||
* only rarely flush and send trace data back to the main process. That is because it may
|
||||
* be an expensive operation to send the trace data over IPC, and we would like to avoid
|
||||
* much runtime overhead of tracing. So, to end tracing, we must asynchronously ask all
|
||||
* child processes to flush any pending trace data.
|
||||
*
|
||||
* @param resultFilePath Trace data will be written into this file if it is not empty,
|
||||
* or into a temporary file.
|
||||
* @param callback Called once all child processes have acked to the stopRecording request.
|
||||
* @param callback Called once all child processes have acknowledged the stopRecording request.
|
||||
*/
|
||||
stopRecording(resultFilePath: string, callback:
|
||||
/**
|
||||
* @param filePath A file that contains the traced data.
|
||||
*/
|
||||
(filePath: string) => void
|
||||
): void;
|
||||
stopRecording(resultFilePath: string, callback: (filePath: string) => void): void;
|
||||
/**
|
||||
* Start monitoring on all processes. Monitoring begins immediately locally, and asynchronously
|
||||
* Start monitoring on all processes. Monitoring begins immediately locally and asynchronously
|
||||
* on child processes as soon as they receive the startMonitoring request.
|
||||
*
|
||||
* @param callback Called once all child processes have acked to the startMonitoring request.
|
||||
*/
|
||||
startMonitoring(categoryFilter: string, options: number, callback: Function): void;
|
||||
startMonitoring(options: ContentTracingOptions, callback: Function): void;
|
||||
/**
|
||||
* Stop monitoring on all processes.
|
||||
* @param callback Called once all child processes have acked to the stopMonitoring request.
|
||||
*
|
||||
* @param callback Called once all child processes have acknowledged the stopMonitoring request.
|
||||
*/
|
||||
stopMonitoring(callback: Function): void;
|
||||
/**
|
||||
@@ -1456,17 +1449,13 @@ declare namespace Electron {
|
||||
* be an expensive operation to send the trace data over IPC, and we would like to avoid much
|
||||
* runtime overhead of tracing. So, to end tracing, we must asynchronously ask all child
|
||||
* processes to flush any pending trace data.
|
||||
* @param callback Called once all child processes have acked to the captureMonitoringSnapshot request.
|
||||
*
|
||||
* @param callback Called once all child processes have acknowledged the captureMonitoringSnapshot request.
|
||||
*/
|
||||
captureMonitoringSnapshot(resultFilePath: string, callback:
|
||||
/**
|
||||
* @param filePath A file that contains the traced data
|
||||
* @returns {}
|
||||
*/
|
||||
(filePath: string) => void
|
||||
): void;
|
||||
captureMonitoringSnapshot(resultFilePath: string, callback: (filePath: string) => void): void;
|
||||
/**
|
||||
* Get the maximum across processes of trace buffer percent full state.
|
||||
* Get the maximum usage across processes of trace buffer as a percentage of the full state.
|
||||
*
|
||||
* @param callback Called when the TraceBufferUsage value is determined.
|
||||
*/
|
||||
getTraceBufferUsage(callback: Function): void;
|
||||
@@ -1475,16 +1464,47 @@ declare namespace Electron {
|
||||
*/
|
||||
setWatchEvent(categoryName: string, eventName: string, callback: Function): void;
|
||||
/**
|
||||
* Cancel the watch event. If tracing is enabled, this may race with the watch event callback.
|
||||
* Cancel the watch event. This may lead to a race condition with the watch event callback if tracing is enabled.
|
||||
*/
|
||||
cancelWatchEvent(): void;
|
||||
DEFAULT_OPTIONS: number;
|
||||
ENABLE_SYSTRACE: number;
|
||||
ENABLE_SAMPLING: number;
|
||||
RECORD_CONTINUOUSLY: number;
|
||||
}
|
||||
|
||||
// https://github.com/atom/electron/blob/master/docs/api/crash-reporter.md
|
||||
interface ContentTracingOptions {
|
||||
/**
|
||||
* Filter to control what category groups should be traced.
|
||||
* A filter can have an optional - prefix to exclude category groups
|
||||
* that contain a matching category. Having both included and excluded
|
||||
* category patterns in the same list is not supported.
|
||||
*
|
||||
* Examples:
|
||||
* test_MyTest*
|
||||
* test_MyTest*,test_OtherStuff
|
||||
* -excluded_category1,-excluded_category2
|
||||
*/
|
||||
categoryFilter: string;
|
||||
/**
|
||||
* Controls what kind of tracing is enabled, it is a comma-delimited list.
|
||||
*
|
||||
* Possible options are:
|
||||
* record-until-full
|
||||
* record-continuously
|
||||
* trace-to-console
|
||||
* enable-sampling
|
||||
* enable-systrace
|
||||
*
|
||||
* The first 3 options are trace recoding modes and hence mutually exclusive.
|
||||
* If more than one trace recording modes appear in the traceOptions string,
|
||||
* the last one takes precedence. If none of the trace recording modes are specified,
|
||||
* recording mode is record-until-full.
|
||||
*
|
||||
* The trace option will first be reset to the default option (record_mode set
|
||||
* to record-until-full, enable_sampling and enable_systrace set to false)
|
||||
* before options parsed from traceOptions are applied on it.
|
||||
*/
|
||||
traceOptions: string;
|
||||
}
|
||||
|
||||
// https://github.com/electron/electron/blob/master/docs/api/crash-reporter.md
|
||||
|
||||
/**
|
||||
* The crash-reporter module enables sending your app's crash reports.
|
||||
@@ -1492,87 +1512,56 @@ declare namespace Electron {
|
||||
interface CrashReporter {
|
||||
/**
|
||||
* You are required to call this method before using other crashReporter APIs.
|
||||
*
|
||||
* Note: On OS X, Electron uses a new crashpad client, which is different from breakpad
|
||||
* on Windows and Linux. To enable the crash collection feature, you are required to call
|
||||
* the crashReporter.start API to initialize crashpad in the main process and in each
|
||||
* renderer process from which you wish to collect crash reports.
|
||||
*/
|
||||
start(options: CrashReporterStartOptions): void;
|
||||
/**
|
||||
* @returns The date and ID of the last crash report. When there was no crash report
|
||||
* @returns The crash report. When there was no crash report
|
||||
* sent or the crash reporter is not started, null will be returned.
|
||||
*/
|
||||
getLastCrashReport(): CrashReporterPayload;
|
||||
getLastCrashReport(): CrashReport;
|
||||
/**
|
||||
* @returns All uploaded crash reports. Each report contains the date and uploaded ID.
|
||||
* @returns All uploaded crash reports.
|
||||
*/
|
||||
getUploadedReports(): CrashReporterPayload[];
|
||||
getUploadedReports(): CrashReport[];
|
||||
}
|
||||
|
||||
interface CrashReporterStartOptions {
|
||||
/**
|
||||
* Default: Electron
|
||||
*/
|
||||
* Default: Electron
|
||||
*/
|
||||
productName?: string;
|
||||
companyName: string;
|
||||
/**
|
||||
* URL that crash reports would be sent to as POST.
|
||||
*/
|
||||
* URL that crash reports would be sent to as POST.
|
||||
*/
|
||||
submitURL: string;
|
||||
/**
|
||||
* Send the crash report without user interaction.
|
||||
* Default: true.
|
||||
*/
|
||||
* Send the crash report without user interaction.
|
||||
* Default: true.
|
||||
*/
|
||||
autoSubmit?: boolean;
|
||||
/**
|
||||
* Default: false.
|
||||
*/
|
||||
* Default: false.
|
||||
*/
|
||||
ignoreSystemCrashHandler?: boolean;
|
||||
/**
|
||||
* An object you can define which content will be send along with the report.
|
||||
* Only string properties are send correctly.
|
||||
* Nested objects are not supported.
|
||||
*/
|
||||
* An object you can define that will be sent along with the report.
|
||||
* Only string properties are sent correctly, nested objects are not supported.
|
||||
*/
|
||||
extra?: {[prop: string]: string};
|
||||
}
|
||||
|
||||
interface CrashReporterPayload extends Object {
|
||||
/**
|
||||
* E.g., "electron-crash-service".
|
||||
*/
|
||||
rept: string;
|
||||
/**
|
||||
* The version of Electron.
|
||||
*/
|
||||
ver: string;
|
||||
/**
|
||||
* E.g., "win32".
|
||||
*/
|
||||
platform: string;
|
||||
/**
|
||||
* E.g., "renderer".
|
||||
*/
|
||||
process_type: string;
|
||||
ptime: number;
|
||||
/**
|
||||
* The version in package.json.
|
||||
*/
|
||||
_version: string;
|
||||
/**
|
||||
* The product name in the crashReporter options object.
|
||||
*/
|
||||
_productName: string;
|
||||
/**
|
||||
* Name of the underlying product. In this case, Electron.
|
||||
*/
|
||||
prod: string;
|
||||
/**
|
||||
* The company name in the crashReporter options object.
|
||||
*/
|
||||
_companyName: string;
|
||||
/**
|
||||
* The crashreporter as a file.
|
||||
*/
|
||||
upload_file_minidump: File;
|
||||
interface CrashReport {
|
||||
id: string;
|
||||
date: Date;
|
||||
}
|
||||
|
||||
// https://github.com/atom/electron/blob/master/docs/api/desktop-capturer.md
|
||||
// https://github.com/electron/electron/blob/master/docs/api/desktop-capturer.md
|
||||
|
||||
/**
|
||||
* The desktopCapturer module can be used to get available sources
|
||||
@@ -1618,7 +1607,7 @@ declare namespace Electron {
|
||||
thumbnail: NativeImage;
|
||||
}
|
||||
|
||||
// https://github.com/atom/electron/blob/master/docs/api/dialog.md
|
||||
// https://github.com/electron/electron/blob/master/docs/api/dialog.md
|
||||
|
||||
/**
|
||||
* The dialog module provides APIs to show native system dialogs, such as opening files or alerting,
|
||||
@@ -1752,7 +1741,7 @@ declare namespace Electron {
|
||||
noLink?: boolean;
|
||||
}
|
||||
|
||||
// https://github.com/atom/electron/blob/master/docs/api/download-item.md
|
||||
// https://github.com/electron/electron/blob/master/docs/api/download-item.md
|
||||
|
||||
/**
|
||||
* DownloadItem represents a download item in Electron.
|
||||
@@ -1820,7 +1809,7 @@ declare namespace Electron {
|
||||
getContentDisposition(): string;
|
||||
}
|
||||
|
||||
// https://github.com/atom/electron/blob/master/docs/api/global-shortcut.md
|
||||
// https://github.com/electron/electron/blob/master/docs/api/global-shortcut.md
|
||||
|
||||
/**
|
||||
* The globalShortcut module can register/unregister a global keyboard shortcut
|
||||
@@ -1854,7 +1843,7 @@ declare namespace Electron {
|
||||
unregisterAll(): void;
|
||||
}
|
||||
|
||||
// https://github.com/atom/electron/blob/master/docs/api/ipc-main.md
|
||||
// https://github.com/electron/electron/blob/master/docs/api/ipc-main.md
|
||||
|
||||
/**
|
||||
* The ipcMain module handles asynchronous and synchronous messages
|
||||
@@ -1883,7 +1872,7 @@ declare namespace Electron {
|
||||
sender: WebContents;
|
||||
}
|
||||
|
||||
// https://github.com/atom/electron/blob/master/docs/api/ipc-renderer.md
|
||||
// https://github.com/electron/electron/blob/master/docs/api/ipc-renderer.md
|
||||
|
||||
/**
|
||||
* The ipcRenderer module provides a few methods so you can send synchronous
|
||||
@@ -1926,7 +1915,8 @@ declare namespace Electron {
|
||||
sender: IpcRenderer;
|
||||
}
|
||||
|
||||
// https://github.com/atom/electron/blob/master/docs/api/menu-item.md
|
||||
// https://github.com/electron/electron/blob/master/docs/api/menu-item.md
|
||||
// https://github.com/electron/electron/blob/master/docs/api/accelerator.md
|
||||
|
||||
/**
|
||||
* The MenuItem allows you to add items to an application or context menu.
|
||||
@@ -1986,14 +1976,17 @@ declare namespace Electron {
|
||||
* multiple modifiers and key codes, combined by the + character.
|
||||
*
|
||||
* Examples:
|
||||
* Command+A
|
||||
* Ctrl+Shift+Z
|
||||
* CommandOrControl+A
|
||||
* CommandOrControl+Shift+Z
|
||||
*
|
||||
* Platform notice:
|
||||
* On Linux and Windows, the Command key would not have any effect,
|
||||
* you can use CommandOrControl which represents Command on OS X and Control on
|
||||
* Linux and Windows to define some accelerators.
|
||||
*
|
||||
* Use Alt instead of Option. The Option key only exists on OS X, whereas
|
||||
* the Alt key is available on all platforms.
|
||||
*
|
||||
* The Super key is mapped to the Windows key on Windows and Linux and Cmd on OS X.
|
||||
*
|
||||
* Available modifiers:
|
||||
@@ -2031,8 +2024,17 @@ declare namespace Electron {
|
||||
* or NativeImage instances. When passing null, an empty image will be used.
|
||||
*/
|
||||
icon?: NativeImage|string;
|
||||
/**
|
||||
* If false, the menu item will be greyed out and unclickable.
|
||||
*/
|
||||
enabled?: boolean;
|
||||
/**
|
||||
* If false, the menu item will be entirely hidden.
|
||||
*/
|
||||
visible?: boolean;
|
||||
/**
|
||||
* Should only be specified for 'checkbox' or 'radio' type menu items.
|
||||
*/
|
||||
checked?: boolean;
|
||||
/**
|
||||
* Should be specified for submenu type menu item, when it's specified the
|
||||
@@ -2055,7 +2057,7 @@ declare namespace Electron {
|
||||
role?: MenuItemRole | MenuItemRoleMac;
|
||||
}
|
||||
|
||||
// https://github.com/atom/electron/blob/master/docs/api/menu.md
|
||||
// https://github.com/electron/electron/blob/master/docs/api/menu.md
|
||||
|
||||
/**
|
||||
* The Menu class is used to create native menus that can be used as application
|
||||
@@ -2110,7 +2112,7 @@ declare namespace Electron {
|
||||
items: MenuItem[];
|
||||
}
|
||||
|
||||
// https://github.com/atom/electron/blob/master/docs/api/native-image.md
|
||||
// https://github.com/electron/electron/blob/master/docs/api/native-image.md
|
||||
|
||||
/**
|
||||
* This class is used to represent an image.
|
||||
@@ -2169,7 +2171,7 @@ declare namespace Electron {
|
||||
isTemplateImage(): boolean;
|
||||
}
|
||||
|
||||
// https://github.com/atom/electron/blob/master/docs/api/power-monitor.md
|
||||
// https://github.com/electron/electron/blob/master/docs/api/power-monitor.md
|
||||
|
||||
/**
|
||||
* The power-monitor module is used to monitor power state changes.
|
||||
@@ -2195,7 +2197,7 @@ declare namespace Electron {
|
||||
on(event: string, listener: Function): this;
|
||||
}
|
||||
|
||||
// https://github.com/atom/electron/blob/master/docs/api/power-save-blocker.md
|
||||
// https://github.com/electron/electron/blob/master/docs/api/power-save-blocker.md
|
||||
|
||||
/**
|
||||
* The powerSaveBlocker module is used to block the system from entering
|
||||
@@ -2220,7 +2222,7 @@ declare namespace Electron {
|
||||
isStarted(id: number): boolean;
|
||||
}
|
||||
|
||||
// https://github.com/atom/electron/blob/master/docs/api/protocol.md
|
||||
// https://github.com/electron/electron/blob/master/docs/api/protocol.md
|
||||
|
||||
/**
|
||||
* The protocol module can register a custom protocol or intercept an existing protocol.
|
||||
@@ -2335,7 +2337,7 @@ declare namespace Electron {
|
||||
}): void;
|
||||
}
|
||||
|
||||
// https://github.com/atom/electron/blob/master/docs/api/remote.md
|
||||
// https://github.com/electron/electron/blob/master/docs/api/remote.md
|
||||
|
||||
/**
|
||||
* The remote module provides a simple way to do inter-process communication (IPC)
|
||||
@@ -2365,7 +2367,7 @@ declare namespace Electron {
|
||||
process: NodeJS.Process;
|
||||
}
|
||||
|
||||
// https://github.com/atom/electron/blob/master/docs/api/screen.md
|
||||
// https://github.com/electron/electron/blob/master/docs/api/screen.md
|
||||
|
||||
/**
|
||||
* The Display object represents a physical display connected to the system.
|
||||
@@ -2450,7 +2452,7 @@ declare namespace Electron {
|
||||
getDisplayMatching(rect: Bounds): Display;
|
||||
}
|
||||
|
||||
// https://github.com/atom/electron/blob/master/docs/api/session.md
|
||||
// https://github.com/electron/electron/blob/master/docs/api/session.md
|
||||
|
||||
/**
|
||||
* The session module can be used to create new Session objects.
|
||||
@@ -2695,7 +2697,7 @@ declare namespace Electron {
|
||||
remove(url: string, name: string, callback: (error: Error) => void): void;
|
||||
}
|
||||
|
||||
// https://github.com/atom/electron/blob/master/docs/api/shell.md
|
||||
// https://github.com/electron/electron/blob/master/docs/api/shell.md
|
||||
|
||||
/**
|
||||
* The shell module provides functions related to desktop integration.
|
||||
@@ -2732,7 +2734,7 @@ declare namespace Electron {
|
||||
beep(): void;
|
||||
}
|
||||
|
||||
// https://github.com/atom/electron/blob/master/docs/api/tray.md
|
||||
// https://github.com/electron/electron/blob/master/docs/api/tray.md
|
||||
|
||||
/**
|
||||
* A Tray represents an icon in an operating system's notification area.
|
||||
@@ -2853,7 +2855,7 @@ declare namespace Electron {
|
||||
metaKey: boolean;
|
||||
}
|
||||
|
||||
// https://github.com/atom/electron/blob/master/docs/api/web-contents.md
|
||||
// https://github.com/electron/electron/blob/master/docs/api/web-contents.md
|
||||
|
||||
/**
|
||||
* A WebContents is responsible for rendering and controlling a web page.
|
||||
@@ -3564,7 +3566,7 @@ declare namespace Electron {
|
||||
on(event: string, listener: Function): this;
|
||||
}
|
||||
|
||||
// https://github.com/atom/electron/blob/master/docs/api/web-frame.md
|
||||
// https://github.com/electron/electron/blob/master/docs/api/web-frame.md
|
||||
|
||||
/**
|
||||
* The web-frame module allows you to customize the rendering of the current web page.
|
||||
@@ -3630,7 +3632,7 @@ declare namespace Electron {
|
||||
executeJavaScript(code: string, userGesture?: boolean, callback?: (result: any) => void): void;
|
||||
}
|
||||
|
||||
// https://github.com/atom/electron/blob/master/docs/api/web-view-tag.md
|
||||
// https://github.com/electron/electron/blob/master/docs/api/web-view-tag.md
|
||||
|
||||
/**
|
||||
* Use the webview tag to embed 'guest' content (such as web pages) in your Electron app.
|
||||
@@ -4056,7 +4058,7 @@ declare namespace Electron {
|
||||
|
||||
interface LoadCommitEvent extends Event {
|
||||
url: string;
|
||||
isMainFrame: string;
|
||||
isMainFrame: boolean;
|
||||
}
|
||||
|
||||
interface DidFailLoadEvent extends Event {
|
||||
@@ -4163,7 +4165,7 @@ declare namespace Electron {
|
||||
postMessage(message: string, targetOrigin: string): void;
|
||||
}
|
||||
|
||||
// https://github.com/atom/electron/blob/master/docs/api/synopsis.md
|
||||
// https://github.com/electron/electron/blob/master/docs/api/synopsis.md
|
||||
|
||||
interface CommonElectron {
|
||||
clipboard: Electron.Clipboard;
|
||||
@@ -4205,7 +4207,7 @@ interface Document {
|
||||
createElement(tagName: 'webview'): Electron.WebViewElement;
|
||||
}
|
||||
|
||||
// https://github.com/atom/electron/blob/master/docs/api/window-open.md
|
||||
// https://github.com/electron/electron/blob/master/docs/api/window-open.md
|
||||
|
||||
interface Window {
|
||||
/**
|
||||
@@ -4214,7 +4216,7 @@ interface Window {
|
||||
open(url: string, frameName?: string, features?: string): Electron.BrowserWindowProxy;
|
||||
}
|
||||
|
||||
// https://github.com/atom/electron/blob/master/docs/api/file-object.md
|
||||
// https://github.com/electron/electron/blob/master/docs/api/file-object.md
|
||||
|
||||
interface File {
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,190 @@
|
||||
/// <reference path="handsontable.d.ts" />
|
||||
|
||||
function test_HandsontableInit() {
|
||||
var elem = document.createElement('div');
|
||||
var hot = new Handsontable(elem, {
|
||||
allowEmpty: true,
|
||||
allowInsertColumn: true,
|
||||
allowInsertRow: true,
|
||||
allowInvalid: true,
|
||||
allowRemoveColumn: true,
|
||||
allowRemoveRow: true,
|
||||
autoColumnSize: true,
|
||||
autoComplete: [],
|
||||
autoRowSize: true,
|
||||
autoWrapCol: true,
|
||||
autoWrapRow: true,
|
||||
cell: [],
|
||||
cells: function() {},
|
||||
checkedTemplate: true,
|
||||
className: [],
|
||||
colHeaders: true,
|
||||
columnHeaderHeight: 123,
|
||||
columns: [],
|
||||
columnSorting: {},
|
||||
colWidths: 123,
|
||||
commentedCellClassName: 'foo',
|
||||
comments: [],
|
||||
contextMenu: true,
|
||||
contextMenuCopyPaste: {},
|
||||
copyable: true,
|
||||
copyColsLimit: 123,
|
||||
copyPaste: true,
|
||||
copyRowsLimit: 123,
|
||||
correctFormat: true,
|
||||
currentColClassName: 'foo',
|
||||
currentRowClassName: 'foo',
|
||||
customBorders: true,
|
||||
data: [],
|
||||
dataSchema: {},
|
||||
dateFormat: 'foo',
|
||||
debug: true,
|
||||
defaultDate: 'foo',
|
||||
disableVisualSelection: true,
|
||||
editor: true,
|
||||
enterBeginsEditing: true,
|
||||
enterMoves: {},
|
||||
fillHandle: true,
|
||||
fixedColumnsLeft: 123,
|
||||
fixedRowsTop: 123,
|
||||
format: 'foo',
|
||||
fragmentSelection: true,
|
||||
height: 123,
|
||||
invalidCellClassName: 'foo',
|
||||
label: {},
|
||||
language: 'foo',
|
||||
manualColumnFreeze: true,
|
||||
manualColumnMove: true,
|
||||
manualColumnResize: true,
|
||||
manualRowMove: true,
|
||||
manualRowResize: true,
|
||||
maxCols: 123,
|
||||
maxRows: 123,
|
||||
mergeCells: true,
|
||||
minCols: 123,
|
||||
minRows: 123,
|
||||
minSpareCols: 123,
|
||||
minSpareRows: 123,
|
||||
multiSelect: true,
|
||||
noWordWrapClassName: 'foo',
|
||||
observeChanges: true,
|
||||
observeDOMVisibility: true,
|
||||
outsideClickDeselects: true,
|
||||
pasteMode: 'foo',
|
||||
persistentState: true,
|
||||
placeholder: 123,
|
||||
placeholderCellClassName: 'foo',
|
||||
preventOverflow: true,
|
||||
readOnly: true,
|
||||
readOnlyCellClassName: 'foo',
|
||||
renderAllRows: true,
|
||||
renderer: 'foo',
|
||||
rowHeaders: true,
|
||||
rowHeaderWidth: 123,
|
||||
rowHeights: 123,
|
||||
search: true,
|
||||
selectOptions: [],
|
||||
skipColumnOnPaste: true,
|
||||
sortFunction: function() {},
|
||||
sortIndicator: true,
|
||||
source: [],
|
||||
startCols: 123,
|
||||
startRows: 123,
|
||||
stretchH: 'foo',
|
||||
strict: true,
|
||||
tableClassName: 'foo',
|
||||
tabMoves: {},
|
||||
title: 'foo',
|
||||
trimDropdown: true,
|
||||
trimWhitespace: true,
|
||||
type: 'foo',
|
||||
uncheckedTemplate: true,
|
||||
undo: true,
|
||||
validator: function() {},
|
||||
viewportColumnRenderingOffset: 123,
|
||||
viewportRowRenderingOffset: 123,
|
||||
visibleRows: 123,
|
||||
width: 1232,
|
||||
wordWrap: true,
|
||||
});
|
||||
}
|
||||
|
||||
function test_HandsontableMethods() {
|
||||
var elem = document.createElement('div');
|
||||
var hot = new Handsontable(elem, {});
|
||||
hot.addHook('foo', []);
|
||||
hot.addHookOnce('foo', []);
|
||||
hot.alter('foo', 123, 123, 'foo', true);
|
||||
hot.clear();
|
||||
hot.colOffset();
|
||||
hot.colToProp(123);
|
||||
hot.countCols();
|
||||
hot.countEmptyCols(true);
|
||||
hot.countEmptyRows(true);
|
||||
hot.countRenderedCols();
|
||||
hot.countRenderedRows();
|
||||
hot.countRows();
|
||||
hot.countSourceRows();
|
||||
hot.countVisibleCols();
|
||||
hot.countVisibleRows();
|
||||
hot.deselectCell();
|
||||
hot.destroy();
|
||||
hot.destroyEditor(true);
|
||||
hot.getActiveEditor();
|
||||
hot.getCell(123, 123, true);
|
||||
hot.getCellEditor(123, 123);
|
||||
hot.getCellMeta(123, 123);
|
||||
hot.getCellRenderer(123, 123);
|
||||
hot.getCellValidator(123, 123);
|
||||
hot.getColHeader(123);
|
||||
hot.getColWidth(123);
|
||||
hot.getCoords(elem.querySelector('td'));
|
||||
hot.getCopyableData(123, 123);
|
||||
hot.getCopyableText(123, 123, 123, 123);
|
||||
hot.getData(123, 123, 123, 123);
|
||||
hot.getDataAtCell(123, 123);
|
||||
hot.getDataAtCol(123);
|
||||
hot.getDataAtProp(123);
|
||||
hot.getDataAtRow(123);
|
||||
hot.getDataAtRowProp(123, 'foo');
|
||||
hot.getDataType(123, 123, 123, 123);
|
||||
hot.getInstance();
|
||||
hot.getPlugin('foo');
|
||||
hot.getRowHeader(123);
|
||||
hot.getRowHeight(123);
|
||||
hot.getSchema();
|
||||
hot.getSelected();
|
||||
hot.getSelectedRange();
|
||||
hot.getSettings();
|
||||
hot.getSourceData(123, 123, 123, 123);
|
||||
hot.getSourceDataAtCell(123, 123);
|
||||
hot.getSourceDataAtCol(123);
|
||||
hot.getSourceDataAtRow(123);
|
||||
hot.getValue();
|
||||
hot.hasColHeaders();
|
||||
hot.hasHook('foo');
|
||||
hot.hasRowHeaders();
|
||||
hot.isEmptyCol(123);
|
||||
hot.isEmptyRow(123);
|
||||
hot.isListening();
|
||||
hot.listen();
|
||||
hot.loadData([]);
|
||||
hot.populateFromArray(123, 123, [], 123, 123, 'foo', 'foo', 'foo', []);
|
||||
hot.propToCol('foo');
|
||||
hot.removeCellMeta(123, 123, 'foo');
|
||||
hot.removeHook('foo', function() {});
|
||||
hot.render();
|
||||
hot.rowOffset();
|
||||
hot.runHooks('foo', 123, 'foo', true, {}, [], function() {});
|
||||
hot.selectCell(123, 123, 123, 123, true, true);
|
||||
hot.selectCellByProp(123, 'foo', 123, 'foo', true);
|
||||
hot.setCellMeta(123, 123, 'foo', 'foo');
|
||||
hot.setCellMetaObject(123, 123, {});
|
||||
hot.setDataAtCell(123, 123, 'foo', 'foo');
|
||||
hot.setDataAtRowProp(123, 'foo', 'foo', 'foo');
|
||||
hot.spliceCol(123, 123, 123, 'foo');
|
||||
hot.spliceRow(123, 123, 123, 'foo');
|
||||
hot.unlisten();
|
||||
hot.updateSettings({}, true);
|
||||
hot.validateCells(function() {});
|
||||
}
|
||||
Vendored
+194
@@ -0,0 +1,194 @@
|
||||
// Type definitions for Handsontable 0.24.1
|
||||
// Project: https://handsontable.com/
|
||||
// Definitions by: Handsoncode sp. z o.o. <http://handsoncode.net/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped\
|
||||
|
||||
declare namespace ht {
|
||||
interface Options {
|
||||
allowEmpty?: boolean;
|
||||
allowInsertColumn?: boolean;
|
||||
allowInsertRow?: boolean;
|
||||
allowInvalid?: boolean;
|
||||
allowRemoveColumn?: boolean;
|
||||
allowRemoveRow?: boolean;
|
||||
autoColumnSize?: Object|boolean;
|
||||
autoComplete?: any[];
|
||||
autoRowSize?: Object|boolean;
|
||||
autoWrapCol?: boolean;
|
||||
autoWrapRow?: boolean;
|
||||
cell?: any[];
|
||||
cells?: Function;
|
||||
checkedTemplate?: boolean|string;
|
||||
className?: string|any[];
|
||||
colHeaders?: boolean|any[]|Function;
|
||||
columnHeaderHeight?: number|any[];
|
||||
columns?: any[];
|
||||
columnSorting?: boolean|Object;
|
||||
colWidths?: any[]|Function|number|string;
|
||||
commentedCellClassName?: string;
|
||||
comments?: boolean|any[];
|
||||
contextMenu?: boolean|any[]|Object;
|
||||
contextMenuCopyPaste?: Object;
|
||||
copyable?: boolean;
|
||||
copyColsLimit?: number;
|
||||
copyPaste?: boolean;
|
||||
copyRowsLimit?: number;
|
||||
correctFormat?: boolean;
|
||||
currentColClassName?: string;
|
||||
currentRowClassName?: string;
|
||||
customBorders?: boolean|any[];
|
||||
data?: any[]|Function;
|
||||
dataSchema?: Object;
|
||||
dateFormat?: string;
|
||||
debug?: boolean;
|
||||
defaultDate?: string;
|
||||
disableVisualSelection?: boolean|string|any[];
|
||||
editor?: string|Function|boolean;
|
||||
enterBeginsEditing?: boolean;
|
||||
enterMoves?: Object|Function;
|
||||
fillHandle?: boolean|string|Object;
|
||||
fixedColumnsLeft?: number;
|
||||
fixedRowsTop?: number;
|
||||
format?: string;
|
||||
fragmentSelection?: boolean|string;
|
||||
height?: number|Function;
|
||||
invalidCellClassName?: string;
|
||||
label?: Object;
|
||||
language?: string;
|
||||
manualColumnFreeze?: boolean;
|
||||
manualColumnMove?: boolean|any[];
|
||||
manualColumnResize?: boolean|any[];
|
||||
manualRowMove?: boolean|any[];
|
||||
manualRowResize?: boolean|any[];
|
||||
maxCols?: number;
|
||||
maxRows?: number;
|
||||
mergeCells?: boolean|any[];
|
||||
minCols?: number;
|
||||
minRows?: number;
|
||||
minSpareCols?: number;
|
||||
minSpareRows?: number;
|
||||
multiSelect?: boolean;
|
||||
noWordWrapClassName?: string;
|
||||
observeChanges?: boolean;
|
||||
observeDOMVisibility?: boolean;
|
||||
outsideClickDeselects?: boolean;
|
||||
pasteMode?: string;
|
||||
persistentState?: boolean;
|
||||
placeholder?: any;
|
||||
placeholderCellClassName?: string;
|
||||
preventOverflow?: string|boolean;
|
||||
readOnly?: boolean;
|
||||
readOnlyCellClassName?: string;
|
||||
renderAllRows?: boolean;
|
||||
renderer?: string|Function;
|
||||
rowHeaders?: boolean|any[]|Function;
|
||||
rowHeaderWidth?: number|any[];
|
||||
rowHeights?: any[]|Function|number|string;
|
||||
search?: boolean;
|
||||
selectOptions?: any[];
|
||||
skipColumnOnPaste?: boolean;
|
||||
sortFunction?: Function;
|
||||
sortIndicator?: boolean;
|
||||
source?: any[]|Function;
|
||||
startCols?: number;
|
||||
startRows?: number;
|
||||
stretchH?: string;
|
||||
strict?: boolean;
|
||||
tableClassName?: string|any[];
|
||||
tabMoves?: Object;
|
||||
title?: string;
|
||||
trimDropdown?: boolean;
|
||||
trimWhitespace?: boolean;
|
||||
type?: string;
|
||||
uncheckedTemplate?: boolean|string;
|
||||
undo?: boolean;
|
||||
validator?: Function|RegExp;
|
||||
viewportColumnRenderingOffset?: number|string;
|
||||
viewportRowRenderingOffset?: number|string;
|
||||
visibleRows?: number;
|
||||
width?: number|Function;
|
||||
wordWrap?: boolean;
|
||||
isEmptyCol?: (col: number) => boolean;
|
||||
isEmptyRow?: (row: number) => boolean;
|
||||
}
|
||||
interface Methods {
|
||||
addHook(key: string, callback: Function|any[]): void;
|
||||
addHookOnce(key: string, callback: Function|any[]): void;
|
||||
alter(action: string, index: number, amount?: number, source?: string, keepEmptyRows?: boolean): void;
|
||||
clear(): void;
|
||||
colOffset(): number;
|
||||
colToProp(col: number): string|number;
|
||||
countCols(): number;
|
||||
countEmptyCols(ending?: boolean): number;
|
||||
countEmptyRows(ending?: boolean): number;
|
||||
countRenderedCols(): number;
|
||||
countRenderedRows(): number;
|
||||
countRows(): number;
|
||||
countSourceRows(): number;
|
||||
countVisibleCols(): number;
|
||||
countVisibleRows(): number;
|
||||
deselectCell(): void;
|
||||
destroy(): void;
|
||||
destroyEditor(revertOriginal?: boolean): void;
|
||||
getActiveEditor(): Object;
|
||||
getCell(row: number, col: number, topmost?: boolean): Element;
|
||||
getCellEditor(row: number, col: number): Object;
|
||||
getCellMeta(row: number, col: number): Object;
|
||||
getCellRenderer(row: number, col: number): Function;
|
||||
getCellValidator(row: number, col: number): any;
|
||||
getColHeader(col: number): any[]|string;
|
||||
getColWidth(col: number): number;
|
||||
getCoords(elem: Element): Object;
|
||||
getCopyableData(row: number, column: number): string;
|
||||
getCopyableText(startRow: number, startCol: number, endRow: number, endCol: number): string;
|
||||
getData(r?: number, c?: number, r2?: number, c2?: number): any[];
|
||||
getDataAtCell(row: number, col: number): any;
|
||||
getDataAtCol(col: number): any[];
|
||||
getDataAtProp(prop: string|number): any[];
|
||||
getDataAtRow(row: number): any[];
|
||||
getDataAtRowProp(row: number, prop: string): any;
|
||||
getDataType(rowFrom: number, columnFrom: number, rowTo: number, columnTo: number): string;
|
||||
getInstance(): any;
|
||||
getPlugin(pluginName: string): any;
|
||||
getRowHeader(row?: number): any[]|string;
|
||||
getRowHeight(row: number): number;
|
||||
getSchema(): Object;
|
||||
getSelected(): any[];
|
||||
getSelectedRange(): any;
|
||||
getSettings(): Object;
|
||||
getSourceData(r?: number, c?: number, r2?: number, c2?: number): any[];
|
||||
getSourceDataAtCell(row: number, column: number): any;
|
||||
getSourceDataAtCol(column: number): any[];
|
||||
getSourceDataAtRow(row: number): any[]|Object;
|
||||
getValue(): any;
|
||||
hasColHeaders(): boolean;
|
||||
hasHook(key: string): boolean;
|
||||
hasRowHeaders(): boolean;
|
||||
isEmptyCol(col: number): boolean;
|
||||
isEmptyRow(row: number): boolean;
|
||||
isListening(): boolean;
|
||||
listen(): void;
|
||||
loadData(data: any[]): void;
|
||||
populateFromArray(row: number, col: number, input: any[], endRow?: number, endCol?: number, source?: string, method?: string, direction?: string, deltas?: any[]): any;
|
||||
propToCol(prop: string): number;
|
||||
removeCellMeta(row: number, col: number, key: string): void;
|
||||
removeHook(key: string, callback: Function): void;
|
||||
render(): void;
|
||||
rowOffset(): number;
|
||||
runHooks(key: string, p1?: any, p2?: any, p3?: any, p4?: any, p5?: any, p6?: any): any;
|
||||
selectCell(row: number, col: number, endRow?: number, endCol?: number, scrollToCell?: boolean, changeListener?: boolean): boolean;
|
||||
selectCellByProp(row: number, prop: string, endRow?: number, endProp?: string, scrollToCell?: boolean): boolean;
|
||||
setCellMeta(row: number, col: number, key: string, val: string): void;
|
||||
setCellMetaObject(row: number, col: number, prop: Object): void;
|
||||
setDataAtCell(row: number|any[], col: number, value: string, source?: string): void;
|
||||
setDataAtRowProp(row: number|any[], prop: string, value: string, source?: string): void;
|
||||
spliceCol(col: number, index: number, amount: number, elements?: any): void;
|
||||
spliceRow(row: number, index: number, amount: number, elements?: any): void;
|
||||
unlisten(): void;
|
||||
updateSettings(settings: Object, init: boolean): void;
|
||||
validateCells(callback: Function): void;
|
||||
}
|
||||
}
|
||||
declare var Handsontable: {
|
||||
new (element: Element, options: ht.Options): ht.Methods;
|
||||
};
|
||||
@@ -0,0 +1,10 @@
|
||||
/// <reference path="html-entities.d.ts" />
|
||||
|
||||
import * as htmlEntities from "html-entities";
|
||||
|
||||
let entities = new htmlEntities.AllHtmlEntities();
|
||||
|
||||
console.log(entities.encode('<>"\'&©®')); // <>"'&©®
|
||||
console.log(entities.encodeNonUTF('<>"\'&©®')); // <>"'&©®
|
||||
console.log(entities.encodeNonASCII('<>"\'&©®')); // <>"\'&©®
|
||||
console.log(entities.decode('<>"'&©®∆')); // <>"'&©®∆
|
||||
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
// Type definitions for html-entities v1.2.0
|
||||
// Project: https://www.npmjs.com/package/html-entities
|
||||
// Definitions by: Xavier Stouder <https://github.com/xstoudi/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module "html-entities" {
|
||||
abstract class Entities {
|
||||
encode(toEncode: string): string;
|
||||
encodeNonUTF(toEncode: string): string;
|
||||
encodeNonASCII(toEncode: string): string;
|
||||
decode(toDecode: string): string;
|
||||
}
|
||||
class XmlEntities extends Entities {}
|
||||
class Html4Entities extends Entities {}
|
||||
class Html5Entities extends Entities {}
|
||||
class AllHtmlEntities extends Entities {}
|
||||
}
|
||||
@@ -39,7 +39,9 @@ str = httpStatus[414];
|
||||
str = httpStatus[415];
|
||||
str = httpStatus[416];
|
||||
str = httpStatus[417];
|
||||
str = httpStatus[422];
|
||||
str = httpStatus[429];
|
||||
str = httpStatus[451];
|
||||
str = httpStatus[500];
|
||||
str = httpStatus[501];
|
||||
str = httpStatus[502];
|
||||
@@ -82,7 +84,9 @@ nmr = httpStatus.REQUEST_URI_TOO_LONG;
|
||||
nmr = httpStatus.UNSUPPORTED_MEDIA_TYPE;
|
||||
nmr = httpStatus.REQUESTED_RANGE_NOT_SATISFIABLE;
|
||||
nmr = httpStatus.EXPECTATION_FAILED;
|
||||
nmr = httpStatus.UNPROCESSABLE_ENTITY;
|
||||
nmr = httpStatus.TOO_MANY_REQUESTS;
|
||||
nmr = httpStatus.UNAVAILABLE_FOR_LEGAL_REASONS;
|
||||
nmr = httpStatus.INTERNAL_SERVER_ERROR;
|
||||
nmr = httpStatus.NOT_IMPLEMENTED;
|
||||
nmr = httpStatus.BAD_GATEWAY;
|
||||
|
||||
Vendored
+5
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for http-status v0.1.8
|
||||
// Type definitions for http-status v0.2.1
|
||||
// Project: https://github.com/wdavidw/node-http-status
|
||||
// Definitions by: Michael Zabka <https://github.com/misak113/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -38,7 +38,9 @@ interface HttpStatus {
|
||||
415: string;
|
||||
416: string;
|
||||
417: string;
|
||||
422: string;
|
||||
429: string;
|
||||
451: string;
|
||||
500: string;
|
||||
501: string;
|
||||
502: string;
|
||||
@@ -79,7 +81,9 @@ interface HttpStatus {
|
||||
UNSUPPORTED_MEDIA_TYPE: number;
|
||||
REQUESTED_RANGE_NOT_SATISFIABLE: number;
|
||||
EXPECTATION_FAILED: number;
|
||||
UNPROCESSABLE_ENTITY: number;
|
||||
TOO_MANY_REQUESTS: number;
|
||||
UNAVAILABLE_FOR_LEGAL_REASONS: number;
|
||||
INTERNAL_SERVER_ERROR: number;
|
||||
NOT_IMPLEMENTED: number;
|
||||
BAD_GATEWAY: number;
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
/// <reference path="ioredis.d.ts" />
|
||||
|
||||
import * as Redis from "ioredis";
|
||||
var redis = new Redis();
|
||||
|
||||
redis.set('foo', 'bar');
|
||||
redis.get('foo', function(err, result) {
|
||||
console.log(result);
|
||||
});
|
||||
|
||||
// Or using a promise if the last argument isn't a function
|
||||
redis.get('foo').then(function(result: any) {
|
||||
console.log(result);
|
||||
});
|
||||
|
||||
// Arguments to commands are flattened, so the following are the same:
|
||||
redis.sadd('set', 1, 3, 5, 7);
|
||||
redis.sadd('set', [1, 3, 5, 7]);
|
||||
|
||||
// All arguments are passed directly to the redis server:
|
||||
redis.set('key', 100, 'EX', 10);
|
||||
|
||||
new Redis() // Connect to 127.0.0.1:6379
|
||||
new Redis(6380) // 127.0.0.1:6380
|
||||
new Redis(6379, '192.168.1.1') // 192.168.1.1:6379
|
||||
new Redis('/tmp/redis.sock')
|
||||
new Redis({
|
||||
port: 6379, // Redis port
|
||||
host: '127.0.0.1', // Redis host
|
||||
family: 4, // 4 (IPv4) or 6 (IPv6)
|
||||
password: 'auth',
|
||||
db: 0
|
||||
})
|
||||
|
||||
var pub = new Redis();
|
||||
redis.subscribe('news', 'music', function(err: any, count: any) {
|
||||
// Now we are subscribed to both the 'news' and 'music' channels.
|
||||
// `count` represents the number of channels we are currently subscribed to.
|
||||
|
||||
pub.publish('news', 'Hello world!');
|
||||
pub.publish('music', 'Hello again!');
|
||||
});
|
||||
|
||||
redis.on('message', function(channel: any, message: any) {
|
||||
// Receive message Hello world! from channel news
|
||||
// Receive message Hello again! from channel music
|
||||
console.log('Receive message %s from channel %s', message, channel);
|
||||
});
|
||||
|
||||
// There's also an event called 'messageBuffer', which is the same as 'message' except
|
||||
// it returns buffers instead of strings.
|
||||
redis.on('messageBuffer', function(channel: any, message: any) {
|
||||
// Both `channel` and `message` are buffers.
|
||||
});
|
||||
Vendored
+699
@@ -0,0 +1,699 @@
|
||||
// Type definitions for ioredis
|
||||
// Project: https://github.com/luin/ioredis
|
||||
// Definitions by: York Yao <https://github.com/plantain-00/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/* =================== USAGE ===================
|
||||
import * as Redis from "ioredis";
|
||||
var redis = new Redis();
|
||||
=============================================== */
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
|
||||
declare module "ioredis" {
|
||||
|
||||
|
||||
interface RedisStatic {
|
||||
new (port?: number, host?: string, options?: IORedis.RedisOptions): IORedis.Redis;
|
||||
new (host?: string, options?: IORedis.RedisOptions): IORedis.Redis;
|
||||
new (options: IORedis.RedisOptions): IORedis.Redis;
|
||||
new (url: string): IORedis.Redis;
|
||||
(port?: number, host?: string, options?: IORedis.RedisOptions): IORedis.Redis;
|
||||
(host?: string, options?: IORedis.RedisOptions): IORedis.Redis;
|
||||
(options: IORedis.RedisOptions): IORedis.Redis;
|
||||
(url: string): IORedis.Redis;
|
||||
Cluster: IORedis.Cluster;
|
||||
}
|
||||
|
||||
var redis: RedisStatic;
|
||||
export = redis;
|
||||
}
|
||||
declare module IORedis {
|
||||
interface Commander {
|
||||
new (): Commander;
|
||||
getBuiltinCommands(): string[];
|
||||
createBuiltinCommand(commandName: string): {};
|
||||
defineCommand(name: string, definition: {
|
||||
numberOfKeys?: number;
|
||||
lua?: string;
|
||||
}): any;
|
||||
sendCommand(): void;
|
||||
}
|
||||
|
||||
interface Redis extends NodeJS.EventEmitter, Commander {
|
||||
connect(callback: Function): Promise<any>;
|
||||
disconnect(): void;
|
||||
duplicate(): Redis;
|
||||
monitor(calback: (error: Error, monitor: NodeJS.EventEmitter) => void): Promise<NodeJS.EventEmitter>;
|
||||
|
||||
send_command(command: string, ...args: any[]): any;
|
||||
auth(password: string, callback?: ResCallbackT<any>): any;
|
||||
ping(callback?: ResCallbackT<number>): any;
|
||||
append(key: string, value: string, callback?: ResCallbackT<number>): any;
|
||||
bitcount(key: string, callback?: ResCallbackT<number>): any;
|
||||
bitcount(key: string, start: number, end: number, callback?: ResCallbackT<number>): any;
|
||||
set(key: string, value: string, callback?: ResCallbackT<string>): any;
|
||||
get(key: string, callback?: ResCallbackT<string>): any;
|
||||
exists(key: string, value: string, callback?: ResCallbackT<number>): any;
|
||||
publish(channel: string, value: any): any;
|
||||
subscribe(channel: string): any;
|
||||
get(args: any[], callback?: ResCallbackT<string>): any;
|
||||
get(...args: any[]): any;
|
||||
set(args: any[], callback?: ResCallbackT<string>): any;
|
||||
set(...args: any[]): any;
|
||||
setnx(args: any[], callback?: ResCallbackT<any>): any;
|
||||
setnx(...args: any[]): any;
|
||||
setex(args: any[], callback?: ResCallbackT<any>): any;
|
||||
setex(...args: any[]): any;
|
||||
append(args: any[], callback?: ResCallbackT<any>): any;
|
||||
append(...args: any[]): any;
|
||||
strlen(args: any[], callback?: ResCallbackT<any>): any;
|
||||
strlen(...args: any[]): any;
|
||||
del(args: any[], callback?: ResCallbackT<any>): any;
|
||||
del(...args: any[]): any;
|
||||
exists(args: any[], callback?: ResCallbackT<any>): any;
|
||||
exists(...args: any[]): any;
|
||||
setbit(args: any[], callback?: ResCallbackT<any>): any;
|
||||
setbit(...args: any[]): any;
|
||||
getbit(args: any[], callback?: ResCallbackT<any>): any;
|
||||
getbit(...args: any[]): any;
|
||||
setrange(args: any[], callback?: ResCallbackT<any>): any;
|
||||
setrange(...args: any[]): any;
|
||||
getrange(args: any[], callback?: ResCallbackT<any>): any;
|
||||
getrange(...args: any[]): any;
|
||||
substr(args: any[], callback?: ResCallbackT<any>): any;
|
||||
substr(...args: any[]): any;
|
||||
incr(args: any[], callback?: ResCallbackT<any>): any;
|
||||
incr(...args: any[]): any;
|
||||
decr(args: any[], callback?: ResCallbackT<any>): any;
|
||||
decr(...args: any[]): any;
|
||||
mget(args: any[], callback?: ResCallbackT<any>): any;
|
||||
mget(...args: any[]): any;
|
||||
rpush(...args: any[]): any;
|
||||
lpush(args: any[], callback?: ResCallbackT<any>): any;
|
||||
lpush(...args: any[]): any;
|
||||
rpushx(args: any[], callback?: ResCallbackT<any>): any;
|
||||
rpushx(...args: any[]): any;
|
||||
lpushx(args: any[], callback?: ResCallbackT<any>): any;
|
||||
lpushx(...args: any[]): any;
|
||||
linsert(args: any[], callback?: ResCallbackT<any>): any;
|
||||
linsert(...args: any[]): any;
|
||||
rpop(args: any[], callback?: ResCallbackT<any>): any;
|
||||
rpop(...args: any[]): any;
|
||||
lpop(args: any[], callback?: ResCallbackT<any>): any;
|
||||
lpop(...args: any[]): any;
|
||||
brpop(args: any[], callback?: ResCallbackT<any>): any;
|
||||
brpop(...args: any[]): any;
|
||||
brpoplpush(args: any[], callback?: ResCallbackT<any>): any;
|
||||
brpoplpush(...args: any[]): any;
|
||||
blpop(args: any[], callback?: ResCallbackT<any>): any;
|
||||
blpop(...args: any[]): any;
|
||||
llen(args: any[], callback?: ResCallbackT<any>): any;
|
||||
llen(...args: any[]): any;
|
||||
lindex(args: any[], callback?: ResCallbackT<any>): any;
|
||||
lindex(...args: any[]): any;
|
||||
lset(args: any[], callback?: ResCallbackT<any>): any;
|
||||
lset(...args: any[]): any;
|
||||
lrange(args: any[], callback?: ResCallbackT<any>): any;
|
||||
lrange(...args: any[]): any;
|
||||
ltrim(args: any[], callback?: ResCallbackT<any>): any;
|
||||
ltrim(...args: any[]): any;
|
||||
lrem(args: any[], callback?: ResCallbackT<any>): any;
|
||||
lrem(...args: any[]): any;
|
||||
rpoplpush(args: any[], callback?: ResCallbackT<any>): any;
|
||||
rpoplpush(...args: any[]): any;
|
||||
sadd(args: any[], callback?: ResCallbackT<any>): any;
|
||||
sadd(...args: any[]): any;
|
||||
srem(args: any[], callback?: ResCallbackT<any>): any;
|
||||
srem(...args: any[]): any;
|
||||
smove(args: any[], callback?: ResCallbackT<any>): any;
|
||||
smove(...args: any[]): any;
|
||||
sismember(args: any[], callback?: ResCallbackT<any>): any;
|
||||
sismember(...args: any[]): any;
|
||||
scard(args: any[], callback?: ResCallbackT<any>): any;
|
||||
scard(...args: any[]): any;
|
||||
spop(args: any[], callback?: ResCallbackT<any>): any;
|
||||
spop(...args: any[]): any;
|
||||
srandmember(args: any[], callback?: ResCallbackT<any>): any;
|
||||
srandmember(...args: any[]): any;
|
||||
sinter(args: any[], callback?: ResCallbackT<any>): any;
|
||||
sinter(...args: any[]): any;
|
||||
sinterstore(args: any[], callback?: ResCallbackT<any>): any;
|
||||
sinterstore(...args: any[]): any;
|
||||
sunion(args: any[], callback?: ResCallbackT<any>): any;
|
||||
sunion(...args: any[]): any;
|
||||
sunionstore(args: any[], callback?: ResCallbackT<any>): any;
|
||||
sunionstore(...args: any[]): any;
|
||||
sdiff(args: any[], callback?: ResCallbackT<any>): any;
|
||||
sdiff(...args: any[]): any;
|
||||
sdiffstore(args: any[], callback?: ResCallbackT<any>): any;
|
||||
sdiffstore(...args: any[]): any;
|
||||
smembers(args: any[], callback?: ResCallbackT<any>): any;
|
||||
smembers(...args: any[]): any;
|
||||
zadd(args: any[], callback?: ResCallbackT<any>): any;
|
||||
zadd(...args: any[]): any;
|
||||
zincrby(args: any[], callback?: ResCallbackT<any>): any;
|
||||
zincrby(...args: any[]): any;
|
||||
zrem(args: any[], callback?: ResCallbackT<any>): any;
|
||||
zrem(...args: any[]): any;
|
||||
zremrangebyscore(args: any[], callback?: ResCallbackT<any>): any;
|
||||
zremrangebyscore(...args: any[]): any;
|
||||
zremrangebyrank(args: any[], callback?: ResCallbackT<any>): any;
|
||||
zremrangebyrank(...args: any[]): any;
|
||||
zunionstore(args: any[], callback?: ResCallbackT<any>): any;
|
||||
zunionstore(...args: any[]): any;
|
||||
zinterstore(args: any[], callback?: ResCallbackT<any>): any;
|
||||
zinterstore(...args: any[]): any;
|
||||
zrange(args: any[], callback?: ResCallbackT<any>): any;
|
||||
zrange(...args: any[]): any;
|
||||
zrangebyscore(args: any[], callback?: ResCallbackT<any>): any;
|
||||
zrangebyscore(...args: any[]): any;
|
||||
zrevrangebyscore(args: any[], callback?: ResCallbackT<any>): any;
|
||||
zrevrangebyscore(...args: any[]): any;
|
||||
zcount(args: any[], callback?: ResCallbackT<any>): any;
|
||||
zcount(...args: any[]): any;
|
||||
zrevrange(args: any[], callback?: ResCallbackT<any>): any;
|
||||
zrevrange(...args: any[]): any;
|
||||
zcard(args: any[], callback?: ResCallbackT<any>): any;
|
||||
zcard(...args: any[]): any;
|
||||
zscore(args: any[], callback?: ResCallbackT<any>): any;
|
||||
zscore(...args: any[]): any;
|
||||
zrank(args: any[], callback?: ResCallbackT<any>): any;
|
||||
zrank(...args: any[]): any;
|
||||
zrevrank(args: any[], callback?: ResCallbackT<any>): any;
|
||||
zrevrank(...args: any[]): any;
|
||||
hset(args: any[], callback?: ResCallbackT<any>): any;
|
||||
hset(...args: any[]): any;
|
||||
hsetnx(args: any[], callback?: ResCallbackT<any>): any;
|
||||
hsetnx(...args: any[]): any;
|
||||
hget(args: any[], callback?: ResCallbackT<any>): any;
|
||||
hget(...args: any[]): any;
|
||||
hmset(args: any[], callback?: ResCallbackT<any>): any;
|
||||
hmset(key: string, hash: any, callback?: ResCallbackT<any>): any;
|
||||
hmset(...args: any[]): any;
|
||||
hmget(args: any[], callback?: ResCallbackT<any>): any;
|
||||
hmget(...args: any[]): any;
|
||||
hincrby(args: any[], callback?: ResCallbackT<any>): any;
|
||||
hincrby(...args: any[]): any;
|
||||
hdel(args: any[], callback?: ResCallbackT<any>): any;
|
||||
hdel(...args: any[]): any;
|
||||
hlen(args: any[], callback?: ResCallbackT<any>): any;
|
||||
hlen(...args: any[]): any;
|
||||
hkeys(args: any[], callback?: ResCallbackT<any>): any;
|
||||
hkeys(...args: any[]): any;
|
||||
hvals(args: any[], callback?: ResCallbackT<any>): any;
|
||||
hvals(...args: any[]): any;
|
||||
hgetall(args: any[], callback?: ResCallbackT<any>): any;
|
||||
hgetall(...args: any[]): any;
|
||||
hgetall(key: string, callback?: ResCallbackT<any>): any;
|
||||
hexists(args: any[], callback?: ResCallbackT<any>): any;
|
||||
hexists(...args: any[]): any;
|
||||
incrby(args: any[], callback?: ResCallbackT<any>): any;
|
||||
incrby(...args: any[]): any;
|
||||
decrby(args: any[], callback?: ResCallbackT<any>): any;
|
||||
decrby(...args: any[]): any;
|
||||
getset(args: any[], callback?: ResCallbackT<any>): any;
|
||||
getset(...args: any[]): any;
|
||||
mset(args: any[], callback?: ResCallbackT<any>): any;
|
||||
mset(...args: any[]): any;
|
||||
msetnx(args: any[], callback?: ResCallbackT<any>): any;
|
||||
msetnx(...args: any[]): any;
|
||||
randomkey(args: any[], callback?: ResCallbackT<any>): any;
|
||||
randomkey(...args: any[]): any;
|
||||
select(args: any[], callback?: ResCallbackT<any>): void;
|
||||
select(...args: any[]): void;
|
||||
move(args: any[], callback?: ResCallbackT<any>): any;
|
||||
move(...args: any[]): any;
|
||||
rename(args: any[], callback?: ResCallbackT<any>): any;
|
||||
rename(...args: any[]): any;
|
||||
renamenx(args: any[], callback?: ResCallbackT<any>): any;
|
||||
renamenx(...args: any[]): any;
|
||||
expire(args: any[], callback?: ResCallbackT<any>): any;
|
||||
expire(...args: any[]): any;
|
||||
expireat(args: any[], callback?: ResCallbackT<any>): any;
|
||||
expireat(...args: any[]): any;
|
||||
keys(args: any[], callback?: ResCallbackT<any>): any;
|
||||
keys(...args: any[]): any;
|
||||
dbsize(args: any[], callback?: ResCallbackT<any>): any;
|
||||
dbsize(...args: any[]): any;
|
||||
auth(args: any[], callback?: ResCallbackT<any>): void;
|
||||
auth(...args: any[]): void;
|
||||
ping(args: any[], callback?: ResCallbackT<any>): any;
|
||||
ping(...args: any[]): any;
|
||||
echo(args: any[], callback?: ResCallbackT<any>): any;
|
||||
echo(...args: any[]): any;
|
||||
save(args: any[], callback?: ResCallbackT<any>): any;
|
||||
save(...args: any[]): any;
|
||||
bgsave(args: any[], callback?: ResCallbackT<any>): any;
|
||||
bgsave(...args: any[]): any;
|
||||
bgrewriteaof(args: any[], callback?: ResCallbackT<any>): any;
|
||||
bgrewriteaof(...args: any[]): any;
|
||||
shutdown(args: any[], callback?: ResCallbackT<any>): any;
|
||||
shutdown(...args: any[]): any;
|
||||
lastsave(args: any[], callback?: ResCallbackT<any>): any;
|
||||
lastsave(...args: any[]): any;
|
||||
type(args: any[], callback?: ResCallbackT<any>): any;
|
||||
type(...args: any[]): any;
|
||||
multi(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
multi(...args: any[]): Pipeline;
|
||||
exec(args: any[], callback?: ResCallbackT<any>): any;
|
||||
exec(...args: any[]): any;
|
||||
discard(args: any[], callback?: ResCallbackT<any>): any;
|
||||
discard(...args: any[]): any;
|
||||
sync(args: any[], callback?: ResCallbackT<any>): any;
|
||||
sync(...args: any[]): any;
|
||||
flushdb(args: any[], callback?: ResCallbackT<any>): any;
|
||||
flushdb(...args: any[]): any;
|
||||
flushall(args: any[], callback?: ResCallbackT<any>): any;
|
||||
flushall(...args: any[]): any;
|
||||
sort(args: any[], callback?: ResCallbackT<any>): any;
|
||||
sort(...args: any[]): any;
|
||||
info(args: any[], callback?: ResCallbackT<any>): any;
|
||||
info(...args: any[]): any;
|
||||
monitor(args: any[], callback?: ResCallbackT<any>): any;
|
||||
monitor(...args: any[]): any;
|
||||
ttl(args: any[], callback?: ResCallbackT<any>): any;
|
||||
ttl(...args: any[]): any;
|
||||
persist(args: any[], callback?: ResCallbackT<any>): any;
|
||||
persist(...args: any[]): any;
|
||||
slaveof(args: any[], callback?: ResCallbackT<any>): any;
|
||||
slaveof(...args: any[]): any;
|
||||
debug(args: any[], callback?: ResCallbackT<any>): any;
|
||||
debug(...args: any[]): any;
|
||||
config(args: any[], callback?: ResCallbackT<any>): any;
|
||||
config(...args: any[]): any;
|
||||
subscribe(args: any[], callback?: ResCallbackT<any>): any;
|
||||
subscribe(...args: any[]): any;
|
||||
unsubscribe(args: any[], callback?: ResCallbackT<any>): any;
|
||||
unsubscribe(...args: any[]): any;
|
||||
psubscribe(args: any[], callback?: ResCallbackT<any>): any;
|
||||
psubscribe(...args: any[]): any;
|
||||
punsubscribe(args: any[], callback?: ResCallbackT<any>): any;
|
||||
punsubscribe(...args: any[]): any;
|
||||
publish(args: any[], callback?: ResCallbackT<any>): any;
|
||||
publish(...args: any[]): any;
|
||||
watch(args: any[], callback?: ResCallbackT<any>): any;
|
||||
watch(...args: any[]): any;
|
||||
unwatch(args: any[], callback?: ResCallbackT<any>): any;
|
||||
unwatch(...args: any[]): any;
|
||||
cluster(args: any[], callback?: ResCallbackT<any>): any;
|
||||
cluster(...args: any[]): any;
|
||||
restore(args: any[], callback?: ResCallbackT<any>): any;
|
||||
restore(...args: any[]): any;
|
||||
migrate(args: any[], callback?: ResCallbackT<any>): any;
|
||||
migrate(...args: any[]): any;
|
||||
dump(args: any[], callback?: ResCallbackT<any>): any;
|
||||
dump(...args: any[]): any;
|
||||
object(args: any[], callback?: ResCallbackT<any>): any;
|
||||
object(...args: any[]): any;
|
||||
client(args: any[], callback?: ResCallbackT<any>): any;
|
||||
client(...args: any[]): any;
|
||||
eval(args: any[], callback?: ResCallbackT<any>): any;
|
||||
eval(...args: any[]): any;
|
||||
evalsha(args: any[], callback?: ResCallbackT<any>): any;
|
||||
evalsha(...args: any[]): any;
|
||||
script(args: any[], callback?: ResCallbackT<any>): any;
|
||||
script(...args: any[]): any;
|
||||
script(key: string, callback?: ResCallbackT<any>): any;
|
||||
quit(args: any[], callback?: ResCallbackT<any>): any;
|
||||
quit(...args: any[]): any;
|
||||
scan(...args: any[]): any;
|
||||
scan(args: any[], callback?: ResCallbackT<any>): any;
|
||||
hscan(...args: any[]): any;
|
||||
hscan(args: any[], callback?: ResCallbackT<any>): any;
|
||||
zscan(...args: any[]): any;
|
||||
zscan(args: any[], callback?: ResCallbackT<any>): any;
|
||||
|
||||
pipeline(): Pipeline;
|
||||
pipeline(commands: string[][]): Pipeline;
|
||||
|
||||
scanStream(options?: IORedis.ScanStreamOption): NodeJS.EventEmitter;
|
||||
hscanStream(key: string, options?: IORedis.ScanStreamOption): NodeJS.EventEmitter;
|
||||
}
|
||||
|
||||
interface Pipeline {
|
||||
exec(callback?: ResCallbackT<any[]>): any;
|
||||
|
||||
get(args: any[], callback?: ResCallbackT<string>): Pipeline;
|
||||
get(...args: any[]): Pipeline;
|
||||
set(args: any[], callback?: ResCallbackT<string>): Pipeline;
|
||||
set(...args: any[]): Pipeline;
|
||||
setnx(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
setnx(...args: any[]): Pipeline;
|
||||
setex(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
setex(...args: any[]): Pipeline;
|
||||
append(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
append(...args: any[]): Pipeline;
|
||||
strlen(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
strlen(...args: any[]): Pipeline;
|
||||
del(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
del(...args: any[]): Pipeline;
|
||||
exists(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
exists(...args: any[]): Pipeline;
|
||||
setbit(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
setbit(...args: any[]): Pipeline;
|
||||
getbit(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
getbit(...args: any[]): Pipeline;
|
||||
setrange(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
setrange(...args: any[]): Pipeline;
|
||||
getrange(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
getrange(...args: any[]): Pipeline;
|
||||
substr(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
substr(...args: any[]): Pipeline;
|
||||
incr(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
incr(...args: any[]): Pipeline;
|
||||
decr(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
decr(...args: any[]): Pipeline;
|
||||
mget(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
mget(...args: any[]): Pipeline;
|
||||
rpush(...args: any[]): Pipeline;
|
||||
lpush(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
lpush(...args: any[]): Pipeline;
|
||||
rpushx(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
rpushx(...args: any[]): Pipeline;
|
||||
lpushx(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
lpushx(...args: any[]): Pipeline;
|
||||
linsert(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
linsert(...args: any[]): Pipeline;
|
||||
rpop(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
rpop(...args: any[]): Pipeline;
|
||||
lpop(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
lpop(...args: any[]): Pipeline;
|
||||
brpop(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
brpop(...args: any[]): Pipeline;
|
||||
brpoplpush(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
brpoplpush(...args: any[]): Pipeline;
|
||||
blpop(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
blpop(...args: any[]): Pipeline;
|
||||
llen(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
llen(...args: any[]): Pipeline;
|
||||
lindex(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
lindex(...args: any[]): Pipeline;
|
||||
lset(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
lset(...args: any[]): Pipeline;
|
||||
lrange(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
lrange(...args: any[]): Pipeline;
|
||||
ltrim(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
ltrim(...args: any[]): Pipeline;
|
||||
lrem(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
lrem(...args: any[]): Pipeline;
|
||||
rpoplpush(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
rpoplpush(...args: any[]): Pipeline;
|
||||
sadd(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
sadd(...args: any[]): Pipeline;
|
||||
srem(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
srem(...args: any[]): Pipeline;
|
||||
smove(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
smove(...args: any[]): Pipeline;
|
||||
sismember(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
sismember(...args: any[]): Pipeline;
|
||||
scard(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
scard(...args: any[]): Pipeline;
|
||||
spop(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
spop(...args: any[]): Pipeline;
|
||||
srandmember(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
srandmember(...args: any[]): Pipeline;
|
||||
sinter(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
sinter(...args: any[]): Pipeline;
|
||||
sinterstore(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
sinterstore(...args: any[]): Pipeline;
|
||||
sunion(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
sunion(...args: any[]): Pipeline;
|
||||
sunionstore(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
sunionstore(...args: any[]): Pipeline;
|
||||
sdiff(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
sdiff(...args: any[]): Pipeline;
|
||||
sdiffstore(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
sdiffstore(...args: any[]): Pipeline;
|
||||
smembers(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
smembers(...args: any[]): Pipeline;
|
||||
zadd(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
zadd(...args: any[]): Pipeline;
|
||||
zincrby(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
zincrby(...args: any[]): Pipeline;
|
||||
zrem(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
zrem(...args: any[]): Pipeline;
|
||||
zremrangebyscore(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
zremrangebyscore(...args: any[]): Pipeline;
|
||||
zremrangebyrank(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
zremrangebyrank(...args: any[]): Pipeline;
|
||||
zunionstore(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
zunionstore(...args: any[]): Pipeline;
|
||||
zinterstore(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
zinterstore(...args: any[]): Pipeline;
|
||||
zrange(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
zrange(...args: any[]): Pipeline;
|
||||
zrangebyscore(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
zrangebyscore(...args: any[]): Pipeline;
|
||||
zrevrangebyscore(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
zrevrangebyscore(...args: any[]): Pipeline;
|
||||
zcount(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
zcount(...args: any[]): Pipeline;
|
||||
zrevrange(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
zrevrange(...args: any[]): Pipeline;
|
||||
zcard(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
zcard(...args: any[]): Pipeline;
|
||||
zscore(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
zscore(...args: any[]): Pipeline;
|
||||
zrank(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
zrank(...args: any[]): Pipeline;
|
||||
zrevrank(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
zrevrank(...args: any[]): Pipeline;
|
||||
hset(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
hset(...args: any[]): Pipeline;
|
||||
hsetnx(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
hsetnx(...args: any[]): Pipeline;
|
||||
hget(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
hget(...args: any[]): Pipeline;
|
||||
hmset(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
hmset(key: string, hash: any, callback?: ResCallbackT<any>): Pipeline;
|
||||
hmset(...args: any[]): Pipeline;
|
||||
hmget(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
hmget(...args: any[]): Pipeline;
|
||||
hincrby(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
hincrby(...args: any[]): Pipeline;
|
||||
hdel(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
hdel(...args: any[]): Pipeline;
|
||||
hlen(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
hlen(...args: any[]): Pipeline;
|
||||
hkeys(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
hkeys(...args: any[]): Pipeline;
|
||||
hvals(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
hvals(...args: any[]): Pipeline;
|
||||
hgetall(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
hgetall(...args: any[]): Pipeline;
|
||||
hgetall(key: string, callback?: ResCallbackT<any>): Pipeline;
|
||||
hexists(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
hexists(...args: any[]): Pipeline;
|
||||
incrby(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
incrby(...args: any[]): Pipeline;
|
||||
decrby(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
decrby(...args: any[]): Pipeline;
|
||||
getset(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
getset(...args: any[]): Pipeline;
|
||||
mset(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
mset(...args: any[]): Pipeline;
|
||||
msetnx(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
msetnx(...args: any[]): Pipeline;
|
||||
randomkey(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
randomkey(...args: any[]): Pipeline;
|
||||
select(args: any[], callback?: ResCallbackT<any>): void;
|
||||
select(...args: any[]): Pipeline;
|
||||
move(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
move(...args: any[]): Pipeline;
|
||||
rename(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
rename(...args: any[]): Pipeline;
|
||||
renamenx(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
renamenx(...args: any[]): Pipeline;
|
||||
expire(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
expire(...args: any[]): Pipeline;
|
||||
expireat(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
expireat(...args: any[]): Pipeline;
|
||||
keys(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
keys(...args: any[]): Pipeline;
|
||||
dbsize(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
dbsize(...args: any[]): Pipeline;
|
||||
auth(args: any[], callback?: ResCallbackT<any>): void;
|
||||
auth(...args: any[]): void;
|
||||
ping(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
ping(...args: any[]): Pipeline;
|
||||
echo(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
echo(...args: any[]): Pipeline;
|
||||
save(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
save(...args: any[]): Pipeline;
|
||||
bgsave(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
bgsave(...args: any[]): Pipeline;
|
||||
bgrewriteaof(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
bgrewriteaof(...args: any[]): Pipeline;
|
||||
shutdown(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
shutdown(...args: any[]): Pipeline;
|
||||
lastsave(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
lastsave(...args: any[]): Pipeline;
|
||||
type(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
type(...args: any[]): Pipeline;
|
||||
multi(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
multi(...args: any[]): Pipeline;
|
||||
exec(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
exec(...args: any[]): Pipeline;
|
||||
discard(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
discard(...args: any[]): Pipeline;
|
||||
sync(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
sync(...args: any[]): Pipeline;
|
||||
flushdb(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
flushdb(...args: any[]): Pipeline;
|
||||
flushall(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
flushall(...args: any[]): Pipeline;
|
||||
sort(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
sort(...args: any[]): Pipeline;
|
||||
info(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
info(...args: any[]): Pipeline;
|
||||
monitor(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
monitor(...args: any[]): Pipeline;
|
||||
ttl(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
ttl(...args: any[]): Pipeline;
|
||||
persist(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
persist(...args: any[]): Pipeline;
|
||||
slaveof(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
slaveof(...args: any[]): Pipeline;
|
||||
debug(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
debug(...args: any[]): Pipeline;
|
||||
config(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
config(...args: any[]): Pipeline;
|
||||
subscribe(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
subscribe(...args: any[]): Pipeline;
|
||||
unsubscribe(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
unsubscribe(...args: any[]): Pipeline;
|
||||
psubscribe(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
psubscribe(...args: any[]): Pipeline;
|
||||
punsubscribe(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
punsubscribe(...args: any[]): Pipeline;
|
||||
publish(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
publish(...args: any[]): Pipeline;
|
||||
watch(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
watch(...args: any[]): Pipeline;
|
||||
unwatch(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
unwatch(...args: any[]): Pipeline;
|
||||
cluster(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
cluster(...args: any[]): Pipeline;
|
||||
restore(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
restore(...args: any[]): Pipeline;
|
||||
migrate(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
migrate(...args: any[]): Pipeline;
|
||||
dump(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
dump(...args: any[]): Pipeline;
|
||||
object(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
object(...args: any[]): Pipeline;
|
||||
client(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
client(...args: any[]): Pipeline;
|
||||
eval(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
eval(...args: any[]): Pipeline;
|
||||
evalsha(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
evalsha(...args: any[]): Pipeline;
|
||||
quit(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
quit(...args: any[]): Pipeline;
|
||||
scan(...args: any[]): Pipeline;
|
||||
scan(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
hscan(...args: any[]): Pipeline;
|
||||
hscan(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
zscan(...args: any[]): Pipeline;
|
||||
zscan(args: any[], callback?: ResCallbackT<any>): Pipeline;
|
||||
}
|
||||
|
||||
interface Cluster extends NodeJS.EventEmitter, Commander {
|
||||
new (nodes: { host: string; port: number; }[], options?: IORedis.ClusterOptions): Redis;
|
||||
connect(callback: Function): Promise<any>;
|
||||
disconnect(): void;
|
||||
nodes(role: string): Redis[];
|
||||
}
|
||||
|
||||
interface ResCallbackT<R> {
|
||||
(err: Error, res: R): void;
|
||||
}
|
||||
|
||||
interface RedisOptions {
|
||||
port?: number;
|
||||
host?: string;
|
||||
/**
|
||||
* 4 (IPv4) or 6 (IPv6), Defaults to 4.
|
||||
*/
|
||||
family?: number;
|
||||
/**
|
||||
* Local domain socket path. If set the port, host and family will be ignored.
|
||||
*/
|
||||
path?: string;
|
||||
/**
|
||||
* TCP KeepAlive on the socket with a X ms delay before start. Set to a non-number value to disable keepAlive.
|
||||
*/
|
||||
keepAlive?: number;
|
||||
connectionName?: string;
|
||||
/**
|
||||
* If set, client will send AUTH command with the value of this option when connected.
|
||||
*/
|
||||
password?: string;
|
||||
/**
|
||||
* Database index to use.
|
||||
*/
|
||||
db?: number;
|
||||
/**
|
||||
* When a connection is established to the Redis server, the server might still be loading
|
||||
* the database from disk. While loading, the server not respond to any commands.
|
||||
* To work around this, when this option is true, ioredis will check the status of the Redis server,
|
||||
* and when the Redis server is able to process commands, a ready event will be emitted.
|
||||
*/
|
||||
enableReadyCheck?: boolean;
|
||||
keyPrefix?: string;
|
||||
retryStrategy?: (times: number) => number;
|
||||
reconnectOnError?: (error: Error) => boolean;
|
||||
/**
|
||||
* By default, if there is no active connection to the Redis server, commands are added to a queue
|
||||
* and are executed once the connection is "ready" (when enableReadyCheck is true, "ready" means
|
||||
* the Redis server has loaded the database from disk, otherwise means the connection to the Redis
|
||||
* server has been established). If this option is false, when execute the command when the connection
|
||||
* isn't ready, an error will be returned.
|
||||
*/
|
||||
enableOfflineQueue?: boolean;
|
||||
/**
|
||||
* The milliseconds before a timeout occurs during the initial connection to the Redis server.
|
||||
* default: 10000.
|
||||
*/
|
||||
connectTimeout?: number;
|
||||
/**
|
||||
* After reconnected, if the previous connection was in the subscriber mode, client will auto re-subscribe these channels.
|
||||
* default: true.
|
||||
*/
|
||||
autoResubscribe?: boolean;
|
||||
/**
|
||||
* If true, client will resend unfulfilled commands(e.g. block commands) in the previous connection when reconnected.
|
||||
* default: true.
|
||||
*/
|
||||
autoResendUnfulfilledCommands?: boolean;
|
||||
lazyConnect?: boolean;
|
||||
tls?: {
|
||||
ca: Buffer;
|
||||
};
|
||||
sentinels?: { host: string; port: number; }[];
|
||||
name?: string;
|
||||
/**
|
||||
* Enable READONLY mode for the connection. Only available for cluster mode.
|
||||
* default: false.
|
||||
*/
|
||||
readOnly?: boolean;
|
||||
}
|
||||
|
||||
interface ScanStreamOption {
|
||||
match?: string;
|
||||
count?: number;
|
||||
}
|
||||
|
||||
interface ClusterOptions {
|
||||
clusterRetryStrategy?: (times: number) => number;
|
||||
enableOfflineQueue?: boolean;
|
||||
enableReadyCheck?: boolean;
|
||||
scaleReads?: string;
|
||||
maxRedirections?: number;
|
||||
retryDelayOnFailover?: number;
|
||||
retryDelayOnClusterDown?: number;
|
||||
retryDelayOnTryAgain?: number;
|
||||
redisOptions?: RedisOptions;
|
||||
}
|
||||
}
|
||||
@@ -747,31 +747,31 @@ describe("Manually ticking the Jasmine Clock", function () {
|
||||
|
||||
describe("Asynchronous specs", function () {
|
||||
var value: number;
|
||||
beforeEach(function (done) {
|
||||
beforeEach(function (done: DoneFn) {
|
||||
setTimeout(function () {
|
||||
value = 0;
|
||||
done();
|
||||
}, 1);
|
||||
});
|
||||
|
||||
it("should support async execution of test preparation and expectations", function (done) {
|
||||
it("should support async execution of test preparation and expectations", function (done: DoneFn) {
|
||||
value++;
|
||||
expect(value).toBeGreaterThan(0);
|
||||
done();
|
||||
});
|
||||
|
||||
describe("long asynchronous specs", function() {
|
||||
beforeEach(function(done) {
|
||||
beforeEach(function(done: DoneFn) {
|
||||
done();
|
||||
}, 1000);
|
||||
|
||||
it("takes a long time", function(done) {
|
||||
it("takes a long time", function(done: DoneFn) {
|
||||
setTimeout(function() {
|
||||
done();
|
||||
}, 9000);
|
||||
}, 10000);
|
||||
|
||||
afterEach(function(done) {
|
||||
afterEach(function(done: DoneFn) {
|
||||
done();
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
Vendored
+14
-7
@@ -11,29 +11,36 @@ declare function fdescribe(description: string, specDefinitions: () => void): vo
|
||||
declare function xdescribe(description: string, specDefinitions: () => void): void;
|
||||
|
||||
declare function it(expectation: string, assertion?: () => void, timeout?: number): void;
|
||||
declare function it(expectation: string, assertion?: (done: () => void) => void, timeout?: number): void;
|
||||
declare function it(expectation: string, assertion?: (done: DoneFn) => void, timeout?: number): void;
|
||||
declare function fit(expectation: string, assertion?: () => void, timeout?: number): void;
|
||||
declare function fit(expectation: string, assertion?: (done: () => void) => void, timeout?: number): void;
|
||||
declare function fit(expectation: string, assertion?: (done: DoneFn) => void, timeout?: number): void;
|
||||
declare function xit(expectation: string, assertion?: () => void, timeout?: number): void;
|
||||
declare function xit(expectation: string, assertion?: (done: () => void) => void, timeout?: number): void;
|
||||
declare function xit(expectation: string, assertion?: (done: DoneFn) => void, timeout?: number): void;
|
||||
|
||||
/** If you call the function pending anywhere in the spec body, no matter the expectations, the spec will be marked pending. */
|
||||
declare function pending(reason?: string): void;
|
||||
|
||||
declare function beforeEach(action: () => void, timeout?: number): void;
|
||||
declare function beforeEach(action: (done: () => void) => void, timeout?: number): void;
|
||||
declare function beforeEach(action: (done: DoneFn) => void, timeout?: number): void;
|
||||
declare function afterEach(action: () => void, timeout?: number): void;
|
||||
declare function afterEach(action: (done: () => void) => void, timeout?: number): void;
|
||||
declare function afterEach(action: (done: DoneFn) => void, timeout?: number): void;
|
||||
|
||||
declare function beforeAll(action: () => void, timeout?: number): void;
|
||||
declare function beforeAll(action: (done: () => void) => void, timeout?: number): void;
|
||||
declare function beforeAll(action: (done: DoneFn) => void, timeout?: number): void;
|
||||
declare function afterAll(action: () => void, timeout?: number): void;
|
||||
declare function afterAll(action: (done: () => void) => void, timeout?: number): void;
|
||||
declare function afterAll(action: (done: DoneFn) => void, timeout?: number): void;
|
||||
|
||||
declare function expect(spy: Function): jasmine.Matchers;
|
||||
declare function expect(actual: any): jasmine.Matchers;
|
||||
|
||||
declare function fail(e?: any): void;
|
||||
/** Action method that should be called when the async work is complete */
|
||||
interface DoneFn extends Function {
|
||||
(): void;
|
||||
|
||||
/** fails the spec and indicates that it has completed. If the message is an Error, Error.message is used */
|
||||
fail: (message?: Error|string) => void;
|
||||
}
|
||||
|
||||
declare function spyOn(object: any, method: string): jasmine.Spy;
|
||||
|
||||
|
||||
Vendored
+4
@@ -29,4 +29,8 @@ interface String {
|
||||
md5(value: Uint8Array): string;
|
||||
}
|
||||
|
||||
declare module "js-md5" {
|
||||
export = md5;
|
||||
}
|
||||
|
||||
declare var md5: md5;
|
||||
|
||||
Vendored
+431
-6
@@ -262,8 +262,10 @@ declare namespace kendo {
|
||||
static fn: Observable;
|
||||
static extend(prototype: Object): Observable;
|
||||
|
||||
init(...args: any[]): void
|
||||
bind(eventName: string, handler: Function): Observable;
|
||||
one(eventName: string, handler: Function): Observable;
|
||||
first(eventName: string, handler: Function): Observable;
|
||||
trigger(eventName: string, e?: any): boolean;
|
||||
unbind(eventName: string, handler?: any): Observable;
|
||||
}
|
||||
@@ -1074,6 +1076,31 @@ declare namespace kendo.data {
|
||||
view(): kendo.data.ObservableArray;
|
||||
}
|
||||
|
||||
class Query {
|
||||
data: any[];
|
||||
|
||||
static process(data: any[], options: DataSourceTransportReadOptionsData): QueryResult;
|
||||
|
||||
constructor(data: any[]);
|
||||
toArray(): any[];
|
||||
range(intex: number, count: number): kendo.data.Query;
|
||||
skip(count: number): kendo.data.Query;
|
||||
take(count: number): kendo.data.Query;
|
||||
select(selector: Function): kendo.data.Query;
|
||||
order(selector: string, dir?: string): kendo.data.Query;
|
||||
order(selector: Function, dir?: string): kendo.data.Query;
|
||||
filter(filters: DataSourceFilterItem): kendo.data.Query;
|
||||
filter(filters: DataSourceFilterItem[]): kendo.data.Query;
|
||||
filter(filters: DataSourceFilters): kendo.data.Query;
|
||||
group(descriptors: DataSourceGroupItem): kendo.data.Query;
|
||||
group(descriptors: DataSourceGroupItem[]): kendo.data.Query;
|
||||
}
|
||||
|
||||
interface QueryResult {
|
||||
total?: number;
|
||||
data?: any[];
|
||||
}
|
||||
|
||||
interface DataSourceAggregateItem {
|
||||
field?: string;
|
||||
aggregate?: string;
|
||||
@@ -4209,6 +4236,7 @@ declare namespace kendo.ui {
|
||||
dataSource?: any|any|kendo.data.DataSource;
|
||||
checkAll?: boolean;
|
||||
itemTemplate?: Function;
|
||||
operators?: any;
|
||||
search?: boolean;
|
||||
ignoreCase?: boolean;
|
||||
ui?: string|Function;
|
||||
@@ -5554,9 +5582,11 @@ declare namespace kendo.ui {
|
||||
|
||||
interface PopupOptions {
|
||||
name?: string;
|
||||
adjustSize?: any;
|
||||
animation?: PopupAnimation;
|
||||
anchor?: string|JQuery;
|
||||
appendTo?: string|JQuery;
|
||||
collision?: string;
|
||||
origin?: string;
|
||||
position?: string;
|
||||
activate?(e: PopupActivateEvent): void;
|
||||
@@ -6677,6 +6707,9 @@ declare namespace kendo.ui {
|
||||
enable(element: string, enable?: boolean): kendo.ui.TabStrip;
|
||||
enable(element: Element, enable?: boolean): kendo.ui.TabStrip;
|
||||
enable(element: JQuery, enable?: boolean): kendo.ui.TabStrip;
|
||||
insertAfter(item: any, referenceTab: string): kendo.ui.TabStrip;
|
||||
insertAfter(item: any, referenceTab: Element): kendo.ui.TabStrip;
|
||||
insertAfter(item: any, referenceTab: JQuery): kendo.ui.TabStrip;
|
||||
insertAfter(item: string, referenceTab: string): kendo.ui.TabStrip;
|
||||
insertAfter(item: string, referenceTab: Element): kendo.ui.TabStrip;
|
||||
insertAfter(item: string, referenceTab: JQuery): kendo.ui.TabStrip;
|
||||
@@ -6686,6 +6719,9 @@ declare namespace kendo.ui {
|
||||
insertAfter(item: JQuery, referenceTab: string): kendo.ui.TabStrip;
|
||||
insertAfter(item: JQuery, referenceTab: Element): kendo.ui.TabStrip;
|
||||
insertAfter(item: JQuery, referenceTab: JQuery): kendo.ui.TabStrip;
|
||||
insertBefore(item: any, referenceTab: string): kendo.ui.TabStrip;
|
||||
insertBefore(item: any, referenceTab: Element): kendo.ui.TabStrip;
|
||||
insertBefore(item: any, referenceTab: JQuery): kendo.ui.TabStrip;
|
||||
insertBefore(item: string, referenceTab: string): kendo.ui.TabStrip;
|
||||
insertBefore(item: string, referenceTab: Element): kendo.ui.TabStrip;
|
||||
insertBefore(item: string, referenceTab: JQuery): kendo.ui.TabStrip;
|
||||
@@ -7213,7 +7249,9 @@ declare namespace kendo.ui {
|
||||
dataItem(row: JQuery): kendo.data.TreeListModel;
|
||||
destroy(): void;
|
||||
editRow(row: JQuery): void;
|
||||
expand(): void;
|
||||
expand(row: string): void;
|
||||
expand(row: Element): void;
|
||||
expand(row: JQuery): void;
|
||||
itemFor(model: kendo.data.TreeListModel): JQuery;
|
||||
itemFor(model: any): JQuery;
|
||||
items(): any;
|
||||
@@ -7930,6 +7968,7 @@ declare namespace kendo.ui {
|
||||
|
||||
interface WindowRefreshOptions {
|
||||
url?: string;
|
||||
cache?: boolean;
|
||||
data?: any;
|
||||
type?: string;
|
||||
template?: string;
|
||||
@@ -7945,6 +7984,7 @@ declare namespace kendo.ui {
|
||||
content?: WindowContent;
|
||||
draggable?: boolean;
|
||||
iframe?: boolean;
|
||||
height?: number|string;
|
||||
maxHeight?: number;
|
||||
maxWidth?: number;
|
||||
minHeight?: number;
|
||||
@@ -7957,7 +7997,6 @@ declare namespace kendo.ui {
|
||||
title?: string|boolean;
|
||||
visible?: boolean;
|
||||
width?: number|string;
|
||||
height?: number|string;
|
||||
activate?(e: WindowEvent): void;
|
||||
close?(e: WindowCloseEvent): void;
|
||||
deactivate?(e: WindowEvent): void;
|
||||
@@ -8107,6 +8146,174 @@ declare namespace kendo.dataviz.ui {
|
||||
|
||||
}
|
||||
|
||||
interface ChartAxisDefaultsCrosshairTooltipBorder {
|
||||
color?: string;
|
||||
dashType?: string;
|
||||
width?: number;
|
||||
}
|
||||
|
||||
interface ChartAxisDefaultsCrosshairTooltipPadding {
|
||||
bottom?: number;
|
||||
left?: number;
|
||||
right?: number;
|
||||
top?: number;
|
||||
}
|
||||
|
||||
interface ChartAxisDefaultsCrosshairTooltip {
|
||||
background?: string;
|
||||
border?: ChartAxisDefaultsCrosshairTooltipBorder;
|
||||
color?: string;
|
||||
font?: string;
|
||||
format?: string;
|
||||
padding?: ChartAxisDefaultsCrosshairTooltipPadding;
|
||||
template?: string|Function;
|
||||
visible?: boolean;
|
||||
}
|
||||
|
||||
interface ChartAxisDefaultsCrosshair {
|
||||
color?: string;
|
||||
opacity?: number;
|
||||
tooltip?: ChartAxisDefaultsCrosshairTooltip;
|
||||
visible?: boolean;
|
||||
width?: number;
|
||||
}
|
||||
|
||||
interface ChartAxisDefaultsLabelsMargin {
|
||||
bottom?: number;
|
||||
left?: number;
|
||||
right?: number;
|
||||
top?: number;
|
||||
}
|
||||
|
||||
interface ChartAxisDefaultsLabelsPadding {
|
||||
bottom?: number;
|
||||
left?: number;
|
||||
right?: number;
|
||||
top?: number;
|
||||
}
|
||||
|
||||
interface ChartAxisDefaultsLabelsRotation {
|
||||
align?: string;
|
||||
angle?: number|string;
|
||||
}
|
||||
|
||||
interface ChartAxisDefaultsLabels {
|
||||
font?: string;
|
||||
format?: string;
|
||||
margin?: ChartAxisDefaultsLabelsMargin;
|
||||
mirror?: boolean;
|
||||
padding?: ChartAxisDefaultsLabelsPadding;
|
||||
rotation?: ChartAxisDefaultsLabelsRotation;
|
||||
skip?: number;
|
||||
step?: number;
|
||||
template?: string|Function;
|
||||
visible?: boolean;
|
||||
visual?: Function;
|
||||
}
|
||||
|
||||
interface ChartAxisDefaultsLine {
|
||||
color?: string;
|
||||
dashType?: string;
|
||||
visible?: boolean;
|
||||
width?: number;
|
||||
}
|
||||
|
||||
interface ChartAxisDefaultsMajorGridLines {
|
||||
color?: string;
|
||||
dashType?: string;
|
||||
visible?: boolean;
|
||||
width?: number;
|
||||
step?: number;
|
||||
skip?: number;
|
||||
}
|
||||
|
||||
interface ChartAxisDefaultsMajorTicks {
|
||||
color?: string;
|
||||
size?: number;
|
||||
visible?: boolean;
|
||||
width?: number;
|
||||
step?: number;
|
||||
skip?: number;
|
||||
}
|
||||
|
||||
interface ChartAxisDefaultsMinorGridLines {
|
||||
color?: string;
|
||||
dashType?: string;
|
||||
visible?: boolean;
|
||||
width?: number;
|
||||
step?: number;
|
||||
skip?: number;
|
||||
}
|
||||
|
||||
interface ChartAxisDefaultsMinorTicks {
|
||||
color?: string;
|
||||
size?: number;
|
||||
visible?: boolean;
|
||||
width?: number;
|
||||
step?: number;
|
||||
skip?: number;
|
||||
}
|
||||
|
||||
interface ChartAxisDefaultsPlotBand {
|
||||
color?: string;
|
||||
from?: number;
|
||||
opacity?: number;
|
||||
to?: number;
|
||||
}
|
||||
|
||||
interface ChartAxisDefaultsTitleBorder {
|
||||
color?: string;
|
||||
dashType?: string;
|
||||
width?: number;
|
||||
}
|
||||
|
||||
interface ChartAxisDefaultsTitleMargin {
|
||||
bottom?: number;
|
||||
left?: number;
|
||||
right?: number;
|
||||
top?: number;
|
||||
}
|
||||
|
||||
interface ChartAxisDefaultsTitlePadding {
|
||||
bottom?: number;
|
||||
left?: number;
|
||||
right?: number;
|
||||
top?: number;
|
||||
}
|
||||
|
||||
interface ChartAxisDefaultsTitle {
|
||||
background?: string;
|
||||
border?: ChartAxisDefaultsTitleBorder;
|
||||
color?: string;
|
||||
font?: string;
|
||||
margin?: ChartAxisDefaultsTitleMargin;
|
||||
padding?: ChartAxisDefaultsTitlePadding;
|
||||
position?: string;
|
||||
rotation?: number;
|
||||
text?: string;
|
||||
visible?: boolean;
|
||||
visual?: Function;
|
||||
}
|
||||
|
||||
interface ChartAxisDefaults {
|
||||
background?: string;
|
||||
color?: string;
|
||||
crosshair?: ChartAxisDefaultsCrosshair;
|
||||
labels?: ChartAxisDefaultsLabels;
|
||||
line?: ChartAxisDefaultsLine;
|
||||
majorGridLines?: ChartAxisDefaultsMajorGridLines;
|
||||
majorTicks?: ChartAxisDefaultsMajorTicks;
|
||||
minorGridLines?: ChartAxisDefaultsMinorGridLines;
|
||||
minorTicks?: ChartAxisDefaultsMinorTicks;
|
||||
narrowRange?: boolean;
|
||||
pane?: string;
|
||||
plotBands?: ChartAxisDefaultsPlotBand[];
|
||||
reverse?: boolean;
|
||||
startAngle?: number;
|
||||
title?: ChartAxisDefaultsTitle;
|
||||
visible?: boolean;
|
||||
}
|
||||
|
||||
interface ChartCategoryAxisItemAutoBaseUnitSteps {
|
||||
seconds?: any;
|
||||
minutes?: any;
|
||||
@@ -9280,6 +9487,7 @@ declare namespace kendo.dataviz.ui {
|
||||
color?: string;
|
||||
font?: string;
|
||||
format?: string;
|
||||
opacity?: number;
|
||||
padding?: ChartTooltipPadding;
|
||||
shared?: boolean;
|
||||
sharedTemplate?: string|Function;
|
||||
@@ -10183,7 +10391,7 @@ declare namespace kendo.dataviz.ui {
|
||||
interface ChartOptions {
|
||||
name?: string;
|
||||
autoBind?: boolean;
|
||||
axisDefaults?: any;
|
||||
axisDefaults?: ChartAxisDefaults;
|
||||
categoryAxis?: ChartCategoryAxisItem[];
|
||||
chartArea?: ChartChartArea;
|
||||
dataSource?: any|any|kendo.data.DataSource;
|
||||
@@ -10363,9 +10571,9 @@ declare namespace kendo.dataviz.ui {
|
||||
options: DiagramOptions;
|
||||
|
||||
dataSource: kendo.data.DataSource;
|
||||
connections: kendo.dataviz.diagram.Connection[];
|
||||
connections: DiagramConnection[];
|
||||
connectionsDataSource: kendo.data.DataSource;
|
||||
shapes: kendo.dataviz.diagram.Shape[];
|
||||
shapes: DiagramShape[];
|
||||
|
||||
element: JQuery;
|
||||
wrapper: JQuery;
|
||||
@@ -10432,6 +10640,9 @@ declare namespace kendo.dataviz.ui {
|
||||
}
|
||||
|
||||
interface DiagramConnectionDefaultsContent {
|
||||
color?: string;
|
||||
fontFamily?: string;
|
||||
fontSize?: number;
|
||||
template?: string|Function;
|
||||
text?: string;
|
||||
visual?: Function;
|
||||
@@ -10526,6 +10737,9 @@ declare namespace kendo.dataviz.ui {
|
||||
}
|
||||
|
||||
interface DiagramConnectionContent {
|
||||
color?: string;
|
||||
fontFamily?: string;
|
||||
fontSize?: number;
|
||||
template?: string|Function;
|
||||
text?: string;
|
||||
visual?: Function;
|
||||
@@ -10776,9 +10990,76 @@ declare namespace kendo.dataviz.ui {
|
||||
stroke?: DiagramSelectableStroke;
|
||||
}
|
||||
|
||||
interface DiagramShapeDefaultsConnectorDefaultsFill {
|
||||
color?: string;
|
||||
opacity?: number;
|
||||
}
|
||||
|
||||
interface DiagramShapeDefaultsConnectorDefaultsHoverFill {
|
||||
color?: string;
|
||||
opacity?: number;
|
||||
}
|
||||
|
||||
interface DiagramShapeDefaultsConnectorDefaultsHoverStroke {
|
||||
color?: string;
|
||||
dashType?: string;
|
||||
width?: number;
|
||||
}
|
||||
|
||||
interface DiagramShapeDefaultsConnectorDefaultsHover {
|
||||
fill?: DiagramShapeDefaultsConnectorDefaultsHoverFill;
|
||||
stroke?: DiagramShapeDefaultsConnectorDefaultsHoverStroke;
|
||||
}
|
||||
|
||||
interface DiagramShapeDefaultsConnectorDefaultsStroke {
|
||||
color?: string;
|
||||
dashType?: string;
|
||||
width?: number;
|
||||
}
|
||||
|
||||
interface DiagramShapeDefaultsConnectorDefaults {
|
||||
width?: number;
|
||||
height?: number;
|
||||
hover?: DiagramShapeDefaultsConnectorDefaultsHover;
|
||||
fill?: DiagramShapeDefaultsConnectorDefaultsFill;
|
||||
stroke?: DiagramShapeDefaultsConnectorDefaultsStroke;
|
||||
}
|
||||
|
||||
interface DiagramShapeDefaultsConnectorFill {
|
||||
color?: string;
|
||||
opacity?: number;
|
||||
}
|
||||
|
||||
interface DiagramShapeDefaultsConnectorHoverFill {
|
||||
color?: string;
|
||||
opacity?: number;
|
||||
}
|
||||
|
||||
interface DiagramShapeDefaultsConnectorHoverStroke {
|
||||
color?: string;
|
||||
dashType?: string;
|
||||
width?: number;
|
||||
}
|
||||
|
||||
interface DiagramShapeDefaultsConnectorHover {
|
||||
fill?: DiagramShapeDefaultsConnectorHoverFill;
|
||||
stroke?: DiagramShapeDefaultsConnectorHoverStroke;
|
||||
}
|
||||
|
||||
interface DiagramShapeDefaultsConnectorStroke {
|
||||
color?: string;
|
||||
dashType?: string;
|
||||
width?: number;
|
||||
}
|
||||
|
||||
interface DiagramShapeDefaultsConnector {
|
||||
name?: string;
|
||||
position?: Function;
|
||||
width?: number;
|
||||
height?: number;
|
||||
hover?: DiagramShapeDefaultsConnectorHover;
|
||||
fill?: DiagramShapeDefaultsConnectorFill;
|
||||
stroke?: DiagramShapeDefaultsConnectorStroke;
|
||||
}
|
||||
|
||||
interface DiagramShapeDefaultsContent {
|
||||
@@ -10844,6 +11125,7 @@ declare namespace kendo.dataviz.ui {
|
||||
|
||||
interface DiagramShapeDefaults {
|
||||
connectors?: DiagramShapeDefaultsConnector[];
|
||||
connectorDefaults?: DiagramShapeDefaultsConnectorDefaults;
|
||||
content?: DiagramShapeDefaultsContent;
|
||||
editable?: DiagramShapeDefaultsEditable;
|
||||
fill?: DiagramShapeDefaultsFill;
|
||||
@@ -10863,10 +11145,77 @@ declare namespace kendo.dataviz.ui {
|
||||
y?: number;
|
||||
}
|
||||
|
||||
interface DiagramShapeConnectorDefaultsFill {
|
||||
color?: string;
|
||||
opacity?: number;
|
||||
}
|
||||
|
||||
interface DiagramShapeConnectorDefaultsHoverFill {
|
||||
color?: string;
|
||||
opacity?: number;
|
||||
}
|
||||
|
||||
interface DiagramShapeConnectorDefaultsHoverStroke {
|
||||
color?: string;
|
||||
dashType?: string;
|
||||
width?: number;
|
||||
}
|
||||
|
||||
interface DiagramShapeConnectorDefaultsHover {
|
||||
fill?: DiagramShapeConnectorDefaultsHoverFill;
|
||||
stroke?: DiagramShapeConnectorDefaultsHoverStroke;
|
||||
}
|
||||
|
||||
interface DiagramShapeConnectorDefaultsStroke {
|
||||
color?: string;
|
||||
dashType?: string;
|
||||
width?: number;
|
||||
}
|
||||
|
||||
interface DiagramShapeConnectorDefaults {
|
||||
width?: number;
|
||||
height?: number;
|
||||
hover?: DiagramShapeConnectorDefaultsHover;
|
||||
fill?: DiagramShapeConnectorDefaultsFill;
|
||||
stroke?: DiagramShapeConnectorDefaultsStroke;
|
||||
}
|
||||
|
||||
interface DiagramShapeConnectorFill {
|
||||
color?: string;
|
||||
opacity?: number;
|
||||
}
|
||||
|
||||
interface DiagramShapeConnectorHoverFill {
|
||||
color?: string;
|
||||
opacity?: number;
|
||||
}
|
||||
|
||||
interface DiagramShapeConnectorHoverStroke {
|
||||
color?: string;
|
||||
dashType?: string;
|
||||
width?: number;
|
||||
}
|
||||
|
||||
interface DiagramShapeConnectorHover {
|
||||
fill?: DiagramShapeConnectorHoverFill;
|
||||
stroke?: DiagramShapeConnectorHoverStroke;
|
||||
}
|
||||
|
||||
interface DiagramShapeConnectorStroke {
|
||||
color?: string;
|
||||
dashType?: string;
|
||||
width?: number;
|
||||
}
|
||||
|
||||
interface DiagramShapeConnector {
|
||||
description?: string;
|
||||
name?: string;
|
||||
position?: Function;
|
||||
width?: number;
|
||||
height?: number;
|
||||
hover?: DiagramShapeConnectorHover;
|
||||
fill?: DiagramShapeConnectorFill;
|
||||
stroke?: DiagramShapeConnectorStroke;
|
||||
}
|
||||
|
||||
interface DiagramShapeContent {
|
||||
@@ -10930,6 +11279,7 @@ declare namespace kendo.dataviz.ui {
|
||||
|
||||
interface DiagramShape {
|
||||
connectors?: DiagramShapeConnector[];
|
||||
connectorDefaults?: DiagramShapeConnectorDefaults;
|
||||
content?: DiagramShapeContent;
|
||||
editable?: DiagramShapeEditable;
|
||||
fill?: DiagramShapeFill;
|
||||
@@ -10999,6 +11349,7 @@ declare namespace kendo.dataviz.ui {
|
||||
remove?(e: DiagramRemoveEvent): void;
|
||||
save?(e: DiagramSaveEvent): void;
|
||||
select?(e: DiagramSelectEvent): void;
|
||||
toolBarClick?(e: DiagramToolBarClickEvent): void;
|
||||
zoomEnd?(e: DiagramZoomEndEvent): void;
|
||||
zoomStart?(e: DiagramZoomStartEvent): void;
|
||||
}
|
||||
@@ -11091,6 +11442,13 @@ declare namespace kendo.dataviz.ui {
|
||||
deselected?: any;
|
||||
}
|
||||
|
||||
interface DiagramToolBarClickEvent extends DiagramEvent {
|
||||
action?: string;
|
||||
shapes?: any;
|
||||
connections?: any;
|
||||
target?: JQuery;
|
||||
}
|
||||
|
||||
interface DiagramZoomEndEvent extends DiagramEvent {
|
||||
point?: kendo.dataviz.diagram.Point;
|
||||
zoom?: number;
|
||||
@@ -14924,6 +15282,9 @@ declare namespace kendo.dataviz.diagram {
|
||||
}
|
||||
|
||||
interface ConnectionContent {
|
||||
color?: string;
|
||||
fontFamily?: string;
|
||||
fontSize?: number;
|
||||
template?: string|Function;
|
||||
text?: string;
|
||||
visual?: Function;
|
||||
@@ -15022,11 +15383,35 @@ declare namespace kendo.dataviz.diagram {
|
||||
opacity?: number;
|
||||
}
|
||||
|
||||
interface ConnectorHoverFill {
|
||||
color?: string;
|
||||
opacity?: number;
|
||||
}
|
||||
|
||||
interface ConnectorHoverStroke {
|
||||
color?: string;
|
||||
dashType?: string;
|
||||
width?: number;
|
||||
}
|
||||
|
||||
interface ConnectorHover {
|
||||
fill?: ConnectorHoverFill;
|
||||
stroke?: ConnectorHoverStroke;
|
||||
}
|
||||
|
||||
interface ConnectorStroke {
|
||||
color?: string;
|
||||
dashType?: string;
|
||||
width?: number;
|
||||
}
|
||||
|
||||
interface ConnectorOptions {
|
||||
name?: string;
|
||||
width?: number;
|
||||
height?: number;
|
||||
hover?: ConnectorHover;
|
||||
fill?: ConnectorFill;
|
||||
stroke?: ConnectorStroke;
|
||||
}
|
||||
interface ConnectorEvent {
|
||||
sender: Connector;
|
||||
@@ -15491,6 +15876,41 @@ declare namespace kendo.dataviz.diagram {
|
||||
|
||||
}
|
||||
|
||||
interface ShapeConnectorDefaultsFill {
|
||||
color?: string;
|
||||
opacity?: number;
|
||||
}
|
||||
|
||||
interface ShapeConnectorDefaultsHoverFill {
|
||||
color?: string;
|
||||
opacity?: number;
|
||||
}
|
||||
|
||||
interface ShapeConnectorDefaultsHoverStroke {
|
||||
color?: string;
|
||||
dashType?: string;
|
||||
width?: number;
|
||||
}
|
||||
|
||||
interface ShapeConnectorDefaultsHover {
|
||||
fill?: ShapeConnectorDefaultsHoverFill;
|
||||
stroke?: ShapeConnectorDefaultsHoverStroke;
|
||||
}
|
||||
|
||||
interface ShapeConnectorDefaultsStroke {
|
||||
color?: string;
|
||||
dashType?: string;
|
||||
width?: number;
|
||||
}
|
||||
|
||||
interface ShapeConnectorDefaults {
|
||||
width?: number;
|
||||
height?: number;
|
||||
hover?: ShapeConnectorDefaultsHover;
|
||||
fill?: ShapeConnectorDefaultsFill;
|
||||
stroke?: ShapeConnectorDefaultsStroke;
|
||||
}
|
||||
|
||||
interface ShapeConnector {
|
||||
name?: string;
|
||||
description?: string;
|
||||
@@ -15498,8 +15918,11 @@ declare namespace kendo.dataviz.diagram {
|
||||
}
|
||||
|
||||
interface ShapeContent {
|
||||
text?: string;
|
||||
align?: string;
|
||||
color?: string;
|
||||
fontFamily?: string;
|
||||
fontSize?: number;
|
||||
text?: string;
|
||||
}
|
||||
|
||||
interface ShapeEditable {
|
||||
@@ -15566,6 +15989,7 @@ declare namespace kendo.dataviz.diagram {
|
||||
content?: ShapeContent;
|
||||
selectable?: boolean;
|
||||
visual?: Function;
|
||||
connectorDefaults?: ShapeConnectorDefaults;
|
||||
}
|
||||
interface ShapeEvent {
|
||||
sender: Shape;
|
||||
@@ -15859,6 +16283,7 @@ declare namespace kendo.spreadsheet {
|
||||
showGridLines(): boolean;
|
||||
showGridLines(showGridLiens?: boolean): void;
|
||||
toJSON(): void;
|
||||
setDataSource(dataSource: kendo.data.DataSource, columns?: any): void;
|
||||
unhideColumn(index: number): void;
|
||||
unhideRow(index: number): void;
|
||||
|
||||
|
||||
Vendored
+10
@@ -535,6 +535,16 @@ interface KnockoutStatic {
|
||||
};
|
||||
|
||||
components: KnockoutComponents;
|
||||
|
||||
/////////////////////////////////
|
||||
// options.js
|
||||
/////////////////////////////////
|
||||
|
||||
options: {
|
||||
deferUpdates: boolean,
|
||||
|
||||
useOnlyNativeEvents: boolean
|
||||
}
|
||||
}
|
||||
|
||||
interface KnockoutBindingProvider {
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
/// <reference path="../koa/koa.d.ts" />
|
||||
/// <reference path="koa-json.d.ts" />
|
||||
|
||||
import * as Koa from "koa";
|
||||
import * as json from 'koa-json';
|
||||
|
||||
const app = new Koa();
|
||||
|
||||
app.use(json({
|
||||
pretty: false,
|
||||
param: 'pretty',
|
||||
spaces: 2
|
||||
}));
|
||||
|
||||
app.listen(80)
|
||||
Vendored
+40
@@ -0,0 +1,40 @@
|
||||
// Type definitions for koa-json v2.x
|
||||
// Project: https://github.com/koajs/json
|
||||
// Definitions by: Alex Friedman <https://github.com/brooklyndev/>
|
||||
// Definitions: https://github.com/brooklyndev/DefinitelyTyped
|
||||
|
||||
/* =================== USAGE ===================
|
||||
|
||||
import * as Koa from 'koa';
|
||||
import * as json from 'koa-json';
|
||||
|
||||
const app = new Koa();
|
||||
app.use(json());
|
||||
|
||||
=============================================== */
|
||||
/// <reference path="../koa/koa.d.ts" />
|
||||
|
||||
declare module "koa-json" {
|
||||
|
||||
import * as Koa from "koa";
|
||||
|
||||
function json(opts?:{
|
||||
|
||||
/**
|
||||
* default to pretty response [true]
|
||||
*/
|
||||
pretty?: boolean,
|
||||
|
||||
/**
|
||||
* optional query-string param for pretty responses [none]
|
||||
*/
|
||||
param?: string,
|
||||
|
||||
/**
|
||||
* JSON spaces [2]
|
||||
*/
|
||||
spaces?: number
|
||||
}) : { (ctx: Koa.Context, next?: () => any): any } ;
|
||||
namespace json {}
|
||||
export = json;
|
||||
}
|
||||
Vendored
+5
@@ -3383,6 +3383,11 @@ declare namespace L {
|
||||
*/
|
||||
className?: string;
|
||||
|
||||
/**
|
||||
* Sets the radius of a circle marker.
|
||||
*/
|
||||
radius?: number;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,11 @@ log.setLevel("error", false);
|
||||
log.setLevel(LogLevel.WARN);
|
||||
log.setLevel(LogLevel.WARN, false);
|
||||
|
||||
log.enableAll(false);
|
||||
log.enableAll();
|
||||
log.disableAll(true);
|
||||
log.disableAll();
|
||||
|
||||
var logLevel = log.getLevel();
|
||||
|
||||
var testLogger = log.getLogger("TestLogger");
|
||||
@@ -26,3 +31,8 @@ testLogger.warn("logging test");
|
||||
var logging = log.noConflict();
|
||||
|
||||
logging.error("still pretty easy");
|
||||
|
||||
log.methodFactory = function(methodName: string, level: LogLevel, loggerName :string) {
|
||||
return function(...messages: any[]) {
|
||||
};
|
||||
};
|
||||
Vendored
+39
-1
@@ -1,6 +1,6 @@
|
||||
// Type definitions for loglevel 1.4.0
|
||||
// Project: https://github.com/pimterry/loglevel
|
||||
// Definitions by: Stefan Profanter <https://github.com/Pro/>, Florian Wagner <https://github.com/flqw/>
|
||||
// Definitions by: Stefan Profanter <https://github.com/Pro/>, Florian Wagner <https://github.com/flqw/>, Gabor Szmetanko <https://github.com/szmeti/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/**
|
||||
@@ -15,8 +15,28 @@ declare const enum LogLevel {
|
||||
SILENT = 5
|
||||
}
|
||||
|
||||
interface LoggingMethod {
|
||||
|
||||
(...message : any[]):void;
|
||||
|
||||
}
|
||||
|
||||
interface MethodFactory {
|
||||
|
||||
(methodName : string, level : LogLevel, loggerName : string):LoggingMethod;
|
||||
|
||||
}
|
||||
|
||||
interface Log {
|
||||
|
||||
/**
|
||||
* Plugin API entry point. This will be called for each enabled method each time the level is set
|
||||
* (including initially), and should return a MethodFactory to be used for the given log method, at the given level,
|
||||
* for a logger with the given name. If you'd like to retain all the reliability and features of loglevel, it's
|
||||
* recommended that this wraps the initially provided value of log.methodFactory
|
||||
*/
|
||||
methodFactory:MethodFactory;
|
||||
|
||||
/**
|
||||
* Output trace message to console.
|
||||
* This will also include a full stack trace
|
||||
@@ -135,6 +155,24 @@ interface Log {
|
||||
*/
|
||||
getLogger(name : String):Log;
|
||||
|
||||
/**
|
||||
* This enables all log messages, and is equivalent to log.setLevel("trace").
|
||||
*
|
||||
* @param persist Where possible the log level will be persisted. LocalStorage will be used if available, falling
|
||||
* back to cookies if not. If neither is available in the current environment (i.e. in Node), or if you pass
|
||||
* false as the optional 'persist' second argument, persistence will be skipped.
|
||||
*/
|
||||
enableAll(persist? : boolean):void;
|
||||
|
||||
/**
|
||||
* This disables all log messages, and is equivalent to log.setLevel("silent").
|
||||
*
|
||||
* @param persist Where possible the log level will be persisted. LocalStorage will be used if available, falling
|
||||
* back to cookies if not. If neither is available in the current environment (i.e. in Node), or if you pass
|
||||
* false as the optional 'persist' second argument, persistence will be skipped.
|
||||
*/
|
||||
disableAll(persist? : boolean):void;
|
||||
|
||||
}
|
||||
|
||||
declare var log : Log;
|
||||
|
||||
Vendored
+2
-2
@@ -576,7 +576,7 @@ declare namespace __MaterialUI {
|
||||
export class EnhancedButton extends React.Component<EnhancedButtonProps, {}> {
|
||||
}
|
||||
|
||||
interface FlatButtonProps extends SharedEnhancedButtonProps<FlatButton> {
|
||||
interface FlatButtonProps extends React.DOMAttributes, SharedEnhancedButtonProps<FlatButton> {
|
||||
// <EnhancedButton/> is the element that get the 'other' properties
|
||||
backgroundColor?: string;
|
||||
disabled?: boolean;
|
||||
@@ -843,7 +843,7 @@ declare namespace __MaterialUI {
|
||||
ref?: string;
|
||||
text: string;
|
||||
}
|
||||
interface DialogProps extends React.Props<Dialog> {
|
||||
interface DialogProps extends React.DOMAttributes, React.Props<Dialog> {
|
||||
/** @deprecated use a custom `actions` property instead */
|
||||
actionFocus?: string;
|
||||
actions?: Array<DialogAction | React.ReactElement<any>>;
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
/// <reference path="microgears.d.ts" />
|
||||
|
||||
|
||||
function verify_module_file() {
|
||||
var tracePlugin = new TracePlugin();
|
||||
microgears.addPlugin(tracePlugin);
|
||||
var service = new UserService();
|
||||
var userService = microgears.addService(service);
|
||||
|
||||
|
||||
}
|
||||
|
||||
class TracePlugin implements microgears.Plugin {
|
||||
name: 'TracePlugin';
|
||||
public beforeChain(args:Array<any>, _meta: microgears.MetaInformation) {
|
||||
var serviceName = _meta.serviceName,
|
||||
method = _meta.methodName;
|
||||
console.log('before call-> ' + serviceName + '.' + method);
|
||||
|
||||
_meta.extra = {
|
||||
count: 1
|
||||
};
|
||||
|
||||
return args
|
||||
}
|
||||
public afterChain(result:any, _meta: microgears.MetaInformation) {
|
||||
var serviceName = _meta.serviceName,
|
||||
method = _meta.methodName;
|
||||
|
||||
console.log('after of-> ' + serviceName + '.' + method);
|
||||
if (_meta.extra.count) {
|
||||
console.log('this number comes to the beforeChain: ' + _meta.extra.count);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
class User {
|
||||
name: string;
|
||||
email: string;
|
||||
|
||||
constructor(name: string, email: string) {
|
||||
this.email = email;
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
|
||||
class UserService implements microgears.Service {
|
||||
name: string = "userService";
|
||||
namespace: string = "services.user";
|
||||
|
||||
public findUserById(id: number) {
|
||||
return new User('test', 'test@example.com');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Vendored
+33
@@ -0,0 +1,33 @@
|
||||
// Type definitions for microgears v4.0.0
|
||||
// Project: http://github.com/marcusdb/microgears
|
||||
// Definitions by: Marcus David Bronstein <https://github.com/marcusdb>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace microgears {
|
||||
export interface Service {
|
||||
name: string;
|
||||
async?: boolean;
|
||||
pathname?: string;
|
||||
namespace: string;
|
||||
}
|
||||
|
||||
interface MetaInformation {
|
||||
serviceName: string;
|
||||
methodName: string;
|
||||
serviceNameSpace: string;
|
||||
extra: any;
|
||||
}
|
||||
|
||||
interface Plugin {
|
||||
name: string;
|
||||
beforeChain(arguments: Array<any>, metaInfo: MetaInformation): Array<any>;
|
||||
afterChain<T>(result: T, metaInfo: MetaInformation): T;
|
||||
}
|
||||
|
||||
function addService(service: Service): Service;
|
||||
function addPlugin(plugin: Plugin): void;
|
||||
}
|
||||
|
||||
declare module "microgears" {
|
||||
export = microgears;
|
||||
}
|
||||
Vendored
+5
-5
@@ -1,6 +1,6 @@
|
||||
// Type definitions for mssql v2.2.0
|
||||
// Type definitions for mssql v3.1.0
|
||||
// Project: https://www.npmjs.com/package/mssql
|
||||
// Definitions by: COLSA Corporation <http://www.colsa.com/>, Ben Farr <https://github.com/jaminfarr>
|
||||
// Definitions by: COLSA Corporation <http://www.colsa.com/>, Ben Farr <https://github.com/jaminfarr>, Vitor Buzinaro <https://github.com/buzinas>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
@@ -199,14 +199,14 @@ declare module "mssql" {
|
||||
public constructor(transaction: Transaction);
|
||||
public constructor(preparedStatement: PreparedStatement);
|
||||
public execute(procedure: string): Promise<recordSet>;
|
||||
public execute<Entity>(procedure: string, callback: (err?: any, recordsets?: Entity[], returnValue?: any) => void): void;
|
||||
public execute<Entity>(procedure: string, callback: (err?: any, recordsets?: Entity[], returnValue?: any, rowsAffected?: number) => void): void;
|
||||
public input(name: string, value: any): void;
|
||||
public input(name: string, type: any, value: any): void;
|
||||
public output(name: string, type: any, value?: any): void;
|
||||
public pipe(stream: NodeJS.WritableStream): void;
|
||||
public query(command: string): Promise<void>;
|
||||
public query<Entity>(command: string): Promise<Entity[]>;
|
||||
public query(command: string, callback: (err?: any, recordset?: any) => void): void;
|
||||
public query(command: string, callback: (err?: any, recordset?: any, rowsAffected?: number) => void): void;
|
||||
public query<Entity>(command: string, callback: (err?: any, recordset?: Entity[]) => void): void;
|
||||
public batch(batch: string): Promise<recordSet>;
|
||||
public batch<Entity>(batch: string): Promise<Entity[]>;
|
||||
@@ -258,7 +258,7 @@ declare module "mssql" {
|
||||
public prepare(statement?: string, callback?: (err?: any) => void): void;
|
||||
public execute(values: Object): Promise<recordSet>;
|
||||
public execute<Entity>(values: Object): Promise<Entity[]>;
|
||||
public execute(values: Object, callback: (err: any, recordSet: recordSet) => void): void;
|
||||
public execute(values: Object, callback: (err: any, recordSet: recordSet, rowsAffected: number) => void): void;
|
||||
public execute<Entity>(values: Object, callback: (err: any, recordSet: Entity[]) => void): void;
|
||||
public unprepare(): Promise<void>;
|
||||
public unprepare(callback: (err?: any) => void): void;
|
||||
|
||||
@@ -138,6 +138,7 @@ function bufferTests() {
|
||||
var base64Buffer = new Buffer('','base64');
|
||||
var octets: Uint8Array = null;
|
||||
var octetBuffer = new Buffer(octets);
|
||||
var sharedBuffer = new Buffer(octets.buffer);
|
||||
var copiedBuffer = new Buffer(utf8Buffer);
|
||||
console.log(Buffer.isBuffer(octetBuffer));
|
||||
console.log(Buffer.isEncoding('utf8'));
|
||||
@@ -181,6 +182,12 @@ function bufferTests() {
|
||||
let sb = new ImportedSlowBuffer(43);
|
||||
b.writeUInt8(0, 6);
|
||||
}
|
||||
|
||||
// Buffer has Uint8Array's buffer field (an ArrayBuffer).
|
||||
{
|
||||
let buffer = new Buffer('123');
|
||||
let octets = new Uint8Array(buffer.buffer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Vendored
+14
-3
@@ -108,6 +108,14 @@ declare var Buffer: {
|
||||
* @param array The octets to store.
|
||||
*/
|
||||
new (array: Uint8Array): Buffer;
|
||||
/**
|
||||
* Produces a Buffer backed by the same allocated memory as
|
||||
* the given {ArrayBuffer}.
|
||||
*
|
||||
*
|
||||
* @param arrayBuffer The ArrayBuffer with which to share memory.
|
||||
*/
|
||||
new (arrayBuffer: ArrayBuffer): Buffer;
|
||||
/**
|
||||
* Allocates a new buffer containing the given {array} of octets.
|
||||
*
|
||||
@@ -382,12 +390,10 @@ declare namespace NodeJS {
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
interface NodeBuffer {
|
||||
[index: number]: number;
|
||||
interface NodeBuffer extends Uint8Array {
|
||||
write(string: string, offset?: number, length?: number, encoding?: string): number;
|
||||
toString(encoding?: string, start?: number, end?: number): string;
|
||||
toJSON(): any;
|
||||
length: number;
|
||||
equals(otherBuffer: Buffer): boolean;
|
||||
compare(otherBuffer: Buffer): number;
|
||||
copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
|
||||
@@ -429,7 +435,12 @@ interface NodeBuffer {
|
||||
writeDoubleLE(value: number, offset: number, noAssert?: boolean): number;
|
||||
writeDoubleBE(value: number, offset: number, noAssert?: boolean): number;
|
||||
fill(value: any, offset?: number, end?: number): Buffer;
|
||||
// TODO: encoding param
|
||||
indexOf(value: string | number | Buffer, byteOffset?: number): number;
|
||||
// TODO: entries
|
||||
// TODO: includes
|
||||
// TODO: keys
|
||||
// TODO: values
|
||||
}
|
||||
|
||||
/************************************************
|
||||
|
||||
Vendored
+4
@@ -174,3 +174,7 @@ declare namespace noUiSlider {
|
||||
noUiSlider: noUiSlider
|
||||
}
|
||||
}
|
||||
|
||||
declare module "nouislider" {
|
||||
export = noUiSlider;
|
||||
}
|
||||
|
||||
Vendored
+8
-8
@@ -2142,7 +2142,7 @@ declare namespace Excel {
|
||||
*
|
||||
* @param across Set true to merge cells in each row of the specified range as separate merged cells. The default value is false.
|
||||
*
|
||||
* [Api set: ExcelApi 1.1]
|
||||
* [Api set: ExcelApi 1.2]
|
||||
*/
|
||||
merge(across?: boolean): void;
|
||||
/**
|
||||
@@ -2156,7 +2156,7 @@ declare namespace Excel {
|
||||
*
|
||||
* Unmerge the range cells into separate cells.
|
||||
*
|
||||
* [Api set: ExcelApi 1.1]
|
||||
* [Api set: ExcelApi 1.2]
|
||||
*/
|
||||
unmerge(): void;
|
||||
/**
|
||||
@@ -2473,14 +2473,14 @@ declare namespace Excel {
|
||||
*
|
||||
* Clears all the filters currently applied on the table.
|
||||
*
|
||||
* [Api set: ExcelApi 1.1]
|
||||
* [Api set: ExcelApi 1.2]
|
||||
*/
|
||||
clearFilters(): void;
|
||||
/**
|
||||
*
|
||||
* Converts the table into a normal range of cells. All data is preserved.
|
||||
*
|
||||
* [Api set: ExcelApi 1.1]
|
||||
* [Api set: ExcelApi 1.2]
|
||||
*/
|
||||
convertToRange(): Excel.Range;
|
||||
/**
|
||||
@@ -2522,7 +2522,7 @@ declare namespace Excel {
|
||||
*
|
||||
* Reapplies all the filters currently on the table.
|
||||
*
|
||||
* [Api set: ExcelApi 1.1]
|
||||
* [Api set: ExcelApi 1.2]
|
||||
*/
|
||||
reapplyFilters(): void;
|
||||
/**
|
||||
@@ -2835,14 +2835,14 @@ declare namespace Excel {
|
||||
*
|
||||
* Changes the width of the columns of the current range to achieve the best fit, based on the current data in the columns.
|
||||
*
|
||||
* [Api set: ExcelApi 1.1]
|
||||
* [Api set: ExcelApi 1.2]
|
||||
*/
|
||||
autofitColumns(): void;
|
||||
/**
|
||||
*
|
||||
* Changes the height of the rows of the current range to achieve the best fit, based on the current data in the columns.
|
||||
*
|
||||
* [Api set: ExcelApi 1.1]
|
||||
* [Api set: ExcelApi 1.2]
|
||||
*/
|
||||
autofitRows(): void;
|
||||
/**
|
||||
@@ -3221,7 +3221,7 @@ declare namespace Excel {
|
||||
* @param width (Optional) The desired width of the resulting image.
|
||||
* @param fittingMode (Optional) The method used to scale the chart to the specified to the specified dimensions (if both height and width are set)."
|
||||
*
|
||||
* [Api set: ExcelApi 1.1]
|
||||
* [Api set: ExcelApi 1.2]
|
||||
*/
|
||||
getImage(width?: number, height?: number, fittingMode?: string): OfficeExtension.ClientResult<string>;
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
/// <reference path="promise-pg.d.ts" />
|
||||
/// <reference path="../q/Q.d.ts" />
|
||||
|
||||
import * as pg from 'promise-pg';
|
||||
|
||||
var conString = "postgres://username:password@localhost/database";
|
||||
|
||||
// https://github.com/brianc/node-pg-types
|
||||
pg.raw.types.setTypeParser(20, (val) => Number(val));
|
||||
|
||||
// Client pooling
|
||||
pg.connect(conString)
|
||||
.spread(function (client: pg.Client, done: () => void) {
|
||||
client.query("SELECT $1::int AS number", ["1"]).promise
|
||||
.then(function (result) {
|
||||
// done
|
||||
}, function (err) {
|
||||
console.error("Error running query", err);
|
||||
})
|
||||
.finally(done);
|
||||
}, function (err) {
|
||||
return console.error("Error fetching client from pool", err);
|
||||
}).done();
|
||||
|
||||
// Simple
|
||||
var client = new pg.Client(conString);
|
||||
client.connect()
|
||||
.spread(function (client: pg.Client, done: () => void) {
|
||||
client.query("SELECT NOW() AS 'theTime'").promise
|
||||
.then(function (result) {
|
||||
console.log(result.rows[0]["theTime"]);
|
||||
client.end();
|
||||
return null;
|
||||
}, function (err) {
|
||||
return console.error("Error running query", err);
|
||||
});
|
||||
}, function (err) {
|
||||
return console.error("Could not connect to postgres", err);
|
||||
}).done();
|
||||
|
||||
// Using buffer query option
|
||||
pg.connect(conString)
|
||||
.spread(function (client: pg.Client, done: () => void) {
|
||||
client.query({
|
||||
text: "SELECT * FROM users",
|
||||
buffer: true
|
||||
}).promise.then(
|
||||
function (result) { console.log(result.rows.length + " rows returned"); },
|
||||
function (err) { console.error("Error running query", err); throw err; },
|
||||
function (user: any) {} // called for each returned row
|
||||
).finally(done);
|
||||
}).done();
|
||||
|
||||
// Transactions
|
||||
pg.connect(conString)
|
||||
.spread(function (client: pg.Client, done: () => void) {
|
||||
var INSERT = "INSERT INTO users(name, t_birth, country) VALUES ($1, $2, $3)";
|
||||
|
||||
console.log("Transaction I:");
|
||||
var trans = client.transaction(function () {
|
||||
return Q.all([{
|
||||
text: INSERT,
|
||||
values: ["Jake1", "now()", "Oo"]
|
||||
}, {
|
||||
text: INSERT,
|
||||
values: ["Cake2", null, "Küche"]
|
||||
}, {
|
||||
text: INSERT,
|
||||
values: ["Mike3", "now()", null]
|
||||
}].map(function (q) { return client.query(q).promise; }));
|
||||
}).then(function() {
|
||||
console.log("Good - Committed Transaction I.");
|
||||
}, function (err) {
|
||||
console.log("Bad - Rolled back Transaction I.", err);
|
||||
});
|
||||
|
||||
trans.finally(function () {
|
||||
client.transaction(function () {
|
||||
return Q.all([{
|
||||
text: INSERT,
|
||||
values: ["Jake", "now()", "Oo"]
|
||||
}, {
|
||||
text: INSERT, // Bad, name is NOT NULL
|
||||
values: [null, null, "Küche"]
|
||||
}, {
|
||||
text: INSERT,
|
||||
values: ["Mike", "now()", null]
|
||||
}].map(function (q) { return client.query(q).promise; }));
|
||||
}).then(function () {
|
||||
console.log("Bad - Committed Transaction II.");
|
||||
}, function (err) {
|
||||
console.log("Good - Rolled back Transaction II.", err.message);
|
||||
}).finally(done).done();
|
||||
});
|
||||
}).done();
|
||||
Vendored
+61
@@ -0,0 +1,61 @@
|
||||
// Type definitions for promise-pg
|
||||
// Project: https://bitbucket.org/lplabs/promise-pg
|
||||
// Definitions by: Chris Charabaruk <http://github.com/coldacid>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
/// <reference path="../q/Q.d.ts" />
|
||||
/// <reference path="../pg/pg.d.ts" />
|
||||
|
||||
declare module "promise-pg" {
|
||||
import * as stream from 'stream';
|
||||
import * as pg from 'pg';
|
||||
|
||||
export {pg as raw};
|
||||
|
||||
export interface ClientConfig extends pg.ClientConfig {}
|
||||
|
||||
export function connect(connection: string): Q.Promise<Client>;
|
||||
export function connect(connection: pg.ClientConfig): Q.Promise<Client>;
|
||||
|
||||
export function end(): Q.Promise<void>;
|
||||
|
||||
export interface QueryConfig extends pg.QueryConfig {
|
||||
buffer?: boolean;
|
||||
}
|
||||
|
||||
export class Client {
|
||||
constructor(connection: string);
|
||||
constructor(config: ClientConfig);
|
||||
|
||||
raw: pg.Client;
|
||||
|
||||
connect(): Q.Promise<void>;
|
||||
end(): Q.Promise<void>;
|
||||
|
||||
query(queryText: string): Query;
|
||||
query(config: QueryConfig): Query;
|
||||
query(queryText: string, values: any[]): Query;
|
||||
|
||||
copyFrom(queryText: string): stream.Writable;
|
||||
copyTo(queryText: string): stream.Readable;
|
||||
|
||||
pauseDrain(): void;
|
||||
resumeDrain(): void;
|
||||
|
||||
public on(event: "drain", listener: () => void): Client;
|
||||
public on(event: "error", listener: (err: Error) => void): Client;
|
||||
public on(event: "notification", listener: (message: any) => void): Client;
|
||||
public on(event: "notice", listener: (message: any) => void): Client;
|
||||
public on(event: string, listener: Function): Client;
|
||||
|
||||
transaction(task: () => Q.Promise<any>): Q.Promise<any>;
|
||||
}
|
||||
|
||||
export interface QueryResult extends pg.QueryResult {}
|
||||
export interface ResultBuilder extends pg.ResultBuilder {}
|
||||
|
||||
export class Query extends pg.Query {
|
||||
promise: Q.Promise<QueryResult>;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
/// <reference path='qrcode-generator.d.ts' />
|
||||
|
||||
import qrcode = require('qrcode-generator');
|
||||
|
||||
let qr = qrcode(4,'M');
|
||||
|
||||
qr.addData('some arbitrary data');
|
||||
qr.make();
|
||||
|
||||
let imgHtml = qr.createImageTag(5,5);
|
||||
let svgHtml = qr.createSvgTag(5,5);
|
||||
let tableHtml = qr.createTableTag(5,5);
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// Type definitions for grcode-generator
|
||||
// Project: https://github.com/kazuhikoarase/qrcode-generator
|
||||
// Definitions by: Stefan Huber <https://github.com/stefanhuber/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
interface QRCode {
|
||||
addData(data: string) : void;
|
||||
make() : void;
|
||||
|
||||
createTableTag(cellSize: number, margin: number) : string;
|
||||
createSvgTag(cellSize: number, margin: number) : string;
|
||||
createImageTag(cellSize: number, margin: number) : string;
|
||||
}
|
||||
|
||||
declare module 'qrcode-generator' {
|
||||
function qrcode(type: number, errorCorrectionLevel: string) : QRCode;
|
||||
export = qrcode;
|
||||
}
|
||||
@@ -26,7 +26,7 @@ FormattedPlural,
|
||||
FormattedDate,
|
||||
FormattedTime
|
||||
} from "react-intl"
|
||||
import reactIntlEn = require("react-intl/lib/locale-data/en");
|
||||
import reactIntlEn = require("react-intl/locale-data/en");
|
||||
|
||||
addLocaleData(reactIntlEn);
|
||||
console.log(hasLocaleData("en"));
|
||||
@@ -165,4 +165,4 @@ class TestApp extends React.Component<{}, {}> {
|
||||
export default {
|
||||
TestApp,
|
||||
SomeComponent: injectIntl(SomeComponent)
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1162
-2
File diff suppressed because it is too large
Load Diff
@@ -12,8 +12,10 @@ class SelectTest extends React.Component<React.Props<{}>, {}> {
|
||||
|
||||
render() {
|
||||
const options: ReactSelect.Option[] = [{ label: "Foo", value: "bar" }]
|
||||
const onOpen = () => { return; };
|
||||
const onClose = () => { return; };
|
||||
return <div>
|
||||
<Select options={options} />
|
||||
<Select options={options} onOpen={onOpen} onClose={onClose} />
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
Vendored
+3
@@ -153,9 +153,12 @@ declare namespace ReactSelect {
|
||||
*/
|
||||
onBlurResetsInput?: boolean;
|
||||
onChange?: (newValue: Option | Option[]) => void;
|
||||
onClose?: () => void;
|
||||
onFocus?: __React.FocusEventHandler;
|
||||
onInputChange?: (inputValue: string) => void;
|
||||
onOpen?: () => void;
|
||||
onOptionLabelClick?: (value: string, event: Event) => void;
|
||||
|
||||
/**
|
||||
* function which returns a custom way to render the options in the menu
|
||||
*/
|
||||
|
||||
Vendored
+4
-4
@@ -18,14 +18,14 @@ declare namespace __React {
|
||||
element: SFCElement<P>,
|
||||
container: Element,
|
||||
callback?: () => any): void;
|
||||
function render<P, T extends Component<P, {}>>(
|
||||
function render<P, T extends Component<P, ComponentState>>(
|
||||
element: CElement<P, T>,
|
||||
container: Element,
|
||||
callback?: (component: T) => any): T;
|
||||
function render<P>(
|
||||
element: ReactElement<P>,
|
||||
container: Element,
|
||||
callback?: (component?: Component<P, {}> | Element) => any): Component<P, {}> | Element | void;
|
||||
callback?: (component?: Component<P, ComponentState> | Element) => any): Component<P, ComponentState> | Element | void;
|
||||
|
||||
function unmountComponentAtNode(container: Element): boolean;
|
||||
|
||||
@@ -40,7 +40,7 @@ declare namespace __React {
|
||||
element: DOMElement<P, T>,
|
||||
container: Element,
|
||||
callback?: (element: T) => any): T;
|
||||
function unstable_renderSubtreeIntoContainer<P, T extends Component<P, {}>>(
|
||||
function unstable_renderSubtreeIntoContainer<P, T extends Component<P, ComponentState>>(
|
||||
parentComponent: Component<any, any>,
|
||||
element: CElement<P, T>,
|
||||
container: Element,
|
||||
@@ -54,7 +54,7 @@ declare namespace __React {
|
||||
parentComponent: Component<any, any>,
|
||||
element: ReactElement<P>,
|
||||
container: Element,
|
||||
callback?: (component?: Component<P, {}> | Element) => any): Component<P, {}> | Element | void;
|
||||
callback?: (component?: Component<P, ComponentState> | Element) => any): Component<P, ComponentState> | Element | void;
|
||||
}
|
||||
|
||||
namespace __DOMServer {
|
||||
|
||||
@@ -138,6 +138,8 @@ class ModernComponent extends React.Component<Props, State>
|
||||
}
|
||||
}
|
||||
|
||||
class ModernComponentNoState extends React.Component<Props, void> {}
|
||||
|
||||
interface SCProps {
|
||||
foo?: number;
|
||||
}
|
||||
@@ -182,6 +184,8 @@ var domFactoryElement: React.DOMElement<React.DOMAttributes, Element> =
|
||||
// React.createElement
|
||||
var element: React.CElement<Props, ModernComponent> =
|
||||
React.createElement(ModernComponent, props);
|
||||
var elementNoState: React.CElement<Props, ModernComponentNoState> =
|
||||
React.createElement(ModernComponentNoState, props);
|
||||
var statelessElement: React.SFCElement<SCProps> =
|
||||
React.createElement(StatelessComponent, props);
|
||||
var classicElement: React.ClassicElement<Props> =
|
||||
@@ -216,6 +220,8 @@ var clonedDOMElement: React.ReactHTMLElement<HTMLDivElement> =
|
||||
// React.render
|
||||
var component: ModernComponent =
|
||||
ReactDOM.render(element, container);
|
||||
var componentNoState: ModernComponentNoState =
|
||||
ReactDOM.render(elementNoState, container);
|
||||
var classicComponent: React.ClassicComponent<Props, any> =
|
||||
ReactDOM.render(classicElement, container);
|
||||
var domComponent: Element =
|
||||
|
||||
Vendored
+19
-18
@@ -13,6 +13,7 @@ declare namespace __React {
|
||||
|
||||
type Key = string | number;
|
||||
type Ref<T> = string | ((instance: T) => any);
|
||||
type ComponentState = {} | void;
|
||||
|
||||
interface Attributes {
|
||||
key?: Key;
|
||||
@@ -31,13 +32,13 @@ declare namespace __React {
|
||||
type: SFC<P>;
|
||||
}
|
||||
|
||||
type CElement<P, T extends Component<P, {}>> = ComponentElement<P, T>;
|
||||
interface ComponentElement<P, T extends Component<P, {}>> extends ReactElement<P> {
|
||||
type CElement<P, T extends Component<P, ComponentState>> = ComponentElement<P, T>;
|
||||
interface ComponentElement<P, T extends Component<P, ComponentState>> extends ReactElement<P> {
|
||||
type: ComponentClass<P>;
|
||||
ref?: Ref<T>;
|
||||
}
|
||||
|
||||
type ClassicElement<P> = CElement<P, ClassicComponent<P, {}>>;
|
||||
type ClassicElement<P> = CElement<P, ClassicComponent<P, ComponentState>>;
|
||||
|
||||
interface DOMElement<P extends DOMAttributes, T extends Element> extends ReactElement<P> {
|
||||
type: string;
|
||||
@@ -62,12 +63,12 @@ declare namespace __React {
|
||||
(props?: P & Attributes, ...children: ReactNode[]): SFCElement<P>;
|
||||
}
|
||||
|
||||
interface ComponentFactory<P, T extends Component<P, {}>> {
|
||||
interface ComponentFactory<P, T extends Component<P, ComponentState>> {
|
||||
(props?: P & ClassAttributes<T>, ...children: ReactNode[]): CElement<P, T>;
|
||||
}
|
||||
|
||||
type CFactory<P, T extends Component<P, {}>> = ComponentFactory<P, T>;
|
||||
type ClassicFactory<P> = CFactory<P, ClassicComponent<P, {}>>;
|
||||
type CFactory<P, T extends Component<P, ComponentState>> = ComponentFactory<P, T>;
|
||||
type ClassicFactory<P> = CFactory<P, ClassicComponent<P, ComponentState>>;
|
||||
|
||||
interface DOMFactory<P extends DOMAttributes, T extends Element> {
|
||||
(props?: P & ClassAttributes<T>, ...children: ReactNode[]): DOMElement<P, T>;
|
||||
@@ -101,8 +102,8 @@ declare namespace __React {
|
||||
type: string): DOMFactory<P, T>;
|
||||
function createFactory<P>(type: SFC<P>): SFCFactory<P>;
|
||||
function createFactory<P>(
|
||||
type: ClassType<P, ClassicComponent<P, {}>, ClassicComponentClass<P>>): CFactory<P, ClassicComponent<P, {}>>;
|
||||
function createFactory<P, T extends Component<P, {}>, C extends ComponentClass<P>>(
|
||||
type: ClassType<P, ClassicComponent<P, ComponentState>, ClassicComponentClass<P>>): CFactory<P, ClassicComponent<P, ComponentState>>;
|
||||
function createFactory<P, T extends Component<P, ComponentState>, C extends ComponentClass<P>>(
|
||||
type: ClassType<P, T, C>): CFactory<P, T>;
|
||||
function createFactory<P>(type: ComponentClass<P> | SFC<P>): Factory<P>;
|
||||
|
||||
@@ -115,10 +116,10 @@ declare namespace __React {
|
||||
props?: P & Attributes,
|
||||
...children: ReactNode[]): SFCElement<P>;
|
||||
function createElement<P>(
|
||||
type: ClassType<P, ClassicComponent<P, {}>, ClassicComponentClass<P>>,
|
||||
props?: P & ClassAttributes<ClassicComponent<P, {}>>,
|
||||
...children: ReactNode[]): CElement<P, ClassicComponent<P, {}>>;
|
||||
function createElement<P, T extends Component<P, {}>, C extends ComponentClass<P>>(
|
||||
type: ClassType<P, ClassicComponent<P, ComponentState>, ClassicComponentClass<P>>,
|
||||
props?: P & ClassAttributes<ClassicComponent<P, ComponentState>>,
|
||||
...children: ReactNode[]): CElement<P, ClassicComponent<P, ComponentState>>;
|
||||
function createElement<P, T extends Component<P, ComponentState>, C extends ComponentClass<P>>(
|
||||
type: ClassType<P, T, C>,
|
||||
props?: P & ClassAttributes<T>,
|
||||
...children: ReactNode[]): CElement<P, T>;
|
||||
@@ -135,7 +136,7 @@ declare namespace __React {
|
||||
element: SFCElement<P>,
|
||||
props?: Q, // should be Q & Attributes, but then Q is inferred as {}
|
||||
...children: ReactNode[]): SFCElement<P>;
|
||||
function cloneElement<P extends Q, Q, T extends Component<P, {}>>(
|
||||
function cloneElement<P extends Q, Q, T extends Component<P, ComponentState>>(
|
||||
element: CElement<P, T>,
|
||||
props?: Q, // should be Q & ClassAttributes<T>
|
||||
...children: ReactNode[]): CElement<P, T>;
|
||||
@@ -201,7 +202,7 @@ declare namespace __React {
|
||||
}
|
||||
|
||||
interface ComponentClass<P> {
|
||||
new(props?: P, context?: any): Component<P, {}>;
|
||||
new(props?: P, context?: any): Component<P, ComponentState>;
|
||||
propTypes?: ValidationMap<P>;
|
||||
contextTypes?: ValidationMap<any>;
|
||||
childContextTypes?: ValidationMap<any>;
|
||||
@@ -210,7 +211,7 @@ declare namespace __React {
|
||||
}
|
||||
|
||||
interface ClassicComponentClass<P> extends ComponentClass<P> {
|
||||
new(props?: P, context?: any): ClassicComponent<P, {}>;
|
||||
new(props?: P, context?: any): ClassicComponent<P, ComponentState>;
|
||||
getDefaultProps?(): P;
|
||||
}
|
||||
|
||||
@@ -219,7 +220,7 @@ declare namespace __React {
|
||||
* a single argument, which is useful for many top-level API defs.
|
||||
* See https://github.com/Microsoft/TypeScript/issues/7234 for more info.
|
||||
*/
|
||||
type ClassType<P, T extends Component<P, {}>, C extends ComponentClass<P>> =
|
||||
type ClassType<P, T extends Component<P, ComponentState>, C extends ComponentClass<P>> =
|
||||
C &
|
||||
(new() => T) &
|
||||
(new() => { props: P });
|
||||
@@ -1180,7 +1181,7 @@ declare namespace __React {
|
||||
lineClamp?: number;
|
||||
|
||||
/**
|
||||
* Specifies the height of an inline block level element.
|
||||
* Specifies the height of an inline block level element.
|
||||
*/
|
||||
lineHeight?: number | string;
|
||||
|
||||
@@ -2033,7 +2034,7 @@ declare namespace __React {
|
||||
results?: number;
|
||||
security?: string;
|
||||
unselectable?: boolean;
|
||||
|
||||
|
||||
// Allows aria- and data- Attributes
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,625 @@
|
||||
///<reference path='rebass.d.ts' />
|
||||
|
||||
import * as React from "react";
|
||||
import {
|
||||
Arrow
|
||||
, Avatar
|
||||
, Badge
|
||||
, Banner
|
||||
, Block
|
||||
, Blockquote
|
||||
, Breadcrumbs
|
||||
, Button
|
||||
, ButtonCircle
|
||||
, ButtonOutline
|
||||
, Card
|
||||
, CardImage
|
||||
, Checkbox
|
||||
, Close
|
||||
, Container
|
||||
, Divider
|
||||
, Donut
|
||||
, DotIndicator
|
||||
, Drawer
|
||||
, Dropdown
|
||||
, DropdownMenu
|
||||
, Embed
|
||||
, Fixed
|
||||
, Footer
|
||||
, Heading
|
||||
, HeadingLink
|
||||
, InlineForm
|
||||
, Input
|
||||
, Label
|
||||
, LinkBlock
|
||||
, Media
|
||||
, Menu
|
||||
, Message
|
||||
, NavItem
|
||||
, Overlay
|
||||
, PageHeader
|
||||
, Panel
|
||||
, PanelFooter
|
||||
, PanelHeader
|
||||
, Pre
|
||||
, Progress
|
||||
, Radio
|
||||
, Rating
|
||||
, Section
|
||||
, SectionHeader
|
||||
, Select
|
||||
, SequenceMap
|
||||
, SequenceMapStep
|
||||
, Slider
|
||||
, Space
|
||||
, Stat
|
||||
, Switch
|
||||
, Table
|
||||
, Text
|
||||
, Textarea
|
||||
, Toolbar
|
||||
, Tooltip
|
||||
} from "rebass";
|
||||
|
||||
interface IconProps extends React.Props<Icon> {
|
||||
fill: string;
|
||||
height: string;
|
||||
name: string;
|
||||
width: string;
|
||||
}
|
||||
|
||||
class Icon extends React.Component<IconProps, {}> {
|
||||
render() {
|
||||
return <div></div>;
|
||||
}
|
||||
}
|
||||
|
||||
class RebassTest extends React.Component<{}, {}> {
|
||||
render() {
|
||||
return <div>
|
||||
<Button
|
||||
backgroundColor="primary"
|
||||
color="white"
|
||||
inverted={true}
|
||||
rounded={true}
|
||||
>
|
||||
Arrow
|
||||
<Arrow direction="down" />
|
||||
</Button>
|
||||
|
||||
<Avatar
|
||||
circle={true}
|
||||
size={48}
|
||||
src="http://lorempixel.com/64/64/cats"
|
||||
/>
|
||||
|
||||
<div>
|
||||
<Heading level={4}>
|
||||
Rebass
|
||||
</Heading>
|
||||
<Space x={1} />
|
||||
<Badge
|
||||
rounded={true}
|
||||
theme="info"
|
||||
>
|
||||
0.2.0
|
||||
</Badge>
|
||||
<Space x={2} />
|
||||
<Heading level={4}>
|
||||
Pill
|
||||
</Heading>
|
||||
<Space x={1} />
|
||||
<Badge
|
||||
pill={true}
|
||||
rounded={true}
|
||||
theme="info"
|
||||
>
|
||||
Pill
|
||||
</Badge>
|
||||
<Space x={2} />
|
||||
<Heading level={4}>
|
||||
Circular
|
||||
</Heading>
|
||||
<Space x={1} />
|
||||
<Badge
|
||||
circle={true}
|
||||
rounded={true}
|
||||
theme="error"
|
||||
>
|
||||
4
|
||||
</Badge>
|
||||
</div>
|
||||
|
||||
<Banner
|
||||
align="center"
|
||||
backgroundImage="https://d262ilb51hltx0.cloudfront.net/max/2000/1*DZwdGMaeu-rvTroJYui6Uw.jpeg"
|
||||
>
|
||||
<Heading
|
||||
level={2}
|
||||
size={0}
|
||||
>
|
||||
Rebass
|
||||
</Heading>
|
||||
</Banner>
|
||||
|
||||
<Block
|
||||
borderLeft={true}
|
||||
color="blue"
|
||||
px={2}
|
||||
>
|
||||
<Media img="http://placehold.it/128/08e/fff">
|
||||
<Heading
|
||||
level={2}
|
||||
size={0}
|
||||
>
|
||||
Block
|
||||
</Heading>
|
||||
<Text>
|
||||
Generic box for containing things
|
||||
</Text>
|
||||
</Media>
|
||||
</Block>
|
||||
|
||||
<Blockquote
|
||||
href="http://webtypography.net/3.1.1"
|
||||
source="Robert Bringhurst"
|
||||
>
|
||||
In the sixteenth century, a series of common sizes developed among European typographers, and the series survived with little change and few additions for 400 years. […] Use the old familiar scale, or use new scales of your own devising, but limit yourself, at first, to a modest set of distinct and related intervals.
|
||||
</Blockquote>
|
||||
|
||||
<Breadcrumbs links={[{children: 'Jxnblk', href: '#!'}, {children: 'Rebass', href: '#!'}, {children: 'Breadcrumbs', href: '#!'}]} />
|
||||
|
||||
<div>
|
||||
<Button
|
||||
backgroundColor="primary"
|
||||
color="white"
|
||||
inverted={true}
|
||||
rounded={true}
|
||||
>
|
||||
Button
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<ButtonCircle title="Like">
|
||||
<Icon
|
||||
fill="currentColor"
|
||||
height="1em"
|
||||
name="heart"
|
||||
width="1em"
|
||||
/>
|
||||
</ButtonCircle>
|
||||
<ButtonCircle title="Comment">
|
||||
<Icon
|
||||
fill="currentColor"
|
||||
height="1em"
|
||||
name="chat"
|
||||
width="1em"
|
||||
/>
|
||||
</ButtonCircle>
|
||||
<ButtonCircle title="Repost">
|
||||
<Icon
|
||||
fill="currentColor"
|
||||
height="1em"
|
||||
name="repost"
|
||||
width="1em"
|
||||
/>
|
||||
</ButtonCircle>
|
||||
<ButtonCircle title="Bookmark">
|
||||
<Icon
|
||||
fill="currentColor"
|
||||
height="1em"
|
||||
name="bookmark"
|
||||
width="1em"
|
||||
/>
|
||||
</ButtonCircle>
|
||||
<ButtonCircle title="Tag">
|
||||
<Icon
|
||||
fill="currentColor"
|
||||
height="1em"
|
||||
name="tag"
|
||||
width="1em"
|
||||
/>
|
||||
</ButtonCircle>
|
||||
<Text small={true}>
|
||||
Example Icon component from react-geomicons
|
||||
</Text>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<ButtonOutline
|
||||
color="primary"
|
||||
inverted={false}
|
||||
rounded="left"
|
||||
>
|
||||
Button
|
||||
</ButtonOutline>
|
||||
<ButtonOutline
|
||||
color="primary"
|
||||
inverted={false}
|
||||
rounded={false}
|
||||
style={{marginLeft: -1}}
|
||||
>
|
||||
Group
|
||||
</ButtonOutline>
|
||||
<Button
|
||||
backgroundColor="primary"
|
||||
color="white"
|
||||
inverted={true}
|
||||
rounded="right"
|
||||
style={{marginLeft: -1}}
|
||||
>
|
||||
Button
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<Card
|
||||
rounded={true}
|
||||
width={256}
|
||||
>
|
||||
<CardImage src="http://placehold.it/320/08e/fff" />
|
||||
<Heading
|
||||
level={2}
|
||||
size={3}
|
||||
>
|
||||
Card
|
||||
</Heading>
|
||||
<Text>
|
||||
Cats like cards too
|
||||
</Text>
|
||||
</Card>
|
||||
|
||||
<div style={{maxWidth: 192}}>
|
||||
<CardImage src="http://placehold.it/320/08e/fff" />
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<Checkbox
|
||||
label="Checkbox"
|
||||
name="checkbox_1"
|
||||
/>
|
||||
<Checkbox
|
||||
checked={true}
|
||||
label="Checkbox"
|
||||
name="checkbox_1"
|
||||
readOnly={true}
|
||||
theme="success"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<Close />
|
||||
|
||||
<Container>
|
||||
Container
|
||||
</Container>
|
||||
|
||||
<div>
|
||||
<Divider />
|
||||
<Divider
|
||||
ml={0}
|
||||
width={128}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<Donut
|
||||
color="primary"
|
||||
size={256}
|
||||
strokeWidth={32}
|
||||
value={0.5625}
|
||||
/>
|
||||
<Donut
|
||||
color="primary"
|
||||
size={128}
|
||||
strokeWidth={8}
|
||||
value={0.5625}
|
||||
>
|
||||
9/16
|
||||
</Donut>
|
||||
<Donut
|
||||
color="primary"
|
||||
size={128}
|
||||
strokeWidth={8}
|
||||
value={0.625}
|
||||
/>
|
||||
<Donut
|
||||
color="primary"
|
||||
size={128}
|
||||
strokeWidth={8}
|
||||
value={0.125}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<DotIndicator
|
||||
active={0}
|
||||
length={3}
|
||||
onClick={function noRefCheck() {}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<Dropdown>
|
||||
<Button
|
||||
backgroundColor="primary"
|
||||
color="white"
|
||||
inverted={true}
|
||||
rounded={true}
|
||||
>
|
||||
Dropdown
|
||||
<Arrow direction="down" />
|
||||
</Button>
|
||||
<DropdownMenu
|
||||
onDismiss={function noRefCheck() {}}
|
||||
open={false}
|
||||
>
|
||||
<NavItem is="a">
|
||||
Hello
|
||||
</NavItem>
|
||||
<NavItem is="a">
|
||||
Hi
|
||||
</NavItem>
|
||||
</DropdownMenu>
|
||||
</Dropdown>
|
||||
|
||||
<Embed ratio={0.5625}>
|
||||
<iframe
|
||||
allowFullScreen={true}
|
||||
src="https://www.youtube.com/embed/KO_3Qgib6RQ"
|
||||
/>
|
||||
</Embed>
|
||||
|
||||
<Footer>
|
||||
Footer™ ©2016 Jxnblk
|
||||
</Footer>
|
||||
|
||||
<InlineForm
|
||||
buttonLabel="Go"
|
||||
label="InlineForm"
|
||||
name="inline_form"
|
||||
onChange={function noRefCheck() {}}
|
||||
onClick={function noRefCheck() {}}
|
||||
/>
|
||||
|
||||
<Input
|
||||
label="Input"
|
||||
name="input_example"
|
||||
placeholder="Placeholder"
|
||||
rounded={true}
|
||||
type="text"
|
||||
/>
|
||||
|
||||
<Label>
|
||||
Label for form elements
|
||||
</Label>
|
||||
|
||||
<LinkBlock
|
||||
href="#LinkBlock"
|
||||
is="a"
|
||||
>
|
||||
<Media
|
||||
align="center"
|
||||
img="http://placehold.it/96/08e/fff"
|
||||
>
|
||||
<Heading level={3}>
|
||||
LinkBlock
|
||||
</Heading>
|
||||
</Media>
|
||||
</LinkBlock>
|
||||
|
||||
<Media
|
||||
align="center"
|
||||
img="http://placehold.it/128/08e/fff"
|
||||
>
|
||||
<Heading level={3}>
|
||||
Media Object
|
||||
</Heading>
|
||||
<Text>
|
||||
With alignment options
|
||||
</Text>
|
||||
</Media>
|
||||
|
||||
<Menu rounded={true}>
|
||||
<NavItem is="a">
|
||||
Menu
|
||||
</NavItem>
|
||||
<NavItem is="a">
|
||||
NavItem
|
||||
</NavItem>
|
||||
<NavItem is="a">
|
||||
NavItem
|
||||
</NavItem>
|
||||
</Menu>
|
||||
|
||||
<Message
|
||||
inverted={true}
|
||||
rounded={true}
|
||||
theme="success"
|
||||
>
|
||||
Hello Message!
|
||||
<Space
|
||||
auto={true}
|
||||
x={1}
|
||||
/>
|
||||
<Close />
|
||||
</Message>
|
||||
|
||||
<PageHeader
|
||||
description="Description about the page"
|
||||
heading="Page Header"
|
||||
/>
|
||||
|
||||
<Panel theme="info">
|
||||
<PanelHeader
|
||||
inverted={true}
|
||||
theme="default"
|
||||
>
|
||||
Panel
|
||||
</PanelHeader>
|
||||
<Text>
|
||||
Panels are great for visually separating UI, content, or data from the rest of the page.
|
||||
</Text>
|
||||
<PanelFooter theme="default">
|
||||
The footer is a good place for less important information
|
||||
</PanelFooter>
|
||||
</Panel>
|
||||
|
||||
<Pre>
|
||||
this is text
|
||||
this is text
|
||||
this is text
|
||||
</Pre>
|
||||
|
||||
<Progress
|
||||
color="primary"
|
||||
value={0.25}
|
||||
/>
|
||||
|
||||
<div>
|
||||
<Radio
|
||||
checked={true}
|
||||
circle={true}
|
||||
group="radios"
|
||||
label="Radio"
|
||||
name="radio_1"
|
||||
readOnly={true}
|
||||
/>
|
||||
<Radio
|
||||
circle={true}
|
||||
group="radios"
|
||||
label="Radio"
|
||||
name="radio_2"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<Rating
|
||||
color="orange"
|
||||
value={3.5}
|
||||
/>
|
||||
|
||||
<Section>
|
||||
Section
|
||||
</Section>
|
||||
|
||||
<Section>
|
||||
<SectionHeader
|
||||
description="With linked header"
|
||||
heading="Section Header"
|
||||
/>
|
||||
Section
|
||||
</Section>
|
||||
|
||||
<Select
|
||||
label="Select"
|
||||
name="select_example"
|
||||
options={[{children: 'Two', value: 2}, {children: 'Four', value: 4}, {children: 'Eight', value: 8}, {children: 'Sixteen', value: 16}, {children: 'Thirty-Two', value: 32}, {children: 'Sixty-Four', value: 64}]}
|
||||
rounded={true}
|
||||
/>
|
||||
|
||||
<SequenceMap
|
||||
active={1}
|
||||
steps={[{children: 'Sign In', href: '#!'}, {children: 'Shipping Address', href: '#!'}, {children: 'Payment Method', href: '#!'}, {children: 'Place Order', href: '#!'}]}
|
||||
/>
|
||||
|
||||
<div>
|
||||
<Slider
|
||||
defaultValue={37.5}
|
||||
label="Slider"
|
||||
name="slider_1"
|
||||
/>
|
||||
<Slider
|
||||
color="blue"
|
||||
fill={true}
|
||||
label="Slider with color and fill"
|
||||
name="slider_2"
|
||||
readOnly={true}
|
||||
value={62.5}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<Button
|
||||
backgroundColor="primary"
|
||||
color="white"
|
||||
inverted={true}
|
||||
rounded={true}
|
||||
>
|
||||
Button
|
||||
</Button>
|
||||
<Space x={1} />
|
||||
<Button
|
||||
backgroundColor="primary"
|
||||
color="white"
|
||||
inverted={true}
|
||||
rounded={true}
|
||||
>
|
||||
With
|
||||
</Button>
|
||||
<Space x={4} />
|
||||
<Button
|
||||
backgroundColor="primary"
|
||||
color="white"
|
||||
inverted={true}
|
||||
rounded={true}
|
||||
>
|
||||
Space
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<Stat
|
||||
label="Memory"
|
||||
unit="GB"
|
||||
value="512"
|
||||
/>
|
||||
<Stat
|
||||
label="PetaFLOPS"
|
||||
value="32"
|
||||
/>
|
||||
<Stat
|
||||
label="Upload"
|
||||
unit="Mbps"
|
||||
value="512"
|
||||
/>
|
||||
<Stat
|
||||
label="Download"
|
||||
unit="Mbps"
|
||||
value="1,024"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<Switch checked={false}/>
|
||||
|
||||
<Table
|
||||
data={[['Hamburger', 'Beef', 'Onion', 'Bun'], ['Pizza', 'Pork', 'Tomato', 'Crust'], ['Corndog', 'Pork', 'Corn', 'Cornbread'], ['Hot Dog', 'Pork', 'Peppers', 'Bun']]}
|
||||
headings={['Name', 'Meat', 'Vegetable', 'Carb']}
|
||||
/>
|
||||
|
||||
<Toolbar>
|
||||
<NavItem is="a">
|
||||
Toolbar
|
||||
</NavItem>
|
||||
<NavItem is="a">
|
||||
NavItem
|
||||
</NavItem>
|
||||
<Space
|
||||
auto={true}
|
||||
x={1}
|
||||
/>
|
||||
<NavItem is="a">
|
||||
NavItem
|
||||
</NavItem>
|
||||
</Toolbar>
|
||||
|
||||
<Tooltip
|
||||
inverted={true}
|
||||
rounded={true}
|
||||
title="Hello!"
|
||||
>
|
||||
<Heading level={3}>
|
||||
Tooltip
|
||||
</Heading>
|
||||
</Tooltip>
|
||||
</div>;
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+497
@@ -0,0 +1,497 @@
|
||||
// Type definitions for Rebass 0.2.5
|
||||
// Project: https://github.com/jxnblk/rebass
|
||||
// Definitions by: rhysd <https://rhysd.github.io>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
///<reference path='../react/react.d.ts' />
|
||||
|
||||
declare module "rebass" {
|
||||
export import React = __React;
|
||||
|
||||
export interface BaseProps<C> extends React.Props<C> {
|
||||
tagName?: string;
|
||||
className?: string;
|
||||
baseStyle?: Object;
|
||||
style?: Object;
|
||||
m?: number;
|
||||
mt?: number;
|
||||
mr?: number;
|
||||
mb?: number;
|
||||
ml?: number;
|
||||
mx?: number;
|
||||
my?: number;
|
||||
p?: number;
|
||||
pt?: number;
|
||||
pr?: number;
|
||||
pb?: number;
|
||||
pl?: number;
|
||||
px?: number;
|
||||
py?: number;
|
||||
color?: string;
|
||||
backgroundColor?: string;
|
||||
inverted?: boolean;
|
||||
rounded?: boolean | "top" | "right" | "bottom" | "left";
|
||||
circle?: boolean;
|
||||
pill?: boolean;
|
||||
}
|
||||
|
||||
export interface ArrowProps extends BaseProps<ArrowClass> {
|
||||
direction?: "up" | "down";
|
||||
}
|
||||
type ArrowClass = React.StatelessComponent<ArrowProps>
|
||||
export const Arrow: ArrowClass;
|
||||
|
||||
export interface AvatarProps extends BaseProps<AvatarClass> {
|
||||
size?: number;
|
||||
src?: string;
|
||||
}
|
||||
type AvatarClass = React.StatelessComponent<AvatarProps>
|
||||
export const Avatar: AvatarClass;
|
||||
|
||||
export interface BadgeProps extends BaseProps<BadgeClass> {
|
||||
theme?: "primary" | "secondary" | "default" | "info" | "success" | "warning" | "error";
|
||||
rounded?: boolean | "top" | "right" | "bottom" | "left";
|
||||
pill?: boolean;
|
||||
circle?: boolean;
|
||||
}
|
||||
type BadgeClass = React.StatelessComponent<BadgeProps>
|
||||
export const Badge: BadgeClass;
|
||||
|
||||
export interface BannerProps extends BaseProps<BannerClass> {
|
||||
align?: "left" | "center" | "right";
|
||||
backgroundImage: string;
|
||||
}
|
||||
type BannerClass = React.StatelessComponent<BannerProps>
|
||||
export const Banner: BannerClass;
|
||||
|
||||
export interface BlockProps extends BaseProps<BlockClass> {
|
||||
m?: number;
|
||||
mt?: number;
|
||||
mr?: number;
|
||||
mb?: number;
|
||||
ml?: number;
|
||||
mx?: number;
|
||||
my?: number;
|
||||
p?: number;
|
||||
pt?: number;
|
||||
pr?: number;
|
||||
pb?: number;
|
||||
pl?: number;
|
||||
px?: number;
|
||||
py?: number;
|
||||
color?: string;
|
||||
backgroundColor?: string;
|
||||
borderColor?: string;
|
||||
border?: boolean;
|
||||
borderTop?: boolean;
|
||||
borderRight?: boolean;
|
||||
borderBottom?: boolean;
|
||||
borderLeft?: boolean;
|
||||
rounded?: boolean | "top" | "right" | "bottom" | "left";
|
||||
}
|
||||
type BlockClass = React.StatelessComponent<BlockProps>
|
||||
export const Block: BlockClass;
|
||||
|
||||
export interface BlockquoteProps extends BaseProps<BlockquoteClass> {
|
||||
source: string;
|
||||
href: string;
|
||||
}
|
||||
type BlockquoteClass = React.StatelessComponent<BlockquoteProps>
|
||||
export const Blockquote: BlockquoteClass;
|
||||
|
||||
export interface BreadcrumbsProps extends BaseProps<BreadcrumbsClass> {
|
||||
links: {
|
||||
children: any;
|
||||
href: string;
|
||||
}[];
|
||||
}
|
||||
type BreadcrumbsClass = React.StatelessComponent<BreadcrumbsProps>
|
||||
export const Breadcrumbs: BreadcrumbsClass;
|
||||
|
||||
export interface ButtonProps extends BaseProps<ButtonClass> {
|
||||
href?: string;
|
||||
color?: string;
|
||||
backgroundColor?: string;
|
||||
rounded?: boolean | "top" | "right" | "bottom" | "left";
|
||||
pill?: boolean;
|
||||
big?: boolean;
|
||||
theme?: "primary" | "secondary" | "default" | "info" | "success" | "warning" | "error";
|
||||
}
|
||||
type ButtonClass = React.StatelessComponent<ButtonProps>
|
||||
export const Button: ButtonClass;
|
||||
|
||||
export interface ButtonCircleProps extends BaseProps<ButtonCircleClass> {
|
||||
title?: string;
|
||||
href?: string;
|
||||
color?: string;
|
||||
backgroundColor?: string;
|
||||
size?: number;
|
||||
}
|
||||
type ButtonCircleClass = React.StatelessComponent<ButtonCircleProps>
|
||||
export const ButtonCircle: ButtonCircleClass;
|
||||
|
||||
export interface ButtonOutlineProps extends BaseProps<ButtonOutlineClass> {
|
||||
href?: string;
|
||||
color?: string;
|
||||
rounded?: boolean | "top" | "right" | "bottom" | "left";
|
||||
pill?: boolean;
|
||||
big?: boolean;
|
||||
}
|
||||
type ButtonOutlineClass = React.StatelessComponent<ButtonOutlineProps>
|
||||
export const ButtonOutline: ButtonOutlineClass;
|
||||
|
||||
export interface CardProps extends BaseProps<CardClass> {
|
||||
width?: number | string;
|
||||
}
|
||||
type CardClass = React.StatelessComponent<CardProps>
|
||||
export const Card: CardClass;
|
||||
|
||||
export interface CardImageProps extends BaseProps<CardImageClass> {
|
||||
src?: string;
|
||||
}
|
||||
type CardImageClass = React.StatelessComponent<CardImageProps>
|
||||
export const CardImage: CardImageClass;
|
||||
|
||||
export interface CheckboxProps extends BaseProps<CheckboxClass> {
|
||||
label?: string;
|
||||
checked?: boolean;
|
||||
name?: string;
|
||||
readOnly?: boolean;
|
||||
theme?: "primary" | "secondary" | "default" | "info" | "success" | "warning" | "error";
|
||||
}
|
||||
type CheckboxClass = React.StatelessComponent<CheckboxProps>
|
||||
export const Checkbox: CheckboxClass;
|
||||
|
||||
export interface CloseProps extends BaseProps<CloseClass> {
|
||||
}
|
||||
type CloseClass = React.StatelessComponent<CloseProps>
|
||||
export const Close: CloseClass;
|
||||
|
||||
export interface ContainerProps extends BaseProps<ContainerClass> {
|
||||
}
|
||||
type ContainerClass = React.StatelessComponent<ContainerProps>
|
||||
export const Container: ContainerClass;
|
||||
|
||||
export interface DividerProps extends BaseProps<DividerClass> {
|
||||
width?: number;
|
||||
}
|
||||
type DividerClass = React.StatelessComponent<DividerProps>
|
||||
export const Divider: DividerClass;
|
||||
|
||||
export interface DonutProps extends BaseProps<DonutClass> {
|
||||
value?: number;
|
||||
size?: number;
|
||||
strokeWidth?: number;
|
||||
color?: string;
|
||||
}
|
||||
type DonutClass = React.StatelessComponent<DonutProps>
|
||||
export const Donut: DonutClass;
|
||||
|
||||
export interface DotIndicatorProps extends BaseProps<DotIndicatorClass> {
|
||||
length?: number;
|
||||
active?: number;
|
||||
onClick?: Function;
|
||||
}
|
||||
type DotIndicatorClass = React.StatelessComponent<DotIndicatorProps>
|
||||
export const DotIndicator: DotIndicatorClass;
|
||||
|
||||
export interface DrawerProps extends BaseProps<DrawerClass> {
|
||||
size?: number;
|
||||
open?: boolean;
|
||||
position?: "top" | "right" | "bottom" | "left";
|
||||
onDismiss?: Function;
|
||||
}
|
||||
type DrawerClass = React.StatelessComponent<DrawerProps>
|
||||
export const Drawer: DrawerClass;
|
||||
|
||||
export interface DropdownProps extends BaseProps<DropdownClass> {
|
||||
}
|
||||
type DropdownClass = React.StatelessComponent<DropdownProps>
|
||||
export const Dropdown: DropdownClass;
|
||||
|
||||
export interface DropdownMenuProps extends BaseProps<DropdownMenuClass> {
|
||||
open?: boolean;
|
||||
right?: boolean;
|
||||
top?: boolean;
|
||||
onDismiss?: Function;
|
||||
}
|
||||
type DropdownMenuClass = React.StatelessComponent<DropdownMenuProps>
|
||||
export const DropdownMenu: DropdownMenuClass;
|
||||
|
||||
export interface EmbedProps extends BaseProps<EmbedClass> {
|
||||
ratio?: number;
|
||||
}
|
||||
type EmbedClass = React.StatelessComponent<EmbedProps>
|
||||
export const Embed: EmbedClass;
|
||||
|
||||
export interface FixedProps extends BaseProps<FixedClass> {
|
||||
top?: boolean;
|
||||
right?: boolean;
|
||||
bottom?: boolean;
|
||||
left?: boolean;
|
||||
zIndex?: number;
|
||||
}
|
||||
type FixedClass = React.StatelessComponent<FixedProps>
|
||||
export const Fixed: FixedClass;
|
||||
|
||||
export interface FooterProps extends BaseProps<FooterClass> {
|
||||
}
|
||||
type FooterClass = React.StatelessComponent<FooterProps>
|
||||
export const Footer: FooterClass;
|
||||
|
||||
export interface HeadingProps extends BaseProps<HeadingClass> {
|
||||
big?: boolean;
|
||||
level?: number;
|
||||
size?: number;
|
||||
alt?: boolean;
|
||||
}
|
||||
type HeadingClass = React.StatelessComponent<HeadingProps>
|
||||
export const Heading: HeadingClass;
|
||||
|
||||
export interface HeadingLinkProps extends BaseProps<HeadingLinkClass> {
|
||||
level?: number;
|
||||
size?: number;
|
||||
href?: string;
|
||||
}
|
||||
type HeadingLinkClass = React.StatelessComponent<HeadingLinkProps>
|
||||
export const HeadingLink: HeadingLinkClass;
|
||||
|
||||
export interface InlineFormProps extends BaseProps<InlineFormClass> {
|
||||
label?: string;
|
||||
name?: string;
|
||||
value?: number | string;
|
||||
placeholder?: string;
|
||||
onChange?: Function;
|
||||
buttonLabel?: string;
|
||||
onClick?: Function;
|
||||
}
|
||||
type InlineFormClass = React.StatelessComponent<InlineFormProps>
|
||||
export const InlineForm: InlineFormClass;
|
||||
|
||||
export interface InputProps extends BaseProps<InputClass> {
|
||||
label?: string;
|
||||
name?: string;
|
||||
type?: string;
|
||||
message?: string;
|
||||
hideLabel?: boolean;
|
||||
rounded?: boolean | "top" | "right" | "bottom" | "left";
|
||||
placeholder?: string;
|
||||
}
|
||||
type InputClass = React.StatelessComponent<InputProps>
|
||||
export const Input: InputClass;
|
||||
|
||||
export interface LabelProps extends BaseProps<LabelClass> {
|
||||
hide?: boolean;
|
||||
}
|
||||
type LabelClass = React.StatelessComponent<LabelProps>
|
||||
export const Label: LabelClass;
|
||||
|
||||
export interface LinkBlockProps extends BaseProps<LinkBlockClass> {
|
||||
is?: string | Object | Function;
|
||||
href?: string;
|
||||
}
|
||||
type LinkBlockClass = React.StatelessComponent<LinkBlockProps>
|
||||
export const LinkBlock: LinkBlockClass;
|
||||
|
||||
export interface MediaProps extends BaseProps<MediaClass> {
|
||||
img?: string;
|
||||
right?: boolean;
|
||||
align?: "top" | "center" | "bottom";
|
||||
}
|
||||
type MediaClass = React.StatelessComponent<MediaProps>
|
||||
export const Media: MediaClass;
|
||||
|
||||
export interface MenuProps extends BaseProps<MenuClass> {
|
||||
}
|
||||
type MenuClass = React.StatelessComponent<MenuProps>
|
||||
export const Menu: MenuClass;
|
||||
|
||||
export interface MessageProps extends BaseProps<MessageClass> {
|
||||
theme?: "primary" | "secondary" | "default" | "info" | "success" | "warning" | "error";
|
||||
}
|
||||
type MessageClass = React.StatelessComponent<MessageProps>
|
||||
export const Message: MessageClass;
|
||||
|
||||
export interface NavItemProps extends BaseProps<NavItemClass> {
|
||||
small?: boolean;
|
||||
is?: string | Object | Function;
|
||||
}
|
||||
type NavItemClass = React.StatelessComponent<NavItemProps>
|
||||
export const NavItem: NavItemClass;
|
||||
|
||||
export interface OverlayProps extends BaseProps<OverlayClass> {
|
||||
open?: boolean;
|
||||
dark?: boolean;
|
||||
box?: boolean;
|
||||
fullWidth?: boolean;
|
||||
onDismiss?: Function;
|
||||
}
|
||||
type OverlayClass = React.StatelessComponent<OverlayProps>
|
||||
export const Overlay: OverlayClass;
|
||||
|
||||
export interface PageHeaderProps extends BaseProps<PageHeaderClass> {
|
||||
heading?: string;
|
||||
description?: string;
|
||||
}
|
||||
type PageHeaderClass = React.StatelessComponent<PageHeaderProps>
|
||||
export const PageHeader: PageHeaderClass;
|
||||
|
||||
export interface PanelProps extends BaseProps<PanelClass> {
|
||||
theme?: "primary" | "secondary" | "default" | "info" | "success" | "warning" | "error";
|
||||
}
|
||||
type PanelClass = React.StatelessComponent<PanelProps>
|
||||
export const Panel: PanelClass;
|
||||
|
||||
export interface PanelFooterProps extends BaseProps<PanelFooterClass> {
|
||||
theme?: "primary" | "secondary" | "default" | "info" | "success" | "warning" | "error";
|
||||
}
|
||||
type PanelFooterClass = React.StatelessComponent<PanelFooterProps>
|
||||
export const PanelFooter: PanelFooterClass;
|
||||
|
||||
export interface PanelHeaderProps extends BaseProps<PanelHeaderClass> {
|
||||
theme?: "primary" | "secondary" | "default" | "info" | "success" | "warning" | "error";
|
||||
}
|
||||
type PanelHeaderClass = React.StatelessComponent<PanelHeaderProps>
|
||||
export const PanelHeader: PanelHeaderClass;
|
||||
|
||||
export interface PreProps extends BaseProps<PreClass> {
|
||||
}
|
||||
type PreClass = React.StatelessComponent<PreProps>
|
||||
export const Pre: PreClass;
|
||||
|
||||
export interface ProgressProps extends BaseProps<ProgressClass> {
|
||||
value?: number;
|
||||
color?: string;
|
||||
}
|
||||
type ProgressClass = React.StatelessComponent<ProgressProps>
|
||||
export const Progress: ProgressClass;
|
||||
|
||||
export interface RadioProps extends BaseProps<RadioClass> {
|
||||
checked?: boolean;
|
||||
group?: string;
|
||||
label?: string;
|
||||
name?: string;
|
||||
readOnly?: boolean;
|
||||
}
|
||||
type RadioClass = React.StatelessComponent<RadioProps>
|
||||
export const Radio: RadioClass;
|
||||
|
||||
export interface RatingProps extends BaseProps<RatingClass> {
|
||||
value?: number;
|
||||
onClick?: Function;
|
||||
}
|
||||
type RatingClass = React.StatelessComponent<RatingProps>
|
||||
export const Rating: RatingClass;
|
||||
|
||||
export interface SectionProps extends BaseProps<SectionClass> {
|
||||
}
|
||||
type SectionClass = React.StatelessComponent<SectionProps>
|
||||
export const Section: SectionClass;
|
||||
|
||||
export interface SectionHeaderProps extends BaseProps<SectionHeaderClass> {
|
||||
heading?: string;
|
||||
href?: string;
|
||||
description?: string;
|
||||
}
|
||||
type SectionHeaderClass = React.StatelessComponent<SectionHeaderProps>
|
||||
export const SectionHeader: SectionHeaderClass;
|
||||
|
||||
export interface SelectProps extends BaseProps<SelectClass> {
|
||||
label?: string;
|
||||
name?: string;
|
||||
options?: {
|
||||
children: any;
|
||||
value: any;
|
||||
}[];
|
||||
message?: string;
|
||||
hideLabel?: boolean;
|
||||
}
|
||||
type SelectClass = React.StatelessComponent<SelectProps>
|
||||
export const Select: SelectClass;
|
||||
|
||||
export interface SequenceMapProps extends BaseProps<SequenceMapClass> {
|
||||
steps?: {
|
||||
children: any;
|
||||
href: string;
|
||||
}[];
|
||||
active?: number;
|
||||
}
|
||||
type SequenceMapClass = React.StatelessComponent<SequenceMapProps>
|
||||
export const SequenceMap: SequenceMapClass;
|
||||
|
||||
export interface SequenceMapStepProps extends BaseProps<SequenceMapStepClass> {
|
||||
width?: string;
|
||||
first?: boolean;
|
||||
active?: boolean;
|
||||
}
|
||||
type SequenceMapStepClass = React.StatelessComponent<SequenceMapStepProps>
|
||||
export const SequenceMapStep: SequenceMapStepClass;
|
||||
|
||||
export interface SliderProps extends BaseProps<SliderClass> {
|
||||
label?: string;
|
||||
name?: string;
|
||||
fill?: boolean;
|
||||
hideLabel?: boolean;
|
||||
value?: number;
|
||||
defaultValue?: number;
|
||||
readOnly?: boolean;
|
||||
}
|
||||
type SliderClass = React.StatelessComponent<SliderProps>
|
||||
export const Slider: SliderClass;
|
||||
|
||||
export interface SpaceProps extends BaseProps<SpaceClass> {
|
||||
x?: number;
|
||||
auto?: boolean;
|
||||
}
|
||||
type SpaceClass = React.StatelessComponent<SpaceProps>
|
||||
export const Space: SpaceClass;
|
||||
|
||||
export interface StatProps extends BaseProps<StatClass> {
|
||||
value?: number | string;
|
||||
unit?: string;
|
||||
label?: string;
|
||||
topLabel?: boolean;
|
||||
}
|
||||
type StatClass = React.StatelessComponent<StatProps>
|
||||
export const Stat: StatClass;
|
||||
|
||||
export interface SwitchProps extends BaseProps<SwitchClass> {
|
||||
checked?: boolean;
|
||||
}
|
||||
type SwitchClass = React.StatelessComponent<SwitchProps>
|
||||
export const Switch: SwitchClass;
|
||||
|
||||
export interface TableProps extends BaseProps<TableClass> {
|
||||
headings?: any[];
|
||||
data?: any[][];
|
||||
}
|
||||
type TableClass = React.StatelessComponent<TableProps>
|
||||
export const Table: TableClass;
|
||||
|
||||
export interface TextProps extends BaseProps<TextClass> {
|
||||
small?: boolean;
|
||||
bold?: boolean;
|
||||
}
|
||||
type TextClass = React.StatelessComponent<TextProps>
|
||||
export const Text: TextClass;
|
||||
|
||||
export interface TextareaProps extends BaseProps<TextareaClass> {
|
||||
label?: string;
|
||||
name?: string;
|
||||
message?: string;
|
||||
hideLabel?: boolean;
|
||||
}
|
||||
type TextareaClass = React.StatelessComponent<TextareaProps>
|
||||
export const Textarea: TextareaClass;
|
||||
|
||||
export interface ToolbarProps extends BaseProps<ToolbarClass> {
|
||||
}
|
||||
type ToolbarClass = React.StatelessComponent<ToolbarProps>
|
||||
export const Toolbar: ToolbarClass;
|
||||
|
||||
export interface TooltipProps extends BaseProps<TooltipClass> {
|
||||
title?: string;
|
||||
}
|
||||
type TooltipClass = React.StatelessComponent<TooltipProps>
|
||||
export const Tooltip: TooltipClass;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
/// <reference path="../redux/redux.d.ts"/>
|
||||
/// <reference path="redux-debounced.d.ts"/>
|
||||
|
||||
import { applyMiddleware } from 'redux';
|
||||
import createDebounce from 'redux-debounced';
|
||||
|
||||
applyMiddleware(createDebounce());
|
||||
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
// Type definitions for redux-debounced v0.2.0
|
||||
// Project: https://github.com/ryanseddon/redux-debounced
|
||||
// Definitions by: Sean Kelley <https://github.com/seansfkelley>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../redux/redux.d.ts" />
|
||||
|
||||
declare module "redux-debounced" {
|
||||
import { Middleware } from 'redux';
|
||||
export default function createDebounce(): Middleware;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
/// <reference path="../rx/rx.all.d.ts" />
|
||||
/// <reference path="./rx-dom.d.ts" />
|
||||
|
||||
import * as Rx from 'rx';
|
||||
import * as DOM from 'rx.DOM';
|
||||
Vendored
+142
@@ -0,0 +1,142 @@
|
||||
// Type definitions for RxJS v2.5.3
|
||||
// Project: https://github.com/Reactive-Extensions/RxJS-DOM
|
||||
// Definitions by: oliver Weichhold <https://github.com/oliverw>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../rx/rx.all.d.ts" />
|
||||
|
||||
declare module Rx.DOM {
|
||||
export interface AjaxSettings {
|
||||
async?: boolean;
|
||||
body?: string;
|
||||
// This options does not seem to be used in the code yet
|
||||
// contentType?: string;
|
||||
crossDomain?: boolean;
|
||||
headers?: any;
|
||||
method?: string;
|
||||
password?: string;
|
||||
progressObserver?: Rx.Observer<any>;
|
||||
responseType?: string;
|
||||
url?: string;
|
||||
user?: string;
|
||||
}
|
||||
|
||||
export interface AjaxSuccessResponse {
|
||||
response: any;
|
||||
status: number;
|
||||
responseType: string;
|
||||
xhr: XMLHttpRequest;
|
||||
originalEvent: Event;
|
||||
}
|
||||
|
||||
export interface AjaxErrorResponse {
|
||||
type: string;
|
||||
status: number;
|
||||
xhr: XMLHttpRequest;
|
||||
originalEvent: Event;
|
||||
}
|
||||
|
||||
export interface JsonpSettings {
|
||||
async?: boolean;
|
||||
jsonp?: string;
|
||||
jsonpCallback?: string;
|
||||
url?: string;
|
||||
}
|
||||
|
||||
export interface JsonpSuccessResponse {
|
||||
response: any;
|
||||
status: number;
|
||||
responseType: string;
|
||||
originalEvent: Event;
|
||||
}
|
||||
|
||||
export interface JsonpErrorResponse {
|
||||
type: string;
|
||||
status: number;
|
||||
originalEvent: Event;
|
||||
}
|
||||
|
||||
export interface GeolocationOptions {
|
||||
enableHighAccuracy?: boolean;
|
||||
timeout?: number;
|
||||
maximumAge?: number;
|
||||
}
|
||||
|
||||
// Events
|
||||
function fromEvent<T>(element:any, eventName:string, selector?:Function, useCapture?:boolean):Rx.Observable<T>;
|
||||
|
||||
function ready():Rx.Observable<any>;
|
||||
|
||||
// Event Shortcuts
|
||||
function blur(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<FocusEvent>;
|
||||
function change(element: Element, selector?:Function):Rx.Observable<Event>;
|
||||
function click(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<MouseEvent>;
|
||||
function contextmenu(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<MouseEvent>;
|
||||
function dblclick(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<MouseEvent>;
|
||||
function error(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<Event>;
|
||||
function focus(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<FocusEvent>;
|
||||
function focusin(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<MouseEvent>;
|
||||
function focusout(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<MouseEvent>;
|
||||
function keydown(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<KeyboardEvent>;
|
||||
function keypress(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<KeyboardEvent>;
|
||||
function keyup(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<KeyboardEvent>;
|
||||
function load(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<UIEvent>;
|
||||
function mousedown(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<MouseEvent>;
|
||||
function mouseenter(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<MouseEvent>;
|
||||
function mouseleave(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<MouseEvent>;
|
||||
function mousemove(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<MouseEvent>;
|
||||
function mouseout(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<MouseEvent>;
|
||||
function mouseover(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<MouseEvent>;
|
||||
function mouseup(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<MouseEvent>;
|
||||
function resize(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<UIEvent>;
|
||||
function scroll(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<UIEvent>;
|
||||
function select(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<Event>;
|
||||
function submit(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<Event>;
|
||||
function unload(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<Event>;
|
||||
|
||||
// Pointer Events
|
||||
function pointerdown(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<PointerEvent>;
|
||||
function pointerenter(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<PointerEvent>;
|
||||
function pointerleave(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<PointerEvent>;
|
||||
function pointermove(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<PointerEvent>;
|
||||
function pointerout(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<PointerEvent>;
|
||||
function pointerover(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<PointerEvent>;
|
||||
function pointerup(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<PointerEvent>;
|
||||
|
||||
// Touch Events
|
||||
function touchcancel(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<TouchEvent>;
|
||||
function touchend(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<TouchEvent>;
|
||||
function touchmove(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<TouchEvent>;
|
||||
function touchstart(element: Element, selector?:Function, useCapture?:boolean):Rx.Observable<TouchEvent>;
|
||||
|
||||
// Ajax
|
||||
function ajax(url:string):Rx.Observable<AjaxSuccessResponse | AjaxErrorResponse>;
|
||||
function ajax(settings:AjaxSettings):Rx.Observable<AjaxSuccessResponse | AjaxErrorResponse>;
|
||||
function get(url:string):Rx.Observable<AjaxSuccessResponse | AjaxErrorResponse>;
|
||||
function getJSON(url:string):Rx.Observable<string>;
|
||||
function post(url:string, body:any):Rx.Observable<AjaxSuccessResponse | AjaxErrorResponse>;
|
||||
function jsonpRequest(url:string):Rx.Observable<string>;
|
||||
function jsonpRequest(settings:JsonpSettings):Rx.Observable<JsonpSuccessResponse | JsonpErrorResponse>;
|
||||
|
||||
// Server-Sent Events
|
||||
function fromEventSource<T>(url:string, openObservable?:Rx.Observer<T>):Rx.Observable<T>;
|
||||
|
||||
// Web Sockets
|
||||
function fromWebSocket(url:string, protocol:string, openObserver?:Rx.Observer<Event>, closingObserver?:Rx.Observer<CloseEvent>):Rx.Subject<MessageEvent>;
|
||||
|
||||
// Web Workers
|
||||
function fromWebWorker(url:string):Rx.Subject<string>;
|
||||
|
||||
// Mutation Observers
|
||||
function fromMutationObserver(target:Node, options:MutationObserverInit):Rx.Observable<MutationEvent>;
|
||||
|
||||
// Geolocation
|
||||
export module geolocation {
|
||||
function getCurrentPosition(geolocationOptions?:GeolocationOptions):Rx.Observable<Position>;
|
||||
function watchPosition(geolocationOptions?:GeolocationOptions):Rx.Observable<Position>;
|
||||
}
|
||||
}
|
||||
|
||||
declare module "rx.DOM" {
|
||||
export default Rx.DOM;
|
||||
}
|
||||
Vendored
+7
-2
@@ -572,10 +572,12 @@ declare namespace Rx {
|
||||
catchError<T>(...sources: Observable<T>[]): Observable<T>; // alias for catch
|
||||
catchError<T>(...sources: IPromise<T>[]): Observable<T>; // alias for catch
|
||||
|
||||
combineLatest<T, T2>(first: Observable<T>, second: Observable<T2>): Observable<[T, T2]>;
|
||||
combineLatest<T, T2, TResult>(first: Observable<T>, second: Observable<T2>, resultSelector: (v1: T, v2: T2) => TResult): Observable<TResult>;
|
||||
combineLatest<T, T2, TResult>(first: IPromise<T>, second: Observable<T2>, resultSelector: (v1: T, v2: T2) => TResult): Observable<TResult>;
|
||||
combineLatest<T, T2, TResult>(first: Observable<T>, second: IPromise<T2>, resultSelector: (v1: T, v2: T2) => TResult): Observable<TResult>;
|
||||
combineLatest<T, T2, TResult>(first: IPromise<T>, second: IPromise<T2>, resultSelector: (v1: T, v2: T2) => TResult): Observable<TResult>;
|
||||
combineLatest<T, T2, T3>(first: Observable<T>, second: Observable<T2>, third: Observable<T3>): Observable<[T, T2, T3]>;
|
||||
combineLatest<T, T2, T3, TResult>(first: Observable<T>, second: Observable<T2>, third: Observable<T3>, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable<TResult>;
|
||||
combineLatest<T, T2, T3, TResult>(first: Observable<T>, second: Observable<T2>, third: IPromise<T3>, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable<TResult>;
|
||||
combineLatest<T, T2, T3, TResult>(first: Observable<T>, second: IPromise<T2>, third: Observable<T3>, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable<TResult>;
|
||||
@@ -584,6 +586,7 @@ declare namespace Rx {
|
||||
combineLatest<T, T2, T3, TResult>(first: IPromise<T>, second: Observable<T2>, third: IPromise<T3>, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable<TResult>;
|
||||
combineLatest<T, T2, T3, TResult>(first: IPromise<T>, second: IPromise<T2>, third: Observable<T3>, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable<TResult>;
|
||||
combineLatest<T, T2, T3, TResult>(first: IPromise<T>, second: IPromise<T2>, third: IPromise<T3>, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable<TResult>;
|
||||
combineLatest<T, T2, T3, T4>(first: Observable<T>, second: Observable<T2>, third: Observable<T3>, fourth: Observable<T4>): Observable<[T, T2, T3, T4]>;
|
||||
combineLatest<T, T2, T3, T4, TResult>(first: Observable<T>, second: Observable<T2>, third: Observable<T3>, fourth: Observable<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
|
||||
combineLatest<T, T2, T3, T4, TResult>(first: Observable<T>, second: Observable<T2>, third: Observable<T3>, fourth: IPromise<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
|
||||
combineLatest<T, T2, T3, T4, TResult>(first: Observable<T>, second: Observable<T2>, third: IPromise<T3>, fourth: Observable<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
|
||||
@@ -600,9 +603,11 @@ declare namespace Rx {
|
||||
combineLatest<T, T2, T3, T4, TResult>(first: IPromise<T>, second: IPromise<T2>, third: Observable<T3>, fourth: IPromise<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
|
||||
combineLatest<T, T2, T3, T4, TResult>(first: IPromise<T>, second: IPromise<T2>, third: IPromise<T3>, fourth: Observable<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
|
||||
combineLatest<T, T2, T3, T4, TResult>(first: IPromise<T>, second: IPromise<T2>, third: IPromise<T3>, fourth: IPromise<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
|
||||
combineLatest<T, T2, T3, T4, T5>(first: Observable<T>, second: Observable<T2>, third: Observable<T3>, fourth: Observable<T4>, fifth: Observable<T5>): Observable<[T, T2, T3, T4, T5]>;
|
||||
combineLatest<T, T2, T3, T4, T5, TResult>(first: Observable<T>, second: Observable<T2>, third: Observable<T3>, fourth: Observable<T4>, fifth: Observable<T5>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => TResult): Observable<TResult>;
|
||||
combineLatest<TOther, TResult>(souces: Observable<TOther>[], resultSelector: (...otherValues: TOther[]) => TResult): Observable<TResult>;
|
||||
combineLatest<TOther, TResult>(souces: IPromise<TOther>[], resultSelector: (...otherValues: TOther[]) => TResult): Observable<TResult>;
|
||||
combineLatest<T>(sources: Observable<T>[]): Observable<T[]>;
|
||||
combineLatest<TOther, TResult>(sources: Observable<TOther>[], resultSelector: (...otherValues: TOther[]) => TResult): Observable<TResult>;
|
||||
combineLatest<TOther, TResult>(sources: IPromise<TOther>[], resultSelector: (...otherValues: TOther[]) => TResult): Observable<TResult>;
|
||||
|
||||
withLatestFrom<T, T2, TResult>(first: Observable<T>, second: Observable<T2>, resultSelector: (v1: T, v2: T2) => TResult): Observable<TResult>;
|
||||
withLatestFrom<T, T2, TResult>(first: IPromise<T>, second: Observable<T2>, resultSelector: (v1: T, v2: T2) => TResult): Observable<TResult>;
|
||||
|
||||
Vendored
+1
-1
@@ -29,6 +29,6 @@ declare namespace Rx {
|
||||
* An array of observables. The first triggers when the predicate returns true,
|
||||
* and the second triggers when the predicate returns false.
|
||||
*/
|
||||
partition(predicate: (value: T, index: number, source: Observable<T>) => boolean, thisArg: any): Observable<T>[];
|
||||
partition(predicate: (value: T, index: number, source: Observable<T>) => boolean, thisArg?: any): Observable<T>[];
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -132,9 +132,9 @@ var Client = require('ssh2').Client;
|
||||
var conn = new Client();
|
||||
conn.on('ready', () => {
|
||||
console.log('Client :: ready');
|
||||
conn.sftp( (err: Error, sftp: any) => {
|
||||
conn.sftp( (err: Error, sftp: ssh2.Sftp.Wrapper) => {
|
||||
if (err) throw err;
|
||||
sftp.readdir('foo', (err: Error, list: any) => {
|
||||
sftp.readdir('foo', (err: Error, list: ssh2.Sftp.ReadDirItem[]) => {
|
||||
if (err) throw err;
|
||||
console.dir(list);
|
||||
conn.end();
|
||||
|
||||
Vendored
+93
-2
@@ -9,7 +9,7 @@ declare module "ssh2" {
|
||||
import stream = require('stream');
|
||||
|
||||
namespace ssh2 {
|
||||
interface Client {
|
||||
interface Client extends NodeJS.EventEmitter {
|
||||
Server: ServerStatic;
|
||||
new(): Client;
|
||||
/**
|
||||
@@ -326,8 +326,99 @@ declare module "ssh2" {
|
||||
EXCL: number;
|
||||
}
|
||||
|
||||
interface Attributes {
|
||||
mode: number;
|
||||
uid: number;
|
||||
gid: number;
|
||||
size: number;
|
||||
atime: number;
|
||||
mtime: number;
|
||||
}
|
||||
interface InputAttributes {
|
||||
mode?: number;
|
||||
uid?: number;
|
||||
gid?: number;
|
||||
size?: number;
|
||||
atime?: number;
|
||||
mtime?: number;
|
||||
}
|
||||
interface Stats extends Attributes {
|
||||
isDirectory(): boolean;
|
||||
isFile(): boolean;
|
||||
isBlockDevice(): boolean;
|
||||
isCharacterDevice(): boolean;
|
||||
isSymbloicLink(): boolean;
|
||||
isFIFO(): boolean;
|
||||
isSocket(): boolean;
|
||||
}
|
||||
|
||||
interface Wrapper extends NodeJS.EventEmitter {
|
||||
//TODO: extends `ssh2-streams.SFTPStream`
|
||||
fastGet(remotePath: string, localPath: string, callback: (err: any) => void): void;
|
||||
fastGet(remotePath: string, localPath: string, options: TransferOptions, callback: (err: any) => void): void;
|
||||
fastPut(localPath: string, remotePath: string, callback: (err: any) => void): void;
|
||||
fastPut(localPath: string, remotePath: string, options: TransferOptions, callback: (err: any) => void): void;
|
||||
|
||||
createReadStream(path: string, options?: ReadStreamOptions): stream.Readable;
|
||||
createWriteStream(path: string, options?: WriteStreamOptions): stream.Writable;
|
||||
open(filename: string, mode: string, callback: (err: any, handle: Buffer) => void): boolean;
|
||||
open(filename: string, mode: string, attributes: InputAttributes, callback: (err: any, handle: Buffer) => void): boolean;
|
||||
close(handle: Buffer, callback: (err: any) => void): boolean;
|
||||
readData(handle: Buffer, buffer: Buffer, offset: number, length: number, position: number,
|
||||
callback: (err: any, bytesRead: number, buffer: Buffer, position: number) => void): boolean;
|
||||
writeData(handle: Buffer, buffer: Buffer, offset: number, length: number, position: number,
|
||||
callback: (err: any) => void): boolean;
|
||||
fstat(handle: Buffer, callback: (err: any, stats: Stats) => void): boolean;
|
||||
fsetstat(handle: Buffer, attributes: InputAttributes, callback: (err: any) => void): boolean;
|
||||
futimes(handle: Buffer, atime: number | Date, mtime: number | Date, callback: (err: any) => void): boolean;
|
||||
fchown(handle: Buffer, uid: number, gid: number, callback: (err: any) => void): boolean;
|
||||
fchmod(handle: Buffer, mode: number | string, callback: (err: any) => void): boolean;
|
||||
opendir(path: string, callback: (err: any, handle: Buffer) => void): boolean;
|
||||
readdir(location: string | Buffer, callback: (err: any, list: ReadDirItem[]) => void): boolean;
|
||||
unlink(path: string, callback: (err: any) => void): boolean;
|
||||
rename(srcPath: string, destPath: string, callback: (err: any) => void): boolean;
|
||||
mkdir(path: string, callback: (err: any) => void): boolean;
|
||||
mkdir(path: string, attributes: InputAttributes, callback: (err: any) => void): boolean;
|
||||
rmdir(path: string, callback: (err: any) => void): boolean;
|
||||
stat(path: string, callback: (err: any, stats: Stats) => void): boolean;
|
||||
lstat(path: string, callback: (err: any, stats: Stats) => void): boolean;
|
||||
setstat(path: string, attributes: InputAttributes, callback: (err: any) => void): boolean;
|
||||
utimes(path: string, atime: number | Date, mtime: number | Date, callback: (err: any) => void): boolean;
|
||||
chown(path: string, uid: number, gid: number, callback: (err: any) => void): boolean;
|
||||
chmod(path: string, mode: number | string, callback: (err: any) => void): boolean;
|
||||
readlink(path: string, callback: (err: any, target: string) => void): boolean;
|
||||
symlink(targetPath: string, linkPath: string, callback: (err: any) => void): boolean;
|
||||
realpath(path: string, callback: (err: any, absPath: string) => void): boolean;
|
||||
|
||||
ext_openssh_rename(srcPath: string, destPath: string, callback: (err: any) => void): boolean;
|
||||
ext_openssh_statvfs(path: string, callback: (err: any, fsInfo: any) => void): boolean;
|
||||
ext_openssh_fstatvfs(handle: Buffer, callback: (err: any, fsInfo: any) => void): boolean;
|
||||
ext_openssh_hardlink(targetPath: string, linkPath: string, callback: (err: any) => void): boolean;
|
||||
ext_openssh_fsync(handle: Buffer, callback: (err: any, fsInfo: any) => void): boolean;
|
||||
}
|
||||
|
||||
interface TransferOptions {
|
||||
concurrency?: number;
|
||||
chunkSize?: number;
|
||||
step?: (total_transferred: number, chunk: number, total: number) => void;
|
||||
}
|
||||
interface ReadStreamOptions {
|
||||
flags?: string;
|
||||
encoding?: string;
|
||||
handle?: Buffer;
|
||||
mode?: number;
|
||||
autoClose?: boolean;
|
||||
start?: number;
|
||||
end?: number;
|
||||
}
|
||||
interface WriteStreamOptions {
|
||||
flags?: string;
|
||||
encoding?: string;
|
||||
mode?: number;
|
||||
}
|
||||
interface ReadDirItem {
|
||||
filename: string;
|
||||
longname: string;
|
||||
attrs: Attributes;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+729
-93
File diff suppressed because it is too large
Load Diff
Vendored
+5217
-1821
File diff suppressed because it is too large
Load Diff
Vendored
+2
-2
@@ -6122,7 +6122,7 @@ declare namespace THREE {
|
||||
|
||||
export interface TextGeometryParameters {
|
||||
font: Font;
|
||||
site: number;
|
||||
size: number;
|
||||
height: number;
|
||||
curveSegments: number;
|
||||
bevelEnabled: boolean;
|
||||
@@ -6135,7 +6135,7 @@ declare namespace THREE {
|
||||
|
||||
parameters: {
|
||||
font: Font;
|
||||
site: number;
|
||||
size: number;
|
||||
height: number;
|
||||
curveSegments: number;
|
||||
bevelEnabled: boolean;
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
/// <reference path="./twitter-text.d.ts" />
|
||||
|
||||
import * as twitter from "twitter-text";
|
||||
|
||||
const text: string = twitter.htmlEscape("@you #hello < @world > https://github.com");
|
||||
const entities = twitter.extractEntitiesWithIndices(text);
|
||||
|
||||
function isHashtagEntity(e: twitter.EntityWithIndices): e is twitter.HashtagWithIndices {
|
||||
return "hashtag" in e;
|
||||
}
|
||||
|
||||
function isUrlEntity(e: twitter.EntityWithIndices): e is twitter.UrlWithIndices {
|
||||
return "url" in e;
|
||||
}
|
||||
|
||||
function isMentionEntity(e: twitter.EntityWithIndices): e is twitter.MentionWithIndices {
|
||||
return "screenName" in e;
|
||||
}
|
||||
|
||||
function isCashtagEntity(e: twitter.EntityWithIndices): e is twitter.CashtagWithIndices {
|
||||
return "cashtag" in e;
|
||||
}
|
||||
|
||||
for (let e of entities) {
|
||||
e = twitter.modifyIndicesFromUnicodeToUTF16(e);
|
||||
if (isHashtagEntity(e)) {
|
||||
console.log("hashtag: ", e.hashtag);
|
||||
} else if (isUrlEntity(e)) {
|
||||
console.log("url: ", e.url);
|
||||
} else if (isMentionEntity(e)) {
|
||||
console.log("screenName: ", e.screenName);
|
||||
} else if (isCashtagEntity(e)) {
|
||||
console.log("cashtag: ", e.cashtag);
|
||||
} else {
|
||||
console.error("Unreachable");
|
||||
}
|
||||
console.log(`indices: (${e.indices[0]}, ${e.indices[1]})`);
|
||||
}
|
||||
|
||||
let result: string;
|
||||
result = twitter.autoLink(text);
|
||||
result = twitter.autoLinkUsernamesOrLists(text);
|
||||
result = twitter.autoLinkHashtags(text);
|
||||
result = twitter.autoLinkCashtags(text);
|
||||
result = twitter.autoLinkUrlsCustom(text);
|
||||
|
||||
const len: number = twitter.getTweetLength(text);
|
||||
|
||||
const linked: string = twitter.autoLink("link @user, and expand url... http://t.co/0JG5Mcq", {
|
||||
urlEntities: [
|
||||
{
|
||||
url: "http://t.co/0JG5Mcq",
|
||||
display_url: "blog.twitter.com/2011/05/twitte…",
|
||||
expanded_url: "http://blog.twitter.com/2011/05/twitter-for-mac-update.html",
|
||||
indices: [
|
||||
30,
|
||||
48
|
||||
]
|
||||
}
|
||||
]});
|
||||
|
||||
const usernames: string[] = twitter.extractMentions("Mentioning @twitter and @jack");
|
||||
Vendored
+103
@@ -0,0 +1,103 @@
|
||||
// Type definitions for twitter-text v1.13.4
|
||||
// Project: https://github.com/twitter/twitter-text
|
||||
// Definitions by: rhysd <https://rhysd.github.io>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module "twitter-text" {
|
||||
export interface HashtagWithIndices {
|
||||
hashtag: string;
|
||||
indices: [number, number];
|
||||
}
|
||||
export interface UrlWithIndices {
|
||||
url: string;
|
||||
indices: [number, number];
|
||||
}
|
||||
export interface MentionWithIndices {
|
||||
screenName: string;
|
||||
indices: [number, number];
|
||||
}
|
||||
export interface MentionOrListWithIndices {
|
||||
screenName: string;
|
||||
listSlug: string;
|
||||
indices: [number, number];
|
||||
}
|
||||
export interface CashtagWithIndices {
|
||||
cashtag: string;
|
||||
indices: [number, number];
|
||||
}
|
||||
export type EntityWithIndices =
|
||||
HashtagWithIndices |
|
||||
UrlWithIndices |
|
||||
MentionWithIndices |
|
||||
MentionOrListWithIndices |
|
||||
CashtagWithIndices;
|
||||
|
||||
interface Indices {
|
||||
indices: [number, number];
|
||||
}
|
||||
|
||||
export function htmlEscape(text: string): string;
|
||||
export function splitTags(text: string): string[];
|
||||
|
||||
export function extractHashtags(text: string): string[];
|
||||
export function extractHashtagsWithIndices(text: string): HashtagWithIndices[];
|
||||
export function extractUrls(text: string): string[];
|
||||
export function extractUrlsWithIndices(text: string): UrlWithIndices[];
|
||||
export function extractMentions(text: string): string[];
|
||||
export function extractMentionsWithIndices(text: string): MentionWithIndices[];
|
||||
export function extractMentionsOrListsWithIndices(text: string): MentionOrListWithIndices[];
|
||||
export function extractReplies(text: string): string[];
|
||||
export function extractCashtags(text: string): string[];
|
||||
export function extractCashtagsWithIndices(text: string): CashtagWithIndices[];
|
||||
export function extractEntitiesWithIndices(text: string): EntityWithIndices[];
|
||||
|
||||
export function modifyIndicesFromUnicodeToUTF16<I>(i: I): I;
|
||||
export function modifyIndicesFromUTF16ToUnicode<I>(i: I): I;
|
||||
|
||||
export interface UrlEntity {
|
||||
url: string;
|
||||
display_url: string;
|
||||
expanded_url: string;
|
||||
indices: [number, number];
|
||||
}
|
||||
export interface AutoLinkOptions {
|
||||
hashtagClass?: string;
|
||||
hashtagUrlBase?: string;
|
||||
cashtagClass?: string;
|
||||
cashtagUrlBase?: string;
|
||||
listClass?: string;
|
||||
usernameClass?: string;
|
||||
usernameUrlBase?: string;
|
||||
listUrlBase?: string;
|
||||
htmlAttrs?: string;
|
||||
invisibleTagAttrs?: string;
|
||||
htmlEscapeNonEntities?: boolean;
|
||||
urlEntities?: UrlEntity[];
|
||||
}
|
||||
|
||||
export function autoLink(text: string, options?: AutoLinkOptions): string;
|
||||
export function autoLinkUsernamesOrLists(text: string, options?: AutoLinkOptions): string;
|
||||
export function autoLinkHashtags(text: string, options?: AutoLinkOptions): string;
|
||||
export function autoLinkCashtags(text: string, options?: AutoLinkOptions): string;
|
||||
export function autoLinkUrlsCustom(text: string, options?: AutoLinkOptions): string;
|
||||
export function autoLinkEntities(text: string, entities: EntityWithIndices[], options?: AutoLinkOptions): string;
|
||||
|
||||
interface TweetLengthOptions {
|
||||
short_url_length: number;
|
||||
short_url_length_https: number;
|
||||
}
|
||||
export function getTweetLength(text: string, options?: TweetLengthOptions): number;
|
||||
|
||||
export function isValidUsername(username: string): boolean;
|
||||
export function isValidList(usernameList: string): boolean;
|
||||
export function isValidHashtag(hashtag: string): boolean;
|
||||
// Note: unicodeDomainsa and requireProtocol can be null
|
||||
export function isValidUrl(url: string, unicodeDomains: boolean, requireProtocol: boolean): boolean;
|
||||
export function isInvalidTweet(text: string): string;
|
||||
|
||||
export function getUnicodeTextLength(text: string): number;
|
||||
// Note: This function directly modify entities" indices
|
||||
export function convertUnicodeIndices(text: string, entities: EntityWithIndices[], indicesInUTF16?: boolean): void;
|
||||
|
||||
export function hitHighlight(text: string, hits?: number[][], options?: {tag: string}): string;
|
||||
}
|
||||
Vendored
+2
-2
@@ -39,7 +39,7 @@ declare module _ {
|
||||
* Default value is '/<%-([\s\S]+?)%>/g'.
|
||||
**/
|
||||
escape?: RegExp;
|
||||
|
||||
|
||||
/**
|
||||
* By default, 'template()' places the values from your data in the local scope via the 'with' statement.
|
||||
* However, you can specify a single variable name with this setting.
|
||||
@@ -5908,7 +5908,7 @@ interface _ChainSingle<T> {
|
||||
value(): T;
|
||||
}
|
||||
interface _ChainOfArrays<T> extends _Chain<T[]> {
|
||||
flatten(): _Chain<T>;
|
||||
flatten(shallow?: boolean): _Chain<T>;
|
||||
}
|
||||
|
||||
declare var _: UnderscoreStatic;
|
||||
|
||||
Vendored
+2
-2
@@ -59,8 +59,8 @@ declare class Body {
|
||||
}
|
||||
declare class Response extends Body {
|
||||
constructor(body?: BodyInit, init?: ResponseInit);
|
||||
error(): Response;
|
||||
redirect(url: string, status: number): Response;
|
||||
static error(): Response;
|
||||
static redirect(url: string, status: number): Response;
|
||||
type: ResponseType;
|
||||
url: string;
|
||||
status: number;
|
||||
|
||||
Reference in New Issue
Block a user