diff --git a/JSONStream/JSONStream.d.ts b/JSONStream/JSONStream.d.ts
index 029e5b8e9c..a3481906b3 100644
--- a/JSONStream/JSONStream.d.ts
+++ b/JSONStream/JSONStream.d.ts
@@ -5,18 +5,17 @@
///
-declare module 'JSONStream' {
- export interface Options {
- recurse: boolean;
- }
- export function parse(pattern: any): NodeJS.ReadWriteStream;
- export function parse(patterns: any[]): NodeJS.ReadWriteStream;
-
- export function stringify(): NodeJS.ReadWriteStream;
- export function stringify(open: string, sep: string, close: string): NodeJS.ReadWriteStream;
-
- export function stringifyObject(): NodeJS.ReadWriteStream;
- export function stringifyObject(open: string, sep: string, close: string): NodeJS.ReadWriteStream;
+export interface Options {
+ recurse: boolean;
}
+
+declare export function parse(pattern: any): NodeJS.ReadWriteStream;
+declare export function parse(patterns: any[]): NodeJS.ReadWriteStream;
+
+declare export function stringify(): NodeJS.ReadWriteStream;
+declare export function stringify(open: string, sep: string, close: string): NodeJS.ReadWriteStream;
+
+declare export function stringifyObject(): NodeJS.ReadWriteStream;
+declare export function stringifyObject(open: string, sep: string, close: string): NodeJS.ReadWriteStream;
diff --git a/abs/abs.d.ts b/abs/abs.d.ts
index 58a5335283..b5182da9e6 100644
--- a/abs/abs.d.ts
+++ b/abs/abs.d.ts
@@ -3,12 +3,11 @@
// Definitions by: Aya Morisawa
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-declare module "abs" {
- /**
- * Compute the absolute path of an input.
- * @param input The input path.
- */
- function Abs(input: string): string;
- export default Abs;
-}
+/**
+ * Compute the absolute path of an input.
+ * @param input The input path.
+ */
+declare function Abs(input: string): string;
+
+export default Abs;
diff --git a/absolute/absolute.d.ts b/absolute/absolute.d.ts
index c0e8e9bd6e..4dc77e5fbe 100644
--- a/absolute/absolute.d.ts
+++ b/absolute/absolute.d.ts
@@ -3,11 +3,10 @@
// Definitions by: Aya Morisawa
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-declare module "absolute" {
- /**
- * Test if a path is absolute
- */
- function absolute(path: string): boolean;
- export default absolute;
-}
+/**
+ * Test if a path is absolute
+ */
+declare function absolute(path: string): boolean;
+
+export default absolute;
diff --git a/acl/acl.d.ts b/acl/acl.d.ts
index 06defa2449..daabcf628f 100644
--- a/acl/acl.d.ts
+++ b/acl/acl.d.ts
@@ -9,42 +9,42 @@
///
///
-declare module "acl" {
- import http = require('http');
- import Promise = require("bluebird");
- type strings = string|string[];
- type Value = string|number;
- type Values = Value|Value[];
- type Action = () => any;
- type Callback = (err: Error) => any;
- type AnyCallback = (err: Error, obj: any) => any;
- type AllowedCallback = (err: Error, allowed: boolean) => any;
- type GetUserId = (req: http.ServerRequest, res: http.ServerResponse) => Value;
+import http = require('http');
+import Promise = require("bluebird");
- interface AclStatic {
+type strings = string | string[];
+type Value = string | number;
+type Values = Value | Value[];
+type Action = () => any;
+type Callback = (err: Error) => any;
+type AnyCallback = (err: Error, obj: any) => any;
+type AllowedCallback = (err: Error, allowed: boolean) => any;
+type GetUserId = (req: http.ServerRequest, res: http.ServerResponse) => Value;
+
+interface AclStatic {
new (backend: Backend, logger: Logger, options: Option): Acl;
new (backend: Backend, logger: Logger): Acl;
new (backend: Backend): Acl;
memoryBackend: MemoryBackendStatic;
- }
+}
- interface Logger {
- debug: (msg: string)=>any;
- }
+interface Logger {
+ debug: (msg: string) => any;
+}
- interface Acl {
+interface Acl {
addUserRoles: (userId: Value, roles: strings, cb?: Callback) => Promise;
removeUserRoles: (userId: Value, roles: strings, cb?: Callback) => Promise;
- userRoles: (userId: Value, cb?: (err: Error, roles: string[])=>any) => Promise;
- roleUsers: (role: Value, cb?: (err: Error, users: Values)=>any) => Promise;
- hasRole: (userId: Value, role: string, cb?: (err: Error, isInRole: boolean)=>any) => Promise;
+ userRoles: (userId: Value, cb?: (err: Error, roles: string[]) => any) => Promise;
+ roleUsers: (role: Value, cb?: (err: Error, users: Values) => any) => Promise;
+ hasRole: (userId: Value, role: string, cb?: (err: Error, isInRole: boolean) => any) => Promise;
addRoleParents: (role: string, parents: Values, cb?: Callback) => Promise;
removeRole: (role: string, cb?: Callback) => Promise;
removeResource: (resource: string, cb?: Callback) => Promise;
allow: {
- (roles: Values, resources: strings, permissions: strings, cb?: Callback): Promise;
- (aclSets: AclSet|AclSet[]): Promise;
+ (roles: Values, resources: strings, permissions: strings, cb?: Callback): Promise;
+ (aclSets: AclSet | AclSet[]): Promise;
}
removeAllow: (role: string, resources: strings, permissions: strings, cb?: Callback) => Promise;
removePermissions: (role: string, resources: strings, permissions: strings, cb?: Function) => Promise;
@@ -53,41 +53,41 @@ declare module "acl" {
areAnyRolesAllowed: (roles: strings, resource: strings, permissions: strings, cb?: AllowedCallback) => Promise;
whatResources: (roles: strings, permissions: strings, cb?: AnyCallback) => Promise;
permittedResources: (roles: strings, permissions: strings, cb?: Function) => Promise;
- middleware: (numPathComponents: number, userId: Value|GetUserId, actions: strings) => Promise;
- }
+ middleware: (numPathComponents: number, userId: Value | GetUserId, actions: strings) => Promise;
+}
- interface Option {
+interface Option {
buckets?: BucketsOption;
- }
+}
- interface BucketsOption {
+interface BucketsOption {
meta?: string;
parents?: string;
permissions?: string;
resources?: string;
roles?: string;
users?: string;
- }
+}
- interface AclSet {
+interface AclSet {
roles: strings;
allows: AclAllow[];
- }
+}
- interface AclAllow {
+interface AclAllow {
resources: strings;
permissions: strings;
- }
+}
- interface MemoryBackend extends Backend { }
- interface MemoryBackendStatic {
- new(): MemoryBackend;
- }
+interface MemoryBackend extends Backend { }
+interface MemoryBackendStatic {
+ new (): MemoryBackend;
+}
- //
- // For internal use
- //
- interface Backend {
+//
+// For internal use
+//
+interface Backend {
begin: () => T;
end: (transaction: T, cb?: Action) => void;
clean: (cb?: Action) => void;
@@ -101,50 +101,49 @@ declare module "acl" {
getAsync: Function;
cleanAsync: Function;
unionAsync: Function;
- }
+}
- interface Contract {
- (args: IArguments): Contract|NoOp;
+interface Contract {
+ (args: IArguments): Contract | NoOp;
debug: boolean;
fulfilled: boolean;
args: any[];
checkedParams: string[];
- params: (...types: string[]) => Contract|NoOp;
+ params: (...types: string[]) => Contract | NoOp;
end: () => void;
- }
+}
- interface NoOp {
+interface NoOp {
params: (...types: string[]) => NoOp;
end: () => void;
- }
-
- // for redis backend
- import redis = require('redis');
-
- interface AclStatic {
- redisBackend: RedisBackendStatic;
- }
-
- interface RedisBackend extends Backend { }
- interface RedisBackendStatic {
- new(redis: redis.RedisClient, prefix: string): RedisBackend;
- new(redis: redis.RedisClient): RedisBackend;
- }
-
- // for mongodb backend
- import mongo = require('mongodb');
-
- interface AclStatic {
- mongodbBackend: MongodbBackendStatic;
- }
-
- interface MongodbBackend extends Backend { }
- interface MongodbBackendStatic {
- new(db: mongo.Db, prefix: string, useSingle: boolean): MongodbBackend;
- new(db: mongo.Db, prefix: string): MongodbBackend;
- new(db: mongo.Db): MongodbBackend;
- }
-
- var _: AclStatic;
- export = _;
}
+
+// for redis backend
+import redis = require('redis');
+
+interface AclStatic {
+ redisBackend: RedisBackendStatic;
+}
+
+interface RedisBackend extends Backend { }
+interface RedisBackendStatic {
+ new (redis: redis.RedisClient, prefix: string): RedisBackend;
+ new (redis: redis.RedisClient): RedisBackend;
+}
+
+// for mongodb backend
+import mongo = require('mongodb');
+
+interface AclStatic {
+ mongodbBackend: MongodbBackendStatic;
+}
+
+interface MongodbBackend extends Backend { }
+interface MongodbBackendStatic {
+ new (db: mongo.Db, prefix: string, useSingle: boolean): MongodbBackend;
+ new (db: mongo.Db, prefix: string): MongodbBackend;
+ new (db: mongo.Db): MongodbBackend;
+}
+
+declare var _: AclStatic;
+export = _;
diff --git a/adm-zip/adm-zip.d.ts b/adm-zip/adm-zip.d.ts
index 19298149c3..06e1181694 100644
--- a/adm-zip/adm-zip.d.ts
+++ b/adm-zip/adm-zip.d.ts
@@ -5,303 +5,302 @@
///
-declare module "adm-zip" {
- class AdmZip {
- /**
- * Create a new, empty archive.
- */
- constructor();
- /**
- * Read an existing archive.
- */
- constructor(fileName: string);
- /**
- * Extracts the given entry from the archive and returns the content as a
- * Buffer object.
- * @param entry String with the full path of the entry
- * @return Buffer or Null in case of error
- */
- readFile(entry: string): Buffer;
- /**
- * Extracts the given entry from the archive and returns the content as a
- * Buffer object.
- * @param entry ZipEntry object
- * @return Buffer or Null in case of error
- */
- readFile(entry: AdmZip.IZipEntry): Buffer;
- /**
- * Asynchronous readFile
- * @param entry String with the full path of the entry
- * @param callback Called with a Buffer or Null in case of error
- */
- readFileAsync(entry: string, callback: (data: Buffer, err: string) => any): void;
- /**
- * Asynchronous readFile
- * @param entry ZipEntry object
- * @param callback Called with a Buffer or Null in case of error
- * @return Buffer or Null in case of error
- */
- readFileAsync(entry: AdmZip.IZipEntry, callback: (data: Buffer, err: string) => any): void;
- /**
- * Extracts the given entry from the archive and returns the content as
- * plain text in the given encoding
- * @param entry String with the full path of the entry
- * @param encoding Optional. If no encoding is specified utf8 is used
- * @return String
- */
- readAsText(fileName: string, encoding?: string): string;
- /**
- * Extracts the given entry from the archive and returns the content as
- * plain text in the given encoding
- * @param entry ZipEntry object
- * @param encoding Optional. If no encoding is specified utf8 is used
- * @return String
- */
- readAsText(fileName: AdmZip.IZipEntry, encoding?: string): string;
- /**
- * Asynchronous readAsText
- * @param entry String with the full path of the entry
- * @param callback Called with the resulting string.
- * @param encoding Optional. If no encoding is specified utf8 is used
- */
- readAsTextAsync(fileName: string, callback: (data: string) => any, encoding?: string): void;
- /**
- * Asynchronous readAsText
- * @param entry ZipEntry object
- * @param callback Called with the resulting string.
- * @param encoding Optional. If no encoding is specified utf8 is used
- */
- readAsTextAsync(fileName: AdmZip.IZipEntry, callback: (data: string) => any, encoding?: string): void;
- /**
- * Remove the entry from the file or the entry and all its nested directories
- * and files if the given entry is a directory
- * @param entry String with the full path of the entry
- */
- deleteFile(entry: string): void;
- /**
- * Remove the entry from the file or the entry and all its nested directories
- * and files if the given entry is a directory
- * @param entry A ZipEntry object.
- */
- deleteFile(entry: AdmZip.IZipEntry): void;
- /**
- * Adds a comment to the zip. The zip must be rewritten after
- * adding the comment.
- * @param comment Content of the comment.
- */
- addZipComment(comment: string): void;
- /**
- * Returns the zip comment
- * @return The zip comment.
- */
- getZipComment(): string;
- /**
- * Adds a comment to a specified zipEntry. The zip must be rewritten after
- * adding the comment.
- * The comment cannot exceed 65535 characters in length.
- * @param entry String with the full path of the entry
- * @param comment The comment to add to the entry.
- */
- addZipEntryComment(entry: string, comment: string): void;
- /**
- * Adds a comment to a specified zipEntry. The zip must be rewritten after
- * adding the comment.
- * The comment cannot exceed 65535 characters in length.
- * @param entry ZipEntry object.
- * @param comment The comment to add to the entry.
- */
- addZipEntryComment(entry: AdmZip.IZipEntry, comment: string): void;
- /**
- * Returns the comment of the specified entry.
- * @param entry String with the full path of the entry.
- * @return String The comment of the specified entry.
- */
- getZipEntryComment(entry: string): string;
- /**
- * Returns the comment of the specified entry
- * @param entry ZipEntry object.
- * @return String The comment of the specified entry.
- */
- getZipEntryComment(entry: AdmZip.IZipEntry): string;
- /**
- * Updates the content of an existing entry inside the archive. The zip
- * must be rewritten after updating the content
- * @param entry String with the full path of the entry.
- * @param content The entry's new contents.
- */
- updateFile(entry: string, content: Buffer): void;
- /**
- * Updates the content of an existing entry inside the archive. The zip
- * must be rewritten after updating the content
- * @param entry ZipEntry object.
- * @param content The entry's new contents.
- */
- updateFile(entry: AdmZip.IZipEntry, content: Buffer): void;
- /**
- * Adds a file from the disk to the archive.
- * @param localPath Path to a file on disk.
- * @param zipPath Path to a directory in the archive. Defaults to the empty
- * string.
- */
- addLocalFile(localPath: string, zipPath?: string): void;
- /**
- * Adds a local directory and all its nested files and directories to the
- * archive.
- * @param localPath Path to a folder on disk.
- * @param zipPath Path to a folder in the archive. Defaults to an empty
- * string.
- */
- addLocalFolder(localPath: string, zipPath?: string): void;
- /**
- * Allows you to create a entry (file or directory) in the zip file.
- * If you want to create a directory the entryName must end in / and a null
- * buffer should be provided.
- * @param entryName Entry path
- * @param content Content to add to the entry; must be a 0-length buffer
- * for a directory.
- * @param comment Comment to add to the entry.
- * @param attr Attribute to add to the entry.
- */
- addFile(entryName: string, data: Buffer, comment?: string, attr?: number): void;
- /**
- * Returns an array of ZipEntry objects representing the files and folders
- * inside the archive
- */
- getEntries(): AdmZip.IZipEntry[];
- /**
- * Returns a ZipEntry object representing the file or folder specified by
- * ``name``.
- * @param name Name of the file or folder to retrieve.
- * @return ZipEntry The entry corresponding to the name.
- */
- getEntry(name: string): AdmZip.IZipEntry;
- /**
- * Extracts the given entry to the given targetPath.
- * If the entry is a directory inside the archive, the entire directory and
- * its subdirectories will be extracted.
- * @param entry String with the full path of the entry
- * @param targetPath Target folder where to write the file
- * @param maintainEntryPath If maintainEntryPath is true and the entry is
- * inside a folder, the entry folder will be created in targetPath as
- * well. Default is TRUE
- * @param overwrite If the file already exists at the target path, the file
- * will be overwriten if this is true. Default is FALSE
- *
- * @return Boolean
- */
- extractEntryTo(entryPath: string, targetPath: string, maintainEntryPath?: boolean, overwrite?: boolean): boolean;
- /**
- * Extracts the given entry to the given targetPath.
- * If the entry is a directory inside the archive, the entire directory and
- * its subdirectories will be extracted.
- * @param entry ZipEntry object
- * @param targetPath Target folder where to write the file
- * @param maintainEntryPath If maintainEntryPath is true and the entry is
- * inside a folder, the entry folder will be created in targetPath as
- * well. Default is TRUE
- * @param overwrite If the file already exists at the target path, the file
- * will be overwriten if this is true. Default is FALSE
- * @return Boolean
- */
- extractEntryTo(entryPath: AdmZip.IZipEntry, targetPath: string, maintainEntryPath?: boolean, overwrite?: boolean): boolean;
- /**
- * Extracts the entire archive to the given location
- * @param targetPath Target location
- * @param overwrite If the file already exists at the target path, the file
- * will be overwriten if this is true. Default is FALSE
- */
- extractAllTo(targetPath: string, overwrite?: boolean): void;
- /**
- * Extracts the entire archive to the given location
- * @param targetPath Target location
- * @param overwrite If the file already exists at the target path, the file
- * will be overwriten if this is true. Default is FALSE
- * @param callback The callback function will be called afeter extraction
- */
- extractAllToAsync(targetPath: string, overwrite: boolean, callback: (error: Error) => void): void;
- /**
- * Writes the newly created zip file to disk at the specified location or
- * if a zip was opened and no ``targetFileName`` is provided, it will
- * overwrite the opened zip
- * @param targetFileName
- */
- writeZip(targetPath?: string): void;
- /**
- * Returns the content of the entire zip file as a Buffer object
- * @return Buffer
- */
- toBuffer(): Buffer;
- }
- namespace AdmZip {
- /**
- * The ZipEntry is more than a structure representing the entry inside the
- * zip file. Beside the normal attributes and headers a entry can have, the
- * class contains a reference to the part of the file where the compressed
- * data resides and decompresses it when requested. It also compresses the
- * data and creates the headers required to write in the zip file.
- */
- interface IZipEntry {
- /**
- * Represents the full name and path of the file
- */
- entryName: string;
- rawEntryName: Buffer;
- /**
- * Extra data associated with this entry.
- */
- extra: Buffer;
- /**
- * Entry comment.
- */
- comment: string;
- name: string;
- /**
- * Read-Only property that indicates the type of the entry.
- */
- isDirectory: boolean;
- /**
- * Get the header associated with this ZipEntry.
- */
- header: Buffer;
- /**
- * Retrieve the compressed data for this entry. Note that this may trigger
- * compression if any properties were modified.
- */
- getCompressedData(): Buffer;
- /**
- * Asynchronously retrieve the compressed data for this entry. Note that
- * this may trigger compression if any properties were modified.
- */
- getCompressedDataAsync(callback: (data: Buffer) => void): void;
- /**
- * Set the (uncompressed) data to be associated with this entry.
- */
- setData(value: string): void;
- /**
- * Set the (uncompressed) data to be associated with this entry.
- */
- setData(value: Buffer): void;
- /**
- * Get the decompressed data associated with this entry.
- */
- getData(): Buffer;
- /**
- * Asynchronously get the decompressed data associated with this entry.
- */
- getDataAsync(callback: (data: Buffer) => void): void;
- /**
- * Returns the CEN Entry Header to be written to the output zip file, plus
- * the extra data and the entry comment.
- */
- packHeader(): Buffer;
- /**
- * Returns a nicely formatted string with the most important properties of
- * the ZipEntry.
- */
- toString(): string;
- }
- }
-
- export = AdmZip;
+declare class AdmZip {
+ /**
+ * Create a new, empty archive.
+ */
+ constructor();
+ /**
+ * Read an existing archive.
+ */
+ constructor(fileName: string);
+ /**
+ * Extracts the given entry from the archive and returns the content as a
+ * Buffer object.
+ * @param entry String with the full path of the entry
+ * @return Buffer or Null in case of error
+ */
+ readFile(entry: string): Buffer;
+ /**
+ * Extracts the given entry from the archive and returns the content as a
+ * Buffer object.
+ * @param entry ZipEntry object
+ * @return Buffer or Null in case of error
+ */
+ readFile(entry: AdmZip.IZipEntry): Buffer;
+ /**
+ * Asynchronous readFile
+ * @param entry String with the full path of the entry
+ * @param callback Called with a Buffer or Null in case of error
+ */
+ readFileAsync(entry: string, callback: (data: Buffer, err: string) => any): void;
+ /**
+ * Asynchronous readFile
+ * @param entry ZipEntry object
+ * @param callback Called with a Buffer or Null in case of error
+ * @return Buffer or Null in case of error
+ */
+ readFileAsync(entry: AdmZip.IZipEntry, callback: (data: Buffer, err: string) => any): void;
+ /**
+ * Extracts the given entry from the archive and returns the content as
+ * plain text in the given encoding
+ * @param entry String with the full path of the entry
+ * @param encoding Optional. If no encoding is specified utf8 is used
+ * @return String
+ */
+ readAsText(fileName: string, encoding?: string): string;
+ /**
+ * Extracts the given entry from the archive and returns the content as
+ * plain text in the given encoding
+ * @param entry ZipEntry object
+ * @param encoding Optional. If no encoding is specified utf8 is used
+ * @return String
+ */
+ readAsText(fileName: AdmZip.IZipEntry, encoding?: string): string;
+ /**
+ * Asynchronous readAsText
+ * @param entry String with the full path of the entry
+ * @param callback Called with the resulting string.
+ * @param encoding Optional. If no encoding is specified utf8 is used
+ */
+ readAsTextAsync(fileName: string, callback: (data: string) => any, encoding?: string): void;
+ /**
+ * Asynchronous readAsText
+ * @param entry ZipEntry object
+ * @param callback Called with the resulting string.
+ * @param encoding Optional. If no encoding is specified utf8 is used
+ */
+ readAsTextAsync(fileName: AdmZip.IZipEntry, callback: (data: string) => any, encoding?: string): void;
+ /**
+ * Remove the entry from the file or the entry and all its nested directories
+ * and files if the given entry is a directory
+ * @param entry String with the full path of the entry
+ */
+ deleteFile(entry: string): void;
+ /**
+ * Remove the entry from the file or the entry and all its nested directories
+ * and files if the given entry is a directory
+ * @param entry A ZipEntry object.
+ */
+ deleteFile(entry: AdmZip.IZipEntry): void;
+ /**
+ * Adds a comment to the zip. The zip must be rewritten after
+ * adding the comment.
+ * @param comment Content of the comment.
+ */
+ addZipComment(comment: string): void;
+ /**
+ * Returns the zip comment
+ * @return The zip comment.
+ */
+ getZipComment(): string;
+ /**
+ * Adds a comment to a specified zipEntry. The zip must be rewritten after
+ * adding the comment.
+ * The comment cannot exceed 65535 characters in length.
+ * @param entry String with the full path of the entry
+ * @param comment The comment to add to the entry.
+ */
+ addZipEntryComment(entry: string, comment: string): void;
+ /**
+ * Adds a comment to a specified zipEntry. The zip must be rewritten after
+ * adding the comment.
+ * The comment cannot exceed 65535 characters in length.
+ * @param entry ZipEntry object.
+ * @param comment The comment to add to the entry.
+ */
+ addZipEntryComment(entry: AdmZip.IZipEntry, comment: string): void;
+ /**
+ * Returns the comment of the specified entry.
+ * @param entry String with the full path of the entry.
+ * @return String The comment of the specified entry.
+ */
+ getZipEntryComment(entry: string): string;
+ /**
+ * Returns the comment of the specified entry
+ * @param entry ZipEntry object.
+ * @return String The comment of the specified entry.
+ */
+ getZipEntryComment(entry: AdmZip.IZipEntry): string;
+ /**
+ * Updates the content of an existing entry inside the archive. The zip
+ * must be rewritten after updating the content
+ * @param entry String with the full path of the entry.
+ * @param content The entry's new contents.
+ */
+ updateFile(entry: string, content: Buffer): void;
+ /**
+ * Updates the content of an existing entry inside the archive. The zip
+ * must be rewritten after updating the content
+ * @param entry ZipEntry object.
+ * @param content The entry's new contents.
+ */
+ updateFile(entry: AdmZip.IZipEntry, content: Buffer): void;
+ /**
+ * Adds a file from the disk to the archive.
+ * @param localPath Path to a file on disk.
+ * @param zipPath Path to a directory in the archive. Defaults to the empty
+ * string.
+ */
+ addLocalFile(localPath: string, zipPath?: string): void;
+ /**
+ * Adds a local directory and all its nested files and directories to the
+ * archive.
+ * @param localPath Path to a folder on disk.
+ * @param zipPath Path to a folder in the archive. Defaults to an empty
+ * string.
+ */
+ addLocalFolder(localPath: string, zipPath?: string): void;
+ /**
+ * Allows you to create a entry (file or directory) in the zip file.
+ * If you want to create a directory the entryName must end in / and a null
+ * buffer should be provided.
+ * @param entryName Entry path
+ * @param content Content to add to the entry; must be a 0-length buffer
+ * for a directory.
+ * @param comment Comment to add to the entry.
+ * @param attr Attribute to add to the entry.
+ */
+ addFile(entryName: string, data: Buffer, comment?: string, attr?: number): void;
+ /**
+ * Returns an array of ZipEntry objects representing the files and folders
+ * inside the archive
+ */
+ getEntries(): AdmZip.IZipEntry[];
+ /**
+ * Returns a ZipEntry object representing the file or folder specified by
+ * ``name``.
+ * @param name Name of the file or folder to retrieve.
+ * @return ZipEntry The entry corresponding to the name.
+ */
+ getEntry(name: string): AdmZip.IZipEntry;
+ /**
+ * Extracts the given entry to the given targetPath.
+ * If the entry is a directory inside the archive, the entire directory and
+ * its subdirectories will be extracted.
+ * @param entry String with the full path of the entry
+ * @param targetPath Target folder where to write the file
+ * @param maintainEntryPath If maintainEntryPath is true and the entry is
+ * inside a folder, the entry folder will be created in targetPath as
+ * well. Default is TRUE
+ * @param overwrite If the file already exists at the target path, the file
+ * will be overwriten if this is true. Default is FALSE
+ *
+ * @return Boolean
+ */
+ extractEntryTo(entryPath: string, targetPath: string, maintainEntryPath?: boolean, overwrite?: boolean): boolean;
+ /**
+ * Extracts the given entry to the given targetPath.
+ * If the entry is a directory inside the archive, the entire directory and
+ * its subdirectories will be extracted.
+ * @param entry ZipEntry object
+ * @param targetPath Target folder where to write the file
+ * @param maintainEntryPath If maintainEntryPath is true and the entry is
+ * inside a folder, the entry folder will be created in targetPath as
+ * well. Default is TRUE
+ * @param overwrite If the file already exists at the target path, the file
+ * will be overwriten if this is true. Default is FALSE
+ * @return Boolean
+ */
+ extractEntryTo(entryPath: AdmZip.IZipEntry, targetPath: string, maintainEntryPath?: boolean, overwrite?: boolean): boolean;
+ /**
+ * Extracts the entire archive to the given location
+ * @param targetPath Target location
+ * @param overwrite If the file already exists at the target path, the file
+ * will be overwriten if this is true. Default is FALSE
+ */
+ extractAllTo(targetPath: string, overwrite?: boolean): void;
+ /**
+ * Extracts the entire archive to the given location
+ * @param targetPath Target location
+ * @param overwrite If the file already exists at the target path, the file
+ * will be overwriten if this is true. Default is FALSE
+ * @param callback The callback function will be called afeter extraction
+ */
+ extractAllToAsync(targetPath: string, overwrite: boolean, callback: (error: Error) => void): void;
+ /**
+ * Writes the newly created zip file to disk at the specified location or
+ * if a zip was opened and no ``targetFileName`` is provided, it will
+ * overwrite the opened zip
+ * @param targetFileName
+ */
+ writeZip(targetPath?: string): void;
+ /**
+ * Returns the content of the entire zip file as a Buffer object
+ * @return Buffer
+ */
+ toBuffer(): Buffer;
}
+
+declare namespace AdmZip {
+ /**
+ * The ZipEntry is more than a structure representing the entry inside the
+ * zip file. Beside the normal attributes and headers a entry can have, the
+ * class contains a reference to the part of the file where the compressed
+ * data resides and decompresses it when requested. It also compresses the
+ * data and creates the headers required to write in the zip file.
+ */
+ interface IZipEntry {
+ /**
+ * Represents the full name and path of the file
+ */
+ entryName: string;
+ rawEntryName: Buffer;
+ /**
+ * Extra data associated with this entry.
+ */
+ extra: Buffer;
+ /**
+ * Entry comment.
+ */
+ comment: string;
+ name: string;
+ /**
+ * Read-Only property that indicates the type of the entry.
+ */
+ isDirectory: boolean;
+ /**
+ * Get the header associated with this ZipEntry.
+ */
+ header: Buffer;
+ /**
+ * Retrieve the compressed data for this entry. Note that this may trigger
+ * compression if any properties were modified.
+ */
+ getCompressedData(): Buffer;
+ /**
+ * Asynchronously retrieve the compressed data for this entry. Note that
+ * this may trigger compression if any properties were modified.
+ */
+ getCompressedDataAsync(callback: (data: Buffer) => void): void;
+ /**
+ * Set the (uncompressed) data to be associated with this entry.
+ */
+ setData(value: string): void;
+ /**
+ * Set the (uncompressed) data to be associated with this entry.
+ */
+ setData(value: Buffer): void;
+ /**
+ * Get the decompressed data associated with this entry.
+ */
+ getData(): Buffer;
+ /**
+ * Asynchronously get the decompressed data associated with this entry.
+ */
+ getDataAsync(callback: (data: Buffer) => void): void;
+ /**
+ * Returns the CEN Entry Header to be written to the output zip file, plus
+ * the extra data and the entry comment.
+ */
+ packHeader(): Buffer;
+ /**
+ * Returns a nicely formatted string with the most important properties of
+ * the ZipEntry.
+ */
+ toString(): string;
+ }
+}
+
+export = AdmZip;
diff --git a/agenda/agenda.d.ts b/agenda/agenda.d.ts
index 011676bc86..b6e2dc08d1 100644
--- a/agenda/agenda.d.ts
+++ b/agenda/agenda.d.ts
@@ -6,438 +6,437 @@
///
///
-declare module "agenda" {
- import {EventEmitter} from "events";
- import {Db, Collection, ObjectID} from "mongodb";
- interface Callback {
- (err?: Error): void;
- }
+import {EventEmitter} from "events";
+import {Db, Collection, ObjectID} from "mongodb";
- interface ResultCallback {
- (err?: Error, result?: T): void;
- }
-
- /**
- * Agenda Configuration.
- */
- interface AgendaConfiguration {
-
- /**
- * Sets the interval with which the queue is checked. A number in milliseconds or a frequency string.
- */
- processEvery?: string | number;
-
- /**
- * Takes a number which specifies the default number of a specific job that can be running at any given moment.
- * By default it is 5.
- */
- defaultConcurrency?: number;
-
- /**
- * Takes a number which specifies the max number of jobs that can be running at any given moment. By default it
- * is 20.
- */
- maxConcurrency?: number;
-
- /**
- * Takes a number which specifies the default number of a specific job that can be locked at any given moment.
- * By default it is 0 for no max.
- */
- defaultLockLimit?: number;
-
- /**
- * Takes a number shich specifies the max number jobs that can be locked at any given moment. By default it is
- * 0 for no max.
- */
- lockLimit?: number;
-
- /**
- * Takes a number which specifies the default lock lifetime in milliseconds. By default it is 10 minutes. This
- * can be overridden by specifying the lockLifetime option to a defined job.
- */
- defaultLockLifetime?: number;
-
- /**
- * Specifies that Agenda should be initialized using and existing MongoDB connection.
- */
- mongo?: {
- /**
- * The MongoDB database connection to use.
- */
- db: Db;
-
- /**
- * The name of the collection to use.
- */
- collection?: string;
- }
-
- /**
- * Specifies that Agenda should connect to MongoDB.
- */
- db?: {
- /**
- * The connection URL.
- */
- address: string;
-
- /**
- * The name of the collection to use.
- */
- collection?: string;
-
- /**
- * Connection options to pass to MongoDB.
- */
- options?: any;
- }
- }
-
- /**
- * The database record associated with a job.
- */
- interface JobAttributes {
- /**
- * The record identity.
- */
- _id: ObjectID;
-
- /**
- * The name of the job.
- */
- name: string;
-
- /**
- * The type of the job (single|normal).
- */
- type: string;
-
- /**
- * The job details.
- */
- data: { [name: string]: any };
-
- /**
- * The priority of the job.
- */
- priority: number;
-
- /**
- * How often the job is repeated using a human-readable or cron format.
- */
- repeatInterval: string | number;
-
- /**
- * The timezone that conforms to [moment-timezone](http://momentjs.com/timezone/).
- */
- repeatTimezone: string;
-
- /**
- * Date/time the job was las modified.
- */
- lastModifiedBy: string;
-
- /**
- * Date/time the job will run next.
- */
- nextRunAt: Date;
-
- /**
- * Date/time the job was locked.
- */
- lockedAt: Date;
-
- /**
- * Date/time the job was last run.
- */
- lastRunAt: Date;
-
- /**
- * Date/time the job last finished running.
- */
- lastFinishedAt: Date;
-
- /**
- * The reason the job failed.
- */
- failReason: string;
-
- /**
- * The number of times the job has failed.
- */
- failCount: number;
-
- /**
- * The date/time the job last failed.
- */
- failedAt: Date;
- }
-
- /**
- * A scheduled job.
- */
- interface Job {
-
- /**
- * The database record associated with the job.
- */
- attrs: JobAttributes;
-
- /**
- * Specifies an interval on which the job should repeat.
- * @param interval A human-readable format String, a cron format String, or a Number.
- * @param options An optional argument that can include a timezone field. The timezone should be a string as
- * accepted by moment-timezone and is considered when using an interval in the cron string format.
- */
- repeatEvery(interval: string | number, options?: { timezone?: string }): Job
-
- /**
- * Specifies a time when the job should repeat. [Possible values](https://github.com/matthewmueller/date#examples).
- * @param time
- */
- repeatAt(time: string): Job
-
- /**
- * Disables the job.
- */
- disable(): Job;
-
- /**
- * Enables the job.
- */
- enable(): Job;
-
- /**
- * Ensure that only one instance of this job exists with the specified properties
- * @param value The properties associated with the job that must be unqiue.
- * @param opts
- */
- unique(value: any, opts?: { insertOnly?: boolean }): Job;
-
- /**
- * Specifies the next time at which the job should run.
- * @param time The next time at which the job should run.
- */
- schedule(time: string | Date): Job;
-
- /**
- * Specifies the priority weighting of the job.
- * @param value The priority of the job (lowest|low|normal|high|highest|number).
- */
- priority(value: string | number): Job;
-
- /**
- * Sets job.attrs.failedAt to now, and sets job.attrs.failReason to reason.
- * @param reason A message or Error object that indicates why the job failed.
- */
- fail(reason: string | Error): Job;
-
- /**
- * Runs the given job and calls callback(err, job) upon completion. Normally you never need to call this manually
- * @param cb Called when the job is completed.
- */
- run(cb?: ResultCallback): Job;
-
- /**
- * Returns true if the job is running; otherwise, returns false.
- */
- isRunning(): boolean;
-
- /**
- * Saves the job into the database.
- * @param cb Called when the job is saved.
- */
- save(cb?: ResultCallback): Job;
-
- /**
- * Removes the job from the database and cancels the job.
- * @param cb Called after the job has beeb removed from the database.
- */
- remove(cb?: Callback): void;
-
- /**
- * Resets the lock on the job. Useful to indicate that the job hasn't timed out when you have very long running
- * jobs.
- * @param cb Called after the job has been saved to the database.
- */
- touch(cb?: Callback): void;
- }
-
- interface JobOptions {
-
- /**
- * Maximum number of that job that can be running at once (per instance of agenda)
- */
- concurrency?: number;
-
- /**
- * Maximum number of that job that can be locked at once (per instance of agenda)
- */
- lockLimit?: number;
-
- /**
- * Interval in ms of how long the job stays locked for (see multiple job processors for more info). A job will
- * automatically unlock if done() is called.
- */
- lockLifetime?: number;
-
- /**
- * (lowest|low|normal|high|highest|number) specifies the priority of the job. Higher priority jobs will run
- * first.
- */
- priority?: string | number;
- }
-
- class Agenda extends EventEmitter {
-
- /**
- * Constructs a new Agenda object.
- * @param config Optional configuration to initialize the Agenda.
- * @param cb Optional callback called with the MongoDB colleciton.
- */
- constructor(config?: AgendaConfiguration, cb?: ResultCallback);
-
- /**
- * Connect to the specified MongoDB server and database.
- */
- database(url: string, collection?: string, options?: any, cb?: ResultCallback): Agenda;
-
- /**
- * Initialize agenda with an existing MongoDB connection.
- */
- mongo(db: Db, collection?: string, cb?: ResultCallback): Agenda;
-
- /**
- * Sets the agenda name.
- */
- name(value: string): Agenda;
-
- /**
- * Sets the interval with which the queue is checked. A number in milliseconds or a frequency string.
- */
- processEvery(interval: string | number): Agenda;
-
- /**
- * Takes a number which specifies the max number of jobs that can be running at any given moment. By default it
- * is 20.
- * @param value The value to set.
- */
- maxConcurrency(value: number): Agenda;
-
- /**
- * Takes a number which specifies the default number of a specific job that can be running at any given moment.
- * By default it is 5.
- * @param value The value to set.
- */
- defaultConcurrency(value: number): Agenda;
-
- /**
- * Takes a number shich specifies the max number jobs that can be locked at any given moment. By default it is
- * 0 for no max.
- * @param value The value to set.
- */
- lockLimit(value: number): Agenda;
-
- /**
- * Takes a number which specifies the default number of a specific job that can be locked at any given moment.
- * By default it is 0 for no max.
- * @param value The value to set.
- */
- defaultLockLimit(value: number): Agenda;
-
- /**
- * Takes a number which specifies the default lock lifetime in milliseconds. By default it is 10 minutes. This
- * can be overridden by specifying the lockLifetime option to a defined job.
- * @param value The value to set.
- */
- defaultLockLifetime(value: number): Agenda;
-
- /**
- * Returns an instance of a jobName with data. This does NOT save the job in the database. See below to learn
- * how to manually work with jobs.
- * @param name The name of the job.
- * @param data Data to associated with the job.
- */
- create(name: string, data?: any): Job;
-
- /**
- * Find all Jobs matching `query` and pass same back in cb().
- * @param query
- * @param cb
- */
- jobs(query: any, cb: ResultCallback): void;
-
- /**
- * Removes all jobs in the database without defined behaviors. Useful if you change a definition name and want
- * to remove old jobs.
- * @param cb Called with the number of jobs removed.
- */
- purge(cb?: ResultCallback): void;
-
- /**
- * Defines a job with the name of jobName. When a job of job name gets run, it will be passed to fn(job, done).
- * To maintain asynchronous behavior, you must call done() when you are processing the job. If your function is
- * synchronous, you may omit done from the signature.
- * @param name The name of the jobs.
- * @param options The options for the job.
- * @param handler The handler to execute.
- */
- define(name: string, handler: (job?: Job, done?: (err?: Error) => void) => void): void;
- define(name: string, options: JobOptions, handler: (job?: Job, done?: (err?: Error) => void) => void): void;
-
- /**
- * Runs job name at the given interval. Optionally, data and options can be passed in.
- * @param interval Can be a human-readable format String, a cron format String, or a Number.
- * @param names The name or names of the job(s) to run.
- * @param data An optional argument that will be passed to the processing function under job.attrs.data.
- * @param options An optional argument that will be passed to job.repeatEvery.
- * @param cb An optional callback function which will be called when the job has been persisted in the database.
- */
- every(interval: number | string, names: string, data?: any, options?: any, cb?: ResultCallback): Job;
- every(interval: number | string, names: string[], data?: any, options?: any, cb?: ResultCallback): Job[];
-
- /**
- * Schedules a job to run name once at a given time.
- * @param when A Date or a String such as tomorrow at 5pm.
- * @param names The name or names of the job(s) to run.
- * @param data An optional argument that will be passed to the processing function under job.attrs.data.
- * @param cb An optional callback function which will be called when the job has been persisted in the database.
- */
- schedule(when: Date | string, names: string, data?: any, cb?: ResultCallback): Job;
- schedule(when: Date | string, names: string[], data?: any, cb?: ResultCallback): Job[];
-
- /**
- * Schedules a job to run name once immediately.
- * @param name The name of the job to run.
- * @param data An optional argument that will be passed to the processing function under job.attrs.data.
- * @param cb An optional callback function which will be called when the job has been persisted in the database.
- */
- now(name: string, data?: any, cb?: ResultCallback): Job;
-
- /**
- * Cancels any jobs matching the passed mongodb-native query, and removes them from the database.
- * @param query Mongodb native query.
- * @param cb Called with the number of jobs removed.
- */
- cancel(query: any, cb?: ResultCallback): void;
-
- /**
- * Starts the job queue processing, checking processEvery time to see if there are new jobs.
- */
- start(): void;
-
- /**
- * Stops the job queue processing. Unlocks currently running jobs.
- * @param cb Called after the job processing queue shuts down and unlocks all jobs.
- */
- stop(cb: Callback): void;
- }
-
- namespace Agenda {
-
- }
-
- export = Agenda;
+interface Callback {
+ (err?: Error): void;
}
+
+interface ResultCallback {
+ (err?: Error, result?: T): void;
+}
+
+/**
+ * Agenda Configuration.
+ */
+interface AgendaConfiguration {
+
+ /**
+ * Sets the interval with which the queue is checked. A number in milliseconds or a frequency string.
+ */
+ processEvery?: string | number;
+
+ /**
+ * Takes a number which specifies the default number of a specific job that can be running at any given moment.
+ * By default it is 5.
+ */
+ defaultConcurrency?: number;
+
+ /**
+ * Takes a number which specifies the max number of jobs that can be running at any given moment. By default it
+ * is 20.
+ */
+ maxConcurrency?: number;
+
+ /**
+ * Takes a number which specifies the default number of a specific job that can be locked at any given moment.
+ * By default it is 0 for no max.
+ */
+ defaultLockLimit?: number;
+
+ /**
+ * Takes a number shich specifies the max number jobs that can be locked at any given moment. By default it is
+ * 0 for no max.
+ */
+ lockLimit?: number;
+
+ /**
+ * Takes a number which specifies the default lock lifetime in milliseconds. By default it is 10 minutes. This
+ * can be overridden by specifying the lockLifetime option to a defined job.
+ */
+ defaultLockLifetime?: number;
+
+ /**
+ * Specifies that Agenda should be initialized using and existing MongoDB connection.
+ */
+ mongo?: {
+ /**
+ * The MongoDB database connection to use.
+ */
+ db: Db;
+
+ /**
+ * The name of the collection to use.
+ */
+ collection?: string;
+ }
+
+ /**
+ * Specifies that Agenda should connect to MongoDB.
+ */
+ db?: {
+ /**
+ * The connection URL.
+ */
+ address: string;
+
+ /**
+ * The name of the collection to use.
+ */
+ collection?: string;
+
+ /**
+ * Connection options to pass to MongoDB.
+ */
+ options?: any;
+ }
+}
+
+/**
+ * The database record associated with a job.
+ */
+interface JobAttributes {
+ /**
+ * The record identity.
+ */
+ _id: ObjectID;
+
+ /**
+ * The name of the job.
+ */
+ name: string;
+
+ /**
+ * The type of the job (single|normal).
+ */
+ type: string;
+
+ /**
+ * The job details.
+ */
+ data: { [name: string]: any };
+
+ /**
+ * The priority of the job.
+ */
+ priority: number;
+
+ /**
+ * How often the job is repeated using a human-readable or cron format.
+ */
+ repeatInterval: string | number;
+
+ /**
+ * The timezone that conforms to [moment-timezone](http://momentjs.com/timezone/).
+ */
+ repeatTimezone: string;
+
+ /**
+ * Date/time the job was las modified.
+ */
+ lastModifiedBy: string;
+
+ /**
+ * Date/time the job will run next.
+ */
+ nextRunAt: Date;
+
+ /**
+ * Date/time the job was locked.
+ */
+ lockedAt: Date;
+
+ /**
+ * Date/time the job was last run.
+ */
+ lastRunAt: Date;
+
+ /**
+ * Date/time the job last finished running.
+ */
+ lastFinishedAt: Date;
+
+ /**
+ * The reason the job failed.
+ */
+ failReason: string;
+
+ /**
+ * The number of times the job has failed.
+ */
+ failCount: number;
+
+ /**
+ * The date/time the job last failed.
+ */
+ failedAt: Date;
+}
+
+/**
+ * A scheduled job.
+ */
+interface Job {
+
+ /**
+ * The database record associated with the job.
+ */
+ attrs: JobAttributes;
+
+ /**
+ * Specifies an interval on which the job should repeat.
+ * @param interval A human-readable format String, a cron format String, or a Number.
+ * @param options An optional argument that can include a timezone field. The timezone should be a string as
+ * accepted by moment-timezone and is considered when using an interval in the cron string format.
+ */
+ repeatEvery(interval: string | number, options?: { timezone?: string }): Job
+
+ /**
+ * Specifies a time when the job should repeat. [Possible values](https://github.com/matthewmueller/date#examples).
+ * @param time
+ */
+ repeatAt(time: string): Job
+
+ /**
+ * Disables the job.
+ */
+ disable(): Job;
+
+ /**
+ * Enables the job.
+ */
+ enable(): Job;
+
+ /**
+ * Ensure that only one instance of this job exists with the specified properties
+ * @param value The properties associated with the job that must be unqiue.
+ * @param opts
+ */
+ unique(value: any, opts?: { insertOnly?: boolean }): Job;
+
+ /**
+ * Specifies the next time at which the job should run.
+ * @param time The next time at which the job should run.
+ */
+ schedule(time: string | Date): Job;
+
+ /**
+ * Specifies the priority weighting of the job.
+ * @param value The priority of the job (lowest|low|normal|high|highest|number).
+ */
+ priority(value: string | number): Job;
+
+ /**
+ * Sets job.attrs.failedAt to now, and sets job.attrs.failReason to reason.
+ * @param reason A message or Error object that indicates why the job failed.
+ */
+ fail(reason: string | Error): Job;
+
+ /**
+ * Runs the given job and calls callback(err, job) upon completion. Normally you never need to call this manually
+ * @param cb Called when the job is completed.
+ */
+ run(cb?: ResultCallback): Job;
+
+ /**
+ * Returns true if the job is running; otherwise, returns false.
+ */
+ isRunning(): boolean;
+
+ /**
+ * Saves the job into the database.
+ * @param cb Called when the job is saved.
+ */
+ save(cb?: ResultCallback): Job;
+
+ /**
+ * Removes the job from the database and cancels the job.
+ * @param cb Called after the job has beeb removed from the database.
+ */
+ remove(cb?: Callback): void;
+
+ /**
+ * Resets the lock on the job. Useful to indicate that the job hasn't timed out when you have very long running
+ * jobs.
+ * @param cb Called after the job has been saved to the database.
+ */
+ touch(cb?: Callback): void;
+}
+
+interface JobOptions {
+
+ /**
+ * Maximum number of that job that can be running at once (per instance of agenda)
+ */
+ concurrency?: number;
+
+ /**
+ * Maximum number of that job that can be locked at once (per instance of agenda)
+ */
+ lockLimit?: number;
+
+ /**
+ * Interval in ms of how long the job stays locked for (see multiple job processors for more info). A job will
+ * automatically unlock if done() is called.
+ */
+ lockLifetime?: number;
+
+ /**
+ * (lowest|low|normal|high|highest|number) specifies the priority of the job. Higher priority jobs will run
+ * first.
+ */
+ priority?: string | number;
+}
+
+declare class Agenda extends EventEmitter {
+
+ /**
+ * Constructs a new Agenda object.
+ * @param config Optional configuration to initialize the Agenda.
+ * @param cb Optional callback called with the MongoDB colleciton.
+ */
+ constructor(config?: AgendaConfiguration, cb?: ResultCallback);
+
+ /**
+ * Connect to the specified MongoDB server and database.
+ */
+ database(url: string, collection?: string, options?: any, cb?: ResultCallback): Agenda;
+
+ /**
+ * Initialize agenda with an existing MongoDB connection.
+ */
+ mongo(db: Db, collection?: string, cb?: ResultCallback): Agenda;
+
+ /**
+ * Sets the agenda name.
+ */
+ name(value: string): Agenda;
+
+ /**
+ * Sets the interval with which the queue is checked. A number in milliseconds or a frequency string.
+ */
+ processEvery(interval: string | number): Agenda;
+
+ /**
+ * Takes a number which specifies the max number of jobs that can be running at any given moment. By default it
+ * is 20.
+ * @param value The value to set.
+ */
+ maxConcurrency(value: number): Agenda;
+
+ /**
+ * Takes a number which specifies the default number of a specific job that can be running at any given moment.
+ * By default it is 5.
+ * @param value The value to set.
+ */
+ defaultConcurrency(value: number): Agenda;
+
+ /**
+ * Takes a number shich specifies the max number jobs that can be locked at any given moment. By default it is
+ * 0 for no max.
+ * @param value The value to set.
+ */
+ lockLimit(value: number): Agenda;
+
+ /**
+ * Takes a number which specifies the default number of a specific job that can be locked at any given moment.
+ * By default it is 0 for no max.
+ * @param value The value to set.
+ */
+ defaultLockLimit(value: number): Agenda;
+
+ /**
+ * Takes a number which specifies the default lock lifetime in milliseconds. By default it is 10 minutes. This
+ * can be overridden by specifying the lockLifetime option to a defined job.
+ * @param value The value to set.
+ */
+ defaultLockLifetime(value: number): Agenda;
+
+ /**
+ * Returns an instance of a jobName with data. This does NOT save the job in the database. See below to learn
+ * how to manually work with jobs.
+ * @param name The name of the job.
+ * @param data Data to associated with the job.
+ */
+ create(name: string, data?: any): Job;
+
+ /**
+ * Find all Jobs matching `query` and pass same back in cb().
+ * @param query
+ * @param cb
+ */
+ jobs(query: any, cb: ResultCallback): void;
+
+ /**
+ * Removes all jobs in the database without defined behaviors. Useful if you change a definition name and want
+ * to remove old jobs.
+ * @param cb Called with the number of jobs removed.
+ */
+ purge(cb?: ResultCallback): void;
+
+ /**
+ * Defines a job with the name of jobName. When a job of job name gets run, it will be passed to fn(job, done).
+ * To maintain asynchronous behavior, you must call done() when you are processing the job. If your function is
+ * synchronous, you may omit done from the signature.
+ * @param name The name of the jobs.
+ * @param options The options for the job.
+ * @param handler The handler to execute.
+ */
+ define(name: string, handler: (job?: Job, done?: (err?: Error) => void) => void): void;
+ define(name: string, options: JobOptions, handler: (job?: Job, done?: (err?: Error) => void) => void): void;
+
+ /**
+ * Runs job name at the given interval. Optionally, data and options can be passed in.
+ * @param interval Can be a human-readable format String, a cron format String, or a Number.
+ * @param names The name or names of the job(s) to run.
+ * @param data An optional argument that will be passed to the processing function under job.attrs.data.
+ * @param options An optional argument that will be passed to job.repeatEvery.
+ * @param cb An optional callback function which will be called when the job has been persisted in the database.
+ */
+ every(interval: number | string, names: string, data?: any, options?: any, cb?: ResultCallback): Job;
+ every(interval: number | string, names: string[], data?: any, options?: any, cb?: ResultCallback): Job[];
+
+ /**
+ * Schedules a job to run name once at a given time.
+ * @param when A Date or a String such as tomorrow at 5pm.
+ * @param names The name or names of the job(s) to run.
+ * @param data An optional argument that will be passed to the processing function under job.attrs.data.
+ * @param cb An optional callback function which will be called when the job has been persisted in the database.
+ */
+ schedule(when: Date | string, names: string, data?: any, cb?: ResultCallback): Job;
+ schedule(when: Date | string, names: string[], data?: any, cb?: ResultCallback): Job[];
+
+ /**
+ * Schedules a job to run name once immediately.
+ * @param name The name of the job to run.
+ * @param data An optional argument that will be passed to the processing function under job.attrs.data.
+ * @param cb An optional callback function which will be called when the job has been persisted in the database.
+ */
+ now(name: string, data?: any, cb?: ResultCallback): Job;
+
+ /**
+ * Cancels any jobs matching the passed mongodb-native query, and removes them from the database.
+ * @param query Mongodb native query.
+ * @param cb Called with the number of jobs removed.
+ */
+ cancel(query: any, cb?: ResultCallback): void;
+
+ /**
+ * Starts the job queue processing, checking processEvery time to see if there are new jobs.
+ */
+ start(): void;
+
+ /**
+ * Stops the job queue processing. Unlocks currently running jobs.
+ * @param cb Called after the job processing queue shuts down and unlocks all jobs.
+ */
+ stop(cb: Callback): void;
+}
+
+declare namespace Agenda {
+
+}
+
+export = Agenda;
diff --git a/amazon-product-api/amazon-product-api.d.ts b/amazon-product-api/amazon-product-api.d.ts
index f7ccf905e5..9b5604ff5b 100644
--- a/amazon-product-api/amazon-product-api.d.ts
+++ b/amazon-product-api/amazon-product-api.d.ts
@@ -3,23 +3,22 @@
// Definitions by: Matti Lehtinen
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-declare module "amazon-product-api" {
- interface ICredentials {
- awsId: string,
- awsSecret: string,
- awsTag: string
- }
- interface IAmazonProductQueryCallback {
- (err: string, results: Object[]): void;
- }
-
- interface IAmazonProductClient {
- itemSearch(query: any, callback?: IAmazonProductQueryCallback) : Promise