Remove <reference path="../xxx/xxx.d.ts"> from definitions files and replace it with import * as Xxx from "xxx" or <reference types="xxx"/>

This commit is contained in:
Andy Hanson 2016-09-14 12:12:01 -07:00
parent 84a760de85
commit 28ef3d201b
474 changed files with 5552 additions and 3078 deletions

View File

@ -1,5 +1,3 @@
/// <reference path="3d-bin-packing.d.ts" />
import packer = require("3d-bin-packing");
import samchon = require("samchon-framework");

View File

@ -3,11 +3,11 @@
// Definitions by: Jeongho Nam <http://samchon.org>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../typescript-stl/typescript-stl.d.ts" />
/// <reference path="../samchon-framework/samchon-framework.d.ts" />
/// <reference path="../react/react-global.d.ts" />
/// <reference path="../react-data-grid/react-data-grid.d.ts" />
/// <reference path="../threejs/three.d.ts" />
/// <reference types="typescript-stl" />
/// <reference types="samchon-framework" />
/// <reference types="react" />
/// <reference types="react-data-grid" />
/// <reference types="three" />
declare module "3d-bin-packing"
{

View File

@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"3d-bin-packing.d.ts",
"3d-bin-packing-tests.ts"
]
}

View File

@ -1,5 +1,3 @@
///<reference path="angular-q-spread.d.ts"/>
interface IMyService {
getFirstname(): ng.IPromise<string>;
getLastname(): ng.IPromise<string>;

View File

@ -3,9 +3,9 @@
// Definitions by: rafw87 <https://github.com/rafw87>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
import * as a from "angular";
declare module angular {
declare module "angular" {
interface IPromise<T> {
/**
This method can be used as a replacement for then. Similarly, it takes two parameters, a callback when all promises are resolved and a callback for failure. The resolve callback is going to be called with the result of the list of promises passed to $q.all as separate parameters instead of one parameters which is an array.

View File

@ -0,0 +1,19 @@
{
"files": [
"angular-q-spread.d.ts",
"angular-q-spread-tests.ts"
],
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": false
}
}

View File

@ -3,155 +3,157 @@
// Definitions by: Nick Veys <https://github.com/nickveys>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path='../angularjs/angular.d.ts' />
import * as ng from "angular";
declare namespace angular.websocket {
/**
* Options available to be specified for IWebSocketProvider.
*/
type IWebSocketConfigOptions = {
scope?: ng.IScope;
rootScopeFailOver?: boolean;
useApplyAsync?: boolean;
initialTimeout?: number;
maxTimeout?: number;
binaryType?: "blob" | "arraybuffer";
reconnectIfNotNormalClose?: boolean;
}
interface IWebSocketProvider {
/**
* Creates and opens an IWebSocket instance.
*
* @param url url to connect to
* @return websocket instance
*/
(url: string, protocols?: string | string[] | IWebSocketConfigOptions, options?: IWebSocketConfigOptions): IWebSocket;
}
/** Options available to be specified for IWebSocket.onMessage */
type IWebSocketMessageOptions = {
declare module "angular" {
namespace websocket {
/**
* If specified, only messages that match the filter will cause the message event
* to be fired.
* Options available to be specified for IWebSocketProvider.
*/
filter?: string | RegExp;
type IWebSocketConfigOptions = {
scope?: ng.IScope;
rootScopeFailOver?: boolean;
useApplyAsync?: boolean;
initialTimeout?: number;
maxTimeout?: number;
binaryType?: "blob" | "arraybuffer";
reconnectIfNotNormalClose?: boolean;
}
interface IWebSocketProvider {
/**
* Creates and opens an IWebSocket instance.
*
* @param url url to connect to
* @return websocket instance
*/
(url: string, protocols?: string | string[] | IWebSocketConfigOptions, options?: IWebSocketConfigOptions): IWebSocket;
}
/** If true, each message handled will safely call `$rootScope.$digest()`. */
autoApply?: boolean;
}
/** Options available to be specified for IWebSocket.onMessage */
type IWebSocketMessageOptions = {
/** Type corresponding to onMessage callbaks stored in $Websocket#onMessageCallbacks instance. */
type IWebSocketMessageHandler = {
fn: (evt: MessageEvent) => void;
pattern: string | RegExp;
autoApply: boolean;
}
/**
* If specified, only messages that match the filter will cause the message event
* to be fired.
*/
filter?: string | RegExp;
/** Type corresponding to items stored in $WebSocket#sendQueue instance. */
type IWebSocketQueueItem = {
message: any;
defered: ng.IPromise<void>;
}
/** If true, each message handled will safely call `$rootScope.$digest()`. */
autoApply?: boolean;
}
interface IWebSocket {
/** Type corresponding to onMessage callbaks stored in $Websocket#onMessageCallbacks instance. */
type IWebSocketMessageHandler = {
fn: (evt: MessageEvent) => void;
pattern: string | RegExp;
autoApply: boolean;
}
/**
* Adds a callback to be executed each time a socket connection is opened for
* this instance.
*
* @param event event object
* @returns this instance, for method chaining
*/
onOpen(callback: (event: Event) => void): IWebSocket;
/** Type corresponding to items stored in $WebSocket#sendQueue instance. */
type IWebSocketQueueItem = {
message: any;
defered: ng.IPromise<void>;
}
/**
* Adds a callback to be executed each time a socket connection is closed for
* this instance.
*
* @param event event object
* @returns this instance, for method chaining
*/
onClose(callback: (event: CloseEvent) => void): IWebSocket;
interface IWebSocket {
/**
* Adds a callback to be executed each time a socket connection is closed for
* this instance.
*
* @param event event object
* @returns this instance, for method chaining
*/
onError(callback: (event: Event) => void): IWebSocket;
/**
* Adds a callback to be executed each time a socket connection is opened for
* this instance.
*
* @param event event object
* @returns this instance, for method chaining
*/
onOpen(callback: (event: Event) => void): IWebSocket;
/**
* Adds a callback to be executed each time a socket connection has an error for
* this instance.
*
* @param event event object
* @returns this instance, for method chaining
*/
onMessage(callback: (event: MessageEvent) => void, options?: IWebSocketMessageOptions): IWebSocket;
/**
* Adds a callback to be executed each time a socket connection is closed for
* this instance.
*
* @param event event object
* @returns this instance, for method chaining
*/
onClose(callback: (event: CloseEvent) => void): IWebSocket;
/**
* Closes the underlying socket, as long as no data is still being sent from the client.
*
* @param force if `true`, force close even if data is still being sent
* @returns this instance, for method chaining
*/
close(force?: boolean): IWebSocket;
/**
* Adds a callback to be executed each time a socket connection is closed for
* this instance.
*
* @param event event object
* @returns this instance, for method chaining
*/
onError(callback: (event: Event) => void): IWebSocket;
/**
* Adds data to a queue, and attempts to send if the socket is ready.
*
* @param data data to send, if this is an object, it will be stringified before sending
*/
send(data: string | {}): ng.IPromise<any>;
/**
* Adds a callback to be executed each time a socket connection has an error for
* this instance.
*
* @param event event object
* @returns this instance, for method chaining
*/
onMessage(callback: (event: MessageEvent) => void, options?: IWebSocketMessageOptions): IWebSocket;
/**
* WebSocket instance.
*/
socket: WebSocket;
/**
* Closes the underlying socket, as long as no data is still being sent from the client.
*
* @param force if `true`, force close even if data is still being sent
* @returns this instance, for method chaining
*/
close(force?: boolean): IWebSocket;
/**
* Queue of send calls to be made on socket when socket is able to receive data.
*/
sendQueue: IWebSocketQueueItem[];
/**
* Adds data to a queue, and attempts to send if the socket is ready.
*
* @param data data to send, if this is an object, it will be stringified before sending
*/
send(data: string | {}): ng.IPromise<any>;
/**
* List of callbacks to be executed when the socket is opened.
*/
onOpenCallbacks: ((evt: Event) => void)[];
/**
* WebSocket instance.
*/
socket: WebSocket;
/**
* List of callbacks to be executed when a message is received from the socket.
*/
onMessageCallbacks: IWebSocketMessageHandler[];
/**
* Queue of send calls to be made on socket when socket is able to receive data.
*/
sendQueue: IWebSocketQueueItem[];
/**
* List of callbacks to be executed when an error is received from the socket.
*/
onErrorCallbacks: ((evt: Event) => void)[];
/**
* List of callbacks to be executed when the socket is opened.
*/
onOpenCallbacks: ((evt: Event) => void)[];
/**
* List of callbacks to be executed when the socket is closed.
*/
onCloseCallbacks: ((evt: CloseEvent) => void)[];
/**
* List of callbacks to be executed when a message is received from the socket.
*/
onMessageCallbacks: IWebSocketMessageHandler[];
/**
* Returns either the readyState value from the underlying WebSocket instance
* or a proprietary value representing the internal state
*/
readyState: number;
/**
* List of callbacks to be executed when an error is received from the socket.
*/
onErrorCallbacks: ((evt: Event) => void)[];
/**
* The initial timeout.
*/
initialTimeout: number;
/**
* List of callbacks to be executed when the socket is closed.
*/
onCloseCallbacks: ((evt: CloseEvent) => void)[];
/**
* Maximun timeout used to determine reconnection delay.
*/
maxTimeout: number;
/**
* Returns either the readyState value from the underlying WebSocket instance
* or a proprietary value representing the internal state
*/
readyState: number;
/**
* The initial timeout.
*/
initialTimeout: number;
/**
* Maximun timeout used to determine reconnection delay.
*/
maxTimeout: number;
}
}
}

View File

@ -0,0 +1,19 @@
{
"files": [
"angular-websocket.d.ts",
"angular-websocket-tests.ts"
],
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": false
}
}

View File

@ -3,96 +3,96 @@
// Definitions by: Joao Monteiro <https://github.com/jpmnteiro>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
import * as angular from "angular";
declare namespace angular.xeditable {
declare module "angular" {
namespace xeditable {
interface IEditableOptions {
interface IEditableOptions {
/**
* Theme. Possible values `bs3`, `bs2`, `default`
*/
theme: string;
/**
* Theme. Possible values `bs3`, `bs2`, `default`
*/
theme: string;
/**
* Icon Set. Possible values `font-awesome`, `default`.
*/
icon_set: string;
/**
* Icon Set. Possible values `font-awesome`, `default`.
*/
icon_set: string;
/**
* Whether to show buttons for single editalbe element.
* Possible values `right` (default), `no`.
*/
buttons: string;
/**
* Whether to show buttons for single editalbe element.
* Possible values `right` (default), `no`.
*/
buttons: string;
/**
* Default value for `blur` attribute of single editable element.
* Can be `cancel|submit|ignore`.
*/
blurElem: string;
/**
* Default value for `blur` attribute of single editable element.
* Can be `cancel|submit|ignore`.
*/
blurElem: string;
/**
* Default value for `blur` attribute of editable form.
* Can be `cancel|submit|ignore`.
*/
blurForm: string;
/**
* Default value for `blur` attribute of editable form.
* Can be `cancel|submit|ignore`.
*/
blurForm: string;
/**
* How input elements get activated. Possible values: `focus|select|none`.
*/
activate: string;
/**
* How input elements get activated. Possible values: `focus|select|none`.
*/
activate: string;
/**
* Whether to disable x-editable. Can be overloaded on each element.
*/
isDisabled: boolean;
/**
* Whether to disable x-editable. Can be overloaded on each element.
*/
isDisabled: boolean;
/*
* Event, on which the edit mode gets activated.
* Can be any event.
*/
activationEvent: string;
}
/*
* Event, on which the edit mode gets activated.
* Can be any event.
*/
activationEvent: string;
interface IEditableFormController extends angular.IFormController {
/**
* Shows form with editable controls.
*/
$show(): void;
/**
* Hides form with editable controls without saving.
*/
$hide(): void;
/**
* Sets focus on form field specified by `name`.<br/>
* When trying to set the focus on a form field of a new row in the editable table, the `$activate` call needs to be wrapped in a `$timeout` call so that the form is rendered before the `$activate` function is called.
*
* @param name name of field
*/
$activate(name: string): void;
/**
* Triggers `oncancel` event and calls `$hide()`.
*/
$cancel(): void;
$setWaiting(value: boolean): void;
/**
* Shows error message for particular field.
*
* @param name name of field
* @param msg error message
*/
$setError(name: string, msg: string): void;
$submit(): void;
$save(): void;
}
}
interface IEditableFormController extends angular.IFormController {
/**
* Shows form with editable controls.
*/
$show(): void;
/**
* Hides form with editable controls without saving.
*/
$hide(): void;
/**
* Sets focus on form field specified by `name`.<br/>
* When trying to set the focus on a form field of a new row in the editable table, the `$activate` call needs to be wrapped in a `$timeout` call so that the form is rendered before the `$activate` function is called.
*
* @param name name of field
*/
$activate(name: string): void;
/**
* Triggers `oncancel` event and calls `$hide()`.
*/
$cancel(): void;
$setWaiting(value: boolean): void;
/**
* Shows error message for particular field.
*
* @param name name of field
* @param msg error message
*/
$setError(name: string, msg: string): void;
$submit(): void;
$save(): void;
}
}

View File

@ -0,0 +1,19 @@
{
"files": [
"angular-xeditable.d.ts",
"angular-xeditable-tests.ts"
],
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": false
}
}

View File

@ -1,6 +1,5 @@
///<reference path="./backbone-fetch-cache.d.ts" />
import * as Backbone from "backbone-fetch-cache";
import * as Backbone from "backbone";
import * as BackboneFetchCache from "backbone-fetch-cache";
// static methods / properties

View File

@ -1,189 +0,0 @@
// Type definitions for backbone-fetch-cache 1.4.0
// Project: https://github.com/madglory/backbone-fetch-cache
// Definitions by: delphinus <https://github.com/delphinus35/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../backbone/backbone.d.ts" />
declare namespace BackboneFetchCache {
interface SuperMethods {
modelFetch(options?: Backbone.ModelFetchOptions): JQueryXHR;
modelSync(...arg: any[]): JQueryXHR;
collectionFetch(options?: Backbone.CollectionFetchOptions): JQueryXHR;
}
interface GetCacheOptions {
data?: any;
url?: string;
}
interface SetCacheOptions extends GetCacheOptions {
cache: boolean;
expires: boolean | number;
prefill: boolean;
prefillExpires: boolean | number;
}
interface Cache {
expires: number;
lastSync: number;
prefillExpires: number;
value: any;
}
interface GetCacheKeyObject {
getCacheKey?: (opts?: GetCacheOptions) => string;
url?: () => string;
}
type GetCacheKeyOptions = string | {url: string} | GetCacheKeyObject;
interface Static {
/**
* Global flag to enable/disable caching
*/
enabled: boolean;
/**
* By default the cache is persisted in localStorage (if available).
* Set Backbone.fetchCache.localStorage = false to disable this.
*/
localStorage: boolean;
/**
* Sometimes you just need to clear a cached item manually.
* Backbone.fetchCache.clearItem() can be called safely from anywhere
* in your application. It will take your backbone Model or Collection,
* a function that returns the key String, or the key String itself. If
* you pass in a Model or Collection, the .getCacheKey() method will be
* checked before the url property.
*/
clearItem(...args: any[]): any;
/**
* You can explicitly fetch a cached item, without having to call the
* models/collection fetch. This might be useful for debugging and
* testing.
*/
getCache(key: () => string, opts?: GetCacheOptions): Cache;
getCache(key: GetCacheKeyOptions, opts?: GetCacheOptions): Cache;
getCacheKey(key: () => string, opts?: GetCacheOptions): string;
getCacheKey(key: GetCacheKeyOptions, opts?: GetCacheOptions): string;
/**
* If you want to know when was the last (server) sync of a given key, you can use.
*/
getLastSync(key: () => string, opts?: GetCacheOptions): number;
getLastSync(key: GetCacheKeyOptions, opts?: GetCacheOptions): number;
getLocalStorage(): void;
getLocalStorageKey(): string;
/**
* When setting items in localStorage, the browser may throw a
* QUOTA_EXCEEDED_ERR, meaning the store is full. Backbone.fetchCache
* tries to work around this problem by deleting what it considers the
* most stale item to make space for the new data. The staleness of
* data is determined by the sorting function priorityFn, which by
* default returns the oldest item.
*/
priorityFn(a: Cache, b: Cache): number;
reset(): void;
setCache(instance: () => string, opts?: SetCacheOptions, attrs?: any): void;
setCache(instance: GetCacheKeyOptions, opts?: SetCacheOptions, attrs?: any): void;
setLocalStorage(...args: any[]): any;
_superMethods: SuperMethods;
}
}
declare module Backbone {
var fetchCache: BackboneFetchCache.Static;
/**
* The most used API hook for Backbone Fetch Cache is the Model and
* Collection #.fetch() method. Here are the options you can pass into that
* method to get behaviour particular to Backbone Fetch Cache.
*/
interface ModelFetchWithCacheOptions extends ModelFetchOptions {
/**
* Calls to modelInstance.fetch or collectionInstance.fetch will be
* fulfilled from the cache (if possible) when cache: true is set in
* the options hash.
*/
cache?: boolean;
context?: any;
/**
* Cache values expire after 5 minutes by default. You can adjust this
* by passing expires: <seconds> to the fetch call. Set to false to
* never expire.
*/
expires?: number;
/**
* This option allows the model/collection to be populated from the
* cache immediately and then be updated once the call to fetch has
* completed. The initial cache hit calls the prefillSuccess callback
* and then the AJAX success/error callbacks are called as normal when
* the request is complete. This allows the page to render something
* immediately and then update it after the request completes. (Note:
* the prefillSuccess callback will not fire if the data is not found
* in the cache.)
*
* prefill and prefillExpires options can be used with the promises
* interface like so (note: the progress event will not fire if the
* data is not found in the cache.).
*
* prefillExpires affects prefill in the following ways:
*
* 1. If the cache doesn't hold the requested data, just fetch it
* (usual behaviour)
* 2. If the cache holds an expired version of the requested data, just
* fetch it (usual behaviour)
* 3. If the cache holds requested data that is neither expired nor
* prefill expired, just return it and don't do a fetch / prefill
* callback (usual cache behavior, unusual prefill behaviour)
* 4. If the cache holds requested data that isn't expired but is
* prefill expired, use the prefill callback and do a fetch (usual
* prefill behaviour)
*/
prefill?: boolean;
prefillExpires?: number;
prefillSuccess?: (self: any, attributes: any, opts: ModelFetchWithCacheOptions) => void;
}
interface CollectionFetchWithCacheOptions extends ModelFetchWithCacheOptions {
prefillSuccess?: (self: any) => void;
}
interface ModelWithCache extends Model {
fetch(options?: ModelFetchWithCacheOptions): JQueryXHR;
}
interface CollectionWithCache extends Collection<Model> {
fetch(options?: CollectionFetchWithCacheOptions): JQueryXHR;
}
}
declare module "backbone-fetch-cache" {
export = Backbone;
}

183
backbone-fetch-cache/index.d.ts vendored Normal file
View File

@ -0,0 +1,183 @@
// Type definitions for backbone-fetch-cache 1.4.0
// Project: https://github.com/madglory/backbone-fetch-cache
// Definitions by: delphinus <https://github.com/delphinus35/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import * as Backbone from "backbone";
interface SuperMethods {
modelFetch(options?: Backbone.ModelFetchOptions): JQueryXHR;
modelSync(...arg: any[]): JQueryXHR;
collectionFetch(options?: Backbone.CollectionFetchOptions): JQueryXHR;
}
interface GetCacheOptions {
data?: any;
url?: string;
}
interface SetCacheOptions extends GetCacheOptions {
cache: boolean;
expires: boolean | number;
prefill: boolean;
prefillExpires: boolean | number;
}
interface Cache {
expires: number;
lastSync: number;
prefillExpires: number;
value: any;
}
interface GetCacheKeyObject {
getCacheKey?: (opts?: GetCacheOptions) => string;
url?: () => string;
}
type GetCacheKeyOptions = string | {url: string} | GetCacheKeyObject;
interface Static {
/**
* Global flag to enable/disable caching
*/
enabled: boolean;
/**
* By default the cache is persisted in localStorage (if available).
* Set Backbone.fetchCache.localStorage = false to disable this.
*/
localStorage: boolean;
/**
* Sometimes you just need to clear a cached item manually.
* Backbone.fetchCache.clearItem() can be called safely from anywhere
* in your application. It will take your backbone Model or Collection,
* a function that returns the key String, or the key String itself. If
* you pass in a Model or Collection, the .getCacheKey() method will be
* checked before the url property.
*/
clearItem(...args: any[]): any;
/**
* You can explicitly fetch a cached item, without having to call the
* models/collection fetch. This might be useful for debugging and
* testing.
*/
getCache(key: () => string, opts?: GetCacheOptions): Cache;
getCache(key: GetCacheKeyOptions, opts?: GetCacheOptions): Cache;
getCacheKey(key: () => string, opts?: GetCacheOptions): string;
getCacheKey(key: GetCacheKeyOptions, opts?: GetCacheOptions): string;
/**
* If you want to know when was the last (server) sync of a given key, you can use.
*/
getLastSync(key: () => string, opts?: GetCacheOptions): number;
getLastSync(key: GetCacheKeyOptions, opts?: GetCacheOptions): number;
getLocalStorage(): void;
getLocalStorageKey(): string;
/**
* When setting items in localStorage, the browser may throw a
* QUOTA_EXCEEDED_ERR, meaning the store is full. Backbone.fetchCache
* tries to work around this problem by deleting what it considers the
* most stale item to make space for the new data. The staleness of
* data is determined by the sorting function priorityFn, which by
* default returns the oldest item.
*/
priorityFn(a: Cache, b: Cache): number;
reset(): void;
setCache(instance: () => string, opts?: SetCacheOptions, attrs?: any): void;
setCache(instance: GetCacheKeyOptions, opts?: SetCacheOptions, attrs?: any): void;
setLocalStorage(...args: any[]): any;
_superMethods: SuperMethods;
}
declare module "backbone" {
var fetchCache: Static;
/**
* The most used API hook for Backbone Fetch Cache is the Model and
* Collection #.fetch() method. Here are the options you can pass into that
* method to get behaviour particular to Backbone Fetch Cache.
*/
interface ModelFetchWithCacheOptions extends ModelFetchOptions {
/**
* Calls to modelInstance.fetch or collectionInstance.fetch will be
* fulfilled from the cache (if possible) when cache: true is set in
* the options hash.
*/
cache?: boolean;
context?: any;
/**
* Cache values expire after 5 minutes by default. You can adjust this
* by passing expires: <seconds> to the fetch call. Set to false to
* never expire.
*/
expires?: number;
/**
* This option allows the model/collection to be populated from the
* cache immediately and then be updated once the call to fetch has
* completed. The initial cache hit calls the prefillSuccess callback
* and then the AJAX success/error callbacks are called as normal when
* the request is complete. This allows the page to render something
* immediately and then update it after the request completes. (Note:
* the prefillSuccess callback will not fire if the data is not found
* in the cache.)
*
* prefill and prefillExpires options can be used with the promises
* interface like so (note: the progress event will not fire if the
* data is not found in the cache.).
*
* prefillExpires affects prefill in the following ways:
*
* 1. If the cache doesn't hold the requested data, just fetch it
* (usual behaviour)
* 2. If the cache holds an expired version of the requested data, just
* fetch it (usual behaviour)
* 3. If the cache holds requested data that is neither expired nor
* prefill expired, just return it and don't do a fetch / prefill
* callback (usual cache behavior, unusual prefill behaviour)
* 4. If the cache holds requested data that isn't expired but is
* prefill expired, use the prefill callback and do a fetch (usual
* prefill behaviour)
*/
prefill?: boolean;
prefillExpires?: number;
prefillSuccess?: (self: any, attributes: any, opts: ModelFetchWithCacheOptions) => void;
}
interface CollectionFetchWithCacheOptions extends ModelFetchWithCacheOptions {
prefillSuccess?: (self: any) => void;
}
interface ModelWithCache extends Model {
fetch(options?: ModelFetchWithCacheOptions): JQueryXHR;
}
interface CollectionWithCache extends Collection<Model> {
fetch(options?: CollectionFetchWithCacheOptions): JQueryXHR;
}
}
export as namespace BackboneFetchCache;

View File

@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": false,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"backbone-fetch-cache-tests.ts"
]
}

2
backbone/index.d.ts vendored
View File

@ -58,7 +58,7 @@ declare namespace Backbone {
interface ModelSetOptions extends Silenceable, Validable {
}
interface ModelFetchOptions extends PersistenceOptions, ModelSetOptions, Parseable {
export interface ModelFetchOptions extends PersistenceOptions, ModelSetOptions, Parseable {
}
interface ModelSaveOptions extends Silenceable, Waitable, Validable, Parseable, PersistenceOptions {

View File

@ -1,5 +1,3 @@
/// <reference path="backlog-js.d.ts" />
import * as backlogjs from 'backlog-js';
const host = 'example.backlog.jp';

View File

@ -1,695 +0,0 @@
// Type definitions for backlog-js 0.9.0
// Project: https://github.com/nulab/backlog-js
// Definitions by: Yuichi Watanabe <https://github.com/vvatanabe>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
/// <reference path="../isomorphic-fetch/isomorphic-fetch.d.ts" />
/// <reference path="../node_modules/typescript/lib/lib.es6.d.ts" />
declare module 'backlog-js' {
class Request {
private configure;
constructor(configure: {
host: string;
apiKey?: string;
accessToken?: string;
timeout?: number;
});
get<T>(path: string, params?: any): Promise<T>;
post<T>(path: string, params?: any): Promise<T>;
put<T>(path: string, params: any): Promise<T>;
patch<T>(path: string, params: any): Promise<T>;
delete<T>(path: string, params?: any): Promise<T>;
request(options: {
method: string;
path: string;
params?: Params | FormData;
}): Promise<IResponse>;
checkStatus(response: IResponse): Promise<IResponse>;
parseJSON<T>(response: IResponse): Promise<T>;
private toFormData(params);
private toQueryString(params);
webAppBaseURL: string;
restBaseURL: string;
}
type Params = {
[index: string]: number | string | number[] | string[];
};
export class Backlog extends Request {
constructor(configure: {
host: string;
apiKey?: string;
accessToken?: string;
timeout?: number;
});
getSpace(): Promise<any>;
getSpaceActivities(params: Option.Space.GetActivitiesParams): Promise<any>;
getSpaceNotification(): Promise<any>;
putSpaceNotification(params: Option.Space.PutSpaceNotificationParams): Promise<any>;
getSpaceDiskUsage(): Promise<any>;
getSpaceIcon(): Promise<Entity.File.FileData>;
postSpaceAttachment(form: FormData): Promise<IResponse>;
getUsers(): Promise<any>;
getUser(userId: number): Promise<any>;
postUser(params: Option.User.PostUserParams): Promise<any>;
patchUser(userId: number, params: Option.User.PatchUserParams): Promise<any>;
deleteUser(userId: number): Promise<any>;
getMyself(): Promise<any>;
getUserActivities(userId: number, params: Option.User.GetUserActivitiesParams): Promise<any>;
getUserStars(userId: number, params: Option.User.GetUserStarsParams): Promise<any>;
getUserStarsCount(userId: number, params: Option.User.GetUserStarsCountParams): Promise<any>;
getRecentlyViewedIssues(params: Option.User.GetRecentlyViewedParams): Promise<any>;
getRecentlyViewedProjects(params: Option.User.GetRecentlyViewedParams): Promise<any>;
getRecentlyViewedWikis(params: Option.User.GetRecentlyViewedParams): Promise<any>;
getUserIcon(userId: number): Promise<Entity.File.FileData>;
getGroups(params: Option.Group.GetGroupsParams): Promise<any>;
postGroups(params: Option.Group.PostGroupsParams): Promise<any>;
getGroup(groupId: number): Promise<any>;
patchGroup(groupId: number, params: Option.Group.PatchGroupParams): Promise<any>;
deleteGroup(groupId: number): Promise<any>;
getStatuses(): Promise<any>;
getResolutions(): Promise<any>;
getPriorities(): Promise<any>;
postProject(params: Option.Project.PostProjectParams): Promise<any>;
getProjects(params?: Option.Project.GetProjectsParams): Promise<any>;
getProject(projectIdOrKey: string): Promise<any>;
patchProject(projectIdOrKey: string, params: Option.Project.PatchProjectParams): Promise<any>;
deleteProject(projectIdOrKey: string): Promise<any>;
getProjectActivities(projectIdOrKey: string, params: Option.Space.GetActivitiesParams): Promise<any>;
getProjectUsers(projectIdOrKey: string): Promise<any>;
deleteProjectUsers(projectIdOrKey: string, params: Option.Project.DeleteProjectUsersParams): Promise<any>;
postProjectAdministrators(projectIdOrKey: string, params: Option.Project.PostProjectAdministrators): Promise<any>;
getProjectAdministrators(projectIdOrKey: string): Promise<any>;
deleteProjectAdministrators(projectIdOrKey: string, params: Option.Project.DeleteProjectAdministrators): Promise<any>;
getIssueTypes(projectIdOrKey: string): Promise<any>;
postIssueType(projectIdOrKey: string, params: Option.Project.PostIssueTypeParams): Promise<any>;
patchIssueType(projectIdOrKey: string, id: number, params: Option.Project.PatchIssueTypeParams): Promise<any>;
deleteIssueType(projectIdOrKey: string, id: number, params: Option.Project.DeleteIssueTypeParams): Promise<any>;
getCategories(projectIdOrKey: string): Promise<any>;
postCategories(projectIdOrKey: string, params: Option.Project.PostCategoriesParams): Promise<any>;
patchCategories(projectIdOrKey: string, id: number, params: Option.Project.PatchCategoriesParams): Promise<any>;
deleteCategories(projectIdOrKey: string, id: number): Promise<any>;
getVersions(projectIdOrKey: string): Promise<any>;
postVersions(projectIdOrKey: string, params: Option.Project.PostVersionsParams): Promise<any>;
patchVersions(projectIdOrKey: string, id: number, params: Option.Project.PatchVersionsParams): Promise<any>;
deleteVersions(projectIdOrKey: string, id: number): Promise<any>;
getCustomFields(projectIdOrKey: string): Promise<any>;
postCustomField(projectIdOrKey: string, params: Option.Project.PostCustomFieldParams | Option.Project.PostCustomFieldWithNumericParams | Option.Project.PostCustomFieldWithDateParams | Option.Project.PostCustomFieldWithListParams): Promise<any>;
patchCustomField(projectIdOrKey: string, id: number, params: Option.Project.PatchCustomFieldParams | Option.Project.PatchCustomFieldWithNumericParams | Option.Project.PatchCustomFieldWithDateParams | Option.Project.PatchCustomFieldWithListParams): Promise<any>;
deleteCustomField(projectIdOrKey: string, id: number): Promise<any>;
postCustomFieldItem(projectIdOrKey: string, id: number, params: Option.Project.PostCustomFieldItemParams): Promise<any>;
patchCustomFieldItem(projectIdOrKey: string, id: number, itemId: number, params: Option.Project.PatchCustomFieldItemParams): Promise<any>;
deleteCustomFieldItem(projectIdOrKey: string, id: number, params: Option.Project.PostCustomFieldItemParams): Promise<any>;
getSharedFiles(projectIdOrKey: string, path: string, params: Option.Project.GetSharedFilesParams): Promise<any>;
getProjectsDiskUsage(projectIdOrKey: string): Promise<any>;
getWebhooks(projectIdOrKey: string): Promise<any>;
postWebhook(projectIdOrKey: string, params: Option.Project.PostWebhookParams): Promise<any>;
getWebhook(projectIdOrKey: string, webhookId: string): Promise<any>;
patchWebhook(projectIdOrKey: string, webhookId: string, params: Option.Project.PatchWebhookParams): Promise<any>;
deleteWebhook(projectIdOrKey: string, webhookId: string): Promise<any>;
postIssue(params: Option.Issue.PostIssueParams): Promise<any>;
patchIssue(issueIdOrKey: string, params: Option.Issue.PatchIssueParams): Promise<any>;
getIssues(params?: Option.Issue.GetIssuesParams): Promise<any>;
getIssue(issueIdOrKey: string): Promise<any>;
getIssuesCount(params?: Option.Issue.GetIssuesParams): Promise<any>;
deleteIssuesCount(issueIdOrKey: string): Promise<any>;
getIssueComments(issueIdOrKey: string, params: Option.Issue.GetIssueCommentsParams): Promise<any>;
postIssueComments(issueIdOrKey: string, params: Option.Issue.PostIssueCommentsParams): Promise<any>;
getIssueCommentsCount(issueIdOrKey: string): Promise<any>;
getIssueComment(issueIdOrKey: string, commentId: number): Promise<any>;
patchIssueComment(issueIdOrKey: string, commentId: number, params: Option.Issue.PatchIssueCommentParams): Promise<any>;
getIssueCommentNotifications(issueIdOrKey: string, commentId: number): Promise<any>;
postIssueCommentNotifications(issueIdOrKey: string, commentId: number, prams: Option.Issue.IssueCommentNotifications): Promise<any>;
getIssueAttachments(issueIdOrKey: string): Promise<any>;
deleteIssueAttachment(issueIdOrKey: string, attachmentId: string): Promise<any>;
getIssueSharedFiles(issueIdOrKey: string): Promise<any>;
linkIssueSharedFiles(issueIdOrKey: string, params: Option.Issue.LinkIssueSharedFilesParams): Promise<any>;
unlinkIssueSharedFile(issueIdOrKey: string, id: number): Promise<any>;
getWikis(projectIdOrKey: number): Promise<any>;
getWikisCount(projectIdOrKey: number): Promise<any>;
getWikisTags(projectIdOrKey: number): Promise<any>;
postWiki(params: Option.Wiki.PostWikiParams): Promise<any>;
getWiki(wikiId: number): Promise<any>;
patchWiki(wikiId: number, params: Option.Wiki.PatchWikiParams): Promise<any>;
deleteWiki(wikiId: number, mailNotify: boolean): Promise<any>;
getWikisAttachments(wikiId: number): Promise<any>;
postWikisAttachments(wikiId: number, attachmentId: number[]): Promise<any>;
deleteWikisAttachments(wikiId: number, attachmentId: number): Promise<any>;
getWikisSharedFiles(wikiId: number): Promise<any>;
linkWikisSharedFiles(wikiId: number, fileId: number[]): Promise<any>;
unlinkWikisSharedFiles(wikiId: number, id: number): Promise<any>;
getWikisHistory(wikiId: number, params: Option.Wiki.GetWikisHistoryParams): Promise<any>;
getWikisStars(wikiId: number): Promise<any>;
postStar(params: Option.Project.PostStarParams): Promise<any>;
getNotifications(params: Option.Notification.GetNotificationsParams): Promise<any>;
getNotificationsCount(params: Option.Notification.GetNotificationsCountParams): Promise<any>;
resetNotificationsMarkAsRead(): Promise<any>;
markAsReadNotification(id: number): Promise<any>;
getGitRepositories(projectIdOrKey: string): Promise<any>;
getGitRepository(projectIdOrKey: string, repoIdOrName: string): Promise<any>;
getPullRequests(projectIdOrKey: string, repoIdOrName: string, params: Option.PullRequest.GetPullRequestsParams): Promise<any>;
getPullRequestsCount(projectIdOrKey: string, repoIdOrName: string, params: Option.PullRequest.GetPullRequestsParams): Promise<any>;
postPullRequest(projectIdOrKey: string, repoIdOrName: string, params: Option.PullRequest.PostPullRequestParams): Promise<any>;
getPullRequest(projectIdOrKey: string, repoIdOrName: string, number: number): Promise<any>;
patchPullRequest(projectIdOrKey: string, repoIdOrName: string, number: number, params: Option.PullRequest.PatchPullRequestParams): Promise<any>;
getPullRequestComments(projectIdOrKey: string, repoIdOrName: string, number: number, params: Option.PullRequest.GetPullRequestCommentsParams): Promise<any>;
postPullRequestComments(projectIdOrKey: string, repoIdOrName: string, number: number, params: Option.PullRequest.PostPullRequestCommentsParams): Promise<any>;
getPullRequestCommentsCount(projectIdOrKey: string, repoIdOrName: string, number: number): Promise<any>;
patchPullRequestComments(projectIdOrKey: string, repoIdOrName: string, number: number, commentId: number, params: Option.PullRequest.PatchPullRequestCommentsParams): Promise<any>;
getPullRequestAttachments(projectIdOrKey: string, repoIdOrName: string, number: number): Promise<any>;
deletePullRequestAttachment(projectIdOrKey: string, repoIdOrName: string, number: number, attachmentId: number): Promise<any>;
getProjectIcon(projectIdOrKey: string): Promise<Entity.File.FileData>;
getSharedFile(projectIdOrKey: string, sharedFileId: number): Promise<Entity.File.FileData>;
getIssueAttachment(issueIdOrKey: string, attachmentId: number): Promise<Entity.File.FileData>;
getWikiAttachment(wikiId: number, attachmentId: number): Promise<Entity.File.FileData>;
getPullRequestAttachment(projectIdOrKey: string, repoIdOrName: string, number: number, attachmentId: number): Promise<Entity.File.FileData>;
private download(path);
private upload(path, params);
private parseFileData(response);
}
export class OAuth2 {
private credentials;
private timeout;
constructor(credentials: Option.OAuth2.Credentials, timeout?: number);
getAuthorizationURL(options: {
host: string;
redirectUri?: string;
state?: string;
}): string;
getAccessToken(options: {
host: string;
code: string;
redirectUri?: string;
}): Promise<Entity.OAuth2.AccessToken>;
refreshAccessToken(options: {
host: string;
refreshToken: string;
}): Promise<Entity.OAuth2.AccessToken>;
}
import { PassThrough } from 'stream';
export namespace Entity {
export namespace File {
export type FileData = NodeFileData | BrowserFileData;
export interface NodeFileData {
body: PassThrough;
url: string;
filename: string;
}
export interface BrowserFileData {
body: any;
url: string;
blob?: () => Promise<Blob>;
}
}
export namespace OAuth2 {
export interface AccessToken {
access_token: string;
token_type: string;
expires_in: number;
refresh_token: string;
}
}
}
export namespace Option {
export type Order = "asc" | "desc";
export enum ActivityType {
Undefined = -1,
IssueCreated = 1,
IssueUpdated = 2,
IssueCommented = 3,
IssueDeleted = 4,
WikiCreated = 5,
WikiUpdated = 6,
WikiDeleted = 7,
FileAdded = 8,
FileUpdated = 9,
FileDeleted = 10,
SvnCommitted = 11,
GitPushed = 12,
GitRepositoryCreated = 13,
IssueMultiUpdated = 14,
ProjectUserAdded = 15,
ProjectUserRemoved = 16,
NotifyAdded = 17,
PullRequestAdded = 18,
PullRequestUpdated = 19,
PullRequestCommented = 20,
PullRequestMerged = 21,
}
export namespace Notification {
export interface GetNotificationsParams {
minId?: number;
maxId?: number;
count?: number;
order?: Order;
}
export interface GetNotificationsCountParams {
alreadyRead: boolean;
resourceAlreadyRead: boolean;
}
}
export namespace Space {
export interface GetActivitiesParams {
activityTypeId?: ActivityType[];
minId?: number;
maxId?: number;
count?: number;
order?: Order;
}
export interface PutSpaceNotificationParams {
content: string;
}
}
export namespace User {
export interface PostUserParams {
userId: string;
password: string;
name: string;
mailAddress: string;
roleType: RoleType;
}
export interface PatchUserParams {
password?: string;
name?: string;
mailAddress?: string;
roleType?: RoleType;
}
export enum RoleType {
Admin = 1,
User = 2,
Reporter = 3,
Viewer = 4,
GuestReporter = 5,
GuestViewer = 6,
}
export interface GetUserActivitiesParams {
activityTypeId?: ActivityType[];
minId?: number;
maxId?: number;
count?: number;
order?: Order;
}
export interface GetUserStarsParams {
minId?: number;
maxId?: number;
count?: number;
order?: Order;
}
export interface GetUserStarsCountParams {
since?: string;
until?: string;
}
export interface GetRecentlyViewedParams {
order?: Order;
offset?: number;
count?: number;
}
}
export namespace Group {
export interface GetGroupsParams {
order?: Order;
offset?: number;
count?: number;
}
export interface PostGroupsParams {
name: string;
members?: string[];
}
export interface PatchGroupParams {
name?: string;
members?: string[];
}
}
export namespace Project {
export type TextFormattingRule = "backlog" | "markdown";
export interface PostProjectParams {
name: string;
key: string;
chartEnabled: boolean;
projectLeaderCanEditProjectLeader?: boolean;
subtaskingEnabled: boolean;
textFormattingRule: TextFormattingRule;
}
export interface PatchProjectParams {
name?: string;
key?: string;
chartEnabled?: boolean;
subtaskingEnabled?: boolean;
projectLeaderCanEditProjectLeader?: boolean;
textFormattingRule?: TextFormattingRule;
archived?: boolean;
}
export interface GetProjectsParams {
archived?: boolean;
all?: boolean;
}
export interface DeleteProjectUsersParams {
userId: number;
}
export interface PostProjectAdministrators {
userId: number;
}
export interface DeleteProjectAdministrators {
userId: number;
}
export type IssueTypeColor = "#e30000" | "#990000" | "#934981" | "#814fbc" | "#2779ca" | "#007e9a" | "#7ea800" | "#ff9200" | "#ff3265" | "#666665";
export interface PostIssueTypeParams {
name: string;
color: IssueTypeColor;
}
export interface PatchIssueTypeParams {
name?: string;
color?: IssueTypeColor;
}
export interface DeleteIssueTypeParams {
substituteIssueTypeId: number;
}
export interface PostCategoriesParams {
name: string;
}
export interface PatchCategoriesParams {
name: string;
}
export interface PostVersionsParams {
name: string;
description: string;
startDate: string;
releaseDueDate: string;
}
export interface PatchVersionsParams {
name: string;
description?: string;
startDate?: string;
releaseDueDate?: string;
archived?: boolean;
}
export interface PostCustomFieldParams {
typeId: FieldType;
name: string;
applicableIssueTypes?: number[];
description?: string;
required?: boolean;
}
export interface PostCustomFieldWithNumericParams extends PostCustomFieldParams {
min?: number;
max?: number;
initialValue?: number;
unit?: string;
}
export interface PostCustomFieldWithDateParams extends PostCustomFieldParams {
min?: string;
max?: string;
initialValueType?: number;
initialDate?: string;
initialShift?: number;
}
export interface PostCustomFieldWithListParams extends PostCustomFieldParams {
items?: string[];
allowInput?: boolean;
allowAddItem?: boolean;
}
export interface PatchCustomFieldParams {
name?: string;
applicableIssueTypes?: number[];
description?: string;
required?: boolean;
}
export interface PatchCustomFieldWithNumericParams extends PatchCustomFieldParams {
min?: number;
max?: number;
initialValue?: number;
unit?: string;
}
export interface PatchCustomFieldWithDateParams extends PatchCustomFieldParams {
min?: string;
max?: string;
initialValueType?: number;
initialDate?: string;
initialShift?: number;
}
export interface PatchCustomFieldWithListParams extends PatchCustomFieldParams {
items?: string[];
allowInput?: boolean;
allowAddItem?: boolean;
}
export interface PostCustomFieldItemParams {
name: string;
}
export interface PatchCustomFieldItemParams {
name: string;
}
export interface GetSharedFilesParams {
order?: Order;
offset?: number;
count?: number;
}
export interface PostWebhookParams {
name?: string;
description?: string;
hookUrl?: string;
allEvent?: boolean;
activityTypeIds?: number[];
}
export interface PatchWebhookParams {
name?: string;
description?: string;
hookUrl?: string;
allEvent?: boolean;
activityTypeIds?: number[];
}
export enum FieldType {
Text = 1,
TextArea = 2,
Numeric = 3,
Date = 4,
SingleList = 5,
MultipleList = 6,
CheckBox = 7,
Radio = 8,
}
export interface PostStarParams {
issueId?: number;
commentId?: number;
wikiId?: number;
pullRequestId?: number;
pullRequestCommentId?: number;
}
}
export namespace Issue {
export interface PostIssueParams {
projectId: number;
summary: string;
priorityId: number;
issueTypeId: number;
parentIssueId?: number;
description?: string;
startDate?: string;
dueDate?: string;
estimatedHours?: number;
actualHours?: number;
categoryId?: number[];
versionId?: number[];
milestoneId?: number[];
assigneeId?: number;
notifiedUserId?: number[];
attachmentId?: number[];
[customField_: string]: any;
}
export interface PatchIssueParams {
summary?: string;
parentIssueId?: number;
description?: string;
statusId?: number;
resolutionId?: number;
startDate?: string;
dueDate?: string;
estimatedHours?: number;
actualHours?: number;
issueTypeId?: number;
categoryId?: number[];
versionId?: number[];
milestoneId?: number[];
priorityId?: number;
assigneeId?: number;
notifiedUserId?: number[];
attachmentId?: number[];
comment?: string;
[customField_: string]: any;
}
export interface GetIssuesParams {
projectId?: number[];
issueTypeId?: number[];
categoryId?: number[];
versionId?: number[];
milestoneId?: number[];
statusId?: number[];
priorityId?: number[];
assigneeId?: number[];
createdUserId?: number[];
resolutionId?: number[];
parentChild?: ParentChildType;
attachment?: boolean;
sharedFile?: boolean;
sort?: SortKey;
order?: Order;
offset?: number;
count?: number;
createdSince?: string;
createdUntil?: string;
updatedSince?: string;
updatedUntil?: string;
startDateSince?: string;
startDateUntil?: string;
dueDateSince?: string;
dueDateUntil?: string;
id?: number[];
parentIssueId?: number[];
keyword: string;
[customField_: string]: any;
}
export enum ParentChildType {
All = 0,
NotChild = 1,
Child = 2,
NotChildNotParent = 3,
Parent = 4,
}
export type SortKey = "issueType" | "category" | "version" | "milestone" | "summary" | "status" | "priority" | "attachment" | "sharedFile" | "created" | "createdUser" | "updated" | "updatedUser" | "assignee" | "startDate" | "dueDate" | "estimatedHours" | "actualHours" | "childIssue";
export interface GetIssueCommentsParams {
minId?: number;
maxId?: number;
count?: number;
order?: Order;
}
export interface PostIssueCommentsParams {
content: string;
notifiedUserId?: number[];
attachmentId?: number[];
}
export interface PatchIssueCommentParams {
content: string;
}
export interface IssueCommentNotifications {
notifiedUserId: number[];
}
export interface LinkIssueSharedFilesParams {
fileId: number[];
}
}
export namespace PullRequest {
export interface GetPullRequestsParams {
statusId?: number[];
assigneeId?: number[];
issueId?: number[];
createdUserId?: number[];
offset?: number;
count?: number;
}
export interface PostPullRequestParams {
summary: string;
description: string;
base: string;
branch: string;
issueId?: number;
assigneeId?: number;
notifiedUserId?: number[];
attachmentId?: number[];
}
export interface PatchPullRequestParams {
summary?: string;
description?: string;
issueId?: number;
assigneeId?: number;
notifiedUserId?: number[];
comment?: string[];
}
export interface GetPullRequestCommentsParams {
minId?: number;
maxId?: number;
count?: number;
order?: Order;
}
export interface PostPullRequestCommentsParams {
content: string;
notifiedUserId?: number[];
}
export interface PatchPullRequestCommentsParams {
content: string;
}
}
export namespace Wiki {
export interface PostWikiParams {
projectId: number;
name: string;
content: string;
mailNotify?: boolean;
}
export interface PatchWikiParams {
name?: string;
content?: string;
mailNotify?: boolean;
}
export interface GetWikisHistoryParams {
minId?: number;
maxId?: number;
count?: number;
order?: Order;
}
}
export namespace OAuth2 {
export interface Credentials {
clientId: string;
clientSecret: string;
}
}
}
export namespace Error {
export class BacklogError extends global.Error {
private _name;
private _url;
private _status;
private _body;
private _response;
constructor(name: BacklogErrorNameType, response: IResponse, body?: {
errors: BacklogErrorMessage[];
});
name: BacklogErrorNameType;
url: string;
status: number;
body: {
errors: BacklogErrorMessage[];
};
response: IResponse;
}
export class BacklogApiError extends BacklogError {
constructor(response: IResponse, body?: {
errors: BacklogErrorMessage[];
});
}
export class BacklogAuthError extends BacklogError {
constructor(response: IResponse, body?: {
errors: BacklogErrorMessage[];
});
}
export class UnexpectedError extends BacklogError {
constructor(response: IResponse);
}
export interface BacklogErrorMessage {
message: string;
code: number;
errorInfo: string;
moreInfo: string;
}
export type BacklogErrorNameType = 'BacklogApiError' | 'BacklogAuthError' | 'UnexpectedError';
}
}

690
backlog-js/index.d.ts vendored Normal file
View File

@ -0,0 +1,690 @@
// Type definitions for backlog-js 0.9.0
// Project: https://github.com/nulab/backlog-js
// Definitions by: Yuichi Watanabe <https://github.com/vvatanabe>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
/// <reference types="isomorphic-fetch" />
declare class Request {
private configure;
constructor(configure: {
host: string;
apiKey?: string;
accessToken?: string;
timeout?: number;
});
get<T>(path: string, params?: any): Promise<T>;
post<T>(path: string, params?: any): Promise<T>;
put<T>(path: string, params: any): Promise<T>;
patch<T>(path: string, params: any): Promise<T>;
delete<T>(path: string, params?: any): Promise<T>;
request(options: {
method: string;
path: string;
params?: Params | FormData;
}): Promise<IResponse>;
checkStatus(response: IResponse): Promise<IResponse>;
parseJSON<T>(response: IResponse): Promise<T>;
private toFormData(params);
private toQueryString(params);
webAppBaseURL: string;
restBaseURL: string;
}
type Params = {
[index: string]: number | string | number[] | string[];
};
export class Backlog extends Request {
constructor(configure: {
host: string;
apiKey?: string;
accessToken?: string;
timeout?: number;
});
getSpace(): Promise<any>;
getSpaceActivities(params: Option.Space.GetActivitiesParams): Promise<any>;
getSpaceNotification(): Promise<any>;
putSpaceNotification(params: Option.Space.PutSpaceNotificationParams): Promise<any>;
getSpaceDiskUsage(): Promise<any>;
getSpaceIcon(): Promise<Entity.File.FileData>;
postSpaceAttachment(form: FormData): Promise<IResponse>;
getUsers(): Promise<any>;
getUser(userId: number): Promise<any>;
postUser(params: Option.User.PostUserParams): Promise<any>;
patchUser(userId: number, params: Option.User.PatchUserParams): Promise<any>;
deleteUser(userId: number): Promise<any>;
getMyself(): Promise<any>;
getUserActivities(userId: number, params: Option.User.GetUserActivitiesParams): Promise<any>;
getUserStars(userId: number, params: Option.User.GetUserStarsParams): Promise<any>;
getUserStarsCount(userId: number, params: Option.User.GetUserStarsCountParams): Promise<any>;
getRecentlyViewedIssues(params: Option.User.GetRecentlyViewedParams): Promise<any>;
getRecentlyViewedProjects(params: Option.User.GetRecentlyViewedParams): Promise<any>;
getRecentlyViewedWikis(params: Option.User.GetRecentlyViewedParams): Promise<any>;
getUserIcon(userId: number): Promise<Entity.File.FileData>;
getGroups(params: Option.Group.GetGroupsParams): Promise<any>;
postGroups(params: Option.Group.PostGroupsParams): Promise<any>;
getGroup(groupId: number): Promise<any>;
patchGroup(groupId: number, params: Option.Group.PatchGroupParams): Promise<any>;
deleteGroup(groupId: number): Promise<any>;
getStatuses(): Promise<any>;
getResolutions(): Promise<any>;
getPriorities(): Promise<any>;
postProject(params: Option.Project.PostProjectParams): Promise<any>;
getProjects(params?: Option.Project.GetProjectsParams): Promise<any>;
getProject(projectIdOrKey: string): Promise<any>;
patchProject(projectIdOrKey: string, params: Option.Project.PatchProjectParams): Promise<any>;
deleteProject(projectIdOrKey: string): Promise<any>;
getProjectActivities(projectIdOrKey: string, params: Option.Space.GetActivitiesParams): Promise<any>;
getProjectUsers(projectIdOrKey: string): Promise<any>;
deleteProjectUsers(projectIdOrKey: string, params: Option.Project.DeleteProjectUsersParams): Promise<any>;
postProjectAdministrators(projectIdOrKey: string, params: Option.Project.PostProjectAdministrators): Promise<any>;
getProjectAdministrators(projectIdOrKey: string): Promise<any>;
deleteProjectAdministrators(projectIdOrKey: string, params: Option.Project.DeleteProjectAdministrators): Promise<any>;
getIssueTypes(projectIdOrKey: string): Promise<any>;
postIssueType(projectIdOrKey: string, params: Option.Project.PostIssueTypeParams): Promise<any>;
patchIssueType(projectIdOrKey: string, id: number, params: Option.Project.PatchIssueTypeParams): Promise<any>;
deleteIssueType(projectIdOrKey: string, id: number, params: Option.Project.DeleteIssueTypeParams): Promise<any>;
getCategories(projectIdOrKey: string): Promise<any>;
postCategories(projectIdOrKey: string, params: Option.Project.PostCategoriesParams): Promise<any>;
patchCategories(projectIdOrKey: string, id: number, params: Option.Project.PatchCategoriesParams): Promise<any>;
deleteCategories(projectIdOrKey: string, id: number): Promise<any>;
getVersions(projectIdOrKey: string): Promise<any>;
postVersions(projectIdOrKey: string, params: Option.Project.PostVersionsParams): Promise<any>;
patchVersions(projectIdOrKey: string, id: number, params: Option.Project.PatchVersionsParams): Promise<any>;
deleteVersions(projectIdOrKey: string, id: number): Promise<any>;
getCustomFields(projectIdOrKey: string): Promise<any>;
postCustomField(projectIdOrKey: string, params: Option.Project.PostCustomFieldParams | Option.Project.PostCustomFieldWithNumericParams | Option.Project.PostCustomFieldWithDateParams | Option.Project.PostCustomFieldWithListParams): Promise<any>;
patchCustomField(projectIdOrKey: string, id: number, params: Option.Project.PatchCustomFieldParams | Option.Project.PatchCustomFieldWithNumericParams | Option.Project.PatchCustomFieldWithDateParams | Option.Project.PatchCustomFieldWithListParams): Promise<any>;
deleteCustomField(projectIdOrKey: string, id: number): Promise<any>;
postCustomFieldItem(projectIdOrKey: string, id: number, params: Option.Project.PostCustomFieldItemParams): Promise<any>;
patchCustomFieldItem(projectIdOrKey: string, id: number, itemId: number, params: Option.Project.PatchCustomFieldItemParams): Promise<any>;
deleteCustomFieldItem(projectIdOrKey: string, id: number, params: Option.Project.PostCustomFieldItemParams): Promise<any>;
getSharedFiles(projectIdOrKey: string, path: string, params: Option.Project.GetSharedFilesParams): Promise<any>;
getProjectsDiskUsage(projectIdOrKey: string): Promise<any>;
getWebhooks(projectIdOrKey: string): Promise<any>;
postWebhook(projectIdOrKey: string, params: Option.Project.PostWebhookParams): Promise<any>;
getWebhook(projectIdOrKey: string, webhookId: string): Promise<any>;
patchWebhook(projectIdOrKey: string, webhookId: string, params: Option.Project.PatchWebhookParams): Promise<any>;
deleteWebhook(projectIdOrKey: string, webhookId: string): Promise<any>;
postIssue(params: Option.Issue.PostIssueParams): Promise<any>;
patchIssue(issueIdOrKey: string, params: Option.Issue.PatchIssueParams): Promise<any>;
getIssues(params?: Option.Issue.GetIssuesParams): Promise<any>;
getIssue(issueIdOrKey: string): Promise<any>;
getIssuesCount(params?: Option.Issue.GetIssuesParams): Promise<any>;
deleteIssuesCount(issueIdOrKey: string): Promise<any>;
getIssueComments(issueIdOrKey: string, params: Option.Issue.GetIssueCommentsParams): Promise<any>;
postIssueComments(issueIdOrKey: string, params: Option.Issue.PostIssueCommentsParams): Promise<any>;
getIssueCommentsCount(issueIdOrKey: string): Promise<any>;
getIssueComment(issueIdOrKey: string, commentId: number): Promise<any>;
patchIssueComment(issueIdOrKey: string, commentId: number, params: Option.Issue.PatchIssueCommentParams): Promise<any>;
getIssueCommentNotifications(issueIdOrKey: string, commentId: number): Promise<any>;
postIssueCommentNotifications(issueIdOrKey: string, commentId: number, prams: Option.Issue.IssueCommentNotifications): Promise<any>;
getIssueAttachments(issueIdOrKey: string): Promise<any>;
deleteIssueAttachment(issueIdOrKey: string, attachmentId: string): Promise<any>;
getIssueSharedFiles(issueIdOrKey: string): Promise<any>;
linkIssueSharedFiles(issueIdOrKey: string, params: Option.Issue.LinkIssueSharedFilesParams): Promise<any>;
unlinkIssueSharedFile(issueIdOrKey: string, id: number): Promise<any>;
getWikis(projectIdOrKey: number): Promise<any>;
getWikisCount(projectIdOrKey: number): Promise<any>;
getWikisTags(projectIdOrKey: number): Promise<any>;
postWiki(params: Option.Wiki.PostWikiParams): Promise<any>;
getWiki(wikiId: number): Promise<any>;
patchWiki(wikiId: number, params: Option.Wiki.PatchWikiParams): Promise<any>;
deleteWiki(wikiId: number, mailNotify: boolean): Promise<any>;
getWikisAttachments(wikiId: number): Promise<any>;
postWikisAttachments(wikiId: number, attachmentId: number[]): Promise<any>;
deleteWikisAttachments(wikiId: number, attachmentId: number): Promise<any>;
getWikisSharedFiles(wikiId: number): Promise<any>;
linkWikisSharedFiles(wikiId: number, fileId: number[]): Promise<any>;
unlinkWikisSharedFiles(wikiId: number, id: number): Promise<any>;
getWikisHistory(wikiId: number, params: Option.Wiki.GetWikisHistoryParams): Promise<any>;
getWikisStars(wikiId: number): Promise<any>;
postStar(params: Option.Project.PostStarParams): Promise<any>;
getNotifications(params: Option.Notification.GetNotificationsParams): Promise<any>;
getNotificationsCount(params: Option.Notification.GetNotificationsCountParams): Promise<any>;
resetNotificationsMarkAsRead(): Promise<any>;
markAsReadNotification(id: number): Promise<any>;
getGitRepositories(projectIdOrKey: string): Promise<any>;
getGitRepository(projectIdOrKey: string, repoIdOrName: string): Promise<any>;
getPullRequests(projectIdOrKey: string, repoIdOrName: string, params: Option.PullRequest.GetPullRequestsParams): Promise<any>;
getPullRequestsCount(projectIdOrKey: string, repoIdOrName: string, params: Option.PullRequest.GetPullRequestsParams): Promise<any>;
postPullRequest(projectIdOrKey: string, repoIdOrName: string, params: Option.PullRequest.PostPullRequestParams): Promise<any>;
getPullRequest(projectIdOrKey: string, repoIdOrName: string, number: number): Promise<any>;
patchPullRequest(projectIdOrKey: string, repoIdOrName: string, number: number, params: Option.PullRequest.PatchPullRequestParams): Promise<any>;
getPullRequestComments(projectIdOrKey: string, repoIdOrName: string, number: number, params: Option.PullRequest.GetPullRequestCommentsParams): Promise<any>;
postPullRequestComments(projectIdOrKey: string, repoIdOrName: string, number: number, params: Option.PullRequest.PostPullRequestCommentsParams): Promise<any>;
getPullRequestCommentsCount(projectIdOrKey: string, repoIdOrName: string, number: number): Promise<any>;
patchPullRequestComments(projectIdOrKey: string, repoIdOrName: string, number: number, commentId: number, params: Option.PullRequest.PatchPullRequestCommentsParams): Promise<any>;
getPullRequestAttachments(projectIdOrKey: string, repoIdOrName: string, number: number): Promise<any>;
deletePullRequestAttachment(projectIdOrKey: string, repoIdOrName: string, number: number, attachmentId: number): Promise<any>;
getProjectIcon(projectIdOrKey: string): Promise<Entity.File.FileData>;
getSharedFile(projectIdOrKey: string, sharedFileId: number): Promise<Entity.File.FileData>;
getIssueAttachment(issueIdOrKey: string, attachmentId: number): Promise<Entity.File.FileData>;
getWikiAttachment(wikiId: number, attachmentId: number): Promise<Entity.File.FileData>;
getPullRequestAttachment(projectIdOrKey: string, repoIdOrName: string, number: number, attachmentId: number): Promise<Entity.File.FileData>;
private download(path);
private upload(path, params);
private parseFileData(response);
}
export class OAuth2 {
private credentials;
private timeout;
constructor(credentials: Option.OAuth2.Credentials, timeout?: number);
getAuthorizationURL(options: {
host: string;
redirectUri?: string;
state?: string;
}): string;
getAccessToken(options: {
host: string;
code: string;
redirectUri?: string;
}): Promise<Entity.OAuth2.AccessToken>;
refreshAccessToken(options: {
host: string;
refreshToken: string;
}): Promise<Entity.OAuth2.AccessToken>;
}
import { PassThrough } from 'stream';
export namespace Entity {
export namespace File {
export type FileData = NodeFileData | BrowserFileData;
export interface NodeFileData {
body: PassThrough;
url: string;
filename: string;
}
export interface BrowserFileData {
body: any;
url: string;
blob?: () => Promise<Blob>;
}
}
export namespace OAuth2 {
export interface AccessToken {
access_token: string;
token_type: string;
expires_in: number;
refresh_token: string;
}
}
}
export namespace Option {
export type Order = "asc" | "desc";
export enum ActivityType {
Undefined = -1,
IssueCreated = 1,
IssueUpdated = 2,
IssueCommented = 3,
IssueDeleted = 4,
WikiCreated = 5,
WikiUpdated = 6,
WikiDeleted = 7,
FileAdded = 8,
FileUpdated = 9,
FileDeleted = 10,
SvnCommitted = 11,
GitPushed = 12,
GitRepositoryCreated = 13,
IssueMultiUpdated = 14,
ProjectUserAdded = 15,
ProjectUserRemoved = 16,
NotifyAdded = 17,
PullRequestAdded = 18,
PullRequestUpdated = 19,
PullRequestCommented = 20,
PullRequestMerged = 21,
}
export namespace Notification {
export interface GetNotificationsParams {
minId?: number;
maxId?: number;
count?: number;
order?: Order;
}
export interface GetNotificationsCountParams {
alreadyRead: boolean;
resourceAlreadyRead: boolean;
}
}
export namespace Space {
export interface GetActivitiesParams {
activityTypeId?: ActivityType[];
minId?: number;
maxId?: number;
count?: number;
order?: Order;
}
export interface PutSpaceNotificationParams {
content: string;
}
}
export namespace User {
export interface PostUserParams {
userId: string;
password: string;
name: string;
mailAddress: string;
roleType: RoleType;
}
export interface PatchUserParams {
password?: string;
name?: string;
mailAddress?: string;
roleType?: RoleType;
}
export enum RoleType {
Admin = 1,
User = 2,
Reporter = 3,
Viewer = 4,
GuestReporter = 5,
GuestViewer = 6,
}
export interface GetUserActivitiesParams {
activityTypeId?: ActivityType[];
minId?: number;
maxId?: number;
count?: number;
order?: Order;
}
export interface GetUserStarsParams {
minId?: number;
maxId?: number;
count?: number;
order?: Order;
}
export interface GetUserStarsCountParams {
since?: string;
until?: string;
}
export interface GetRecentlyViewedParams {
order?: Order;
offset?: number;
count?: number;
}
}
export namespace Group {
export interface GetGroupsParams {
order?: Order;
offset?: number;
count?: number;
}
export interface PostGroupsParams {
name: string;
members?: string[];
}
export interface PatchGroupParams {
name?: string;
members?: string[];
}
}
export namespace Project {
export type TextFormattingRule = "backlog" | "markdown";
export interface PostProjectParams {
name: string;
key: string;
chartEnabled: boolean;
projectLeaderCanEditProjectLeader?: boolean;
subtaskingEnabled: boolean;
textFormattingRule: TextFormattingRule;
}
export interface PatchProjectParams {
name?: string;
key?: string;
chartEnabled?: boolean;
subtaskingEnabled?: boolean;
projectLeaderCanEditProjectLeader?: boolean;
textFormattingRule?: TextFormattingRule;
archived?: boolean;
}
export interface GetProjectsParams {
archived?: boolean;
all?: boolean;
}
export interface DeleteProjectUsersParams {
userId: number;
}
export interface PostProjectAdministrators {
userId: number;
}
export interface DeleteProjectAdministrators {
userId: number;
}
export type IssueTypeColor = "#e30000" | "#990000" | "#934981" | "#814fbc" | "#2779ca" | "#007e9a" | "#7ea800" | "#ff9200" | "#ff3265" | "#666665";
export interface PostIssueTypeParams {
name: string;
color: IssueTypeColor;
}
export interface PatchIssueTypeParams {
name?: string;
color?: IssueTypeColor;
}
export interface DeleteIssueTypeParams {
substituteIssueTypeId: number;
}
export interface PostCategoriesParams {
name: string;
}
export interface PatchCategoriesParams {
name: string;
}
export interface PostVersionsParams {
name: string;
description: string;
startDate: string;
releaseDueDate: string;
}
export interface PatchVersionsParams {
name: string;
description?: string;
startDate?: string;
releaseDueDate?: string;
archived?: boolean;
}
export interface PostCustomFieldParams {
typeId: FieldType;
name: string;
applicableIssueTypes?: number[];
description?: string;
required?: boolean;
}
export interface PostCustomFieldWithNumericParams extends PostCustomFieldParams {
min?: number;
max?: number;
initialValue?: number;
unit?: string;
}
export interface PostCustomFieldWithDateParams extends PostCustomFieldParams {
min?: string;
max?: string;
initialValueType?: number;
initialDate?: string;
initialShift?: number;
}
export interface PostCustomFieldWithListParams extends PostCustomFieldParams {
items?: string[];
allowInput?: boolean;
allowAddItem?: boolean;
}
export interface PatchCustomFieldParams {
name?: string;
applicableIssueTypes?: number[];
description?: string;
required?: boolean;
}
export interface PatchCustomFieldWithNumericParams extends PatchCustomFieldParams {
min?: number;
max?: number;
initialValue?: number;
unit?: string;
}
export interface PatchCustomFieldWithDateParams extends PatchCustomFieldParams {
min?: string;
max?: string;
initialValueType?: number;
initialDate?: string;
initialShift?: number;
}
export interface PatchCustomFieldWithListParams extends PatchCustomFieldParams {
items?: string[];
allowInput?: boolean;
allowAddItem?: boolean;
}
export interface PostCustomFieldItemParams {
name: string;
}
export interface PatchCustomFieldItemParams {
name: string;
}
export interface GetSharedFilesParams {
order?: Order;
offset?: number;
count?: number;
}
export interface PostWebhookParams {
name?: string;
description?: string;
hookUrl?: string;
allEvent?: boolean;
activityTypeIds?: number[];
}
export interface PatchWebhookParams {
name?: string;
description?: string;
hookUrl?: string;
allEvent?: boolean;
activityTypeIds?: number[];
}
export enum FieldType {
Text = 1,
TextArea = 2,
Numeric = 3,
Date = 4,
SingleList = 5,
MultipleList = 6,
CheckBox = 7,
Radio = 8,
}
export interface PostStarParams {
issueId?: number;
commentId?: number;
wikiId?: number;
pullRequestId?: number;
pullRequestCommentId?: number;
}
}
export namespace Issue {
export interface PostIssueParams {
projectId: number;
summary: string;
priorityId: number;
issueTypeId: number;
parentIssueId?: number;
description?: string;
startDate?: string;
dueDate?: string;
estimatedHours?: number;
actualHours?: number;
categoryId?: number[];
versionId?: number[];
milestoneId?: number[];
assigneeId?: number;
notifiedUserId?: number[];
attachmentId?: number[];
[customField_: string]: any;
}
export interface PatchIssueParams {
summary?: string;
parentIssueId?: number;
description?: string;
statusId?: number;
resolutionId?: number;
startDate?: string;
dueDate?: string;
estimatedHours?: number;
actualHours?: number;
issueTypeId?: number;
categoryId?: number[];
versionId?: number[];
milestoneId?: number[];
priorityId?: number;
assigneeId?: number;
notifiedUserId?: number[];
attachmentId?: number[];
comment?: string;
[customField_: string]: any;
}
export interface GetIssuesParams {
projectId?: number[];
issueTypeId?: number[];
categoryId?: number[];
versionId?: number[];
milestoneId?: number[];
statusId?: number[];
priorityId?: number[];
assigneeId?: number[];
createdUserId?: number[];
resolutionId?: number[];
parentChild?: ParentChildType;
attachment?: boolean;
sharedFile?: boolean;
sort?: SortKey;
order?: Order;
offset?: number;
count?: number;
createdSince?: string;
createdUntil?: string;
updatedSince?: string;
updatedUntil?: string;
startDateSince?: string;
startDateUntil?: string;
dueDateSince?: string;
dueDateUntil?: string;
id?: number[];
parentIssueId?: number[];
keyword: string;
[customField_: string]: any;
}
export enum ParentChildType {
All = 0,
NotChild = 1,
Child = 2,
NotChildNotParent = 3,
Parent = 4,
}
export type SortKey = "issueType" | "category" | "version" | "milestone" | "summary" | "status" | "priority" | "attachment" | "sharedFile" | "created" | "createdUser" | "updated" | "updatedUser" | "assignee" | "startDate" | "dueDate" | "estimatedHours" | "actualHours" | "childIssue";
export interface GetIssueCommentsParams {
minId?: number;
maxId?: number;
count?: number;
order?: Order;
}
export interface PostIssueCommentsParams {
content: string;
notifiedUserId?: number[];
attachmentId?: number[];
}
export interface PatchIssueCommentParams {
content: string;
}
export interface IssueCommentNotifications {
notifiedUserId: number[];
}
export interface LinkIssueSharedFilesParams {
fileId: number[];
}
}
export namespace PullRequest {
export interface GetPullRequestsParams {
statusId?: number[];
assigneeId?: number[];
issueId?: number[];
createdUserId?: number[];
offset?: number;
count?: number;
}
export interface PostPullRequestParams {
summary: string;
description: string;
base: string;
branch: string;
issueId?: number;
assigneeId?: number;
notifiedUserId?: number[];
attachmentId?: number[];
}
export interface PatchPullRequestParams {
summary?: string;
description?: string;
issueId?: number;
assigneeId?: number;
notifiedUserId?: number[];
comment?: string[];
}
export interface GetPullRequestCommentsParams {
minId?: number;
maxId?: number;
count?: number;
order?: Order;
}
export interface PostPullRequestCommentsParams {
content: string;
notifiedUserId?: number[];
}
export interface PatchPullRequestCommentsParams {
content: string;
}
}
export namespace Wiki {
export interface PostWikiParams {
projectId: number;
name: string;
content: string;
mailNotify?: boolean;
}
export interface PatchWikiParams {
name?: string;
content?: string;
mailNotify?: boolean;
}
export interface GetWikisHistoryParams {
minId?: number;
maxId?: number;
count?: number;
order?: Order;
}
}
export namespace OAuth2 {
export interface Credentials {
clientId: string;
clientSecret: string;
}
}
}
export namespace Error {
export class BacklogError extends global.Error {
private _name;
private _url;
private _status;
private _body;
private _response;
constructor(name: BacklogErrorNameType, response: IResponse, body?: {
errors: BacklogErrorMessage[];
});
name: BacklogErrorNameType;
url: string;
status: number;
body: {
errors: BacklogErrorMessage[];
};
response: IResponse;
}
export class BacklogApiError extends BacklogError {
constructor(response: IResponse, body?: {
errors: BacklogErrorMessage[];
});
}
export class BacklogAuthError extends BacklogError {
constructor(response: IResponse, body?: {
errors: BacklogErrorMessage[];
});
}
export class UnexpectedError extends BacklogError {
constructor(response: IResponse);
}
export interface BacklogErrorMessage {
message: string;
code: number;
errorInfo: string;
moreInfo: string;
}
export type BacklogErrorNameType = 'BacklogApiError' | 'BacklogAuthError' | 'UnexpectedError';
}

19
backlog-js/tsconfig.json Normal file
View File

@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": false,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"backlog-js-tests.ts"
]
}

View File

@ -3,7 +3,7 @@
// Definitions by: Ché Coxshall <https://github.com/CheCoxshall>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts" />
/// <reference types="jquery" />
interface JQuery {
fileinput: (options?: BootstrapFileInput.FileInputOptions) => JQuery;

View File

@ -0,0 +1,18 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": false,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"bootstrap-fileinput.d.ts"
]
}

View File

@ -5,9 +5,10 @@
/// <reference types="node" />
declare var browserify: BrowserifyConstructor;
declare var browserify: browserify.BrowserifyConstructor;
export = browserify;
declare namespace browserify {
/**
* Options pertaining to an individual file.
*/
@ -173,3 +174,4 @@ interface BrowserifyObject extends NodeJS.EventEmitter {
*/
pipeline: any;
}
}

View File

@ -3,7 +3,7 @@
// Definitions by: Matt Lewis <https://github.com/mattlewis92>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../chai/chai.d.ts" />
/// <reference types="chai" />
declare namespace Chai {
@ -24,13 +24,13 @@ declare namespace Chai {
value(text: string): Assertion;
}
interface Include {
text(text: string|string[]): Assertion;
html(text: string|string[]): Assertion;
}
}

19
chai-dom/tsconfig.json Normal file
View File

@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"chai-dom.d.ts",
"chai-dom-tests.ts"
]
}

View File

@ -1,7 +1,7 @@
/// <reference path="../react/react.d.ts" />
/// <reference types="react" />
/// <reference path="./chai-enzyme.d.ts" />
/// <reference path="../enzyme/enzyme.d.ts" />
/// <reference path="../chai/chai.d.ts" />
/// <reference types="enzyme" />
/// <reference types="chai" />
import * as React from "react";
import * as chaiEnzyme from "chai-enzyme";

View File

@ -4,12 +4,12 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../enzyme/enzyme.d.ts" />
/// <reference path="../chai/chai.d.ts" />
/// <reference path="../react/react.d.ts" />
/// <reference types="enzyme" />
/// <reference types="chai" />
/// <reference types="react" />
declare namespace Chai {
type EnzymeSelector = string | __React.StatelessComponent<any> | __React.ComponentClass<any> | { [key: string]: any };
type EnzymeSelector = string | React.StatelessComponent<any> | React.ComponentClass<any> | { [key: string]: any };
interface Match {
/**

21
chai-enzyme/tsconfig.json Normal file
View File

@ -0,0 +1,21 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"jsx": "react"
},
"files": [
"chai-enzyme.d.ts",
"chai-enzyme-tests.tsx"
]
}

View File

@ -3,12 +3,12 @@
// Definitions by: Hiraash Thawfeek <https://github.com/hiraash>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path='../angularjs/angular.d.ts' />
/// <reference types="angular" />
declare var commangular: commangular.ICommAngularStatic;
declare module commangular {
///////////////////////////////////////////////////////////////////////////
// Commangular Static
// see http://commangular.org/docs/#commangular-namespace
@ -19,78 +19,78 @@ declare module commangular {
* Use this function to create and register a command with Commangular
*
* @param commandName It's the name of the command you are creating. It's useful to reference the command from the command provider.
* @param commandFunction It's the command class that will be executed when commangular runs this command.
* @param commandFunction It's the command class that will be executed when commangular runs this command.
* It has to be something that implements ICommand. Same as angular syntax
* @param commandConfig It's and object with paramaters to configure the command execution.
*/
create (commandName: string, commandFunction: Function, commandConfig?:ICommandConfig) : void;
command (commandName: string, commandFunction: Function, commandConfig?:ICommandConfig) : void;
/**
* This function allows you to hijack the execution before or after and
* execute some cross cutting functionality.
* see http://commangular.org/docs/#command-aspects
* @param aspectDescriptor The interceptor descriptor has two parts 'Where' and 'What'.
* Where do you want to intercept? you've 5 options :
* - @Before : The interceptor will be executed before the command. You will be able to
* cancel the command or modify the data that will be injected in the command or do
* - @Before : The interceptor will be executed before the command. You will be able to
* cancel the command or modify the data that will be injected in the command or do
* some other operation you need before the command execution.
* - @After : The interceptor will be executed just after the command and before any other next
* - @After : The interceptor will be executed just after the command and before any other next
* command. You can get the lastResult from the command, cancel execution etc etc.
* - @AfterExecution : This intercetor is executed just after the command execute method and
* - @AfterExecution : This intercetor is executed just after the command execute method and
* it can get the result from the command and update it before the onResult method is executed.
* - @AfterThrowing : This interceptor will be executed if the command or any interceptor of
* - @AfterThrowing : This interceptor will be executed if the command or any interceptor of
* the command throws an exception. You can get the error throwed injected to do what you need.
* - @Around : The interceptor is executed around a command.That means that a especial
* object 'processor' will be injected in the interceptor and you can invoke the command
* - @Around : The interceptor is executed around a command.That means that a especial
* object 'processor' will be injected in the interceptor and you can invoke the command
* or the next interceptor. It will be better explained below.
* @param aspectFunction It's the command class execute function that will be run for the given aspect.
* @param order You can chain any number of interceptors to the same command, so if you need to executed
* @param order You can chain any number of interceptors to the same command, so if you need to executed
* the interceptor in a specific order you can indicate it here. An order of 0 is assigned by default.
*/
aspect ( aspectDescriptor: string, aspectFunction: ICommand, order: number ) : void;
/**
* Event aspects work the same way command aspects do, but they intercept all the command groups instead,
* so you can run some function before the command group starts it's execution , after or when any
* Event aspects work the same way command aspects do, but they intercept all the command groups instead,
* so you can run some function before the command group starts it's execution , after or when any
* command or interceptor in the group throw an exception.
* see http://commangular.org/docs/#event-aspects
* @param aspectDescriptor The interceptor descriptor has two parts 'Where' and 'What'.
* Where do you want to intercept? you've 3 options :
* - @Before : The interceptor will be executed before the command. You will be able to
* cancel the command or modify the data that will be injected in the command or do
* - @Before : The interceptor will be executed before the command. You will be able to
* cancel the command or modify the data that will be injected in the command or do
* some other operation you need before the command execution.
* - @After : The interceptor will be executed just after the command and before any other next
* - @After : The interceptor will be executed just after the command and before any other next
* command. You can get the lastResult from the command, cancel execution etc etc.
* - @AfterThrowing : This interceptor will be executed if the command or any interceptor of
* - @AfterThrowing : This interceptor will be executed if the command or any interceptor of
* the command throws an exception. You can get the error throwed injected to do what you need.
* @param aspectFunction It's the command class execute function that will be run for the given aspect.
* @param order You can chain any number of interceptors to the same command, so if you need to executed
* @param order You can chain any number of interceptors to the same command, so if you need to executed
* the interceptor in a specific order you can indicate it here. An order of 0 is assigned by default.
*/
eventAspect( aspectDescriptor: string, aspectFunction: ICommand, order: number ) : void;
/**
* TBD
*/
resolver( commandName: string, resolverFunction : Function ) : void;
resolver( commandName: string, resolverFunction : Function ) : void;
/**
* Clears all commands and aspects registered with commangular.
*/
reset() : void;
/**
* Can be used to enable/disable debug
* Can be used to enable/disable debug
*/
debug( enableDebug : boolean ) : void;
/**
* TBD
*/
build() : void;
}
/**
* The command function/object
* see http://commangular.org/docs/#commangular-namespace
@ -101,29 +101,29 @@ declare module commangular {
* It can take parameters in as injected by angular
*/
execute() : any;
}
interface IResultCommand extends ICommand{
/**
* Is executed after the execute method and the interception chain and can receive
* Is executed after the execute method and the interception chain and can receive
* the result from the execute method of the same command.
*
*
* @param result Value/object returned by the execution.
*/
onResult ( result: any ) : void;
/**
* Is executed when the executed method ends with an error. Can receive the error throw by the execute method.
* @param error The error that occured during execution
*/
onError ( error: Error ) : void;
}
/**
* The result object expected in the promise returned by the dispatch function
* This must be extended to add custom result keys
* see http://commangular.org/docs/#returning-result-from-commands
* see http://commangular.org/docs/#returning-result-from-commands
*/
interface ICommandResult {
/**
@ -131,65 +131,65 @@ declare module commangular {
*/
lastResult : any;
}
/**
* Command creation configuration
* see http://commangular.org/docs/#the-command-config-object
*/
interface ICommandConfig {
/**
* This property instruct commangular to keep the value returned by the command in the value
* key passed in 'resultKey'. It has to be a string. It means that after the execution of this
* This property instruct commangular to keep the value returned by the command in the value
* key passed in 'resultKey'. It has to be a string. It means that after the execution of this
* commands you will be able to inject on the next command using that key and the result of the command will be injected.
*/
resultKey : string;
}
/**
* All the command configuration of your application is done in an angular config block and
* with the $commangularProvider. The provider is responsible to build the command strutures and
* map them to the desired event names. You can create multiple configs blocks in angular, so you
* All the command configuration of your application is done in an angular config block and
* with the $commangularProvider. The provider is responsible to build the command strutures and
* map them to the desired event names. You can create multiple configs blocks in angular, so you
* can have multiple command config blocks to separate functional parts of your application.
* see http://commangular.org/docs/#using-the-provider
*/
interface ICommAngularProvider {
/**
* This function lets you map a even name to a command sequence
* @param eventName An event that will be watched by commangular
*/
mapTo( eventName: string ) : ICommAngularDescriptor;
/**
* Used along with mapTo function. Creates a sequence of commands that
* Used along with mapTo function. Creates a sequence of commands that
* execute after one and other
* see http://commangular.org/docs/#building-command-sequences
*/
asSequence(): ICommAngularDescriptor;
/**
* Used along with mapTo function. Maps commands to be executed parallel
* see http://commangular.org/docs/#building-parallel-commands
*/
asParallel(): ICommAngularDescriptor;
/**
* A command flow is a decision point inside the command group.You can have any number
* A command flow is a decision point inside the command group.You can have any number
* of flows inside a command group and nesting them how you perfer.
* see http://commangular.org/docs/#building-command-flows
*/
asFlow(): ICommAngularDescriptor;
asFlow(): ICommAngularDescriptor;
findCommand( eventName: string ): ICommAngularDescriptor;
}
/**
* The service that enables the execution of commands
* see http://commangular.org/docs/#dispatching-events
*/
interface ICommAngularService {
/**
* This function executes the given command sequence.
* see http://commangular.org/docs/#dispatching-events
@ -198,76 +198,76 @@ declare module commangular {
*/
dispatch( eventName: string, data?: any ) : ng.IPromise<any>;
}
interface ICommAngularDescriptor {
/**
* Used along with mapTo function. Creates a sequence of commands that
* Used along with mapTo function. Creates a sequence of commands that
* execute after one and other
* see http://commangular.org/docs/#building-command-sequences
*/
asSequence (): ICommAngularDescriptor;
asSequence (): ICommAngularDescriptor;
/**
* Used along with mapTo function. Maps commands to be executed parallel
* see http://commangular.org/docs/#building-parallel-commands
*/
asParallel(): ICommAngularDescriptor;
/**
* A command flow is a decision point inside the command group.You can have any number
* A command flow is a decision point inside the command group.You can have any number
* of flows inside a command group and nesting them how you perfer.
* see http://commangular.org/docs/#building-command-flows
*/
asFlow(): ICommAngularDescriptor;
asFlow(): ICommAngularDescriptor;
/**
* Add commands to a descriptor.
* @param command The name that was used to create the command.
*/
add ( command: string ): ICommAngularDescriptor;
/**
* Add descriptor to a descriptor.
* @param descriptor Another descriptor attached to a sequnce of commands.
*/
add ( descriptor: ICommAngularDescriptor ): ICommAngularDescriptor;
/**
* This is to be used with flowing commands to attach an expression that
* This is to be used with flowing commands to attach an expression that
* evaluates using Angular $parse.
* see http://commangular.org/docs/#building-command-flows
* @param expression A string form expression that can make use of services to validate conditions.
* @param services A comma seperated list of services that are used in the above expression
*/
link ( expression: string, services?: string ): ICommAngularDescriptor;
/**
* Works with the <code>link</code> function to attach a command to the flow if the
* expression becomes truthy.
* Works with the <code>link</code> function to attach a command to the flow if the
* expression becomes truthy.
* see http://commangular.org/docs/#building-command-flows
* @param command The name that was used to create the command.
*/
to ( command: string ): ICommAngularDescriptor;
to ( command: string ): ICommAngularDescriptor;
}
}
/**
* Extending the angular rootScope to include the dispatch function in all scopes.
*/
declare module angular {
interface IRootScopeService {
/**
* Commangular method to execute a command.
* @param eventName Name of the even that will trigger a command sequence
* @param data Data of any type that will be passed to the command.
*/
dispatch( eventName: string, data?: any ) : ng.IPromise<any>;
}
}

19
commangular/tsconfig.json Normal file
View File

@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"commangular.d.ts",
"commangular-mock.d.ts"
]
}

View File

@ -1,5 +1,5 @@
/// <reference path="./connect-redis.d.ts" />
/// <reference path="../express-session/express-session.d.ts" />
/// <reference types="express-session" />
import * as connectRedis from "connect-redis";
import * as session from "express-session";

View File

@ -3,9 +3,9 @@
// Definitions by: Xavier Stouder <https://github.com/xstoudi>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../express/express.d.ts" />
/// <reference path="../express-session/express-session.d.ts" />
/// <reference path="../redis/redis.d.ts" />
/// <reference types="express" />
/// <reference types="express-session" />
/// <reference types="redis" />
declare module "connect-redis" {
import * as express from "express";

View File

@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"connect-redis.d.ts",
"connect-redis-tests.ts"
]
}

View File

@ -2,11 +2,11 @@
// Project: https://github.com/apache/cordova-plugin-file-transfer
// Definitions by: Microsoft Open Technologies Inc. <http://msopentech.com>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
//
//
// Copyright (c) Microsoft Open Technologies Inc
// Licensed under the MIT license
/// <reference path="../cordova-plugin-file/index.d.ts" />
/// <reference types="cordova-plugin-file" />
/**
* The FileTransfer object provides a way to upload files using an HTTP multi-part POST request,
@ -21,7 +21,7 @@ interface FileTransfer {
* this can also be the full path of the file on the device.
* @param server URL of the server to receive the file, as encoded by encodeURI().
* @param successCallback A callback that is passed a FileUploadResult object.
* @param errorCallback A callback that executes if an error occurs retrieving the FileUploadResult.
* @param errorCallback A callback that executes if an error occurs retrieving the FileUploadResult.
* Invoked with a FileTransferError object.
* @param options Optional parameters.
* @param trustAllHosts Optional parameter, defaults to false. If set to true, it accepts all security certificates.

View File

@ -2,9 +2,15 @@
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": false,
"noImplicitAny": true,
"strictNullChecks": false,
"noEmit": true
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",

View File

@ -3,44 +3,44 @@
// Definitions by: David Muller <https://github.com/davidm77>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
/// <reference types="node" />
declare module "csv-parse/types" {
interface callbackFn {
(err: any, output: any): void
}
interface nameCallback {
(line1: any[]): boolean | string[]
}
}
interface options {
/***
* Set the field delimiter. One character only, defaults to comma.
* Set the field delimiter. One character only, defaults to comma.
*/
delimiter?: string;
/***
* String used to delimit record rows or a special value; special constants are 'auto', 'unix', 'mac', 'windows', 'unicode'; defaults to 'auto' (discovered in source or 'unix' if no source is specified).
*/
*/
rowDelimiter?: string;
/***
* Optional character surrounding a field, one character only, defaults to double quotes.
* Optional character surrounding a field, one character only, defaults to double quotes.
*/
quote?: string
/***
* Set the escape character, one character only, defaults to double quotes.
*/
* Set the escape character, one character only, defaults to double quotes.
*/
escape?: string
/***
* List of fields as an array, a user defined callback accepting the first line and returning the column names or true if autodiscovered in the first CSV line, default to null, affect the result data set in the sense that records will be objects instead of arrays.
* List of fields as an array, a user defined callback accepting the first line and returning the column names or true if autodiscovered in the first CSV line, default to null, affect the result data set in the sense that records will be objects instead of arrays.
*/
columns?: any[]|boolean|nameCallback;
/***
* Treat all the characters after this one as a comment, default to '' (disabled).
* Treat all the characters after this one as a comment, default to '' (disabled).
*/
comment?: string
@ -88,24 +88,24 @@ declare module "csv-parse/types" {
* If true, the parser will attempt to convert read data types to native types.
*/
auto_parse?: boolean
/***
* If true, the parser will attempt to convert read data types to dates. It requires the "auto_parse" option.
*/
auto_parse_date?: boolean
}
import * as stream from "stream";
import * as stream from "stream";
interface Parser extends stream.Transform {
__push(line: any): any ;
__write(chars: any, end: any, callback: any): any;
__write(chars: any, end: any, callback: any): any;
}
interface ParserConstructor {
new (options: options): Parser;
}
interface parse {
(input: string, options?: options, callback?: callbackFn): any;
(options: options, callback: callbackFn): any;
@ -117,16 +117,16 @@ declare module "csv-parse/types" {
declare module "csv-parse" {
import { parse as parseIntf } from "csv-parse/types";
let parse: parseIntf;
export = parse;
}
declare module "csv-parse/lib/sync" {
import { options } from "csv-parse/types";
import { options } from "csv-parse/types";
function parse (input: string, options?: options): any;
export = parse;
}

19
csv-parse/tsconfig.json Normal file
View File

@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"csv-parse.d.ts",
"csv-parse-tests.ts"
]
}

View File

@ -1,7 +1,7 @@
/// <reference path="d3kit.d.ts" />
/// <reference path="../d3/d3.d.ts" />
/// <reference path="../mocha/mocha.d.ts" />
/// <reference path="../chai/chai.d.ts" />
/// <reference types="d3" />
/// <reference types="mocha" />
/// <reference types="chai" />
/* jshint expr: true */

16
d3kit/d3kit.d.ts vendored
View File

@ -3,7 +3,7 @@
// Definitions by: Morgan Benton <https://github.com/morphatic/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../d3/d3.d.ts" />
/// <reference types="d3" />
declare namespace d3kit {
@ -29,7 +29,7 @@ declare namespace d3kit {
export class Skeleton {
constructor(selector: string|Element, options?: ChartOptions, customEvents?: Array<string>);
// Getters
getCustomEventNames(): Array<string>;
getDispatcher(): any; // should be d3.Dispatch but this throws error for user-created events
@ -78,9 +78,9 @@ declare namespace d3kit {
export class Chartlet {
constructor(
enterFunction?: ChartletEventFunction,
updateFunction?: ChartletEventFunction,
exitFunction?: ChartletEventFunction,
enterFunction?: ChartletEventFunction,
updateFunction?: ChartletEventFunction,
exitFunction?: ChartletEventFunction,
customEventName?: Array<string>);
// Getter functions
@ -116,15 +116,15 @@ declare namespace d3kit {
constructor(container: d3.Selection<any>, tag?: string);
create(config: string|Array<string>|LayerConfig|Array<LayerConfig>): d3.Selection<any>|Array<d3.Selection<any>>;
create(config: string|Array<string>|LayerConfig|Array<LayerConfig>|any): d3.Selection<any>|Array<d3.Selection<any>>;
get(name: string): d3.Selection<any>;
has(name: string): boolean;
}
export namespace factory {
export function createChart(
defaultOptions: ChartOptions,
customEvents: Array<string>,
defaultOptions: ChartOptions,
customEvents: Array<string>,
constructor: (skeleton: Skeleton) => void
): (selector: string|Element, options?: ChartOptions, customEvents?: Array<string>) => Skeleton;
}

19
d3kit/tsconfig.json Normal file
View File

@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"d3kit.d.ts",
"d3kit-tests.ts"
]
}

View File

@ -1,4 +1,5 @@
/// <reference path="daterangepicker.d.ts"/>
import moment = require("moment")
function tests_simple() {
$('#daterange').daterangepicker();

View File

@ -3,12 +3,14 @@
// Definitions by: SirMartin <https://github.com/SirMartin/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts"/>
/// <reference path="../moment/moment.d.ts"/>
/// <reference types="jquery"/>
import moment = require("moment");
interface JQuery {
daterangepicker(settings?: daterangepicker.Settings): JQuery;
daterangepicker(settings?: daterangepicker.Settings, callback?: (start?: string | Date | moment.Moment, end?: string | Date | moment.Moment, label?: string) => any): JQuery;
declare global {
interface JQuery {
daterangepicker(settings?: daterangepicker.Settings): JQuery;
daterangepicker(settings?: daterangepicker.Settings, callback?: (start?: string | Date | moment.Moment, end?: string | Date | moment.Moment, label?: string) => any): JQuery;
}
}
declare namespace daterangepicker {

View File

@ -0,0 +1,5 @@
{
"dependencies": {
"moment": "2.14.*"
}
}

View File

@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"daterangepicker.d.ts",
"daterangepicker-tests.ts"
]
}

View File

@ -3,7 +3,7 @@
// Definitions by: Andrey Lipatkin <https://github.com/Litee>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts" />
/// <reference types="jquery" />
type Direction = "horizontal" | "vertical" | "both";

19
df-visible/tsconfig.json Normal file
View File

@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": false,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"df-visible.d.ts",
"df-visible-tests.ts"
]
}

View File

@ -1,11 +1,7 @@
/// <reference path="../react/react.d.ts" />
/// <reference path="./dva.d.ts" />
import React = __React;
import dva from 'dva';
import { connect } from 'dva';
import { Router, Route } from 'dva/router';
import * as React from "react";
// 1. Initialize
const app = dva();
@ -25,9 +21,9 @@ app.model({
});
// 3. View
const App = connect(({ count }) => ({
const App = connect(({ count }: any) => ({
count
}))(function ({ count, dispatch }) {
}))(function ({ count, dispatch }: any) {
return (
<div>
<h2>{ count }</h2>
@ -38,7 +34,7 @@ const App = connect(({ count }) => ({
});
// 4. Router
app.router(({ history }) =>
app.router(({ history }: any) =>
<Router history={history}>
<Route path="/" component={App}/>
</Router>

4
dva/dva.d.ts vendored
View File

@ -3,7 +3,7 @@
// Definitions by: nikogu <https://github.com/nikogu/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../react/react.d.ts" />
/// <reference types="react" />
declare module 'dva' {
/** connecting Container Components */
export function connect(maps:Object):Function;
@ -28,8 +28,6 @@ declare module 'dva' {
* https://github.com/reactjs/react-router
*/
declare module 'dva/router' {
import React = __React;
interface RouterProps {
history?: Object
}

21
dva/tsconfig.json Normal file
View File

@ -0,0 +1,21 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"jsx": "react"
},
"files": [
"dva.d.ts",
"dva-tests.tsx"
]
}

2
electron/index.d.ts vendored
View File

@ -3,7 +3,7 @@
// Definitions by: jedmao <https://github.com/jedmao/>, rhysd <https://rhysd.github.io>, Milan Burda <https://github.com/miniak/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
/// <reference types="node" />
declare namespace Electron {

22
epub/epub.d.ts vendored
View File

@ -3,7 +3,7 @@
// Definitions by: Julien Chaumond <https://github.com/julien-c>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
/// <reference types="node" />
/**
* new EPub(fname[, imageroot][, linkroot])
@ -31,9 +31,9 @@
* /images/logo_img/OPT/logo.jpg
**/
declare module "epub" {
import {EventEmitter} from "events";
interface TocElement {
level: number;
order: number;
@ -41,26 +41,26 @@ declare module "epub" {
id: string;
href?: string;
}
class EPub extends EventEmitter {
constructor(epubfile: string, imagewebroot?: string, chapterwebroot?: string);
metadata: Object;
manifest: Object;
spine: Object;
flow: Array<Object>;
toc: Array<TocElement>;
parse(): void;
getChapter(chapterId: string, callback: (error: Error, text: string) => void): void;
getChapterRaw(chapterId: string, callback: (error: Error, text: string) => void): void;
getImage(id: string, callback: (error: Error, data: Buffer, mimeType: string) => void): void;
getFile(id: string, callback: (error: Error, data: Buffer, mimeType: string) => void): void;
}
export = EPub;
}

19
epub/tsconfig.json Normal file
View File

@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"epub.d.ts",
"epub-tests.ts"
]
}

2
eq.js/index.d.ts vendored
View File

@ -11,7 +11,7 @@ declare module 'eq.js' {
}
declare namespace eq {
type AvailableElementType = HTMLElement|HTMLElement[]|NodeList|JQuery;
type AvailableElementType = HTMLElement|HTMLCollectionOf<Element>|HTMLElement[]|NodeList|JQuery;
interface EqjsStatic {

View File

@ -13,6 +13,7 @@
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts"
"index.d.ts",
"eq.js.tests.ts"
]
}

View File

@ -1,7 +1,5 @@
/// <reference path="../estree/estree.d.ts" />
/// <reference path="esprima-walk.d.ts" />
import * as walk from 'esprima-walk'
import * as ESTree from "estree";
import walk = require("esprima-walk");
var program: ESTree.Program
var string: string

View File

@ -1,40 +0,0 @@
// Type definitions for esprima-walk v0.1.0
// Project: https://github.com/jrajav/esprima-walk
// Definitions by: tswaters <https://github.com/tswaters>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../estree/estree.d.ts" />
declare module "esprima-walk" {
interface NodeWithParent extends ESTree.Node {
parent?: ESTree.Node
}
/**
* Walk the provided AST; fn is called once for each node with a `type`
* @param {ESTree.Program} ast program to walk
* @param {function} fn function invoked for each node with type
*/
function walk (ast: ESTree.Program, fn:(node: ESTree.Node)=>void) :void
namespace walk {
/**
* Walk the provided AST; fn is called once for each node with a `type`
* @param {ESTree.Program} ast program to walk
* @param {function} fn function invoked for each node
*/
export function walk (ast: ESTree.Program, fn:(node: ESTree.Node)=>void) :void
/**
* Walk the provided AST; fn is called once for each node with a `type`.
* Adds a parent property prior to invoking fn when applicable
* @param {ESTree.Program} ast program to walk
* @param {function} fn function invoked for each node
*/
export function walkAddParent (ast: ESTree.Program, fn:(node: NodeWithParent)=>void) :void
}
export = walk
}

34
esprima-walk/index.d.ts vendored Normal file
View File

@ -0,0 +1,34 @@
// Type definitions for esprima-walk v0.1.0
// Project: https://github.com/jrajav/esprima-walk
// Definitions by: tswaters <https://github.com/tswaters>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import * as ESTree from "estree";
type NodeWithParent = ESTree.Node & { parent?: ESTree.Node };
/**
* Walk the provided AST; fn is called once for each node with a `type`
* @param {ESTree.Program} ast program to walk
* @param {function} fn function invoked for each node with type
*/
declare function walk (ast: ESTree.Program, fn:(node: ESTree.Node)=>void) :void
declare namespace walk {
/**
* Walk the provided AST; fn is called once for each node with a `type`
* @param {ESTree.Program} ast program to walk
* @param {function} fn function invoked for each node
*/
export function walk (ast: ESTree.Program, fn:(node: ESTree.Node)=>void) :void
/**
* Walk the provided AST; fn is called once for each node with a `type`.
* Adds a parent property prior to invoking fn when applicable
* @param {ESTree.Program} ast program to walk
* @param {function} fn function invoked for each node
*/
export function walkAddParent (ast: ESTree.Program, fn:(node: NodeWithParent)=>void) :void
}
export = walk

View File

@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"esprima-walk-tests.ts"
]
}

View File

@ -3,7 +3,7 @@
// Definitions by: TeamworkGuy2 <https://github.com/TeamworkGuy2>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../through/through.d.ts" />
/// <reference types="through" />
declare module 'exorcist' {
import through = require("through");

19
exorcist/tsconfig.json Normal file
View File

@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"exorcist.d.ts",
"exorcist-tests.ts"
]
}

View File

@ -3,7 +3,7 @@
// Definitions by: Hookclaw <https://github.com/hookclaw>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../express/express.d.ts" />
/// <reference types="express" />
declare module "express-domain-middleware" {
import express = require('express');

View File

@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"express-domain-middleware.d.ts",
"express-domain-middleware-tests.ts"
]
}

View File

@ -1,5 +1,3 @@
/// <reference path="file-type.d.ts" />
"use strict";
import fileType = require("file-type")

View File

@ -3,15 +3,13 @@
// Definitions by: KIM Jaesuck a.k.a. gim tcaesvk <http://github.com/tcaesvk/>
// Definitions: https://github.com/DefinitelyType/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
/// <reference types="node" />
declare module "file-type" {
interface FileTypeResult {
ext: string
mime: string
}
function FileType(buf: Buffer): FileTypeResult
export = FileType
interface FileTypeResult {
ext: string
mime: string
}
declare function FileType(buf: Buffer): FileTypeResult
export = FileType

19
file-type/tsconfig.json Normal file
View File

@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"file-type-tests.ts"
]
}

View File

@ -3,7 +3,7 @@
// Definitions by: Seth Westphal <https://github.com/westy92>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
/// <reference types="node" />
declare module 'fill-pdf' {

19
fill-pdf/tsconfig.json Normal file
View File

@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"fill-pdf.d.ts",
"fill-pdf-tests.ts"
]
}

View File

@ -3,7 +3,7 @@
// Definitions by: KIM Jaesuck a.k.a. gim tcaesvk <http://github.com/tcaesvk/>
// Definitions: https://github.com/DefinitelyType/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
/// <reference types="node" />
declare module "fluent-ffmpeg" {
import * as events from "events"

View File

@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"fluent-ffmpeg.d.ts",
"fluent-ffmpeg-tests.ts"
]
}

View File

@ -3,215 +3,215 @@
// Definitions by: Andrew Roberts <http://www.atroberts.org>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts" />
/// <reference types="jquery" />
interface FullPageJsOptions {
/**
* (default false) A selector can be used to specify the menu to link with the sections. This way the scrolling of the sections will activate the corresponding element in the menu using the class active. This won't generate a menu but will just add the active class to the element in the given menu with the corresponding anchor links. In order to link the elements of the menu with the sections, an HTML 5 data-tag (data-menuanchor) will be needed to use with the same anchor links as used within the sections.
*/
menu?: string;
/**
* (default false). Determines whether anchors in the URL will have any effect at all in the plugin. You can still using anchors internally for your own functions and callbacks, but they won't have any effect in the scrolling of the site. Useful if you want to combine fullPage.js with other plugins using anchor in the URL.
*/
lockAnchors?: boolean;
/**
* (default []) Defines the anchor links (#example) to be shown on the URL for each section. Anchors value should be unique. The position of the anchors in the array will define to which sections the anchor is applied. (second position for second section and so on). Using anchors forward and backward navigation will also be possible through the browser. This option also allows users to bookmark a specific section or slide. Be careful! anchors can not have the same value as any ID element on the site (or NAME element for IE). Now anchors can be defined directly in the HTML structure by using the attribute data-anchor as explained here.
*/
anchors?: string[];
/**
* (default false) If set to true, it will show a navigation bar made up of small circles.
*/
navigation?: boolean;
/**
* (default none) It can be set to left or right and defines which position the navigation bar will be shown (if using one).
*/
navigationPosition?: string;
/**
* (default []) Defines the tooltips to show for the navigation circles in case they are being used. Example: navigationTooltips: ['firstSlide', 'secondSlide'].
*/
navigationTooltips?: string[];
/**
* (default false) Shows a persistent tooltip for the actively viewed section in the vertical navigation.
*/
showActiveTooltip?: boolean;
/**
* (default false) If set to true it will show a navigation bar made up of small circles for each landscape slider on the site.
*/
slidesNavigation?: boolean;
/**
* (default bottom) Defines the position for the landscape navigation bar for sliders. Admits top and bottom as values. You may want to modify the CSS styles to determine the distance from the top or bottom as well as any other style such as color.
*/
slidesNavPosition?: string;
// Scrolling
// Scrolling
/**
* (default true). Defines whether to use JavaScript or CSS3 transforms to scroll within sections and slides. Useful to speed up the movement in tablet and mobile devices with browsers supporting CSS3. If this option is set to true and the browser doesn't support CSS3, a jQuery fallback will be used instead.
*/
css3?: boolean;
/**
* (default 700) Speed in milliseconds for the scrolling transitions.
*/
scrollingSpeed?: number;
/**
* (default true) Defines whether to use the "automatic" scrolling or the "normal" one. It also has affects the way the sections fit in the browser/device window in tablets and mobile phones.
*/
autoScrolling?: boolean;
/**
* (default true). Determines whether or not to fit sections to the viewport or not. When set to true the current active section will always fill the whole viewport. Otherwise the user will be free to stop in the middle of a section (when )
*/
fitToSection?: boolean;
/**
* (default 1000). If fitToSection is set to true, this delays the fitting by the configured milliseconds.
*/
fitToSectionDelay?: number;
/**
* (default false). Determines whether to use scrollbar for the site or not. In case of using scroll bar, the autoScrolling functionality will still working as expected. The user will also be free to scroll the site with the scroll bar and fullPage.js will fit the section in the screen when scrolling finishes.
*/
scrollBar?: boolean;
/**
* (default easeInOutCubic) Defines the transition effect to use for the vertical and horizontal scrolling. It requires the file vendors/jquery.easings.min.js or jQuery UI for using some of its transitions. Other libraries could be used instead.
*/
easing?: string;
/**
* (default ease) Defines the transition effect to use in case of using css3:true. You can use the pre-defined ones (such as linear, ease-out...) or create your own ones using the cubic-bezier function. You might want to use Matthew Lein CSS Easing Animation Tool for it.
*/
easingcss3?: string;
/**
* (default false) Defines whether scrolling down in the last section should scroll to the first one or not.
*/
loopBottom?: boolean;
/**
* (default false) Defines whether scrolling up in the first section should scroll to the last one or not.
*/
loopTop?: boolean;
/**
* (default true) Defines whether horizontal sliders will loop after reaching the last or previous slide or not.
*/
loopHorizontal?: boolean;
/**
* (default false) Defines whether scrolling down in the last section should scroll down to the first one or not, and if scrolling up in the first section should scroll up to the last one or not. Not compatible with loopTop or loopBottom.
*/
continuousVertical?: boolean;
/**
* (default null) If you want to avoid the auto scroll when scrolling over some elements, this is the option you need to use. (useful for maps, scrolling divs etc.) It requires a string with the jQuery selectors for those elements. (For example: normalScrollElements: '#element1, .element2')
*/
normalScrollElements?: string;
/**
* (default false) defines whether or not to create a scroll for the section/slide in case its content is bigger than the height of it. When set to true, your content will be wrapped by the plugin. Consider using delegation or load your other scripts in the afterRender callback. In case of setting it to true, it requires the vendor library scrolloverflow.min.js and it should be loaded before the fullPage.js plugin.
*/
scrollOverflow?: boolean;
/**
* when using scrollOverflow:true fullpage.js will make use of a forked and modified version of iScroll.js libary. You can customize the scrolling behaviour by providing fullpage.js with the iScroll.js options you want to use. Check its documentation for more info.
*/
scrollOverflowOptions?: any;
/**
* (default 5) Defines a percentage of the browsers window width/height, and how far a swipe must measure for navigating to the next section / slide
*/
touchSensitivity?: number;
/**
* (default 5) Defines the threshold for the number of hops up the html node tree Fullpage will test to see if normalScrollElements is a match to allow scrolling functionality on divs on a touch device. (For example: normalScrollElementTouchThreshold: 3)
*/
normalScrollElementTouchThreshold?: number;
// Accessibility
/**
* (default true) Defines if the content can be navigated using the keyboard
*/
keyboardScrolling?: boolean;
/**
* (default true) Defines whether the load of the site when given an anchor (#) will scroll with animation to its destination or will directly load on the given section.
*/
animateAnchor?: boolean;
/**
* (default true) Defines whether to push the state of the site to the browser's history. When set to true each section/slide of the site will act as a new page and the back and forward buttons of the browser will scroll the sections/slides to reach the previous or next state of the site. When set to false, the URL will keep changing but will have no effect ont he browser's history. This option is automatically turned off when using autoScrolling:false.
*/
recordHistory?: boolean;
// Design
// Design
/**
* (default: true) Determines whether to use control arrows for the slides to move right or left.
*/
controlArrows?: boolean;
/**
* (default true) Vertically centering of the content within sections. When set to true, your content will be wrapped by the plugin. Consider using delegation or load your other scripts in the afterRender callback.
*/
verticalCentered?: boolean;
resize ?: boolean;
/**
* (default none) Define the CSS background-color property for each section
*/
sectionsColor ?: string[];
/**
* (default 0) Defines the top padding for each section with a numerical value and its measure (paddingTop: '10px', paddingTop: '10em'...) Useful in case of using a fixed header.
*/
paddingTop?: string;
/**
* (default 0) Defines the bottom padding for each section with a numerical value and its measure (paddingBottom: '10px', paddingBottom: '10em'...). Useful in case of using a fixed footer.
*/
paddingBottom?: string;
/**
* (default null) Defines which elements will be taken off the scrolling structure of the plugin which is necessary when using the css3 option to keep them fixed. It requires a string with the jQuery selectors for those elements. (For example: fixedElements: '#element1, .element2')
*/
fixedElements?: string;
/**
* (default 0) A normal scroll (autoScrolling:false) will be used under the defined width in pixels. A class fp-responsive is added to the body tag in case the user wants to use it for his own responsive CSS. For example, if set to 900, whenever the browser's width is less than 900 the plugin will scroll like a normal site.
*/
responsiveWidth?: number;
/**
* (default 0) A normal scroll (autoScrolling:false) will be used under the defined height in pixels. A class fp-responsive is added to the body tag in case the user wants to use it for his own responsive CSS. For example, if set to 900, whenever the browser's height is less than 900 the plugin will scroll like a normal site.
*/
responsiveHeight?: number;
// Custom selectors
/**
* (default .section) Defines the jQuery selector used for the plugin sections. It might need to be changed sometimes to avoid problem with other plugins using the same selectors as fullpage.js.
*/
sectionSelector?: string;
/**
* (default .slide) Defines the jQuery selector used for the plugin slides. It might need to be changed sometimes to avoid problem with other plugins using the same selectors as fullpage.js.
*/
slideSelector?: string;
// Events
// Events
/**
* This callback is fired once the user leaves a section, in the transition to the new section. Returning false will cancel the move before it takes place.
* @param index index of the leaving section. Starting from 1.
@ -219,29 +219,29 @@ interface FullPageJsOptions {
* @param direction it will take the values up or down depending on the scrolling direction.
*/
onLeave?: (index: number, nextIndex: number, direction: string) => void;
/**
* Callback fired once the sections have been loaded, after the scrolling has ended.
* @param anchorLink anchorLink corresponding to the section.
* @param index index of the section. Starting from 1.
*/
afterLoad?: (anchorLink: string, index: number) => void;
/**
* This callback is fired just after the structure of the page is generated. This is the callback you want to use to initialize other plugins or fire any code which requires the document to be ready (as this plugin modifies the DOM to create the resulting structure).
*/
afterRender?: () => void;
/**
* This callback is fired after resizing the browser's window. Just after the sections are resized.
*/
afterResize?: () => void;
/**
* Callback fired once the slide of a section have been loaded, after the scrolling has ended.
*
*
* In case of not having anchorLinks defined for the slide or slides the slideIndex parameter would be the only one to use.
*
*
* Parameters:
*
* @param anchorLink anchorLink corresponding to the section.
@ -250,7 +250,7 @@ interface FullPageJsOptions {
* @param slideIndex index of the slide. Starting from 1. (the default slide doesn't count as slide, but as a section)
*/
afterSlideLoad?: (anchorLink: string, index: number, slideAnchor: string, slideIndex: number) => void;
/**
* This callback is fired once the user leaves an slide to go to another, in the transition to the new slide. Returning false will cancel the move before it takes place.
* @param anchorLink: anchorLink corresponding to the section.

19
fullpage.js/tsconfig.json Normal file
View File

@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"fullpage.js.d.ts",
"fullpage.js-tests.ts"
]
}

View File

@ -1,6 +1,3 @@
/// <reference path="geojson2osm.d.ts" />
/// <reference path="../geojson/geojson.d.ts" />
import { geojson2osm } from 'geojson2osm'
const features: GeoJSON.FeatureCollection<any> = {

View File

@ -1,15 +0,0 @@
// Type definitions for geojson2osm 0.0.5
// Project: https://github.com/Rub21/geojson2osm
// Definitions by: Denis Carriere <https://github.com/DenisCarriere>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../geojson/geojson.d.ts" />
declare module 'geojson2osm' {
/**
* Converts GeoJSON features to OpenStreetMap XML.
* @param features Input features
* @returns OpenStreetMap XML
*/
export function geojson2osm(features: GeoJSON.Feature<any> | GeoJSON.FeatureCollection<any>): any
}

13
geojson2osm/index.d.ts vendored Normal file
View File

@ -0,0 +1,13 @@
// Type definitions for geojson2osm 0.0.5
// Project: https://github.com/Rub21/geojson2osm
// Definitions by: Denis Carriere <https://github.com/DenisCarriere>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="geojson"/>
/**
* Converts GeoJSON features to OpenStreetMap XML.
* @param features Input features
* @returns OpenStreetMap XML
*/
export function geojson2osm(features: GeoJSON.Feature<any> | GeoJSON.FeatureCollection<any>): any

19
geojson2osm/tsconfig.json Normal file
View File

@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"geojson2osm-tests.ts"
]
}

View File

@ -1,12 +1,11 @@
///<reference path="globalize-compiler.d.ts" />
import globalizeCompiler = require("globalize-compiler");
import * as ESTree from "estree";
import * as globalizeCompiler from "globalize-compiler";
const globalize: GlobalizeStatic = null;
let extractsArray: GlobalizeCompiler.FormatterOrParserFunction[];
let extractsArray: globalizeCompiler.FormatterOrParserFunction[];
const templateFunction: (options: GlobalizeCompiler.CompileTemplateOptions) => string =
(options: GlobalizeCompiler.CompileTemplateOptions): string => {
const templateFunction: (options: globalizeCompiler.CompileTemplateOptions) => string =
(options: globalizeCompiler.CompileTemplateOptions): string => {
const deps: string[] = options.dependencies;
const code: string = options.code;
return `${deps.join(';')}${code}`;
@ -18,7 +17,7 @@ compileOutput = globalizeCompiler.compile({ x: () => "test", y: (x: string) => x
compileOutput = globalizeCompiler.compile(extractsArray, { template: templateFunction });
compileOutput = globalizeCompiler.compile({ x: () => "test", y: (x: string) => x }, { template: templateFunction });
let extractOutput: GlobalizeCompiler.ExtractFunction;
let extractOutput: globalizeCompiler.ExtractFunction;
extractOutput = globalizeCompiler.extract("path");
const ast: ESTree.Program = undefined;

View File

@ -1,106 +0,0 @@
// Type definitions for globalize-compiler v0.2.0
// Project: https://github.com/jquery-support/globalize-compiler
// Definitions by: Ian Clanton-Thuon <https://github.com/iclanton>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="./../globalize/globalize.d.ts" />
/// <reference path="../estree/estree.d.ts" />
declare namespace GlobalizeCompiler {
interface CompileTemplateOptions {
/**
* the source of the compiled formatters and parsers.
*/
code: string;
/**
* a list of globalize runtime modules that the compiled code depends on, e.g. globalize-runtime/number.
*/
dependencies: string[];
}
interface CompileOptions {
/**
* A function that replaces the default template.
*/
template?: (options: CompileTemplateOptions) => string;
}
interface FormatterOrParserFunction {
(...arguments: any[]): any;
}
interface ExtractFunction {
/**
* @param {globalize} the globalize object.
*
* @returns an Array with the formatters and parsers created using the passed Globalize.
*/
(globalize: GlobalizeStatic): FormatterOrParserFunction[];
}
interface CompileExtractsAttributes extends CompileOptions {
/**
* an Array of extracts obtained by @see{GlobalizeCompilerStatic.extract}
*/
extracts: ExtractFunction;
/**
* a locale to be used as Globalize.locale(defaultLocale) when generating the extracted formatters and parsers.
*/
defaultLocale: string;
/**
* an Object with CLDR data (in the JSON format) or a Function taking one argument: locale, a String; returning
* an Object with the CLDR data for the passed locale. Defaults to the entire supplemental data plus the entire
* main data for the defaultLocale.
*/
cldr?: Object | ((locale: string) => Object);
/**
* an Object with messages data (in the JSON format) or a Function taking one argument: locale, a String; returning
* an Object with the messages data for the passed locale. Defaults to {}.
*/
messages?: Object | ((locale: string) => Object);
}
interface GlobalizeCompilerStatic {
/**
* Generates a JavaScript bundle containing the specified globalize formatters and parsers.
*
* @param {formattersAndParsers} an Array or an Object containing formatters and/or parsers.
* @param {options} compiler options.
*
* @returns a String with the generated JavaScript bundle (UMD wrapped) including the compiled formatters and
* parsers.
*/
compile(formattersAndParsers: FormatterOrParserFunction[] | { [key: string]: FormatterOrParserFunction },
options?: CompileOptions): string;
/**
* Creates an extract function from a source file.
*
* @param {input} a String with a filename, or a String with the file content, or an AST Object.
*
* @returns an extract. An extract is a Function taking one argument: Globalize, the Globalize Object;
* and returning an Array with the formatters and parsers created using the passed Globalize.
*/
extract(input: string | ESTree.Program): ExtractFunction;
/**
* Generates a JavaScript bundle containing the specified globalize formatters and parsers.
*
* @param {options} compiler attributes.
*
* @returns a String with the generated JavaScript bundle (UMD wrapped) including the compiled formatters and
* parsers.
*/
compileExtracts(attributes: CompileExtractsAttributes): string;
}
}
declare module "globalize-compiler" {
var globalizeCompiler: GlobalizeCompiler.GlobalizeCompilerStatic;
export = globalizeCompiler;
}

96
globalize-compiler/index.d.ts vendored Normal file
View File

@ -0,0 +1,96 @@
// Type definitions for globalize-compiler v0.2.0
// Project: https://github.com/jquery-support/globalize-compiler
// Definitions by: Ian Clanton-Thuon <https://github.com/iclanton>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="globalize" />
import * as ESTree from "estree";
interface CompileTemplateOptions {
/**
* the source of the compiled formatters and parsers.
*/
code: string;
/**
* a list of globalize runtime modules that the compiled code depends on, e.g. globalize-runtime/number.
*/
dependencies: string[];
}
interface CompileOptions {
/**
* A function that replaces the default template.
*/
template?: (options: CompileTemplateOptions) => string;
}
interface FormatterOrParserFunction {
(...args: any[]): any;
}
interface ExtractFunction {
/**
* @param {globalize} the globalize object.
*
* @returns an Array with the formatters and parsers created using the passed Globalize.
*/
(globalize: GlobalizeStatic): FormatterOrParserFunction[];
}
interface CompileExtractsAttributes extends CompileOptions {
/**
* an Array of extracts obtained by @see{GlobalizeCompilerStatic.extract}
*/
extracts: ExtractFunction;
/**
* a locale to be used as Globalize.locale(defaultLocale) when generating the extracted formatters and parsers.
*/
defaultLocale: string;
/**
* an Object with CLDR data (in the JSON format) or a Function taking one argument: locale, a String; returning
* an Object with the CLDR data for the passed locale. Defaults to the entire supplemental data plus the entire
* main data for the defaultLocale.
*/
cldr?: Object | ((locale: string) => Object);
/**
* an Object with messages data (in the JSON format) or a Function taking one argument: locale, a String; returning
* an Object with the messages data for the passed locale. Defaults to {}.
*/
messages?: Object | ((locale: string) => Object);
}
/**
* Generates a JavaScript bundle containing the specified globalize formatters and parsers.
*
* @param {formattersAndParsers} an Array or an Object containing formatters and/or parsers.
* @param {options} compiler options.
*
* @returns a String with the generated JavaScript bundle (UMD wrapped) including the compiled formatters and
* parsers.
*/
export function compile(formattersAndParsers: FormatterOrParserFunction[] | { [key: string]: FormatterOrParserFunction },
options?: CompileOptions): string;
/**
* Creates an extract function from a source file.
*
* @param {input} a String with a filename, or a String with the file content, or an AST Object.
*
* @returns an extract. An extract is a Function taking one argument: Globalize, the Globalize Object;
* and returning an Array with the formatters and parsers created using the passed Globalize.
*/
export function extract(input: string | ESTree.Program): ExtractFunction;
/**
* Generates a JavaScript bundle containing the specified globalize formatters and parsers.
*
* @param {options} compiler attributes.
*
* @returns a String with the generated JavaScript bundle (UMD wrapped) including the compiled formatters and
* parsers.
*/
export function compileExtracts(attributes: CompileExtractsAttributes): string;

View File

@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"globalize-compiler-tests.ts"
]
}

View File

@ -1,6 +1,3 @@
/// <reference path="../gulp/gulp.d.ts"/>
/// <reference path="../gulp-angular-templatecache/gulp-angular-templatecache.d.ts"/>
import * as gulp from 'gulp';
import * as templateCache from 'gulp-angular-templatecache';

View File

@ -3,7 +3,7 @@
// Definitions by: Aman Mahajan <https://github.com/amanmahajan7>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../node/node.d.ts"/>
/// <reference types="node"/>
declare module "gulp-angular-templatecache" {
function templatecache(): NodeJS.ReadWriteStream;

View File

@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"gulp-angular-templatecache.d.ts",
"gulp-angular-templatecache-tests.ts"
]
}

View File

@ -1,7 +1,3 @@
/// <reference path="gulp-help-doc.d.ts" />
/// <reference path="../node/node.d.ts" />
/// <reference path="../gulp/gulp.d.ts" />
import gulp = require('gulp');
import usage = require('gulp-help-doc');

View File

@ -3,8 +3,8 @@
// Definitions by: Mikhus <https://github.com/Mikhus>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
/// <reference path="../gulp/gulp.d.ts" />
/// <reference types="node" />
/// <reference types="gulp" />
declare module "gulp-help-doc" {

View File

@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"gulp-help-doc.d.ts",
"gulp-help-doc-tests.ts"
]
}

View File

@ -1,6 +1,3 @@
///<reference path="gulp-insert.d.ts" />
///<reference path="../gulp/gulp.d.ts" />
import * as gulp from 'gulp';
import * as insert from 'gulp-insert';

View File

@ -3,8 +3,8 @@
// Definitions by: Shant Marouti <https://github.com/shantmarouti>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../node/node.d.ts"/>
/// <reference path="../vinyl/vinyl.d.ts"/>
/// <reference types="node"/>
/// <reference types="vinyl"/>
declare module 'gulp-insert' {

19
gulp-insert/tsconfig.json Normal file
View File

@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"gulp-insert.d.ts",
"gulp-insert-tests.ts"
]
}

1
gulp/index.d.ts vendored
View File

@ -8,6 +8,7 @@
import Orchestrator = require("orchestrator");
import VinylFile = require("vinyl");
declare namespace gulp {
interface Gulp extends Orchestrator {

View File

@ -1,6 +1,3 @@
/// <reference path='html-pdf.d.ts' />
/// <reference path='../node/node.d.ts' />
import * as fs from 'fs';
import * as pdf from 'html-pdf';

View File

@ -3,7 +3,7 @@
// Definitions by: Seth Westphal <https://github.com/westy92>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path='../node/node.d.ts' />
/// <reference types="node" />
declare module 'html-pdf' {

19
html-pdf/tsconfig.json Normal file
View File

@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"html-pdf.d.ts",
"html-pdf-tests.ts"
]
}

View File

@ -3,7 +3,7 @@
// Definitions by: Simon Hartcher <http://github.com/deevus>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
///<reference path="../webpack/webpack.d.ts" />
///<reference types="webpack" />
declare module "html-webpack-plugin" {
import {Plugin} from "webpack";

View File

@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"html-webpack-plugin.d.ts",
"html-webpack-plugin-tests.ts"
]
}

View File

@ -1,6 +1,3 @@
///<reference path="./imagemapster.d.ts" />
///<reference path="../jquery/jquery.d.ts" />
const areaOptions: ImageMapster.AreaRenderingOptions = {
key: "foo",
includeKeys: "foo",

View File

@ -3,7 +3,7 @@
// Definitions by: delphinus <https://github.com/delphinus35/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
///<reference path="../jquery/jquery.d.ts" />
///<reference types="jquery" />
declare namespace ImageMapster {

View File

@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"imagemapster.d.ts",
"imagemapster-tests.ts"
]
}

View File

@ -1,6 +1,3 @@
/// <reference path="../jquery/jquery.d.ts" />
/// <reference path="intl-tel-input.d.ts" />
$('#phone').intlTelInput();
$('#phone').intlTelInput({

View File

@ -8,7 +8,7 @@
// https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/jquery/jquery.d.ts#L958
// fn: any; //TODO: Decide how we want to type this
/// <reference path="../jquery/jquery.d.ts" />
/// <reference types="jquery" />
declare namespace IntlTelInput {

View File

@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"intl-tel-input.d.ts",
"intl-tel-input-tests.ts"
]
}

47
inversify-binding-decorators/index.d.ts vendored Normal file
View File

@ -0,0 +1,47 @@
// Type definitions for inversify 1.0.0-beta.5
// Project: https://github.com/inversify/inversify-binding-decorators
// Definitions by: inversify <https://github.com/inversify/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
import inversify = require("inversify")
interface IProvideInSyntax<T> extends IProvideDoneSyntax<T> {
inSingletonScope(): IProvideWhenOnSyntax<T>;
}
interface IProvideDoneSyntax<T> {
done(): (target: any) => any;
}
interface IProvideOnSyntax<T> extends IProvideDoneSyntax<T> {
onActivation(fn: (context: inversify.interfaces.Context, injectable: T) => T): IProvideWhenSyntax<T>;
}
interface IProvideInWhenOnSyntax<T> extends IProvideInSyntax<T>, IProvideWhenSyntax<T>, IProvideOnSyntax<T> {}
interface IProvideWhenOnSyntax<T> extends IProvideWhenSyntax<T>, IProvideOnSyntax<T> {}
interface IProvideWhenSyntax<T> extends IProvideDoneSyntax<T> {
when(constraint: (request: inversify.interfaces.Request) => boolean): IProvideOnSyntax<T>;
whenTargetNamed(name: string): IProvideOnSyntax<T>;
whenTargetTagged(tag: string, value: any): IProvideOnSyntax<T>;
whenInjectedInto(parent: (Function|string)): IProvideOnSyntax<T>;
whenParentNamed(name: string): IProvideOnSyntax<T>;
whenParentTagged(tag: string, value: any): IProvideOnSyntax<T>;
whenAnyAncestorIs(ancestor: (Function|string)): IProvideOnSyntax<T>;
whenNoAncestorIs(ancestor: (Function|string)): IProvideOnSyntax<T>;
whenAnyAncestorNamed(name: string): IProvideOnSyntax<T>;
whenAnyAncestorTagged(tag: string, value: any): IProvideOnSyntax<T>;
whenNoAncestorNamed(name: string): IProvideOnSyntax<T>;
whenNoAncestorTagged(tag: string, value: any): IProvideOnSyntax<T>;
whenAnyAncestorMatches(constraint: (request: inversify.interfaces.Request) => boolean): IProvideOnSyntax<T>;
whenNoAncestorMatches(constraint: (request: inversify.interfaces.Request) => boolean): IProvideOnSyntax<T>;
}
export function autoProvide(kernel: inversify.interfaces.Kernel, ...modules: any[]): void;
export function makeProvideDecorator(kernel: inversify.interfaces.Kernel):
(serviceIdentifier: (string|Symbol|inversify.interfaces.Newable<any>)) => (target: any) => any;
export function makeFluentProvideDecorator(kernel: inversify.interfaces.Kernel):
(serviceIdentifier: (string|Symbol|inversify.interfaces.Newable<any>)) => IProvideInWhenOnSyntax<any>;

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