From 25e287b4ff419eca9f924639ff8403c0b7cc1cf1 Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Fri, 23 Sep 2016 09:21:15 -0700 Subject: [PATCH] Fix build failures --- d3-tip/d3-tip-tests.ts | 5 +- d3-tip/index.d.ts | 4 +- imap-simple/imap-simple-tests.ts | 2 - imap-simple/index.d.ts | 90 +++++++++++++++----------------- mapbox-gl/mapbox-gl-tests.ts | 2 - 5 files changed, 44 insertions(+), 59 deletions(-) diff --git a/d3-tip/d3-tip-tests.ts b/d3-tip/d3-tip-tests.ts index aa5e9b179c..a9daf5422a 100644 --- a/d3-tip/d3-tip-tests.ts +++ b/d3-tip/d3-tip-tests.ts @@ -1,6 +1,3 @@ -/// -/// - // test variables interface dataType { @@ -8,7 +5,7 @@ interface dataType { Number: number } -let data: dataType[] = [ { Title: "one", Number: 1 }, { Title: "two", Number: 2} ]; +let data: dataType[] = [ { Title: "one", Number: 1 }, { Title: "two", Number: 2} ]; let svgElement: SVGElement; let root: HTMLElement; diff --git a/d3-tip/index.d.ts b/d3-tip/index.d.ts index ce3d7f21bc..2747851b90 100644 --- a/d3-tip/index.d.ts +++ b/d3-tip/index.d.ts @@ -3,9 +3,9 @@ // Definitions by: Gert Braspenning // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +import {Primitive} from "d3"; -declare namespace d3 { +declare module "d3" { type TooltipDirection = ("n" | "s" | "e" | "w" | "nw" | "ne" | "sw" | "se"); interface Tooltip { hide(): Tooltip; diff --git a/imap-simple/imap-simple-tests.ts b/imap-simple/imap-simple-tests.ts index c4d0dee1d3..39236023d5 100644 --- a/imap-simple/imap-simple-tests.ts +++ b/imap-simple/imap-simple-tests.ts @@ -1,5 +1,3 @@ -/// - import * as imaps from "imap-simple"; let config = { diff --git a/imap-simple/index.d.ts b/imap-simple/index.d.ts index 42a9a0fdf9..765c8a5f0a 100644 --- a/imap-simple/index.d.ts +++ b/imap-simple/index.d.ts @@ -3,55 +3,54 @@ // Definitions by: Jeffery Grajkowski // Definitions: https://github.com/psnider/DefinitelyTyped/imap-simple -/// +import Imap = require("imap"); -declare namespace IMAPS { +export interface ImapSimpleOptions { + /** Options to pass to node-imap constructor. */ + imap: Imap.Config; - export interface ImapSimpleOptions { - /** Options to pass to node-imap constructor. */ - imap: IMAP.Config; + /** Time in milliseconds to wait before giving up on a connection attempt. (Deprecated: please use options.imap.authTimeout instead) */ + connectTimeout?: number; +} - /** Time in milliseconds to wait before giving up on a connection attempt. (Deprecated: please use options.imap.authTimeout instead) */ - connectTimeout?: number; - } +export interface MessageBodyPart extends Imap.ImapMessageBodyInfo { + /** string type where which=='TEXT', complex Object where which=='HEADER' */ + body: any; +} - export interface MessageBodyPart extends IMAP.ImapMessageBodyInfo { - /** string type where which=='TEXT', complex Object where which=='HEADER' */ - body: any; - } +export interface Message { + attributes: Imap.ImapMessageAttributes; + parts: MessageBodyPart[]; +} - export interface Message { - attributes: IMAP.ImapMessageAttributes; - parts: MessageBodyPart[]; - } +export class ImapSimple { + constructor(imap: Imap); - export class ImapSimple { - constructor(imap: IMAP.Connection); + /** Open a mailbox, calling the provided callback with signature (err, boxName), or resolves the returned promise with boxName. */ + openBox(boxName: string, callback: (err: Error, boxName: string) => void): void; + openBox(boxName: string): Promise; - /** Open a mailbox, calling the provided callback with signature (err, boxName), or resolves the returned promise with boxName. */ - openBox(boxName: string, callback: (err: Error, boxName: string) => void): void; - openBox(boxName: string): Promise; + /** Search for and retrieve mail in the previously opened mailbox. */ + search(searchCriteria: any[], fetchOptions: Imap.FetchOptions, callback: (err: Error, messages: Message[]) => void): void; + search(searchCriteria: any[], fetchOptions: Imap.FetchOptions): Promise; - /** Search for and retrieve mail in the previously opened mailbox. */ - search(searchCriteria: any[], fetchOptions: IMAP.FetchOptions, callback: (err: Error, messages: Message[]) => void): void; - search(searchCriteria: any[], fetchOptions: IMAP.FetchOptions): Promise; + /** Close the connection to the imap server. */ + end(): void; - /** Close the connection to the imap server. */ - end(): void; + /** Downloads part data (which is either part of the message body, or an attachment). Upon success, either the provided callback will be called with signature (err, data), or the returned promise will be resolved with data. The data will be automatically decoded based on its encoding. If the encoding of the part is not supported, an error will occur. */ + getPartData(message: Message, part: any, callback: (err: Error, data: any) => void): void; + getPartData(message: Message, part: any): Promise; - /** Downloads part data (which is either part of the message body, or an attachment). Upon success, either the provided callback will be called with signature (err, data), or the returned promise will be resolved with data. The data will be automatically decoded based on its encoding. If the encoding of the part is not supported, an error will occur. */ - getPartData(message: Message, part: any, callback: (err: Error, data: any) => void): void; - getPartData(message: Message, part: any): Promise; + /** Adds the provided label(s) to the specified message(s). source corresponds to a node-imap MessageSource which specifies the messages to be moved. label is either a string or array of strings indicating the labels to add. When completed, either calls the provided callback with signature (err), or resolves the returned promise. */ + addMessageLabel(source: string | string[], label: string | string[], callback: (err: Error) => void): void; + addMessageLabel(source: string | string[], label: string | string[]): Promise; - /** Adds the provided label(s) to the specified message(s). source corresponds to a node-imap MessageSource which specifies the messages to be moved. label is either a string or array of strings indicating the labels to add. When completed, either calls the provided callback with signature (err), or resolves the returned promise. */ - addMessageLabel(source: string | string[], label: string | string[], callback: (err: Error) => void): void; - addMessageLabel(source: string | string[], label: string | string[]): Promise; - - /** Moves the specified message(s) in the currently open mailbox to another mailbox. source corresponds to a node-imap MessageSource which specifies the messages to be moved. When completed, either calls the provided callback with signature (err), or resolves the returned promise. */ - moveMessage(source: string | string[], boxName: string, callback: (err: Error) => void): void; - moveMessage(source: string | string[], boxName: string): Promise; - } + /** Moves the specified message(s) in the currently open mailbox to another mailbox. source corresponds to a node-imap MessageSource which specifies the messages to be moved. When completed, either calls the provided callback with signature (err), or resolves the returned promise. */ + moveMessage(source: string | string[], boxName: string, callback: (err: Error) => void): void; + moveMessage(source: string | string[], boxName: string): Promise; +} +export namespace errors { /** Error thrown when a connection attempt has timed out. */ export class ConnectionTimeoutError extends Error { timeout: number; @@ -59,17 +58,10 @@ declare namespace IMAPS { } } -declare module "imap-simple" { - /** Main entry point. Connect to an Imap server. */ - export function connect(options: IMAPS.ImapSimpleOptions, callback: (err: Error, connection: IMAPS.ImapSimple) => void): void; - export function connect(options: IMAPS.ImapSimpleOptions): Promise; - export namespace errors { - export import ConnectionTimeoutError = IMAPS.ConnectionTimeoutError; - } +/** Main entry point. Connect to an Imap server. */ +export function connect(options: ImapSimpleOptions, callback: (err: Error, connection: ImapSimple) => void): void; +export function connect(options: ImapSimpleOptions): Promise; - export import ImapSimple = IMAPS.ImapSimple; - - /** Given the message.attributes.struct, retrieve a flattened array of parts objects that describe the structure of the different parts of the message's body. Useful for getting a simple list to iterate for the purposes of, for example, finding all attachments. */ - export function getParts(struct: any[]): any[]; -} +/** Given the message.attributes.struct, retrieve a flattened array of parts objects that describe the structure of the different parts of the message's body. Useful for getting a simple list to iterate for the purposes of, for example, finding all attachments. */ +export function getParts(struct: any[]): any[]; diff --git a/mapbox-gl/mapbox-gl-tests.ts b/mapbox-gl/mapbox-gl-tests.ts index f77a9f4af7..9e7b715968 100644 --- a/mapbox-gl/mapbox-gl-tests.ts +++ b/mapbox-gl/mapbox-gl-tests.ts @@ -1,6 +1,4 @@ // These examples adapted from Mapbox's examples (https://www.mapbox.com/mapbox-gl-js/examples) -/// -/// /** * Set API Access Token