diff --git a/ace/tslint.json b/ace/tslint.json index 0f47deabb4..e050abdce9 100644 --- a/ace/tslint.json +++ b/ace/tslint.json @@ -1,6 +1,7 @@ { "extends": "../tslint.json", "rules": { - "forbidden-types": false + "forbidden-types": false, + "no-empty-interface": false } } \ No newline at end of file diff --git a/acl/tslint.json b/acl/tslint.json index 0f47deabb4..e050abdce9 100644 --- a/acl/tslint.json +++ b/acl/tslint.json @@ -1,6 +1,7 @@ { "extends": "../tslint.json", "rules": { - "forbidden-types": false + "forbidden-types": false, + "no-empty-interface": false } } \ No newline at end of file diff --git a/adm-zip/index.d.ts b/adm-zip/index.d.ts index 4749fcb885..405545a8ca 100644 --- a/adm-zip/index.d.ts +++ b/adm-zip/index.d.ts @@ -18,72 +18,36 @@ declare class AdmZip { /** * 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 + * @param entry ZipEntry object or 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; + readFile(entry: AdmZip.IZipEntry | string): Buffer; /** * Asynchronous readFile - * @param entry String with the full path of the entry + * @param entry ZipEntry object or 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; + readFileAsync(entry: AdmZip.IZipEntry | string, 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 entry ZipEntry object or 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; + readAsText(fileName: AdmZip.IZipEntry | string, encoding?: string): string; /** * Asynchronous readAsText - * @param entry String with the full path of the entry + * @param entry ZipEntry object or 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; + readAsTextAsync(fileName: AdmZip.IZipEntry | string, 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 + * @param entry ZipEntry object or 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. @@ -99,44 +63,23 @@ declare class AdmZip { * 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 entry ZipEntry object or 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; + addZipEntryComment(entry: AdmZip.IZipEntry | string, comment: string): void; /** * Returns the comment of the specified entry. - * @param entry String with the full path of the entry. + * @param entry ZipEntry object or 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; + getZipEntryComment(entry: AdmZip.IZipEntry | string): 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 entry ZipEntry object or 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; + updateFile(entry: AdmZip.IZipEntry | string, content: Buffer): void; /** * Adds a file from the disk to the archive. * @param localPath Path to a file on disk. @@ -179,7 +122,7 @@ declare class AdmZip { * 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 entry ZipEntry object or 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 @@ -189,21 +132,7 @@ declare class AdmZip { * * @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; + extractEntryTo(entryPath: AdmZip.IZipEntry | string, targetPath: string, maintainEntryPath?: boolean, overwrite?: boolean): boolean; /** * Extracts the entire archive to the given location * @param targetPath Target location diff --git a/agenda/index.d.ts b/agenda/index.d.ts index 8c4d102326..d06d4089a4 100644 --- a/agenda/index.d.ts +++ b/agenda/index.d.ts @@ -10,13 +10,9 @@ import { Db, Collection, ObjectID } from "mongodb"; export = Agenda; -interface Callback { - (err?: Error): void; -} +type Callback = (err?: Error) => void; -interface ResultCallback { - (err?: Error, result?: T): void; -} +type ResultCallback = (err?: Error, result?: T) => void; declare class Agenda extends EventEmitter { diff --git a/ajv/index.d.ts b/ajv/index.d.ts index ee06bc2f19..1466db0e99 100644 --- a/ajv/index.d.ts +++ b/ajv/index.d.ts @@ -57,7 +57,7 @@ declare class Ajv { static ValidationError: Function; } declare namespace Ajv { - type AjvOptions = { + interface AjvOptions { v5?: boolean; allErrors?: boolean; verbose?: boolean; @@ -82,21 +82,21 @@ declare namespace Ajv { loopRequired?: number; ownProperties?: boolean; multipleOfPrecision?: boolean | number; - errorDataPath?: string, + errorDataPath?: string; messages?: boolean; beautify?: boolean; cache?: any; - }; + } type AjvValidate = ((data: any) => boolean | PromiseLike) & { errors: ValidationError[]; }; - type AjxKeywordDefinition = { + interface AjxKeywordDefinition { async?: boolean; type: string; compile?: (schema: any, parentsSchema: any) => ((data: any) => boolean | PromiseLike); validate?: (schema: any, data: any) => boolean; - }; - type ValidationError = { + } + interface ValidationError { keyword: string; dataPath: string; schemaPath: string; @@ -105,7 +105,7 @@ declare namespace Ajv { schema: any; parentSchema: any; data: any; - }; + } } export = Ajv; diff --git a/alexa-sdk/tslint.json b/alexa-sdk/tslint.json index 0f47deabb4..e050abdce9 100644 --- a/alexa-sdk/tslint.json +++ b/alexa-sdk/tslint.json @@ -1,6 +1,7 @@ { "extends": "../tslint.json", "rules": { - "forbidden-types": false + "forbidden-types": false, + "no-empty-interface": false } } \ No newline at end of file diff --git a/alt/index.d.ts b/alt/index.d.ts index 9385526c71..900c35c668 100644 --- a/alt/index.d.ts +++ b/alt/index.d.ts @@ -26,7 +26,7 @@ declare namespace AltJS { //state setState?(state: S | ((currentState: S, nextState: S) => S)): void; getState?(): S; - waitFor?(storeOrStores: AltStore | AltStore[]): void; + waitFor?(storeOrStores: AltStore | Array>): void; //events onSerialize?(fn: (data: any) => any): void; @@ -48,7 +48,9 @@ declare namespace AltJS { displayName?: string; } - export type Source = {[name: string]: () => SourceModel}; + export interface Source { + [name: string]: () => SourceModel; + } export interface SourceModel { local(state: any, ...args: any[]): any; @@ -75,7 +77,9 @@ declare namespace AltJS { error } - export type Actions = {[action: string]: Action}; + export interface Actions { + [action: string]: Action; + } export interface Action { ( args: T): void; @@ -104,13 +108,12 @@ declare namespace AltJS { bootstrap(jsonData: string): void; takeSnapshot( ...storeNames: string[]): string; flush(): Object; - recycle( ...stores: AltJS.AltStore[]): void; + recycle( ...stores: Array>): void; rollback(): void; dispatch(action?: AltJS.Action, data?: Object, details?: any): void; //Actions methods addActions(actionsName: string, ActionsClass: ActionsClassConstructor): void; - createActions(ActionsClass: ActionsClassConstructor, exportObj?: Object): T; createActions(ActionsClass: ActionsClassConstructor, exportObj?: Object, ...constructorArgs: any[]): T; generateActions( ...actions: string[]): T; getActions(actionsName: string): AltJS.Actions; @@ -128,7 +131,9 @@ declare namespace AltJS { type ActionsClassConstructor = new (alt: Alt) => AltJS.ActionsClass; type ActionHandler = ( ...data: any[]) => any; - type ExportConfig = {[key: string]: (...args: any[]) => any}; + interface ExportConfig { + [key: string]: (...args: any[]) => any; + } } declare module "alt/utils/chromeDebug" { @@ -142,7 +147,7 @@ declare module "alt/AltContainer" { interface ContainerProps { store?: AltJS.AltStore; - stores?: AltJS.AltStore[]; + stores?: Array>; inject?: {[key: string]: any}; actions?: {[key: string]: Object}; render?: (...props: any[]) => React.ReactElement; diff --git a/amazon-product-api/index.d.ts b/amazon-product-api/index.d.ts index e86165e6f6..350bdbf795 100644 --- a/amazon-product-api/index.d.ts +++ b/amazon-product-api/index.d.ts @@ -11,9 +11,7 @@ interface ICredentials { awsTag: string; } -interface IAmazonProductQueryCallback { - (err: string, results: Object[]): void; -} +type IAmazonProductQueryCallback = (err: string, results: Object[]) => void; interface IAmazonProductClient { itemSearch(query: any, callback?: IAmazonProductQueryCallback): Promise;