diff --git a/types/bootstrap.v3.datetimepicker/index.d.ts b/types/bootstrap.v3.datetimepicker/index.d.ts index 4686aa9680..f37a42b67d 100644 --- a/types/bootstrap.v3.datetimepicker/index.d.ts +++ b/types/bootstrap.v3.datetimepicker/index.d.ts @@ -337,16 +337,16 @@ export interface DatetimepickerOptions { /** Shows the week of the year to the left of first day of the week. * @default: false */ - calendarWeeks?: boolean; + calendarWeeks?: boolean; /** Using a Bootstraps collapse to switch between date/time pickers. * @default: true */ - collapse?: boolean; + collapse?: boolean; /** Disables the section of days of the week, e.g. weekends. * Accepts: array of numbers from 0-6 * @default: false */ - daysOfWeekDisabled?: number[] | boolean; + daysOfWeekDisabled?: number[] | boolean; /** Changes the heading of the datepicker when in "days" view. * @default: "MMMM YYYY" */ @@ -358,14 +358,14 @@ export interface DatetimepickerOptions { /** Sets the picker default date/time. Overrides useCurrent * @default: false */ - defaultDate?: boolean | moment.Moment | Date | string; + defaultDate?: boolean | moment.Moment | Date | string; /** Disables selection of dates in the array, e.g. holidays * @default: false * IMPORTANT! The getter returns an Object NOT an Array, with keys being the dates, values being true. * eg disabledDates = ["2010-10-10"]; -> disabledDated will be { "2010-01-01": true } * https://github.com/Eonasdan/bootstrap-datetimepicker/issues/1499 */ - disabledDates?: boolean | Array | any; + disabledDates?: boolean | Array | any; /** Will allow or disallow hour selections (much like disabledTimeIntervals) but will affect all days * @default: false * IMPORTANT! The getter returns an Object NOT an Array, with keys being the hours, values being true. @@ -384,7 +384,7 @@ export interface DatetimepickerOptions { * eg enabledDates = ["2010-10-10"]; -> enabledDated will be { "2010-01-01": true } * https://github.com/Eonasdan/bootstrap-datetimepicker/issues/1499 */ - enabledDates?: boolean | Array | any; + enabledDates?: boolean | Array | any; /** Will allow or disallow hour selections (much like disabledTimeIntervals) but will affect all days * @default: false * IMPORTANT! The getter returns an Object NOT an Array, with keys being the hours, values being true. @@ -403,17 +403,17 @@ export interface DatetimepickerOptions { /** See momentjs' docs for valid formats. Format also dictates what components are shown, e.g. MM/dd/YYYY will not display the time picker. * @default: false */ - format?: boolean | string | moment.MomentBuiltinFormat; + format?: boolean | string | moment.MomentBuiltinFormat; /** Change the default icons for the pickers functions. */ - icons?: Icons; + icons?: Icons; /** Allow date picker show event to fire even when the associated input element has the readonly="readonly"property. * @default: false */ - ignoreReadonly?: boolean; + ignoreReadonly?: boolean; /** Will display the picker inline without the need of a input field. This will also hide borders and shadows. * @default: false */ - inline?: boolean; + inline?: boolean; /** Allows for custom events to fire on keyboard press. * eg: keybinds: { * up: (widget) => console.log(widget), @@ -433,17 +433,17 @@ export interface DatetimepickerOptions { /** See momentjs for valid locales. You must include moment-with-locales.js or a local js file. * @default: moment.locale() */ - locale?: string; + locale?: string; /** Prevents date/time selections after this date. * maxDate will override defaultDate and useCurrent if either of these settings are the same day since both options are invalid according to the rules you've selected. * @default: false */ - maxDate?: boolean | moment.Moment | Date | string; + maxDate?: boolean | moment.Moment | Date | string; /** Prevents date/time selections before this date. * minDate will override defaultDate and useCurrent if either of these settings are the same day since both options are invalid according to the rules you've selected. * @default: false */ - minDate?: boolean | moment.Moment | Date | string; + minDate?: boolean | moment.Moment | Date | string; /** Allows custom input formatting For example: the user can enter "yesterday"" or "30 days ago". * {@link http://eonasdan.github.io/bootstrap-datetimepicker/Functions/#parseinputdate} */ @@ -452,7 +452,7 @@ export interface DatetimepickerOptions { * Clicking the "Clear" button will set the calendar to null. * @default: false */ - showClear?: boolean; + showClear?: boolean; /** Show the "Close" button in the icon toolbar. * Clicking the "Close" button will call hide() * @default: false @@ -462,11 +462,11 @@ export interface DatetimepickerOptions { * Clicking the "Today" button will set the calendar view and set the date to now. * @default: false */ - showTodayButton?: boolean; + showTodayButton?: boolean; /** Shows the picker side by side when using the time and date together. * @default: false */ - sideBySide?: boolean; + sideBySide?: boolean; /** Number of minutes the up/down arrow's will move the minutes value in the time picker * @default: 1 */ @@ -479,17 +479,17 @@ export interface DatetimepickerOptions { /** Changes the placement of the icon toolbar. * @default: "default" */ - toolbarPlacement?: "default" | "top" | "bottom"; + toolbarPlacement?: "default" | "top" | "bottom"; /** This will change the tooltips over each icon to a custom string */ tooltips?: Tooltips; /** On show, will set the picker to the current date/time * @default: true */ - useCurrent?: boolean; + useCurrent?: boolean; /** Defines if moment should use strict date parsing when considering a date to be valid * @default: false */ - useStrict?: boolean; + useStrict?: boolean; /** This will change the viewDate without changing or setting the selected date. * @default: false */ @@ -498,7 +498,7 @@ export interface DatetimepickerOptions { * Note: To limit the picker to selecting, for instance the year and month, use format: MM/YYYY * @default: "days" */ - viewMode?: "decades" | "years" | "months" | "days"; + viewMode?: "decades" | "years" | "months" | "days"; /** On picker show, places the widget at the identifier (string) or jQuery object if the element has css position: "relative" * @default: null */ @@ -520,7 +520,7 @@ export interface Icons { /** default: "glyphicon glyphicon-screenshot" */ previous?: string; /** default: "glyphicon glyphicon-chevron-right" */ - time?: string; + time?: string; /** default: "glyphicon glyphicon-chevron-down" */ today?: string; /** default: "glyphicon glyphicon-chevron-up" */ diff --git a/types/chocolatechipjs/index.d.ts b/types/chocolatechipjs/index.d.ts index 0e33e087c3..4c1d49f6d1 100644 --- a/types/chocolatechipjs/index.d.ts +++ b/types/chocolatechipjs/index.d.ts @@ -438,7 +438,7 @@ interface ChocolateChipStatic { /** * Serialize */ - serialize(form: HTMLFormElement | ChocolateChipElementArray): string; + serialize(form: HTMLFormElement | ChocolateChipElementArray): string; /** * Grabs values from a form and converts them into a JSON object. @@ -862,7 +862,7 @@ interface ChocolateChipElementArray extends Array { * @param property The property to remove. * @return HTMLElement[] */ - removeProp(property: string): ChocolateChipElementArray; + removeProp(property: string): ChocolateChipElementArray; /** * Adds the specified class(es) to each of the set of matched elements. diff --git a/types/d3-ease/index.d.ts b/types/d3-ease/index.d.ts index 3de6fd2e87..1f2b5f4cdd 100644 --- a/types/d3-ease/index.d.ts +++ b/types/d3-ease/index.d.ts @@ -87,7 +87,7 @@ export interface PolynomialEasingFactory { * * @param e Exponent for polynomial easing. */ - exponent(e: number): PolynomialEasingFactory; + exponent(e: number): PolynomialEasingFactory; } /** @@ -240,7 +240,7 @@ export interface BackEasingFactory { * * @param s Overshoot parameter */ - overshoot(s: number): BackEasingFactory; + overshoot(s: number): BackEasingFactory; } /** @@ -282,14 +282,14 @@ export interface ElasticEasingFactory { * * @param a Amplitude for elastic easing. */ - amplitude(a: number): ElasticEasingFactory; - /** - * Returns a new elastic easing with the specified amplitude a. - * Defaults to 0.3,if not specified. - * - * @param p Period for elastic easing. - */ - period(p: number): ElasticEasingFactory; + amplitude(a: number): ElasticEasingFactory; + /** + * Returns a new elastic easing with the specified amplitude a. + * Defaults to 0.3,if not specified. + * + * @param p Period for elastic easing. + */ + period(p: number): ElasticEasingFactory; } /** diff --git a/types/deepmerge/deepmerge-tests.ts b/types/deepmerge/deepmerge-tests.ts index 8c7988ba78..5467cb83f0 100644 --- a/types/deepmerge/deepmerge-tests.ts +++ b/types/deepmerge/deepmerge-tests.ts @@ -1,13 +1,19 @@ import * as deepmerge from "deepmerge"; -const x = { foo: { bar: 3 }, - array: [ { does: 'work', too: [ 1, 2, 3 ] } ] }; -const y = { foo: { baz: 4 }, +const x = { + foo: { bar: 3 }, + array: [{ does: 'work', too: [1, 2, 3] }] +}; +const y = { + foo: { baz: 4 }, quux: 5, - array: [ { does: 'work', too: [ 4, 5, 6 ] }, { really: 'yes' } ] }; + array: [{ does: 'work', too: [4, 5, 6] }, { really: 'yes' }] +}; -const expected = { foo: { bar: 3, baz: 4 }, - array: [ { does: 'work', too: [ 1, 2, 3, 4, 5, 6 ] }, { really: 'yes' } ], - quux: 5 }; +const expected = { + foo: { bar: 3, baz: 4 }, + array: [{ does: 'work', too: [1, 2, 3, 4, 5, 6] }, { really: 'yes' }], + quux: 5 +}; const result = deepmerge(x, y); diff --git a/types/dwt/index.d.ts b/types/dwt/index.d.ts index 9198ba80bf..460158afe1 100644 --- a/types/dwt/index.d.ts +++ b/types/dwt/index.d.ts @@ -9,12 +9,12 @@ * Product: Dynamsoft Web Twain * Web Site: http://www.dynamsoft.com * -* Copyright 2017, Dynamsoft Corporation +* Copyright 2017, Dynamsoft Corporation * Author: Dynamsoft Support Team * Version: 12.3 */ -/** +/** * @namespace Dynamsoft */ declare namespace Dynamsoft { @@ -86,16 +86,16 @@ declare enum EnumDWT_Cap { CAP_AUTHOR = 4096, /** A general note about the acquired image. */ CAP_CAPTION = 4097, - /** If TRUE, Source must acquire data from the document feeder acquire area and other feeder - * capabilities can be used. If FALSE, Source must acquire data from the non-feeder acquire area + /** If TRUE, Source must acquire data from the document feeder acquire area and other feeder + * capabilities can be used. If FALSE, Source must acquire data from the non-feeder acquire area * and no other feeder capabilities can be used. */ CAP_FEEDERENABLED = 4098, /** Reflect whether there are documents loaded in the Source's feeder. */ CAP_FEEDERLOADED = 4099, /** The date and time the image was acquired. - * Stored in the form "YYYY/MM/DD HH:mm:SS.sss" where YYYY is the year, MM is the - * numerical month, DD is the numerical day, HH is the hour, mm is the minute, SS is the second, + * Stored in the form "YYYY/MM/DD HH:mm:SS.sss" where YYYY is the year, MM is the + * numerical month, DD is the numerical day, HH is the hour, mm is the minute, SS is the second, * and sss is the millisecond. */ CAP_TIMEDATE = 4100, @@ -225,9 +225,9 @@ declare enum EnumDWT_Cap { * devices may all report the same serial number. */ CAP_SERIALNUMBER = 4132, - /** CapGet() returns the current list of available printer devices, along with the one currently being used for negotiation. + /** CapGet() returns the current list of available printer devices, along with the one currently being used for negotiation. * CapSet() selects the current device for negotiation, and optionally constrains the list. - * Top/Bottom refers to duplex devices, and indicates if the printer is writing on the top or the bottom of the sheet of paper. + * Top/Bottom refers to duplex devices, and indicates if the printer is writing on the top or the bottom of the sheet of paper. * Simplex devices use the top settings. Before/After indicates whether printing occurs before or after the sheet of paper has been scanned. */ CAP_PRINTER = 4134, @@ -250,8 +250,8 @@ declare enum EnumDWT_Cap { CAP_PRINTERSTRING = 4138, /** Specifies the string that shall be used as the current CAP_PRINTER device's suffix. */ CAP_PRINTERSUFFIX = 4139, - /** Allows Application and Source to identify which languages they have in common for the exchange of string data, - * and to select the language of the internal UI. Since the TWLG_xxxx codes include language and country data, there is no separate + /** Allows Application and Source to identify which languages they have in common for the exchange of string data, + * and to select the language of the internal UI. Since the TWLG_xxxx codes include language and country data, there is no separate * capability for selecting the country. */ CAP_LANGUAGE = 4140, @@ -282,21 +282,21 @@ declare enum EnumDWT_Cap { /** Added 1.91 */ CAP_CAMERASIDE = 4148, /** Added 1.91 */ - CAP_SEGMENTED = 4149, + CAP_SEGMENTED = 4149, /** Added 2.0 */ CAP_CAMERAENABLED = 4150, /** Added 2.0 */ - CAP_CAMERAORDER = 4151, + CAP_CAMERAORDER = 4151, /** Added 2.0 */ - CAP_MICRENABLED = 4152, + CAP_MICRENABLED = 4152, /** Added 2.0 */ - CAP_FEEDERPREP = 4153, + CAP_FEEDERPREP = 4153, /** Added 2.0 */ - CAP_FEEDERPOCKET = 4154, + CAP_FEEDERPOCKET = 4154, /** Added 2.1 */ CAP_AUTOMATICSENSEMEDIUM = 4155, /** Added 2.1 */ - CAP_CUSTOMINTERFACEGUID = 4156, + CAP_CUSTOMINTERFACEGUID = 4156, /** TRUE enables and FALSE disables the Source's Auto-brightness function (if any). */ ICAP_AUTOBRIGHT = 4352, /** The brightness values available within the Source. */ @@ -323,37 +323,37 @@ declare enum EnumDWT_Cap { */ ICAP_HIGHLIGHT = 4362, /** Informs the application which file formats the Source can generate (CapGet()). Tells the Source which file formats the application can handle (CapSet()). - * TWFF_TIFF Used for document - * TWFF_PICT Native Macintosh - * TWFF_BMP Native Microsoft - * TWFF_XBM Used for document - * TWFF_JFIF Wrapper for JPEG - * TWFF_FPX FlashPix, used with digital + * TWFF_TIFF Used for document + * TWFF_PICT Native Macintosh + * TWFF_BMP Native Microsoft + * TWFF_XBM Used for document + * TWFF_JFIF Wrapper for JPEG + * TWFF_FPX FlashPix, used with digital * TWFF_TIFFMULTI Multi-page TIFF files * TWFF_PNG An image format standard intended for use on the web, replaces GIF * TWFF_SPIFF A standard from JPEG, intended to replace JFIF, also supports JBIG - * TWFF_EXIF File format for use with digital cameras. + * TWFF_EXIF File format for use with digital cameras. */ ICAP_IMAGEFILEFORMAT = 4364, /** TRUE means the lamp is currently, or should be set to ON. Sources may not support CapSet() operations. */ ICAP_LAMPSTATE = 4365, /** Describes the general color characteristic of the light source used to acquire the image. */ ICAP_LIGHTSOURCE = 4366, - /** Defines which edge of the "paper" the image's "top" is aligned with. This information is used to adjust the frames to match the - * scanning orientation of the paper. For instance, if an ICAP_SUPPORTEDSIZE of TWSS_ISOA4 has been negotiated, - * and ICAP_ORIENTATION is set to TWOR_LANDSCAPE, then the Source must rotate the frame it downloads to the scanner to reflect the - * orientation of the paper. Please note that setting ICAP_ORIENTATION does not affect the values reported by ICAP_FRAMES; - * it just causes the Source to use them in a different way. The upper-left of the image is defined as the location where both the primary and + /** Defines which edge of the "paper" the image's "top" is aligned with. This information is used to adjust the frames to match the + * scanning orientation of the paper. For instance, if an ICAP_SUPPORTEDSIZE of TWSS_ISOA4 has been negotiated, + * and ICAP_ORIENTATION is set to TWOR_LANDSCAPE, then the Source must rotate the frame it downloads to the scanner to reflect the + * orientation of the paper. Please note that setting ICAP_ORIENTATION does not affect the values reported by ICAP_FRAMES; + * it just causes the Source to use them in a different way. The upper-left of the image is defined as the location where both the primary and * secondary scans originate. (The X axis is the primary scan direction and the Y axis is the secondary scan direction.) - * For a flatbed scanner, the light bar moves in the secondary scan direction. For a handheld scanner, the scanner is drug in the - * secondary scan direction. For a digital camera, the secondary direction is the vertical axis when the viewed image is considered upright. + * For a flatbed scanner, the light bar moves in the secondary scan direction. For a handheld scanner, the scanner is drug in the + * secondary scan direction. For a digital camera, the secondary direction is the vertical axis when the viewed image is considered upright. */ ICAP_ORIENTATION = 4368, /** The maximum physical width (X-axis) the Source can acquire (measured in units of ICAP_UNITS). */ ICAP_PHYSICALWIDTH = 4369, /** The maximum physical height (Y-axis) the Source can acquire (measured in units of ICAP_UNITS). */ ICAP_PHYSICALHEIGHT = 4370, - /** Specifies which value in an image should be interpreted as the darkest "shadow." All values + /** Specifies which value in an image should be interpreted as the darkest "shadow." All values * "darker" than this value will be clipped to this value. */ ICAP_SHADOW = 4371, @@ -387,13 +387,13 @@ declare enum EnumDWT_Cap { * appropriate in ICAP_PHYSICALHEIGHT and ICAP_PHYSICALWIDTH. */ ICAP_YRESOLUTION = 4377, - /** The maximum number of frames the Source can provide or the application can accept per page. + /** The maximum number of frames the Source can provide or the application can accept per page. * This is a bounding capability only. It does not establish current or future behavior. */ ICAP_MAXFRAMES = 4378, /** This is used with buffered memory transfers. If TRUE, Source can provide application with tiled image data. */ ICAP_TILES = 4379, - /** Specifies how the bytes in an image are filled by the Source. TWBO_MSBFIRST indicates that the leftmost bit in the byte (usually bit 7) is + /** Specifies how the bytes in an image are filled by the Source. TWBO_MSBFIRST indicates that the leftmost bit in the byte (usually bit 7) is * the byte's Most Significant Bit. */ ICAP_BITORDER = 4380, @@ -416,8 +416,8 @@ declare enum EnumDWT_Cap { * rotation specified in ICAP_ORIENTATION. */ ICAP_ROTATION = 4385, - /** For devices that support fixed frame sizes. - * Defined sizes match typical page sizes. This specifies the size(s) the Source can/should use to acquire image data. + /** For devices that support fixed frame sizes. + * Defined sizes match typical page sizes. This specifies the size(s) the Source can/should use to acquire image data. */ ICAP_SUPPORTEDSIZES = 4386, /** Specifies the dividing line between black and white. This is the value the Source will use to @@ -427,17 +427,17 @@ declare enum EnumDWT_Cap { ICAP_THRESHOLD = 4387, /** All the X-axis scaling values available. A value of '1.0' is equivalent to 100% scaling. Do not use values less than or equal to zero. */ ICAP_XSCALING = 4388, - /** All the Y-axis scaling values available. A value of '1.0' is equivalent to 100% scaling. Do not use values less than or equal to zero. + /** All the Y-axis scaling values available. A value of '1.0' is equivalent to 100% scaling. Do not use values less than or equal to zero. * There are no units inherent with this data as it is normalized to 1.0 being "unscaled." */ ICAP_YSCALING = 4389, /** Used for CCITT data compression only. Indicates the bit order representation of the stored compressed codes. */ ICAP_BITORDERCODES = 4390, - /** Used only for CCITT data compression. Specifies whether the compressed codes' pixel "sense" + /** Used only for CCITT data compression. Specifies whether the compressed codes' pixel "sense" * will be inverted from the Current value of ICAP_PIXELFLAVOR prior to transfer. */ ICAP_PIXELFLAVORCODES = 4391, - /** Allows the application and Source to agree upon a common set of color descriptors that are + /** Allows the application and Source to agree upon a common set of color descriptors that are * made available by the Source. This ICAP is only useful for JPEG-compressed buffered memory image transfers. */ ICAP_JPEGPIXELTYPE = 4392, @@ -458,7 +458,7 @@ declare enum EnumDWT_Cap { * the scanned image is rotated or merged with another scanned image. */ ICAP_UNDEFINEDIMAGESIZE = 4397, - /** Allows the application to query the data source to see if it supports extended image attribute capabilities, + /** Allows the application to query the data source to see if it supports extended image attribute capabilities, * such as Barcode Recognition, Shaded Area Detection and Removal, Skew detection and Removal, and so on. */ ICAP_EXTIMAGEINFO = 4399, @@ -480,7 +480,7 @@ declare enum EnumDWT_Cap { ICAP_AUTODISCARDBLANKPAGES = 4404, /** Flip rotation is used to properly orient images that flip orientation every other image. * TWFR_BOOK The images to be scanned are viewed in book form, flipping each page from left to right or right to left. - * TWFR_FANFOLD The images to be scanned are viewed in fanfold paper style, flipping each page up or down. + * TWFR_FANFOLD The images to be scanned are viewed in fanfold paper style, flipping each page up or down. */ ICAP_FLIPROTATION = 4406, /** Turns bar code detection on and off. */ @@ -514,77 +514,77 @@ declare enum EnumDWT_Cap { /** Restricts the total time spent on searching for a patch code on each page. */ ICAP_PATCHCODETIMEOUT = 4421, /** For devices that support flash. CapSet() selects the flash to be used (if any). CapGet() reports the current setting. - * This capability replaces ICAP_FLASHUSED, which is only able to negotiate the flash being on or off. + * This capability replaces ICAP_FLASHUSED, which is only able to negotiate the flash being on or off. */ ICAP_FLASHUSED2 = 4422, /** For devices that support image enhancement filtering. This capability selects the algorithm used to improve the quality of the image. */ ICAP_IMAGEFILTER = 4423, /** For devices that support noise filtering. This capability selects the algorithm used to remove noise. */ ICAP_NOISEFILTER = 4424, - /** Overscan is used to scan outside of the boundaries described by ICAP_FRAMES, and is used to help acquire image data that + /** Overscan is used to scan outside of the boundaries described by ICAP_FRAMES, and is used to help acquire image data that * may be lost because of skewing. - * This is primarily of use for transport scanners which rely on edge detection to begin scanning. - * If overscan is supported, then the device is capable of scanning in the inter-document gap to get the skewed image information. + * This is primarily of use for transport scanners which rely on edge detection to begin scanning. + * If overscan is supported, then the device is capable of scanning in the inter-document gap to get the skewed image information. */ ICAP_OVERSCAN = 4425, /** Turns automatic border detection on and off. */ ICAP_AUTOMATICBORDERDETECTION = 4432, /** Turns automatic deskew correction on and off. */ ICAP_AUTOMATICDESKEW = 4433, - /** When TRUE this capability depends on intelligent features within the Source to automatically + /** When TRUE this capability depends on intelligent features within the Source to automatically * rotate the image to the correct position. */ ICAP_AUTOMATICROTATE = 4434, /** Added 1.9 */ ICAP_JPEGQUALITY = 4435, /** Added 1.91 */ - ICAP_FEEDERTYPE = 4436, + ICAP_FEEDERTYPE = 4436, /** Added 1.91 */ ICAP_ICCPROFILE = 4437, /** Added 2.0 */ - ICAP_AUTOSIZE = 4438, + ICAP_AUTOSIZE = 4438, /** Added 2.1 */ - ICAP_AUTOMATICCROPUSESFRAME = 4439, + ICAP_AUTOMATICCROPUSESFRAME = 4439, /** Added 2.1 */ ICAP_AUTOMATICLENGTHDETECTION = 4440, /** Added 2.1 */ - ICAP_AUTOMATICCOLORENABLED = 4441, + ICAP_AUTOMATICCOLORENABLED = 4441, /** Added 2.1 */ - ICAP_AUTOMATICCOLORNONCOLORPIXELTYPE = 4442, + ICAP_AUTOMATICCOLORNONCOLORPIXELTYPE = 4442, /** Added 2.1 */ ICAP_COLORMANAGEMENTENABLED = 4443, /** Added 2.1 */ - ICAP_IMAGEMERGE = 4444, + ICAP_IMAGEMERGE = 4444, /** Added 2.1 */ ICAP_IMAGEMERGEHEIGHTTHRESHOLD = 4445, /** Added 2.1 */ - ICAP_SUPPORTEDEXTIMAGEINFO = 4446 + ICAP_SUPPORTEDEXTIMAGEINFO = 4446 } -/** Capabilities exist in many varieties but all have a Default Value, Current Value, and may have other values available that can be supported if selected. - * To help categorize the supported values into clear structures, TWAIN defines four types of containers for capabilities = +/** Capabilities exist in many varieties but all have a Default Value, Current Value, and may have other values available that can be supported if selected. + * To help categorize the supported values into clear structures, TWAIN defines four types of containers for capabilities = * TW_ONEVALUE, TW_ARRAY, TW_RANGE and TW_ENUMERATION. */ declare enum EnumDWT_CapType { /** Nothing. */ TWON_NONE = 0, - /** A rectangular array of values that describe a logical item. It is similar to the TW_ONEVALUE because the current and default values are the same and - * there are no other values to select from. For example, a list of the names, such as the supported capabilities list returned by the CAP_SUPPORTEDCAPS - * capability, would use this type of container. + /** A rectangular array of values that describe a logical item. It is similar to the TW_ONEVALUE because the current and default values are the same and + * there are no other values to select from. For example, a list of the names, such as the supported capabilities list returned by the CAP_SUPPORTEDCAPS + * capability, would use this type of container. */ TWON_ARRAY = 3, - /** This is the most general type because it defines a list of values from which the Current Value can be chosen. - * The values do not progress uniformly through a range and there is not a consistent step size between the values. - * For example, if a Source's resolution options do not occur in even step sizes then an enumeration would be used (for example, 150, 400, and 600). + /** This is the most general type because it defines a list of values from which the Current Value can be chosen. + * The values do not progress uniformly through a range and there is not a consistent step size between the values. + * For example, if a Source's resolution options do not occur in even step sizes then an enumeration would be used (for example, 150, 400, and 600). */ TWON_ENUMERATION = 4, /** A single value whose current and default values are coincident. The range of available values for this type of capability is simply this single value. * For example, a capability that indicates the presence of a document feeder could be of this type. */ TWON_ONEVALUE = 5, - /** Many capabilities allow users to select their current value from a range of regularly spaced values. + /** Many capabilities allow users to select their current value from a range of regularly spaced values. * The capability can specify the minimum and maximum acceptable values and the incremental step size between the values. - * For example, resolution might be supported from 100 to 600 in steps of 50 (100, 150, 200, ..., 550, 600). + * For example, resolution might be supported from 100 to 600 in steps of 50 (100, 150, 200, ..., 550, 600). */ TWON_RANGE = 6 } @@ -600,23 +600,23 @@ declare enum EnumDWT_TransferMode { /** Buffered Memory Mode Transfers. */ TWSX_MEMORY = 2, /** added 1.91 */ - TWSX_MEMFILE = 4 + TWSX_MEMFILE = 4 } /** ICAP_IMAGEFILEFORMAT values. */ declare enum EnumDWT_FileFormat { /** Used for document imaging. Tagged Image File Format */ - TWFF_TIFF = 0, + TWFF_TIFF = 0, /** Native Macintosh format. Macintosh PICT */ - TWFF_PICT = 1, + TWFF_PICT = 1, /** Native Microsoft format. Windows Bitmap */ - TWFF_BMP = 2, + TWFF_BMP = 2, /** Used for document imaging. X-Windows Bitmap */ - TWFF_XBM = 3, + TWFF_XBM = 3, /** Wrapper for JPEG images. JPEG File Interchange Format */ - TWFF_JFIF = 4, + TWFF_JFIF = 4, /** FlashPix, used with digital cameras. Flash Pix */ - TWFF_FPX = 5, + TWFF_FPX = 5, /** Multi-page TIFF files. Multi-page tiff file */ TWFF_TIFFMULTI = 6, /** An image format standard intended for use on the web, replaces GIF. */ @@ -626,19 +626,19 @@ declare enum EnumDWT_FileFormat { /** File format for use with digital cameras. */ TWFF_EXIF = 9, /** A file format from Adobe. 1.91 NB: this is not PDF/A */ - TWFF_PDF = 10, + TWFF_PDF = 10, /** A file format from the Joint Photographic Experts Group. 1.91 */ - TWFF_JP2 = 11, + TWFF_JP2 = 11, /** 1.91 */ - TWFF_JPN = 12, + TWFF_JPN = 12, /** 1.91 */ - TWFF_JPX = 13, + TWFF_JPX = 13, /** A file format from LizardTech. 1.91 */ - TWFF_DEJAVU = 14, + TWFF_DEJAVU = 14, /** A file format from Adobe. 2.0 */ - TWFF_PDFA = 15, + TWFF_PDFA = 15, /** 2.1 Adobe PDF/A, Version 2 */ - TWFF_PDFA2 = 16 + TWFF_PDFA2 = 16 } /** TIFF file compression type. */ @@ -718,29 +718,29 @@ declare enum EnumDWT_ShowMode { declare enum EnumDWT_CapValueType { TWTY_INT8 = 0, /** Means Item is a TW_INT16 */ - TWTY_INT16 = 1, + TWTY_INT16 = 1, /** Means Item is a TW_INT32 */ - TWTY_INT32 = 2, + TWTY_INT32 = 2, /** Means Item is a TW_UINT8 */ - TWTY_UINT8 = 3, + TWTY_UINT8 = 3, /** Means Item is a TW_UINT16 */ - TWTY_UINT16 = 4, + TWTY_UINT16 = 4, /** Means Item is a TW_int */ - TWTY_int = 5, + TWTY_int = 5, /** Means Item is a TW_BOOL */ - TWTY_BOOL = 6, + TWTY_BOOL = 6, /** Means Item is a TW_FIX32 */ - TWTY_FIX32 = 7, + TWTY_FIX32 = 7, /** Means Item is a TW_FRAME */ - TWTY_FRAME = 8, + TWTY_FRAME = 8, /** Means Item is a TW_STR32 */ - TWTY_STR32 = 9, + TWTY_STR32 = 9, /** Means Item is a TW_STR64 */ - TWTY_STR64 = 10, + TWTY_STR64 = 10, /** Means Item is a TW_STR128 */ - TWTY_STR128 = 11, + TWTY_STR128 = 11, /** Means Item is a TW_STR255 */ - TWTY_STR255 = 12 + TWTY_STR255 = 12 } /** ICAP_UNITS values. */ @@ -764,33 +764,33 @@ declare enum EnumDWT_DUPLEX { /** CAP_LANGUAGE values. */ declare enum EnumDWT_CapLanguage { /** Danish */ - TWLG_DAN = 0, + TWLG_DAN = 0, /** Dutch */ - TWLG_DUT = 1, + TWLG_DUT = 1, /** International English */ - TWLG_ENG = 2, + TWLG_ENG = 2, /** French Canadian */ - TWLG_FCF = 3, + TWLG_FCF = 3, /** Finnish */ - TWLG_FIN = 4, + TWLG_FIN = 4, /** French */ - TWLG_FRN = 5, + TWLG_FRN = 5, /** German */ - TWLG_GER = 6, + TWLG_GER = 6, /** Icelandic */ - TWLG_ICE = 7, + TWLG_ICE = 7, /** Italian */ - TWLG_ITN = 8, + TWLG_ITN = 8, /** Norwegian */ - TWLG_NOR = 9, + TWLG_NOR = 9, /** Portuguese */ - TWLG_POR = 10, + TWLG_POR = 10, /** Spanish */ - TWLG_SPA = 11, + TWLG_SPA = 11, /** Swedish */ - TWLG_SWE = 12, + TWLG_SWE = 12, /** U.S. English */ - TWLG_USA = 13, + TWLG_USA = 13, /** Added for 1.8 */ TWLG_USERLOCALE = -1, TWLG_AFRIKAANS = 14, @@ -811,7 +811,7 @@ declare enum EnumDWT_CapLanguage { TWLG_ARABIC_SYRIA = 29, TWLG_ARABIC_TUNISIA = 30, /** United Arabic Emirates */ - TWLG_ARABIC_UAE = 31, + TWLG_ARABIC_UAE = 31, TWLG_ARABIC_YEMEN = 32, TWLG_BASQUE = 33, TWLG_BYELORUSSIAN = 34, @@ -820,7 +820,7 @@ declare enum EnumDWT_CapLanguage { TWLG_CHINESE = 37, TWLG_CHINESE_HONGKONG = 38, /** People's Republic of China */ - TWLG_CHINESE_PRC = 39, + TWLG_CHINESE_PRC = 39, TWLG_CHINESE_SINGAPORE = 40, TWLG_CHINESE_SIMPLIFIED = 41, TWLG_CHINESE_TAIWAN = 42, @@ -924,7 +924,7 @@ declare enum EnumDWT_CapSupportedSizes { TWSS_USLETTER = 3, /** 4 */ TWSS_USLEGAL = 4, - /** Added 1.5 + /** Added 1.5 * 5 */ TWSS_A5 = 5, @@ -932,7 +932,7 @@ declare enum EnumDWT_CapSupportedSizes { TWSS_B4 = 6, /** 7 */ TWSS_B6 = 7, - /** Added 1.7 + /** Added 1.7 * 9 */ TWSS_USLEDGER = 9, @@ -950,7 +950,7 @@ declare enum EnumDWT_CapSupportedSizes { TWSS_C5 = 15, /** 16 */ TWSS_C6 = 16, - /** Added 1.8 + /** Added 1.8 * 17 */ TWSS_4A0 = 17, @@ -1037,7 +1037,7 @@ declare enum EnumDWT_CapSupportedSizes { /** 53 */ TWSS_BUSINESSCARD = 53, /** 54. Added 2.1 */ - TWSS_MAXSIZE = 54 + TWSS_MAXSIZE = 54 } /** CAP_FEEDERALIGNMENT values. */ @@ -1046,7 +1046,7 @@ declare enum EnumDWT_CapFeederAlignment { TWFA_NONE = 0, /** The alignment is to the left. */ TWFA_LEFT = 1, - /** The alignment is centered. This means that the paper will be fed in the middle of the ICAP_PHYSICALWIDTH of the + /** The alignment is centered. This means that the paper will be fed in the middle of the ICAP_PHYSICALWIDTH of the * device. If this is set, then the Application should calculate any frames with a left offset of zero. */ TWFA_CENTER = 2, @@ -1162,11 +1162,11 @@ declare enum EnumDWT_CapLightSource { /** TWEI_MAGTYPE values. (MD_ means Mag Type) Added 2.0 */ declare enum EnumDWT_MagType { /** Added 2.0 */ - TWMD_MICR = 0, + TWMD_MICR = 0, /** added 2.1 */ - TWMD_RAW = 1, + TWMD_RAW = 1, /** added 2.1 */ - TWMD_INVALID = 2 + TWMD_INVALID = 2 } /** ICAP_NOISEFILTER values. */ @@ -1186,11 +1186,11 @@ declare enum EnumDWT_CapORientation { TWOR_PORTRAIT = 0, TWOR_LANDSCAPE = 3, /** 2.0 */ - TWOR_AUTO = 4, + TWOR_AUTO = 4, /** 2.0 */ - TWOR_AUTOTEXT = 5, + TWOR_AUTOTEXT = 5, /** 2.0 */ - TWOR_AUTOPICTURE = 6 + TWOR_AUTOPICTURE = 6 } /** ICAP_OVERSCAN values. */ @@ -1205,9 +1205,9 @@ declare enum EnumDWT_CapOverscan { /** ICAP_PIXELFLAVOR values. */ declare enum EnumDWT_CapPixelFlavor { /** Zero pixel represents darkest shade. zero pixel represents darkest shade */ - TWPF_CHOCOLATE = 0, + TWPF_CHOCOLATE = 0, /** Zero pixel represents lightest shade. zero pixel represents lightest shade */ - TWPF_VANILLA = 1 + TWPF_VANILLA = 1 } /** ICAP_PLANARCHUNKY values. */ @@ -1253,825 +1253,825 @@ declare enum EnumDWT_MouseShape { /** * @class */ -// properties (get/set) / sync functions +// properties (get/set) / sync functions interface WebTwain { - /** + /** * Returns or sets whether multi-page selection is supported. * @type {bool} */ AllowMultiSelect: boolean; - /** + /** * [Deprecated.] Returns or sets whether allowing the plugin to send authentication request. The default value of this property is TRUE. * @type {bool} */ AllowPluginAuthentication: boolean; - /** + /** * [Deprecated.] Returns or sets whether the async mode is activated. With this mode, Dynamic Web TWAIN is able to upload/download files via HTTP/FTP asynchronously. The default value is false. * @type {bool} */ AsyncMode: boolean; - /** + /** * Returns or sets the background color of the main control. It is a value specifying the 24-bit RGB value. * @type {int} */ BackgroundColor: number; - /** + /** * Returns or sets the fill color of the selected area of an image when it is cut, erased or rotated. It is a value specifying the 24-bit RGB value. * @type {int} */ BackgroundFillColor: number; - /** + /** * [Deprecated.] Returns the number of barcode detected in an image. * @type {int} */ BarcodeCount: number; - /** + /** * Returns or sets the pixel bit depths for the current value of PixelType property. This is a runtime property. * @type {short} */ BitDepth: number; - /** + /** * Returns the current deviation of the pixels in the image. * @type {float} */ BlankImageCurrentStdDev: number; - /** + /** * Returns or sets the standard deviation of the pixels in the image. * @type {float} */ BlankImageMaxStdDev: number; - /** + /** * Returns or sets the dividing line between black and white. The default value is 128. * @type {int} */ BlankImageThreshold: number; - /** + /** * [Deprecated.] Returns or sets the border style. * @type {EnumDWT_BorderStyle} */ BorderStyle: EnumDWT_BorderStyle; - /** + /** * Returns or sets the brightness values available within the Source. This is a runtime property. * @type {float} */ Brightness: number; - /** + /** * [Deprecated.] Sets or returns whether brokerprocess is enabled for scanning. * @type {int} */ BrokerProcessType: number; - - /** + + /** * Sets or returns how much physical memory is allowed for storing images currently loaded in Dynamic Web TWAIN. Once the limit is reached, images will be cached on the hard disk. * @type {int} */ BufferMemoryLimit: number; - /** + /** * Specifies the capabiltiy to be negotiated. This is a runtime property. * @type {EnumDWT_Cap} */ Capability: EnumDWT_Cap; - /** + /** * Sets or returns the index (0-based) of a list to indicate the Current Value when the value of the CapType property is TWON_ENUMERATION. If the data type of the capability is String, the list is in CapItemsString property. For other data types, the list is in CapItems property. This is a runtime property. * @type {int} */ CapCurrentIndex: number; - /** + /** * Sets or returns the current value in a range when the value of the CapType property is TWON_RANGE. This is a runtime property. * @type {double} */ CapCurrentValue: number; - /** + /** * Returns the index (0-based) of a list to indicate the Default Value when the value of the CapType property is TWON_ENUMERATION. If the data type of the capability is String, the list is in CapItemsString property. For other data types, the list is in CapItems property. This is a runtime, read-only property. * @type {int} */ CapDefaultIndex: number; - /** - * Returns the default value in a range when the value of the CapType property is TWON_RANGE. This is a runtime, read-only property. + /** + * Returns the default value in a range when the value of the CapType property is TWON_RANGE. This is a runtime, read-only property. * @type {double} */ CapDefaultValue: number; - /** + /** * Sets or returns the maximum value in a range when the value of the CapType property is TWON_RANGE. This is a runtime property. * @type {double} */ CapMaxValue: number; - /** + /** * Sets or returns the minimum value in a range when the value of the CapType property is TWON_RANGE. This is a runtime property. * @type {double} */ CapMinValue: number; - /** + /** * [Deprecated.] Sets or returns how many items are in the list when the value of the CapType property is TWON_ARRAY or TWON_ENUMERATION. For String data type, the list is in CapItemsString property. For other data types, the list is in CapItems property. This is a runtime property. * @type {int} */ CapNumItems: number; - - /** - * [Deprecated.] Replaced by GetCapItemsString method and SetCapItemsString method. + + /** + * [Deprecated.] Replaced by GetCapItemsString method and SetCapItemsString method. * @type {string} */ - CapItemsString: string; + CapItemsString: string; - /** + /** * Sets or returns the step size in a range when the value of the CapType property is TWON_RANGE. This is a runtime property. * @type {double} */ CapStepSize: number; - /** + /** * Sets or returns the type of capability container used to exchange capability information between application and source. This is a runtime property. * @type {EnumDWT_CapType} */ CapType: EnumDWT_CapType; - /** + /** * Returns or sets the value of the capability specified by Capability property when the value of the CapType property is TWON_ONEVALUE. This is a runtime property. * @type {double} */ CapValue: number; - /** + /** * Sets or returns the string value for a capability when the value of the CapType property is TWON_ONEVALUE. This is a runtime property. * @type {string} */ CapValueString: string; - - /** + + /** * Sets or returns the value type for reading the value of a capability. This is a runtime property. * @type {short} */ CapValueType: number; - /** + /** * Returns or sets the contrast values available within the Source. This is a runtime property. * @type {float} */ Contrast: number; - /** + /** * Sets or returns the product name string for the application identity. * @type {string} */ ProductName: string; - /** + /** * Returns or sets current index of image in buffer. This is a runtime property. * @type {short} */ CurrentImageIndexInBuffer: number; - /** + /** * Returns the device name of current source. This is a runtime, read-only property. * @type {string} */ CurrentSourceName: string; - /** + /** * Returns the value indicating the data source status. This is a runtime, read-only property. * @type {int} */ DataSourceStatus: number; - /** + /** * Returns the device name of default source. This is a runtime, read-only property. * @type {string} */ DefaultSourceName: string; - /** + /** * Returns whether the source supports duplex. If so, it further returns the level of duplex the Source supports (one pass or two pass duplex). This is a runtime, read-only property. * @type {int} */ Duplex: number; - /** + /** * [Deprecated.] Returns or sets whether the user can zoom image using hot key. * @type {bool} */ EnableInteractiveZoom: boolean; - /** + /** * Returns the error code. This is a runtime, read-only property. * @type {int} */ ErrorCode: number; - /** + /** * Returns the error string. This is a runtime, read-only property. * @type {string} */ ErrorString: string; - /** + /** * Returns or sets whether to resize the image to fit the image to the width or height of the window. To use the property, the view mode should be set to -1 by -1. You can use SetViewMode method to set the view mode. * @type {EnumDWT_FitWindowType} */ FitWindowType: EnumDWT_FitWindowType; - /** + /** * Returns or sets the password used to log into the FTP server. * @type {string} */ FTPPassword: string; - /** + /** * Returns or sets the port number of the FTP server. * @type {int} */ FTPPort: number; - /** + /** * Returns or sets the user name used to log into the FTP server. * @type {string} */ FTPUserName: string; - /** + /** * Returns how many images are in buffer. This is a runtime, read-only property. * @type {short} */ HowManyImagesInBuffer: number; - /** + /** * Specifies the field name of uploaded image through POST. * @type {string} */ HttpFieldNameOfUploadedImage: string; - /** + /** * [Deprecated.] Sets or returns the password used to log into the HTTP server. * @type {string} */ HTTPPassword: string; - /** + /** * Returns or sets the port number of the HTTP server. * @type {int} */ HTTPPort: number; - /** + /** * Returns the response string from the HTTP server if an error occurs for HTTPUploadThroughPost() method. This is a runtime, read-only property. * @type {string} */ HTTPPostResponseString: string; - /** + /** * [Deprecated.] Returns or sets the user name used to log into the HTTP server. * @type {string} */ HTTPUserName: string; - /** + /** * Returns or sets whether the feature of disk caching is enabled. * @type {bool} */ IfAllowLocalCache: boolean; - /** + /** * Returns or sets whether insert or append new scanned images. * @type {bool} */ IfAppendImage: boolean; - /** + /** * Returns or sets whether the Source's Auto-brightness function is enabled. This is a runtime property. * @type {bool} */ IfAutoBright: boolean; - /** + /** * Returns or sets whether the data source (scanner) will discard blank images during scanning. The property works only if the device and its driver support discarding blank pages. You can find whether your device supports this capbility from its user manual. Or, you can use the built-in methods of Dynamic Web TWAIN to detect blank images: IsBlankImage, IsBlankImageEx. * @type {bool} */ IfAutoDiscardBlankpages: boolean; - /** + /** * Returns or sets whether the Source enable automatic document feeding process. This is a runtime property. * @type {bool} */ IfAutoFeed: boolean; - /** - * Turns automatic border detection on and off. The property works only if the device and its driver support detecting the border automatically. You can find whether your device supports this capbility from its user manual. + /** + * Turns automatic border detection on and off. The property works only if the device and its driver support detecting the border automatically. You can find whether your device supports this capbility from its user manual. * @type {bool} */ IfAutomaticBorderDetection: boolean; - /** + /** * Turns automatic skew correction on and off. * @type {bool} */ IfAutomaticDeskew: boolean; - /** + /** * Returns or sets whether the Source enables the automatic document scanning process. This is a runtime property. * @type {bool} */ IfAutoScan: boolean; - /** + /** * Returns or sets whether close the Data Source User Interface after acquire all images. Default value of this property is FALSE. * @type {bool} */ IfDisableSourceAfterAcquire: boolean; - /** + /** * Returns or sets whether the Source supports duplex. If TRUE, the scanner scans both sides of a paper; otherwise, the scanner will scan only one side of the image. This is a runtime property. * @type {bool} */ IfDuplexEnabled: boolean; - /** + /** * Returns or sets whether the Automatic Document Feeder (ADF) is enabled. This is a runtime property. * @type {bool} */ IfFeederEnabled: boolean; - /** + /** * Returns whether or not there are documents loaded in the Source's feeder when IfFeederEnabled and IfPaperDetectable are TRUE. This is a runtime, read-only property. * @type {bool} */ IfFeederLoaded: boolean; - /** + /** * Returns or sets whether to resize the image to fit the size of window when the view mode is set to -1 by -1. You can use SetViewMode method to set the view mode. * @type {bool} */ IfFitWindow: boolean; - /** + /** * [Deprecated.] Returns or sets whether the UI (User Interface) of Source runs in modal state. Default value of this property is TRUE. * @type {bool} */ IfModalUI: boolean; - /** + /** * Sets or returns whether Dynamic Web TWAIN uses Graphics Device Interface (GDI) when decoding images. * @type {bool} */ IfOpenImageWithGDIPlus: boolean; - /** + /** * Returns the value whether the Source has a paper sensor that can detect documents on the ADF or Flatbed. This is a runtime, read-only property. * @type {bool} */ IfPaperDetectable: boolean; - /** + /** * Returns or sets whether FTP passive mode is enabled. * @type {bool} */ IfPASVMode: boolean; - /** + /** * [Deprecated.] Returns or sets whether communicate with device in a separate thread. Default value of this property is FALSE. * @type {bool} */ IfScanInNewThread: boolean; - /** + /** * Sets or returns whether to show the cancel dialog when uploading images to server. * @type {bool} */ IfShowCancelDialogWhenImageTransfer: boolean; - /** + /** * Returns or sets whether to show the file dialog box when saving scanned images or loading images from local folder. * @type {bool} */ IfShowFileDialog: boolean; - /** + /** * Returns or sets whether the Source displays a progress indicator during acquisition and transfer, regardless of whether the Source's user interface is active. This is a runtime property. * @type {bool} */ IfShowIndicator: boolean; - /** + /** * [Deprecated.] Returns or sets whether the driver of the printer displays the User Interface. * @type {bool} */ IfShowPrintUI: boolean; - /** + /** * Returns or sets whether the progress bar will be displayed during the transaction. This is a runtime property. * @type {bool} */ IfShowProgressBar: boolean; - /** + /** * Returns or sets whether the Source displays the User Interface. * @type {bool} */ IfShowUI: boolean; - /** + /** * Returns or sets whether SSL is used when uploading or downloading images. * @type {bool} */ IfSSL: boolean; - /** + /** * Return or sets whether the Source allows to save many images in one TIFF file. The default value is FALSE. * @type {bool} */ IfTiffMultiPage: boolean; - /** + /** * Returns whether the Source supports acquisition with the UI (User Interface) disabled. If FALSE, indicates that this Source can only support acquisition with the UI enabled. This is a runtime, read-only property. * @type {bool} */ IfUIControllable: boolean; - /** + /** * Sets or returns whether Dynamic Web TWAIN uses the new TWAIN Data Source Manager (TWAINDSM.dll) when acquiring images from TWAIN devices. * @type {bool} */ IfUseTwainDSM: boolean; - - /** + + /** * Specifies whether or not to automatically scroll to the last image or stay on the current image when loading or acquiring images * @type {bool} */ - IfAutoScroll: boolean; - - /** + IfAutoScroll: boolean; + + /** * [Deprecated.] The number of bits in each image pixel (or bit depth). This is a runtime, read-only property. * @type {short} */ ImageBitsPerPixel: number; - /** + /** * Returns or sets whether a TWAIN driver or Native Scan of Mac OS X is used for document scanning. This property works for Mac edition only. * @type {int} */ ImageCaptureDriverType: number; - /** + /** * [Deprecated.] Returns or sets whether the image enumerator is enabled in Image Editor. * @type {bool} */ ImageEditorIfEnableEnumerator: boolean; - /** + /** * [Deprecated.] Returns or sets whether the Image Editor is a modal window. * @type {bool} */ ImageEditorIfModal: boolean; - /** + /** * [Deprecated.] Returns or sets whether the Image Editor is read-only. * @type {bool} */ ImageEditorIfReadonly: boolean; - /** + /** * [Deprecated.] Returns or sets the title of Image Editor window. * @type {string} */ ImageEditorWindowTitle: string; - /** + /** * Returns the document number of the current image. This is a runtime, read-only property. * @type {int} */ ImageLayoutDocumentNumber: number; - /** + /** * Returns the value of the bottom-most edge of the current image frame (in Unit). This is a read-only runtime property. * @type {float} */ ImageLayoutFrameBottom: number; - /** + /** * Returns the value of the left-most edge of the current image frame (in Unit). This is a runtime, read-only property. * @type {float} */ ImageLayoutFrameLeft: number; - /** + /** * Returns the frame number of the current image. This is a runtime, read-only property. * @type {int} */ ImageLayoutFrameNumber: number; - /** + /** * Returns the value of the right-most edge of the current image frame (in Unit). This is a runtime, read-only property. * @type {float} */ ImageLayoutFrameRight: number; - /** + /** * Returns the value of the top-most edge of the current image frame (in Unit). This is a runtime, read-only property. * @type {float} */ ImageLayoutFrameTop: number; - /** + /** * Returns the page number of the current image. This is a runtime, read-only property. * @type {Long} */ ImageLayoutPageNumber: number; - /** + /** * [Deprecated.] Returns how tall/long, in pixels, the image is. This is a runtime, read-only property. * @type {int} */ ImageLength: number; - /** + /** * Returns or sets the margin between images when multiple images are displayed in Dynamic Web TWAIN. * @type {short} */ ImageMargin: number; - /** + /** * Returns the pixel type of the current image. This is a runtime, read-only property. Please note the property is only valid in OnPreTransfer and OnPostTransfer event. * @type {EnumDWT_PixelType} */ ImagePixelType: EnumDWT_PixelType; - /** + /** * [Deprecated.] Returns how width, in pixels, the image is. This is a runtime, read-only property. * @type {int} */ ImageWidth: number; - /** + /** * [Deprecated.] Returns the X resolution of the current image. X resolution is the number of pixels per Unit in the horizontal direction. This is a runtime, read-only property. * @type {float} */ ImageXResolution: number; - /** + /** * [Deprecated.] Returns the Y resolution of the current image. Y resolution is the number of pixels per Unit in the vertical direction. This is a runtime, read-only property. * @type {float} */ ImageYResolution: number; - /** + /** * Returns or sets the quality of JPEG files and PDF files using JPEG compression. * @type {short} */ JPEGQuality: number; - /** + /** * Returns or sets the log level for debugging. * @type {short} */ LogLevel: number; - /** + /** * Return the magnetic data if the scanner support magnetic data recognition. * @type {string} */ MagData: string; - /** + /** * Return the magnetic type if the scanner support magnetic data recognition. * @type {short} */ MagType: number; - /** + /** * Sets or returns the manufacture string for the application identity. * @type {string} */ Manufacturer: string; - /** - * Returns or sets the maximum number of images can be held in buffer. + /** + * Returns or sets the maximum number of images can be held in buffer. * @type {short} */ MaxImagesInBuffer: number; - /** + /** * [Deprecated.] Returns or sets how many threads can be used when you upload files through POST. * @type {int} */ MaxInternetTransferThreads: number; - /** + /** * Sets or returns the maximum allowed size when Dynamic Web TWAIN uploads a document. * @type {int} */ MaxUploadImageSize: number; - /** + /** * Returns or sets the shape of the mouse. * @type {bool} */ MouseShape: boolean; - /** + /** * Returns the X co-ordinate of the mouse. This is a runtime property. * @type {int} */ MouseX: number; - /** + /** * Returns the Y co-ordinate of the mouse. This is a runtime property. * @type {int} */ MouseY: number; - /** + /** * Returns or sets the page size(s) the Source can/should use to acquire image data. This is a runtime property. * @type {short} */ PageSize: number; - /** + /** * Returns or sets the name of the person who creates the PDF document. * @type {string} */ PDFAuthor: string; - /** + /** * Returns or sets the compression type of PDF files. This is a runtime property. * @type {EnumDWT_PDFCompressionType} */ PDFCompressionType: EnumDWT_PDFCompressionType; - /** + /** * Returns or sets the date when the PDF document is created. * @type {string} */ PDFCreationDate: string; - /** + /** * Returns or sets the name of the application that created the original document, if the PDF document is converted from another form. * @type {string} */ PDFCreator: string; - /** + /** * Returns or sets the keywords associated with the PDF document. * @type {string} */ PDFKeywords: string; - /** + /** * Returns or sets the date when the PDF document is last modified. * @type {string} */ PDFModifiedDate: string; - /** + /** * Returns or sets the name of the application that converted the PDF document from its native. * @type {string} */ PDFProducer: string; - /** + /** * Returns or sets the subject of the PDF document. * @type {string} */ PDFSubject: string; - /** + /** * Returns or sets the title of the PDF document. * @type {string} */ PDFTitle: string; - /** + /** * Returns or sets the value of the PDF version. * @type {string} */ PDFVersion: string; - /** + /** * Returns the number of transfers the Source is ready to supply, upon demand. This is a runtime, read-only property. * @type {short} */ PendingXfers: number; - /** + /** * Returns or sets the pixel flavor for acquired images. This is a runtime property. * @type {short} */ PixelFlavor: number; - /** + /** * Returns or sets the pixel type of current data source. This is a runtime property. Using this property after calling OpenSource() method and before calling AcquireImage(). * @type {EnumDWT_PixelType} */ PixelType: EnumDWT_PixelType; - /** + /** * Sets or returns the product family string for the application identity. * @type {string} */ ProductFamily: string; - /** + /** * Sets the product key. A product key is generated in Licensing Tool which is intalled with Dynamic Web TWAIN. Each product key corresponds with a license. * @type {string} */ ProductKey: string; - /** + /** * [Deprecated.] Returns or sets the name of the proxy server. * @type {string} */ ProxyServer: string; - /** + /** * Returns or sets the current resolution for acquired images. This is a runtime property. * @type {float} */ Resolution: number; - /** + /** * Returns or sets how many scanned images are selected. * @type {short} */ SelectedImagesCount: number; - /** + /** * Returns or sets the border color of the selected image. It is a value specifying the 24-bit RGB value. * @type {int} */ SelectionImageBorderColor: number; - /** + /** * Specifies a fixed aspect ratio to be used for selecting an area. * @type {float} */ SelectionRectAspectRatio: number; - /** + /** * Returns how many sources are installed in the system. This is a runtime, read-only property. * @type {int} */ SourceCount: number; - - /** + + /** * [Deprecated.] Replaced by GetSourceNameItems method. * @type {string} */ SourceNameItems: string; - - /** + + /** * [Deprecated.] * @type {string} */ GetSourceNames: string; - /** + /** * Returns or sets the compression type of TIFF files. This is a runtime property. * @type {EnumDWT_TIFFCompressionType} */ TIFFCompressionType: EnumDWT_TIFFCompressionType; - /** + /** * Sets or returns the transfer mode. * @type {EnumDWT_TransferMode} */ TransferMode: EnumDWT_TransferMode; - /** + /** * Returns or sets the unit of measure. This is a runtime property. * @type {short} */ Unit: number; - /** + /** * Sets or returns the version info string for the application identity. * @type {string} */ VersionInfo: string; - /** + /** * Returns and sets the number of images you are willing to transfer per session. This is a runtime property. * @type {short} */ XferCount: number; - /** + /** * Returns or sets zoom factor for the image, only valid When the view mode is set to -1 by -1. * @type {float} */ @@ -2079,7 +2079,7 @@ interface WebTwain { /** * Binds a specified function to an event, so that the function gets called whenever the event fires. - * @method WebTwain#RegisterEvent + * @method WebTwain#RegisterEvent * @param {string} name the name of the event that the function is bound to. * @param {object} evt specifies the function to call when event fires. * @return {bool} @@ -2090,81 +2090,81 @@ interface WebTwain { /** * Cancels all pending transfers. - * @method WebTwain#CancelAllPendingTransfers + * @method WebTwain#CancelAllPendingTransfers * @return {bool} */ CancelAllPendingTransfers(): boolean; /** * Closes Data Source. - * @method WebTwain#CloseSource + * @method WebTwain#CloseSource * @return {bool} */ CloseSource(): boolean; /** * Closes and unloads Data Source Manager. - * @method WebTwain#CloseSourceManager + * @method WebTwain#CloseSourceManager * @return {bool} */ CloseSourceManager(): boolean; /** - * Disable the source. If the source's user interface is displayed when the source is enabled, it will be closed. - * @method WebTwain#DisableSource + * Disable the source. If the source's user interface is displayed when the source is enabled, it will be closed. + * @method WebTwain#DisableSource * @return {bool} */ DisableSource(): boolean; /** * Sets the Source to eject the current page and advance the next page in the document feeder into the feeder acquire area when IfFeederEnabled is TRUE. - * @method WebTwain#FeedPage + * @method WebTwain#FeedPage * @return {bool} */ FeedPage(): boolean; /** * Retrieve the device type of the currently selected data source, it might be a scanner, a web camera, etc. - * @method WebTwain#GetDeviceType + * @method WebTwain#GetDeviceType * @return {int} */ GetDeviceType(): number; /** * Get the source name according to the source index. - * @method WebTwain#GetSourceNameItems + * @method WebTwain#GetSourceNameItems * @param {short} index int index. Index is 0-based and can not be greater than SourceCount property. * @return {string} */ GetSourceNameItems(index: number): string; /** - * Loads the specified Source into main memory and causes its initialization, - * placing Dynamic Web TWAIN into Capability Negotiation state. If no source is + * Loads the specified Source into main memory and causes its initialization, + * placing Dynamic Web TWAIN into Capability Negotiation state. If no source is * specified (no SelectSource() or SelectSourceByIndex() is called), opens the default source. - * @method WebTwain#OpenSource + * @method WebTwain#OpenSource * @return {bool} */ OpenSource(): boolean; /** * Loads and opens Data Source Manager. - * @method WebTwain#OpenSourceManager + * @method WebTwain#OpenSourceManager * @return {bool} */ OpenSourceManager(): boolean; /** * Reverts the current image layout to the Data Source's default. - * @method WebTwain#ResetImageLayout + * @method WebTwain#ResetImageLayout * @return {bool} */ ResetImageLayout(): boolean; /** - * Sets the Source to return the current page to the input side of the document feeder and + * Sets the Source to return the current page to the input side of the document feeder and * feed the last page from the outside of the feeder back into the acquisition area if IfFeederEnabled is TRUE. - * @method WebTwain#RewindPage + * @method WebTwain#RewindPage * @return {bool} */ RewindPage(): boolean; @@ -2172,14 +2172,14 @@ interface WebTwain { /** * Brings up the TWAIN Data Source Manager's Source Selection User Interface (UI) * so that user can choose which Data Source to be the current Source. - * @method WebTwain#SelectSource + * @method WebTwain#SelectSource * @return {bool} */ SelectSource(): boolean; /** * Selects the index-the source in SourceNameItems property as the current source. - * @method WebTwain#SelectSourceByIndex + * @method WebTwain#SelectSourceByIndex * @param {short} index It is the index of SourceNameItems property. * @return {bool} */ @@ -2187,7 +2187,7 @@ interface WebTwain { /** * Sets file name and file format information used in File Transfer Mode. - * @method WebTwain#SetFileXferInfo + * @method WebTwain#SetFileXferInfo * @param {string} fileName the name of the file to be used in transfer. * @param {EnumDWT_FileFormat} fileFormat an enumerated value indicates the format of the image. * @return {bool} @@ -2196,7 +2196,7 @@ interface WebTwain { /** * Sets the left, top, right, and bottom sides of the image layout rectangle for the current Data Source. - * @method WebTwain#SetImageLayout + * @method WebTwain#SetImageLayout * @param {float} left specifies the floating point number for the left side of the image layout rectangle. * @param {float} top specifies the floating point number for the top side of the image layout rectangle. * @param {float} right specifies the floating point number for the right side of the image layout rectangle. @@ -2207,21 +2207,21 @@ interface WebTwain { /** * Clears all the web forms which are used for image uploading. - * @method WebTwain#ClearAllHTTPFormField + * @method WebTwain#ClearAllHTTPFormField * @return {bool} */ ClearAllHTTPFormField(): boolean; /** * Clears the content of all custom tiff tags. - * @method WebTwain#ClearTiffCustomTag + * @method WebTwain#ClearTiffCustomTag * @return {void} */ ClearTiffCustomTag(): void; /** * Check whether a certain file exists on the local disk. - * @method WebTwain#FileExists + * @method WebTwain#FileExists * @param {string} localFile specifies the absolute path of the local file. * @return {bool} */ @@ -2229,7 +2229,7 @@ interface WebTwain { /** * Downloads an image from the FTP server. - * @method WebTwain#FTPDownload + * @method WebTwain#FTPDownload * @param {string} FTPServer the name of the FTP server. * @param {string} FTPRemoteFile the name of the file to be downloaded. It should be the relative path of the file on the FTP server. * @param {function} optionalAsyncSuccessFunc optional. The function to call when the download succeeds. Please refer to the function prototype OnSuccess. @@ -2240,7 +2240,7 @@ interface WebTwain { /** * Directly download a file from the FTP server to local disk without loading it into Dynamic Web TWAIN. - * @method WebTwain#FTPDownloadDirectly + * @method WebTwain#FTPDownloadDirectly * @param {string} FTPServer the name of the FTP server. * @param {string} FTPRemoteFile the name of the file to be downloaded. It should be the relative path of the file on the FTP server. * @param {string} localFile specify a full path to store the file. @@ -2252,7 +2252,7 @@ interface WebTwain { /** * Downloads an image from the FTP server. - * @method WebTwain#FTPDownloadEx + * @method WebTwain#FTPDownloadEx * @param {string} FTPServer the name of the FTP server. * @param {string} FTPRemoteFile the name of the file to be downloaded. It should be the relative path of the file on the FTP server. * @param {EnumDWT_ImageType} lImageType simage format of the file to be downloaded. @@ -2264,7 +2264,7 @@ interface WebTwain { /** * Uploads the image of a specified index in the buffer to the FTP server. - * @method WebTwain#FTPUpload + * @method WebTwain#FTPUpload * @param {string} FTPServer the name of the FTP server. * @param {short} sImageIndex specifies the index of the image in the buffer. The index is 0-based. * @param {string} FTPRemoteFile the name of the file to be created on the FTP server. It should be a relative path on the FTP server. @@ -2276,7 +2276,7 @@ interface WebTwain { /** * Directly upload a specific file to the FTP server without loading it into Dynamic Web TWAIN. - * @method WebTwain#FTPUploadDirectly + * @method WebTwain#FTPUploadDirectly * @param {string} FTPServer the name of the FTP server. * @param {string} localFile specify the the full path of a local file. * @param {string} FTPRemoteFile the name of the file to be created on the FTP server. It should be a relative path on the FTP server. @@ -2288,9 +2288,9 @@ interface WebTwain { /** * Uploads the image of a specified index in the buffer to the FTP server as a specified image format. - * @method WebTwain#FTPUploadEx + * @method WebTwain#FTPUploadEx * @param {string} FTPServer the name of the FTP server. - * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. + * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. * @param {string} FTPRemoteFile the name of the file to be created on the FTP server. It should be a relative path on the FTP server. * @param {EnumDWT_ImageType} lImageType the image format of the file to be created on the FTP server. * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. @@ -2301,7 +2301,7 @@ interface WebTwain { /** * Uploads all images in buffer to the FTP server as Multi-Page TIFF. - * @method WebTwain#FTPUploadAllAsMultiPageTIFF + * @method WebTwain#FTPUploadAllAsMultiPageTIFF * @param {string} FTPServer the name of the FTP server. * @param {string} FTPRemoteFile the name of the image to be uploaded. It should be a relative path on the FTP server. * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. @@ -2312,7 +2312,7 @@ interface WebTwain { /** * Uploads all images in buffer to the FTP server as Multi-Page PDF. - * @method WebTwain#FTPUploadAllAsPDF + * @method WebTwain#FTPUploadAllAsPDF * @param {string} FTPServer the name of the FTP server. * @param {string} FTPRemoteFile the name of the image to be uploaded. It should be a relative path on the FTP server. * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. @@ -2323,7 +2323,7 @@ interface WebTwain { /** * Uploads the selected images in buffer to the FTP server as Multi-Page PDF. - * @method WebTwain#FTPUploadAsMultiPagePDF + * @method WebTwain#FTPUploadAsMultiPagePDF * @param {string} FTPServer the name of the FTP server. * @param {string} FTPRemoteFile the name of the image to be uploaded. It should be a relative path on the FTP server. * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. @@ -2334,7 +2334,7 @@ interface WebTwain { /** * Uploads the selected images in buffer to the FTP server as Multi-Page TIFF. - * @method WebTwain#FTPUploadAsMultiPageTIFF + * @method WebTwain#FTPUploadAsMultiPageTIFF * @param {string} FTPServer the name of the FTP server. * @param {string} FTPRemoteFile the name of the image to be uploaded. It should be a relative path on the FTP server. * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. @@ -2345,7 +2345,7 @@ interface WebTwain { /** * Downloads an image from the HTTP server. - * @method WebTwain#HTTPDownload + * @method WebTwain#HTTPDownload * @param {string} HTTPServer the name of the HTTP server. * @param {string} HTTPRemoteFile the name of the image to be downloaded. It should be the relative path of the file on the HTTP server. * @param {function} optionalAsyncSuccessFunc optional. The function to call when the download succeeds. Please refer to the function prototype OnSuccess. @@ -2356,7 +2356,7 @@ interface WebTwain { /** * Directly downloads a file from the HTTP server to a local disk without loading it into Dynamic Web TWAIN. - * @method WebTwain#HTTPDownloadDirectly + * @method WebTwain#HTTPDownloadDirectly * @param {string} HTTPServer the name of the HTTP server. * @param {string} HTTPRemoteFile The relative path of the file on the HTTP server. * @param {string} localFile specify the location to store the downloaded file. @@ -2368,7 +2368,7 @@ interface WebTwain { /** * Downloads an image from the HTTP server. - * @method WebTwain#HTTPDownloadEx + * @method WebTwain#HTTPDownloadEx * @param {string} HTTPServer the name of the HTTP server. * @param {string} HTTPRemoteFile the relative path of the file on the HTTP server, or path to an action page (with necessary parameters) which gets and sends back the image stream to the client (please check the sample for more info) * @param {EnumDWT_ImageType} lImageType the image format of the file to be downloaded. @@ -2380,7 +2380,7 @@ interface WebTwain { /** * Download an image from the server using a HTTP Post call. - * @method WebTwain#HTTPDownloadThroughPost + * @method WebTwain#HTTPDownloadThroughPost * @param {string} HTTPServer the name of the HTTP server. * @param {string} HTTPRemoteFile the relative path of the file on the HTTP server, or path to an action page (with necessary parameters) which gets and sends back the image stream to the client (please check the sample for more info) * @param {EnumDWT_ImageType} lImageType the image format of the file to be downloaded. @@ -2392,10 +2392,10 @@ interface WebTwain { /** * Uploads the image of a specified index in the buffer to the HTTP server through the HTTP POST method. - * @method WebTwain#HTTPUploadThroughPost + * @method WebTwain#HTTPUploadThroughPost * @param {string} HTTPServer the name of the HTTP server. - * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @param {string} ActionPage the specified page for posting image files. This is the relative path of the page, not the absolute path. For example: "upload.asp", not "http://www.webserver.com/upload.asp". + * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. + * @param {string} ActionPage the specified page for posting image files. This is the relative path of the page, not the absolute path. For example: "upload.asp", not "http://www.webserver.com/upload.asp". * @param {string} fileName the name of the image to be uploaded. * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnHttpUploadSuccess. * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnHttpUploadFailure. @@ -2405,10 +2405,10 @@ interface WebTwain { /** * Directly upload a specific local file to the HTTP server through the HTTP POST method without loading it into Dynamic Web TWAIN. - * @method WebTwain#HTTPUploadThroughPostDirectly + * @method WebTwain#HTTPUploadThroughPostDirectly * @param {string} HTTPServer the name of the HTTP server. * @param {string} localFile specifies the path of a local file . - * @param {string} ActionPage the specified page for posting files. This is the relative path of the page, not the absolute path. For example: "upload.asp", not "http://www.webserver.com/upload.asp". + * @param {string} ActionPage the specified page for posting files. This is the relative path of the page, not the absolute path. For example: "upload.asp", not "http://www.webserver.com/upload.asp". * @param {string} fileName the name of the file to be uploaded. * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnHttpUploadSuccess. * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnHttpUploadFailure. @@ -2418,10 +2418,10 @@ interface WebTwain { /** * Uploads the image of a specified index in the buffer to the HTTP server as a specified image format through the HTTP POST method. - * @method WebTwain#HTTPUploadThroughPostEx + * @method WebTwain#HTTPUploadThroughPostEx * @param {string} HTTPServer the name of the HTTP server. - * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @param {string} ActionPage the specified page for posting image files. This is the relative path of the page, not the absolute path. For example: "upload.asp", not "http://www.webserver.com/upload.asp". + * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. + * @param {string} ActionPage the specified page for posting image files. This is the relative path of the page, not the absolute path. For example: "upload.asp", not "http://www.webserver.com/upload.asp". * @param {string} fileName the name of the image to be uploaded. * @param {EnumDWT_ImageType} lImageType the image format of the file to be created on the HTTP server.s * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnHttpUploadSuccess. @@ -2432,7 +2432,7 @@ interface WebTwain { /** * Uploads all images in the buffer to the HTTP server through the HTTP Post method as a Multi-Page TIFF. - * @method WebTwain#HTTPUploadAllThroughPostAsMultiPageTIFF + * @method WebTwain#HTTPUploadAllThroughPostAsMultiPageTIFF * @param {string} HTTPServer the name of the HTTP server. * @param {string} ActionPage the specified page for posting image files. This is the relative path of the page, not the absolute path. For example: "upload.asp", not "http://www.webserver.com/upload.asp". * @param {string} fileName the name of the image to be uploaded. @@ -2444,7 +2444,7 @@ interface WebTwain { /** * Uploads the selected images in the buffer to the HTTP server through the HTTP Post method as a Multi-Page TIFF. - * @method WebTwain#HTTPUploadThroughPostAsMultiPageTIFF + * @method WebTwain#HTTPUploadThroughPostAsMultiPageTIFF * @param {string} HTTPServer the name of the HTTP server. * @param {string} ActionPage the specified page for posting image files. This is the relative path of the page, not the absolute path. For example: "upload.asp", not "http://www.webserver.com/upload.asp". * @param {string} fileName the name of the image to be uploaded. @@ -2456,7 +2456,7 @@ interface WebTwain { /** * Uploads all images in the buffer to the HTTP server through HTTP Post method as a Multi-Page PDF. - * @method WebTwain#HTTPUploadAllThroughPostAsPDF + * @method WebTwain#HTTPUploadAllThroughPostAsPDF * @param {string} HTTPServer the name of the HTTP server. * @param {string} ActionPage the specified page for posting image files. This is the relative path of the page, not the absolute path. For example: "upload.asp", not "http://www.webserver.com/upload.asp". * @param {string} fileName the name of the image to be uploaded. @@ -2468,7 +2468,7 @@ interface WebTwain { /** * Uploads the selected images in the buffer to the HTTP server through the HTTP Post method as a Multi-Page PDF. - * @method WebTwain#HTTPUploadThroughPostAsMultiPagePDF + * @method WebTwain#HTTPUploadThroughPostAsMultiPagePDF * @param {string} HTTPServer the name of the HTTP server. * @param {string} ActionPage the specified page for posting image files. This is the relative path of the page, not the absolute path. For example: "upload.asp", not "http://www.webserver.com/upload.asp". * @param {string} fileName the name of the image to be uploaded. @@ -2480,9 +2480,9 @@ interface WebTwain { /** * [Deprecated.] Directly uploads a specific local file to the HTTP server through the HTTP PUT method without loading it into Dynamic Web TWAIN. - * @method WebTwain#HTTPUploadThroughPutDirectly + * @method WebTwain#HTTPUploadThroughPutDirectly * @param {string} HTTPServer the name of the HTTP server. - * @param {string} localFile specifies the path of a local file. + * @param {string} localFile specifies the path of a local file. * @param {string} RemoteFileName the name of the file to be created on the HTTP server. It should a relative path on the web server. * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnFailure. @@ -2492,9 +2492,9 @@ interface WebTwain { /** * [Deprecated.] Uploads the image of a specified index in the buffer to the HTTP server through the HTTP PUT method. - * @method WebTwain#HTTPUploadThroughPut + * @method WebTwain#HTTPUploadThroughPut * @param {string} HTTPServer the name of the HTTP server. - * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. + * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. * @param {string} RemoteFileName the name of the image to be created on the HTTP server. It should a relative path on the web server. * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnFailure. @@ -2504,9 +2504,9 @@ interface WebTwain { /** * [Deprecated.] Uploads the image of a specified index in the buffer to the HTTP server as a specified image format through the HTTP PUT method. - * @method WebTwain#HTTPUploadThroughPutEx + * @method WebTwain#HTTPUploadThroughPutEx * @param {string} HTTPServer the name of the HTTP server. - * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. + * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. * @param {string} RemoteFileName the name of the file to be created on the HTTP server. It should a relative path on the web server. * @param {EnumDWT_ImageType} lImageType the image format of the file to be created on the HTTP server. * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. @@ -2517,7 +2517,7 @@ interface WebTwain { /** * [Deprecated.] Uploads all images in the buffer to the HTTP server through the HTTP Put method as a Multi-Page TIFF. - * @method WebTwain#HTTPUploadAllThroughPutAsMultiPageTIFF + * @method WebTwain#HTTPUploadAllThroughPutAsMultiPageTIFF * @param {string} HTTPServer the name of the HTTP server. * @param {string} RemoteFileName the name of the image to be uploaded. * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. @@ -2528,7 +2528,7 @@ interface WebTwain { /** * [Deprecated.] Uploads the selected images in the buffer to the HTTP server through the HTTP Put method as a Multi-Page TIFF. - * @method WebTwain#HTTPUploadThroughPutAsMultiPageTIFF + * @method WebTwain#HTTPUploadThroughPutAsMultiPageTIFF * @param {string} HTTPServer the name of the HTTP server. * @param {string} RemoteFileName the name of the image to be uploaded. * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. @@ -2539,7 +2539,7 @@ interface WebTwain { /** * [Deprecated.] Uploads all images in the buffer to the HTTP server through the HTTP Put method as a Multi-Page PDF. - * @method WebTwain#HTTPUploadAllThroughPutAsPDF + * @method WebTwain#HTTPUploadAllThroughPutAsPDF * @param {string} HTTPServer the name of the HTTP server. * @param {string} RemoteFileName the name of the image to be uploaded. * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. @@ -2550,7 +2550,7 @@ interface WebTwain { /** * [Deprecated.] Uploads the selected images in the buffer to the HTTP server through the HTTP Put method as a Multi-Page PDF. - * @method WebTwain#HTTPUploadThroughPutAsMultiPagePDF + * @method WebTwain#HTTPUploadThroughPutAsMultiPagePDF * @param {string} HTTPServer the name of the HTTP server. * @param {string} RemoteFileName the name of the image to be uploaded. * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. @@ -2561,7 +2561,7 @@ interface WebTwain { /** * Configures how segmented upload is done. - * @method WebTwain#SetUploadSegment + * @method WebTwain#SetUploadSegment * @param {int} segmentUploadThreshold specifies the threshold (in MB) over which segmented upload will be invoked. * @param {int} moduleSize specifies the size of each segment (in KB). * @return {bool} @@ -2570,7 +2570,7 @@ interface WebTwain { /** * Uploads the images specified by the indices to the HTTP server. - * @method WebTwain#HTTPUpload + * @method WebTwain#HTTPUpload * @param {string} url the url where the images are sent in a POST request. * @param {Array} indices indices specifies which images are to be uploaded. * @param {EnumDWT_ImageType} enumImageType the image format in which the images are to be uploaded. @@ -2583,7 +2583,7 @@ interface WebTwain { /** * Loads a DIB format image from Clipboard into the Dynamic Web TWAIN. - * @method WebTwain#LoadDibFromClipboard + * @method WebTwain#LoadDibFromClipboard * @param {function} optionalAsyncSuccessFunc optional. The function to call when the loading succeeds. Please refer to the function prototype OnSuccess. * @param {function} optionalAsyncFailureFunc optional. The function to call when the loading fails. Please refer to the function prototype OnFailure. * @return {bool} @@ -2592,7 +2592,7 @@ interface WebTwain { /** * Loads an image into the Dynamic Web TWAIN. - * @method WebTwain#LoadImage + * @method WebTwain#LoadImage * @param {string} localFile the name of the image to be loaded. It should be the absolute path of the image file on the local disk. * @param {function} optionalAsyncSuccessFunc optional. The function to call when the loading succeeds. Please refer to the function prototype OnSuccess. * @param {function} optionalAsyncFailureFunc optional. The function to call when the loading fails. Please refer to the function prototype OnFailure. @@ -2602,7 +2602,7 @@ interface WebTwain { /** * Loads an image into the Dynamic Web TWAIN. - * @method WebTwain#LoadImageEx + * @method WebTwain#LoadImageEx * @param {string} localFile the name of the image to be loaded. It should be the absolute path of the image file on the local disk. * @param {EnumDWT_ImageType} lImageType the image format of the file to be loaded. * @param {function} optionalAsyncSuccessFunc optional. The function to call when the loading succeeds. Please refer to the function prototype OnSuccess. @@ -2613,7 +2613,7 @@ interface WebTwain { /** * Loads image from a base64 byte array with the specified file format. - * @method WebTwain#LoadImageFromBase64Binary + * @method WebTwain#LoadImageFromBase64Binary * @param {string} bry specifies the base64 string data. * @param {EnumDWT_ImageType} lImageType specifies the file format. * @return {bool} @@ -2622,7 +2622,7 @@ interface WebTwain { /** * [Deprecated.] Loads image from a byte array with the specified file format. - * @method WebTwain#LoadImageFromBytes + * @method WebTwain#LoadImageFromBytes * @param {int} lBufferSize Specifies the buffer size. * @param {Array} buffer A byte array of the image data. * @param {EnumDWT_ImageType} lImageType Specifies the file format. @@ -2632,7 +2632,7 @@ interface WebTwain { /** * Saves all images in buffer as a MultiPage TIFF file. - * @method WebTwain#SaveAllAsMultiPageTIFF + * @method WebTwain#SaveAllAsMultiPageTIFF * @param {string} localFile the name of the MultiPage TIFF file to be saved. It should be an absolute path on the local disk. * @param {function} optionalAsyncSuccessFunc optional. The function to call when the saving succeeds. Please refer to the function prototype OnSuccess. * @param {function} optionalAsyncFailureFunc optional. The function to call when the saving fails. Please refer to the function prototype OnFailure. @@ -2642,7 +2642,7 @@ interface WebTwain { /** * Saves all images in buffer as a Multi-Page PDF file. - * @method WebTwain#SaveAllAsPDF + * @method WebTwain#SaveAllAsPDF * @param {string} localFile the name of the Multi-Page PDF file to be saved. It should be an absolute path on the local disk. * @param {function} optionalAsyncSuccessFunc optional. The function to call when the saving succeeds. Please refer to the function prototype OnSuccess. * @param {function} optionalAsyncFailureFunc optional. The function to call when the saving fails. Please refer to the function prototype OnFailure. @@ -2652,7 +2652,7 @@ interface WebTwain { /** * Saves the image of a specified index in buffer as a BMP file. - * @method WebTwain#SaveAsBMP + * @method WebTwain#SaveAsBMP * @param {string} localFile the name of the BMP file to be saved. It should be an absolute path on the local disk. * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. * @return {bool} @@ -2661,43 +2661,43 @@ interface WebTwain { /** * Saves the image of a specified index in buffer as a JPEG file. - * @method WebTwain#SaveAsJPEG + * @method WebTwain#SaveAsJPEG * @param {string} localFile the name of the JPEG file to be saved. It should be an absolute path on the local disk. - * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. + * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. * @return {bool} */ SaveAsJPEG(localFile: string, sImageIndex: number): boolean; /** * Saves the image of a specified index in buffer as a PDF file. - * @method WebTwain#SaveAsPDF + * @method WebTwain#SaveAsPDF * @param {string} localFile the name of the JPEG file to be saved. It should be an absolute path on the local disk. - * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. + * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. * @return {bool} */ SaveAsPDF(localFile: string, sImageIndex: number): boolean; /** * Saves the image of a specified index in buffer as a PNG file. - * @method WebTwain#SaveAsPNG + * @method WebTwain#SaveAsPNG * @param {string} localFile the name of the JPEG file to be saved. It should be an absolute path on the local disk. - * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. + * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. * @return {bool} */ SaveAsPNG(localFile: string, sImageIndex: number): boolean; /** * Saves the image of a specified index in buffer as a TIFF file. - * @method WebTwain#SaveAsTIFF + * @method WebTwain#SaveAsTIFF * @param {string} localFile the name of the JPEG file to be saved. It should be an absolute path on the local disk. - * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. + * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. * @return {bool} */ SaveAsTIFF(localFile: string, sImageIndex: number): boolean; /** * Saves the selected images in buffer as a Multipage PDF file. - * @method WebTwain#SaveSelectedImagesAsMultiPagePDF + * @method WebTwain#SaveSelectedImagesAsMultiPagePDF * @param {string} localFile the name of the MultiPage PDF file to be saved. It should be an absolute path on the local disk. * @param {function} optionalAsyncSuccessFunc optional. The function to call when the saving succeeds. Please refer to the function prototype OnSuccess. * @param {function} optionalAsyncFailureFunc optional. The function to call when the saving fails. Please refer to the function prototype OnFailure. @@ -2707,7 +2707,7 @@ interface WebTwain { /** * Saves the selected images in buffer as a Multipage TIFF file. - * @method WebTwain#SaveSelectedImagesAsMultiPageTIFF + * @method WebTwain#SaveSelectedImagesAsMultiPageTIFF * @param {string} localFile the name of the MultiPage TIFF file to be saved. It should be an absolute path on the local disk. * @param {function} optionalAsyncSuccessFunc optional. The function to call when the saving succeeds. Please refer to the function prototype OnSuccess. * @param {function} optionalAsyncFailureFunc optional. The function to call when the saving fails. Please refer to the function prototype OnFailure. @@ -2717,14 +2717,14 @@ interface WebTwain { /** * Saves the selected images in buffer to base64 string. - * @method WebTwain#SaveSelectedImagesToBase64Binary + * @method WebTwain#SaveSelectedImagesToBase64Binary * @return {string} */ SaveSelectedImagesToBase64Binary(): string; /** * [Deprecated.] Saves the selected images in buffer to a byte array in the specified file format. - * @method WebTwain#SaveSelectedImagesToBytes + * @method WebTwain#SaveSelectedImagesToBytes * @param {int} bufferSize specified the buffer size. * @param {Array} buffer A byte array of the image data. * @return {int} @@ -2733,7 +2733,7 @@ interface WebTwain { /** * [Deprecated.] Sets current cookie into the Http Header to be used when uploading scanned images through POST. - * @method WebTwain#SetCookie + * @method WebTwain#SetCookie * @param {string} cookie the cookie on current page. * @return {void} */ @@ -2741,8 +2741,8 @@ interface WebTwain { /** * Sets a text parameter as a filed in a web form. This form is maintained by the component itself (meaning it's not on the page). All fields in this form will be passed to the server when uploading images. - * @method WebTwain#SetHTTPFormField - * @param {string} FieldName specifies the name of a text field in web form. + * @method WebTwain#SetHTTPFormField + * @param {string} FieldName specifies the name of a text field in web form. * @param {string} FieldValue specifies the value of a text field in web form. * @return {bool} */ @@ -2750,7 +2750,7 @@ interface WebTwain { /** * Sets a custom tiff tag. Currently you can set up to 32 tags. The string to be set in a tag can be encoded with base64. - * @method WebTwain#SetTiffCustomTag + * @method WebTwain#SetTiffCustomTag * @param {int} tag specifies the tag identifier. The value should be between 600 and 700. * @param {string} content the string to be set for this tag. The string will be written to the .tiff file when you save/upload it. If the string is base64 encoded, we'll decode it before writing it. * @param {bool} base64Str if you'd like to encode the string with base64, set this to true. Otherwise, the string will be plin text. @@ -2760,7 +2760,7 @@ interface WebTwain { /** * Show save file dialog or show open file dialog. - * @method WebTwain#ShowFileDialog + * @method WebTwain#ShowFileDialog * @param {bool} SaveDialog True -- show save file dialog, False -- show open file dialog. * @param {string} Filter The filter name specifies the filter pattern (for example, "*.TXT"). To specify multiple filter patterns for a single display string, use a semicolon to separate the patterns (for example, "*.TXT;*.DOC;*.BAK"). A pattern string can be a combination of valid file name characters and the asterisk (*) wildcard character. Do not include spaces in the pattern string. To retrieve a shortcut's target without filtering, use the string "All Files\0*.*\0\0", but the program will replace "\0" with "|" automatically. * @param {int} FilterIndex The index of the currently selected filter in the File Types control. The buffer pointed to by Filter contains pairs of strings that define the filters. The index is 0-based. @@ -2775,28 +2775,28 @@ interface WebTwain { /** * Gets information of the capability specified by the Capability property. - * @method WebTwain#CapGet + * @method WebTwain#CapGet * @return {bool} */ CapGet(): boolean; /** - * Returns the Source's current Value for the specified capability. - * @method WebTwain#CapGetCurrent + * Returns the Source's current Value for the specified capability. + * @method WebTwain#CapGetCurrent * @return {bool} */ CapGetCurrent(): boolean; /** * Returns the Source's Default Value for the specified capability. This is the Source's preferred default value. - * @method WebTwain#CapGetDefault + * @method WebTwain#CapGetDefault * @return {bool} */ CapGetDefault(): boolean; /** * Returns the value of the bottom-most edge of the specified frame. - * @method WebTwain#CapGetFrameBottom + * @method WebTwain#CapGetFrameBottom * @param {short} index specifies the value of which frame to get. The index is 0-based. * @return {float} */ @@ -2804,7 +2804,7 @@ interface WebTwain { /** * Returns the value (in Unit) of the left-most edge of the specified frame. - * @method WebTwain#CapGetFrameLeft + * @method WebTwain#CapGetFrameLeft * @param {short} index specifies the value of which frame to get. The index is 0-based. * @return {float} */ @@ -2812,7 +2812,7 @@ interface WebTwain { /** * Returns the value (in Unit) of the left-most edge of the specified frame. - * @method WebTwain#CapGetFrameRight + * @method WebTwain#CapGetFrameRight * @param {short} index specifies the value of which frame to get. The index is 0-based. * @return {float} */ @@ -2820,7 +2820,7 @@ interface WebTwain { /** * Returns the value (in Unit) of the top-most edge of the specified frame. - * @method WebTwain#CapGetFrameTop + * @method WebTwain#CapGetFrameTop * @param {short} index specifies the value of which frame to get. The index is 0-based. * @return {float} */ @@ -2828,7 +2828,7 @@ interface WebTwain { /** * Queries whether the Source supports a particular operation on the capability. - * @method WebTwain#CapIfSupported + * @method WebTwain#CapIfSupported * @param {EnumDWT_MessageType} messageType specifies the type of capability operation. * @return {bool} */ @@ -2836,21 +2836,21 @@ interface WebTwain { /** * Changes the Current Value of the capability specified by Capability property back to its power-on value. - * @method WebTwain#CapReset + * @method WebTwain#CapReset * @return {bool} */ CapReset(): boolean; /** * Sets the current capability using the container type specified by CapType property. The current capability is specified by Capability property. - * @method WebTwain#CapSet + * @method WebTwain#CapSet * @return {bool} */ CapSet(): boolean; /** * Sets the values of the specified frame. - * @method WebTwain#CapSetFrame + * @method WebTwain#CapSetFrame * @param {short} index specifies the values of which frame to set. The index is 0-based. * @param {float} left the value (in Unit) of the left-most edge of the specified frame. * @param {float} top the value (in Unit) of the top-most edge of the specified frame. @@ -2862,7 +2862,7 @@ interface WebTwain { /** * Get the cap item value of the capability specified by Capability property, when the value of the CapType property is TWON_ARRAY or TWON_ENUMERATION. - * @method WebTwain#GetCapItems + * @method WebTwain#GetCapItems * @param {int} index Index is 0-based. It is the index of the cap item. * @return {double} */ @@ -2870,7 +2870,7 @@ interface WebTwain { /** * Returns the cap item value of the capability specified by Capability property, when the value of the CapType property is TWON_ARRAY or TWON_ENUMERATION. - * @method WebTwain#GetCapItemsString + * @method WebTwain#GetCapItemsString * @param {int} index Index is 0-based. It is the index of the cap item. * @return {string} */ @@ -2878,7 +2878,7 @@ interface WebTwain { /** * Set the value of the specified cap item. - * @method WebTwain#SetCapItems + * @method WebTwain#SetCapItems * @param {int} index Index is 0-based. It is the index of the cap item. * @param {double} newVal The Double type of CapItems property is used to present Double, Single(float), Long, int and even boolean types. For string type, please use CapItemsstring property. * @return {void} @@ -2887,7 +2887,7 @@ interface WebTwain { /** * Set the cap item value of the capability specified by Capability property, when the value of the CapType property is TWON_ARRAY or TWON_ENUMERATION. - * @method WebTwain#SetCapItemsString + * @method WebTwain#SetCapItemsString * @param {int} index Index is 0-based. It is the index of the cap item. * @param {string} newVal The new value to be set. * @return {void} @@ -2899,7 +2899,7 @@ interface WebTwain { /** * Add text on an image. - * @method WebTwain#AddText + * @method WebTwain#AddText * @param {short} sImageIndex the index of the image that you want to add text to. * @param {int} x the x coordinate for the text. * @param {int} y the y coordinate for the text. @@ -2914,7 +2914,7 @@ interface WebTwain { /** * Create the font for adding text using the method AddText. - * @method WebTwain#CreateTextFont + * @method WebTwain#CreateTextFont * @param {int} height Specifies the desired height (in logical units) of the font.The absolute value of nHeight must not exceed 16,384 device units after it is converted.For all height comparisons, the font mapper looks for the largest font that does not exceed the requested size or the smallest font if all the fonts exceed the requested size. * @param {int} width Specifies the average width (in logical units) of characters in the font. If Width is 0, the aspect ratio of the device will be matched against the digitization aspect ratio of the available fonts to find the closest match, which is determined by the absolute value of the difference. * @param {int} escapement Specifies the angle (in 0.1-degree units) between the escapement vector and the x-axis of the display surface. The escapement vector is the line through the origins of the first and last characters on a line. The angle is measured counterclockwise from the x-axis. @@ -2923,9 +2923,9 @@ interface WebTwain { * @param {short} italic Specifies an italic font if set to TRUE. * @param {short} underline Specifies an underlined font if set to TRUE. * @param {short} strikeOut A strikeout font if set to TRUE. - * @param {short} charSet Specifies the font's character set. The OEM character set is system-dependent. Fonts with other character sets may exist in the system. An application that uses a font with an unknown character set must not attempt to translate or interpret strings that are to be rendered with that font. + * @param {short} charSet Specifies the font's character set. The OEM character set is system-dependent. Fonts with other character sets may exist in the system. An application that uses a font with an unknown character set must not attempt to translate or interpret strings that are to be rendered with that font. * @param {short} outputPrecision Specifies the desired output precision. The output precision defines how closely the output must match the requested font's height, width, character orientation, escapement, and pitch. - * @param {short} clipPrecision Specifies the desired clipping precision. The clipping precision defines how to clip characters that are partially outside the clipping region. + * @param {short} clipPrecision Specifies the desired clipping precision. The clipping precision defines how to clip characters that are partially outside the clipping region. * @param {short} quality Specifies the font's output quality, which defines how carefully the GDI must attempt to match the logical-font attributes to those of an actual physical font. * @param {short} pitchAndFamily The pitch and family of the font. * @param {string} faceName the typeface name, the length of this string must not exceed 32 characters, including the terminating null character. @@ -2935,7 +2935,7 @@ interface WebTwain { /** * Copies the image of a specified index in buffer to clipboard in DIB format. - * @method WebTwain#CopyToClipboard + * @method WebTwain#CopyToClipboard * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. * @return {bool} */ @@ -2943,7 +2943,7 @@ interface WebTwain { /** * Clears the specified area of a specified image, and fill the area with the fill color. - * @method WebTwain#Erase + * @method WebTwain#Erase * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. * @param {int} left specifies the x-coordinate of the upper-left corner of the rectangle. * @param {int} top specifies the y-coordinate of the upper-left corner of the rectangle. @@ -2955,7 +2955,7 @@ interface WebTwain { /** * Returns the pixel bit depth of the selected image. - * @method WebTwain#GetImageBitDepth + * @method WebTwain#GetImageBitDepth * @param {short} sImageIndex specifies the index of image. The index is 0-based. * @return {short} */ @@ -2963,7 +2963,7 @@ interface WebTwain { /** * Returns the width (pixels) of the selected image. This is a read-only property. - * @method WebTwain#GetImageWidth + * @method WebTwain#GetImageWidth * @param {short} sImageIndex specifies the index of image. The index is 0-based. * @return {int} */ @@ -2971,7 +2971,7 @@ interface WebTwain { /** * Returns the height (pixels) of the selected image. This is a read-only property. - * @method WebTwain#GetImageHeight + * @method WebTwain#GetImageHeight * @param {short} sImageIndex specifies the index of image. The index is 0-based. * @return {int} */ @@ -2979,7 +2979,7 @@ interface WebTwain { /** * Returns the file size of the new image resized from the image of a specified index in buffer. - * @method WebTwain#GetImageSize + * @method WebTwain#GetImageSize * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. * @param {int} iWidth specifies the pixel width of the new image. * @param {int} iHeight specifies the pixel height of the new image. @@ -2989,7 +2989,7 @@ interface WebTwain { /** * Pre-calculate the file size of the local image file that is saved from an image of a specified index in buffer. - * @method WebTwain#GetImageSizeWithSpecifiedType + * @method WebTwain#GetImageSizeWithSpecifiedType * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. * @param {short} sImageType specifies the type of an image file.. * @return {int} @@ -2998,7 +2998,7 @@ interface WebTwain { /** * Return the horizontal resolution of the specified image. - * @method WebTwain#GetImageXResolution + * @method WebTwain#GetImageXResolution * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. * @return {int} */ @@ -3006,7 +3006,7 @@ interface WebTwain { /** * Return the vertical resolution of the specified image. - * @method WebTwain#GetImageYResolution + * @method WebTwain#GetImageYResolution * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. * @return {int} */ @@ -3014,7 +3014,7 @@ interface WebTwain { /** * Returns the index of the selected image. - * @method WebTwain#GetSelectedImageIndex + * @method WebTwain#GetSelectedImageIndex * @param {short} sSelectedIndex specifies the index of the selected image. * @return {short} */ @@ -3022,7 +3022,7 @@ interface WebTwain { /** * You can use the method to select images programatically which is ususally done by mouse clicking. - * @method WebTwain#SetSelectedImageIndex + * @method WebTwain#SetSelectedImageIndex * @param {short} sSelectedIndex this is the index of an array that holds the indices of selected images. * @param {short} newVal specifies the index of an image that you want to select. * @return {void} @@ -3031,7 +3031,7 @@ interface WebTwain { /** * Pre-calculate the file size of the local image file that is saved from the selected images in buffer. - * @method WebTwain#GetSelectedImagesSize + * @method WebTwain#GetSelectedImagesSize * @param {int} iImageType specifies the type of an image file. * @return {int} */ @@ -3039,7 +3039,7 @@ interface WebTwain { /** * Check the skew angle of an image by its index in buffer. - * @method WebTwain#GetSkewAngle + * @method WebTwain#GetSkewAngle * @param {short} sImageIndex the index of the image in the buffer. * @return {double} */ @@ -3047,7 +3047,7 @@ interface WebTwain { /** * Check the skew angle of a rectangular part of an image by its index in buffer. - * @method WebTwain#GetSkewAngleEx + * @method WebTwain#GetSkewAngleEx * @param {short} sImageIndex the index of the image in the buffer. * @param {int} left specifies the x-coordinate of the upper-left corner of the rectangle. * @param {int} top specifies the y-coordinate of the upper-left corner of the rectangle. @@ -3059,7 +3059,7 @@ interface WebTwain { /** * [Deprecated.] Detects whether a certain area on an image is blank. - * @method WebTwain#IsBlankImageEx + * @method WebTwain#IsBlankImageEx * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. * @param {int} left specifies the x-coordinate of the upper-left corner of the rectangle. * @param {int} top specifies the y-coordinate of the upper-left corner of the rectangle. @@ -3072,7 +3072,7 @@ interface WebTwain { /** * Mirrors the image of a specified index in buffer. - * @method WebTwain#Mirror + * @method WebTwain#Mirror * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. * @return {bool} */ @@ -3080,7 +3080,7 @@ interface WebTwain { /** * Decorates image of a specified index in buffer with rectangles of transparent color. - * @method WebTwain#OverlayRectangle + * @method WebTwain#OverlayRectangle * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. * @param {int} left specifies the x-coordinate of the upper-left corner of the rectangle. * @param {int} top specifies the y-coordinate of the upper-left corner of the rectangle. @@ -3094,22 +3094,22 @@ interface WebTwain { /** * Removes all images in buffer. - * @method WebTwain#RemoveAllImages + * @method WebTwain#RemoveAllImages * @return {void} */ RemoveAllImages(): void; /** * Removes selected images in buffer. - * @method WebTwain#RemoveAllSelectedImages + * @method WebTwain#RemoveAllSelectedImages * @return {bool} */ RemoveAllSelectedImages(): boolean; /** * Removes the image of a specified index in buffer. - * @method WebTwain#RemoveImage - * @param {short} sImageIndexToBeDeleted specifies the index of the image to be deleted in buffer. The index is 0-based. + * @method WebTwain#RemoveImage + * @param {short} sImageIndexToBeDeleted specifies the index of the image to be deleted in buffer. The index is 0-based. * @return {bool} */ RemoveImage(sImageIndexToBeDeleted: number): boolean; @@ -3117,7 +3117,7 @@ interface WebTwain { // Image Operate /** * Rotates the image of a specified index in buffer by specified angle. - * @method WebTwain#Rotate + * @method WebTwain#Rotate * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. * @param {float} fAngle Specifies the rotation angle. * @param {bool} bKeepSize Keep size or not. @@ -3127,7 +3127,7 @@ interface WebTwain { /** * Rotates the image of a specified index in buffer by specified angle. - * @method WebTwain#RotateEx + * @method WebTwain#RotateEx * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. * @param {float} fAngle Specifies the rotation angle. * @param {bool} bKeepSize Keep size or not. @@ -3138,7 +3138,7 @@ interface WebTwain { /** * Rotates the image of a specified index in buffer by 90 degrees counter-clockwise. - * @method WebTwain#RotateLeft + * @method WebTwain#RotateLeft * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. * @return {bool} */ @@ -3146,7 +3146,7 @@ interface WebTwain { /** * Rotates the image of a specified index in buffer by 90 degrees clockwise. - * @method WebTwain#RotateRight + * @method WebTwain#RotateRight * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. * @return {bool} */ @@ -3154,7 +3154,7 @@ interface WebTwain { /** * Changes width and height of the image of a specified index in the buffer. Please note the file size of the image will be changed proportionately. - * @method WebTwain#ChangeImageSize + * @method WebTwain#ChangeImageSize * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. * @param {int} iNewWidth specifies the pixel width of the new image. * @param {int} iNewHeight specifies the pixel height of the new image. @@ -3165,7 +3165,7 @@ interface WebTwain { /** * Flips the image of a specified index in buffer. - * @method WebTwain#Flip + * @method WebTwain#Flip * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. * @return {bool} */ @@ -3173,7 +3173,7 @@ interface WebTwain { /** * Crops the image of a specified index in buffer. - * @method WebTwain#Crop + * @method WebTwain#Crop * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. * @param {int} left specifies the x-coordinate of the upper-left corner of the rectangle. * @param {int} top specifies the y-coordinate of the upper-left corner of the rectangle. @@ -3185,7 +3185,7 @@ interface WebTwain { /** * Crops the image of a specified index in buffer to clipboard in DIB format. - * @method WebTwain#CropToClipboard + * @method WebTwain#CropToClipboard * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. * @param {int} left specifies the x-coordinate of the upper-left corner of the rectangle. * @param {int} top specifies the y-coordinate of the upper-left corner of the rectangle. @@ -3197,7 +3197,7 @@ interface WebTwain { /** * Cuts the image data in the specified area to the system clipboard in DIB format. - * @method WebTwain#CutFrameToClipboard + * @method WebTwain#CutFrameToClipboard * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. * @param {int} left specifies the x-coordinate of the upper-left corner of the rectangle. * @param {int} top specifies the y-coordinate of the upper-left corner of the rectangle. @@ -3209,7 +3209,7 @@ interface WebTwain { /** * Cuts the image of a specified index in buffer to clipboard in DIB format. - * @method WebTwain#CutToClipboard + * @method WebTwain#CutToClipboard * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. * @return {bool} */ @@ -3217,7 +3217,7 @@ interface WebTwain { /** * Change the DPI (dots per inch) for the specified image. - * @method WebTwain#SetDPI + * @method WebTwain#SetDPI * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. * @param {int} xResolution The horizontal resolution. * @param {int} yResolution The vertical resolution. @@ -3229,8 +3229,8 @@ interface WebTwain { /** * Sets the view mode that images are displayed in Dynamic Web TWAIN. You can use this method to display multiple images in Dynamic Web TWAIN. - * @method WebTwain#SetViewMode - * @param {short} sHorizontalImageCount specifies how many columns can be displayed in Dynamic Web TWAIN. + * @method WebTwain#SetViewMode + * @param {short} sHorizontalImageCount specifies how many columns can be displayed in Dynamic Web TWAIN. * @param {short} sVerticalImageCount specifies how many rows can be displayed in Dynamic Web TWAIN.. * @return {void} */ @@ -3238,7 +3238,7 @@ interface WebTwain { /** * Moves a specified image. - * @method WebTwain#MoveImage + * @method WebTwain#MoveImage * @param {short} sSourceImageIndex Specifies the source index of image in buffer. The index is 0-based. * @param {short} sTargetImageIndex Specifies the target index of image in buffer. The index is 0-based. * @return {bool} @@ -3247,7 +3247,7 @@ interface WebTwain { /** * Switchs two images of specified indices in buffer. - * @method WebTwain#SwitchImage + * @method WebTwain#SwitchImage * @param {short} sImageIndex1 specifies the index of image in buffer. The index is 0-based. * @param {short} sImageIndex2 specifies the index of image in buffer. The index is 0-based. * @return {bool} @@ -3256,7 +3256,7 @@ interface WebTwain { /** * Shows the GUI of Image Printer. - * @method WebTwain#Print + * @method WebTwain#Print * @return {bool} */ Print(): boolean; @@ -3267,14 +3267,14 @@ interface WebTwain { // --- Others --- /** * Shows the GUI of Image Editor. - * @method WebTwain#ShowImageEditor + * @method WebTwain#ShowImageEditor * @return {bool} */ ShowImageEditor(): boolean; /** * Unbinds an event from the specified function, so that the function stops receiving notifications when the event fires. - * @method WebTwain#UnregisterEvent + * @method WebTwain#UnregisterEvent * @param {string} name the name of the event. * @param {object} evt specified the function to be unbound. * @return {bool} @@ -3284,14 +3284,14 @@ interface WebTwain { /** * Enables the source to accept image. - * @method WebTwain#EnableSource + * @method WebTwain#EnableSource * @return {bool} */ EnableSource(): boolean; /** * Displays the source's built-in interface to acquire image. - * @method WebTwain#AcquireImage + * @method WebTwain#AcquireImage * @param {object} optionalDeviceConfig a JS object used to set up the device for image acquisition. * @param {function} asyncSuccessFunc the function to call when the upload succeeds. Please refer to the function prototype OnSuccess. * @param {function} asyncFailureFunc the function to call when the upload fails. Please refer to the function prototype OnFailure. @@ -3299,10 +3299,10 @@ interface WebTwain { */ AcquireImage(optionalDeviceConfig?: object, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - // start from 10.0 + // start from 10.0 /** * Change the width of an image in buffer. - * @method WebTwain#SetImageWidth + * @method WebTwain#SetImageWidth * @param {short} sImageIndex specifies which image you'd like to change. * @param {int} iNewWidth specifies how wide you'd like to change the image. * @return {bool} @@ -3312,7 +3312,7 @@ interface WebTwain { // Set custom DS data (DAT_CUSTOMDSDATA), the input string is encoded with base64 /** * Sets custom DS data to be used for scanning, the input string is encoded with base64. Custom DS data means a specific scanning profile. - * @method WebTwain#SetCustomDSDataEx + * @method WebTwain#SetCustomDSDataEx * @param {string} value the input string which is encoded with base64. * @return {bool} */ @@ -3321,7 +3321,7 @@ interface WebTwain { // Set custom DS data, load data from the specified file /** * Sets custom DS data to be used for scanning, the data is stored in a file. Custom DS data means a specific scanning profile. - * @method WebTwain#SetCustomDSData + * @method WebTwain#SetCustomDSData * @param {string} fileName the absolute path of the file where the custom data source data is stored. * @return {bool} */ @@ -3330,7 +3330,7 @@ interface WebTwain { // Get custom DS data, and returned string is encoded with base64 /** * Gets custom DS data, the returned string is base64 encoded. - * @method WebTwain#GetCustomDSDataEx + * @method WebTwain#GetCustomDSDataEx * @return {string} */ GetCustomDSDataEx(): string; @@ -3338,7 +3338,7 @@ interface WebTwain { // Get custom DS data, and save the data to the specified file /** * Gets custom DS data and save the data in a specified file. - * @method WebTwain#GetCustomDSData + * @method WebTwain#GetCustomDSData * @param {string} fileName the path of the file used for storing custom DS data. * @return {bool} */ @@ -3346,7 +3346,7 @@ interface WebTwain { /** * Changes the bitdepth of a specified image. - * @method WebTwain#ChangeBitDepth + * @method WebTwain#ChangeBitDepth * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. * @param {short} sBitDepth specifies the target bit depth. * @param {bool} bHighQuality specifies whether or not to keep high quality while changing the bit depth. When it's true, it takes more time. @@ -3356,7 +3356,7 @@ interface WebTwain { /** * Changes a specified image to gray scale. - * @method WebTwain#ConvertToGrayScale + * @method WebTwain#ConvertToGrayScale * @param {short} sIndex specifies the index of image in buffer. The index is 0-based. * @return {bool} */ @@ -3364,7 +3364,7 @@ interface WebTwain { /** * [Deprecated.] Shows the GUI of Image Editor with custom settings. - * @method WebTwain#ShowImageEditorEx + * @method WebTwain#ShowImageEditorEx * @param {int} x specifies the new position of the left top corner of the window. * @param {int} y specifies the new position of the left top corner of the window. * @param {int} cx specifies the width of the window. @@ -3376,7 +3376,7 @@ interface WebTwain { /** * [Deprecated.] Detects whether an image is blank. - * @method WebTwain#IsBlankImage + * @method WebTwain#IsBlankImage * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. * @return {bool} */ @@ -3384,7 +3384,7 @@ interface WebTwain { /** * Detects whether a specific image is blank. - * @method WebTwain#IsBlankImageExpress + * @method WebTwain#IsBlankImageExpress * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. * @return {bool} */ @@ -3392,7 +3392,7 @@ interface WebTwain { /** * [Deprecated.] Detects whether a specific image is blank. - * @method WebTwain#GetBarcodeInfo + * @method WebTwain#GetBarcodeInfo * @param {int} barcodeInfoType Defined in TWAIN Specification. * @param {int} barcodeIndex Specifies which barcode to check. The index is 0-based. * @return {object} @@ -3401,7 +3401,7 @@ interface WebTwain { /** * [Deprecated.] Gets the content from a specified barcode. - * @method WebTwain#GetBarcodeText + * @method WebTwain#GetBarcodeText * @param {int} barcodeIndex Specifies which barcode to check. The index is 0-based. * @return {bool} */ @@ -3409,7 +3409,7 @@ interface WebTwain { /** * Sets the default source to use. It's only valid when IfUseTWAINDSM is set to true. - * @method WebTwain#SetDefaultSource + * @method WebTwain#SetDefaultSource * @param {short} sImageIndex specifies the index of the default source. The index is 0-based. * @return {bool} */ @@ -3417,7 +3417,7 @@ interface WebTwain { /** * Draws a rectangle on the viewer which represents the selected area. - * @method WebTwain#SetSelectedImageArea + * @method WebTwain#SetSelectedImageArea * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. * @param {int} left The X axis of the left border. * @param {int} top The Y axis of the top border. @@ -3429,7 +3429,7 @@ interface WebTwain { /** * Converts the images specified by the indices to base64. - * @method WebTwain#ConvertToBase64 + * @method WebTwain#ConvertToBase64 * @param {Array} indices indices specifies which images are to be converted to base64. * @param {EnumDWT_ImageType} enumImageType the image format in which the images are to be converted to base64. * @param {function} asyncSuccessFunc the function to call when the upload succeeds. Please refer to the function prototype OnSuccess. @@ -3440,7 +3440,7 @@ interface WebTwain { /** * Returns the direct URL of an image specified by index, if iWidth or iHeight is set to -1, you get the original image, otherwise you get the image with specified iWidth or iHeight while keeping the same aspect ratio. - * @method WebTwain#GetImageURL + * @method WebTwain#GetImageURL * @param {short} index the index of the image. * @param {int} iWidth the width of the image. * @param {int} iHeight the height of the image. @@ -3450,7 +3450,7 @@ interface WebTwain { /** * Sets a header for the current HTTP Post request. - * @method WebTwain#SetHTTPHeader + * @method WebTwain#SetHTTPHeader * @param {string} key the key of the header. * @param {string} value the value of the header. * @return {bool} diff --git a/types/ember/index.d.ts b/types/ember/index.d.ts index 1a8d5455c5..37818e787e 100644 --- a/types/ember/index.d.ts +++ b/types/ember/index.d.ts @@ -548,9 +548,9 @@ declare namespace Ember { toArray(): any[]; uniq(): Enumerable; without(value: any): Enumerable; - '@each': EachProxy; + '@each': EachProxy; Boolean: boolean; - '[]': any[]; + '[]': any[]; firstObject: any; hasEnumerableObservers: boolean; lastObject: any; @@ -630,8 +630,8 @@ declare namespace Ember { unshiftObject(object: any): any; unshiftObjects(objects: any[]): any[]; without(value: any): Enumerable; - '[]': any[]; - '@each': EachProxy; + '[]': any[]; + '@each': EachProxy; Boolean: boolean; firstObject: any; hasEnumerableObservers: boolean; @@ -1030,7 +1030,7 @@ declare namespace Ember { toArray(): any[]; uniq(): Enumerable; without(value: any): Enumerable; - '[]': any[]; + '[]': any[]; firstObject: any; hasEnumerableObservers: boolean; lastObject: any; @@ -1291,7 +1291,7 @@ declare namespace Ember { toArray(): any[]; uniq(): Enumerable; without(value: any): Enumerable; - '[]': any[]; + '[]': any[]; firstObject: any; hasEnumerableObservers: boolean; lastObject: any; diff --git a/types/hapi-auth-jwt2/hapi-auth-jwt2-tests.ts b/types/hapi-auth-jwt2/hapi-auth-jwt2-tests.ts index d0bf1b8688..640706f856 100644 --- a/types/hapi-auth-jwt2/hapi-auth-jwt2-tests.ts +++ b/types/hapi-auth-jwt2/hapi-auth-jwt2-tests.ts @@ -29,13 +29,14 @@ function validate(decoded: User, request: Hapi.Request, callback: hapiAuthJwt2.V } server.register(hapiAuthJwt2, err => { - server.auth.strategy('jwt', 'jwt', { + const options: hapiAuthJwt2.Options = { key: 'NeverShareYourSecret', validateFunc: validate, verifyOptions: { algorithms: ['HS256'] } - }); + }; + server.auth.strategy('jwt', 'jwt', options); }); server.start(); diff --git a/types/hapi/index.d.ts b/types/hapi/index.d.ts index 7ac280569a..6fdef94dec 100644 --- a/types/hapi/index.d.ts +++ b/types/hapi/index.d.ts @@ -120,8 +120,8 @@ export interface IServerConnectionOptions extends IConnectionConfigurationServer export interface IConnectionConfigurationServerDefaults { /** application-specific connection configuration which can be accessed via connection.settings.app. Provides a safe place to store application configuration without potential conflicts with the framework internals. Should not be used to configure plugins which should use plugins[name]. Note the difference between connection.settings.app which is used to store configuration values and connection.app which is meant for storing run-time state. */ app?: any; - /** if false, response content encoding is disabled. Defaults to true */ - compression?: boolean; + /** if false, response content encoding is disabled. Defaults to true */ + compression?: boolean; /** connection load limits configuration where: */ load?: { /** maximum V8 heap size over which incoming requests are rejected with an HTTP Server Timeout (503) response. Defaults to 0 (no limit). */ @@ -408,7 +408,7 @@ export interface IProxyHandlerConfig { maxSockets?: boolean | number; } /** TODO: fill in joi definition */ -export interface IJoi {} +export interface IJoi { } /** a validation function using the signature function(value, options, next) */ export interface IValidationFunction { @@ -514,7 +514,7 @@ export interface IRouteAdditionalConfigurationOptions { }; /** an alternative location for the route handler option. */ - handler?: ISessionHandler | IStrictSessionHandler | string | IRouteHandlerConfig; + handler?: ISessionHandler | IStrictSessionHandler | string | IRouteHandlerConfig; /** an optional unique identifier used to look up the route using server.lookup(). */ id?: number; /** optional arguments passed to JSON.stringify() when converting an object or error response to a string payload.Supports the following: */ @@ -764,14 +764,21 @@ export interface IServerRealm { /** server.state(name, [options]) http://hapijs.com/api#serverstatename-options HTTP state management uses client cookies to persist a state across multiple requests. Registers a cookie definitions where:*/ export interface IServerState { - /** - the cookie name string. */name: string; + /** - the cookie name string. */ + name: string; - /** - are the optional cookie settings: */options: { - /** - time - to - live in milliseconds.Defaults to null (session time- life - cookies are deleted when the browser is closed).*/ttl: number; - /** - sets the 'Secure' flag.Defaults to false.*/isSecure: boolean; - /** - sets the 'HttpOnly' flag.Defaults to false.*/isHttpOnly: boolean - /** - the path scope.Defaults to null (no path).*/path: any; - /** - the domain scope.Defaults to null (no domain). */domain: any; + /** - are the optional cookie settings: */ + options: { + /** - time - to - live in milliseconds.Defaults to null (session time- life - cookies are deleted when the browser is closed).*/ + ttl: number; + /** - sets the 'Secure' flag.Defaults to false.*/ + isSecure: boolean; + /** - sets the 'HttpOnly' flag.Defaults to false.*/ + isHttpOnly: boolean + /** - the path scope.Defaults to null (no path).*/ + path: any; + /** - the domain scope.Defaults to null (no domain). */ + domain: any; /** if present and the cookie was not received from the client or explicitly set by the route handler, the cookie is automatically added to the response with the provided value. The value can be a function with signature function(request, next) where: request - the request object. next - the continuation function using the function(err, value) signature.*/ @@ -783,16 +790,25 @@ export interface IServerState { 'form' - object value is encoded using the x-www-form-urlencoded method. 'iron' - Encrypts and sign the value using iron.*/ encoding: string; - /** - an object used to calculate an HMAC for cookie integrity validation.This does not provide privacy, only a mean to verify that the cookie value was generated by the server.Redundant when 'iron' encoding is used.Options are:*/sign: { - /** - algorithm options.Defaults to require('iron').defaults.integrity.*/integrity: any; - /** - password used for HMAC key generation.*/password: string; + /** - an object used to calculate an HMAC for cookie integrity validation.This does not provide privacy, only a mean to verify that the cookie value was generated by the server.Redundant when 'iron' encoding is used.Options are:*/ + sign: { + /** - algorithm options.Defaults to require('iron').defaults.integrity.*/ + integrity: any; + /** - password used for HMAC key generation.*/ + password: string; }; - /** - password used for 'iron' encoding.*/password: string; - /** - options for 'iron' encoding.Defaults to require('iron').defaults.*/iron: any; - /** - if false, errors are ignored and treated as missing cookies.*/ignoreErrors: boolean; - /** - if true, automatically instruct the client to remove invalid cookies.Defaults to false.*/clearInvalid: boolean; - /** - if false, allows any cookie value including values in violation of RFC 6265. Defaults to true.*/strictHeader: boolean; - /** - overrides the default proxy localStatePassThrough setting.*/passThrough: any; + /** - password used for 'iron' encoding.*/ + password: string; + /** - options for 'iron' encoding.Defaults to require('iron').defaults.*/ + iron: any; + /** - if false, errors are ignored and treated as missing cookies.*/ + ignoreErrors: boolean; + /** - if true, automatically instruct the client to remove invalid cookies.Defaults to false.*/ + clearInvalid: boolean; + /** - if false, allows any cookie value including values in violation of RFC 6265. Defaults to true.*/ + strictHeader: boolean; + /** - overrides the default proxy localStatePassThrough setting.*/ + passThrough: any; }; } @@ -915,7 +931,7 @@ export interface IRouteConfiguration { /** - an optional domain string or an array of domain strings for limiting the route to only requests with a matching host header field.Matching is done against the hostname part of the header only (excluding the port).Defaults to all hosts.*/ vhost?: string; /** - (required) the function called to generate the response after successful authentication and validation.The handler function is described in Route handler.If set to a string, the value is parsed the same way a prerequisite server method string shortcut is processed.Alternatively, handler can be assigned an object with a single key using the name of a registered handler type and value with the options passed to the registered handler.*/ - handler?: ISessionHandler | IStrictSessionHandler | string | IRouteHandlerConfig; + handler?: ISessionHandler | IStrictSessionHandler | string | IRouteHandlerConfig; /** - additional route options.*/ config?: IRouteAdditionalConfigurationOptions; } @@ -1122,7 +1138,7 @@ export interface IServerMethod { generateKey - a function used to generate a unique key (for caching) from the arguments passed to the method function (the callback argument is not passed as input). The server will automatically generate a unique key if the function's arguments are all of types 'string', 'number', or 'boolean'. However if the method uses other types of arguments, a key generation function must be provided which takes the same arguments as the function and returns a unique string (or null if no key can be generated).*/ export interface IServerMethodOptions { bind?: any; - cache?: ICatBoxCachePolicyOptions; + cache?: ICatBoxCachePolicyOptions; callback?: boolean; generateKey?(args: any[]): string; } @@ -1891,9 +1907,9 @@ export class Server extends Events.EventEmitter { * } * }); */ - strategy(name: string, scheme: string, mode?: boolean | string, options?: any): void; - strategy(name: string, scheme: string, mode?: boolean | string): void; - strategy(name: string, scheme: string, options?: any): void; + strategy(name: string, scheme: string, mode?: boolean | string, options?: any): void; + strategy(name: string, scheme: string, mode?: boolean | string): void; + strategy(name: string, scheme: string, options?: any): void; /** server.auth.test(strategy, request, next) Tests a request against an authentication strategy where: @@ -1959,7 +1975,7 @@ export class Server extends Events.EventEmitter { // value === { capital: 'oslo' }; }); });*/ - cache(options: ICatBoxCachePolicyOptions): void; + cache(options: ICatBoxCachePolicyOptions): void; /** server.connection([options]) Adds an incoming server connection diff --git a/types/jasmine-ajax/index.d.ts b/types/jasmine-ajax/index.d.ts index 4762ba085a..dcc6720f04 100644 --- a/types/jasmine-ajax/index.d.ts +++ b/types/jasmine-ajax/index.d.ts @@ -27,13 +27,13 @@ interface JasmineAjaxRequest extends XMLHttpRequest { } interface JasmineAjaxRequestTracker { - track(request: JasmineAjaxRequest): void; - first(): JasmineAjaxRequest; - count(): number; - reset(): void; - mostRecent(): JasmineAjaxRequest; - at(index: number): JasmineAjaxRequest; - filter(urlToMatch: RegExp): JasmineAjaxRequest[]; + track(request: JasmineAjaxRequest): void; + first(): JasmineAjaxRequest; + count(): number; + reset(): void; + mostRecent(): JasmineAjaxRequest; + at(index: number): JasmineAjaxRequest; + filter(urlToMatch: RegExp): JasmineAjaxRequest[]; filter(urlToMatch: Function): JasmineAjaxRequest[]; filter(urlToMatch: string): JasmineAjaxRequest[]; } @@ -48,14 +48,14 @@ interface JasmineAjaxRequestStubReturnOptions { interface JasmineAjaxRequestStub { data?: string; - method?: string; - andReturn(options: JasmineAjaxRequestStubReturnOptions): void; - matches(fullUrl: string, data: string, method: string): boolean; + method?: string; + andReturn(options: JasmineAjaxRequestStubReturnOptions): void; + matches(fullUrl: string, data: string, method: string): boolean; } interface JasmineAjaxStubTracker { - addStub(stub: JasmineAjaxRequestStub): void; - reset(): void; + addStub(stub: JasmineAjaxRequestStub): void; + reset(): void; findStub(url: string, data?: string, method?: string): JasmineAjaxRequestStub; } diff --git a/types/jasmine-ajax/jasmine-ajax-tests.ts b/types/jasmine-ajax/jasmine-ajax-tests.ts index b2c963c6c1..fabd525012 100644 --- a/types/jasmine-ajax/jasmine-ajax-tests.ts +++ b/types/jasmine-ajax/jasmine-ajax-tests.ts @@ -1779,7 +1779,7 @@ describe("mockAjax", () => { mockAjax.install(); - mockAjax.requests.track( { url: '/testurl' }); + // mockAjax.requests.track( { url: '/testurl' }); mockAjax.stubRequest('/bobcat'); expect(mockAjax.requests.count()).toEqual(1); diff --git a/types/jquery.validation/index.d.ts b/types/jquery.validation/index.d.ts index 9b77a80e23..5e0e2cfa01 100644 --- a/types/jquery.validation/index.d.ts +++ b/types/jquery.validation/index.d.ts @@ -10,7 +10,7 @@ declare namespace JQueryValidation { type ValidatePredicate = ((element: HTMLElement, event: JQueryEventObject) => void); - type ShouldValidatePredicate = boolean|ValidatePredicate; + type ShouldValidatePredicate = boolean | ValidatePredicate; interface ValidationOptions { /** @@ -218,7 +218,7 @@ declare namespace JQueryValidation { * * @param template The string to format. */ - format(template: string): ( (...args: any[]) => string); + format(template: string): ((...args: any[]) => string); format(template: string, ...args: any[]): string; /** * Modify default settings for validation. @@ -232,7 +232,7 @@ declare namespace JQueryValidation { } interface Validator { - element(element: string|JQuery): boolean; + element(element: string | JQuery): boolean; checkForm(): boolean; /** * Validates the form, returns true if it is valid, false otherwise. diff --git a/types/jquery.validation/jquery.validation-tests.ts b/types/jquery.validation/jquery.validation-tests.ts index 08bc439973..37273e0f51 100644 --- a/types/jquery.validation/jquery.validation-tests.ts +++ b/types/jquery.validation/jquery.validation-tests.ts @@ -15,8 +15,8 @@ function test_validate() { const errors = validator.numberOfInvalids(); if (errors) { const message = errors === 1 - ? 'You missed 1 field. It has been highlighted' - : 'You missed ' + errors + ' fields. They have been highlighted'; + ? 'You missed 1 field. It has been highlighted' + : 'You missed ' + errors + ' fields. They have been highlighted'; $("div.error span").html(message); $("div.error").show(); } else { @@ -56,7 +56,7 @@ function test_validate() { }, errorPlacement: (error, element) => { if (element.attr("name") === "fname" - || element.attr("name") === "lname") + || element.attr("name") === "lname") error.insertAfter("#lastname"); else error.insertAfter(element); @@ -84,7 +84,7 @@ function test_validate() { onclick: (elt) => { } }); $(".selector").validate({ - onfocusout: (elt, event) => { }, + onfocusout: (elt, event) => { }, onkeyup: (elt, event) => { }, onclick: (elt, event) => { } }); @@ -155,12 +155,12 @@ function test_validate() { highlight: (element: HTMLInputElement, errorClass, validClass) => { $(element).addClass(errorClass).removeClass(validClass); $(( element).form).find("label[for=" + element.id + "]") - .addClass(errorClass); + .addClass(errorClass); }, unhighlight: (element: HTMLInputElement, errorClass, validClass) => { $(element).removeClass(errorClass).addClass(validClass); $(( element).form).find("label[for=" + element.id + "]") - .removeClass(errorClass); + .removeClass(errorClass); } }); $(".selector").validate({ @@ -174,8 +174,8 @@ function test_validate() { onclick: false, }); $('.selector').validate({ - onfocusout: () => {}, - onkeyup: () => {}, + onfocusout: () => { }, + onkeyup: () => { }, onclick: elt => 2, }); } diff --git a/types/jui-core/index.d.ts b/types/jui-core/index.d.ts index 2bea574d7c..d8143aaa28 100644 --- a/types/jui-core/index.d.ts +++ b/types/jui-core/index.d.ts @@ -34,7 +34,7 @@ export interface UtilBase { * @param {Function} ctor base Class * @param {Function} superCtor super Class */ - inherit( ctor: ((...args: any[]) => any), superCtor: ((...args: any[]) => any) ): void; + inherit(ctor: ((...args: any[]) => any), superCtor: ((...args: any[]) => any)): void; /** * @method extend @@ -53,7 +53,7 @@ export interface UtilBase { * @param {String or Number} px * @return {Number} */ - pxToInt(px: string| number): number; + pxToInt(px: string | number): number; /** * @method clone @@ -145,7 +145,7 @@ export interface UtilBase { * @param {Number} dataSize * @return {String} 변환된 csv 문자열 */ - dataToCsv(keys: string[] , dataList: any[], dataSize: number): string; + dataToCsv(keys: string[], dataList: any[], dataSize: number): string; /** * @method dataToCsv2 @@ -268,7 +268,7 @@ export interface UtilBase { * @param {Object} [context=null] * @return {Function} 최적화된 루프 콜백 (index, groupIndex 2가지 파라미터를 받는다.) */ - loop(total: number, context?: any): ((index: number, groupIndex: number) => void ); + loop(total: number, context?: any): ((index: number, groupIndex: number) => void); /** * @method loopArray @@ -280,7 +280,7 @@ export interface UtilBase { * @param {Object} [context=null] * @return {Function} 최적화된 루프 콜백 (data, index, groupIndex 3가지 파라미터를 받는다.) */ - loopArray(data: any[], context?: any): ((data: any, index: number, groupIndex: number) => void ); + loopArray(data: any[], context?: any): ((data: any, index: number, groupIndex: number) => void); /** * @method makeIndex @@ -405,7 +405,7 @@ export interface JuiStatic { * @param {String} type Event type * @param {Array} args Event arguments */ - emit(key: string, type: string, args: any[]): void; + emit(key: string, type: string, args: any[]): void; /** * @method get @@ -414,7 +414,7 @@ export interface JuiStatic { * @param {Integer/String} key * @returns {Object/Array} UI instance */ - get(key: number|string): any; + get(key: number | string): any; /** * @method getAll @@ -422,7 +422,7 @@ export interface JuiStatic { * * @return {Array} UI instances */ - getAll(): any[]; + getAll(): any[]; /** * @method create @@ -433,7 +433,7 @@ export interface JuiStatic { * @param {Object} options * @return {Object} */ - create(type: string, selector: any, options?: {}): any; + create(type: string, selector: any, options?: {}): any; } export interface UICollection { @@ -455,7 +455,7 @@ export interface UICore { * @param {Function} args Event Arguments * @return {Mixed} */ - emit(type: string, args: () => void): any; + emit(type: string, args: () => void): any; /** * @method on @@ -464,7 +464,7 @@ export interface UICore { * @param {String} type Event type * @param {Function} callback */ - on(type: string, callback: () => void): void; + on(type: string, callback: () => void): void; /** * @method off @@ -472,7 +472,7 @@ export interface UICore { * * @param {String} type Event type */ - off(type: string): void; + off(type: string): void; /** * @method addValid @@ -481,7 +481,7 @@ export interface UICore { * @param {String} name Method name * @param {Array} params Parameters */ - addValid(name: string, params: any[]): void; + addValid(name: string, params: any[]): void; /** * @method callBefore @@ -491,7 +491,7 @@ export interface UICore { * @param {Function} callback * @return {Mixed} */ - callBefore(name: string, callback: () => void): void; + callBefore(name: string, callback: () => void): void; /** * @method callAfter @@ -501,7 +501,7 @@ export interface UICore { * @param {Function} callback * @return {Mixed} */ - callAfter(name: string, callback: () => void): void; + callAfter(name: string, callback: () => void): void; /** * @method callDelay @@ -510,7 +510,7 @@ export interface UICore { * @param {String} name Method name * @param {Function} callback */ - callDelay(name: string, callObj: () => void): void; + callDelay(name: string, callObj: () => void): void; /** * @method setTpl @@ -519,7 +519,7 @@ export interface UICore { * @param {String} name Template name * @param {String} html Template markup */ - setTpl(name: string, html: string): void; + setTpl(name: string, html: string): void; /** * @method setOption @@ -528,14 +528,14 @@ export interface UICore { * @param {String} key * @param {Mixed} value */ - setOption(key: string, value: any): void; + setOption(key: string, value: any): void; /** * @method destroy * Removes all events set in a UI obejct and the DOM element * */ - destroy(): void; + destroy(): void; } //noinspection TypeScriptUnresolvedVariable @@ -549,7 +549,7 @@ export interface UIEvent extends UICore { * @param {String/HTMLElement} Selector * @returns {*|jQuery} */ - find(selector: any): JQuery; + find(selector: any): JQuery; } export class ColorScale { @@ -807,7 +807,7 @@ export interface UtilMath { inverseMatrix3d(a: any[]): any[]; } -export interface UtilScaleOrdinal extends Function { +export interface UtilScaleOrdinal extends Function { (x: number): number; domain(values: any[]): UtilScaleOrdinal; range(values: any[]): UtilScaleOrdinal; diff --git a/types/jui-grid/index.d.ts b/types/jui-grid/index.d.ts index 8ced2164e4..5da7d23c43 100644 --- a/types/jui-grid/index.d.ts +++ b/types/jui-grid/index.d.ts @@ -3,16 +3,16 @@ // Definitions by: Jin-Ho Park // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -import {UIEvent} from 'jui-core'; +import { UIEvent } from 'jui-core'; export interface GridColumn { - (index: number|string): this; + (index: number | string): this; /** @property {HTMLElement} [element=null] TH element of a specified column */ element: any; /** @property {String} [order="asc"] Column sort state */ - order: "asc"|"desc"; + order: "asc" | "desc"; /** @property {String} [name=null] Column name */ name?: string; @@ -27,7 +27,7 @@ export interface GridColumn { index: number; /** @property {"show"/"hide"/"resize"} [type="show"] The current column state */ - type: "show"|"hide"|"resize"; + type: "show" | "hide" | "resize"; /** @property {Integer} [width=null] Column width */ width?: number; @@ -47,7 +47,7 @@ export interface GridRow { rownum?: number; /** @property {String/Integer} [index=null] Index of a specified row. In the case of a tree structure, a depth is given. */ - index: number|string; + index: number | string; /** @property {HTMLElement} [element=null] TR element of a specified row. */ element: any; @@ -68,12 +68,12 @@ export interface GridRow { depth: number; /** @property {"open"/"fold"} [type="fold"] State value that indicates whether a child row is shown or hidden. */ - type: "open"|"fold"; + type: "open" | "fold"; /** @property {Function} [type="null"] State value that indicates whether a child row is shown or hidden. */ tpl?(): void; - setIndex(rownum: number|string): void; + setIndex(rownum: number | string): void; reload(columns: GridColumn[], seq: any, xssFilter: any): void; destroy(): void; isLeaf(): boolean; @@ -81,37 +81,37 @@ export interface GridRow { open(): void; appendChild(row: GridRow): void; insertChild(rownum: number, row: GridRow, isReload?: any): void; - removeChild(index: number|string): void; + removeChild(index: number | string): void; lastChild(): GridRow; - lastChildLeaf(lastRow: GridRow): GridRow|any; + lastChildLeaf(lastRow: GridRow): GridRow | any; showCell(index: number): void; hideCell(index: number): void; } export interface GridBase { - appendRow(index: number|string, data?: {}): GridRow; - insertRow(index: number|string, data: {}): GridRow; - updateRow(index: number|string, data: {}): GridRow; - moveRow(index: number|string, targetIndex: number|string): void; - removeRow(index: number|string): void; - openRow(index: number|string): void; + appendRow(index: number | string, data?: {}): GridRow; + insertRow(index: number | string, data: {}): GridRow; + updateRow(index: number | string, data: {}): GridRow; + moveRow(index: number | string, targetIndex: number | string): void; + removeRow(index: number | string): void; + openRow(index: number | string): void; openRowAll(): void; - foldRow(index: number|string): void; + foldRow(index: number | string): void; foldRowAll(): void; removeRows(): void; sortRows(name: string, isDesc: boolean): void; appendColumn(tplType: string, dataList: any[]): void; - removeColumn(index: number|string): void; - hideColumn(index: number|string): void; - showColumn(index: number|string): void; + removeColumn(index: number | string): void; + hideColumn(index: number | string): void; + showColumn(index: number | string): void; getColumnCount(): number; getRowCount(): number; - getColumn(index?: number|string): GridColumn|GridColumn[]; - getRow(index?: number|string): GridRow|GridRow[]; - getRowAll(index: number|string): GridRow[]; - getRowParent(index: number|string): GridRow; - setColumn(index: number|string, column: GridColumn): void; - setRow(index: number|string, row: GridRow): void; + getColumn(index?: number | string): GridColumn | GridColumn[]; + getRow(index?: number | string): GridRow | GridRow[]; + getRowAll(index: number | string): GridRow[]; + getRowParent(index: number | string): GridRow; + setColumn(index: number | string, column: GridColumn): void; + setRow(index: number | string, row: GridRow): void; } export interface GridTable extends UIEvent { @@ -153,7 +153,7 @@ export interface GridTable extends UIEvent { * @cfg {Boolean/Array} [colshow=false] * Sets a column index shown when the Show/Hide Column menu is enabled. */ - colshow?: boolean|any[], + colshow?: boolean | any[], /** * @cfg {Boolean} [scroll=false] @@ -189,7 +189,7 @@ export interface GridTable extends UIEvent { * @cfg {Boolean|Array} [editRow=false] * Determines whether to use a modified row area. */ - editRow?: boolean|any[], + editRow?: boolean | any[], /** * @cfg {Boolean} [editEvent=true] @@ -207,7 +207,7 @@ export interface GridTable extends UIEvent { * @cfg {Boolean/Array} [sort=false] * Determines whether to use the table sort function. */ - sort?: boolean|any[], + sort?: boolean | any[], /** * @cfg {Integer} [sortIndex=null] @@ -219,7 +219,7 @@ export interface GridTable extends UIEvent { * @cfg {String} [sortOrder="asc"] * Determines whether to use the table sort function. */ - sortOrder?: "asc"|"desc", + sortOrder?: "asc" | "desc", /** * @cfg {Boolean} [sortEvent=true] @@ -242,7 +242,7 @@ export interface GridTable extends UIEvent { * * @param {Array} rows */ - update(indexOrRows?: any, rows?: any): void; + update(indexOrRows?: any, rows?: any): void; /** * @method updateTree * It is possible to configure a tree table using an object array with the index and data properties. @@ -257,7 +257,7 @@ export interface GridTable extends UIEvent { * * @param {RowObject} row */ - append(rowOrIndex?: number|any, row?: any): void; + append(rowOrIndex?: number | any, row?: any): void; /** * @method insert @@ -468,7 +468,7 @@ export interface GridTable extends UIEvent { * @param {"Integer"/"String"} key index or column key * @return {ColumnObject} column */ - getColumn(index: number|string): GridColumn; + getColumn(index: number | string): GridColumn; /** * @method showColumn @@ -476,7 +476,7 @@ export interface GridTable extends UIEvent { * * @param {"Integer"/"String"} key index or column name */ - showColumn(index: number|string, e?: any): void; + showColumn(index: number | string, e?: any): void; /** * @method hideColumn @@ -484,7 +484,7 @@ export interface GridTable extends UIEvent { * * @param {"Integer"/"String"} key index or column name */ - hideColumn(index: number|string, e?: any): void; + hideColumn(index: number | string, e?: any): void; /** * @method initColumns @@ -662,7 +662,7 @@ export interface GridXTable extends UIEvent { * * @param {Integer} index */ - open(index: number|string): void; + open(index: number | string): void; /** * @method fold @@ -670,19 +670,19 @@ export interface GridXTable extends UIEvent { * * @param {Integer} index */ - fold(index: number|string): void; + fold(index: number | string): void; /** * @method openAll * Shows all child rows of a specified index. */ - openAll(index: number|string): void; + openAll(index: number | string): void; /** * @method foldAll * Hides all child rows of a specified index. */ - foldAll(index: number|string): void; + foldAll(index: number | string): void; /** * @method next @@ -705,7 +705,7 @@ export interface GridXTable extends UIEvent { * @param {Integer} index * @param {String} order "asc" or "desc" */ - sort(index: number, order: "asc"|"desc", e?: any, isNotLoading?: any): void; + sort(index: number, order: "asc" | "desc", e?: any, isNotLoading?: any): void; /** * @method filter @@ -762,7 +762,7 @@ export interface GridXTable extends UIEvent { * @param {Integer|String} index * @param {Integer} dist */ - scrollTop(index: number|string, dist: number): void; + scrollTop(index: number | string, dist: number): void; /** * @deprecated @@ -831,7 +831,7 @@ export interface GridXTable extends UIEvent { * @param {"Integer"/"String"} key index or column key * @return {ColumnObject} column */ - getColumn(index: number|string): GridColumn; + getColumn(index: number | string): GridColumn; /** * @method getData @@ -840,7 +840,7 @@ export interface GridXTable extends UIEvent { * @param {"Integer"/"String"} key index * @return {ColumnObject} data */ - getData(index: number|string): any; + getData(index: number | string): any; /** * @method showColumn @@ -848,7 +848,7 @@ export interface GridXTable extends UIEvent { * * @param {"Integer"/"String"} key index or column name */ - showColumn(index: number|string): void; + showColumn(index: number | string): void; /** * @method hideColumn @@ -856,7 +856,7 @@ export interface GridXTable extends UIEvent { * * @param {"Integer"/"String"} key index or column name */ - hideColumn(index: number|string): void; + hideColumn(index: number | string): void; /** * @method initColumns @@ -864,7 +864,7 @@ export interface GridXTable extends UIEvent { * * @param {"Integer"/"String"} key index or column name */ - initColumns(keys: number|string): void; + initColumns(keys: number | string): void; /** * @method showColumnMenu @@ -973,7 +973,7 @@ export interface GridXTable extends UIEvent { * @param {Integer} columnIndex * @param {Function} callback */ - rowFunc(type: "sum"|"avg", index: number, callback: (data: any) => void): any; + rowFunc(type: "sum" | "avg", index: number, callback: (data: any) => void): any; /** * @method getPage diff --git a/types/jui/index.d.ts b/types/jui/index.d.ts index 24e5ed215c..93372f898d 100644 --- a/types/jui/index.d.ts +++ b/types/jui/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Jin-Ho Park // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -import {UIEvent} from 'jui-core'; +import { UIEvent } from 'jui-core'; export interface UIAccordion extends UIEvent { (selector: any, options?: { @@ -26,7 +26,7 @@ export interface UIAccordion extends UIEvent { * */ multipanel?: boolean - }) : this; + }): this; /** * @method activeIndex @@ -52,7 +52,7 @@ export interface UIAutoComplete { * Designates words subject to autofill */ words?: string[] - }) : this; + }): this; /** * @method update @@ -61,14 +61,14 @@ export interface UIAutoComplete { * @param {Array} words * */ - update(newWords: string[]): void; + update(newWords: string[]): void; /** * @method close * Close the active drop-down * */ - close(): void; + close(): void; /** * @method list @@ -76,7 +76,7 @@ export interface UIAutoComplete { * * @return {Array} words */ - list(): string[]; + list(): string[]; } export interface UIColorPicker { @@ -85,11 +85,11 @@ export interface UIColorPicker { event?: any, type?: string, color?: string - }) : this; + }): this; - getColor(type: string): string|{}; + getColor(type: string): string | {}; - setColor(value: string|{}): void; + setColor(value: string | {}): void; } export interface UICombo { @@ -130,14 +130,14 @@ export interface UICombo { * @cfg {"top"/"bottom"} [position="bottom"] * It is possible to determine an initial selection button with a specified value */ - position?: "top"|"bottom", + position?: "top" | "bottom", /** * @cfg {Boolean} [flex=true] * Drop-down menu is varied by changing the width function */ flex?: boolean - }) : this; + }): this; /** * @method setIndex @@ -145,7 +145,7 @@ export interface UICombo { * * @param {Number} index */ - setIndex(index: number): void; + setIndex(index: number): void; /** * @method setValue @@ -153,7 +153,7 @@ export interface UICombo { * * @param {Mixed} value */ - setValue(value: any): void; + setValue(value: any): void; /** * @method getData @@ -161,7 +161,7 @@ export interface UICombo { * * @return {Object} */ - getData(): {}; + getData(): {}; /** * @method getValue @@ -169,7 +169,7 @@ export interface UICombo { * * @return {Mixed} */ - getValue(): any; + getValue(): any; /** * @method getText @@ -177,25 +177,25 @@ export interface UICombo { * * @return {String} */ - getText(): string; + getText(): string; /** * @method open * Shows the element list of a combo box */ - open(e: any): void; + open(e: any): void; /** * @method fold * Hides the element list of a combo box */ - fold(): void; + fold(): void; /** * @method reload * Re-defines a combo box */ - reload(): void; + reload(): void; } export interface UIDatePicker { @@ -206,7 +206,7 @@ export interface UIDatePicker { * @cfg {"daily"/"monthly"/"yearly"} [type="daily"] * Determines the type of a calendar */ - type?: "daily"|"monthly"|"yearly", + type?: "daily" | "monthly" | "yearly", /** * @cfg {String} [titleFormat="yyyy.MM"] @@ -224,7 +224,7 @@ export interface UIDatePicker { * @cfg {Date} [date="now"] * Selects a specific date as a basic */ - date?: "now"|Date, + date?: "now" | Date, /** * @cfg {Date} [minDate="null"] @@ -237,7 +237,7 @@ export interface UIDatePicker { * Selects a specific maximum date */ maxDate?: Date - }) : this; + }): this; /** * @method page @@ -246,7 +246,7 @@ export interface UIDatePicker { * @param {Integer} year * @param {Integer} month */ - page(y: number, m: number): void; + page(y: number, m: number): void; /** * @method prev @@ -260,7 +260,7 @@ export interface UIDatePicker { * Outputs a calendar that fits the next year/month * */ - next(e: any, moveYear?: boolean): void; + next(e: any, moveYear?: boolean): void; /** * @method select @@ -268,7 +268,7 @@ export interface UIDatePicker { * * @param {"year"/"month"/"date"/"timestamp"/"Date"} */ - select( ...args: any[]): void; + select(...args: any[]): void; /** * @method addTime @@ -276,7 +276,7 @@ export interface UIDatePicker { * * @param {"Integer"/"Date"} time Timestamp or Date */ - addTime(time: number|Date): void; + addTime(time: number | Date): void; /** * @method getDate @@ -284,7 +284,7 @@ export interface UIDatePicker { * * @return {Date} Date object */ - getDate(): Date; + getDate(): Date; /** * @method getTime @@ -292,7 +292,7 @@ export interface UIDatePicker { * * @return {Integer} Timestamp */ - getTime(): number; + getTime(): number; /** * @method getFormat @@ -300,13 +300,13 @@ export interface UIDatePicker { * * @return {String} format Formatted date string */ - getFormat(format: string): string; + getFormat(format: string): string; /** * @method reload * Reloads the datepicker */ - reload(): void; + reload(): void; } export interface UIDropdown { @@ -377,7 +377,7 @@ export interface UIDropdown { * @param {Integer} x * @param {Integer} y */ - show(x: number, y: number): void; + show(x: number, y: number): void; /** * @method move @@ -386,13 +386,13 @@ export interface UIDropdown { * @param {Integer} x * @param {Integer} y */ - move(x: number, y: number): void; + move(x: number, y: number): void; /** * @method reload * Reloads the dropdown list */ - reload(): void; + reload(): void; } export interface UIModal { @@ -403,7 +403,7 @@ export interface UIModal { * @cfg {"black"/"gray"} [color="black"] * Determines the color of a modal */ - color?: "black"|"gray", + color?: "black" | "gray", /** * @cfg {Float} [opacity=0.4] @@ -415,7 +415,7 @@ export interface UIModal { * @cfg {String/DOMElement} [target="body"] * Sets a selector on which a modal is shown */ - target?: string|any, + target?: string | any, /** * @cfg {Integer} [index=0] @@ -434,19 +434,19 @@ export interface UIModal { * Automatically hides a modal when clicking on it */ autoHide?: boolean - }): this; + }): this; /** * @method hide * Hides a modal */ - hide(): void; + hide(): void; /** * @method show * Shows a modal */ - show(): void; + show(): void; /** * @method resize @@ -463,7 +463,7 @@ export interface UINotify { * @cfg {"top"/"top-lefet"/"top-right"/"bottom"/"bottom-left"/"bottom-right"} [position="top-right"] * Designates the location where a notice message is added */ - position?: "top"|"top-lefet"|"top-right"|"bottom"|"bottom-left"|"bottom-right", + position?: "top" | "top-lefet" | "top-right" | "bottom" | "bottom-left" | "bottom-right", /** * @cfg {Integer} [padding=12] @@ -524,7 +524,7 @@ export interface UINotify { reset(): void; } -export interface UIPaging { +export interface UIPaging { (selector: any, options?: { tpl?: any, event?: any, @@ -593,7 +593,7 @@ export interface UIProgress { tpl?: any, event?: any, type?: "simple" | "flat", // simple or flat - orient?: "horizontal"|"vertical", // or vertical, + orient?: "horizontal" | "vertical", // or vertical, min?: number, max?: number, value?: number, @@ -618,7 +618,7 @@ export interface UIProperty { loadItems(newItems: any[]): void; - addItem(item: {}|any[]): void; + addItem(item: {} | any[]): void; // remove item by key or title removeItem(item: {}): void; @@ -628,7 +628,7 @@ export interface UIProperty { * * get a list of group's title. */ - getGroupList(): any[]; + getGroupList(): any[]; /** * @method collapsed @@ -637,7 +637,7 @@ export interface UIProperty { * * @param {String} id */ - collapsed(id: string): void; + collapsed(id: string): void; /** * @method expanded @@ -683,13 +683,13 @@ export interface UISelect { event?: any, items?: any[], placeholder?: string, - align?: 'left'|'right', - valign?: 'top'|'bottom', + align?: 'left' | 'right', + valign?: 'top' | 'bottom', multi?: boolean }): this; - setValue(value: any|any[]): void; - getValue(): any| any[]; + setValue(value: any | any[]): void; + getValue(): any | any[]; setSelectedIndex(index: number): void; getSelectedIndex(): number; update(data: any[]): void; @@ -699,8 +699,8 @@ export interface UISlider { (selector: any, options?: { tpl?: any, event?: any, - type?: "single"|"double", // or double - orient?: "horizontal"|"vertical", // or vertical, + type?: "single" | "double", // or double + orient?: "horizontal" | "vertical", // or vertical, min?: number, max?: number, step?: number, @@ -776,13 +776,13 @@ export interface UISplitter { * @cfg {"vertical"/"horizontal"} [direction='vertical'] * set bar's direction */ - direction?: 'vertical'|'horizontal', + direction?: 'vertical' | 'horizontal', /** * @cfg {String/Number} [initSize='50%'] * set first panel's default width or height */ - initSize?: string|number, + initSize?: string | number, /** * @cfg {Number/Array} [minSize=30] @@ -794,7 +794,7 @@ export interface UISplitter { * minSize[1] is second panel's minimum size * */ - minSize?: number|number[], + minSize?: number | number[], /** * @cfg {String} [items=[]] @@ -846,7 +846,7 @@ export interface UITab { * @cfg {String/DOMElement} [target=""] * Determines a selector in the area to become the content of a tab */ - target?: string|any, + target?: string | any, /** * @cfg {Integer} [index=0] @@ -963,7 +963,7 @@ export interface UITooltip { * @cfg {"top"/"bottom"/"left"/"right"} [position="top"] * Determines the location where a tooltip is shown */ - position?: "top"|"bottom"|"left"|"right", + position?: "top" | "bottom" | "left" | "right", /** * @cfg {Integer} [width=150] @@ -975,7 +975,7 @@ export interface UITooltip { * @cfg {"left"/"right"/"center"} [align="left"] * Determines the alignment state inside a tooltip */ - align?: "left"|"right"|"center", + align?: "left" | "right" | "center", /** * @cfg {Integer} [delay=0] @@ -1260,25 +1260,25 @@ export interface UIWindow { * @cfg {String/Integer} [left="auto"] * Determines the X coordinate of a window */ - left?: string|number, + left?: string | number, /** * @cfg {String/Integer} [top="auto"] * Determines the Y coordinate of a window */ - top?: string|number, + top?: string | number, /** * @cfg {String/Integer} [right="auto"] * Determines the X coordinate based on the right side of a window */ - right?: string|number, + right?: string | number, /** * @cfg {String/Integer} [bottom="auto"] * Determines the Y coordinate based on the bottom side of a window */ - bottom?: string|number, + bottom?: string | number, /** * @cfg {Boolean} [modal=false] diff --git a/types/loopback-boot/loopback-boot-tests.ts b/types/loopback-boot/loopback-boot-tests.ts index 5b0e8d54a9..5de95d00c6 100644 --- a/types/loopback-boot/loopback-boot-tests.ts +++ b/types/loopback-boot/loopback-boot-tests.ts @@ -3,18 +3,18 @@ import * as boot from 'loopback-boot'; import * as cookieParser from 'cookie-parser'; class Server { - app: loopback.LoopBackApplication; + app: loopback.LoopBackApplication; - static boostrap(): Server { - return new Server(); - } - constructor() { - this.app = loopback(); + static boostrap(): Server { + return new Server(); + } + constructor() { + this.app = loopback(); - this.app.use(cookieParser()); + this.app.use(cookieParser()); - this.config(); - } + this.config(); + } private config(): void { boot(this.app, __dirname, (err: Error) => { diff --git a/types/nedb/index.d.ts b/types/nedb/index.d.ts index d85016493e..15a2fd4e83 100644 --- a/types/nedb/index.d.ts +++ b/types/nedb/index.d.ts @@ -60,7 +60,7 @@ declare class Nedb { * If one update violates a constraint, all changes are rolled back */ updateIndexes(oldDoc: T, newDoc: T): void; - updateIndexes(updates: Array<{oldDoc: T; newDoc: T}>): void; + updateIndexes(updates: Array<{ oldDoc: T; newDoc: T }>): void; /** * Return the list of candidates for a given query diff --git a/types/nedb/nedb-tests.ts b/types/nedb/nedb-tests.ts index 9b5527051c..47af1b137f 100644 --- a/types/nedb/nedb-tests.ts +++ b/types/nedb/nedb-tests.ts @@ -54,7 +54,7 @@ class BaseCollection { findByID(id: string): Promise { return new Promise((resolve, reject) => { - this.dataStore.findOne({_id: id}, (err: Error, doc: T) => { + this.dataStore.findOne({ _id: id }, (err: Error, doc: T) => { if (err) { reject(err); } else { @@ -102,7 +102,7 @@ class BaseCollection { upsert(query: any, updateQuery: any): Promise { const a: Promise = new Promise((resolve, reject) => { - this.dataStore.update(query, updateQuery, {upsert: true}, (err: Error, numberOfUpdated: number, upsert: boolean) => { + this.dataStore.update(query, updateQuery, { upsert: true }, (err: Error, numberOfUpdated: number, upsert: boolean) => { if (err) { reject(err); } else { @@ -112,7 +112,7 @@ class BaseCollection { }); const b: Promise = new Promise((resolve, reject) => { - this.dataStore.update(query, updateQuery, {upsert: true}, (err: Error, numberOfUpdated: number, affectedDocs: any, upsert: boolean) => { + this.dataStore.update(query, updateQuery, { upsert: true }, (err: Error, numberOfUpdated: number, affectedDocs: any, upsert: boolean) => { if (err) { reject(err); } else { @@ -154,19 +154,19 @@ import Datastore = require('nedb'); let db = new Datastore(); // Type 2: Persistent datastore with manual loading -db = new Datastore({filename: 'path/to/datafile'}); +db = new Datastore({ filename: 'path/to/datafile' }); db.loadDatabase((err) => { // Callback is optional // Now commands will be executed }); // Type 3: Persistent datastore with automatic loading -db = new Datastore({filename: 'path/to/datafile', autoload: true}); +db = new Datastore({ filename: 'path/to/datafile', autoload: true }); // You can issue commands right away // Type 4: Persistent datastore for a Node Webkit app called 'nwtest' // For example on Linux, the datafile will be ~/.config/nwtest/nedb-data/something.db import path = require('path'); -db = new Datastore({filename: path.join(require('nw.gui').App.dataPath, 'something.db')}); +db = new Datastore({ filename: path.join(require('nw.gui').App.dataPath, 'something.db') }); // Of course you can create multiple datastores if you need several // collections. In this case it's usually a good idea to use autoload for all collections. @@ -179,14 +179,14 @@ dbContainer.users.loadDatabase(); dbContainer.robots.loadDatabase(); const doc: any = { - hello: 'world' - , n: 5 - , today: new Date() - , nedbIsAwesome: true - , notthere: null - , notToBeSaved: undefined // Will not be saved - , fruits: ['apple', 'orange', 'pear'] - , infos: {name: 'nedb'} + hello: 'world', + n: 5, + today: new Date(), + nedbIsAwesome: true, + notthere: null, + notToBeSaved: undefined, // Will not be saved + fruits: ['apple', 'orange', 'pear'], + infos: { name: 'nedb' } }; db.insert(doc, (err: Error, newDoc: any) => { // Callback is optional @@ -194,54 +194,54 @@ db.insert(doc, (err: Error, newDoc: any) => { // Callback is optional // newDoc has no key called notToBeSaved since its value was undefined }); -db.insert([{a: 5}, {a: 42}], (err: Error, newdocs: any[]) => { +db.insert([{ a: 5 }, { a: 42 }], (err: Error, newdocs: any[]) => { // Two documents were inserted in the database // newDocs is an array with these documents, augmented with their _id }); // If there is a unique constraint on field 'a', this will fail -db.insert([{a: 5}, {a: 42}, {a: 5}], (err: Error) => { +db.insert([{ a: 5 }, { a: 42 }, { a: 5 }], (err: Error) => { // err is a 'uniqueViolated' error // The database was not modified }); // Finding all planets in the solar system -db.find({system: 'solar'}, (err: Error, docs: any[]) => { +db.find({ system: 'solar' }, (err: Error, docs: any[]) => { // docs is an array containing documents Mars, Earth, Jupiter // If no document is found, docs is equal to [] }); // Finding all planets whose name contain the substring 'ar' using a regular expression -db.find({planet: /ar/}, (err: Error, docs: any[]) => { +db.find({ planet: /ar/ }, (err: Error, docs: any[]) => { // docs contains Mars and Earth }); // Finding all inhabited planets in the solar system -db.find({system: 'solar', inhabited: true}, (err: Error, docs: any[]) => { +db.find({ system: 'solar', inhabited: true }, (err: Error, docs: any[]) => { // docs is an array containing document Earth only }); // Use the dot-notation to match fields in subdocuments -db.find({"humans.genders": 2}, (err: Error, docs: any[]) => { +db.find({ "humans.genders": 2 }, (err: Error, docs: any[]) => { // docs contains Earth }); // Use the dot-notation to navigate arrays of subdocuments -db.find({"completeData.planets.name": "Mars"}, (err: Error, docs: any[]) => { +db.find({ "completeData.planets.name": "Mars" }, (err: Error, docs: any[]) => { // docs contains document 5 }); -db.find({"completeData.planets.name": "Jupiter"}, (err: Error, docs: any[]) => { +db.find({ "completeData.planets.name": "Jupiter" }, (err: Error, docs: any[]) => { // docs is empty }); -db.find({"completeData.planets.0.name": "Earth"}, (err: Error, docs: any[]) => { +db.find({ "completeData.planets.0.name": "Earth" }, (err: Error, docs: any[]) => { // docs contains document 5 // If we had tested against "Mars" docs would be empty because we are matching against a specific array element }); // You can also deep-compare objects. Don't confuse this with dot-notation! -db.find({humans: {genders: 2}}, (err: Error, docs: any[]) => { +db.find({ humans: { genders: 2 } }, (err: Error, docs: any[]) => { // docs is empty, because { genders: 2 } is not equal to { genders: 2, eyes: true } }); @@ -250,66 +250,66 @@ db.find({}, (err: Error, docs: any[]) => { }); // The same rules apply when you want to only find one document -db.findOne({_id: 'id1'}, (err: Error, doc: any) => { +db.findOne({ _id: 'id1' }, (err: Error, doc: any) => { // doc is the document Mars // If no document is found, doc is null }); // $lt, $lte, $gt and $gte work on numbers and strings -db.find({"humans.genders": {$gt: 5}}, (err: Error, docs: any[]) => { +db.find({ "humans.genders": { $gt: 5 } }, (err: Error, docs: any[]) => { // docs contains Omicron Persei 8, whose humans have more than 5 genders (7). }); // When used with strings, lexicographical order is used -db.find({planet: {$gt: 'Mercury'}}, (err: Error, docs: any[]) => { +db.find({ planet: { $gt: 'Mercury' } }, (err: Error, docs: any[]) => { // docs contains Omicron Persei 8 }); // Using $in. $nin is used in the same way -db.find({planet: {$in: ['Earth', 'Jupiter']}}, (err: Error, docs: any[]) => { +db.find({ planet: { $in: ['Earth', 'Jupiter'] } }, (err: Error, docs: any[]) => { // docs contains Earth and Jupiter }); // Using $exists -db.find({satellites: {$exists: true}}, (err: Error, docs: any[]) => { +db.find({ satellites: { $exists: true } }, (err: Error, docs: any[]) => { // docs contains only Mars }); // Using $regex with another operator -db.find({planet: {$regex: /ar/, $nin: ['Jupiter', 'Earth']}}, (err: Error, docs: any[]) => { +db.find({ planet: { $regex: /ar/, $nin: ['Jupiter', 'Earth'] } }, (err: Error, docs: any[]) => { // docs only contains Mars because Earth was excluded from the match by $nin }); // Using an array-specific comparison function // Note: you can't use nested comparison functions, e.g. { $size: { $lt: 5 } } will throw an error -db.find({satellites: {$size: 2}}, (err: Error, docs: any[]) => { +db.find({ satellites: { $size: 2 } }, (err: Error, docs: any[]) => { // docs contains Mars }); -db.find({satellites: {$size: 1}}, (err: Error, docs: any[]) => { +db.find({ satellites: { $size: 1 } }, (err: Error, docs: any[]) => { // docs is empty }); // If a document's field is an array, matching it means matching any element of the array -db.find({satellites: 'Phobos'}, (err: Error, docs: any[]) => { +db.find({ satellites: 'Phobos' }, (err: Error, docs: any[]) => { // docs contains Mars. Result would have been the same if query had been { satellites: 'Deimos' } }); // This also works for queries that use comparison operators -db.find({satellites: {$lt: 'Amos'}}, (err: Error, docs: any[]) => { +db.find({ satellites: { $lt: 'Amos' } }, (err: Error, docs: any[]) => { // docs is empty since Phobos and Deimos are after Amos in lexicographical order }); // This also works with the $in and $nin operator -db.find({satellites: {$in: ['Moon', 'Deimos']}}, (err: Error, docs: any[]) => { +db.find({ satellites: { $in: ['Moon', 'Deimos'] } }, (err: Error, docs: any[]) => { // docs contains Mars (the Earth document is not complete!) }); -db.find({$or: [{planet: 'Earth'}, {planet: 'Mars'}]}, (err: Error, docs: any[]) => { +db.find({ $or: [{ planet: 'Earth' }, { planet: 'Mars' }] }, (err: Error, docs: any[]) => { // docs contains Earth and Mars }); -db.find({$not: {planet: 'Earth'}}, (err: Error, docs: any[]) => { +db.find({ $not: { planet: 'Earth' } }, (err: Error, docs: any[]) => { // docs contains Mars, Jupiter, Omicron Persei 8 }); @@ -322,53 +322,53 @@ db.find({ }); // You can mix normal queries, comparison queries and logical operators -db.find({$or: [{planet: 'Earth'}, {planet: 'Mars'}], inhabited: true}, (err: Error, docs: any[]) => { +db.find({ $or: [{ planet: 'Earth' }, { planet: 'Mars' }], inhabited: true }, (err: Error, docs: any[]) => { // docs contains Earth }); // No query used means all results are returned (before the Cursor modifiers) -db.find({}).sort({planet: 1}).skip(1).limit(2).exec((err: Error, docs: any[]) => { +db.find({}).sort({ planet: 1 }).skip(1).limit(2).exec((err: Error, docs: any[]) => { // docs is [doc3, doc1] }); // You can sort in reverse order like this -db.find({system: 'solar'}).sort({planet: -1}).exec((err: Error, docs: any[]) => { +db.find({ system: 'solar' }).sort({ planet: -1 }).exec((err: Error, docs: any[]) => { // docs is [doc1, doc3, doc2] }); // You can sort on one field, then another, and so on like this: -db.find({}).sort({firstField: 1, secondField: -1}); +db.find({}).sort({ firstField: 1, secondField: -1 }); // Same database as above // Keeping only the given fields -db.find({planet: 'Mars'}, {planet: 1, system: 1}, (err: Error, docs: any[]) => { +db.find({ planet: 'Mars' }, { planet: 1, system: 1 }, (err: Error, docs: any[]) => { // docs is [{ planet: 'Mars', system: 'solar', _id: 'id1' }] }); // Keeping only the given fields but removing _id -db.find({planet: 'Mars'}, {planet: 1, system: 1, _id: 0}, (err: Error, docs: any[]) => { +db.find({ planet: 'Mars' }, { planet: 1, system: 1, _id: 0 }, (err: Error, docs: any[]) => { // docs is [{ planet: 'Mars', system: 'solar' }] }); // Omitting only the given fields and removing _id -db.find({planet: 'Mars'}, {planet: 0, system: 0, _id: 0}, (err: Error, docs: any[]) => { +db.find({ planet: 'Mars' }, { planet: 0, system: 0, _id: 0 }, (err: Error, docs: any[]) => { // docs is [{ inhabited: false, satellites: ['Phobos', 'Deimos'] }] }); // Failure: using both modes at the same time -db.find({planet: 'Mars'}, {planet: 0, system: 1}, (err: Error, docs: any[]) => { +db.find({ planet: 'Mars' }, { planet: 0, system: 1 }, (err: Error, docs: any[]) => { // err is the error message, docs is undefined }); // You can also use it in a Cursor way but this syntax is not compatible with MongoDB // If upstream compatibility is important don't use this method -db.find({planet: 'Mars'}).projection({planet: 1, system: 1}).exec((err: Error, docs: any[]) => { +db.find({ planet: 'Mars' }).projection({ planet: 1, system: 1 }).exec((err: Error, docs: any[]) => { // docs is [{ planet: 'Mars', system: 'solar', _id: 'id1' }] }); // Count all planets in the solar system -db.count({system: 'solar'}, (err: Error, count: number) => { +db.count({ system: 'solar' }, (err: Error, count: number) => { // count equals to 3 }); @@ -384,7 +384,7 @@ db.count({}, (err: Error, count: number) => { // { _id: 'id4', planet: 'Omicron Persia 8', system: 'futurama', inhabited: true } // Replace a document by another -db.update({planet: 'Jupiter'}, {planet: 'Pluton'}, {}, (err: Error, numReplaced: number) => { +db.update({ planet: 'Jupiter' }, { planet: 'Pluton' }, {}, (err: Error, numReplaced: number) => { // numReplaced = 1 // The doc #3 has been replaced by { _id: 'id3', planet: 'Pluton' } // Note that the _id is kept unchanged, and the document has been replaced @@ -392,19 +392,19 @@ db.update({planet: 'Jupiter'}, {planet: 'Pluton'}, {}, (err: Error, numReplaced: }); // Set an existing field's value -db.update({system: 'solar'}, {$set: {system: 'solar system'}}, {multi: true}, (err: Error, numReplaced: number) => { +db.update({ system: 'solar' }, { $set: { system: 'solar system' } }, { multi: true }, (err: Error, numReplaced: number) => { // numReplaced = 3 // Field 'system' on Mars, Earth, Jupiter now has value 'solar system' }); // Setting the value of a non-existing field in a subdocument by using the dot-notation -db.update({planet: 'Mars'}, {$set: {"data.satellites": 2, "data.red": true}}, {}, () => { +db.update({ planet: 'Mars' }, { $set: { "data.satellites": 2, "data.red": true } }, {}, () => { // Mars document now is { _id: 'id1', system: 'solar', inhabited: false // , data: { satellites: 2, red: true } // } // Not that to set fields in subdocuments, you HAVE to use dot-notation // Using object-notation will just replace the top-level field - db.update({planet: 'Mars'}, {$set: {data: {satellites: 3}}}, {}, () => { + db.update({ planet: 'Mars' }, { $set: { data: { satellites: 3 } } }, {}, () => { // Mars document now is { _id: 'id1', system: 'solar', inhabited: false // , data: { satellites: 3 } // } @@ -413,23 +413,23 @@ db.update({planet: 'Mars'}, {$set: {"data.satellites": 2, "data.red": true}}, {} }); // Deleting a field -db.update({planet: 'Mars'}, {$unset: {planet: true}}, {}, () => { +db.update({ planet: 'Mars' }, { $unset: { planet: true } }, {}, () => { // Now the document for Mars doesn't contain the planet field // You can unset nested fields with the dot notation of course }); // Upserting a document -db.update({planet: 'Pluton'}, { +db.update({ planet: 'Pluton' }, { planet: 'Pluton', inhabited: false -}, {upsert: true}, (err: Error, numReplaced: number, upsert: boolean) => { +}, { upsert: true }, (err: Error, numReplaced: number, upsert: boolean) => { // numReplaced = 1, upsert = { _id: 'id5', planet: 'Pluton', inhabited: false } // A new document { _id: 'id5', planet: 'Pluton', inhabited: false } has been added to the collection }); // If you upsert with a modifier, the upserted doc is the query modified by the modifier // This is simpler than it sounds :) -db.update({planet: 'Pluton'}, {$inc: {distance: 38}}, {upsert: true}, () => { +db.update({ planet: 'Pluton' }, { $inc: { distance: 38 } }, { upsert: true }, () => { // A new document { _id: 'id5', planet: 'Pluton', distance: 38 } has been added to the collection }); @@ -437,12 +437,12 @@ db.update({planet: 'Pluton'}, {$inc: {distance: 38}}, {upsert: true}, () => { // let's see how we can modify the array field atomically // $push inserts new elements at the end of the array -db.update({_id: 'id6'}, {$push: {fruits: 'banana'}}, {}, () => { +db.update({ _id: 'id6' }, { $push: { fruits: 'banana' } }, {}, () => { // Now the fruits array is ['apple', 'orange', 'pear', 'banana'] }); // $pop removes an element from the end (if used with 1) or the front (if used with -1) of the array -db.update({_id: 'id6'}, {$pop: {fruits: 1}}, {}, () => { +db.update({ _id: 'id6' }, { $pop: { fruits: 1 } }, {}, () => { // Now the fruits array is ['apple', 'orange'] // With { $pop: { fruits: -1 } }, it would have been ['orange', 'pear'] }); @@ -450,22 +450,22 @@ db.update({_id: 'id6'}, {$pop: {fruits: 1}}, {}, () => { // $addToSet adds an element to an array only if it isn't already in it // Equality is deep-checked (i.e. $addToSet will not insert an object in an array already containing the same object) // Note that it doesn't check whether the array contained duplicates before or not -db.update({_id: 'id6'}, {$addToSet: {fruits: 'apple'}}, {}, () => { +db.update({ _id: 'id6' }, { $addToSet: { fruits: 'apple' } }, {}, () => { // The fruits array didn't change // If we had used a fruit not in the array, e.g. 'banana', it would have been added to the array }); // $pull removes all values matching a value or even any NeDB query from the array -db.update({_id: 'id6'}, {$pull: {fruits: 'apple'}}, {}, () => { +db.update({ _id: 'id6' }, { $pull: { fruits: 'apple' } }, {}, () => { // Now the fruits array is ['orange', 'pear'] }); -db.update({_id: 'id6'}, {$pull: {fruits: {$in: ['apple', 'pear']}}}, {}, () => { +db.update({ _id: 'id6' }, { $pull: { fruits: { $in: ['apple', 'pear'] } } }, {}, () => { // Now the fruits array is ['orange'] }); // $each can be used to $push or $addToSet multiple values at once // This example works the same way with $addToSet -db.update({_id: 'id6'}, {$push: {fruits: {$each: ['banana', 'orange']}}}, {}, () => { +db.update({ _id: 'id6' }, { $push: { fruits: { $each: ['banana', 'orange'] } } }, {}, () => { // Now the fruits array is ['apple', 'orange', 'pear', 'banana', 'orange'] }); @@ -477,32 +477,32 @@ db.update({_id: 'id6'}, {$push: {fruits: {$each: ['banana', 'orange']}}}, {}, () // Remove one document from the collection // options set to {} since the default for multi is false -db.remove({_id: 'id2'}, {}, (err: Error, numRemoved: number) => { +db.remove({ _id: 'id2' }, {}, (err: Error, numRemoved: number) => { // numRemoved = 1 }); // Remove multiple documents -db.remove({system: 'solar'}, {multi: true}, (err: Error, numRemoved: number) => { +db.remove({ system: 'solar' }, { multi: true }, (err: Error, numRemoved: number) => { // numRemoved = 3 // All planets from the solar system were removed }); -db.ensureIndex({fieldName: 'somefield'}, (err: Error) => { +db.ensureIndex({ fieldName: 'somefield' }, (err: Error) => { // If there was an error, err is not null }); // Using a unique constraint with the index -db.ensureIndex({fieldName: 'somefield', unique: true}, (err: Error) => { +db.ensureIndex({ fieldName: 'somefield', unique: true }, (err: Error) => { }); // Using a sparse unique index -db.ensureIndex({fieldName: 'somefield', unique: true, sparse: true}, (err: Error) => { +db.ensureIndex({ fieldName: 'somefield', unique: true, sparse: true }, (err: Error) => { }); // Format of the error message when the unique constraint is not met -db.insert({somefield: 'nedb'}, (err: Error) => { +db.insert({ somefield: 'nedb' }, (err: Error) => { // err is null - db.insert({somefield: 'nedb'}, (err: Error) => { + db.insert({ somefield: 'nedb' }, (err: Error) => { // err is { errorType: 'uniqueViolated' // , key: 'name' // , message: 'Unique constraint violated for key name' } diff --git a/types/optics-agent/optics-agent-tests.ts b/types/optics-agent/optics-agent-tests.ts index cb4cb60051..8ead943b5a 100644 --- a/types/optics-agent/optics-agent-tests.ts +++ b/types/optics-agent/optics-agent-tests.ts @@ -33,10 +33,10 @@ OpticsAgent.instrumentHapiServer(hapiServer); const koaServer = new KoaServer(); koaServer.use(OpticsAgent.koaMiddleware()); -const req = {} as express.Request; +declare const req: express.Request; OpticsAgent.context(req); const agent = new OpticsAgent.Agent({ apiKey: '1234' }); -const schema = {} as GraphQLSchema; +declare const schema: GraphQLSchema; agent.instrumentSchema(schema); diff --git a/types/react-native-snap-carousel/react-native-snap-carousel-tests.tsx b/types/react-native-snap-carousel/react-native-snap-carousel-tests.tsx index 88fb764b03..17e92aa6ae 100644 --- a/types/react-native-snap-carousel/react-native-snap-carousel-tests.tsx +++ b/types/react-native-snap-carousel/react-native-snap-carousel-tests.tsx @@ -42,8 +42,8 @@ class SnapCarouselTest extends React.Component<{}, {}> { const styles = StyleSheet.create({ container: { flex: 1 - } as ViewStyle, + }, item: { width: 75 - } as ViewStyle + } }); diff --git a/types/react-native-swiper/react-native-swiper-tests.tsx b/types/react-native-swiper/react-native-swiper-tests.tsx index 7463ac0b70..5bd12c3868 100644 --- a/types/react-native-swiper/react-native-swiper-tests.tsx +++ b/types/react-native-swiper/react-native-swiper-tests.tsx @@ -35,28 +35,28 @@ class SwiperTest extends React.Component<{}, {}> { const styles = StyleSheet.create({ wrapper: { - } as ViewStyle, + }, slide1: { flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#9DD6EB' - } as ViewStyle, + }, slide2: { flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#97CAE5' - } as ViewStyle, + }, slide3: { flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#92BBD9' - } as ViewStyle, + }, text: { color: '#fff', fontSize: 30, fontWeight: 'bold' - } as ViewStyle + } }); diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index a7dc4da43a..5fd5b40b96 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -7471,6 +7471,18 @@ export interface UIManagerStatic { onFail: () => void, /* currently unused */ onSuccess: MeasureLayoutOnSuccessCallback ): void; + + /** + * Automatically animates views to their new positions when the + * next layout happens. + * + * A common way to use this API is to call it before calling `setState`. + * + * Note that in order to get this to work on **Android** you need to set the following flags via `UIManager`: + * + * UIManager.setLayoutAnimationEnabledExperimental && UIManager.setLayoutAnimationEnabledExperimental(true); + */ + setLayoutAnimationEnabledExperimental(value: boolean): void; } export interface SwitchPropertiesIOS extends ViewProperties { diff --git a/types/react-native/test/index.tsx b/types/react-native/test/index.tsx index 6c22c0597a..62e925575b 100644 --- a/types/react-native/test/index.tsx +++ b/types/react-native/test/index.tsx @@ -78,24 +78,24 @@ const styles = StyleSheet.create( //alternative declaration of styles (inline typings) const stylesAlt = StyleSheet.create( { - container: { - flex: 1, - justifyContent: 'center', - alignItems: 'center', + container: { + flex: 1, + justifyContent: 'center', + alignItems: 'center', backgroundColor: '#F5FCFF', - } as ViewStyle, - welcome: { - fontSize: 20, + }, + welcome: { + fontSize: 20, textAlign: 'center', - margin: 10, - } as TextStyle, + margin: 10, + }, instructions: { - textAlign: 'center', - color: '#333333', + textAlign: 'center', + color: '#333333', marginBottom: 5, - } as TextStyle + } } -) +); class CustomView extends React.Component<{}, {}> { diff --git a/types/react-router/test/ModalGallery.tsx b/types/react-router/test/ModalGallery.tsx index 7236ea19a1..3d7aadd0f7 100644 --- a/types/react-router/test/ModalGallery.tsx +++ b/types/react-router/test/ModalGallery.tsx @@ -52,9 +52,9 @@ class ModalSwitch extends React.Component, void> { return (
- - - + + + {isModal ? : null}
@@ -70,14 +70,14 @@ const IMAGES = [ { id: 4, title: 'Crimson', color: 'Crimson' } ]; -const Thumbnail: React.SFC<{color: string}> = ({ color }) => +const Thumbnail: React.SFC<{ color: string }> = ({ color }) =>
; + }} />; -const Image: React.SFC<{color: string}> = ({ color }) => +const Image: React.SFC<{ color: string }> = ({ color }) =>
(
); -const ImageView: React.SFC> = ({ match }) => { +const ImageView: React.SFC> = ({ match }) => { const image = IMAGES[parseInt(match.params.id, 10)]; if (!image) { return
Image not found
; @@ -127,7 +127,7 @@ const ImageView: React.SFC> = ({ match }) => { ); }; -const Modal: React.SFC> = ({ match, history }) => { +const Modal: React.SFC> = ({ match, history }) => { const image = IMAGES[parseInt(match.params.id, 10)]; if (!image) { return null!; @@ -149,7 +149,7 @@ const Modal: React.SFC> = ({ match, history }) }} >
{ - static staticMethodToBeHoisted(): void {} + static staticMethodToBeHoisted(): void { } navigate() { const router = this.props.router; @@ -125,20 +122,20 @@ ReactDOM.render(( - - + + ), document.body); ReactDOM.render(( - + ), document.body); ReactDOM.render(( - + ), document.body); @@ -147,7 +144,7 @@ const history = createMemoryHistory("baseurl"); const routes = ( - + ); diff --git a/types/react-virtualized/dist/es/Grid.d.ts b/types/react-virtualized/dist/es/Grid.d.ts index b0d65a7cb5..c0856f1de7 100644 --- a/types/react-virtualized/dist/es/Grid.d.ts +++ b/types/react-virtualized/dist/es/Grid.d.ts @@ -63,17 +63,11 @@ export type OverscanIndices = { export type CellSizeAndPositionManager = { areOffsetsAdjusted(): boolean; - configure({ - cellCount, - estimatedCellSize - }: ConfigureParams): void; + configure({ cellCount, estimatedCellSize }: ConfigureParams): void; getCellCount(): number; getEstimatedCellSize(): number; getLastMeasuredIndex(): number; - getOffsetAdjustment({ - containerSize, - offset // safe - }: ContainerSizeAndOffset): number; + getOffsetAdjustment({ containerSize, offset/*safe*/ }: ContainerSizeAndOffset): number; /** * This method returns the size and position for the cell at the specified index. * It just-in-time calculates (or used cached values) for cells leading up to the index. diff --git a/types/request-promise-native/index.d.ts b/types/request-promise-native/index.d.ts index ab606fb542..e7d1e29cc1 100644 --- a/types/request-promise-native/index.d.ts +++ b/types/request-promise-native/index.d.ts @@ -42,7 +42,7 @@ declare module 'request-promise-native/errors' { response: http.IncomingMessage; } interface RequestErrorConstructor { - new (cause: any, options: rp.Options, response: http.IncomingMessage): RequestError; + new(cause: any, options: rp.Options, response: http.IncomingMessage): RequestError; (cause: any, options: rp.Options, response: http.IncomingMessage): RequestError; prototype: RequestError; } @@ -55,7 +55,7 @@ declare module 'request-promise-native/errors' { response: http.IncomingMessage; } interface StatusCodeErrorConstructor extends Error { - new (statusCode: number, body: any, options: rp.Options, response: http.IncomingMessage): StatusCodeError; + new(statusCode: number, body: any, options: rp.Options, response: http.IncomingMessage): StatusCodeError; (statusCode: number, body: any, options: rp.Options, response: http.IncomingMessage): StatusCodeError; prototype: StatusCodeError; } @@ -68,7 +68,7 @@ declare module 'request-promise-native/errors' { response: http.IncomingMessage; } interface TransformErrorConstructor extends Error { - new (cause: any, options: rp.Options, response: http.IncomingMessage): TransformError; + new(cause: any, options: rp.Options, response: http.IncomingMessage): TransformError; (cause: any, options: rp.Options, response: http.IncomingMessage): TransformError; prototype: TransformError; } diff --git a/types/request-promise-native/request-promise-native-tests.ts b/types/request-promise-native/request-promise-native-tests.ts index b0562acc6e..d553ab3dcc 100644 --- a/types/request-promise-native/request-promise-native-tests.ts +++ b/types/request-promise-native/request-promise-native-tests.ts @@ -249,9 +249,9 @@ import * as qs from 'querystring'; const CONSUMER_KEY = 'key'; const CONSUMER_SECRET = 'secret'; let oauth = { - callback: 'http://mysite.com/callback/' - , consumer_key: CONSUMER_KEY - , consumer_secret: CONSUMER_SECRET + callback: 'http://mysite.com/callback/', + consumer_key: CONSUMER_KEY, + consumer_secret: CONSUMER_SECRET, }; url = 'https://api.twitter.com/oauth/request_token'; @@ -272,11 +272,11 @@ rpn.post({ url, oauth }, (e, r, body) => { // after the user is redirected back to your server let auth_data: any = qs.parse(body); let oauth = { - consumer_key: CONSUMER_KEY - , consumer_secret: CONSUMER_SECRET - , token: auth_data.oauth_token - , token_secret: req_data.oauth_token_secret - , verifier: auth_data.oauth_verifier + consumer_key: CONSUMER_KEY, + consumer_secret: CONSUMER_SECRET, + token: auth_data.oauth_token, + token_secret: req_data.oauth_token_secret, + verifier: auth_data.oauth_verifier, }; url = 'https://api.twitter.com/oauth/access_token'; @@ -284,10 +284,10 @@ rpn.post({ url, oauth }, (e, r, body) => { // ready to make signed requests on behalf of the user let perm_data: any = qs.parse(body); let oauth = { - consumer_key: CONSUMER_KEY - , consumer_secret: CONSUMER_SECRET - , token: perm_data.oauth_token - , token_secret: perm_data.oauth_token_secret + consumer_key: CONSUMER_KEY, + consumer_secret: CONSUMER_SECRET, + token: perm_data.oauth_token, + token_secret: perm_data.oauth_token_secret, }; url = 'https://api.twitter.com/1.1/users/show.json'; @@ -406,17 +406,17 @@ rpn.get('http://10.255.255.1', { timeout: 1500 }, (err) => { let rand = Math.floor(Math.random() * 100000000).toString(); rpn( { - method: 'PUT' - , uri: 'http://mikeal.iriscouch.com/testjs/' + rand - , multipart: + method: 'PUT', + uri: 'http://mikeal.iriscouch.com/testjs/' + rand, + multipart: [{ - 'content-type': 'application/json' - , body: JSON.stringify({ foo: 'bar', _attachments: { 'message.txt': { follows: true, length: 18, content_type: 'text/plain' } } }) - } - , { body: 'I am an attachment' } + 'content-type': 'application/json', + body: JSON.stringify({ foo: 'bar', _attachments: { 'message.txt': { follows: true, length: 18, content_type: 'text/plain' } } }) + }, + { body: 'I am an attachment' } ] - } - , (error, response, body) => { + }, + (error, response, body) => { if (response.statusCode === 201) { console.log('document saved as: http://mikeal.iriscouch.com/testjs/' + rand); } else { @@ -428,11 +428,11 @@ rpn( rpn( { - method: 'GET' - , uri: 'http://www.google.com' - , gzip: true - } - , (error, response, body) => { + method: 'GET', + uri: 'http://www.google.com', + gzip: true + }, + (error, response, body) => { // body is the decompressed response body console.log('server encoded the data as: ' + (response.headers['content-encoding'] || 'identity')); console.log('the decoded data is: ' + body); diff --git a/types/restify/index.d.ts b/types/restify/index.d.ts index 4cc27b21e8..bb0db64140 100644 --- a/types/restify/index.d.ts +++ b/types/restify/index.d.ts @@ -454,7 +454,7 @@ export interface ServerOptions { handleUpgrades?: boolean; router?: Router; httpsServerOptions?: any; - socketio?: boolean; + socketio?: boolean; } export interface ClientOptions { diff --git a/types/sparkpost/sparkpost-tests.ts b/types/sparkpost/sparkpost-tests.ts index 409fbeac43..cd9774d2bd 100644 --- a/types/sparkpost/sparkpost-tests.ts +++ b/types/sparkpost/sparkpost-tests.ts @@ -45,7 +45,7 @@ client.inboundDomains.create({ domain: 'example1.com' }) .catch(err => { console.log('Whoops! Something went wrong'); console.log(err); -}); + }); // Callback client.inboundDomains.delete("example1.com", (err, res) => { @@ -66,7 +66,7 @@ client.inboundDomains.delete('example1.com') .catch(err => { console.log('Whoops! Something went wrong'); console.log(err); -}); + }); // Callback client.inboundDomains.get("example1.com", (err, res) => { @@ -87,7 +87,7 @@ client.inboundDomains.get('example1.com') .catch(err => { console.log('Whoops! Something went wrong'); console.log(err); -}); + }); // Callback client.inboundDomains.list((err, res) => { @@ -108,7 +108,7 @@ client.inboundDomains.list() .catch(err => { console.log('Whoops! Something went wrong'); console.log(err); -}); + }); // Callback client.messageEvents.search({}, (err, res) => { @@ -152,8 +152,8 @@ client.messageEvents.search({ // Promise client.messageEvents.search({ - events: 'click', - campaign_ids: 'monday_mailshot' + events: 'click', + campaign_ids: 'monday_mailshot' }) .then(data => { console.log('Congrats you can use our client library!'); @@ -162,7 +162,7 @@ client.messageEvents.search({ .catch(err => { console.log('Whoops! Something went wrong'); console.log(err); -}); + }); // Promise client.messageEvents.search({}) @@ -173,16 +173,16 @@ client.messageEvents.search({}) .catch(err => { console.log('Whoops! Something went wrong'); console.log(err); -}); + }); // Promise client.messageEvents.search({ - from: '2016-01-01T00:00', - to: '2016-01-02T23:59', - page: 1, - per_page: 5, - events: ['bounce', 'out_of_band'], - bounce_classes: [10] + from: '2016-01-01T00:00', + to: '2016-01-02T23:59', + page: 1, + per_page: 5, + events: ['bounce', 'out_of_band'], + bounce_classes: [10] }) .then(data => { console.log('Congrats you can use our client library!'); @@ -191,7 +191,7 @@ client.messageEvents.search({ .catch(err => { console.log('Whoops! Something went wrong'); console.log(err); -}); + }); // Callback client.recipientLists.create({ @@ -248,7 +248,7 @@ client.recipientLists.create({ .catch(err => { console.log('Whoops! Something went wrong'); console.log(err); -}); + }); // Callback client.recipientLists.delete("UNIQUE_TEST_ID", (err, res) => { @@ -269,7 +269,7 @@ client.recipientLists.delete('UNIQUE_TEST_ID') .catch(err => { console.log('Whoops! Something went wrong'); console.log(err); -}); + }); // Callback client.recipientLists.list((err, res) => { @@ -290,7 +290,7 @@ client.recipientLists.list() .catch(err => { console.log('Whoops! Something went wrong'); console.log(err); -}); + }); // Callback client.recipientLists.get('UNIQUE_TEST_ID', (err, res) => { @@ -325,7 +325,7 @@ client.recipientLists.get('UNIQUE_TEST_ID', { .catch(err => { console.log('Whoops! Something went wrong'); console.log(err); -}); + }); // Promise client.recipientLists.get('UNIQUE_TEST_ID') @@ -336,7 +336,7 @@ client.recipientLists.get('UNIQUE_TEST_ID') .catch(err => { console.log('Whoops! Something went wrong'); console.log(err); -}); + }); // Callback client.recipientLists.update('EXISTING_TEST_ID', { @@ -410,11 +410,11 @@ client.relayWebhooks.create({ // Promise client.relayWebhooks.create({ - name: 'Test Relay Webhook', - target: 'http://client.test.com/test-webhook', - match: { - domain: 'inbound.example.com' - } + name: 'Test Relay Webhook', + target: 'http://client.test.com/test-webhook', + match: { + domain: 'inbound.example.com' + } }) .then(data => { console.log('Congrats you can use our client library!'); @@ -423,7 +423,7 @@ client.relayWebhooks.create({ .catch(err => { console.log('Whoops! Something went wrong'); console.log(err); -}); + }); // Callback client.relayWebhooks.delete("123456789", (err, res) => { @@ -444,7 +444,7 @@ client.relayWebhooks.delete('123456789') .catch(err => { console.log('Whoops! Something went wrong'); console.log(err); -}); + }); // Callback client.relayWebhooks.get('123456789', (err, res) => { @@ -465,7 +465,7 @@ client.relayWebhooks.get('123456789') .catch(err => { console.log('Whoops! Something went wrong'); console.log(err); -}); + }); client.relayWebhooks.list((err, res) => { if (err) { @@ -485,7 +485,7 @@ client.relayWebhooks.list() .catch(err => { console.log('Whoops! Something went wrong'); console.log(err); -}); + }); // Callback client.relayWebhooks.update('123456789', { @@ -501,7 +501,7 @@ client.relayWebhooks.update('123456789', { // Promise client.relayWebhooks.update('123456789', { - target: 'http://client.test.com/test-webhook' + target: 'http://client.test.com/test-webhook' }) .then(data => { console.log('Congrats you can use our client library!'); @@ -510,7 +510,7 @@ client.relayWebhooks.update('123456789', { .catch(err => { console.log('Whoops! Something went wrong'); console.log(err); -}); + }); // Callback client.sendingDomains.create({ @@ -532,13 +532,13 @@ client.sendingDomains.create({ // Promise client.sendingDomains.create({ - domain: 'example1.com', - dkim: { - private: 'MIICXgIBAAKBgQC+W6scd3XWwvC/hPRksfDYFi3ztgyS9OSqnnjtNQeDdTSD1DRx/==', - public: 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+W6scd3XWwvC/==', - selector: 'brisbane', - headers: 'from:to:subject:date' - } + domain: 'example1.com', + dkim: { + private: 'MIICXgIBAAKBgQC+W6scd3XWwvC/hPRksfDYFi3ztgyS9OSqnnjtNQeDdTSD1DRx/==', + public: 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+W6scd3XWwvC/==', + selector: 'brisbane', + headers: 'from:to:subject:date' + } }) .then(data => { console.log('Congrats you can use our client library!'); @@ -547,7 +547,7 @@ client.sendingDomains.create({ .catch(err => { console.log('Whoops! Something went wrong'); console.log(err); -}); + }); // Callback client.sendingDomains.delete("example1.com", (err, data) => { @@ -568,7 +568,7 @@ client.sendingDomains.delete('example1.com') .catch(err => { console.log('Whoops! Something went wrong'); console.log(err); -}); + }); // Callback client.sendingDomains.list((err, res) => { @@ -589,7 +589,7 @@ client.sendingDomains.list() .catch(err => { console.log('Whoops! Something went wrong'); console.log(err); -}); + }); // Callback client.sendingDomains.get('example1.com', (err, res) => { @@ -610,7 +610,7 @@ client.sendingDomains.get('example1.com') .catch(err => { console.log('Whoops! Something went wrong'); console.log(err); -}); + }); // Callback client.sendingDomains.update('example1.com', { @@ -630,12 +630,12 @@ client.sendingDomains.update('example1.com', { }); client.sendingDomains.update('example1.com', { - dkim: { - private: 'MIICXgIBAAKBgQC+W6scd3XWwvC/hPRksfDYFi3ztgyS9OSqnnjtNQeDdTSD1DRx/Y1g==', - public: 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+W6scd3XWwvC/==', - selector: 'hello_selector', - headers: 'from:to:subject:date' - } + dkim: { + private: 'MIICXgIBAAKBgQC+W6scd3XWwvC/hPRksfDYFi3ztgyS9OSqnnjtNQeDdTSD1DRx/Y1g==', + public: 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+W6scd3XWwvC/==', + selector: 'hello_selector', + headers: 'from:to:subject:date' + } }) .then(data => { console.log('Congrats you can use our client library!'); @@ -644,14 +644,14 @@ client.sendingDomains.update('example1.com', { .catch(err => { console.log('Whoops! Something went wrong'); console.log(err); -}); + }); // Callback client.sendingDomains.verify('example1.com', { - dkim_verify: true, - spf_verify: true, - abuse_at_verify: true, - postmaster_at_verify: true + dkim_verify: true, + spf_verify: true, + abuse_at_verify: true, + postmaster_at_verify: true }, (err, res) => { if (err) { console.log(err); @@ -663,7 +663,7 @@ client.sendingDomains.verify('example1.com', { // Callback client.sendingDomains.verify('example1.com', { - dkim_verify: false + dkim_verify: false }, (err, res) => { if (err) { console.log(err); @@ -675,10 +675,10 @@ client.sendingDomains.verify('example1.com', { // Promise client.sendingDomains.verify('example1.com', { - dkim_verify: true, - spf_verify: true, - abuse_at_verify: true, - postmaster_at_verify: true + dkim_verify: true, + spf_verify: true, + abuse_at_verify: true, + postmaster_at_verify: true }) .then(data => { console.log('Congrats you can use our client library!'); @@ -687,7 +687,7 @@ client.sendingDomains.verify('example1.com', { .catch(err => { console.log('Whoops! Something went wrong'); console.log(err); -}); + }); // Callback client.subaccounts.create({ @@ -708,12 +708,12 @@ client.subaccounts.create({ // Promise client.subaccounts.create({ - name: 'Test Subaccount', - key_label: 'Test Subaccount key', - key_grants: [ - 'smtp/inject', - 'transmissions/modify' - ] + name: 'Test Subaccount', + key_label: 'Test Subaccount key', + key_grants: [ + 'smtp/inject', + 'transmissions/modify' + ] }) .then(data => { console.log('Congrats you can use our client library!'); @@ -722,7 +722,7 @@ client.subaccounts.create({ .catch(err => { console.log('Whoops! Something went wrong'); console.log(err); -}); + }); // Callback client.subaccounts.list((err, res) => { @@ -743,7 +743,7 @@ client.subaccounts.list() .catch(err => { console.log('Whoops! Something went wrong'); console.log(err); -}); + }); // Callback client.subaccounts.get(123, (err, res) => { @@ -764,7 +764,7 @@ client.subaccounts.get('123') .catch(err => { console.log('Whoops! Something went wrong'); console.log(err); -}); + }); // Callback client.subaccounts.update('123', { @@ -781,8 +781,8 @@ client.subaccounts.update('123', { // Promise client.subaccounts.update('123', { - name: 'Test Subaccount', - status: 'suspended' + name: 'Test Subaccount', + status: 'suspended' }) .then(data => { console.log('Congrats you can use our client library!'); @@ -791,7 +791,7 @@ client.subaccounts.update('123', { .catch(err => { console.log('Whoops! Something went wrong'); console.log(err); -}); + }); // Callback client.suppressionList.delete('test@test.com', (err, data) => { @@ -813,7 +813,7 @@ client.suppressionList.delete('test@test.com') .catch(err => { console.log('Whoops! Something went wrong'); console.log(err); -}); + }); // Promise client.suppressionList.get('test@test.com') @@ -824,7 +824,7 @@ client.suppressionList.get('test@test.com') .catch(err => { console.log('Whoops! Something went wrong'); console.log(err); -}); + }); // Callback client.suppressionList.get('test@test.com', (err, data) => { @@ -839,9 +839,9 @@ client.suppressionList.get('test@test.com', (err, data) => { // Promise client.suppressionList.list({ - from: '2015-05-07T00:00:00+0000', - to: '2015-05-07T23:59:59+0000', - limit: 5 + from: '2015-05-07T00:00:00+0000', + to: '2015-05-07T23:59:59+0000', + limit: 5 }) .then(data => { console.log('Congrats you can use our client library!'); @@ -854,9 +854,9 @@ client.suppressionList.list({ // Callback client.suppressionList.list({ - from: '2015-05-07T00:00:00+0000', - to: '2015-05-07T23:59:59+0000', - limit: 5 + from: '2015-05-07T00:00:00+0000', + to: '2015-05-07T23:59:59+0000', + limit: 5 }, (err, data) => { if (err) { console.log('Whoops! Something went wrong'); @@ -880,10 +880,10 @@ client.suppressionList.list((err, data) => { // Promise client.suppressionList.upsert({ - recipient: 'test1@test.com', - transactional: false, - non_transactional: true, - description: 'Test description 1' + recipient: 'test1@test.com', + transactional: false, + non_transactional: true, + description: 'Test description 1' }) .then(data => { console.log('Congrats you can use our client library!'); @@ -896,10 +896,10 @@ client.suppressionList.upsert({ // Callback client.suppressionList.upsert({ - recipient: 'test1@test.com', - transactional: false, - non_transactional: true, - description: 'Test description 1' + recipient: 'test1@test.com', + transactional: false, + non_transactional: true, + description: 'Test description 1' }, (err, data) => { if (err) { console.log('Whoops! Something went wrong'); @@ -912,24 +912,24 @@ client.suppressionList.upsert({ // Promise client.suppressionList.upsert([ - { - recipient: 'test1@test.com', - transactional: false, - non_transactional: true, - description: 'Test description 1' - }, - { - recipient: 'test2@test.com', - transactional: true, - non_transactional: true, - description: 'Test description 2' - }, - { - recipient: 'test3@test.com', - transactional: true, - non_transactional: false, - description: 'Test description 3' - } + { + recipient: 'test1@test.com', + transactional: false, + non_transactional: true, + description: 'Test description 1' + }, + { + recipient: 'test2@test.com', + transactional: true, + non_transactional: true, + description: 'Test description 2' + }, + { + recipient: 'test3@test.com', + transactional: true, + non_transactional: false, + description: 'Test description 3' + } ]) .then(data => { console.log('Congrats you can use our client library!'); @@ -942,24 +942,24 @@ client.suppressionList.upsert([ // Callback client.suppressionList.upsert([ - { - recipient: 'test1@test.com', - transactional: false, - non_transactional: true, - description: 'Test description 1' - }, - { - recipient: 'test2@test.com', - transactional: true, - non_transactional: true, - description: 'Test description 2' - }, - { - recipient: 'test3@test.com', - transactional: true, - non_transactional: false, - description: 'Test description 3' - } + { + recipient: 'test1@test.com', + transactional: false, + non_transactional: true, + description: 'Test description 1' + }, + { + recipient: 'test2@test.com', + transactional: true, + non_transactional: true, + description: 'Test description 2' + }, + { + recipient: 'test3@test.com', + transactional: true, + non_transactional: false, + description: 'Test description 3' + } ], (err, data) => { if (err) { console.log('Whoops! Something went wrong'); @@ -972,13 +972,13 @@ client.suppressionList.upsert([ // Callback client.templates.create({ - id: "TEST_ID", - name: "Test Template", - content: { - from: "test@test.com", - subject: "Test email template!", - html: "This is a test email template!" - } + id: "TEST_ID", + name: "Test Template", + content: { + from: "test@test.com", + subject: "Test email template!", + html: "This is a test email template!" + } }, (err, res) => { if (err) { console.log(err); @@ -990,13 +990,13 @@ client.templates.create({ // Promise client.templates.create({ - id: 'TEST_ID', - name: 'Test Template', - content: { - from: 'test@test.com', - subject: 'Test email template!', - html: 'This is a test email template!' - } + id: 'TEST_ID', + name: 'Test Template', + content: { + from: 'test@test.com', + subject: 'Test email template!', + html: 'This is a test email template!' + } }) .then(data => { console.log('Congrats you can use our client library!'); @@ -1005,7 +1005,7 @@ client.templates.create({ .catch(err => { console.log('Whoops! Something went wrong'); console.log(err); -}); + }); // Callback client.templates.delete("TEST_ID", (err, res) => { @@ -1026,7 +1026,7 @@ client.templates.delete('TEST_ID') .catch(err => { console.log('Whoops! Something went wrong'); console.log(err); -}); + }); // Callback client.templates.list((err, res) => { @@ -1047,7 +1047,7 @@ client.templates.list() .catch(err => { console.log('Whoops! Something went wrong'); console.log(err); -}); + }); // Callback client.templates.get('TEST_ID', { @@ -1080,7 +1080,7 @@ client.templates.get('TEST_ID') .catch(err => { console.log('Whoops! Something went wrong'); console.log(err); -}); + }); // Callback client.templates.preview('TEST_ID', { @@ -1096,12 +1096,12 @@ client.templates.preview('TEST_ID', { // Promise client.templates.preview('TEST_ID', { - substitution_data: { - name: 'Natalie', - age: 35, - member: true - }, - draft: true + substitution_data: { + name: 'Natalie', + age: 35, + member: true + }, + draft: true }) .then(data => { console.log('Congrats you can use our client library!'); @@ -1110,32 +1110,32 @@ client.templates.preview('TEST_ID', { .catch(err => { console.log('Whoops! Something went wrong'); console.log(err); -}); + }); // Callback client.templates.update('TEST_ID', { - content: { - from: "test@test.com", - subject: "Updated Published Test email template!", - html: "This is a published test email template! Updated!" - }, + content: { + from: "test@test.com", + subject: "Updated Published Test email template!", + html: "This is a published test email template! Updated!" + }, }, { update_published: true }, -(err, res) => { - if (err) { - console.log(err); - } else { - console.log(res.body); - console.log("Congrats you can use our SDK!"); - } -}); + (err, res) => { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("Congrats you can use our SDK!"); + } + }); // Callback client.templates.update('TEST_ID', { - content: { - from: "test@test.com", - subject: "Updated Test email template!", - html: "This is a test email template! Updated!" - } + content: { + from: "test@test.com", + subject: "Updated Test email template!", + html: "This is a test email template! Updated!" + } }, (err, res) => { if (err) { console.log(err); @@ -1147,11 +1147,11 @@ client.templates.update('TEST_ID', { // Promise client.templates.update('TEST_ID', { - content: { - from: 'test@test.com', - subject: 'Updated Test email template!', - html: 'This is a test email template! Updated!' - } + content: { + from: 'test@test.com', + subject: 'Updated Test email template!', + html: 'This is a test email template! Updated!' + } }) .then(data => { console.log('Congrats you can use our client library!'); @@ -1227,17 +1227,17 @@ client.transmissions.get('YOUR-TRANSMISSION-KEY') // Callback client.transmissions.send({ - recipients: [{ address: { email: "john.doe@example.com" } }], - content: { - from: "From Envelope ", - subject: "Example Email for MIME Parts", - html: "

Hello World!

", - text: "Hello World!" - }, - options: { - open_tracking: true, - click_tracking: true - } + recipients: [{ address: { email: "john.doe@example.com" } }], + content: { + from: "From Envelope ", + subject: "Example Email for MIME Parts", + html: "

Hello World!

", + text: "Hello World!" + }, + options: { + open_tracking: true, + click_tracking: true + } }, (err, res) => { if (err) { console.log(err); @@ -1249,10 +1249,10 @@ client.transmissions.send({ // Callback client.transmissions.send({ - recipients: [{address: {email: "john.doe@example.com"}}], - content: { - email_rfc822: "Content-Type: text/plain\nFrom: From Envelope \nSubject: Example Email\n\nHello World" - } + recipients: [{ address: { email: "john.doe@example.com" } }], + content: { + email_rfc822: "Content-Type: text/plain\nFrom: From Envelope \nSubject: Example Email\n\nHello World" + } }, (err, res) => { if (err) { console.log(err); @@ -1264,52 +1264,52 @@ client.transmissions.send({ // Callback client.transmissions.send({ - options: { - open_tracking: true, - click_tracking: true - }, - campaign_id: "christmas_campaign", - return_path: "bounces-christmas-campaign@flintstone.com", - metadata: { - user_type: "students" - }, - substitution_data: { - sender: "Big Store Team" - }, - recipients: [ - { - return_path: "123@bounces.flintstone.com", - address: { - email: "wilma@flintstone.com", - name: "Wilma Flintstone" - }, - tags: [ - "greeting", - "prehistoric", - "fred", - "flintstone" - ], - metadata: { - place: "Bedrock" - }, - substitution_data: { - customer_type: "Platinum" - } + options: { + open_tracking: true, + click_tracking: true + }, + campaign_id: "christmas_campaign", + return_path: "bounces-christmas-campaign@flintstone.com", + metadata: { + user_type: "students" + }, + substitution_data: { + sender: "Big Store Team" + }, + recipients: [ + { + return_path: "123@bounces.flintstone.com", + address: { + email: "wilma@flintstone.com", + name: "Wilma Flintstone" + }, + tags: [ + "greeting", + "prehistoric", + "fred", + "flintstone" + ], + metadata: { + place: "Bedrock" + }, + substitution_data: { + customer_type: "Platinum" } - ], - content: { - from: { - name: "Fred Flintstone", - email: "fred@flintstone.com" - }, - subject: "Big Christmas savings!", - reply_to: "Christmas Sales ", - headers: { - "X-Customer-Campaign-ID": "christmas_campaign" - }, - text: "Hi {{address.name}} \nSave big this Christmas in your area {{place}}! \nClick http://www.mysite.com and get huge discount\n Hurry, this offer is only to {{customer_type}}\n {{sender}}", - html: "

Hi {{address.name}} \nSave big this Christmas in your area {{place}}! \nClick http://www.mysite.com and get huge discount\n

" - } + } + ], + content: { + from: { + name: "Fred Flintstone", + email: "fred@flintstone.com" + }, + subject: "Big Christmas savings!", + reply_to: "Christmas Sales ", + headers: { + "X-Customer-Campaign-ID": "christmas_campaign" + }, + text: "Hi {{address.name}} \nSave big this Christmas in your area {{place}}! \nClick http://www.mysite.com and get huge discount\n Hurry, this offer is only to {{customer_type}}\n {{sender}}", + html: "

Hi {{address.name}} \nSave big this Christmas in your area {{place}}! \nClick http://www.mysite.com and get huge discount\n

" + } }, (err, res) => { if (err) { console.log(err); @@ -1321,35 +1321,35 @@ client.transmissions.send({ // Callback client.transmissions.send({ - recipients: [ - { - address: { - email: "original.recipient@example.com", - name: "Original Recipient" - }, - substitution_data: { - recipient_type: "Original" - } + recipients: [ + { + address: { + email: "original.recipient@example.com", + name: "Original Recipient" }, - { - address: { - email: "bcc.recipient@example.com", - header_to: "\"Original Recipient\" " - }, - substitution_data: { - recipient_type: "BCC" - } + substitution_data: { + recipient_type: "Original" } - ], - content: { - from: { - name: "Node BCC Test", - email: "from@example.com" + }, + { + address: { + email: "bcc.recipient@example.com", + header_to: "\"Original Recipient\" " }, - subject: "Example email using bcc", - text: "An example email using bcc with SparkPost to the {{recipient_type}} recipient.", - html: "

An example email using bcc with SparkPost to the {{recipient_type}} recipient.

" + substitution_data: { + recipient_type: "BCC" + } } + ], + content: { + from: { + name: "Node BCC Test", + email: "from@example.com" + }, + subject: "Example email using bcc", + text: "An example email using bcc with SparkPost to the {{recipient_type}} recipient.", + html: "

An example email using bcc with SparkPost to the {{recipient_type}} recipient.

" + } }, (err, res) => { if (err) { console.log(err); @@ -1361,39 +1361,39 @@ client.transmissions.send({ // Callback client.transmissions.send({ - recipients: [ - { - address: { - email: "original.recipient@example.com", - name: "Original Recipient" - }, - substitution_data: { - recipient_type: "Original" - } + recipients: [ + { + address: { + email: "original.recipient@example.com", + name: "Original Recipient" }, - { - address: { - email: "cc.recipient@example.com", - name: "Carbon Copy Recipient", - header_to: "\"Original Recipient\" " - }, - substitution_data: { - recipient_type: "CC" - } + substitution_data: { + recipient_type: "Original" } - ], - content: { - from: { - name: "Node CC Test", - email: "from@example.com" + }, + { + address: { + email: "cc.recipient@example.com", + name: "Carbon Copy Recipient", + header_to: "\"Original Recipient\" " }, - headers: { - CC: "\"Carbon Copy Recipient\" " - }, - subject: "Example email using cc", - text: "An example email using cc with SparkPost to the {{recipient_type}} recipient.", - html: "

An example email using cc with SparkPost to the {{recipient_type}} recipient.

" + substitution_data: { + recipient_type: "CC" + } } + ], + content: { + from: { + name: "Node CC Test", + email: "from@example.com" + }, + headers: { + CC: "\"Carbon Copy Recipient\" " + }, + subject: "Example email using cc", + text: "An example email using cc with SparkPost to the {{recipient_type}} recipient.", + html: "

An example email using cc with SparkPost to the {{recipient_type}} recipient.

" + } }, (err, res) => { if (err) { console.log(err); @@ -1405,15 +1405,15 @@ client.transmissions.send({ // Callback client.transmissions.send({ - recipients: { - list_id: "example-list" - }, - content: { - from: "From Envelope ", - subject: "Example Email for Stored List and Inline Content", - html: "

Hello World

", - text: "Hello World!" - } + recipients: { + list_id: "example-list" + }, + content: { + from: "From Envelope ", + subject: "Example Email for Stored List and Inline Content", + html: "

Hello World

", + text: "Hello World!" + } }, (err, res) => { if (err) { console.log(err); @@ -1425,14 +1425,14 @@ client.transmissions.send({ // Callback client.transmissions.send({ - recipients: { - list_id: "example-list" - }, - content: { - from: "From Envelope ", - subject: "Example Email for Stored List and Template", - template_id: "my-template" - } + recipients: { + list_id: "example-list" + }, + content: { + from: "From Envelope ", + subject: "Example Email for Stored List and Template", + template_id: "my-template" + } }, (err, res) => { if (err) { console.log(err); @@ -1444,70 +1444,70 @@ client.transmissions.send({ // Callback client.transmissions.send({ - campaign_id: "ricks-campaign", - content: { - template_id: "ricks-template" - }, - recipients: [{ address: { email: "rick.sanchez@rickandmorty100years.com", name: "Rick Sanchez" } }] + campaign_id: "ricks-campaign", + content: { + template_id: "ricks-template" + }, + recipients: [{ address: { email: "rick.sanchez@rickandmorty100years.com", name: "Rick Sanchez" } }] }, { - num_rcpt_errors: 3 -}, (err, res) => { - if (err) { - console.log(err); - } else { - console.log(res.body); - console.log("What up my glib globs! SparkPost!"); - } -}); + num_rcpt_errors: 3 + }, (err, res) => { + if (err) { + console.log(err); + } else { + console.log(res.body); + console.log("What up my glib globs! SparkPost!"); + } + }); // Promise client.transmissions.send({ - options: { - open_tracking: true, - click_tracking: true - }, - campaign_id: 'christmas_campaign', - metadata: { - user_type: 'students' - }, - substitution_data: { - sender: 'Big Store Team' - }, - cc: [], - bcc: [], - recipients: [ - { - address: { - email: 'wilma@flintstone.com', - name: 'Wilma Flintstone' - }, - tags: [ - 'greeting', - 'prehistoric', - 'fred', - 'flintstone' - ], - metadata: { - place: 'Bedrock' - }, - substitution_data: { - customer_type: 'Platinum' - } + options: { + open_tracking: true, + click_tracking: true + }, + campaign_id: 'christmas_campaign', + metadata: { + user_type: 'students' + }, + substitution_data: { + sender: 'Big Store Team' + }, + cc: [], + bcc: [], + recipients: [ + { + address: { + email: 'wilma@flintstone.com', + name: 'Wilma Flintstone' + }, + tags: [ + 'greeting', + 'prehistoric', + 'fred', + 'flintstone' + ], + metadata: { + place: 'Bedrock' + }, + substitution_data: { + customer_type: 'Platinum' } - ], - content: { - from: { - name: 'Fred Flintstone', - email: 'fred@flintstone.com' - }, - subject: 'Big Christmas savings!', - reply_to: 'Christmas Sales ', - headers: { - 'X-Customer-Campaign-ID': 'christmas_campaign' - }, - text: 'Hi {{address.name}} \nSave big this Christmas in your area {{place}}! \nClick http://www.mysite.com and get huge discount\n Hurry, this offer is only to {{customer_type}}\n {{sender}}', - html: '

Hi {{address.name}} \nSave big this Christmas in your area {{place}}! \nClick http://www.mysite.com and get huge discount\n

' } + ], + content: { + from: { + name: 'Fred Flintstone', + email: 'fred@flintstone.com' + }, + subject: 'Big Christmas savings!', + reply_to: 'Christmas Sales ', + headers: { + 'X-Customer-Campaign-ID': 'christmas_campaign' + }, + text: 'Hi {{address.name}} \nSave big this Christmas in your area {{place}}! \nClick http://www.mysite.com and get huge discount\n Hurry, this offer is only to {{customer_type}}\n {{sender}}', + html: '

Hi {{address.name}} \nSave big this Christmas in your area {{place}}! \nClick http://www.mysite.com and get huge discount\n

' + } }) .then(data => { console.log('Congrats you can use our client library!'); @@ -1516,43 +1516,43 @@ client.transmissions.send({ .catch(err => { console.log('Whoops! Something went wrong'); console.log(err); -}); + }); // Promise client.transmissions.send({ - recipients: [ - { - address: { - email: 'original.recipient@example.com', - name: 'Original Recipient' - }, - substitution_data: { - recipient_type: 'Original' - } + recipients: [ + { + address: { + email: 'original.recipient@example.com', + name: 'Original Recipient' }, - { - address: { - email: 'cc.recipient@example.com', - name: 'Carbon Copy Recipient', - header_to: '"Original Recipient" ' - }, - substitution_data: { - recipient_type: 'CC' - } + substitution_data: { + recipient_type: 'Original' } - ], - content: { - from: { - name: 'Node CC Test', - email: 'from@example.com' + }, + { + address: { + email: 'cc.recipient@example.com', + name: 'Carbon Copy Recipient', + header_to: '"Original Recipient" ' }, - headers: { - CC: '"Carbon Copy Recipient" ' - }, - subject: 'Example email using cc', - text: 'An example email using cc with SparkPost to the {{recipient_type}} recipient.', - html: '

An example email using cc with SparkPost to the {{recipient_type}} recipient.

' + substitution_data: { + recipient_type: 'CC' + } } + ], + content: { + from: { + name: 'Node CC Test', + email: 'from@example.com' + }, + headers: { + CC: '"Carbon Copy Recipient" ' + }, + subject: 'Example email using cc', + text: 'An example email using cc with SparkPost to the {{recipient_type}} recipient.', + html: '

An example email using cc with SparkPost to the {{recipient_type}} recipient.

' + } }) .then(data => { console.log('Congrats! You sent an email with cc using SparkPost!'); @@ -1561,7 +1561,7 @@ client.transmissions.send({ .catch(err => { console.log('Whoops! Something went wrong'); console.log(err); -}); + }); // Callback client.webhooks.create({ @@ -1585,15 +1585,15 @@ client.webhooks.create({ // Promise client.webhooks.create({ - name: 'Test Webhook', - target: 'http://client.test.com/test-webhook', - auth_token: 'AUTH_TOKEN', - events: [ - 'delivery', - 'injection', - 'open', - 'click' - ] + name: 'Test Webhook', + target: 'http://client.test.com/test-webhook', + auth_token: 'AUTH_TOKEN', + events: [ + 'delivery', + 'injection', + 'open', + 'click' + ] }) .then(data => { console.log('Congrats you can use our client library!'); @@ -1602,7 +1602,7 @@ client.webhooks.create({ .catch(err => { console.log('Whoops! Something went wrong'); console.log(err); -}); + }); // Callback client.webhooks.delete("TEST_WEBHOOK_UUID", (err, res) => { @@ -1627,7 +1627,7 @@ client.webhooks.delete('TEST_WEBHOOK_UUID') // Callback client.webhooks.get('TEST_WEBHOOK_UUID', { - timezone: 'America/New_York' + timezone: 'America/New_York' }, (err, data) => { if (err) { console.log('Whoops! Something went wrong'); @@ -1640,7 +1640,7 @@ client.webhooks.get('TEST_WEBHOOK_UUID', { // Promise client.webhooks.get('TEST_WEBHOOK_UUID', { - timezone: 'America/New_York' + timezone: 'America/New_York' }) .then(data => { console.log('Congrats you can use our client library!'); @@ -1665,7 +1665,7 @@ client.webhooks.getBatchStatus('TEST_WEBHOOK_UUID', { // Promise client.webhooks.getBatchStatus('TEST_WEBHOOK_UUID', { - limit: 1000 + limit: 1000 }) .then(data => { console.log('Congrats you can use our client library!'); @@ -1695,7 +1695,7 @@ client.webhooks.getDocumentation() .catch(err => { console.log('Whoops! Something went wrong'); console.log(err); -}); + }); // Callback client.webhooks.getSamples({ @@ -1711,7 +1711,7 @@ client.webhooks.getSamples({ // Promise client.webhooks.getSamples({ - events: 'bounce' + events: 'bounce' }) .then(data => { console.log('Congrats you can use our client library!'); @@ -1720,7 +1720,7 @@ client.webhooks.getSamples({ .catch(err => { console.log('Whoops! Something went wrong'); console.log(err); -}); + }); // Callback client.webhooks.list((err, res) => { @@ -1741,7 +1741,7 @@ client.webhooks.list() .catch(err => { console.log('Whoops! Something went wrong'); console.log(err); -}); + }); // Callback client.webhooks.update('TEST_WEBHOOK_UUID', { @@ -1761,11 +1761,11 @@ client.webhooks.update('TEST_WEBHOOK_UUID', { // Promise client.webhooks.update('TEST_WEBHOOK_UUID', { - name: 'Renamed Test Webhook', - events: [ - 'policy_rejection', - 'delay' - ] + name: 'Renamed Test Webhook', + events: [ + 'policy_rejection', + 'delay' + ] }) .then(data => { console.log('Congrats you can use our client library!'); @@ -1774,7 +1774,7 @@ client.webhooks.update('TEST_WEBHOOK_UUID', { .catch(err => { console.log('Whoops! Something went wrong'); console.log(err); -}); + }); // Callback client.webhooks.validate('TEST_WEBHOOK_UUID', { @@ -1792,9 +1792,9 @@ client.webhooks.validate('TEST_WEBHOOK_UUID', { // Promise client.webhooks.validate('TEST_WEBHOOK_UUID', { - message: { - msys: {} - } + message: { + msys: {} + } }) .then(data => { console.log('Congrats you can use our client library!'); diff --git a/types/swagger-hapi/swagger-hapi-tests.ts b/types/swagger-hapi/swagger-hapi-tests.ts index 1793887ec3..c630987e0e 100644 --- a/types/swagger-hapi/swagger-hapi-tests.ts +++ b/types/swagger-hapi/swagger-hapi-tests.ts @@ -5,9 +5,9 @@ const app = new Hapi.Server(); module.exports = app; // for testing -const config = { +const config: SwaggerHapi.Config = { appRoot: __dirname // required config -} as SwaggerHapi.Config; +}; SwaggerHapi.create(config, (err, swaggerHapi) => { if (err) { throw err; } @@ -29,21 +29,21 @@ SwaggerHapi.create(config, (err, swaggerHapi) => { }); const swaggerSecurityHandlerCb = (err: Error) => { - // do nothing + // do nothing }; const configComplex: SwaggerHapi.Config = { - appRoot: __dirname, - configDir: "some/directory", - controllersDirs: ["some/directory"], - fittingsDirs: ["some/directory"], - mockMode: true, - swaggerControllerPipe: 'swagger_controllers', - swaggerSecurityHandlers: { - // did not manage to research the typings of first 3 arguments - someHandlerName: ({}, {}, {}, swaggerSecurityHandlerCb) => { - // do nothing - } - }, - validateResponse: true + appRoot: __dirname, + configDir: "some/directory", + controllersDirs: ["some/directory"], + fittingsDirs: ["some/directory"], + mockMode: true, + swaggerControllerPipe: 'swagger_controllers', + swaggerSecurityHandlers: { + // did not manage to research the typings of first 3 arguments + someHandlerName: ({ }, { }, { }, swaggerSecurityHandlerCb) => { + // do nothing + } + }, + validateResponse: true }; diff --git a/types/swagger-restify-mw/swagger-restify-mw-tests.ts b/types/swagger-restify-mw/swagger-restify-mw-tests.ts index 629c85ecf3..6104bf8795 100644 --- a/types/swagger-restify-mw/swagger-restify-mw-tests.ts +++ b/types/swagger-restify-mw/swagger-restify-mw-tests.ts @@ -3,9 +3,9 @@ import * as restify from "restify"; const app = restify.createServer(); -const config = { - appRoot: __dirname // required config -} as SwaggerRestify.Config; +const config: SwaggerRestify.Config = { + appRoot: __dirname // required config +}; SwaggerRestify.create(config, (err, swaggerRestify) => { if (err) { throw err; }