mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
OldUMD and many other module fixes.
This commit is contained in:
parent
fb9c384720
commit
c17b1b78b8
@ -1,10 +1,8 @@
|
||||
|
||||
|
||||
import AnalyticsNode = require("analytics-node");
|
||||
var analytics: AnalyticsNode.Analytics;
|
||||
import Analytics = require("analytics-node");
|
||||
|
||||
function testConfig(): void {
|
||||
analytics = new Analytics('YOUR_WRITE_KEY', {
|
||||
analytics = new AnalyticsNode.Analytics('YOUR_WRITE_KEY', {
|
||||
flushAt: 20,
|
||||
flushAfter: 10000
|
||||
});
|
||||
|
||||
6
analytics-node/index.d.ts
vendored
6
analytics-node/index.d.ts
vendored
@ -3,6 +3,8 @@
|
||||
// Definitions by: Andrew Fong <https://github.com/fongandrew>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = AnalyticsNode;
|
||||
|
||||
declare namespace AnalyticsNode {
|
||||
|
||||
interface Integrations {
|
||||
@ -77,7 +79,3 @@ declare namespace AnalyticsNode {
|
||||
}) => void): Analytics;
|
||||
}
|
||||
}
|
||||
|
||||
declare module "analytics-node" {
|
||||
export = AnalyticsNode.Analytics;
|
||||
}
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import * as angular from 'angularjs';
|
||||
var app = angular.module('testModule', ['tmh.dynamicLocale']);
|
||||
app.config((localStorageServiceProvider: angular.dynamicLocale.tmhDynamicLocaleProvider) => {
|
||||
localStorageServiceProvider
|
||||
|
||||
29
angular-dynamic-locale/index.d.ts
vendored
29
angular-dynamic-locale/index.d.ts
vendored
@ -5,22 +5,23 @@
|
||||
|
||||
/// <reference types="angularjs" />
|
||||
|
||||
declare module "angular-dynamic-locale" {
|
||||
import ng = angular.dynamicLocale;
|
||||
export = ng;
|
||||
}
|
||||
import * as angular from 'angularjs';
|
||||
|
||||
declare namespace angular.dynamicLocale {
|
||||
declare module 'angularjs' {
|
||||
export namespace dynamicLocale {
|
||||
|
||||
interface tmhDynamicLocaleService {
|
||||
set(locale: string): void;
|
||||
get(): string;
|
||||
}
|
||||
interface tmhDynamicLocaleService {
|
||||
set(locale: string): void;
|
||||
get(): string;
|
||||
}
|
||||
|
||||
interface tmhDynamicLocaleProvider extends angular.IServiceProvider {
|
||||
localeLocationPattern(location: string): tmhDynamicLocaleProvider;
|
||||
localeLocationPattern(): string;
|
||||
useStorage(storageName: string): void;
|
||||
useCookieStorage(): void;
|
||||
interface tmhDynamicLocaleProvider extends angular.IServiceProvider {
|
||||
localeLocationPattern(location: string): tmhDynamicLocaleProvider;
|
||||
localeLocationPattern(): string;
|
||||
useStorage(storageName: string): void;
|
||||
useCookieStorage(): void;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
import * as angular from 'angularjs';
|
||||
|
||||
angular
|
||||
.module('angular-locker-tests', ['angular-locker'])
|
||||
.module('angular-locker-tests', ['angular-locker'])
|
||||
.config(['lockerProvider', function config(lockerProvider: angular.locker.ILockerProvider) {
|
||||
let lockerSettings: angular.locker.ILockerSettings = {
|
||||
driver: 'session',
|
||||
|
||||
313
angular-locker/index.d.ts
vendored
313
angular-locker/index.d.ts
vendored
@ -5,166 +5,165 @@
|
||||
|
||||
/// <reference types="angularjs" />
|
||||
|
||||
declare module "angular-locker" {
|
||||
var _: string;
|
||||
export = _;
|
||||
}
|
||||
import * as angular from 'angularjs';
|
||||
|
||||
declare namespace angular.locker {
|
||||
interface ILockerServicePutFunction {
|
||||
(current: any): any
|
||||
}
|
||||
declare module 'angularjs' {
|
||||
export namespace locker {
|
||||
interface ILockerServicePutFunction {
|
||||
(current: any): any
|
||||
}
|
||||
|
||||
interface ILockerService {
|
||||
/**
|
||||
* Add an item to storage if it doesn't already exist
|
||||
*
|
||||
* @param {String} key The key to add
|
||||
* @param {Mixed} value The value to add
|
||||
*/
|
||||
add(key: string, value: any): boolean;
|
||||
/**
|
||||
* Return all items in storage within the current namespace/driver
|
||||
*
|
||||
*/
|
||||
all(): any;
|
||||
/**
|
||||
* Remove all items set within the current namespace/driver
|
||||
*/
|
||||
clean(): ILockerService;
|
||||
/**
|
||||
* Get the total number of items within the current namespace
|
||||
*/
|
||||
count(): number;
|
||||
/**
|
||||
* Retrieve the specified item from storage
|
||||
*
|
||||
* @param {String|Array} key The key to get
|
||||
* @param {Mixed} def The default value if it does not exist
|
||||
*/
|
||||
get(key: string | Array<string>, defaultValue?: any): any;
|
||||
/**
|
||||
* Determine whether the item exists in storage
|
||||
*
|
||||
* @param {String|Function} key - The key to remove
|
||||
*/
|
||||
has(key: string): boolean
|
||||
/**
|
||||
* Get the storage keys as an array
|
||||
*/
|
||||
keys(): Array<string>;
|
||||
/**
|
||||
* Add a new item to storage (even if it already exists)
|
||||
*
|
||||
* @param {Object} keyValuePairs Key value object
|
||||
*/
|
||||
put(keyValuePairs: Object): ILockerService | boolean;
|
||||
/**
|
||||
* Add a new item to storage (even if it already exists)
|
||||
*
|
||||
* @param {Mixed} putFunction The default to pass to function if doesn't already exist
|
||||
*/
|
||||
put(putFunction: Function): ILockerService | boolean;
|
||||
/**
|
||||
* Add a new item to storage (even if it already exists)
|
||||
*
|
||||
* @param {Mixed} key The key to add
|
||||
* @param {Mixed} value The value to add
|
||||
*/
|
||||
put(key: string, value: any): ILockerService | boolean;
|
||||
/**
|
||||
* Add a new item to storage (even if it already exists)
|
||||
*
|
||||
* @param {Mixed} key The key to add
|
||||
* @param {Mixed} putFunction The default to pass to function if doesn't already exist
|
||||
* @param {Mixed} value The value to add
|
||||
*/
|
||||
put(key: string, putFunction: ILockerServicePutFunction, value: any): ILockerService | boolean;
|
||||
/**
|
||||
* Remove specified item(s) from storage
|
||||
*
|
||||
* @param {String} key The key to remove
|
||||
*/
|
||||
forget(key: string): ILockerService;
|
||||
/**
|
||||
* Remove specified item(s) from storage
|
||||
*
|
||||
* @param {Array} keys The array of keys to remove
|
||||
*
|
||||
*/
|
||||
forget(keys: Array<string>): ILockerService;
|
||||
/**
|
||||
* Retrieve the specified item from storage and then remove it
|
||||
*
|
||||
* @param {String|Array} key The key to pull from storage
|
||||
* @param {Mixed} def The default value if it does not exist
|
||||
*/
|
||||
pull(key: string | Array<string>, defaultValue?: any): any;
|
||||
/**
|
||||
* Bind a storage key to a $scope property
|
||||
*
|
||||
* @param {Object} $scope The angular $scope object
|
||||
* @param {String} key The key in storage to bind to
|
||||
* @param {Mixed} def The default value to initially bind
|
||||
*/
|
||||
bind(scope: IScope, property: string, defaultPropertyValue?: any): ILockerService;
|
||||
/**
|
||||
* Set the storage driver on a new instance to enable overriding defaults
|
||||
*
|
||||
* @param {String} driver The driver to switch to
|
||||
*/
|
||||
driver(localStorageType: string): ILockerService;
|
||||
/**
|
||||
* Empty the current storage driver completely. careful now.
|
||||
*/
|
||||
empty(): ILockerService;
|
||||
/**
|
||||
* Get the currently set namespace
|
||||
*/
|
||||
getNamespace(): string;
|
||||
/**
|
||||
* Get a new instance of Locker
|
||||
*
|
||||
* @param {Object} options The config options to instantiate with
|
||||
*/
|
||||
instance(lockerSettings: ILockerSettings): ILockerService;
|
||||
/**
|
||||
* Set the namespace on a new instance to enable overriding defaults
|
||||
*
|
||||
* @param {String} namespace The namespace to switch to
|
||||
*/
|
||||
'namespace'(name: string): ILockerService;
|
||||
/**
|
||||
* Check browser support
|
||||
*
|
||||
* @see github.com/Modernizr/Modernizr/blob/master/feature-detects/storage/localstorage.js#L38-L47
|
||||
*
|
||||
* @param {String} driver The driver to check support with
|
||||
*/
|
||||
supported(): boolean;
|
||||
/**
|
||||
* Unbind a storage key from a $scope property
|
||||
*
|
||||
* @param {Object} $scope The angular $scope object
|
||||
* @param {String} key The key to remove from bindings
|
||||
*/
|
||||
unbind(scope: IScope, property: string): ILockerService;
|
||||
}
|
||||
interface ILockerService {
|
||||
/**
|
||||
* Add an item to storage if it doesn't already exist
|
||||
*
|
||||
* @param {String} key The key to add
|
||||
* @param {Mixed} value The value to add
|
||||
*/
|
||||
add(key: string, value: any): boolean;
|
||||
/**
|
||||
* Return all items in storage within the current namespace/driver
|
||||
*
|
||||
*/
|
||||
all(): any;
|
||||
/**
|
||||
* Remove all items set within the current namespace/driver
|
||||
*/
|
||||
clean(): ILockerService;
|
||||
/**
|
||||
* Get the total number of items within the current namespace
|
||||
*/
|
||||
count(): number;
|
||||
/**
|
||||
* Retrieve the specified item from storage
|
||||
*
|
||||
* @param {String|Array} key The key to get
|
||||
* @param {Mixed} def The default value if it does not exist
|
||||
*/
|
||||
get(key: string | Array<string>, defaultValue?: any): any;
|
||||
/**
|
||||
* Determine whether the item exists in storage
|
||||
*
|
||||
* @param {String|Function} key - The key to remove
|
||||
*/
|
||||
has(key: string): boolean
|
||||
/**
|
||||
* Get the storage keys as an array
|
||||
*/
|
||||
keys(): Array<string>;
|
||||
/**
|
||||
* Add a new item to storage (even if it already exists)
|
||||
*
|
||||
* @param {Object} keyValuePairs Key value object
|
||||
*/
|
||||
put(keyValuePairs: Object): ILockerService | boolean;
|
||||
/**
|
||||
* Add a new item to storage (even if it already exists)
|
||||
*
|
||||
* @param {Mixed} putFunction The default to pass to function if doesn't already exist
|
||||
*/
|
||||
put(putFunction: Function): ILockerService | boolean;
|
||||
/**
|
||||
* Add a new item to storage (even if it already exists)
|
||||
*
|
||||
* @param {Mixed} key The key to add
|
||||
* @param {Mixed} value The value to add
|
||||
*/
|
||||
put(key: string, value: any): ILockerService | boolean;
|
||||
/**
|
||||
* Add a new item to storage (even if it already exists)
|
||||
*
|
||||
* @param {Mixed} key The key to add
|
||||
* @param {Mixed} putFunction The default to pass to function if doesn't already exist
|
||||
* @param {Mixed} value The value to add
|
||||
*/
|
||||
put(key: string, putFunction: ILockerServicePutFunction, value: any): ILockerService | boolean;
|
||||
/**
|
||||
* Remove specified item(s) from storage
|
||||
*
|
||||
* @param {String} key The key to remove
|
||||
*/
|
||||
forget(key: string): ILockerService;
|
||||
/**
|
||||
* Remove specified item(s) from storage
|
||||
*
|
||||
* @param {Array} keys The array of keys to remove
|
||||
*
|
||||
*/
|
||||
forget(keys: Array<string>): ILockerService;
|
||||
/**
|
||||
* Retrieve the specified item from storage and then remove it
|
||||
*
|
||||
* @param {String|Array} key The key to pull from storage
|
||||
* @param {Mixed} def The default value if it does not exist
|
||||
*/
|
||||
pull(key: string | Array<string>, defaultValue?: any): any;
|
||||
/**
|
||||
* Bind a storage key to a $scope property
|
||||
*
|
||||
* @param {Object} $scope The angular $scope object
|
||||
* @param {String} key The key in storage to bind to
|
||||
* @param {Mixed} def The default value to initially bind
|
||||
*/
|
||||
bind(scope: IScope, property: string, defaultPropertyValue?: any): ILockerService;
|
||||
/**
|
||||
* Set the storage driver on a new instance to enable overriding defaults
|
||||
*
|
||||
* @param {String} driver The driver to switch to
|
||||
*/
|
||||
driver(localStorageType: string): ILockerService;
|
||||
/**
|
||||
* Empty the current storage driver completely. careful now.
|
||||
*/
|
||||
empty(): ILockerService;
|
||||
/**
|
||||
* Get the currently set namespace
|
||||
*/
|
||||
getNamespace(): string;
|
||||
/**
|
||||
* Get a new instance of Locker
|
||||
*
|
||||
* @param {Object} options The config options to instantiate with
|
||||
*/
|
||||
instance(lockerSettings: ILockerSettings): ILockerService;
|
||||
/**
|
||||
* Set the namespace on a new instance to enable overriding defaults
|
||||
*
|
||||
* @param {String} namespace The namespace to switch to
|
||||
*/
|
||||
'namespace'(name: string): ILockerService;
|
||||
/**
|
||||
* Check browser support
|
||||
*
|
||||
* @see github.com/Modernizr/Modernizr/blob/master/feature-detects/storage/localstorage.js#L38-L47
|
||||
*
|
||||
* @param {String} driver The driver to check support with
|
||||
*/
|
||||
supported(): boolean;
|
||||
/**
|
||||
* Unbind a storage key from a $scope property
|
||||
*
|
||||
* @param {Object} $scope The angular $scope object
|
||||
* @param {String} key The key to remove from bindings
|
||||
*/
|
||||
unbind(scope: IScope, property: string): ILockerService;
|
||||
}
|
||||
|
||||
interface ILockerSettings {
|
||||
driver?: string;
|
||||
'namespace'?: string | boolean;
|
||||
separator?: string;
|
||||
eventsEnabled?: boolean;
|
||||
extend?: Object;
|
||||
}
|
||||
interface ILockerSettings {
|
||||
driver?: string;
|
||||
'namespace'?: string | boolean;
|
||||
separator?: string;
|
||||
eventsEnabled?: boolean;
|
||||
extend?: Object;
|
||||
}
|
||||
|
||||
interface ILockerProvider extends angular.IServiceProvider {
|
||||
/**
|
||||
* Allow the defaults to be specified via the `lockerProvider`
|
||||
*
|
||||
* @param {ILockerSettings} lockerSettings The defaults to override
|
||||
*/
|
||||
defaults(lockerSettings: ILockerSettings): void;
|
||||
interface ILockerProvider extends angular.IServiceProvider {
|
||||
/**
|
||||
* Allow the defaults to be specified via the `lockerProvider`
|
||||
*
|
||||
* @param {ILockerSettings} lockerSettings The defaults to override
|
||||
*/
|
||||
defaults(lockerSettings: ILockerSettings): void;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
import * as angular from 'angularjs';
|
||||
|
||||
angular
|
||||
.module('toastr-tests', ['toastr'])
|
||||
.config(function(toastrConfig: angular.toastr.IToastrConfig) {
|
||||
|
||||
209
angular-toastr/index.d.ts
vendored
209
angular-toastr/index.d.ts
vendored
@ -5,118 +5,117 @@
|
||||
|
||||
/// <reference types="angularjs" />
|
||||
|
||||
declare module "angular-toastr" {
|
||||
var _: string;
|
||||
export = _;
|
||||
}
|
||||
import * as angular from 'angularjs';
|
||||
|
||||
declare namespace angular.toastr {
|
||||
interface IToastBaseConfig {
|
||||
allowHtml?: boolean;
|
||||
closeButton?: boolean;
|
||||
closeHtml?: string;
|
||||
extendedTimeOut?: number;
|
||||
messageClass?: string;
|
||||
onHidden?: Function;
|
||||
onShown?: Function;
|
||||
onTap?: Function;
|
||||
progressBar?: boolean;
|
||||
tapToDismiss?: boolean;
|
||||
templates?: {
|
||||
toast?: string;
|
||||
progressbar?: string;
|
||||
};
|
||||
timeOut?: number;
|
||||
titleClass?: string;
|
||||
toastClass?: string;
|
||||
}
|
||||
declare module 'angularjs' {
|
||||
export namespace toastr {
|
||||
interface IToastBaseConfig {
|
||||
allowHtml?: boolean;
|
||||
closeButton?: boolean;
|
||||
closeHtml?: string;
|
||||
extendedTimeOut?: number;
|
||||
messageClass?: string;
|
||||
onHidden?: Function;
|
||||
onShown?: Function;
|
||||
onTap?: Function;
|
||||
progressBar?: boolean;
|
||||
tapToDismiss?: boolean;
|
||||
templates?: {
|
||||
toast?: string;
|
||||
progressbar?: string;
|
||||
};
|
||||
timeOut?: number;
|
||||
titleClass?: string;
|
||||
toastClass?: string;
|
||||
}
|
||||
|
||||
interface IToastContainerConfig {
|
||||
autoDismiss?: boolean;
|
||||
containerId?: string;
|
||||
maxOpened?: number;
|
||||
newestOnTop?: boolean;
|
||||
positionClass?: string;
|
||||
preventDuplicates?: boolean;
|
||||
preventOpenDuplicates?: boolean;
|
||||
target?: string;
|
||||
}
|
||||
interface IToastContainerConfig {
|
||||
autoDismiss?: boolean;
|
||||
containerId?: string;
|
||||
maxOpened?: number;
|
||||
newestOnTop?: boolean;
|
||||
positionClass?: string;
|
||||
preventDuplicates?: boolean;
|
||||
preventOpenDuplicates?: boolean;
|
||||
target?: string;
|
||||
}
|
||||
|
||||
interface IToastConfig extends IToastBaseConfig {
|
||||
iconClasses?: {
|
||||
error?: string;
|
||||
info?: string;
|
||||
success?: string;
|
||||
warning?: string;
|
||||
};
|
||||
}
|
||||
interface IToastConfig extends IToastBaseConfig {
|
||||
iconClasses?: {
|
||||
error?: string;
|
||||
info?: string;
|
||||
success?: string;
|
||||
warning?: string;
|
||||
};
|
||||
}
|
||||
|
||||
interface IToastrConfig extends IToastContainerConfig, IToastConfig { }
|
||||
interface IToastrConfig extends IToastContainerConfig, IToastConfig { }
|
||||
|
||||
interface IToastScope extends angular.IScope {
|
||||
message: string;
|
||||
options: IToastConfig;
|
||||
title: string;
|
||||
toastId: number;
|
||||
toastType: string;
|
||||
}
|
||||
interface IToastScope extends angular.IScope {
|
||||
message: string;
|
||||
options: IToastConfig;
|
||||
title: string;
|
||||
toastId: number;
|
||||
toastType: string;
|
||||
}
|
||||
|
||||
interface IToast {
|
||||
el: angular.IAugmentedJQuery;
|
||||
iconClass: string;
|
||||
isOpened: boolean;
|
||||
open: angular.IPromise<any>;
|
||||
scope: IToastScope;
|
||||
toastId: number;
|
||||
}
|
||||
interface IToast {
|
||||
el: angular.IAugmentedJQuery;
|
||||
iconClass: string;
|
||||
isOpened: boolean;
|
||||
open: angular.IPromise<any>;
|
||||
scope: IToastScope;
|
||||
toastId: number;
|
||||
}
|
||||
|
||||
interface IToastOptions extends IToastBaseConfig {
|
||||
iconClass?: string;
|
||||
target?: string;
|
||||
}
|
||||
interface IToastOptions extends IToastBaseConfig {
|
||||
iconClass?: string;
|
||||
target?: string;
|
||||
}
|
||||
|
||||
interface IToastrService {
|
||||
/**
|
||||
* Return the number of active toasts in screen.
|
||||
*/
|
||||
active(): number;
|
||||
/**
|
||||
* Remove toast from screen. If no toast is passed in, all toasts will be closed.
|
||||
*
|
||||
* @param {IToast} toast Optional toast object to delete
|
||||
*/
|
||||
clear(toast?: IToast): void;
|
||||
/**
|
||||
* Create error toast notification message.
|
||||
*
|
||||
* @param {String} message Message to show on toast
|
||||
* @param {String} title Title to show on toast
|
||||
* @param {IToastOptions} options Override default toast options
|
||||
*/
|
||||
error(message: string, title?: string, options?: IToastOptions): IToast;
|
||||
/**
|
||||
* Create info toast notification message.
|
||||
*
|
||||
* @param {String} message Message to show on toast
|
||||
* @param {String} title Title to show on toast
|
||||
* @param {IToastOptions} options Override default toast options
|
||||
*/
|
||||
info(message: string, title?: string, options?: IToastOptions): IToast;
|
||||
/**
|
||||
* Create success toast notification message.
|
||||
*
|
||||
* @param {String} message Message to show on toast
|
||||
* @param {String} title Title to show on toast
|
||||
* @param {IToastOptions} options Override default toast options
|
||||
*/
|
||||
success(message: string, title?: string, options?: IToastOptions): IToast;
|
||||
/**
|
||||
* Create warning toast notification message.
|
||||
*
|
||||
* @param {String} message Message to show on toast
|
||||
* @param {String} title Title to show on toast
|
||||
* @param {IToastOptions} options Override default toast options
|
||||
*/
|
||||
warning(message: string, title?: string, options?: IToastOptions): IToast;
|
||||
interface IToastrService {
|
||||
/**
|
||||
* Return the number of active toasts in screen.
|
||||
*/
|
||||
active(): number;
|
||||
/**
|
||||
* Remove toast from screen. If no toast is passed in, all toasts will be closed.
|
||||
*
|
||||
* @param {IToast} toast Optional toast object to delete
|
||||
*/
|
||||
clear(toast?: IToast): void;
|
||||
/**
|
||||
* Create error toast notification message.
|
||||
*
|
||||
* @param {String} message Message to show on toast
|
||||
* @param {String} title Title to show on toast
|
||||
* @param {IToastOptions} options Override default toast options
|
||||
*/
|
||||
error(message: string, title?: string, options?: IToastOptions): IToast;
|
||||
/**
|
||||
* Create info toast notification message.
|
||||
*
|
||||
* @param {String} message Message to show on toast
|
||||
* @param {String} title Title to show on toast
|
||||
* @param {IToastOptions} options Override default toast options
|
||||
*/
|
||||
info(message: string, title?: string, options?: IToastOptions): IToast;
|
||||
/**
|
||||
* Create success toast notification message.
|
||||
*
|
||||
* @param {String} message Message to show on toast
|
||||
* @param {String} title Title to show on toast
|
||||
* @param {IToastOptions} options Override default toast options
|
||||
*/
|
||||
success(message: string, title?: string, options?: IToastOptions): IToast;
|
||||
/**
|
||||
* Create warning toast notification message.
|
||||
*
|
||||
* @param {String} message Message to show on toast
|
||||
* @param {String} title Title to show on toast
|
||||
* @param {IToastOptions} options Override default toast options
|
||||
*/
|
||||
warning(message: string, title?: string, options?: IToastOptions): IToast;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
|
||||
import angularTouchSpin = require("angular-touchspin");
|
||||
|
||||
angular
|
||||
.module('touchspin-tests', ['lm.touchspin'])
|
||||
|
||||
6
angular-touchspin/index.d.ts
vendored
6
angular-touchspin/index.d.ts
vendored
@ -5,10 +5,8 @@
|
||||
|
||||
/// <reference types="angularjs" />
|
||||
|
||||
declare module "angular-touchspin" {
|
||||
let _: string;
|
||||
export = _;
|
||||
}
|
||||
declare let angularTouchSpin: string;
|
||||
export = angularTouchSpin;
|
||||
|
||||
declare namespace angularTouchSpin {
|
||||
interface ITouchSpinOptions {
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
|
||||
import * as ng from 'angularjs';
|
||||
import * as angular from 'angularjs';
|
||||
|
||||
var myApp = angular.module('testModule');
|
||||
|
||||
|
||||
713
angular-ui-router/index.d.ts
vendored
713
angular-ui-router/index.d.ts
vendored
@ -3,367 +3,368 @@
|
||||
// Definitions by: Michel Salib <https://github.com/michelsalib>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="angularjs" />
|
||||
import * as angular from 'angularjs';
|
||||
|
||||
// Support for AMD require and CommonJS
|
||||
declare module 'angular-ui-router' {
|
||||
// Since angular-ui-router adds providers for a bunch of
|
||||
// injectable dependencies, it doesn't really return any
|
||||
// actual data except the plain string 'ui.router'.
|
||||
//
|
||||
// As such, I don't think anybody will ever use the actual
|
||||
// default value of the module. So I've only included the
|
||||
// the types. (@xogeny)
|
||||
export type IState = angular.ui.IState;
|
||||
export type IStateProvider = angular.ui.IStateProvider;
|
||||
export type IUrlMatcher = angular.ui.IUrlMatcher;
|
||||
export type IUrlRouterProvider = angular.ui.IUrlRouterProvider;
|
||||
export type IStateOptions = angular.ui.IStateOptions;
|
||||
export type IHrefOptions = angular.ui.IHrefOptions;
|
||||
export type IStateService = angular.ui.IStateService;
|
||||
export type IResolvedState = angular.ui.IResolvedState;
|
||||
export type IStateParamsService = angular.ui.IStateParamsService;
|
||||
export type IUrlRouterService = angular.ui.IUrlRouterService;
|
||||
export type IUiViewScrollProvider = angular.ui.IUiViewScrollProvider;
|
||||
export type IType = angular.ui.IType;
|
||||
}
|
||||
// Since angular-ui-router adds providers for a bunch of
|
||||
// injectable dependencies, it doesn't really return any
|
||||
// actual data except the plain string 'ui.router'.
|
||||
//
|
||||
// As such, I don't think anybody will ever use the actual
|
||||
// default value of the module. So I've only included the
|
||||
// the types. (@xogeny)
|
||||
export type IState = angular.ui.IState;
|
||||
export type IStateProvider = angular.ui.IStateProvider;
|
||||
export type IUrlMatcher = angular.ui.IUrlMatcher;
|
||||
export type IUrlRouterProvider = angular.ui.IUrlRouterProvider;
|
||||
export type IStateOptions = angular.ui.IStateOptions;
|
||||
export type IHrefOptions = angular.ui.IHrefOptions;
|
||||
export type IStateService = angular.ui.IStateService;
|
||||
export type IResolvedState = angular.ui.IResolvedState;
|
||||
export type IStateParamsService = angular.ui.IStateParamsService;
|
||||
export type IUrlRouterService = angular.ui.IUrlRouterService;
|
||||
export type IUiViewScrollProvider = angular.ui.IUiViewScrollProvider;
|
||||
export type IType = angular.ui.IType;
|
||||
|
||||
declare namespace angular.ui {
|
||||
|
||||
interface IState {
|
||||
name?: string;
|
||||
/**
|
||||
* String HTML content, or function that returns an HTML string
|
||||
*/
|
||||
template?: string | {(): string};
|
||||
/**
|
||||
* String URL path to template file OR Function, returns URL path string
|
||||
*/
|
||||
templateUrl?: string | {(params: IStateParamsService): string};
|
||||
/**
|
||||
* Function, returns HTML content string
|
||||
*/
|
||||
templateProvider?: Function | Array<string|Function>;
|
||||
/**
|
||||
* A controller paired to the state. Function, annotated array or name as String
|
||||
*/
|
||||
controller?: Function|string|Array<string|Function>;
|
||||
controllerAs?: string;
|
||||
/**
|
||||
* Function (injectable), returns the actual controller function or string.
|
||||
*/
|
||||
controllerProvider?: Function|Array<string|Function>;
|
||||
|
||||
/**
|
||||
* Specifies the parent state of this state
|
||||
*/
|
||||
parent?: string | IState;
|
||||
|
||||
|
||||
resolve?: { [name:string]: any };
|
||||
/**
|
||||
* A url with optional parameters. When a state is navigated or transitioned to, the $stateParams service will be populated with any parameters that were passed.
|
||||
*/
|
||||
url?: string | IUrlMatcher;
|
||||
/**
|
||||
* A map which optionally configures parameters declared in the url, or defines additional non-url parameters. Only use this within a state if you are not using url. Otherwise you can specify your parameters within the url. When a state is navigated or transitioned to, the $stateParams service will be populated with any parameters that were passed.
|
||||
*/
|
||||
params?: any;
|
||||
/**
|
||||
* Use the views property to set up multiple views. If you don't need multiple views within a single state this property is not needed. Tip: remember that often nested views are more useful and powerful than multiple sibling views.
|
||||
*/
|
||||
views?: { [name:string]: IState };
|
||||
abstract?: boolean;
|
||||
/**
|
||||
* Callback function for when a state is entered. Good way to trigger an action or dispatch an event, such as opening a dialog.
|
||||
* If minifying your scripts, make sure to explicitly annotate this function, because it won't be automatically annotated by your build tools.
|
||||
*/
|
||||
onEnter?: Function|Array<string|Function>;
|
||||
/**
|
||||
* Callback functions for when a state is entered and exited. Good way to trigger an action or dispatch an event, such as opening a dialog.
|
||||
* If minifying your scripts, make sure to explicitly annotate this function, because it won't be automatically annotated by your build tools.
|
||||
*/
|
||||
onExit?: Function|Array<string|Function>;
|
||||
/**
|
||||
* Arbitrary data object, useful for custom configuration.
|
||||
*/
|
||||
data?: any;
|
||||
|
||||
/**
|
||||
* Boolean (default true). If false will not re-trigger the same state just because a search/query parameter has changed. Useful for when you'd like to modify $location.search() without triggering a reload.
|
||||
*/
|
||||
reloadOnSearch?: boolean;
|
||||
|
||||
/**
|
||||
* Boolean (default true). If false will reload state on everytransitions. Useful for when you'd like to restore all data to its initial state.
|
||||
*/
|
||||
cache?: boolean;
|
||||
}
|
||||
|
||||
interface IUnfoundState {
|
||||
to: string,
|
||||
toParams: {},
|
||||
options: IStateOptions
|
||||
}
|
||||
|
||||
interface IStateProvider extends angular.IServiceProvider {
|
||||
state(name:string, config:IState): IStateProvider;
|
||||
state(config:IState): IStateProvider;
|
||||
decorator(name?: string, decorator?: (state: IState, parent: Function) => any): any;
|
||||
}
|
||||
|
||||
interface IUrlMatcher {
|
||||
concat(pattern: string): IUrlMatcher;
|
||||
exec(path: string, searchParams: {}): {};
|
||||
parameters(): string[];
|
||||
format(values: {}): string;
|
||||
}
|
||||
|
||||
interface IUrlMatcherFactory {
|
||||
/**
|
||||
* Creates a UrlMatcher for the specified pattern.
|
||||
*
|
||||
* @param pattern {string} The URL pattern.
|
||||
*
|
||||
* @returns {IUrlMatcher} The UrlMatcher.
|
||||
*/
|
||||
compile(pattern: string): IUrlMatcher;
|
||||
/**
|
||||
* Returns true if the specified object is a UrlMatcher, or false otherwise.
|
||||
*
|
||||
* @param o {any} The object to perform the type check against.
|
||||
*
|
||||
* @returns {boolean} Returns true if the object matches the IUrlMatcher interface, by implementing all the same methods.
|
||||
*/
|
||||
isMatcher(o: any): boolean;
|
||||
/**
|
||||
* Returns a type definition for the specified name
|
||||
*
|
||||
* @param name {string} The type definition name
|
||||
*
|
||||
* @returns {IType} The type definition
|
||||
*/
|
||||
type(name: string): IType;
|
||||
/**
|
||||
* Registers a custom Type object that can be used to generate URLs with typed parameters.
|
||||
*
|
||||
* @param {IType} definition The type definition.
|
||||
* @param {any[]} inlineAnnotedDefinitionFn A function that is injected before the app runtime starts. The result of this function is merged into the existing definition.
|
||||
*
|
||||
* @returns {IUrlMatcherFactory} Returns $urlMatcherFactoryProvider.
|
||||
*/
|
||||
type(name: string, definition: IType, inlineAnnotedDefinitionFn?: any[]): IUrlMatcherFactory;
|
||||
/**
|
||||
* Registers a custom Type object that can be used to generate URLs with typed parameters.
|
||||
*
|
||||
* @param {IType} definition The type definition.
|
||||
* @param {any[]} inlineAnnotedDefinitionFn A function that is injected before the app runtime starts. The result of this function is merged into the existing definition.
|
||||
*
|
||||
* @returns {IUrlMatcherFactory} Returns $urlMatcherFactoryProvider.
|
||||
*/
|
||||
type(name: string, definition: IType, definitionFn?: (...args:any[]) => IType): IUrlMatcherFactory;
|
||||
/**
|
||||
* Defines whether URL matching should be case sensitive (the default behavior), or not.
|
||||
*
|
||||
* @param value {boolean} false to match URL in a case sensitive manner; otherwise true;
|
||||
*
|
||||
* @returns {boolean} the current value of caseInsensitive
|
||||
*/
|
||||
caseInsensitive(value?: boolean): boolean;
|
||||
/**
|
||||
* Sets the default behavior when generating or matching URLs with default parameter values
|
||||
*
|
||||
* @param value {string} A string that defines the default parameter URL squashing behavior. nosquash: When generating an href with a default parameter value, do not squash the parameter value from the URL slash: When generating an href with a default parameter value, squash (remove) the parameter value, and, if the parameter is surrounded by slashes, squash (remove) one slash from the URL any other string, e.g. "~": When generating an href with a default parameter value, squash (remove) the parameter value from the URL and replace it with this string.
|
||||
*/
|
||||
defaultSquashPolicy(value: string): void;
|
||||
/**
|
||||
* Defines whether URLs should match trailing slashes, or not (the default behavior).
|
||||
*
|
||||
* @param value {boolean} false to match trailing slashes in URLs, otherwise true.
|
||||
*
|
||||
* @returns {boolean} the current value of strictMode
|
||||
*/
|
||||
strictMode(value?: boolean): boolean;
|
||||
}
|
||||
|
||||
interface IUrlRouterProvider extends angular.IServiceProvider {
|
||||
when(whenPath: RegExp, handler: Function): IUrlRouterProvider;
|
||||
when(whenPath: RegExp, handler: any[]): IUrlRouterProvider;
|
||||
when(whenPath: RegExp, toPath: string): IUrlRouterProvider;
|
||||
when(whenPath: IUrlMatcher, hanlder: Function): IUrlRouterProvider;
|
||||
when(whenPath: IUrlMatcher, handler: any[]): IUrlRouterProvider;
|
||||
when(whenPath: IUrlMatcher, toPath: string): IUrlRouterProvider;
|
||||
when(whenPath: string, handler: Function): IUrlRouterProvider;
|
||||
when(whenPath: string, handler: any[]): IUrlRouterProvider;
|
||||
when(whenPath: string, toPath: string): IUrlRouterProvider;
|
||||
otherwise(handler: Function): IUrlRouterProvider;
|
||||
otherwise(handler: any[]): IUrlRouterProvider;
|
||||
otherwise(path: string): IUrlRouterProvider;
|
||||
rule(handler: Function): IUrlRouterProvider;
|
||||
rule(handler: any[]): IUrlRouterProvider;
|
||||
/**
|
||||
* Disables (or enables) deferring location change interception.
|
||||
*
|
||||
* If you wish to customize the behavior of syncing the URL (for example, if you wish to defer a transition but maintain the current URL), call this method at configuration time. Then, at run time, call $urlRouter.listen() after you have configured your own $locationChangeSuccess event handler.
|
||||
*
|
||||
* @param {boolean} defer Indicates whether to defer location change interception. Passing no parameter is equivalent to true.
|
||||
*/
|
||||
deferIntercept(defer?: boolean): void;
|
||||
}
|
||||
|
||||
interface IStateOptions {
|
||||
/**
|
||||
* {boolean=true|string=} - If true will update the url in the location bar, if false will not. If string, must be "replace", which will update url and also replace last history record.
|
||||
*/
|
||||
location?: boolean | string;
|
||||
/**
|
||||
* {boolean=true}, If true will inherit url parameters from current url.
|
||||
*/
|
||||
inherit?: boolean;
|
||||
/**
|
||||
* {object=$state.$current}, When transitioning with relative path (e.g '^'), defines which state to be relative from.
|
||||
*/
|
||||
relative?: IState;
|
||||
/**
|
||||
* {boolean=true}, If true will broadcast $stateChangeStart and $stateChangeSuccess events.
|
||||
*/
|
||||
notify?: boolean;
|
||||
/**
|
||||
* {boolean=false}, If true will force transition even if the state or params have not changed, aka a reload of the same state. It differs from reloadOnSearch because you'd use this when you want to force a reload when everything is the same, including search params.
|
||||
*/
|
||||
reload?: boolean;
|
||||
}
|
||||
|
||||
interface IHrefOptions {
|
||||
lossy?: boolean;
|
||||
inherit?: boolean;
|
||||
relative?: IState;
|
||||
absolute?: boolean;
|
||||
}
|
||||
|
||||
interface IStateService {
|
||||
/**
|
||||
* Convenience method for transitioning to a new state. $state.go calls $state.transitionTo internally but automatically sets options to { location: true, inherit: true, relative: $state.$current, notify: true }. This allows you to easily use an absolute or relative to path and specify only the parameters you'd like to update (while letting unspecified parameters inherit from the currently active ancestor states).
|
||||
*
|
||||
* @param to Absolute state name or relative state path. Some examples:
|
||||
*
|
||||
* $state.go('contact.detail') - will go to the contact.detail state
|
||||
* $state.go('^') - will go to a parent state
|
||||
* $state.go('^.sibling') - will go to a sibling state
|
||||
* $state.go('.child.grandchild') - will go to grandchild state
|
||||
*
|
||||
* @param params A map of the parameters that will be sent to the state, will populate $stateParams. Any parameters that are not specified will be inherited from currently defined parameters. This allows, for example, going to a sibling state that shares parameters specified in a parent state. Parameter inheritance only works between common ancestor states, I.e. transitioning to a sibling will get you the parameters for all parents, transitioning to a child will get you all current parameters, etc.
|
||||
*
|
||||
* @param options Options object.
|
||||
*/
|
||||
go(to: string, params?: {}, options?: IStateOptions): angular.IPromise<any>;
|
||||
go(to: IState, params?: {}, options?: IStateOptions): angular.IPromise<any>;
|
||||
transitionTo(state: string, params?: {}, updateLocation?: boolean): angular.IPromise<any>;
|
||||
transitionTo(state: IState, params?: {}, updateLocation?: boolean): angular.IPromise<any>;
|
||||
transitionTo(state: string, params?: {}, options?: IStateOptions): angular.IPromise<any>;
|
||||
transitionTo(state: IState, params?: {}, options?: IStateOptions): angular.IPromise<any>;
|
||||
includes(state: string, params?: {}): boolean;
|
||||
includes(state: string, params?: {}, options?:any): boolean;
|
||||
is(state:string, params?: {}): boolean;
|
||||
is(state: IState, params?: {}): boolean;
|
||||
href(state: IState, params?: {}, options?: IHrefOptions): string;
|
||||
href(state: string, params?: {}, options?: IHrefOptions): string;
|
||||
get(state: string, context?: string): IState;
|
||||
get(state: IState, context?: string): IState;
|
||||
get(state: string, context?: IState): IState;
|
||||
get(state: IState, context?: IState): IState;
|
||||
get(): IState[];
|
||||
/** A reference to the state's config object. However you passed it in. Useful for accessing custom data. */
|
||||
current: IState;
|
||||
/** A param object, e.g. {sectionId: section.id)}, that you'd like to test against the current active state. */
|
||||
params: IStateParamsService;
|
||||
reload(): angular.IPromise<any>;
|
||||
|
||||
/** Currently pending transition. A promise that'll resolve or reject. */
|
||||
transition: angular.IPromise<{}>;
|
||||
|
||||
$current: IResolvedState;
|
||||
}
|
||||
|
||||
interface IResolvedState {
|
||||
locals: {
|
||||
declare module 'angularjs' {
|
||||
export namespace ui {
|
||||
interface IState {
|
||||
name?: string;
|
||||
/**
|
||||
* Currently resolved "resolve" values from the current state
|
||||
* String HTML content, or function that returns an HTML string
|
||||
*/
|
||||
globals: { [key: string]: any; };
|
||||
};
|
||||
template?: string | {(): string};
|
||||
/**
|
||||
* String URL path to template file OR Function, returns URL path string
|
||||
*/
|
||||
templateUrl?: string | {(params: IStateParamsService): string};
|
||||
/**
|
||||
* Function, returns HTML content string
|
||||
*/
|
||||
templateProvider?: Function | Array<string|Function>;
|
||||
/**
|
||||
* A controller paired to the state. Function, annotated array or name as String
|
||||
*/
|
||||
controller?: Function|string|Array<string|Function>;
|
||||
controllerAs?: string;
|
||||
/**
|
||||
* Function (injectable), returns the actual controller function or string.
|
||||
*/
|
||||
controllerProvider?: Function|Array<string|Function>;
|
||||
|
||||
/**
|
||||
* Specifies the parent state of this state
|
||||
*/
|
||||
parent?: string | IState;
|
||||
|
||||
|
||||
resolve?: { [name:string]: any };
|
||||
/**
|
||||
* A url with optional parameters. When a state is navigated or transitioned to, the $stateParams service will be populated with any parameters that were passed.
|
||||
*/
|
||||
url?: string | IUrlMatcher;
|
||||
/**
|
||||
* A map which optionally configures parameters declared in the url, or defines additional non-url parameters. Only use this within a state if you are not using url. Otherwise you can specify your parameters within the url. When a state is navigated or transitioned to, the $stateParams service will be populated with any parameters that were passed.
|
||||
*/
|
||||
params?: any;
|
||||
/**
|
||||
* Use the views property to set up multiple views. If you don't need multiple views within a single state this property is not needed. Tip: remember that often nested views are more useful and powerful than multiple sibling views.
|
||||
*/
|
||||
views?: { [name:string]: IState };
|
||||
abstract?: boolean;
|
||||
/**
|
||||
* Callback function for when a state is entered. Good way to trigger an action or dispatch an event, such as opening a dialog.
|
||||
* If minifying your scripts, make sure to explicitly annotate this function, because it won't be automatically annotated by your build tools.
|
||||
*/
|
||||
onEnter?: Function|Array<string|Function>;
|
||||
/**
|
||||
* Callback functions for when a state is entered and exited. Good way to trigger an action or dispatch an event, such as opening a dialog.
|
||||
* If minifying your scripts, make sure to explicitly annotate this function, because it won't be automatically annotated by your build tools.
|
||||
*/
|
||||
onExit?: Function|Array<string|Function>;
|
||||
/**
|
||||
* Arbitrary data object, useful for custom configuration.
|
||||
*/
|
||||
data?: any;
|
||||
|
||||
/**
|
||||
* Boolean (default true). If false will not re-trigger the same state just because a search/query parameter has changed. Useful for when you'd like to modify $location.search() without triggering a reload.
|
||||
*/
|
||||
reloadOnSearch?: boolean;
|
||||
|
||||
/**
|
||||
* Boolean (default true). If false will reload state on everytransitions. Useful for when you'd like to restore all data to its initial state.
|
||||
*/
|
||||
cache?: boolean;
|
||||
}
|
||||
|
||||
interface IUnfoundState {
|
||||
to: string,
|
||||
toParams: {},
|
||||
options: IStateOptions
|
||||
}
|
||||
|
||||
interface IStateProvider extends angular.IServiceProvider {
|
||||
state(name:string, config:IState): IStateProvider;
|
||||
state(config:IState): IStateProvider;
|
||||
decorator(name?: string, decorator?: (state: IState, parent: Function) => any): any;
|
||||
}
|
||||
|
||||
interface IUrlMatcher {
|
||||
concat(pattern: string): IUrlMatcher;
|
||||
exec(path: string, searchParams: {}): {};
|
||||
parameters(): string[];
|
||||
format(values: {}): string;
|
||||
}
|
||||
|
||||
interface IUrlMatcherFactory {
|
||||
/**
|
||||
* Creates a UrlMatcher for the specified pattern.
|
||||
*
|
||||
* @param pattern {string} The URL pattern.
|
||||
*
|
||||
* @returns {IUrlMatcher} The UrlMatcher.
|
||||
*/
|
||||
compile(pattern: string): IUrlMatcher;
|
||||
/**
|
||||
* Returns true if the specified object is a UrlMatcher, or false otherwise.
|
||||
*
|
||||
* @param o {any} The object to perform the type check against.
|
||||
*
|
||||
* @returns {boolean} Returns true if the object matches the IUrlMatcher interface, by implementing all the same methods.
|
||||
*/
|
||||
isMatcher(o: any): boolean;
|
||||
/**
|
||||
* Returns a type definition for the specified name
|
||||
*
|
||||
* @param name {string} The type definition name
|
||||
*
|
||||
* @returns {IType} The type definition
|
||||
*/
|
||||
type(name: string): IType;
|
||||
/**
|
||||
* Registers a custom Type object that can be used to generate URLs with typed parameters.
|
||||
*
|
||||
* @param {IType} definition The type definition.
|
||||
* @param {any[]} inlineAnnotedDefinitionFn A function that is injected before the app runtime starts. The result of this function is merged into the existing definition.
|
||||
*
|
||||
* @returns {IUrlMatcherFactory} Returns $urlMatcherFactoryProvider.
|
||||
*/
|
||||
type(name: string, definition: IType, inlineAnnotedDefinitionFn?: any[]): IUrlMatcherFactory;
|
||||
/**
|
||||
* Registers a custom Type object that can be used to generate URLs with typed parameters.
|
||||
*
|
||||
* @param {IType} definition The type definition.
|
||||
* @param {any[]} inlineAnnotedDefinitionFn A function that is injected before the app runtime starts. The result of this function is merged into the existing definition.
|
||||
*
|
||||
* @returns {IUrlMatcherFactory} Returns $urlMatcherFactoryProvider.
|
||||
*/
|
||||
type(name: string, definition: IType, definitionFn?: (...args:any[]) => IType): IUrlMatcherFactory;
|
||||
/**
|
||||
* Defines whether URL matching should be case sensitive (the default behavior), or not.
|
||||
*
|
||||
* @param value {boolean} false to match URL in a case sensitive manner; otherwise true;
|
||||
*
|
||||
* @returns {boolean} the current value of caseInsensitive
|
||||
*/
|
||||
caseInsensitive(value?: boolean): boolean;
|
||||
/**
|
||||
* Sets the default behavior when generating or matching URLs with default parameter values
|
||||
*
|
||||
* @param value {string} A string that defines the default parameter URL squashing behavior. nosquash: When generating an href with a default parameter value, do not squash the parameter value from the URL slash: When generating an href with a default parameter value, squash (remove) the parameter value, and, if the parameter is surrounded by slashes, squash (remove) one slash from the URL any other string, e.g. "~": When generating an href with a default parameter value, squash (remove) the parameter value from the URL and replace it with this string.
|
||||
*/
|
||||
defaultSquashPolicy(value: string): void;
|
||||
/**
|
||||
* Defines whether URLs should match trailing slashes, or not (the default behavior).
|
||||
*
|
||||
* @param value {boolean} false to match trailing slashes in URLs, otherwise true.
|
||||
*
|
||||
* @returns {boolean} the current value of strictMode
|
||||
*/
|
||||
strictMode(value?: boolean): boolean;
|
||||
}
|
||||
|
||||
interface IUrlRouterProvider extends angular.IServiceProvider {
|
||||
when(whenPath: RegExp, handler: Function): IUrlRouterProvider;
|
||||
when(whenPath: RegExp, handler: any[]): IUrlRouterProvider;
|
||||
when(whenPath: RegExp, toPath: string): IUrlRouterProvider;
|
||||
when(whenPath: IUrlMatcher, hanlder: Function): IUrlRouterProvider;
|
||||
when(whenPath: IUrlMatcher, handler: any[]): IUrlRouterProvider;
|
||||
when(whenPath: IUrlMatcher, toPath: string): IUrlRouterProvider;
|
||||
when(whenPath: string, handler: Function): IUrlRouterProvider;
|
||||
when(whenPath: string, handler: any[]): IUrlRouterProvider;
|
||||
when(whenPath: string, toPath: string): IUrlRouterProvider;
|
||||
otherwise(handler: Function): IUrlRouterProvider;
|
||||
otherwise(handler: any[]): IUrlRouterProvider;
|
||||
otherwise(path: string): IUrlRouterProvider;
|
||||
rule(handler: Function): IUrlRouterProvider;
|
||||
rule(handler: any[]): IUrlRouterProvider;
|
||||
/**
|
||||
* Disables (or enables) deferring location change interception.
|
||||
*
|
||||
* If you wish to customize the behavior of syncing the URL (for example, if you wish to defer a transition but maintain the current URL), call this method at configuration time. Then, at run time, call $urlRouter.listen() after you have configured your own $locationChangeSuccess event handler.
|
||||
*
|
||||
* @param {boolean} defer Indicates whether to defer location change interception. Passing no parameter is equivalent to true.
|
||||
*/
|
||||
deferIntercept(defer?: boolean): void;
|
||||
}
|
||||
|
||||
interface IStateOptions {
|
||||
/**
|
||||
* {boolean=true|string=} - If true will update the url in the location bar, if false will not. If string, must be "replace", which will update url and also replace last history record.
|
||||
*/
|
||||
location?: boolean | string;
|
||||
/**
|
||||
* {boolean=true}, If true will inherit url parameters from current url.
|
||||
*/
|
||||
inherit?: boolean;
|
||||
/**
|
||||
* {object=$state.$current}, When transitioning with relative path (e.g '^'), defines which state to be relative from.
|
||||
*/
|
||||
relative?: IState;
|
||||
/**
|
||||
* {boolean=true}, If true will broadcast $stateChangeStart and $stateChangeSuccess events.
|
||||
*/
|
||||
notify?: boolean;
|
||||
/**
|
||||
* {boolean=false}, If true will force transition even if the state or params have not changed, aka a reload of the same state. It differs from reloadOnSearch because you'd use this when you want to force a reload when everything is the same, including search params.
|
||||
*/
|
||||
reload?: boolean;
|
||||
}
|
||||
|
||||
interface IHrefOptions {
|
||||
lossy?: boolean;
|
||||
inherit?: boolean;
|
||||
relative?: IState;
|
||||
absolute?: boolean;
|
||||
}
|
||||
|
||||
interface IStateService {
|
||||
/**
|
||||
* Convenience method for transitioning to a new state. $state.go calls $state.transitionTo internally but automatically sets options to { location: true, inherit: true, relative: $state.$current, notify: true }. This allows you to easily use an absolute or relative to path and specify only the parameters you'd like to update (while letting unspecified parameters inherit from the currently active ancestor states).
|
||||
*
|
||||
* @param to Absolute state name or relative state path. Some examples:
|
||||
*
|
||||
* $state.go('contact.detail') - will go to the contact.detail state
|
||||
* $state.go('^') - will go to a parent state
|
||||
* $state.go('^.sibling') - will go to a sibling state
|
||||
* $state.go('.child.grandchild') - will go to grandchild state
|
||||
*
|
||||
* @param params A map of the parameters that will be sent to the state, will populate $stateParams. Any parameters that are not specified will be inherited from currently defined parameters. This allows, for example, going to a sibling state that shares parameters specified in a parent state. Parameter inheritance only works between common ancestor states, I.e. transitioning to a sibling will get you the parameters for all parents, transitioning to a child will get you all current parameters, etc.
|
||||
*
|
||||
* @param options Options object.
|
||||
*/
|
||||
go(to: string, params?: {}, options?: IStateOptions): angular.IPromise<any>;
|
||||
go(to: IState, params?: {}, options?: IStateOptions): angular.IPromise<any>;
|
||||
transitionTo(state: string, params?: {}, updateLocation?: boolean): angular.IPromise<any>;
|
||||
transitionTo(state: IState, params?: {}, updateLocation?: boolean): angular.IPromise<any>;
|
||||
transitionTo(state: string, params?: {}, options?: IStateOptions): angular.IPromise<any>;
|
||||
transitionTo(state: IState, params?: {}, options?: IStateOptions): angular.IPromise<any>;
|
||||
includes(state: string, params?: {}): boolean;
|
||||
includes(state: string, params?: {}, options?:any): boolean;
|
||||
is(state:string, params?: {}): boolean;
|
||||
is(state: IState, params?: {}): boolean;
|
||||
href(state: IState, params?: {}, options?: IHrefOptions): string;
|
||||
href(state: string, params?: {}, options?: IHrefOptions): string;
|
||||
get(state: string, context?: string): IState;
|
||||
get(state: IState, context?: string): IState;
|
||||
get(state: string, context?: IState): IState;
|
||||
get(state: IState, context?: IState): IState;
|
||||
get(): IState[];
|
||||
/** A reference to the state's config object. However you passed it in. Useful for accessing custom data. */
|
||||
current: IState;
|
||||
/** A param object, e.g. {sectionId: section.id)}, that you'd like to test against the current active state. */
|
||||
params: IStateParamsService;
|
||||
reload(): angular.IPromise<any>;
|
||||
|
||||
/** Currently pending transition. A promise that'll resolve or reject. */
|
||||
transition: angular.IPromise<{}>;
|
||||
|
||||
$current: IResolvedState;
|
||||
}
|
||||
|
||||
interface IResolvedState {
|
||||
locals: {
|
||||
/**
|
||||
* Currently resolved "resolve" values from the current state
|
||||
*/
|
||||
globals: { [key: string]: any; };
|
||||
};
|
||||
}
|
||||
|
||||
interface IStateParamsService {
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
interface IUrlRouterService {
|
||||
/*
|
||||
* Triggers an update; the same update that happens when the address bar
|
||||
* url changes, aka $locationChangeSuccess.
|
||||
*
|
||||
* This method is useful when you need to use preventDefault() on the
|
||||
* $locationChangeSuccess event, perform some custom logic (route protection,
|
||||
* auth, config, redirection, etc) and then finally proceed with the transition
|
||||
* by calling $urlRouter.sync().
|
||||
*
|
||||
*/
|
||||
sync(): void;
|
||||
listen(): Function;
|
||||
href(urlMatcher: IUrlMatcher, params?: IStateParamsService, options?: IHrefOptions): string;
|
||||
update(read?: boolean): void;
|
||||
push(urlMatcher: IUrlMatcher, params?: IStateParamsService, options?: IHrefOptions): void;
|
||||
}
|
||||
|
||||
interface IUiViewScrollProvider {
|
||||
/*
|
||||
* Reverts back to using the core $anchorScroll service for scrolling
|
||||
* based on the url anchor.
|
||||
*/
|
||||
useAnchorScroll(): void;
|
||||
}
|
||||
|
||||
interface IType {
|
||||
/**
|
||||
* Converts a parameter value (from URL string or transition param) to a custom/native value.
|
||||
*
|
||||
* @param val {string} The URL parameter value to decode.
|
||||
* @param key {string} The name of the parameter in which val is stored. Can be used for meta-programming of Type objects.
|
||||
*
|
||||
* @returns {any} Returns a custom representation of the URL parameter value.
|
||||
*/
|
||||
decode(val: string, key: string): any;
|
||||
/**
|
||||
* Encodes a custom/native type value to a string that can be embedded in a URL. Note that the return value does not need to be URL-safe (i.e. passed through encodeURIComponent()), it only needs to be a representation of val that has been coerced to a string.
|
||||
*
|
||||
* @param val {any} The value to encode.
|
||||
* @param key {string} The name of the parameter in which val is stored. Can be used for meta-programming of Type objects.
|
||||
*
|
||||
* @returns {string} Returns a string representation of val that can be encoded in a URL.
|
||||
*/
|
||||
encode(val: any, key: string): string;
|
||||
/**
|
||||
* Determines whether two decoded values are equivalent.
|
||||
*
|
||||
* @param a {any} A value to compare against.
|
||||
* @param b {any} A value to compare against.
|
||||
*
|
||||
* @returns {boolean} Returns true if the values are equivalent/equal, otherwise false.
|
||||
*/
|
||||
equals? (a: any, b: any): boolean;
|
||||
/**
|
||||
* Detects whether a value is of a particular type. Accepts a native (decoded) value and determines whether it matches the current Type object.
|
||||
*
|
||||
* @param val {any} The value to check.
|
||||
* @param key {any} Optional. If the type check is happening in the context of a specific UrlMatcher object, this is the name of the parameter in which val is stored. Can be used for meta-programming of Type objects.
|
||||
*
|
||||
* @returns {boolean} Returns true if the value matches the type, otherwise false.
|
||||
*/
|
||||
is(val: any, key: string): boolean;
|
||||
/**
|
||||
* The regular expression pattern used to match values of this type when coming from a substring of a URL.
|
||||
*/
|
||||
pattern?: RegExp;
|
||||
}
|
||||
}
|
||||
|
||||
interface IStateParamsService {
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
interface IUrlRouterService {
|
||||
/*
|
||||
* Triggers an update; the same update that happens when the address bar
|
||||
* url changes, aka $locationChangeSuccess.
|
||||
*
|
||||
* This method is useful when you need to use preventDefault() on the
|
||||
* $locationChangeSuccess event, perform some custom logic (route protection,
|
||||
* auth, config, redirection, etc) and then finally proceed with the transition
|
||||
* by calling $urlRouter.sync().
|
||||
*
|
||||
*/
|
||||
sync(): void;
|
||||
listen(): Function;
|
||||
href(urlMatcher: IUrlMatcher, params?: IStateParamsService, options?: IHrefOptions): string;
|
||||
update(read?: boolean): void;
|
||||
push(urlMatcher: IUrlMatcher, params?: IStateParamsService, options?: IHrefOptions): void;
|
||||
}
|
||||
|
||||
interface IUiViewScrollProvider {
|
||||
/*
|
||||
* Reverts back to using the core $anchorScroll service for scrolling
|
||||
* based on the url anchor.
|
||||
*/
|
||||
useAnchorScroll(): void;
|
||||
}
|
||||
|
||||
interface IType {
|
||||
/**
|
||||
* Converts a parameter value (from URL string or transition param) to a custom/native value.
|
||||
*
|
||||
* @param val {string} The URL parameter value to decode.
|
||||
* @param key {string} The name of the parameter in which val is stored. Can be used for meta-programming of Type objects.
|
||||
*
|
||||
* @returns {any} Returns a custom representation of the URL parameter value.
|
||||
*/
|
||||
decode(val: string, key: string): any;
|
||||
/**
|
||||
* Encodes a custom/native type value to a string that can be embedded in a URL. Note that the return value does not need to be URL-safe (i.e. passed through encodeURIComponent()), it only needs to be a representation of val that has been coerced to a string.
|
||||
*
|
||||
* @param val {any} The value to encode.
|
||||
* @param key {string} The name of the parameter in which val is stored. Can be used for meta-programming of Type objects.
|
||||
*
|
||||
* @returns {string} Returns a string representation of val that can be encoded in a URL.
|
||||
*/
|
||||
encode(val: any, key: string): string;
|
||||
/**
|
||||
* Determines whether two decoded values are equivalent.
|
||||
*
|
||||
* @param a {any} A value to compare against.
|
||||
* @param b {any} A value to compare against.
|
||||
*
|
||||
* @returns {boolean} Returns true if the values are equivalent/equal, otherwise false.
|
||||
*/
|
||||
equals? (a: any, b: any): boolean;
|
||||
/**
|
||||
* Detects whether a value is of a particular type. Accepts a native (decoded) value and determines whether it matches the current Type object.
|
||||
*
|
||||
* @param val {any} The value to check.
|
||||
* @param key {any} Optional. If the type check is happening in the context of a specific UrlMatcher object, this is the name of the parameter in which val is stored. Can be used for meta-programming of Type objects.
|
||||
*
|
||||
* @returns {boolean} Returns true if the value matches the type, otherwise false.
|
||||
*/
|
||||
is(val: any, key: string): boolean;
|
||||
/**
|
||||
* The regular expression pattern used to match values of this type when coming from a substring of a URL.
|
||||
*/
|
||||
pattern?: RegExp;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
13
angularjs/index.d.ts
vendored
13
angularjs/index.d.ts
vendored
@ -14,12 +14,13 @@ interface Function {
|
||||
$inject?: string[];
|
||||
}
|
||||
|
||||
// Collapse angular into ng
|
||||
import ng = angular;
|
||||
export as namespace angular;
|
||||
export as namespace ng;
|
||||
|
||||
// Support AMD require
|
||||
declare module 'angular' {
|
||||
export = angular;
|
||||
}
|
||||
export = angular;
|
||||
|
||||
import ng = angular;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// ng module (angular.js)
|
||||
@ -617,7 +618,7 @@ declare namespace angular {
|
||||
/**
|
||||
* calling preventDefault sets defaultPrevented flag to true.
|
||||
*/
|
||||
preventDefault: Function;
|
||||
preventDefault(): void;
|
||||
/**
|
||||
* true if preventDefault was called.
|
||||
*/
|
||||
|
||||
6
atom-keymap/index.d.ts
vendored
6
atom-keymap/index.d.ts
vendored
@ -5,6 +5,8 @@
|
||||
|
||||
/// <reference types="event-kit" />
|
||||
|
||||
export = AtomKeymap;
|
||||
|
||||
declare namespace AtomKeymap {
|
||||
type Disposable = AtomEventKit.Disposable;
|
||||
|
||||
@ -129,7 +131,3 @@ declare namespace AtomKeymap {
|
||||
/** Allows commands to be associated with keystrokes in a context-sensitive way.*/
|
||||
var KeymapManager: KeymapManagerStatic;
|
||||
}
|
||||
|
||||
declare module 'atom-keymap' {
|
||||
export = AtomKeymap;
|
||||
}
|
||||
|
||||
6
autobahn/index.d.ts
vendored
6
autobahn/index.d.ts
vendored
@ -5,6 +5,8 @@
|
||||
|
||||
/// <reference types="when" />
|
||||
|
||||
export = autobahn;
|
||||
|
||||
declare namespace autobahn {
|
||||
|
||||
export class Session {
|
||||
@ -262,7 +264,3 @@ declare namespace autobahn {
|
||||
var transports: ITransports;
|
||||
var auth_cra: IAuthCra;
|
||||
}
|
||||
|
||||
declare module "autobahn" {
|
||||
export = autobahn;
|
||||
}
|
||||
|
||||
202
babel-core/index.d.ts
vendored
202
babel-core/index.d.ts
vendored
@ -7,138 +7,138 @@
|
||||
/// <reference types="babel-traverse" />
|
||||
/// <reference types="babel-types" />
|
||||
|
||||
declare module "babel-core" {
|
||||
import * as t from 'babel-types';
|
||||
export {t as types};
|
||||
type Node = t.Node;
|
||||
export import template = require('babel-template');
|
||||
export var version: string;
|
||||
import traverse, {Visitor} from "babel-traverse";
|
||||
export {traverse, Visitor};
|
||||
import * as t from 'babel-types';
|
||||
export {t as types};
|
||||
type Node = t.Node;
|
||||
export import template = require('babel-template');
|
||||
export var version: string;
|
||||
import traverse, {Visitor} from "babel-traverse";
|
||||
export {traverse, Visitor};
|
||||
|
||||
|
||||
/** Transforms the passed in `code`. Returning an object with the generated code, source map, and AST. */
|
||||
export function transform(code: string, opts?: TransformOptions): BabelFileResult;
|
||||
/** Transforms the passed in `code`. Returning an object with the generated code, source map, and AST. */
|
||||
export function transform(code: string, opts?: TransformOptions): BabelFileResult;
|
||||
|
||||
/** Asynchronously transforms the entire contents of a file. */
|
||||
export function transformFile(filename: string, opts: TransformOptions, callback: (err: any, result: BabelFileResult) => void): void;
|
||||
/** Asynchronously transforms the entire contents of a file. */
|
||||
export function transformFile(filename: string, opts: TransformOptions, callback: (err: any, result: BabelFileResult) => void): void;
|
||||
|
||||
/** Synchronous version of `babel.transformFile`. Returns the transformed contents of the `filename`. */
|
||||
export function transformFileSync(filename: string, opts?: TransformOptions): BabelFileResult;
|
||||
/** Synchronous version of `babel.transformFile`. Returns the transformed contents of the `filename`. */
|
||||
export function transformFileSync(filename: string, opts?: TransformOptions): BabelFileResult;
|
||||
|
||||
export function transformFromAst(ast: Node, code?: string, opts?: TransformOptions): BabelFileResult;
|
||||
export function transformFromAst(ast: Node, code?: string, opts?: TransformOptions): BabelFileResult;
|
||||
|
||||
export interface TransformOptions {
|
||||
export interface TransformOptions {
|
||||
|
||||
/** Filename to use when reading from stdin - this will be used in source-maps, errors etc. Default: "unknown". */
|
||||
filename?: string;
|
||||
/** Filename to use when reading from stdin - this will be used in source-maps, errors etc. Default: "unknown". */
|
||||
filename?: string;
|
||||
|
||||
/** Filename relative to `sourceRoot`. */
|
||||
filenameRelative?: string;
|
||||
/** Filename relative to `sourceRoot`. */
|
||||
filenameRelative?: string;
|
||||
|
||||
/** A source map object that the output source map will be based on. */
|
||||
inputSourceMap?: Object;
|
||||
/** A source map object that the output source map will be based on. */
|
||||
inputSourceMap?: Object;
|
||||
|
||||
/**
|
||||
* This is an object of keys that represent different environments. For example, you may have:
|
||||
* `{ env: { production: { / * specific options * / } } }`
|
||||
* which will use those options when the enviroment variable `BABEL_ENV` is set to `"production"`.
|
||||
* If `BABEL_ENV` isn't set then `NODE_ENV` will be used, if it's not set then it defaults to `"development"`.
|
||||
*/
|
||||
env?: Object;
|
||||
/**
|
||||
* This is an object of keys that represent different environments. For example, you may have:
|
||||
* `{ env: { production: { / * specific options * / } } }`
|
||||
* which will use those options when the enviroment variable `BABEL_ENV` is set to `"production"`.
|
||||
* If `BABEL_ENV` isn't set then `NODE_ENV` will be used, if it's not set then it defaults to `"development"`.
|
||||
*/
|
||||
env?: Object;
|
||||
|
||||
/** Retain line numbers - will result in really ugly code. Default: `false` */
|
||||
retainLines?: boolean;
|
||||
/** Retain line numbers - will result in really ugly code. Default: `false` */
|
||||
retainLines?: boolean;
|
||||
|
||||
/** Enable/disable ANSI syntax highlighting of code frames. Default: `true`. */
|
||||
highlightCode?: boolean;
|
||||
/** Enable/disable ANSI syntax highlighting of code frames. Default: `true`. */
|
||||
highlightCode?: boolean;
|
||||
|
||||
/** List of presets (a set of plugins) to load and use. */
|
||||
presets?: any[];
|
||||
/** List of presets (a set of plugins) to load and use. */
|
||||
presets?: any[];
|
||||
|
||||
/** List of plugins to load and use. */
|
||||
plugins?: any[];
|
||||
/** List of plugins to load and use. */
|
||||
plugins?: any[];
|
||||
|
||||
/** list of glob paths to **not** compile. Opposite to the `only` option. */
|
||||
ignore?: string[];
|
||||
/** list of glob paths to **not** compile. Opposite to the `only` option. */
|
||||
ignore?: string[];
|
||||
|
||||
/**
|
||||
* A glob, regex, or mixed array of both, matching paths to only compile. Can also be an array of arrays containing
|
||||
* paths to explicitly match. When attempting to compile a non-matching file it's returned verbatim.
|
||||
*/
|
||||
only?: string | RegExp | Array<string | RegExp>;
|
||||
/**
|
||||
* A glob, regex, or mixed array of both, matching paths to only compile. Can also be an array of arrays containing
|
||||
* paths to explicitly match. When attempting to compile a non-matching file it's returned verbatim.
|
||||
*/
|
||||
only?: string | RegExp | Array<string | RegExp>;
|
||||
|
||||
/** Enable code generation. Default: `true`. */
|
||||
code?: boolean;
|
||||
/** Enable code generation. Default: `true`. */
|
||||
code?: boolean;
|
||||
|
||||
/** Include the AST in the returned object. Default: `true`. */
|
||||
ast?: boolean;
|
||||
/** Include the AST in the returned object. Default: `true`. */
|
||||
ast?: boolean;
|
||||
|
||||
/** A path to an .babelrc file to extend. */
|
||||
extends?: string;
|
||||
/** A path to an .babelrc file to extend. */
|
||||
extends?: string;
|
||||
|
||||
/** write comments to generated output. Default: `true`. */
|
||||
comments?: boolean;
|
||||
/** write comments to generated output. Default: `true`. */
|
||||
comments?: boolean;
|
||||
|
||||
/**
|
||||
* An optional callback that controls whether a comment should be output or not. Called as
|
||||
* `shouldPrintComment(commentContents)`. **NOTE**: This overrides the `comments` option when used.
|
||||
*/
|
||||
shouldPrintComment?: (comment: string) => boolean;
|
||||
/**
|
||||
* An optional callback that controls whether a comment should be output or not. Called as
|
||||
* `shouldPrintComment(commentContents)`. **NOTE**: This overrides the `comments` option when used.
|
||||
*/
|
||||
shouldPrintComment?: (comment: string) => boolean;
|
||||
|
||||
/**
|
||||
* Do not include superfluous whitespace characters and line terminators. When set to `"auto"`, `compact` is set to
|
||||
* `true` on input sizes of >100KB.
|
||||
*/
|
||||
compact?: boolean | "auto";
|
||||
/**
|
||||
* Do not include superfluous whitespace characters and line terminators. When set to `"auto"`, `compact` is set to
|
||||
* `true` on input sizes of >100KB.
|
||||
*/
|
||||
compact?: boolean | "auto";
|
||||
|
||||
/**
|
||||
* If truthy, adds a `map` property to returned output. If set to `"inline"`, a comment with a `sourceMappingURL`
|
||||
* directive is added to the bottom of the returned code. If set to `"both"` then a map property is returned as well
|
||||
* as a source map comment appended.
|
||||
*/
|
||||
sourceMaps?: boolean | "inline" | "both";
|
||||
/**
|
||||
* If truthy, adds a `map` property to returned output. If set to `"inline"`, a comment with a `sourceMappingURL`
|
||||
* directive is added to the bottom of the returned code. If set to `"both"` then a map property is returned as well
|
||||
* as a source map comment appended.
|
||||
*/
|
||||
sourceMaps?: boolean | "inline" | "both";
|
||||
|
||||
/** Set `file` on returned source map. */
|
||||
sourceMapTarget?: string;
|
||||
/** Set `file` on returned source map. */
|
||||
sourceMapTarget?: string;
|
||||
|
||||
/** Set `sources[0]` on returned source map. */
|
||||
sourceFileName?: string;
|
||||
/** Set `sources[0]` on returned source map. */
|
||||
sourceFileName?: string;
|
||||
|
||||
/** The root from which all sources are relative. */
|
||||
sourceRoot?: string;
|
||||
/** The root from which all sources are relative. */
|
||||
sourceRoot?: string;
|
||||
|
||||
/** Specify whether or not to use `.babelrc` and `.babelignore` files. Default: `true`. */
|
||||
babelrc?: boolean;
|
||||
/** Specify whether or not to use `.babelrc` and `.babelignore` files. Default: `true`. */
|
||||
babelrc?: boolean;
|
||||
|
||||
/** Attach a comment before all non-user injected code. */
|
||||
auxiliaryCommentBefore?: string;
|
||||
/** Attach a comment before all non-user injected code. */
|
||||
auxiliaryCommentBefore?: string;
|
||||
|
||||
/** Attach a comment after all non-user injected code. */
|
||||
auxiliaryCommentAfter?: string;
|
||||
/** Attach a comment after all non-user injected code. */
|
||||
auxiliaryCommentAfter?: string;
|
||||
|
||||
/**
|
||||
* Specify a custom callback to generate a module id with. Called as `getModuleId(moduleName)`.
|
||||
* If falsy value is returned then the generated module id is used.
|
||||
*/
|
||||
getModuleId?: (moduleName: string) => string;
|
||||
/**
|
||||
* Specify a custom callback to generate a module id with. Called as `getModuleId(moduleName)`.
|
||||
* If falsy value is returned then the generated module id is used.
|
||||
*/
|
||||
getModuleId?: (moduleName: string) => string;
|
||||
|
||||
/** Optional prefix for the AMD module formatter that will be prepend to the filename on module definitions. */
|
||||
moduleRoot?: string;
|
||||
/** Optional prefix for the AMD module formatter that will be prepend to the filename on module definitions. */
|
||||
moduleRoot?: string;
|
||||
|
||||
/**
|
||||
* If truthy, insert an explicit id for modules. By default, all modules are anonymous.
|
||||
* (Not available for `common` modules).
|
||||
*/
|
||||
moduleIds?: boolean;
|
||||
/**
|
||||
* If truthy, insert an explicit id for modules. By default, all modules are anonymous.
|
||||
* (Not available for `common` modules).
|
||||
*/
|
||||
moduleIds?: boolean;
|
||||
|
||||
/** Specify a custom name for module ids. */
|
||||
moduleId?: string;
|
||||
}
|
||||
|
||||
export interface BabelFileResult {
|
||||
ast?: Node;
|
||||
code?: string;
|
||||
map?: Object;
|
||||
}
|
||||
/** Specify a custom name for module ids. */
|
||||
moduleId?: string;
|
||||
}
|
||||
|
||||
export interface BabelFileResult {
|
||||
ast?: Node;
|
||||
code?: string;
|
||||
map?: Object;
|
||||
}
|
||||
export as namespace babel;
|
||||
|
||||
|
||||
159
babel-generator/index.d.ts
vendored
159
babel-generator/index.d.ts
vendored
@ -5,98 +5,97 @@
|
||||
|
||||
/// <reference types="babel-types" />
|
||||
|
||||
declare module "babel-generator" {
|
||||
import * as t from 'babel-types';
|
||||
type Node = t.Node;
|
||||
import * as t from 'babel-types';
|
||||
type Node = t.Node;
|
||||
|
||||
/**
|
||||
* Turns an AST into code, maintaining sourcemaps, user preferences, and valid output.
|
||||
* @param ast - the abstract syntax tree from which to generate output code.
|
||||
* @param opts - used for specifying options for code generation.
|
||||
* @param code - the original source code, used for source maps.
|
||||
* @returns - an object containing the output code and source map.
|
||||
*/
|
||||
export default function generate(ast: Node, opts?: GeneratorOptions, code?: string | {[filename: string]: string}): GeneratorResult;
|
||||
|
||||
export interface GeneratorOptions {
|
||||
|
||||
/**
|
||||
* Turns an AST into code, maintaining sourcemaps, user preferences, and valid output.
|
||||
* @param ast - the abstract syntax tree from which to generate output code.
|
||||
* @param opts - used for specifying options for code generation.
|
||||
* @param code - the original source code, used for source maps.
|
||||
* @returns - an object containing the output code and source map.
|
||||
* Optional string to add as a block comment at the start of the output file.
|
||||
*/
|
||||
auxiliaryCommentBefore?: string;
|
||||
|
||||
/**
|
||||
* Optional string to add as a block comment at the end of the output file.
|
||||
*/
|
||||
auxiliaryCommentAfter?: string;
|
||||
|
||||
/**
|
||||
* Function that takes a comment (as a string) and returns true if the comment should be included in the output.
|
||||
* By default, comments are included if `opts.comments` is `true` or if `opts.minifed` is `false` and the comment
|
||||
* contains `@preserve` or `@license`.
|
||||
*/
|
||||
export default function generate(ast: Node, opts?: GeneratorOptions, code?: string | {[filename: string]: string}): GeneratorResult;
|
||||
shouldPrintComment?: (comment: string) => boolean;
|
||||
|
||||
export interface GeneratorOptions {
|
||||
/**
|
||||
* Attempt to use the same line numbers in the output code as in the source code (helps preserve stack traces).
|
||||
* Defaults to `false`.
|
||||
*/
|
||||
retainLines?: boolean;
|
||||
|
||||
/**
|
||||
* Optional string to add as a block comment at the start of the output file.
|
||||
*/
|
||||
auxiliaryCommentBefore?: string;
|
||||
/**
|
||||
* Should comments be included in output? Defaults to `true`.
|
||||
*/
|
||||
comments?: boolean;
|
||||
|
||||
/**
|
||||
* Optional string to add as a block comment at the end of the output file.
|
||||
*/
|
||||
auxiliaryCommentAfter?: string;
|
||||
/**
|
||||
* Set to true to avoid adding whitespace for formatting. Defaults to the value of `opts.minified`.
|
||||
*/
|
||||
compact?: boolean | 'auto';
|
||||
|
||||
/**
|
||||
* Function that takes a comment (as a string) and returns true if the comment should be included in the output.
|
||||
* By default, comments are included if `opts.comments` is `true` or if `opts.minifed` is `false` and the comment
|
||||
* contains `@preserve` or `@license`.
|
||||
*/
|
||||
shouldPrintComment?: (comment: string) => boolean;
|
||||
/**
|
||||
* Should the output be minified. Defaults to `false`.
|
||||
*/
|
||||
minified?: boolean;
|
||||
|
||||
/**
|
||||
* Attempt to use the same line numbers in the output code as in the source code (helps preserve stack traces).
|
||||
* Defaults to `false`.
|
||||
*/
|
||||
retainLines?: boolean;
|
||||
/**
|
||||
* Set to true to reduce whitespace (but not as much as opts.compact). Defaults to `false`.
|
||||
*/
|
||||
concise?: boolean;
|
||||
|
||||
/**
|
||||
* Should comments be included in output? Defaults to `true`.
|
||||
*/
|
||||
comments?: boolean;
|
||||
/**
|
||||
* The type of quote to use in the output. If omitted, autodetects based on `ast.tokens`.
|
||||
*/
|
||||
quotes?: 'single' | 'double';
|
||||
|
||||
/**
|
||||
* Set to true to avoid adding whitespace for formatting. Defaults to the value of `opts.minified`.
|
||||
*/
|
||||
compact?: boolean | 'auto';
|
||||
/**
|
||||
* Used in warning messages
|
||||
*/
|
||||
filename?: string;
|
||||
|
||||
/**
|
||||
* Should the output be minified. Defaults to `false`.
|
||||
*/
|
||||
minified?: boolean;
|
||||
/**
|
||||
* Enable generating source maps. Defaults to `false`.
|
||||
*/
|
||||
sourceMaps?: boolean;
|
||||
|
||||
/**
|
||||
* Set to true to reduce whitespace (but not as much as opts.compact). Defaults to `false`.
|
||||
*/
|
||||
concise?: boolean;
|
||||
/**
|
||||
* The filename of the generated code that the source map will be associated with.
|
||||
*/
|
||||
sourceMapTarget?: string;
|
||||
|
||||
/**
|
||||
* The type of quote to use in the output. If omitted, autodetects based on `ast.tokens`.
|
||||
*/
|
||||
quotes?: 'single' | 'double';
|
||||
/**
|
||||
* A root for all relative URLs in the source map.
|
||||
*/
|
||||
sourceRoot?: string;
|
||||
|
||||
/**
|
||||
* Used in warning messages
|
||||
*/
|
||||
filename?: string;
|
||||
|
||||
/**
|
||||
* Enable generating source maps. Defaults to `false`.
|
||||
*/
|
||||
sourceMaps?: boolean;
|
||||
|
||||
/**
|
||||
* The filename of the generated code that the source map will be associated with.
|
||||
*/
|
||||
sourceMapTarget?: string;
|
||||
|
||||
/**
|
||||
* A root for all relative URLs in the source map.
|
||||
*/
|
||||
sourceRoot?: string;
|
||||
|
||||
/**
|
||||
* The filename for the source code (i.e. the code in the `code` argument).
|
||||
* This will only be used if `code` is a string.
|
||||
*/
|
||||
sourceFileName?: string;
|
||||
}
|
||||
|
||||
export interface GeneratorResult {
|
||||
map: Object;
|
||||
code: string;
|
||||
}
|
||||
/**
|
||||
* The filename for the source code (i.e. the code in the `code` argument).
|
||||
* This will only be used if `code` is a string.
|
||||
*/
|
||||
sourceFileName?: string;
|
||||
}
|
||||
|
||||
export interface GeneratorResult {
|
||||
map: Object;
|
||||
code: string;
|
||||
}
|
||||
|
||||
|
||||
22
babel-template/index.d.ts
vendored
22
babel-template/index.d.ts
vendored
@ -6,16 +6,16 @@
|
||||
/// <reference types="babylon" />
|
||||
/// <reference types="babel-types" />
|
||||
|
||||
declare module "babel-template" {
|
||||
import {BabylonOptions} from 'babylon';
|
||||
import * as t from 'babel-types';
|
||||
type Node = t.Node;
|
||||
|
||||
// NB: This export doesn't match the handbook example, where `template` is the default export.
|
||||
// But it does match the runtime behaviour (at least at the time of this writing). For some reason,
|
||||
// babel-template/lib/index.js has this line at the bottom: module.exports = exports["default"];
|
||||
export = template;
|
||||
function template(code: string, opts?: BabylonOptions): UseTemplate;
|
||||
import {BabylonOptions} from 'babylon';
|
||||
import * as t from 'babel-types';
|
||||
type Node = t.Node;
|
||||
|
||||
// NB: This export doesn't match the handbook example, where `template` is the default export.
|
||||
// But it does match the runtime behaviour (at least at the time of this writing). For some reason,
|
||||
// babel-template/lib/index.js has this line at the bottom: module.exports = exports["default"];
|
||||
export = template;
|
||||
declare function template(code: string, opts?: BabylonOptions): UseTemplate;
|
||||
|
||||
type UseTemplate = (nodes?: {[placeholder: string]: Node}) => Node;
|
||||
|
||||
type UseTemplate = (nodes?: {[placeholder: string]: Node}) => Node;
|
||||
}
|
||||
|
||||
1910
babel-traverse/index.d.ts
vendored
1910
babel-traverse/index.d.ts
vendored
File diff suppressed because it is too large
Load Diff
2792
babel-types/index.d.ts
vendored
2792
babel-types/index.d.ts
vendored
File diff suppressed because it is too large
Load Diff
65
babylon/index.d.ts
vendored
65
babylon/index.d.ts
vendored
@ -5,44 +5,43 @@
|
||||
|
||||
/// <reference types="babel-types" />
|
||||
|
||||
declare module "babylon" {
|
||||
import * as t from 'babel-types';
|
||||
type Node = t.Node;
|
||||
import * as t from 'babel-types';
|
||||
type Node = t.Node;
|
||||
|
||||
export function parse(code: string, opts?: BabylonOptions): Node;
|
||||
export function parse(code: string, opts?: BabylonOptions): Node;
|
||||
|
||||
export interface BabylonOptions {
|
||||
/**
|
||||
* By default, import and export declarations can only appear at a program's top level.
|
||||
* Setting this option to true allows them anywhere where a statement is allowed.
|
||||
*/
|
||||
allowImportExportEverywhere?: boolean;
|
||||
export interface BabylonOptions {
|
||||
/**
|
||||
* By default, import and export declarations can only appear at a program's top level.
|
||||
* Setting this option to true allows them anywhere where a statement is allowed.
|
||||
*/
|
||||
allowImportExportEverywhere?: boolean;
|
||||
|
||||
/**
|
||||
* By default, a return statement at the top level raises an error. Set this to true to accept such code.
|
||||
*/
|
||||
allowReturnOutsideFunction?: boolean;
|
||||
/**
|
||||
* By default, a return statement at the top level raises an error. Set this to true to accept such code.
|
||||
*/
|
||||
allowReturnOutsideFunction?: boolean;
|
||||
|
||||
allowSuperOutsideMethod?: boolean;
|
||||
allowSuperOutsideMethod?: boolean;
|
||||
|
||||
/**
|
||||
* Indicate the mode the code should be parsed in. Can be either "script" or "module".
|
||||
*/
|
||||
sourceType?: 'script' | 'module';
|
||||
/**
|
||||
* Indicate the mode the code should be parsed in. Can be either "script" or "module".
|
||||
*/
|
||||
sourceType?: 'script' | 'module';
|
||||
|
||||
/**
|
||||
* Correlate output AST nodes with their source filename. Useful when
|
||||
* generating code and source maps from the ASTs of multiple input files.
|
||||
*/
|
||||
sourceFilename?: string;
|
||||
/**
|
||||
* Correlate output AST nodes with their source filename. Useful when
|
||||
* generating code and source maps from the ASTs of multiple input files.
|
||||
*/
|
||||
sourceFilename?: string;
|
||||
|
||||
/**
|
||||
* Array containing the plugins that you want to enable.
|
||||
*/
|
||||
plugins?: PluginName[];
|
||||
}
|
||||
|
||||
export type PluginName = 'jsx' | 'flow' | 'asyncFunctions' | 'classConstructorCall' | 'doExpressions'
|
||||
| 'trailingFunctionCommas' | 'objectRestSpread' | 'decorators' | 'classProperties' | 'exportExtensions'
|
||||
| 'exponentiationOperator' | 'asyncGenerators' | 'functionBind' | 'functionSent';
|
||||
/**
|
||||
* Array containing the plugins that you want to enable.
|
||||
*/
|
||||
plugins?: PluginName[];
|
||||
}
|
||||
|
||||
export type PluginName = 'jsx' | 'flow' | 'asyncFunctions' | 'classConstructorCall' | 'doExpressions'
|
||||
| 'trailingFunctionCommas' | 'objectRestSpread' | 'decorators' | 'classProperties' | 'exportExtensions'
|
||||
| 'exponentiationOperator' | 'asyncGenerators' | 'functionBind' | 'functionSent';
|
||||
|
||||
|
||||
@ -1,8 +1,7 @@
|
||||
|
||||
|
||||
import * as basex from 'base-x';
|
||||
|
||||
let bs16: BaseX.BaseConverter = basex('0123456789ABCDEF');
|
||||
let bs16 = basex('0123456789ABCDEF');
|
||||
|
||||
{
|
||||
let encoded: string;
|
||||
|
||||
11
base-x/index.d.ts
vendored
11
base-x/index.d.ts
vendored
@ -3,6 +3,9 @@
|
||||
// Definitions by: Ilya Mochalov <https://github.com/chrootsu>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare var base: BaseX.Base;
|
||||
export = base;
|
||||
|
||||
declare namespace BaseX {
|
||||
interface EncodeBuffer {
|
||||
[index: number]: number;
|
||||
@ -18,11 +21,3 @@ declare namespace BaseX {
|
||||
(ALPHABET: string): BaseX.BaseConverter
|
||||
}
|
||||
}
|
||||
|
||||
declare module "base-x" {
|
||||
namespace base {}
|
||||
|
||||
let base: BaseX.Base;
|
||||
|
||||
export = base;
|
||||
}
|
||||
|
||||
6
bignum/index.d.ts
vendored
6
bignum/index.d.ts
vendored
@ -5,6 +5,8 @@
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
export = BigNum;
|
||||
|
||||
declare class BigNum {
|
||||
/** Create a new BigNum from n. */
|
||||
constructor(n: number|BigNum);
|
||||
@ -263,7 +265,3 @@ declare namespace BigNum {
|
||||
/** Return the number of bits used to represent the current BigNum. */
|
||||
export function bitLength(n: BigNumCompatible): number;
|
||||
}
|
||||
|
||||
declare module "bignum" {
|
||||
export = BigNum;
|
||||
}
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import bip21 = require('bip21');
|
||||
let decoded:any = bip21.decode('bitcoin:1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH?amount=20.3&label=Foobar');
|
||||
|
||||
let encoded:string = bip21.encode('1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH', {
|
||||
|
||||
4
bip21/index.d.ts
vendored
4
bip21/index.d.ts
vendored
@ -8,6 +8,4 @@ declare namespace bip21 {
|
||||
export function encode(address:string,options?:any) : string;
|
||||
}
|
||||
|
||||
declare module "bip21" {
|
||||
export = bip21;
|
||||
}
|
||||
export = bip21;
|
||||
|
||||
4
blob-stream/index.d.ts
vendored
4
blob-stream/index.d.ts
vendored
@ -15,6 +15,4 @@ declare namespace BlobStream {
|
||||
}
|
||||
}
|
||||
|
||||
declare module "blob-stream" {
|
||||
export = BlobStream;
|
||||
}
|
||||
export = BlobStream;
|
||||
603
bookshelf/index.d.ts
vendored
603
bookshelf/index.d.ts
vendored
@ -6,308 +6,307 @@
|
||||
/// <reference types="bluebird" />
|
||||
/// <reference types="lodash" />
|
||||
|
||||
declare module 'bookshelf' {
|
||||
import knex = require('knex');
|
||||
import Promise = require('bluebird');
|
||||
import Lodash = require('lodash');
|
||||
import knex = require('knex');
|
||||
import Promise = require('bluebird');
|
||||
import Lodash = require('lodash');
|
||||
|
||||
interface Bookshelf extends Bookshelf.Events<any> {
|
||||
VERSION : string;
|
||||
knex : knex;
|
||||
Model : typeof Bookshelf.Model;
|
||||
Collection : typeof Bookshelf.Collection;
|
||||
interface Bookshelf extends Bookshelf.Events<any> {
|
||||
VERSION : string;
|
||||
knex : knex;
|
||||
Model : typeof Bookshelf.Model;
|
||||
Collection : typeof Bookshelf.Collection;
|
||||
|
||||
plugin(name: string | string[] | Function, options?: any) : Bookshelf;
|
||||
transaction<T>(callback : (transaction : knex.Transaction) => T) : Promise<T>;
|
||||
}
|
||||
|
||||
function Bookshelf(knex : knex) : Bookshelf;
|
||||
|
||||
namespace Bookshelf {
|
||||
abstract class Events<T> {
|
||||
on(event? : string, callback? : EventFunction<T>, context? : any) : void;
|
||||
off(event? : string) : void;
|
||||
trigger(event? : string, ...args : any[]) : void;
|
||||
triggerThen(name : string, ...args : any[]) : Promise<any>;
|
||||
once(event : string, callback : EventFunction<T>, context? : any) : void;
|
||||
}
|
||||
|
||||
interface IModelBase {
|
||||
/** Should be declared as a getter instead of a plain property. */
|
||||
hasTimestamps? : boolean|string[];
|
||||
/** Should be declared as a getter instead of a plain property. Should be required, but cannot have abstract properties yet. */
|
||||
tableName? : string;
|
||||
}
|
||||
|
||||
abstract class ModelBase<T extends Model<any>> extends Events<T|Collection<T>> implements IModelBase {
|
||||
/** If overriding, must use a getter instead of a plain property. */
|
||||
idAttribute : string;
|
||||
|
||||
constructor(attributes? : any, options? : ModelOptions);
|
||||
|
||||
clear() : T;
|
||||
clone() : T;
|
||||
escape(attribute : string) : string;
|
||||
format(attributes : any) : any;
|
||||
get(attribute : string) : any;
|
||||
has(attribute : string) : boolean;
|
||||
hasChanged(attribute? : string) : boolean;
|
||||
isNew() : boolean;
|
||||
parse(response : any) : any;
|
||||
previousAttributes() : any;
|
||||
previous(attribute : string) : any;
|
||||
related<R extends Model<any>>(relation : string) : R | Collection<R>;
|
||||
serialize(options? : SerializeOptions) : any;
|
||||
set(attribute?: {[key : string] : any}, options? : SetOptions) : T;
|
||||
set(attribute : string, value? : any, options? : SetOptions) : T;
|
||||
timestamp(options? : TimestampOptions) : any;
|
||||
toJSON(options? : SerializeOptions) : any;
|
||||
unset(attribute : string) : T;
|
||||
|
||||
// lodash methods
|
||||
invert<R extends {}>() : R;
|
||||
keys() : string[];
|
||||
omit<R extends {}>(predicate? : Lodash.ObjectIterator<any, boolean>, thisArg? : any) : R;
|
||||
omit<R extends {}>(...attributes : string[]) : R;
|
||||
pairs() : any[][];
|
||||
pick<R extends {}>(predicate? : Lodash.ObjectIterator<any, boolean>, thisArg? : any) : R;
|
||||
pick<R extends {}>(...attributes : string[]) : R;
|
||||
values() : any[];
|
||||
}
|
||||
|
||||
class Model<T extends Model<any>> extends ModelBase<T> {
|
||||
static collection<T extends Model<any>>(models? : T[], options? : CollectionOptions<T>) : Collection<T>;
|
||||
static count(column? : string, options? : SyncOptions) : Promise<number>;
|
||||
/** @deprecated use Typescript classes */
|
||||
static extend<T extends Model<any>>(prototypeProperties? : any, classProperties? : any) : Function; // should return a type
|
||||
static fetchAll<T extends Model<any>>() : Promise<Collection<T>>;
|
||||
/** @deprecated should use `new` objects instead. */
|
||||
static forge<T>(attributes? : any, options? : ModelOptions) : T;
|
||||
|
||||
belongsTo<R extends Model<any>>(target : {new(...args : any[]) : R}, foreignKey? : string) : R;
|
||||
belongsToMany<R extends Model<any>>(target : {new(...args : any[]) : R}, table? : string, foreignKey? : string, otherKey? : string) : Collection<R>;
|
||||
count(column? : string, options? : SyncOptions) : Promise<number>;
|
||||
destroy(options? : SyncOptions) : Promise<T>;
|
||||
fetch(options? : FetchOptions) : Promise<T>;
|
||||
fetchAll(options? : FetchAllOptions) : Promise<Collection<T>>;
|
||||
hasMany<R extends Model<any>>(target : {new(...args : any[]) : R}, foreignKey? : string) : Collection<R>;
|
||||
hasOne<R extends Model<any>>(target : {new(...args : any[]) : R}, foreignKey? : string) : R;
|
||||
load(relations : string|string[], options? : LoadOptions) : Promise<T>;
|
||||
morphMany<R extends Model<any>>(target : {new(...args : any[]) : R}, name? : string, columnNames? : string[], morphValue? : string) : Collection<R>;
|
||||
morphOne<R extends Model<any>>(target : {new(...args : any[]) : R}, name? : string, columnNames? : string[], morphValue? : string) : R;
|
||||
morphTo(name : string, columnNames? : string[], ...target : typeof Model[]) : T;
|
||||
morphTo(name : string, ...target : typeof Model[]) : T;
|
||||
query(...query : string[]) : T;
|
||||
query(query : {[key : string] : any}) : T;
|
||||
query(callback : (qb : knex.QueryBuilder) => void) : T;
|
||||
query() : knex.QueryBuilder;
|
||||
refresh(options? : FetchOptions) : Promise<T>;
|
||||
resetQuery() : T;
|
||||
save(key? : string, val? : string, options? : SaveOptions) : Promise<T>;
|
||||
save(attrs? : {[key : string] : any}, options? : SaveOptions) : Promise<T>;
|
||||
through<R extends Model<any>>(interim : typeof Model, throughForeignKey? : string, otherKey? : string) : R | Collection<R>;
|
||||
where(properties : {[key : string] : any}) : T;
|
||||
where(key : string, operatorOrValue : string|number|boolean, valueIfOperator? : string|number|boolean) : T;
|
||||
}
|
||||
|
||||
abstract class CollectionBase<T extends Model<any>> extends Events<T> {
|
||||
add(models : T[]|{[key : string] : any}[], options? : CollectionAddOptions) : Collection<T>;
|
||||
at(index : number) : T;
|
||||
clone() : Collection<T>;
|
||||
fetch(options? : CollectionFetchOptions) : Promise<Collection<T>>;
|
||||
findWhere(match : {[key : string] : any}) : T;
|
||||
get(id : any) : T;
|
||||
invokeThen(name : string, ...args : any[]) : Promise<any>;
|
||||
parse(response : any) : any;
|
||||
pluck(attribute : string) : any[];
|
||||
pop() : void;
|
||||
push(model : any) : Collection<T>;
|
||||
reduceThen<R>(iterator : (prev : R, cur : T, idx : number, array : T[]) => R, initialValue : R, context : any) : Promise<R>;
|
||||
remove(model : T, options? : EventOptions) : T;
|
||||
remove(model : T[], options? : EventOptions) : T[];
|
||||
reset(model : any[], options? : CollectionAddOptions) : T[];
|
||||
serialize(options? : SerializeOptions) : any;
|
||||
set(models : T[]|{[key : string] : any}[], options? : CollectionSetOptions) : Collection<T>;
|
||||
shift(options? : EventOptions) : void;
|
||||
slice(begin? : number, end? : number) : void;
|
||||
toJSON(options? : SerializeOptions) : any;
|
||||
unshift(model : any, options? : CollectionAddOptions) : void;
|
||||
where(match : {[key : string] : any}, firstOnly : boolean) : T|Collection<T>;
|
||||
|
||||
// lodash methods
|
||||
all(predicate? : Lodash.ListIterator<T, boolean>|Lodash.DictionaryIterator<T, boolean>|string, thisArg? : any) : boolean;
|
||||
all<R extends {}>(predicate? : R) : boolean;
|
||||
any(predicate? : Lodash.ListIterator<T, boolean>|Lodash.DictionaryIterator<T, boolean>|string, thisArg? : any) : boolean;
|
||||
any<R extends {}>(predicate? : R) : boolean;
|
||||
chain() : Lodash.LoDashExplicitObjectWrapper<T>;
|
||||
collect(predicate? : Lodash.ListIterator<T, boolean>|Lodash.DictionaryIterator<T, boolean>|string, thisArg? : any) : T[];
|
||||
collect<R extends {}>(predicate? : R) : T[];
|
||||
contains(value : any, fromIndex? : number) : boolean;
|
||||
countBy(predicate? : Lodash.ListIterator<T, boolean>|Lodash.DictionaryIterator<T, boolean>|string, thisArg? : any) : Lodash.Dictionary<number>;
|
||||
countBy<R extends {}>(predicate? : R) : Lodash.Dictionary<number>;
|
||||
detect(predicate? : Lodash.ListIterator<T, boolean>|Lodash.DictionaryIterator<T, boolean>|string, thisArg? : any) : T;
|
||||
detect<R extends {}>(predicate? : R) : T;
|
||||
difference(...values : T[]) : T[];
|
||||
drop(n? : number) : T[];
|
||||
each(callback? : Lodash.ListIterator<T, void>, thisArg? : any) : Lodash.List<T>;
|
||||
each(callback? : Lodash.DictionaryIterator<T, void>, thisArg? : any) : Lodash.Dictionary<T>;
|
||||
each(callback? : Lodash.ObjectIterator<T, void>, thisArg? : any) : T;
|
||||
every(predicate? : Lodash.ListIterator<T, boolean>|Lodash.DictionaryIterator<T, boolean>|string, thisArg? : any) : boolean;
|
||||
every<R extends {}>(predicate? : R) : boolean;
|
||||
filter(predicate? : Lodash.ListIterator<T, boolean>|Lodash.DictionaryIterator<T, boolean>|string, thisArg? : any) : T[];
|
||||
filter<R extends {}>(predicate? : R) : T[];
|
||||
find(predicate? : Lodash.ListIterator<T, boolean>|Lodash.DictionaryIterator<T, boolean>|string, thisArg? : any) : T;
|
||||
find<R extends {}>(predicate? : R) : T;
|
||||
first() : T;
|
||||
foldl<R>(callback? : Lodash.MemoIterator<T, R>, accumulator? : R, thisArg? : any) : R;
|
||||
foldr<R>(callback? : Lodash.MemoIterator<T, R>, accumulator? : R, thisArg? : any) : R;
|
||||
forEach(callback? : Lodash.ListIterator<T, void>, thisArg? : any) : Lodash.List<T>;
|
||||
forEach(callback? : Lodash.DictionaryIterator<T, void>, thisArg? : any) : Lodash.Dictionary<T>;
|
||||
forEach(callback? : Lodash.ObjectIterator<T, void>, thisArg? : any) : T;
|
||||
groupBy(predicate? : Lodash.ListIterator<T, boolean>|Lodash.DictionaryIterator<T, boolean>|string, thisArg? : any) : Lodash.Dictionary<T[]>;
|
||||
groupBy<R extends {}>(predicate? : R) : Lodash.Dictionary<T[]>;
|
||||
head() : T;
|
||||
include(value : any, fromIndex? : number) : boolean;
|
||||
indexOf(value : any, fromIndex? : number) : number;
|
||||
initial() : T[];
|
||||
inject<R>(callback? : Lodash.MemoIterator<T, R>, accumulator? : R, thisArg? : any) : R;
|
||||
invoke(methodName : string|Function, ...args : any[]) : any;
|
||||
isEmpty() : boolean;
|
||||
keys() : string[];
|
||||
last() : T;
|
||||
lastIndexOf(value : any, fromIndex? : number) : number;
|
||||
map(predicate? : Lodash.ListIterator<T, boolean>|Lodash.DictionaryIterator<T, boolean>|string, thisArg? : any) : T[];
|
||||
map<R extends {}>(predicate? : R) : T[];
|
||||
max(predicate? : Lodash.ListIterator<T, boolean>|string, thisArg? : any) : T;
|
||||
max<R extends {}>(predicate? : R) : T;
|
||||
min(predicate? : Lodash.ListIterator<T, boolean>|string, thisArg? : any) : T;
|
||||
min<R extends {}>(predicate? : R) : T;
|
||||
reduce<R>(callback? : Lodash.MemoIterator<T, R>, accumulator? : R, thisArg? : any) : R;
|
||||
reduceRight<R>(callback? : Lodash.MemoIterator<T, R>, accumulator? : R, thisArg? : any) : R;
|
||||
reject(predicate? : Lodash.ListIterator<T, boolean>|Lodash.DictionaryIterator<T, boolean>|string, thisArg? : any) : T[];
|
||||
reject<R extends {}>(predicate? : R) : T[];
|
||||
rest() : T[];
|
||||
select(predicate? : Lodash.ListIterator<T, boolean>|Lodash.DictionaryIterator<T, boolean>|string, thisArg? : any) : T[];
|
||||
select<R extends {}>(predicate? : R) : T[];
|
||||
shuffle() : T[];
|
||||
size() : number;
|
||||
some(predicate? : Lodash.ListIterator<T, boolean>|Lodash.DictionaryIterator<T, boolean>|string, thisArg? : any) : boolean;
|
||||
some<R extends {}>(predicate? : R) : boolean;
|
||||
sortBy(predicate? : Lodash.ListIterator<T, boolean>|Lodash.DictionaryIterator<T, boolean>|string, thisArg? : any) : T[];
|
||||
sortBy<R extends {}>(predicate? : R) : T[];
|
||||
tail() : T[];
|
||||
take(n? : number) : T[];
|
||||
toArray() : T[];
|
||||
without(...values : any[]) : T[];
|
||||
}
|
||||
|
||||
class Collection<T extends Model<any>> extends CollectionBase<T> {
|
||||
/** @deprecated use Typescript classes */
|
||||
static extend<T>(prototypeProperties? : any, classProperties? : any) : Function;
|
||||
/** @deprecated should use `new` objects instead. */
|
||||
static forge<T>(attributes? : any, options? : ModelOptions) : T;
|
||||
|
||||
attach(ids : any[], options? : SyncOptions) : Promise<Collection<T>>;
|
||||
count(column? : string, options? : SyncOptions) : Promise<number>;
|
||||
create(model : {[key : string] : any}, options? : CollectionCreateOptions) : Promise<T>;
|
||||
detach(ids : any[], options? : SyncOptions) : Promise<any>;
|
||||
fetchOne(options? : CollectionFetchOneOptions) : Promise<T>;
|
||||
load(relations : string|string[], options? : SyncOptions) : Promise<Collection<T>>;
|
||||
query(...query : string[]) : Collection<T>;
|
||||
query(query : {[key : string] : any}) : Collection<T>;
|
||||
query(callback : (qb : knex.QueryBuilder) => void) : Collection<T>;
|
||||
query() : knex.QueryBuilder;
|
||||
resetQuery() : Collection<T>;
|
||||
through<R extends Model<any>>(interim : typeof Model, throughForeignKey? : string, otherKey? : string) : R | Collection<R>;
|
||||
updatePivot(attributes : any, options? : PivotOptions) : Promise<number>;
|
||||
withPivot(columns : string[]) : Collection<T>;
|
||||
}
|
||||
|
||||
interface ModelOptions {
|
||||
tableName? : string;
|
||||
hasTimestamps? : boolean;
|
||||
parse? : boolean;
|
||||
}
|
||||
|
||||
interface LoadOptions extends SyncOptions {
|
||||
withRelated: string|any|any[];
|
||||
}
|
||||
|
||||
interface FetchOptions extends SyncOptions {
|
||||
require? : boolean;
|
||||
columns? : string|string[];
|
||||
withRelated? : string|any|any[];
|
||||
}
|
||||
|
||||
interface FetchAllOptions extends SyncOptions {
|
||||
require? : boolean;
|
||||
}
|
||||
|
||||
interface SaveOptions extends SyncOptions {
|
||||
method? : string;
|
||||
defaults? : string;
|
||||
patch? : boolean;
|
||||
require? : boolean;
|
||||
}
|
||||
|
||||
interface SerializeOptions {
|
||||
shallow? : boolean;
|
||||
omitPivot? : boolean;
|
||||
}
|
||||
|
||||
interface SetOptions {
|
||||
unset? : boolean;
|
||||
}
|
||||
|
||||
interface TimestampOptions {
|
||||
method? : string;
|
||||
}
|
||||
|
||||
interface SyncOptions {
|
||||
transacting? : knex.Transaction;
|
||||
debug? : boolean;
|
||||
}
|
||||
|
||||
interface CollectionOptions<T> {
|
||||
comparator? : boolean|string|((a : T, b : T) => number);
|
||||
}
|
||||
|
||||
interface CollectionAddOptions extends EventOptions {
|
||||
at? : number;
|
||||
merge? : boolean;
|
||||
}
|
||||
|
||||
interface CollectionFetchOptions {
|
||||
require? : boolean;
|
||||
withRelated? : string|string[];
|
||||
}
|
||||
|
||||
interface CollectionFetchOneOptions {
|
||||
require? : boolean;
|
||||
columns? : string|string[];
|
||||
}
|
||||
|
||||
interface CollectionSetOptions extends EventOptions {
|
||||
add? : boolean;
|
||||
remove? : boolean;
|
||||
merge?: boolean;
|
||||
}
|
||||
|
||||
interface PivotOptions {
|
||||
query? : Function|any;
|
||||
require? : boolean;
|
||||
}
|
||||
|
||||
interface EventOptions {
|
||||
silent? : boolean;
|
||||
}
|
||||
|
||||
interface EventFunction<T> {
|
||||
(model: T, attrs: any, options: any) : Promise<any>|void;
|
||||
}
|
||||
|
||||
interface CollectionCreateOptions extends ModelOptions, SyncOptions, CollectionAddOptions, SaveOptions {}
|
||||
}
|
||||
|
||||
export = Bookshelf;
|
||||
plugin(name: string | string[] | Function, options?: any) : Bookshelf;
|
||||
transaction<T>(callback : (transaction : knex.Transaction) => T) : Promise<T>;
|
||||
}
|
||||
|
||||
declare function Bookshelf(knex : knex) : Bookshelf;
|
||||
|
||||
declare namespace Bookshelf {
|
||||
abstract class Events<T> {
|
||||
on(event? : string, callback? : EventFunction<T>, context? : any) : void;
|
||||
off(event? : string) : void;
|
||||
trigger(event? : string, ...args : any[]) : void;
|
||||
triggerThen(name : string, ...args : any[]) : Promise<any>;
|
||||
once(event : string, callback : EventFunction<T>, context? : any) : void;
|
||||
}
|
||||
|
||||
interface IModelBase {
|
||||
/** Should be declared as a getter instead of a plain property. */
|
||||
hasTimestamps? : boolean|string[];
|
||||
/** Should be declared as a getter instead of a plain property. Should be required, but cannot have abstract properties yet. */
|
||||
tableName? : string;
|
||||
}
|
||||
|
||||
abstract class ModelBase<T extends Model<any>> extends Events<T|Collection<T>> implements IModelBase {
|
||||
/** If overriding, must use a getter instead of a plain property. */
|
||||
idAttribute : string;
|
||||
|
||||
constructor(attributes? : any, options? : ModelOptions);
|
||||
|
||||
clear() : T;
|
||||
clone() : T;
|
||||
escape(attribute : string) : string;
|
||||
format(attributes : any) : any;
|
||||
get(attribute : string) : any;
|
||||
has(attribute : string) : boolean;
|
||||
hasChanged(attribute? : string) : boolean;
|
||||
isNew() : boolean;
|
||||
parse(response : any) : any;
|
||||
previousAttributes() : any;
|
||||
previous(attribute : string) : any;
|
||||
related<R extends Model<any>>(relation : string) : R | Collection<R>;
|
||||
serialize(options? : SerializeOptions) : any;
|
||||
set(attribute?: {[key : string] : any}, options? : SetOptions) : T;
|
||||
set(attribute : string, value? : any, options? : SetOptions) : T;
|
||||
timestamp(options? : TimestampOptions) : any;
|
||||
toJSON(options? : SerializeOptions) : any;
|
||||
unset(attribute : string) : T;
|
||||
|
||||
// lodash methods
|
||||
invert<R extends {}>() : R;
|
||||
keys() : string[];
|
||||
omit<R extends {}>(predicate? : Lodash.ObjectIterator<any, boolean>, thisArg? : any) : R;
|
||||
omit<R extends {}>(...attributes : string[]) : R;
|
||||
pairs() : any[][];
|
||||
pick<R extends {}>(predicate? : Lodash.ObjectIterator<any, boolean>, thisArg? : any) : R;
|
||||
pick<R extends {}>(...attributes : string[]) : R;
|
||||
values() : any[];
|
||||
}
|
||||
|
||||
class Model<T extends Model<any>> extends ModelBase<T> {
|
||||
static collection<T extends Model<any>>(models? : T[], options? : CollectionOptions<T>) : Collection<T>;
|
||||
static count(column? : string, options? : SyncOptions) : Promise<number>;
|
||||
/** @deprecated use Typescript classes */
|
||||
static extend<T extends Model<any>>(prototypeProperties? : any, classProperties? : any) : Function; // should return a type
|
||||
static fetchAll<T extends Model<any>>() : Promise<Collection<T>>;
|
||||
/** @deprecated should use `new` objects instead. */
|
||||
static forge<T>(attributes? : any, options? : ModelOptions) : T;
|
||||
|
||||
belongsTo<R extends Model<any>>(target : {new(...args : any[]) : R}, foreignKey? : string) : R;
|
||||
belongsToMany<R extends Model<any>>(target : {new(...args : any[]) : R}, table? : string, foreignKey? : string, otherKey? : string) : Collection<R>;
|
||||
count(column? : string, options? : SyncOptions) : Promise<number>;
|
||||
destroy(options? : SyncOptions) : Promise<T>;
|
||||
fetch(options? : FetchOptions) : Promise<T>;
|
||||
fetchAll(options? : FetchAllOptions) : Promise<Collection<T>>;
|
||||
hasMany<R extends Model<any>>(target : {new(...args : any[]) : R}, foreignKey? : string) : Collection<R>;
|
||||
hasOne<R extends Model<any>>(target : {new(...args : any[]) : R}, foreignKey? : string) : R;
|
||||
load(relations : string|string[], options? : LoadOptions) : Promise<T>;
|
||||
morphMany<R extends Model<any>>(target : {new(...args : any[]) : R}, name? : string, columnNames? : string[], morphValue? : string) : Collection<R>;
|
||||
morphOne<R extends Model<any>>(target : {new(...args : any[]) : R}, name? : string, columnNames? : string[], morphValue? : string) : R;
|
||||
morphTo(name : string, columnNames? : string[], ...target : typeof Model[]) : T;
|
||||
morphTo(name : string, ...target : typeof Model[]) : T;
|
||||
query(...query : string[]) : T;
|
||||
query(query : {[key : string] : any}) : T;
|
||||
query(callback : (qb : knex.QueryBuilder) => void) : T;
|
||||
query() : knex.QueryBuilder;
|
||||
refresh(options? : FetchOptions) : Promise<T>;
|
||||
resetQuery() : T;
|
||||
save(key? : string, val? : string, options? : SaveOptions) : Promise<T>;
|
||||
save(attrs? : {[key : string] : any}, options? : SaveOptions) : Promise<T>;
|
||||
through<R extends Model<any>>(interim : typeof Model, throughForeignKey? : string, otherKey? : string) : R | Collection<R>;
|
||||
where(properties : {[key : string] : any}) : T;
|
||||
where(key : string, operatorOrValue : string|number|boolean, valueIfOperator? : string|number|boolean) : T;
|
||||
}
|
||||
|
||||
abstract class CollectionBase<T extends Model<any>> extends Events<T> {
|
||||
add(models : T[]|{[key : string] : any}[], options? : CollectionAddOptions) : Collection<T>;
|
||||
at(index : number) : T;
|
||||
clone() : Collection<T>;
|
||||
fetch(options? : CollectionFetchOptions) : Promise<Collection<T>>;
|
||||
findWhere(match : {[key : string] : any}) : T;
|
||||
get(id : any) : T;
|
||||
invokeThen(name : string, ...args : any[]) : Promise<any>;
|
||||
parse(response : any) : any;
|
||||
pluck(attribute : string) : any[];
|
||||
pop() : void;
|
||||
push(model : any) : Collection<T>;
|
||||
reduceThen<R>(iterator : (prev : R, cur : T, idx : number, array : T[]) => R, initialValue : R, context : any) : Promise<R>;
|
||||
remove(model : T, options? : EventOptions) : T;
|
||||
remove(model : T[], options? : EventOptions) : T[];
|
||||
reset(model : any[], options? : CollectionAddOptions) : T[];
|
||||
serialize(options? : SerializeOptions) : any;
|
||||
set(models : T[]|{[key : string] : any}[], options? : CollectionSetOptions) : Collection<T>;
|
||||
shift(options? : EventOptions) : void;
|
||||
slice(begin? : number, end? : number) : void;
|
||||
toJSON(options? : SerializeOptions) : any;
|
||||
unshift(model : any, options? : CollectionAddOptions) : void;
|
||||
where(match : {[key : string] : any}, firstOnly : boolean) : T|Collection<T>;
|
||||
|
||||
// lodash methods
|
||||
all(predicate? : Lodash.ListIterator<T, boolean>|Lodash.DictionaryIterator<T, boolean>|string, thisArg? : any) : boolean;
|
||||
all<R extends {}>(predicate? : R) : boolean;
|
||||
any(predicate? : Lodash.ListIterator<T, boolean>|Lodash.DictionaryIterator<T, boolean>|string, thisArg? : any) : boolean;
|
||||
any<R extends {}>(predicate? : R) : boolean;
|
||||
chain() : Lodash.LoDashExplicitObjectWrapper<T>;
|
||||
collect(predicate? : Lodash.ListIterator<T, boolean>|Lodash.DictionaryIterator<T, boolean>|string, thisArg? : any) : T[];
|
||||
collect<R extends {}>(predicate? : R) : T[];
|
||||
contains(value : any, fromIndex? : number) : boolean;
|
||||
countBy(predicate? : Lodash.ListIterator<T, boolean>|Lodash.DictionaryIterator<T, boolean>|string, thisArg? : any) : Lodash.Dictionary<number>;
|
||||
countBy<R extends {}>(predicate? : R) : Lodash.Dictionary<number>;
|
||||
detect(predicate? : Lodash.ListIterator<T, boolean>|Lodash.DictionaryIterator<T, boolean>|string, thisArg? : any) : T;
|
||||
detect<R extends {}>(predicate? : R) : T;
|
||||
difference(...values : T[]) : T[];
|
||||
drop(n? : number) : T[];
|
||||
each(callback? : Lodash.ListIterator<T, void>, thisArg? : any) : Lodash.List<T>;
|
||||
each(callback? : Lodash.DictionaryIterator<T, void>, thisArg? : any) : Lodash.Dictionary<T>;
|
||||
each(callback? : Lodash.ObjectIterator<T, void>, thisArg? : any) : T;
|
||||
every(predicate? : Lodash.ListIterator<T, boolean>|Lodash.DictionaryIterator<T, boolean>|string, thisArg? : any) : boolean;
|
||||
every<R extends {}>(predicate? : R) : boolean;
|
||||
filter(predicate? : Lodash.ListIterator<T, boolean>|Lodash.DictionaryIterator<T, boolean>|string, thisArg? : any) : T[];
|
||||
filter<R extends {}>(predicate? : R) : T[];
|
||||
find(predicate? : Lodash.ListIterator<T, boolean>|Lodash.DictionaryIterator<T, boolean>|string, thisArg? : any) : T;
|
||||
find<R extends {}>(predicate? : R) : T;
|
||||
first() : T;
|
||||
foldl<R>(callback? : Lodash.MemoIterator<T, R>, accumulator? : R, thisArg? : any) : R;
|
||||
foldr<R>(callback? : Lodash.MemoIterator<T, R>, accumulator? : R, thisArg? : any) : R;
|
||||
forEach(callback? : Lodash.ListIterator<T, void>, thisArg? : any) : Lodash.List<T>;
|
||||
forEach(callback? : Lodash.DictionaryIterator<T, void>, thisArg? : any) : Lodash.Dictionary<T>;
|
||||
forEach(callback? : Lodash.ObjectIterator<T, void>, thisArg? : any) : T;
|
||||
groupBy(predicate? : Lodash.ListIterator<T, boolean>|Lodash.DictionaryIterator<T, boolean>|string, thisArg? : any) : Lodash.Dictionary<T[]>;
|
||||
groupBy<R extends {}>(predicate? : R) : Lodash.Dictionary<T[]>;
|
||||
head() : T;
|
||||
include(value : any, fromIndex? : number) : boolean;
|
||||
indexOf(value : any, fromIndex? : number) : number;
|
||||
initial() : T[];
|
||||
inject<R>(callback? : Lodash.MemoIterator<T, R>, accumulator? : R, thisArg? : any) : R;
|
||||
invoke(methodName : string|Function, ...args : any[]) : any;
|
||||
isEmpty() : boolean;
|
||||
keys() : string[];
|
||||
last() : T;
|
||||
lastIndexOf(value : any, fromIndex? : number) : number;
|
||||
map(predicate? : Lodash.ListIterator<T, boolean>|Lodash.DictionaryIterator<T, boolean>|string, thisArg? : any) : T[];
|
||||
map<R extends {}>(predicate? : R) : T[];
|
||||
max(predicate? : Lodash.ListIterator<T, boolean>|string, thisArg? : any) : T;
|
||||
max<R extends {}>(predicate? : R) : T;
|
||||
min(predicate? : Lodash.ListIterator<T, boolean>|string, thisArg? : any) : T;
|
||||
min<R extends {}>(predicate? : R) : T;
|
||||
reduce<R>(callback? : Lodash.MemoIterator<T, R>, accumulator? : R, thisArg? : any) : R;
|
||||
reduceRight<R>(callback? : Lodash.MemoIterator<T, R>, accumulator? : R, thisArg? : any) : R;
|
||||
reject(predicate? : Lodash.ListIterator<T, boolean>|Lodash.DictionaryIterator<T, boolean>|string, thisArg? : any) : T[];
|
||||
reject<R extends {}>(predicate? : R) : T[];
|
||||
rest() : T[];
|
||||
select(predicate? : Lodash.ListIterator<T, boolean>|Lodash.DictionaryIterator<T, boolean>|string, thisArg? : any) : T[];
|
||||
select<R extends {}>(predicate? : R) : T[];
|
||||
shuffle() : T[];
|
||||
size() : number;
|
||||
some(predicate? : Lodash.ListIterator<T, boolean>|Lodash.DictionaryIterator<T, boolean>|string, thisArg? : any) : boolean;
|
||||
some<R extends {}>(predicate? : R) : boolean;
|
||||
sortBy(predicate? : Lodash.ListIterator<T, boolean>|Lodash.DictionaryIterator<T, boolean>|string, thisArg? : any) : T[];
|
||||
sortBy<R extends {}>(predicate? : R) : T[];
|
||||
tail() : T[];
|
||||
take(n? : number) : T[];
|
||||
toArray() : T[];
|
||||
without(...values : any[]) : T[];
|
||||
}
|
||||
|
||||
class Collection<T extends Model<any>> extends CollectionBase<T> {
|
||||
/** @deprecated use Typescript classes */
|
||||
static extend<T>(prototypeProperties? : any, classProperties? : any) : Function;
|
||||
/** @deprecated should use `new` objects instead. */
|
||||
static forge<T>(attributes? : any, options? : ModelOptions) : T;
|
||||
|
||||
attach(ids : any[], options? : SyncOptions) : Promise<Collection<T>>;
|
||||
count(column? : string, options? : SyncOptions) : Promise<number>;
|
||||
create(model : {[key : string] : any}, options? : CollectionCreateOptions) : Promise<T>;
|
||||
detach(ids : any[], options? : SyncOptions) : Promise<any>;
|
||||
fetchOne(options? : CollectionFetchOneOptions) : Promise<T>;
|
||||
load(relations : string|string[], options? : SyncOptions) : Promise<Collection<T>>;
|
||||
query(...query : string[]) : Collection<T>;
|
||||
query(query : {[key : string] : any}) : Collection<T>;
|
||||
query(callback : (qb : knex.QueryBuilder) => void) : Collection<T>;
|
||||
query() : knex.QueryBuilder;
|
||||
resetQuery() : Collection<T>;
|
||||
through<R extends Model<any>>(interim : typeof Model, throughForeignKey? : string, otherKey? : string) : R | Collection<R>;
|
||||
updatePivot(attributes : any, options? : PivotOptions) : Promise<number>;
|
||||
withPivot(columns : string[]) : Collection<T>;
|
||||
}
|
||||
|
||||
interface ModelOptions {
|
||||
tableName? : string;
|
||||
hasTimestamps? : boolean;
|
||||
parse? : boolean;
|
||||
}
|
||||
|
||||
interface LoadOptions extends SyncOptions {
|
||||
withRelated: string|any|any[];
|
||||
}
|
||||
|
||||
interface FetchOptions extends SyncOptions {
|
||||
require? : boolean;
|
||||
columns? : string|string[];
|
||||
withRelated? : string|any|any[];
|
||||
}
|
||||
|
||||
interface FetchAllOptions extends SyncOptions {
|
||||
require? : boolean;
|
||||
}
|
||||
|
||||
interface SaveOptions extends SyncOptions {
|
||||
method? : string;
|
||||
defaults? : string;
|
||||
patch? : boolean;
|
||||
require? : boolean;
|
||||
}
|
||||
|
||||
interface SerializeOptions {
|
||||
shallow? : boolean;
|
||||
omitPivot? : boolean;
|
||||
}
|
||||
|
||||
interface SetOptions {
|
||||
unset? : boolean;
|
||||
}
|
||||
|
||||
interface TimestampOptions {
|
||||
method? : string;
|
||||
}
|
||||
|
||||
interface SyncOptions {
|
||||
transacting? : knex.Transaction;
|
||||
debug? : boolean;
|
||||
}
|
||||
|
||||
interface CollectionOptions<T> {
|
||||
comparator? : boolean|string|((a : T, b : T) => number);
|
||||
}
|
||||
|
||||
interface CollectionAddOptions extends EventOptions {
|
||||
at? : number;
|
||||
merge? : boolean;
|
||||
}
|
||||
|
||||
interface CollectionFetchOptions {
|
||||
require? : boolean;
|
||||
withRelated? : string|string[];
|
||||
}
|
||||
|
||||
interface CollectionFetchOneOptions {
|
||||
require? : boolean;
|
||||
columns? : string|string[];
|
||||
}
|
||||
|
||||
interface CollectionSetOptions extends EventOptions {
|
||||
add? : boolean;
|
||||
remove? : boolean;
|
||||
merge?: boolean;
|
||||
}
|
||||
|
||||
interface PivotOptions {
|
||||
query? : Function|any;
|
||||
require? : boolean;
|
||||
}
|
||||
|
||||
interface EventOptions {
|
||||
silent? : boolean;
|
||||
}
|
||||
|
||||
interface EventFunction<T> {
|
||||
(model: T, attrs: any, options: any) : Promise<any>|void;
|
||||
}
|
||||
|
||||
interface CollectionCreateOptions extends ModelOptions, SyncOptions, CollectionAddOptions, SaveOptions {}
|
||||
}
|
||||
|
||||
export = Bookshelf;
|
||||
|
||||
|
||||
6
boom/index.d.ts
vendored
6
boom/index.d.ts
vendored
@ -5,6 +5,8 @@
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
export = Boom;
|
||||
|
||||
declare namespace Boom {
|
||||
|
||||
export interface BoomError {
|
||||
@ -53,7 +55,3 @@ declare namespace Boom {
|
||||
export function gatewayTimeout(message?: string, data?: any): BoomError;
|
||||
export function badImplementation(message?: string, data?: any): BoomError;
|
||||
}
|
||||
|
||||
declare module "boom" {
|
||||
export = Boom;
|
||||
}
|
||||
|
||||
7
bowser/index.d.ts
vendored
7
bowser/index.d.ts
vendored
@ -3,10 +3,9 @@
|
||||
// Definitions by: Paulo Cesar <https://github.com/pocesar>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module 'bowser' {
|
||||
var def: BowserModule.IBowser;
|
||||
export = def;
|
||||
}
|
||||
declare var def: BowserModule.IBowser;
|
||||
export = def;
|
||||
export as namespace bowser;
|
||||
|
||||
declare namespace BowserModule {
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
/// <reference types="Q" />
|
||||
import * as Validators from './node-validators';
|
||||
import Validation = require("business-rules-engine");
|
||||
|
||||
export interface IPerson{
|
||||
Checked:boolean;
|
||||
|
||||
3
business-rules-engine/index.d.ts
vendored
3
business-rules-engine/index.d.ts
vendored
@ -239,4 +239,5 @@ declare namespace Validation {
|
||||
static GetValidationMessage(validator: any): string;
|
||||
}
|
||||
}
|
||||
declare module "business-rules-engine" {export = Validation;}
|
||||
export = Validation;
|
||||
export as namespace Validation;
|
||||
|
||||
2
business-rules-engine/node-validators.d.ts
vendored
2
business-rules-engine/node-validators.d.ts
vendored
@ -6,7 +6,7 @@
|
||||
/// <reference types="Q" />
|
||||
/// <reference types="node" />
|
||||
|
||||
|
||||
import Validation = require("business-rules-engine");
|
||||
export as namespace Validators;
|
||||
|
||||
import * as moment from 'moment';
|
||||
|
||||
7
bytebuffer/index.d.ts
vendored
7
bytebuffer/index.d.ts
vendored
@ -610,7 +610,6 @@ declare class ByteBuffer
|
||||
writeVarint64ZigZag( value: number | Long, offset?: number ): ByteBuffer | number;
|
||||
}
|
||||
|
||||
declare module 'bytebuffer' {
|
||||
namespace ByteBuffer {}
|
||||
export = ByteBuffer;
|
||||
}
|
||||
declare namespace ByteBuffer {}
|
||||
export = ByteBuffer;
|
||||
export as namespace ByteBuffer;
|
||||
|
||||
6
chalk/index.d.ts
vendored
6
chalk/index.d.ts
vendored
@ -3,6 +3,8 @@
|
||||
// Definitions by: Diullei Gomes <https://github.com/Diullei>, Bart van der Schoor <https://github.com/Bartvds>, Nico Jansen <https://github.com/nicojs>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = Chalk;
|
||||
|
||||
declare namespace Chalk {
|
||||
|
||||
export var enabled: boolean;
|
||||
@ -116,7 +118,3 @@ declare namespace Chalk {
|
||||
}
|
||||
}
|
||||
|
||||
declare module "chalk" {
|
||||
export = Chalk;
|
||||
}
|
||||
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import Chartist = require("chartist");
|
||||
Chartist.escapingMap = {
|
||||
'&': '&',
|
||||
'<': '<',
|
||||
|
||||
5
chartist/index.d.ts
vendored
5
chartist/index.d.ts
vendored
@ -558,6 +558,5 @@ declare namespace Chartist {
|
||||
|
||||
declare var Chartist: Chartist.ChartistStatic;
|
||||
|
||||
declare module 'chartist' {
|
||||
export = Chartist;
|
||||
}
|
||||
export = Chartist;
|
||||
export as namespace Chartist;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
|
||||
import CodeMirror = require('codemirror');
|
||||
|
||||
var myCodeMirror: CodeMirror.Editor = CodeMirror(document.body);
|
||||
|
||||
|
||||
6
codemirror/index.d.ts
vendored
6
codemirror/index.d.ts
vendored
@ -3,6 +3,9 @@
|
||||
// Definitions by: mihailik <https://github.com/mihailik>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = CodeMirror;
|
||||
export as namespace CodeMirror;
|
||||
|
||||
declare function CodeMirror(host: HTMLElement, options?: CodeMirror.EditorConfiguration): CodeMirror.Editor;
|
||||
declare function CodeMirror(callback: (host: HTMLElement) => void , options?: CodeMirror.EditorConfiguration): CodeMirror.Editor;
|
||||
|
||||
@ -1127,6 +1130,3 @@ declare namespace CodeMirror {
|
||||
}
|
||||
}
|
||||
|
||||
declare module "codemirror" {
|
||||
export = CodeMirror;
|
||||
}
|
||||
|
||||
@ -1,14 +1,5 @@
|
||||
// NOTE: import statement can not use in TypeScript 1.0.1
|
||||
var program:commander.IExportedCommand = require('commander');
|
||||
|
||||
declare namespace commander {
|
||||
interface IExportedCommand {
|
||||
peppers:boolean;
|
||||
pineapple:boolean;
|
||||
bbq:boolean;
|
||||
cheese:string;
|
||||
}
|
||||
}
|
||||
import program = require('commander');
|
||||
|
||||
program
|
||||
.version('0.0.1')
|
||||
@ -19,10 +10,10 @@ program
|
||||
.parse(process.argv);
|
||||
|
||||
console.log('you ordered a pizza with:');
|
||||
if (program.peppers) console.log(' - peppers');
|
||||
if (program.pineapple) console.log(' - pineapple');
|
||||
if (program.bbq) console.log(' - bbq');
|
||||
console.log(' - %s cheese', program.cheese);
|
||||
if (program['peppers']) console.log(' - peppers');
|
||||
if (program['pineapple']) console.log(' - pineapple');
|
||||
if (program['bbq']) console.log(' - bbq');
|
||||
console.log(' - %s cheese', program['cheese']);
|
||||
|
||||
function range(val:string) {
|
||||
return val.split('..').map(Number);
|
||||
@ -41,18 +32,6 @@ function increaseVerbosity(v:any, total:number) {
|
||||
return total + 1;
|
||||
}
|
||||
|
||||
declare namespace commander {
|
||||
interface IExportedCommand {
|
||||
integer:number;
|
||||
float:number;
|
||||
optional:string;
|
||||
range:number[];
|
||||
list:string[];
|
||||
collect:string[];
|
||||
verbose:number;
|
||||
}
|
||||
}
|
||||
|
||||
program
|
||||
.version('0.0.1')
|
||||
.usage('[options] <file ...>')
|
||||
@ -65,15 +44,15 @@ program
|
||||
.option('-v, --verbose', 'A value that can be increased', increaseVerbosity, 0)
|
||||
.parse(process.argv);
|
||||
|
||||
console.log(' int: %j', program.integer);
|
||||
console.log(' float: %j', program.float);
|
||||
console.log(' optional: %j', program.optional);
|
||||
program.range = program.range || [];
|
||||
console.log(' range: %j..%j', program.range[0], program.range[1]);
|
||||
console.log(' list: %j', program.list);
|
||||
console.log(' collect: %j', program.collect);
|
||||
console.log(' verbosity: %j', program.verbose);
|
||||
console.log(' args: %j', program.args);
|
||||
console.log(' int: %j', program['integer']);
|
||||
console.log(' float: %j', program['float']);
|
||||
console.log(' optional: %j', program['optional']);
|
||||
program['range'] = program['range'] || [];
|
||||
console.log(' range: %j..%j', program['range'][0], program['range'][1]);
|
||||
console.log(' list: %j', program['list']);
|
||||
console.log(' collect: %j', program['collect']);
|
||||
console.log(' verbosity: %j', program['verbose']);
|
||||
console.log(' args: %j', program['args']);
|
||||
|
||||
|
||||
program
|
||||
|
||||
9
commander/index.d.ts
vendored
9
commander/index.d.ts
vendored
@ -5,6 +5,9 @@
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
declare var _tmp: commander.IExportedCommand;
|
||||
export = _tmp;
|
||||
|
||||
declare namespace commander {
|
||||
interface ICommandStatic {
|
||||
/**
|
||||
@ -403,10 +406,6 @@ declare namespace commander {
|
||||
interface IExportedCommand extends ICommand {
|
||||
Command: commander.ICommandStatic;
|
||||
Option: commander.IOptionStatic;
|
||||
[key: string]: any;
|
||||
}
|
||||
}
|
||||
|
||||
declare module "commander" {
|
||||
var _tmp:commander.IExportedCommand;
|
||||
export = _tmp;
|
||||
}
|
||||
|
||||
6
commonmark/index.d.ts
vendored
6
commonmark/index.d.ts
vendored
@ -3,6 +3,8 @@
|
||||
// Definitions by: Nico Jansen <https://github.com/nicojs>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = commonmark;
|
||||
export as namespace commonmark;
|
||||
|
||||
declare namespace commonmark {
|
||||
|
||||
@ -208,7 +210,3 @@ declare namespace commonmark {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
declare module 'commonmark' {
|
||||
export = commonmark;
|
||||
}
|
||||
|
||||
8
content-type/index.d.ts
vendored
8
content-type/index.d.ts
vendored
@ -3,6 +3,9 @@
|
||||
// Definitions by: Pine Mizune <https://github.com/pine613>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare var x: ContentType.MediaTypeStatic;
|
||||
export = x;
|
||||
|
||||
declare namespace ContentType {
|
||||
interface MediaType {
|
||||
type: string;
|
||||
@ -25,8 +28,3 @@ declare namespace ContentType {
|
||||
mediaCmp(a: MediaType, b: MediaType): number;
|
||||
}
|
||||
}
|
||||
|
||||
declare module "content-type" {
|
||||
var x: ContentType.MediaTypeStatic;
|
||||
export = x;
|
||||
}
|
||||
|
||||
@ -2,6 +2,8 @@
|
||||
|
||||
// Based on https://github.com/js-coder/cookie.js/blob/gh-pages/tests/spec.js
|
||||
|
||||
import cookie = require("cookiejs");
|
||||
|
||||
cookie.set({a: '1', b: '2', c: '3'});
|
||||
|
||||
cookie;
|
||||
|
||||
8
cookiejs/index.d.ts
vendored
8
cookiejs/index.d.ts
vendored
@ -5,6 +5,10 @@
|
||||
/**
|
||||
* Shortcut for cookie.get()
|
||||
*/
|
||||
|
||||
export = cookie;
|
||||
export as namespace cookie;
|
||||
|
||||
declare function cookie(key : string, fallback?: string) : string;
|
||||
declare function cookie(keys : string[], fallback?: string) : string;
|
||||
|
||||
@ -44,7 +48,3 @@ declare namespace cookie {
|
||||
*/
|
||||
export function enabled() : boolean;
|
||||
}
|
||||
|
||||
declare module "cookiejs" {
|
||||
export = cookie;
|
||||
}
|
||||
|
||||
8
cropperjs/index.d.ts
vendored
8
cropperjs/index.d.ts
vendored
@ -4,6 +4,10 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
|
||||
declare const Cropper: typeof cropperjs.Cropper;
|
||||
export = Cropper;
|
||||
export as namespace Cropper;
|
||||
|
||||
declare module cropperjs {
|
||||
export enum CropperViewMods {
|
||||
CropBoxIsJustWithInTheContainer = 0,
|
||||
@ -446,7 +450,3 @@ declare module cropperjs {
|
||||
}
|
||||
}
|
||||
|
||||
declare module "cropperjs" {
|
||||
const Cropper: typeof cropperjs.Cropper;
|
||||
export = Cropper;
|
||||
}
|
||||
|
||||
9
crypto-js/index.d.ts
vendored
9
crypto-js/index.d.ts
vendored
@ -3,6 +3,11 @@
|
||||
// Definitions by: Michael Zabka <https://github.com/misak113/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
|
||||
import hashes = CryptoJS.hashes;
|
||||
export = hashes;
|
||||
export as namespace CryptoJS;
|
||||
|
||||
declare namespace CryptoJS {
|
||||
type Hash = (message: string, key?: string, ...options: any[]) => string;
|
||||
|
||||
@ -61,7 +66,3 @@ declare namespace CryptoJS {
|
||||
export var hashes: Hashes;
|
||||
}
|
||||
|
||||
declare module 'crypto-js' {
|
||||
import hashes = CryptoJS.hashes;
|
||||
export = hashes;
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
|
||||
import cucumber = require("cucumber");
|
||||
|
||||
function StepSample() {
|
||||
type Callback = cucumber.CallbackStepDefinition;
|
||||
|
||||
6
cucumber/index.d.ts
vendored
6
cucumber/index.d.ts
vendored
@ -3,6 +3,8 @@
|
||||
// Definitions by: Abraão Alves <https://github.com/abraaoalves>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = cucumber;
|
||||
|
||||
declare namespace cucumber {
|
||||
|
||||
export interface CallbackStepDefinition{
|
||||
@ -49,7 +51,3 @@ declare namespace cucumber {
|
||||
registerHandler(handlerOption:string, code:(event:any, callback:CallbackStepDefinition) =>void): void;
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'cucumber'{
|
||||
export = cucumber;
|
||||
}
|
||||
|
||||
18
d3-dsv/index.d.ts
vendored
18
d3-dsv/index.d.ts
vendored
@ -4,18 +4,16 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
|
||||
//commonjs loader
|
||||
declare module "d3-dsv" {
|
||||
|
||||
/** A parser and formatter for DSV (CSV and TSV) files.
|
||||
Extracted from D3. */
|
||||
var loader: (
|
||||
/** the symbol used to seperate cells in the row.*/
|
||||
delimiter: string,
|
||||
/** example: "text/plain" */
|
||||
encoding?: string) => _d3dsv.D3Dsv;
|
||||
export = loader;
|
||||
}
|
||||
declare var loader: (
|
||||
/** the symbol used to seperate cells in the row.*/
|
||||
delimiter: string,
|
||||
/** example: "text/plain" */
|
||||
encoding?: string) => _d3dsv.D3Dsv;
|
||||
export = loader;
|
||||
export as namespace d3_dsv;
|
||||
|
||||
declare module _d3dsv {
|
||||
/** A parser and formatter for DSV (CSV and TSV) files.
|
||||
Extracted from D3. */
|
||||
|
||||
6
debug/index.d.ts
vendored
6
debug/index.d.ts
vendored
@ -5,10 +5,8 @@
|
||||
|
||||
declare var debug: debug.IDebug;
|
||||
|
||||
// Support AMD require
|
||||
declare module 'debug' {
|
||||
export = debug;
|
||||
}
|
||||
export = debug;
|
||||
export as namespace debug;
|
||||
|
||||
declare namespace debug {
|
||||
export interface IDebug {
|
||||
|
||||
5
decorum/index.d.ts
vendored
5
decorum/index.d.ts
vendored
@ -3,9 +3,8 @@
|
||||
// Definitions by: Danil Flores <https://github.com/dflor003>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module 'decorum' {
|
||||
export = decorum;
|
||||
}
|
||||
export = decorum;
|
||||
export as namespace decorum;
|
||||
|
||||
declare namespace decorum {
|
||||
/**
|
||||
|
||||
8
deep-freeze/index.d.ts
vendored
8
deep-freeze/index.d.ts
vendored
@ -3,13 +3,11 @@
|
||||
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare var deepFreeze: DeepFreeze.DeepFreezeInterface;
|
||||
export = deepFreeze;
|
||||
|
||||
declare namespace DeepFreeze {
|
||||
export interface DeepFreezeInterface {
|
||||
<T>(obj: T): T;
|
||||
}
|
||||
}
|
||||
|
||||
declare module "deep-freeze" {
|
||||
let deepFreeze: DeepFreeze.DeepFreezeInterface;
|
||||
export = deepFreeze;
|
||||
}
|
||||
|
||||
7
diff/index.d.ts
vendored
7
diff/index.d.ts
vendored
@ -3,6 +3,9 @@
|
||||
// Definitions by: vvakame <https://github.com/vvakame/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = JsDiff;
|
||||
export as namespace JsDiff;
|
||||
|
||||
declare namespace JsDiff {
|
||||
interface IDiffResult {
|
||||
value: string;
|
||||
@ -54,7 +57,3 @@ declare namespace JsDiff {
|
||||
|
||||
function convertChangesToDMP(changes:IDiffResult[]):{0: number; 1:string;}[];
|
||||
}
|
||||
|
||||
declare module "diff" {
|
||||
export = JsDiff;
|
||||
}
|
||||
|
||||
13
docopt/index.d.ts
vendored
13
docopt/index.d.ts
vendored
@ -3,6 +3,13 @@
|
||||
// Definitions by: Giovanni Bassi <https://github.com/giggio/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/**
|
||||
* @param doc should be a string with the help message, written according to rules of the docopt language.
|
||||
*/
|
||||
declare function docopt(doc: string, options: DocoptOption): any;
|
||||
|
||||
export = docopt;
|
||||
|
||||
interface DocoptOption {
|
||||
/** is an optional argument vector. It defaults to the arguments passed to your program (process.argv[2..]). You can also supply it with an array of strings, as with process.argv. For example: ['--verbose', '-o', 'hai.txt'] */
|
||||
argv?: Array<string>,
|
||||
@ -15,9 +22,3 @@ interface DocoptOption {
|
||||
/** (default true) If set to false will cause docopt to throw exceptions instead of printing the error to console and terminating the application. This flag is mainly for testing purposes. */
|
||||
exit?: boolean
|
||||
}
|
||||
declare module "docopt" {
|
||||
/**
|
||||
* @param doc should be a string with the help message, written according to rules of the docopt language.
|
||||
*/
|
||||
export function docopt(doc: string, options: DocoptOption): any;
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
|
||||
import domready = require("domready");
|
||||
|
||||
domready(function () {
|
||||
// dom is loaded!
|
||||
|
||||
5
domready/index.d.ts
vendored
5
domready/index.d.ts
vendored
@ -5,6 +5,5 @@
|
||||
|
||||
declare function domready(callback: () => any) : void;
|
||||
|
||||
declare module "domready" {
|
||||
export = domready;
|
||||
}
|
||||
export = domready;
|
||||
export as namespace domready;
|
||||
4
donna/index.d.ts
vendored
4
donna/index.d.ts
vendored
@ -3,9 +3,7 @@
|
||||
// Definitions by: vvakame <https://github.com/vvakame/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module "donna" {
|
||||
function generateMetadata(modules: string[]): DonnaTypes.Metadata;
|
||||
}
|
||||
export function generateMetadata(modules: string[]): DonnaTypes.Metadata;
|
||||
|
||||
declare namespace DonnaTypes {
|
||||
interface Metadata {
|
||||
|
||||
6
dotenv/index.d.ts
vendored
6
dotenv/index.d.ts
vendored
@ -3,12 +3,10 @@
|
||||
// Definitions by: Jussi Kinnula <https://github.com/jussikinnula/>
|
||||
// Definitions: https://github.com/jussikinnula/DefinitelyTyped
|
||||
|
||||
export function config(options?: dotenvOptions): boolean;
|
||||
|
||||
interface dotenvOptions {
|
||||
silent?: boolean;
|
||||
path?: string;
|
||||
encoding?: string;
|
||||
}
|
||||
|
||||
declare module 'dotenv' {
|
||||
export function config(options?: dotenvOptions): boolean;
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
|
||||
import dragula = require("dragula");
|
||||
|
||||
var d1 = dragula([document.querySelector('#left'), document.querySelector('#right')]);
|
||||
|
||||
|
||||
11
dragula/index.d.ts
vendored
11
dragula/index.d.ts
vendored
@ -3,6 +3,11 @@
|
||||
// Definitions by: Paul Welter <https://github.com/pwelter34/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare var dragula: dragula.Dragula;
|
||||
|
||||
export = dragula;
|
||||
export as namespace dragula;
|
||||
|
||||
declare namespace dragula {
|
||||
interface DragulaOptions {
|
||||
containers?: Element[];
|
||||
@ -38,9 +43,3 @@ declare namespace dragula {
|
||||
(): Drake;
|
||||
}
|
||||
}
|
||||
|
||||
declare var dragula: dragula.Dragula;
|
||||
|
||||
declare module "dragula" {
|
||||
export = dragula;
|
||||
}
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
///<reference types="tether" />
|
||||
import Drop = require("drop");
|
||||
|
||||
var yellowBox = document.querySelector(".yellow");
|
||||
var greenBox = document.querySelector(".green");
|
||||
|
||||
7
drop/index.d.ts
vendored
7
drop/index.d.ts
vendored
@ -5,6 +5,9 @@
|
||||
|
||||
///<reference types="tether" />
|
||||
|
||||
export = Drop;
|
||||
export as namespace Drop;
|
||||
|
||||
// global Drop constructor
|
||||
declare class Drop {
|
||||
constructor(options: Drop.IDropOptions);
|
||||
@ -50,7 +53,3 @@ declare namespace Drop {
|
||||
}
|
||||
}
|
||||
|
||||
declare module "drop" {
|
||||
export = Drop;
|
||||
}
|
||||
|
||||
|
||||
17
dsv/index.d.ts
vendored
17
dsv/index.d.ts
vendored
@ -4,18 +4,15 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
|
||||
//commonjs loader
|
||||
declare module "dsv" {
|
||||
|
||||
/** A parser and formatter for DSV (CSV and TSV) files.
|
||||
Extracted from D3. */
|
||||
var loader: (
|
||||
/** the symbol used to seperate cells in the row.*/
|
||||
delimiter: string,
|
||||
/** example: "text/plain" */
|
||||
encoding?: string) => _dsv.Dsv;
|
||||
export = loader;
|
||||
}
|
||||
declare var loader: (
|
||||
/** the symbol used to seperate cells in the row.*/
|
||||
delimiter: string,
|
||||
/** example: "text/plain" */
|
||||
encoding?: string) => _dsv.Dsv;
|
||||
export = loader;
|
||||
export as namespace d3_dsv;
|
||||
|
||||
declare module _dsv {
|
||||
/** A parser and formatter for DSV (CSV and TSV) files.
|
||||
|
||||
8
easystarjs/index.d.ts
vendored
8
easystarjs/index.d.ts
vendored
@ -7,6 +7,8 @@
|
||||
easystarjs.d.ts may be freely distributed under the MIT license.
|
||||
*/
|
||||
|
||||
export = easystarjs;
|
||||
|
||||
declare namespace easystarjs
|
||||
{
|
||||
class js
|
||||
@ -30,8 +32,4 @@ declare namespace easystarjs
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
}
|
||||
|
||||
declare module "easystarjs" {
|
||||
export = easystarjs;
|
||||
}
|
||||
}
|
||||
14
electron-window-state/index.d.ts
vendored
14
electron-window-state/index.d.ts
vendored
@ -5,6 +5,12 @@
|
||||
|
||||
/// <reference types="electron" />
|
||||
|
||||
/*
|
||||
* Load the previous state with fallback to defaults
|
||||
*/
|
||||
declare function windowStateKeeper(opts: ElectronWindowState.WindowStateKeeperOptions): ElectronWindowState.WindowState;
|
||||
export = windowStateKeeper;
|
||||
|
||||
declare namespace ElectronWindowState {
|
||||
interface WindowState {
|
||||
/*
|
||||
@ -80,11 +86,3 @@ declare namespace ElectronWindowState {
|
||||
fullScreen?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'electron-window-state' {
|
||||
/*
|
||||
* Load the previous state with fallback to defaults
|
||||
*/
|
||||
function windowStateKeeper(opts: ElectronWindowState.WindowStateKeeperOptions): ElectronWindowState.WindowState;
|
||||
export = windowStateKeeper;
|
||||
}
|
||||
|
||||
14
emissary/index.d.ts
vendored
14
emissary/index.d.ts
vendored
@ -52,10 +52,10 @@ declare namespace Emissary {
|
||||
}
|
||||
}
|
||||
|
||||
declare module "emissary" {
|
||||
var Emitter:Emissary.IEmitterStatic;
|
||||
var Subscriber:Emissary.ISubscriberStatic;
|
||||
var Signal:Function; // TODO
|
||||
var Behavior:Function; // TODO
|
||||
var combine:Function; // TODO
|
||||
}
|
||||
|
||||
export var Emitter:Emissary.IEmitterStatic;
|
||||
export var Subscriber:Emissary.ISubscriberStatic;
|
||||
export var Signal:Function; // TODO
|
||||
export var Behavior:Function; // TODO
|
||||
export var combine:Function; // TODO
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
|
||||
import empower = require("empower");
|
||||
|
||||
var baseAssert:any;
|
||||
var fakeFormatter:any;
|
||||
|
||||
7
empower/index.d.ts
vendored
7
empower/index.d.ts
vendored
@ -5,6 +5,9 @@
|
||||
|
||||
declare function empower(originalAssert:any, formatter:any, options?:empower.Options):any;
|
||||
|
||||
export = empower;
|
||||
export as namespace empower;
|
||||
|
||||
declare namespace empower {
|
||||
export interface Options {
|
||||
destructive?: boolean;
|
||||
@ -13,7 +16,3 @@ declare namespace empower {
|
||||
patterns?: string[];
|
||||
}
|
||||
}
|
||||
|
||||
declare module "empower" {
|
||||
export = empower;
|
||||
}
|
||||
|
||||
7
esprima/index.d.ts
vendored
7
esprima/index.d.ts
vendored
@ -5,6 +5,9 @@
|
||||
|
||||
/// <reference types="estree" />
|
||||
|
||||
export = esprima;
|
||||
export as namespace esprima;
|
||||
|
||||
declare namespace esprima {
|
||||
|
||||
const version: string;
|
||||
@ -100,7 +103,3 @@ declare namespace esprima {
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
declare module "esprima" {
|
||||
export = esprima
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
|
||||
import Evaporate = require("evaporate");
|
||||
|
||||
function test_upload() {
|
||||
var evaporate = new Evaporate({});
|
||||
|
||||
7
evaporate/index.d.ts
vendored
7
evaporate/index.d.ts
vendored
@ -2,12 +2,11 @@
|
||||
// Project: https://github.com/TTLabs/EvaporateJS
|
||||
// Definitions by: Andrew Kuklewicz <https://github.com/kookster/>, Chris Rhoden <https://github.com/chrisrhoden>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = Evaporate;
|
||||
|
||||
declare class Evaporate {
|
||||
cancel(id:string): boolean;
|
||||
constructor(config:any);
|
||||
add(config:any): string;
|
||||
}
|
||||
|
||||
declare module 'evaporate' {
|
||||
export = Evaporate;
|
||||
}
|
||||
|
||||
6
event-kit/index.d.ts
vendored
6
event-kit/index.d.ts
vendored
@ -3,6 +3,8 @@
|
||||
// Definitions by: Vadim Macagon <https://github.com/enlight/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = AtomEventKit;
|
||||
|
||||
declare namespace AtomEventKit {
|
||||
interface IDisposable {
|
||||
dispose(): void;
|
||||
@ -76,7 +78,3 @@ declare namespace AtomEventKit {
|
||||
/** A utility class for implementing event-based APIs. */
|
||||
var Emitter: EmitterStatic;
|
||||
}
|
||||
|
||||
declare module "event-kit" {
|
||||
export = AtomEventKit;
|
||||
}
|
||||
|
||||
@ -29,7 +29,7 @@ declare namespace Assume {
|
||||
let assume = Assume.assume;
|
||||
|
||||
class EventEmitterTest {
|
||||
v: EventEmitter3.EventEmitter;
|
||||
v: any;
|
||||
|
||||
constructor() {
|
||||
this.v = new EventEmitter();
|
||||
@ -54,40 +54,40 @@ class EventEmitterTest {
|
||||
|
||||
on() {
|
||||
var fn = () => console.log(1);
|
||||
var v1: EventEmitter3.EventEmitter = this.v.on('click', fn);
|
||||
var v2: EventEmitter3.EventEmitter = this.v.on('click', fn, this);
|
||||
var v1 = this.v.on('click', fn);
|
||||
var v2 = this.v.on('click', fn, this);
|
||||
}
|
||||
|
||||
once() {
|
||||
var fn = () => console.log(1);
|
||||
var v1: EventEmitter3.EventEmitter = this.v.once('click', fn);
|
||||
var v2: EventEmitter3.EventEmitter = this.v.once('click', fn, this);
|
||||
var v1 = this.v.once('click', fn);
|
||||
var v2 = this.v.once('click', fn, this);
|
||||
}
|
||||
|
||||
removeListener() {
|
||||
var fn = () => console.log(1);
|
||||
var v1: EventEmitter3.EventEmitter = this.v.removeListener('click', fn);
|
||||
var v2: EventEmitter3.EventEmitter = this.v.removeListener('click', fn, true);
|
||||
var v1 = this.v.removeListener('click', fn);
|
||||
var v2 = this.v.removeListener('click', fn, true);
|
||||
}
|
||||
|
||||
removeAllListeners() {
|
||||
var v1: EventEmitter3.EventEmitter = this.v.removeAllListeners('click');
|
||||
var v1 = this.v.removeAllListeners('click');
|
||||
}
|
||||
|
||||
off() {
|
||||
var fn = () => console.log(1);
|
||||
var v1: EventEmitter3.EventEmitter = this.v.off('click', fn);
|
||||
var v2: EventEmitter3.EventEmitter = this.v.off('click', fn, true);
|
||||
var v1 = this.v.off('click', fn);
|
||||
var v2 = this.v.off('click', fn, true);
|
||||
}
|
||||
|
||||
addListener() {
|
||||
var fn = () => console.log(1);
|
||||
var v1: EventEmitter3.EventEmitter = this.v.addListener('click', fn);
|
||||
var v2: EventEmitter3.EventEmitter = this.v.addListener('click', fn, this);
|
||||
var v1 = this.v.addListener('click', fn);
|
||||
var v2 = this.v.addListener('click', fn, this);
|
||||
}
|
||||
|
||||
setMaxListeners() {
|
||||
var v1: EventEmitter3.EventEmitter = this.v.setMaxListeners();
|
||||
var v1 = this.v.setMaxListeners();
|
||||
}
|
||||
}
|
||||
|
||||
@ -255,7 +255,7 @@ describe('EventEmitter', function tests() {
|
||||
it('receives the emitted events', function (done) {
|
||||
var e = new EventEmitter();
|
||||
|
||||
e.on('data', function (a: string, b: EventEmitter3.EventEmitter, c: Date, d: void, undef: void) {
|
||||
e.on('data', function (a: string, b: any, c: Date, d: void, undef: void) {
|
||||
assume(a).equals('foo');
|
||||
assume(b).equals(e);
|
||||
assume(c).is.instanceOf(Date);
|
||||
|
||||
14
eventemitter3/index.d.ts
vendored
14
eventemitter3/index.d.ts
vendored
@ -3,6 +3,12 @@
|
||||
// Definitions by: Yuichi Murata <https://github.com/mrk21>, Leon Yu <https://github.com/leonyu>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
//
|
||||
// Expose the module.
|
||||
//
|
||||
declare var event_emitter3: EventEmitter3.EventEmitter3Static;
|
||||
export = event_emitter3;
|
||||
|
||||
declare namespace EventEmitter3 {
|
||||
interface EventEmitter3Static {
|
||||
new (): EventEmitter;
|
||||
@ -113,11 +119,3 @@ declare namespace EventEmitter3 {
|
||||
setMaxListeners(): EventEmitter;
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'eventemitter3' {
|
||||
//
|
||||
// Expose the module.
|
||||
//
|
||||
var EventEmitter3: EventEmitter3.EventEmitter3Static;
|
||||
export = EventEmitter3;
|
||||
}
|
||||
|
||||
6
falcor-json-graph/index.d.ts
vendored
6
falcor-json-graph/index.d.ts
vendored
@ -3,6 +3,8 @@
|
||||
// Definitions by: Quramy <https://github.com/Quramy/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
export = FalcorJsonGraph;
|
||||
|
||||
declare namespace FalcorJsonGraph {
|
||||
|
||||
// NOTE: The following types are described at https://github.com/Netflix/falcor/tree/master/lib/typedefs .
|
||||
@ -98,7 +100,3 @@ declare namespace FalcorJsonGraph {
|
||||
function pathInvalidation(path: string | FalcorJsonGraph.PathSet): FalcorJsonGraph.InvalidPath;
|
||||
}
|
||||
|
||||
declare module 'falcor-json-graph' {
|
||||
export = FalcorJsonGraph;
|
||||
}
|
||||
|
||||
|
||||
7
falcor/index.d.ts
vendored
7
falcor/index.d.ts
vendored
@ -5,6 +5,9 @@
|
||||
|
||||
/// <reference types="falcor-json-graph" />
|
||||
|
||||
export = FalcorModel;
|
||||
export as namespace falcor;
|
||||
|
||||
declare namespace FalcorModel {
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
@ -271,7 +274,3 @@ declare namespace FalcorModel {
|
||||
catchException(handler: (exception: any) => boolean): Scheduler;
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'falcor' {
|
||||
export = FalcorModel;
|
||||
}
|
||||
|
||||
347
ffi/index.d.ts
vendored
347
ffi/index.d.ts
vendored
@ -6,188 +6,187 @@
|
||||
/// <reference types="node" />
|
||||
|
||||
|
||||
declare module "ffi" {
|
||||
import ref = require('ref');
|
||||
import StructType = require('ref-struct');
|
||||
import ref = require('ref');
|
||||
import StructType = require('ref-struct');
|
||||
|
||||
/** Provides a friendly API on-top of `DynamicLibrary` and `ForeignFunction`. */
|
||||
export var Library: {
|
||||
/** The extension to use on libraries. */
|
||||
EXT: string;
|
||||
|
||||
/**
|
||||
* @param libFile name of library
|
||||
* @param funcs hash of [retType, [...argType], opts?: {abi?, async?, varargs?}]
|
||||
* @param lib hash that will be extended
|
||||
*/
|
||||
new (libFile: string, funcs?: {[key: string]: any[]}, lib?: Object): any;
|
||||
|
||||
/**
|
||||
* @param libFile name of library
|
||||
* @param funcs hash of [retType, [...argType], opts?: {abi?, async?, varargs?}]
|
||||
* @param lib hash that will be extended
|
||||
*/
|
||||
(libFile: string, funcs?: {[key: string]: any[]}, lib?: Object): any;
|
||||
};
|
||||
|
||||
/** Get value of errno. */
|
||||
export function errno(): number;
|
||||
|
||||
export interface Function extends ref.Type {
|
||||
/** The type of return value. */
|
||||
retType: ref.Type;
|
||||
/** The type of arguments. */
|
||||
argTypes: ref.Type[];
|
||||
/** Is set for node-ffi functions. */
|
||||
ffi_type: Buffer;
|
||||
abi: number;
|
||||
|
||||
/** Get a `Callback` pointer of this function type. */
|
||||
toPointer(fn: (...args: any[]) => any): Buffer;
|
||||
/** Get a `ForeignFunction` of this function type. */
|
||||
toFunction(buf: Buffer): ForeignFunction;
|
||||
}
|
||||
|
||||
/** Creates and returns a type for a C function pointer. */
|
||||
export var Function: {
|
||||
new (retType: ref.Type, argTypes: any[], abi?: number): Function;
|
||||
new (retType: string, argTypes: any[], abi?: number): Function;
|
||||
(retType: ref.Type, argTypes: any[], abi?: number): Function;
|
||||
(retType: string, argTypes: any[], abi?: number): Function;
|
||||
};
|
||||
|
||||
export interface ForeignFunction {
|
||||
(...args: any[]): any;
|
||||
async(...args: any[]): void;
|
||||
}
|
||||
/** Provides a friendly API on-top of `DynamicLibrary` and `ForeignFunction`. */
|
||||
export var Library: {
|
||||
/** The extension to use on libraries. */
|
||||
EXT: string;
|
||||
|
||||
/**
|
||||
* Represents a foreign function in another library. Manages all of the aspects
|
||||
* of function execution, including marshalling the data parameters for the
|
||||
* function into native types and also unmarshalling the return from function
|
||||
* execution.
|
||||
* @param libFile name of library
|
||||
* @param funcs hash of [retType, [...argType], opts?: {abi?, async?, varargs?}]
|
||||
* @param lib hash that will be extended
|
||||
*/
|
||||
export var ForeignFunction: {
|
||||
new (ptr: Buffer, retType: ref.Type, argTypes: any[], abi?: number): ForeignFunction;
|
||||
new (ptr: Buffer, retType: string, argTypes: any[], abi?: number): ForeignFunction;
|
||||
(ptr: Buffer, retType: ref.Type, argTypes: any[], abi?: number): ForeignFunction;
|
||||
(ptr: Buffer, retType: string, argTypes: any[], abi?: number): ForeignFunction;
|
||||
}
|
||||
|
||||
export interface VariadicForeignFunction {
|
||||
/**
|
||||
* What gets returned is another function that needs to be invoked with the rest
|
||||
* of the variadic types that are being invoked from the function.
|
||||
*/
|
||||
(...args: any[]): ForeignFunction;
|
||||
|
||||
/**
|
||||
* Return type as a property of the function generator to
|
||||
* allow for monkey patching the return value in the very rare case where the
|
||||
* return type is variadic as well
|
||||
*/
|
||||
returnType: any;
|
||||
}
|
||||
new (libFile: string, funcs?: {[key: string]: any[]}, lib?: Object): any;
|
||||
|
||||
/**
|
||||
* For when you want to call to a C function with variable amount of arguments.
|
||||
* i.e. `printf`.
|
||||
*
|
||||
* This function takes care of caching and reusing `ForeignFunction` instances that
|
||||
* contain the same ffi_type argument signature.
|
||||
* @param libFile name of library
|
||||
* @param funcs hash of [retType, [...argType], opts?: {abi?, async?, varargs?}]
|
||||
* @param lib hash that will be extended
|
||||
*/
|
||||
export var VariadicForeignFunction: {
|
||||
new (ptr: Buffer, ret: ref.Type, fixedArgs: any[], abi?: number): VariadicForeignFunction;
|
||||
new (ptr: Buffer, ret: string, fixedArgs: any[], abi?: number): VariadicForeignFunction;
|
||||
(ptr: Buffer, ret: ref.Type, fixedArgs: any[], abi?: number): VariadicForeignFunction;
|
||||
(ptr: Buffer, ret: string, fixedArgs: any[], abi?: number): VariadicForeignFunction;
|
||||
};
|
||||
(libFile: string, funcs?: {[key: string]: any[]}, lib?: Object): any;
|
||||
};
|
||||
|
||||
export interface DynamicLibrary {
|
||||
/** Close library, returns the result of the `dlclose` system function. */
|
||||
close(): number;
|
||||
/** Get a symbol from this library. */
|
||||
get(symbol: string): Buffer;
|
||||
/** Get the result of the `dlerror` system function. */
|
||||
error(): string;
|
||||
}
|
||||
/** Get value of errno. */
|
||||
export function errno(): number;
|
||||
|
||||
/**
|
||||
* This class loads and fetches function pointers for dynamic libraries
|
||||
* (.so, .dylib, etc). After the libray's function pointer is acquired, then you
|
||||
* call `get(symbol)` to retreive a pointer to an exported symbol. You need to
|
||||
* call `get___` on the pointer to dereference it into its actual value, or
|
||||
* turn the pointer into a callable function with `ForeignFunction`.
|
||||
*/
|
||||
export var DynamicLibrary: {
|
||||
FLAGS: {
|
||||
RTLD_LAZY: number;
|
||||
RTLD_NOW: number;
|
||||
RTLD_LOCAL: number;
|
||||
RTLD_GLOBAL: number;
|
||||
RTLD_NOLOAD: number;
|
||||
RTLD_NODELETE: number;
|
||||
RTLD_NEXT: Buffer;
|
||||
RTLD_DEFAUL: Buffer;
|
||||
}
|
||||
export interface Function extends ref.Type {
|
||||
/** The type of return value. */
|
||||
retType: ref.Type;
|
||||
/** The type of arguments. */
|
||||
argTypes: ref.Type[];
|
||||
/** Is set for node-ffi functions. */
|
||||
ffi_type: Buffer;
|
||||
abi: number;
|
||||
|
||||
new (path?: string, mode?: number): DynamicLibrary;
|
||||
(path?: string, mode?: number): DynamicLibrary;
|
||||
};
|
||||
|
||||
/**
|
||||
* Turns a JavaScript function into a C function pointer.
|
||||
* The function pointer may be used in other C functions that
|
||||
* accept C callback functions.
|
||||
*/
|
||||
export var Callback: {
|
||||
new (retType: any, argTypes: any[], abi: number, fn: any): Buffer;
|
||||
new (retType: any, argTypes: any[], fn: any): Buffer;
|
||||
(retType: any, argTypes: any[], abi: number, fn: any): Buffer;
|
||||
(retType: any, argTypes: any[], fn: any): Buffer;
|
||||
}
|
||||
|
||||
export var ffiType: {
|
||||
/** Get a `ffi_type *` Buffer appropriate for the given type. */
|
||||
(type: ref.Type): Buffer
|
||||
/** Get a `ffi_type *` Buffer appropriate for the given type. */
|
||||
(type: string): Buffer
|
||||
FFI_TYPE: StructType;
|
||||
}
|
||||
|
||||
export var CIF: (retType: any, types: any[], abi?: any) => Buffer
|
||||
export var CIF_var: (retType: any, types: any[], numFixedArgs: number, abi?: any) => Buffer;
|
||||
export var HAS_OBJC: boolean;
|
||||
export var FFI_TYPES: {[key: string]: Buffer};
|
||||
export var FFI_OK: number;
|
||||
export var FFI_BAD_TYPEDEF: number;
|
||||
export var FFI_BAD_ABI: number;
|
||||
export var FFI_DEFAULT_ABI: number;
|
||||
export var FFI_FIRST_ABI: number;
|
||||
export var FFI_LAST_ABI: number;
|
||||
export var FFI_SYSV: number;
|
||||
export var FFI_UNIX64: number;
|
||||
export var RTLD_LAZY: number;
|
||||
export var RTLD_NOW: number;
|
||||
export var RTLD_LOCAL: number;
|
||||
export var RTLD_GLOBAL: number;
|
||||
export var RTLD_NOLOAD: number;
|
||||
export var RTLD_NODELETE: number;
|
||||
export var RTLD_NEXT: Buffer;
|
||||
export var RTLD_DEFAULT: Buffer;
|
||||
export var LIB_EXT: string;
|
||||
export var FFI_TYPE: StructType;
|
||||
|
||||
/** Default types. */
|
||||
export var types: {
|
||||
void: ref.Type; int64: ref.Type; ushort: ref.Type;
|
||||
int: ref.Type; uint64: ref.Type; float: ref.Type;
|
||||
uint: ref.Type; long: ref.Type; double: ref.Type;
|
||||
int8: ref.Type; ulong: ref.Type; Object: ref.Type;
|
||||
uint8: ref.Type; longlong: ref.Type; CString: ref.Type;
|
||||
int16: ref.Type; ulonglong: ref.Type; bool: ref.Type;
|
||||
uint16: ref.Type; char: ref.Type; byte: ref.Type;
|
||||
int32: ref.Type; uchar: ref.Type; size_t: ref.Type;
|
||||
uint32: ref.Type; short: ref.Type;
|
||||
};
|
||||
/** Get a `Callback` pointer of this function type. */
|
||||
toPointer(fn: (...args: any[]) => any): Buffer;
|
||||
/** Get a `ForeignFunction` of this function type. */
|
||||
toFunction(buf: Buffer): ForeignFunction;
|
||||
}
|
||||
|
||||
/** Creates and returns a type for a C function pointer. */
|
||||
export var Function: {
|
||||
new (retType: ref.Type, argTypes: any[], abi?: number): Function;
|
||||
new (retType: string, argTypes: any[], abi?: number): Function;
|
||||
(retType: ref.Type, argTypes: any[], abi?: number): Function;
|
||||
(retType: string, argTypes: any[], abi?: number): Function;
|
||||
};
|
||||
|
||||
export interface ForeignFunction {
|
||||
(...args: any[]): any;
|
||||
async(...args: any[]): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents a foreign function in another library. Manages all of the aspects
|
||||
* of function execution, including marshalling the data parameters for the
|
||||
* function into native types and also unmarshalling the return from function
|
||||
* execution.
|
||||
*/
|
||||
export var ForeignFunction: {
|
||||
new (ptr: Buffer, retType: ref.Type, argTypes: any[], abi?: number): ForeignFunction;
|
||||
new (ptr: Buffer, retType: string, argTypes: any[], abi?: number): ForeignFunction;
|
||||
(ptr: Buffer, retType: ref.Type, argTypes: any[], abi?: number): ForeignFunction;
|
||||
(ptr: Buffer, retType: string, argTypes: any[], abi?: number): ForeignFunction;
|
||||
}
|
||||
|
||||
export interface VariadicForeignFunction {
|
||||
/**
|
||||
* What gets returned is another function that needs to be invoked with the rest
|
||||
* of the variadic types that are being invoked from the function.
|
||||
*/
|
||||
(...args: any[]): ForeignFunction;
|
||||
|
||||
/**
|
||||
* Return type as a property of the function generator to
|
||||
* allow for monkey patching the return value in the very rare case where the
|
||||
* return type is variadic as well
|
||||
*/
|
||||
returnType: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* For when you want to call to a C function with variable amount of arguments.
|
||||
* i.e. `printf`.
|
||||
*
|
||||
* This function takes care of caching and reusing `ForeignFunction` instances that
|
||||
* contain the same ffi_type argument signature.
|
||||
*/
|
||||
export var VariadicForeignFunction: {
|
||||
new (ptr: Buffer, ret: ref.Type, fixedArgs: any[], abi?: number): VariadicForeignFunction;
|
||||
new (ptr: Buffer, ret: string, fixedArgs: any[], abi?: number): VariadicForeignFunction;
|
||||
(ptr: Buffer, ret: ref.Type, fixedArgs: any[], abi?: number): VariadicForeignFunction;
|
||||
(ptr: Buffer, ret: string, fixedArgs: any[], abi?: number): VariadicForeignFunction;
|
||||
};
|
||||
|
||||
export interface DynamicLibrary {
|
||||
/** Close library, returns the result of the `dlclose` system function. */
|
||||
close(): number;
|
||||
/** Get a symbol from this library. */
|
||||
get(symbol: string): Buffer;
|
||||
/** Get the result of the `dlerror` system function. */
|
||||
error(): string;
|
||||
}
|
||||
|
||||
/**
|
||||
* This class loads and fetches function pointers for dynamic libraries
|
||||
* (.so, .dylib, etc). After the libray's function pointer is acquired, then you
|
||||
* call `get(symbol)` to retreive a pointer to an exported symbol. You need to
|
||||
* call `get___` on the pointer to dereference it into its actual value, or
|
||||
* turn the pointer into a callable function with `ForeignFunction`.
|
||||
*/
|
||||
export var DynamicLibrary: {
|
||||
FLAGS: {
|
||||
RTLD_LAZY: number;
|
||||
RTLD_NOW: number;
|
||||
RTLD_LOCAL: number;
|
||||
RTLD_GLOBAL: number;
|
||||
RTLD_NOLOAD: number;
|
||||
RTLD_NODELETE: number;
|
||||
RTLD_NEXT: Buffer;
|
||||
RTLD_DEFAUL: Buffer;
|
||||
}
|
||||
|
||||
new (path?: string, mode?: number): DynamicLibrary;
|
||||
(path?: string, mode?: number): DynamicLibrary;
|
||||
};
|
||||
|
||||
/**
|
||||
* Turns a JavaScript function into a C function pointer.
|
||||
* The function pointer may be used in other C functions that
|
||||
* accept C callback functions.
|
||||
*/
|
||||
export var Callback: {
|
||||
new (retType: any, argTypes: any[], abi: number, fn: any): Buffer;
|
||||
new (retType: any, argTypes: any[], fn: any): Buffer;
|
||||
(retType: any, argTypes: any[], abi: number, fn: any): Buffer;
|
||||
(retType: any, argTypes: any[], fn: any): Buffer;
|
||||
}
|
||||
|
||||
export var ffiType: {
|
||||
/** Get a `ffi_type *` Buffer appropriate for the given type. */
|
||||
(type: ref.Type): Buffer
|
||||
/** Get a `ffi_type *` Buffer appropriate for the given type. */
|
||||
(type: string): Buffer
|
||||
FFI_TYPE: StructType;
|
||||
}
|
||||
|
||||
export var CIF: (retType: any, types: any[], abi?: any) => Buffer
|
||||
export var CIF_var: (retType: any, types: any[], numFixedArgs: number, abi?: any) => Buffer;
|
||||
export var HAS_OBJC: boolean;
|
||||
export var FFI_TYPES: {[key: string]: Buffer};
|
||||
export var FFI_OK: number;
|
||||
export var FFI_BAD_TYPEDEF: number;
|
||||
export var FFI_BAD_ABI: number;
|
||||
export var FFI_DEFAULT_ABI: number;
|
||||
export var FFI_FIRST_ABI: number;
|
||||
export var FFI_LAST_ABI: number;
|
||||
export var FFI_SYSV: number;
|
||||
export var FFI_UNIX64: number;
|
||||
export var RTLD_LAZY: number;
|
||||
export var RTLD_NOW: number;
|
||||
export var RTLD_LOCAL: number;
|
||||
export var RTLD_GLOBAL: number;
|
||||
export var RTLD_NOLOAD: number;
|
||||
export var RTLD_NODELETE: number;
|
||||
export var RTLD_NEXT: Buffer;
|
||||
export var RTLD_DEFAULT: Buffer;
|
||||
export var LIB_EXT: string;
|
||||
export var FFI_TYPE: StructType;
|
||||
|
||||
/** Default types. */
|
||||
export var types: {
|
||||
void: ref.Type; int64: ref.Type; ushort: ref.Type;
|
||||
int: ref.Type; uint64: ref.Type; float: ref.Type;
|
||||
uint: ref.Type; long: ref.Type; double: ref.Type;
|
||||
int8: ref.Type; ulong: ref.Type; Object: ref.Type;
|
||||
uint8: ref.Type; longlong: ref.Type; CString: ref.Type;
|
||||
int16: ref.Type; ulonglong: ref.Type; bool: ref.Type;
|
||||
uint16: ref.Type; char: ref.Type; byte: ref.Type;
|
||||
int32: ref.Type; uchar: ref.Type; size_t: ref.Type;
|
||||
uint32: ref.Type; short: ref.Type;
|
||||
};
|
||||
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import fileUrl = require("file-url");
|
||||
// Copied from https://github.com/sindresorhus/file-url/blob/14c7a69ae3798f50b3a4a21823c86e10b38160fe/readme.md
|
||||
|
||||
|
||||
|
||||
4
file-url/index.d.ts
vendored
4
file-url/index.d.ts
vendored
@ -11,6 +11,4 @@ declare function fileUrl(path:string):string;
|
||||
/**
|
||||
* Convert a path to a file URL.
|
||||
*/
|
||||
declare module "file-url" {
|
||||
export = fileUrl;
|
||||
}
|
||||
export = fileUrl;
|
||||
|
||||
10
filesize/index.d.ts
vendored
10
filesize/index.d.ts
vendored
@ -3,6 +3,10 @@
|
||||
// Definitions by: Giedrius Grabauskas <https://github.com/GiedriusGrabauskas>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare var fileSize: Filesize.IFilesize;
|
||||
export = fileSize;
|
||||
export as namespace filesize;
|
||||
|
||||
declare namespace Filesize {
|
||||
|
||||
export interface SiJedecBits {
|
||||
@ -76,9 +80,3 @@ declare namespace Filesize {
|
||||
(bytes: number, options: Options): string;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
declare module "filesize" {
|
||||
let fileSize: Filesize.IFilesize;
|
||||
export = fileSize;
|
||||
}
|
||||
|
||||
9
first-mate/index.d.ts
vendored
9
first-mate/index.d.ts
vendored
@ -5,6 +5,9 @@
|
||||
|
||||
/// <reference types="event-kit" />
|
||||
|
||||
import * as AtomEventKit from "event-kit";
|
||||
export = AtomFirstMate;
|
||||
|
||||
declare namespace AtomFirstMate {
|
||||
type Disposable = AtomEventKit.Disposable;
|
||||
|
||||
@ -101,8 +104,4 @@ declare namespace AtomFirstMate {
|
||||
|
||||
/** Registry containing one or more grammars. */
|
||||
var GrammarRegistry: GrammarRegistryStatic;
|
||||
}
|
||||
|
||||
declare module 'first-mate' {
|
||||
export = AtomFirstMate;
|
||||
}
|
||||
}
|
||||
7
fixed-data-table/index.d.ts
vendored
7
fixed-data-table/index.d.ts
vendored
@ -5,6 +5,9 @@
|
||||
|
||||
/// <reference types="react"/>
|
||||
|
||||
export = FixedDataTable;
|
||||
export as namespace FixedDataTable;
|
||||
|
||||
declare namespace FixedDataTable {
|
||||
export var version: string;
|
||||
|
||||
@ -491,7 +494,3 @@ declare namespace FixedDataTable {
|
||||
export class Cell extends React.Component<CellProps, {}> {
|
||||
}
|
||||
}
|
||||
|
||||
declare module "fixed-data-table" {
|
||||
export = FixedDataTable;
|
||||
}
|
||||
|
||||
10
flat/index.d.ts
vendored
10
flat/index.d.ts
vendored
@ -3,6 +3,10 @@
|
||||
// Definitions by: Ilya Mochalov <https://github.com/chrootsu>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare var flatten: FlatTypes.Flatten;
|
||||
|
||||
export = flatten;
|
||||
|
||||
declare namespace FlatTypes {
|
||||
interface FlattenOptions {
|
||||
delimiter?: string;
|
||||
@ -33,9 +37,3 @@ declare namespace FlatTypes {
|
||||
): TResult;
|
||||
}
|
||||
}
|
||||
|
||||
declare module "flat" {
|
||||
var flatten: FlatTypes.Flatten;
|
||||
|
||||
export = flatten;
|
||||
}
|
||||
|
||||
9
fromnow/index.d.ts
vendored
9
fromnow/index.d.ts
vendored
@ -3,6 +3,10 @@
|
||||
// Definitions by: Martin Bukovics <https://github.com/marinewater>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare var FromNow: FromNow.FromNowStatic;
|
||||
export = FromNow;
|
||||
export as namespace fromNow;
|
||||
|
||||
declare namespace FromNow {
|
||||
interface FromNowOpts {
|
||||
maxChunks?: number,
|
||||
@ -21,8 +25,3 @@ declare namespace FromNow {
|
||||
(date: string|Date, opts?: FromNowOpts): string
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'fromnow' {
|
||||
var FromNow: FromNow.FromNowStatic;
|
||||
export = FromNow;
|
||||
}
|
||||
|
||||
@ -4,23 +4,23 @@ import finder = require('fs-finder');
|
||||
|
||||
|
||||
// static
|
||||
var a: FsFinder.Finder = finder.in('./*');
|
||||
var a = finder.in('./*');
|
||||
|
||||
var b: FsFinder.Finder = finder.from('./*');
|
||||
var b = finder.from('./*');
|
||||
|
||||
var c: FsFinder.Finder = finder.find('./*');
|
||||
var c = finder.find('./*');
|
||||
finder.find('./*', (paths: string[]) => {});
|
||||
|
||||
var d: FsFinder.Finder = finder.findFiles('./*');
|
||||
var d = finder.findFiles('./*');
|
||||
finder.findFiles('./*', (paths: string[]) => {});
|
||||
|
||||
var e: FsFinder.Finder = finder.findDirectories('./*');
|
||||
var e = finder.findDirectories('./*');
|
||||
finder.findDirectories('./*', (paths: string[]) => {});
|
||||
|
||||
var f: FsFinder.Finder = finder.findFile('./*');
|
||||
var f = finder.findFile('./*');
|
||||
finder.findFile('./*', (paths: string[]) => {});
|
||||
|
||||
var g: FsFinder.Finder = finder.findDirectory('./*');
|
||||
var g = finder.findDirectory('./*');
|
||||
finder.findDirectory('./*', (paths: string[]) => {});
|
||||
|
||||
|
||||
|
||||
6
fs-finder/index.d.ts
vendored
6
fs-finder/index.d.ts
vendored
@ -49,7 +49,5 @@ declare namespace FsFinder {
|
||||
}
|
||||
}
|
||||
|
||||
declare module "fs-finder" {
|
||||
import Finder = FsFinder.Finder;
|
||||
export = Finder;
|
||||
}
|
||||
import Finder = FsFinder.Finder;
|
||||
export = Finder;
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
|
||||
/* Copyright (C) 1998-2016 by Northwoods Software Corporation. */
|
||||
|
||||
|
||||
import go = require("go");
|
||||
|
||||
class CustomLink extends go.Link {
|
||||
constructor() {
|
||||
|
||||
5
go/index.d.ts
vendored
5
go/index.d.ts
vendored
@ -9458,6 +9458,5 @@ declare namespace go {
|
||||
}
|
||||
} //END go
|
||||
|
||||
declare module "go" {
|
||||
export = go;
|
||||
}
|
||||
export = go;
|
||||
export as namespace go;
|
||||
|
||||
30
google-apps-script/index.d.ts
vendored
Normal file
30
google-apps-script/index.d.ts
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
// Type definitions for google-apps-script
|
||||
|
||||
/// <reference path="google-apps-script.base.d.ts"/>
|
||||
/// <reference path="google-apps-script.cache.d.ts"/>
|
||||
/// <reference path="google-apps-script.calendar.d.ts"/>
|
||||
/// <reference path="google-apps-script.charts.d.ts"/>
|
||||
/// <reference path="google-apps-script.contacts.d.ts"/>
|
||||
/// <reference path="google-apps-script.content.d.ts"/>
|
||||
/// <reference path="google-apps-script.document.d.ts"/>
|
||||
/// <reference path="google-apps-script.drive.d.ts"/>
|
||||
/// <reference path="google-apps-script.forms.d.ts"/>
|
||||
/// <reference path="google-apps-script.gmail.d.ts"/>
|
||||
/// <reference path="google-apps-script.groups.d.ts"/>
|
||||
/// <reference path="google-apps-script.html.d.ts"/>
|
||||
/// <reference path="google-apps-script.jdbc.d.ts"/>
|
||||
/// <reference path="google-apps-script.language.d.ts"/>
|
||||
/// <reference path="google-apps-script.lock.d.ts"/>
|
||||
/// <reference path="google-apps-script.mail.d.ts"/>
|
||||
/// reference path="google-apps-script.maps.d.ts"/>
|
||||
/// <reference path="google-apps-script.optimization.d.ts"/>
|
||||
/// <reference path="google-apps-script.properties.d.ts"/>
|
||||
/// <reference path="google-apps-script.script.d.ts"/>
|
||||
/// <reference path="google-apps-script.sites.d.ts"/>
|
||||
/// <reference path="google-apps-script.spreadsheet.d.ts"/>
|
||||
/// <reference path="google-apps-script.types.d.ts"/>
|
||||
/// <reference path="google-apps-script.ui.d.ts"/>
|
||||
/// <reference path="google-apps-script.url-fetch.d.ts"/>
|
||||
/// <reference path="google-apps-script.utilities.d.ts"/>
|
||||
/// <reference path="google-apps-script.xml-service.d.ts"/>
|
||||
|
||||
5
google-maps/index.d.ts
vendored
5
google-maps/index.d.ts
vendored
@ -21,6 +21,5 @@ declare namespace GoogleMapsLoader {
|
||||
export function isLoaded(): boolean;
|
||||
|
||||
}
|
||||
declare module 'google-maps' {
|
||||
export = GoogleMapsLoader;
|
||||
}
|
||||
export = GoogleMapsLoader;
|
||||
export as namespace GoogleMapsLoader;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
|
||||
import ConvexHullGrahamScan = require("graham_scan");
|
||||
|
||||
// Based on the README.MD
|
||||
|
||||
|
||||
5
graham_scan/index.d.ts
vendored
5
graham_scan/index.d.ts
vendored
@ -7,6 +7,5 @@ declare class ConvexHullGrahamScan {
|
||||
getHull(): {x: number, y: number}[];
|
||||
}
|
||||
|
||||
declare module 'graham_scan' {
|
||||
export = ConvexHullGrahamScan;
|
||||
}
|
||||
export = ConvexHullGrahamScan;
|
||||
export as namespace ConvexHullGrahamScan;
|
||||
|
||||
4
gravatar/index.d.ts
vendored
4
gravatar/index.d.ts
vendored
@ -18,6 +18,4 @@ declare namespace GravatarModule {
|
||||
function url(email: string, options?: Options, forceProtocol?: boolean): string;
|
||||
}
|
||||
|
||||
declare module "gravatar" {
|
||||
export = GravatarModule;
|
||||
}
|
||||
export = GravatarModule;
|
||||
|
||||
38
gridfs-stream/index.d.ts
vendored
38
gridfs-stream/index.d.ts
vendored
@ -39,31 +39,31 @@ declare namespace GridFSStream {
|
||||
}
|
||||
}
|
||||
|
||||
declare module "gridfs-stream" {
|
||||
import mongo = require('mongodb');
|
||||
|
||||
// Merged declaration, g is both a callable function and a namespace
|
||||
function g(db: any, mongo: any): g.Grid;
|
||||
import mongo = require('mongodb');
|
||||
|
||||
namespace g {
|
||||
// Merged declaration, g is both a callable function and a namespace
|
||||
declare function g(db: any, mongo: any): g.Grid;
|
||||
|
||||
export class Grid {
|
||||
declare namespace g {
|
||||
|
||||
files: mongo.Collection;
|
||||
collection(name?: string): mongo.Collection;
|
||||
curCol: string;
|
||||
export class Grid {
|
||||
|
||||
createWriteStream(options?: GridFSStream.Options): GridFSStream.WriteStream;
|
||||
createReadStream(options?: GridFSStream.Options): GridFSStream.ReadStream;
|
||||
createWriteStream(options?: string): GridFSStream.WriteStream;
|
||||
createReadStream(options?: string): GridFSStream.ReadStream;
|
||||
files: mongo.Collection;
|
||||
collection(name?: string): mongo.Collection;
|
||||
curCol: string;
|
||||
|
||||
remove(options: GridFSStream.Options, callback: (err: Error) => void): void;
|
||||
exist(options: GridFSStream.Options, callback: (err: Error, found: boolean) => void): void;
|
||||
findOne(options: GridFSStream.Options, callback: (err: Error, record: any)=>void):void;
|
||||
}
|
||||
createWriteStream(options?: GridFSStream.Options): GridFSStream.WriteStream;
|
||||
createReadStream(options?: GridFSStream.Options): GridFSStream.ReadStream;
|
||||
createWriteStream(options?: string): GridFSStream.WriteStream;
|
||||
createReadStream(options?: string): GridFSStream.ReadStream;
|
||||
|
||||
remove(options: GridFSStream.Options, callback: (err: Error) => void): void;
|
||||
exist(options: GridFSStream.Options, callback: (err: Error, found: boolean) => void): void;
|
||||
findOne(options: GridFSStream.Options, callback: (err: Error, record: any)=>void):void;
|
||||
}
|
||||
|
||||
export = g;
|
||||
}
|
||||
|
||||
export = g;
|
||||
|
||||
|
||||
|
||||
4771
hapi/index.d.ts
vendored
4771
hapi/index.d.ts
vendored
File diff suppressed because it is too large
Load Diff
6
harmony-proxy/index.d.ts
vendored
6
harmony-proxy/index.d.ts
vendored
@ -29,7 +29,5 @@ declare namespace harmonyProxy {
|
||||
}
|
||||
}
|
||||
|
||||
declare module "harmony-proxy" {
|
||||
let _Proxy: harmonyProxy.ProxyConstructor;
|
||||
export = _Proxy;
|
||||
}
|
||||
declare var _Proxy: harmonyProxy.ProxyConstructor;
|
||||
export = _Proxy;
|
||||
|
||||
6
hashids/index.d.ts
vendored
6
hashids/index.d.ts
vendored
@ -30,7 +30,5 @@ declare namespace Hashids {
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'hashids' {
|
||||
var hashids: Hashids.IHashids;
|
||||
export = hashids;
|
||||
}
|
||||
declare var hashids: Hashids.IHashids;
|
||||
export = hashids;
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import HashMap = require("hashmap");
|
||||
var emptyMap:HashMap<string, number> = new HashMap<string, number>();
|
||||
var filledMap:HashMap<string, number> = new HashMap<string, number>("bar", 123, "bar2", 234);
|
||||
var copiedMap:HashMap<string, number> = new HashMap(filledMap);
|
||||
|
||||
5
hashmap/index.d.ts
vendored
5
hashmap/index.d.ts
vendored
@ -125,6 +125,5 @@ declare class HashMap<TKey, TValue> {
|
||||
forEach(callback:(value:TValue, key:TKey) => void):HashMap<TKey, TValue>;
|
||||
}
|
||||
|
||||
declare module "hashmap" {
|
||||
export = HashMap;
|
||||
}
|
||||
export = HashMap;
|
||||
export as namespace HashMap;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user