diff --git a/3d-bin-packing/3d-bin-packing-tests.ts b/3d-bin-packing/3d-bin-packing-tests.ts
index 4562c26ce9..319624d597 100644
--- a/3d-bin-packing/3d-bin-packing-tests.ts
+++ b/3d-bin-packing/3d-bin-packing-tests.ts
@@ -1,5 +1,3 @@
-///
-
import packer = require("3d-bin-packing");
import samchon = require("samchon-framework");
diff --git a/3d-bin-packing/3d-bin-packing.d.ts b/3d-bin-packing/3d-bin-packing.d.ts
index afd3af6050..2461538194 100644
--- a/3d-bin-packing/3d-bin-packing.d.ts
+++ b/3d-bin-packing/3d-bin-packing.d.ts
@@ -3,11 +3,11 @@
// Definitions by: Jeongho Nam
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-///
-///
-///
-///
-///
+///
+///
+///
+///
+///
declare module "3d-bin-packing"
{
diff --git a/3d-bin-packing/tsconfig.json b/3d-bin-packing/tsconfig.json
new file mode 100644
index 0000000000..ddad71a1fe
--- /dev/null
+++ b/3d-bin-packing/tsconfig.json
@@ -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"
+ ]
+}
\ No newline at end of file
diff --git a/angular-q-spread/angular-q-spread-tests.ts b/angular-q-spread/angular-q-spread-tests.ts
index 932ecc4fa9..31fad81acd 100644
--- a/angular-q-spread/angular-q-spread-tests.ts
+++ b/angular-q-spread/angular-q-spread-tests.ts
@@ -1,5 +1,3 @@
-///
-
interface IMyService {
getFirstname(): ng.IPromise;
getLastname(): ng.IPromise;
diff --git a/angular-q-spread/angular-q-spread.d.ts b/angular-q-spread/angular-q-spread.d.ts
index 3eb37dc4e0..57f6327071 100644
--- a/angular-q-spread/angular-q-spread.d.ts
+++ b/angular-q-spread/angular-q-spread.d.ts
@@ -3,9 +3,9 @@
// Definitions by: rafw87
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-///
+import * as a from "angular";
-declare module angular {
+declare module "angular" {
interface IPromise {
/**
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.
diff --git a/angular-q-spread/tsconfig.json b/angular-q-spread/tsconfig.json
new file mode 100644
index 0000000000..90110b0e9f
--- /dev/null
+++ b/angular-q-spread/tsconfig.json
@@ -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
+ }
+}
\ No newline at end of file
diff --git a/angular-websocket/angular-websocket.d.ts b/angular-websocket/angular-websocket.d.ts
index 6929561f9c..9c2c93ea09 100644
--- a/angular-websocket/angular-websocket.d.ts
+++ b/angular-websocket/angular-websocket.d.ts
@@ -3,155 +3,157 @@
// Definitions by: Nick Veys
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-///
+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;
- }
+ /** 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;
+ }
- /**
- * 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;
+ /**
+ * 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;
- /**
- * 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;
+ }
}
}
diff --git a/angular-websocket/tsconfig.json b/angular-websocket/tsconfig.json
new file mode 100644
index 0000000000..7579a1591c
--- /dev/null
+++ b/angular-websocket/tsconfig.json
@@ -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
+ }
+}
\ No newline at end of file
diff --git a/angular-xeditable/angular-xeditable.d.ts b/angular-xeditable/angular-xeditable.d.ts
index 026fc5d2fb..e0aba2a0e9 100644
--- a/angular-xeditable/angular-xeditable.d.ts
+++ b/angular-xeditable/angular-xeditable.d.ts
@@ -3,96 +3,96 @@
// Definitions by: Joao Monteiro
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-///
+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`.
+ * 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`.
- * 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;
-
- }
-
}
diff --git a/angular-xeditable/tsconfig.json b/angular-xeditable/tsconfig.json
new file mode 100644
index 0000000000..e9a9c10c51
--- /dev/null
+++ b/angular-xeditable/tsconfig.json
@@ -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
+ }
+}
\ No newline at end of file
diff --git a/backbone-fetch-cache/backbone-fetch-cache-tests.ts b/backbone-fetch-cache/backbone-fetch-cache-tests.ts
index e2eb532690..072e3c29ce 100644
--- a/backbone-fetch-cache/backbone-fetch-cache-tests.ts
+++ b/backbone-fetch-cache/backbone-fetch-cache-tests.ts
@@ -1,6 +1,5 @@
-///
-
-import * as Backbone from "backbone-fetch-cache";
+import * as Backbone from "backbone";
+import * as BackboneFetchCache from "backbone-fetch-cache";
// static methods / properties
diff --git a/backbone-fetch-cache/backbone-fetch-cache.d.ts b/backbone-fetch-cache/backbone-fetch-cache.d.ts
deleted file mode 100644
index 449db1c667..0000000000
--- a/backbone-fetch-cache/backbone-fetch-cache.d.ts
+++ /dev/null
@@ -1,189 +0,0 @@
-// Type definitions for backbone-fetch-cache 1.4.0
-// Project: https://github.com/madglory/backbone-fetch-cache
-// Definitions by: delphinus
-// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-
-///
-
-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: 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 {
-
- fetch(options?: CollectionFetchWithCacheOptions): JQueryXHR;
- }
-}
-
-declare module "backbone-fetch-cache" {
-
- export = Backbone;
-}
diff --git a/backbone-fetch-cache/index.d.ts b/backbone-fetch-cache/index.d.ts
new file mode 100644
index 0000000000..0067bb4443
--- /dev/null
+++ b/backbone-fetch-cache/index.d.ts
@@ -0,0 +1,183 @@
+// Type definitions for backbone-fetch-cache 1.4.0
+// Project: https://github.com/madglory/backbone-fetch-cache
+// Definitions by: delphinus
+// 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: 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 {
+
+ fetch(options?: CollectionFetchWithCacheOptions): JQueryXHR;
+ }
+}
+
+export as namespace BackboneFetchCache;
diff --git a/backbone-fetch-cache/tsconfig.json b/backbone-fetch-cache/tsconfig.json
new file mode 100644
index 0000000000..563a475286
--- /dev/null
+++ b/backbone-fetch-cache/tsconfig.json
@@ -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"
+ ]
+}
\ No newline at end of file
diff --git a/backbone/index.d.ts b/backbone/index.d.ts
index f1203c0967..975d7f33c9 100644
--- a/backbone/index.d.ts
+++ b/backbone/index.d.ts
@@ -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 {
diff --git a/backlog-js/backlog-js-tests.ts b/backlog-js/backlog-js-tests.ts
index 979eb57ca4..8a3e47fbb1 100644
--- a/backlog-js/backlog-js-tests.ts
+++ b/backlog-js/backlog-js-tests.ts
@@ -1,5 +1,3 @@
-///
-
import * as backlogjs from 'backlog-js';
const host = 'example.backlog.jp';
diff --git a/backlog-js/backlog-js.d.ts b/backlog-js/backlog-js.d.ts
deleted file mode 100644
index 353e7e90cd..0000000000
--- a/backlog-js/backlog-js.d.ts
+++ /dev/null
@@ -1,695 +0,0 @@
-// Type definitions for backlog-js 0.9.0
-// Project: https://github.com/nulab/backlog-js
-// Definitions by: Yuichi Watanabe
-// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-
-///
-///
-///
-
-declare module 'backlog-js' {
-
- class Request {
- private configure;
- constructor(configure: {
- host: string;
- apiKey?: string;
- accessToken?: string;
- timeout?: number;
- });
- get(path: string, params?: any): Promise;
- post(path: string, params?: any): Promise;
- put(path: string, params: any): Promise;
- patch(path: string, params: any): Promise;
- delete(path: string, params?: any): Promise;
- request(options: {
- method: string;
- path: string;
- params?: Params | FormData;
- }): Promise;
- checkStatus(response: IResponse): Promise;
- parseJSON(response: IResponse): Promise;
- 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;
- getSpaceActivities(params: Option.Space.GetActivitiesParams): Promise;
- getSpaceNotification(): Promise;
- putSpaceNotification(params: Option.Space.PutSpaceNotificationParams): Promise;
- getSpaceDiskUsage(): Promise;
- getSpaceIcon(): Promise;
- postSpaceAttachment(form: FormData): Promise;
- getUsers(): Promise;
- getUser(userId: number): Promise;
- postUser(params: Option.User.PostUserParams): Promise;
- patchUser(userId: number, params: Option.User.PatchUserParams): Promise;
- deleteUser(userId: number): Promise;
- getMyself(): Promise;
- getUserActivities(userId: number, params: Option.User.GetUserActivitiesParams): Promise;
- getUserStars(userId: number, params: Option.User.GetUserStarsParams): Promise;
- getUserStarsCount(userId: number, params: Option.User.GetUserStarsCountParams): Promise;
- getRecentlyViewedIssues(params: Option.User.GetRecentlyViewedParams): Promise;
- getRecentlyViewedProjects(params: Option.User.GetRecentlyViewedParams): Promise;
- getRecentlyViewedWikis(params: Option.User.GetRecentlyViewedParams): Promise;
- getUserIcon(userId: number): Promise;
- getGroups(params: Option.Group.GetGroupsParams): Promise;
- postGroups(params: Option.Group.PostGroupsParams): Promise;
- getGroup(groupId: number): Promise;
- patchGroup(groupId: number, params: Option.Group.PatchGroupParams): Promise;
- deleteGroup(groupId: number): Promise;
- getStatuses(): Promise;
- getResolutions(): Promise;
- getPriorities(): Promise;
- postProject(params: Option.Project.PostProjectParams): Promise;
- getProjects(params?: Option.Project.GetProjectsParams): Promise;
- getProject(projectIdOrKey: string): Promise;
- patchProject(projectIdOrKey: string, params: Option.Project.PatchProjectParams): Promise;
- deleteProject(projectIdOrKey: string): Promise;
- getProjectActivities(projectIdOrKey: string, params: Option.Space.GetActivitiesParams): Promise;
- getProjectUsers(projectIdOrKey: string): Promise;
- deleteProjectUsers(projectIdOrKey: string, params: Option.Project.DeleteProjectUsersParams): Promise;
- postProjectAdministrators(projectIdOrKey: string, params: Option.Project.PostProjectAdministrators): Promise;
- getProjectAdministrators(projectIdOrKey: string): Promise;
- deleteProjectAdministrators(projectIdOrKey: string, params: Option.Project.DeleteProjectAdministrators): Promise;
- getIssueTypes(projectIdOrKey: string): Promise;
- postIssueType(projectIdOrKey: string, params: Option.Project.PostIssueTypeParams): Promise;
- patchIssueType(projectIdOrKey: string, id: number, params: Option.Project.PatchIssueTypeParams): Promise;
- deleteIssueType(projectIdOrKey: string, id: number, params: Option.Project.DeleteIssueTypeParams): Promise;
- getCategories(projectIdOrKey: string): Promise;
- postCategories(projectIdOrKey: string, params: Option.Project.PostCategoriesParams): Promise;
- patchCategories(projectIdOrKey: string, id: number, params: Option.Project.PatchCategoriesParams): Promise;
- deleteCategories(projectIdOrKey: string, id: number): Promise;
- getVersions(projectIdOrKey: string): Promise;
- postVersions(projectIdOrKey: string, params: Option.Project.PostVersionsParams): Promise;
- patchVersions(projectIdOrKey: string, id: number, params: Option.Project.PatchVersionsParams): Promise;
- deleteVersions(projectIdOrKey: string, id: number): Promise;
- getCustomFields(projectIdOrKey: string): Promise;
- postCustomField(projectIdOrKey: string, params: Option.Project.PostCustomFieldParams | Option.Project.PostCustomFieldWithNumericParams | Option.Project.PostCustomFieldWithDateParams | Option.Project.PostCustomFieldWithListParams): Promise;
- patchCustomField(projectIdOrKey: string, id: number, params: Option.Project.PatchCustomFieldParams | Option.Project.PatchCustomFieldWithNumericParams | Option.Project.PatchCustomFieldWithDateParams | Option.Project.PatchCustomFieldWithListParams): Promise;
- deleteCustomField(projectIdOrKey: string, id: number): Promise;
- postCustomFieldItem(projectIdOrKey: string, id: number, params: Option.Project.PostCustomFieldItemParams): Promise;
- patchCustomFieldItem(projectIdOrKey: string, id: number, itemId: number, params: Option.Project.PatchCustomFieldItemParams): Promise;
- deleteCustomFieldItem(projectIdOrKey: string, id: number, params: Option.Project.PostCustomFieldItemParams): Promise;
- getSharedFiles(projectIdOrKey: string, path: string, params: Option.Project.GetSharedFilesParams): Promise;
- getProjectsDiskUsage(projectIdOrKey: string): Promise;
- getWebhooks(projectIdOrKey: string): Promise;
- postWebhook(projectIdOrKey: string, params: Option.Project.PostWebhookParams): Promise;
- getWebhook(projectIdOrKey: string, webhookId: string): Promise;
- patchWebhook(projectIdOrKey: string, webhookId: string, params: Option.Project.PatchWebhookParams): Promise;
- deleteWebhook(projectIdOrKey: string, webhookId: string): Promise;
- postIssue(params: Option.Issue.PostIssueParams): Promise;
- patchIssue(issueIdOrKey: string, params: Option.Issue.PatchIssueParams): Promise;
- getIssues(params?: Option.Issue.GetIssuesParams): Promise;
- getIssue(issueIdOrKey: string): Promise;
- getIssuesCount(params?: Option.Issue.GetIssuesParams): Promise;
- deleteIssuesCount(issueIdOrKey: string): Promise;
- getIssueComments(issueIdOrKey: string, params: Option.Issue.GetIssueCommentsParams): Promise;
- postIssueComments(issueIdOrKey: string, params: Option.Issue.PostIssueCommentsParams): Promise;
- getIssueCommentsCount(issueIdOrKey: string): Promise;
- getIssueComment(issueIdOrKey: string, commentId: number): Promise;
- patchIssueComment(issueIdOrKey: string, commentId: number, params: Option.Issue.PatchIssueCommentParams): Promise;
- getIssueCommentNotifications(issueIdOrKey: string, commentId: number): Promise;
- postIssueCommentNotifications(issueIdOrKey: string, commentId: number, prams: Option.Issue.IssueCommentNotifications): Promise;
- getIssueAttachments(issueIdOrKey: string): Promise;
- deleteIssueAttachment(issueIdOrKey: string, attachmentId: string): Promise;
- getIssueSharedFiles(issueIdOrKey: string): Promise;
- linkIssueSharedFiles(issueIdOrKey: string, params: Option.Issue.LinkIssueSharedFilesParams): Promise;
- unlinkIssueSharedFile(issueIdOrKey: string, id: number): Promise;
- getWikis(projectIdOrKey: number): Promise;
- getWikisCount(projectIdOrKey: number): Promise;
- getWikisTags(projectIdOrKey: number): Promise;
- postWiki(params: Option.Wiki.PostWikiParams): Promise;
- getWiki(wikiId: number): Promise;
- patchWiki(wikiId: number, params: Option.Wiki.PatchWikiParams): Promise;
- deleteWiki(wikiId: number, mailNotify: boolean): Promise;
- getWikisAttachments(wikiId: number): Promise;
- postWikisAttachments(wikiId: number, attachmentId: number[]): Promise;
- deleteWikisAttachments(wikiId: number, attachmentId: number): Promise;
- getWikisSharedFiles(wikiId: number): Promise;
- linkWikisSharedFiles(wikiId: number, fileId: number[]): Promise;
- unlinkWikisSharedFiles(wikiId: number, id: number): Promise;
- getWikisHistory(wikiId: number, params: Option.Wiki.GetWikisHistoryParams): Promise;
- getWikisStars(wikiId: number): Promise;
- postStar(params: Option.Project.PostStarParams): Promise;
- getNotifications(params: Option.Notification.GetNotificationsParams): Promise;
- getNotificationsCount(params: Option.Notification.GetNotificationsCountParams): Promise;
- resetNotificationsMarkAsRead(): Promise;
- markAsReadNotification(id: number): Promise;
- getGitRepositories(projectIdOrKey: string): Promise;
- getGitRepository(projectIdOrKey: string, repoIdOrName: string): Promise;
- getPullRequests(projectIdOrKey: string, repoIdOrName: string, params: Option.PullRequest.GetPullRequestsParams): Promise;
- getPullRequestsCount(projectIdOrKey: string, repoIdOrName: string, params: Option.PullRequest.GetPullRequestsParams): Promise;
- postPullRequest(projectIdOrKey: string, repoIdOrName: string, params: Option.PullRequest.PostPullRequestParams): Promise;
- getPullRequest(projectIdOrKey: string, repoIdOrName: string, number: number): Promise;
- patchPullRequest(projectIdOrKey: string, repoIdOrName: string, number: number, params: Option.PullRequest.PatchPullRequestParams): Promise;
- getPullRequestComments(projectIdOrKey: string, repoIdOrName: string, number: number, params: Option.PullRequest.GetPullRequestCommentsParams): Promise;
- postPullRequestComments(projectIdOrKey: string, repoIdOrName: string, number: number, params: Option.PullRequest.PostPullRequestCommentsParams): Promise;
- getPullRequestCommentsCount(projectIdOrKey: string, repoIdOrName: string, number: number): Promise;
- patchPullRequestComments(projectIdOrKey: string, repoIdOrName: string, number: number, commentId: number, params: Option.PullRequest.PatchPullRequestCommentsParams): Promise;
- getPullRequestAttachments(projectIdOrKey: string, repoIdOrName: string, number: number): Promise;
- deletePullRequestAttachment(projectIdOrKey: string, repoIdOrName: string, number: number, attachmentId: number): Promise;
- getProjectIcon(projectIdOrKey: string): Promise;
- getSharedFile(projectIdOrKey: string, sharedFileId: number): Promise;
- getIssueAttachment(issueIdOrKey: string, attachmentId: number): Promise;
- getWikiAttachment(wikiId: number, attachmentId: number): Promise;
- getPullRequestAttachment(projectIdOrKey: string, repoIdOrName: string, number: number, attachmentId: number): Promise;
- 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;
- refreshAccessToken(options: {
- host: string;
- refreshToken: string;
- }): Promise;
- }
-
- 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;
- }
- }
- 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';
- }
-
-}
diff --git a/backlog-js/index.d.ts b/backlog-js/index.d.ts
new file mode 100644
index 0000000000..b15602f958
--- /dev/null
+++ b/backlog-js/index.d.ts
@@ -0,0 +1,690 @@
+// Type definitions for backlog-js 0.9.0
+// Project: https://github.com/nulab/backlog-js
+// Definitions by: Yuichi Watanabe
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+///
+///
+
+declare class Request {
+ private configure;
+ constructor(configure: {
+ host: string;
+ apiKey?: string;
+ accessToken?: string;
+ timeout?: number;
+ });
+ get(path: string, params?: any): Promise;
+ post(path: string, params?: any): Promise;
+ put(path: string, params: any): Promise;
+ patch(path: string, params: any): Promise;
+ delete(path: string, params?: any): Promise;
+ request(options: {
+ method: string;
+ path: string;
+ params?: Params | FormData;
+ }): Promise;
+ checkStatus(response: IResponse): Promise;
+ parseJSON(response: IResponse): Promise;
+ 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;
+ getSpaceActivities(params: Option.Space.GetActivitiesParams): Promise;
+ getSpaceNotification(): Promise;
+ putSpaceNotification(params: Option.Space.PutSpaceNotificationParams): Promise;
+ getSpaceDiskUsage(): Promise;
+ getSpaceIcon(): Promise;
+ postSpaceAttachment(form: FormData): Promise;
+ getUsers(): Promise;
+ getUser(userId: number): Promise;
+ postUser(params: Option.User.PostUserParams): Promise;
+ patchUser(userId: number, params: Option.User.PatchUserParams): Promise;
+ deleteUser(userId: number): Promise;
+ getMyself(): Promise;
+ getUserActivities(userId: number, params: Option.User.GetUserActivitiesParams): Promise;
+ getUserStars(userId: number, params: Option.User.GetUserStarsParams): Promise;
+ getUserStarsCount(userId: number, params: Option.User.GetUserStarsCountParams): Promise;
+ getRecentlyViewedIssues(params: Option.User.GetRecentlyViewedParams): Promise;
+ getRecentlyViewedProjects(params: Option.User.GetRecentlyViewedParams): Promise;
+ getRecentlyViewedWikis(params: Option.User.GetRecentlyViewedParams): Promise;
+ getUserIcon(userId: number): Promise;
+ getGroups(params: Option.Group.GetGroupsParams): Promise;
+ postGroups(params: Option.Group.PostGroupsParams): Promise;
+ getGroup(groupId: number): Promise;
+ patchGroup(groupId: number, params: Option.Group.PatchGroupParams): Promise;
+ deleteGroup(groupId: number): Promise;
+ getStatuses(): Promise;
+ getResolutions(): Promise;
+ getPriorities(): Promise;
+ postProject(params: Option.Project.PostProjectParams): Promise;
+ getProjects(params?: Option.Project.GetProjectsParams): Promise;
+ getProject(projectIdOrKey: string): Promise;
+ patchProject(projectIdOrKey: string, params: Option.Project.PatchProjectParams): Promise;
+ deleteProject(projectIdOrKey: string): Promise;
+ getProjectActivities(projectIdOrKey: string, params: Option.Space.GetActivitiesParams): Promise;
+ getProjectUsers(projectIdOrKey: string): Promise;
+ deleteProjectUsers(projectIdOrKey: string, params: Option.Project.DeleteProjectUsersParams): Promise;
+ postProjectAdministrators(projectIdOrKey: string, params: Option.Project.PostProjectAdministrators): Promise;
+ getProjectAdministrators(projectIdOrKey: string): Promise;
+ deleteProjectAdministrators(projectIdOrKey: string, params: Option.Project.DeleteProjectAdministrators): Promise;
+ getIssueTypes(projectIdOrKey: string): Promise;
+ postIssueType(projectIdOrKey: string, params: Option.Project.PostIssueTypeParams): Promise;
+ patchIssueType(projectIdOrKey: string, id: number, params: Option.Project.PatchIssueTypeParams): Promise;
+ deleteIssueType(projectIdOrKey: string, id: number, params: Option.Project.DeleteIssueTypeParams): Promise;
+ getCategories(projectIdOrKey: string): Promise;
+ postCategories(projectIdOrKey: string, params: Option.Project.PostCategoriesParams): Promise;
+ patchCategories(projectIdOrKey: string, id: number, params: Option.Project.PatchCategoriesParams): Promise;
+ deleteCategories(projectIdOrKey: string, id: number): Promise;
+ getVersions(projectIdOrKey: string): Promise;
+ postVersions(projectIdOrKey: string, params: Option.Project.PostVersionsParams): Promise;
+ patchVersions(projectIdOrKey: string, id: number, params: Option.Project.PatchVersionsParams): Promise;
+ deleteVersions(projectIdOrKey: string, id: number): Promise;
+ getCustomFields(projectIdOrKey: string): Promise;
+ postCustomField(projectIdOrKey: string, params: Option.Project.PostCustomFieldParams | Option.Project.PostCustomFieldWithNumericParams | Option.Project.PostCustomFieldWithDateParams | Option.Project.PostCustomFieldWithListParams): Promise;
+ patchCustomField(projectIdOrKey: string, id: number, params: Option.Project.PatchCustomFieldParams | Option.Project.PatchCustomFieldWithNumericParams | Option.Project.PatchCustomFieldWithDateParams | Option.Project.PatchCustomFieldWithListParams): Promise;
+ deleteCustomField(projectIdOrKey: string, id: number): Promise;
+ postCustomFieldItem(projectIdOrKey: string, id: number, params: Option.Project.PostCustomFieldItemParams): Promise;
+ patchCustomFieldItem(projectIdOrKey: string, id: number, itemId: number, params: Option.Project.PatchCustomFieldItemParams): Promise;
+ deleteCustomFieldItem(projectIdOrKey: string, id: number, params: Option.Project.PostCustomFieldItemParams): Promise;
+ getSharedFiles(projectIdOrKey: string, path: string, params: Option.Project.GetSharedFilesParams): Promise;
+ getProjectsDiskUsage(projectIdOrKey: string): Promise;
+ getWebhooks(projectIdOrKey: string): Promise;
+ postWebhook(projectIdOrKey: string, params: Option.Project.PostWebhookParams): Promise;
+ getWebhook(projectIdOrKey: string, webhookId: string): Promise;
+ patchWebhook(projectIdOrKey: string, webhookId: string, params: Option.Project.PatchWebhookParams): Promise;
+ deleteWebhook(projectIdOrKey: string, webhookId: string): Promise;
+ postIssue(params: Option.Issue.PostIssueParams): Promise;
+ patchIssue(issueIdOrKey: string, params: Option.Issue.PatchIssueParams): Promise;
+ getIssues(params?: Option.Issue.GetIssuesParams): Promise;
+ getIssue(issueIdOrKey: string): Promise;
+ getIssuesCount(params?: Option.Issue.GetIssuesParams): Promise;
+ deleteIssuesCount(issueIdOrKey: string): Promise;
+ getIssueComments(issueIdOrKey: string, params: Option.Issue.GetIssueCommentsParams): Promise;
+ postIssueComments(issueIdOrKey: string, params: Option.Issue.PostIssueCommentsParams): Promise;
+ getIssueCommentsCount(issueIdOrKey: string): Promise;
+ getIssueComment(issueIdOrKey: string, commentId: number): Promise;
+ patchIssueComment(issueIdOrKey: string, commentId: number, params: Option.Issue.PatchIssueCommentParams): Promise;
+ getIssueCommentNotifications(issueIdOrKey: string, commentId: number): Promise;
+ postIssueCommentNotifications(issueIdOrKey: string, commentId: number, prams: Option.Issue.IssueCommentNotifications): Promise;
+ getIssueAttachments(issueIdOrKey: string): Promise;
+ deleteIssueAttachment(issueIdOrKey: string, attachmentId: string): Promise;
+ getIssueSharedFiles(issueIdOrKey: string): Promise;
+ linkIssueSharedFiles(issueIdOrKey: string, params: Option.Issue.LinkIssueSharedFilesParams): Promise;
+ unlinkIssueSharedFile(issueIdOrKey: string, id: number): Promise;
+ getWikis(projectIdOrKey: number): Promise;
+ getWikisCount(projectIdOrKey: number): Promise;
+ getWikisTags(projectIdOrKey: number): Promise