From e039b174b810aa99c062e684901d2981cbc23fef Mon Sep 17 00:00:00 2001 From: yushulx Date: Wed, 3 May 2017 11:02:16 +0800 Subject: [PATCH] Updated tslint.json --- types/dwt/dwt-tests.ts | 13 ++++++------- types/dwt/index.d.ts | 26 +++++--------------------- types/dwt/tslint.json | 10 +++++++++- 3 files changed, 20 insertions(+), 29 deletions(-) diff --git a/types/dwt/dwt-tests.ts b/types/dwt/dwt-tests.ts index 1c4bde2f06..4b201cf33d 100644 --- a/types/dwt/dwt-tests.ts +++ b/types/dwt/dwt-tests.ts @@ -1,9 +1,8 @@ function dwtOnReady() { let DWObject = Dynamsoft.WebTwainEnv.GetWebTwain('dwtcontrolContainer'); // Get the Dynamic Web TWAIN object that is embeded in the div with id 'dwtcontrolContainer' if (DWObject) { - var count = DWObject.SourceCount; - if(count == 0) - { + let count = DWObject.SourceCount; + if (count === 0) { DWObject.CloseSourceManager(); DWObject.ImageCaptureDriverType = 0; DWObject.OpenSourceManager(); @@ -15,10 +14,10 @@ function dwtOnReady() { function acquireImage() { let DWObject = Dynamsoft.WebTwainEnv.GetWebTwain('dwtcontrolContainer'); if (DWObject) { - DWObject.SelectSourceByIndex(0); //Use method SelectSourceByIndex to avoid the 'Select Source' dialog + DWObject.SelectSourceByIndex(0); // Use method SelectSourceByIndex to avoid the 'Select Source' dialog DWObject.OpenSource(); - DWObject.IfDisableSourceAfterAcquire = true; // Scanner source will be disabled/closed automatically after the scan. - DWObject.AcquireImage({}, () => {}, (errorCode: number, errorString: string) => {DWObject.CloseSource();}); + DWObject.IfDisableSourceAfterAcquire = true; // Scanner source will be disabled/closed automatically after the scan. + DWObject.AcquireImage({}, () => {}, (errorCode: number, errorString: string) => {DWObject.CloseSource(); }); } } @@ -99,4 +98,4 @@ function downloadImage() { DWObject.HTTPPort = 80; DWObject.HTTPDownload("www.dynamsoft.com", "img.png", () => {}, (errorCode: number, errorString: string) => {}); } -} \ No newline at end of file +} diff --git a/types/dwt/index.d.ts b/types/dwt/index.d.ts index 92095b1eae..9198ba80bf 100644 --- a/types/dwt/index.d.ts +++ b/types/dwt/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for dwt 12.3.0 +// Type definitions for dwt 12.3 // Project: http://www.dynamsoft.com/Products/WebTWAIN_Overview.aspx // Definitions by: Xiao Ling // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -14,12 +14,12 @@ * Version: 12.3 */ -/** +/** * @namespace Dynamsoft */ declare namespace Dynamsoft { namespace WebTwainEnv { - function GetWebTwain (cid: string) : WebTwain; + function GetWebTwain (cid: string): WebTwain; function RegisterEvent(event: string, fn: () => void): void; } } @@ -600,7 +600,7 @@ declare enum EnumDWT_TransferMode { /** Buffered Memory Mode Transfers. */ TWSX_MEMORY = 2, /** added 1.91 */ - //TWSX_MEMFILE = 4 + TWSX_MEMFILE = 4 } /** ICAP_IMAGEFILEFORMAT values. */ @@ -641,7 +641,6 @@ declare enum EnumDWT_FileFormat { TWFF_PDFA2 = 16 } - /** TIFF file compression type. */ declare enum EnumDWT_TIFFCompressionType { /** Auto mode. */ @@ -1041,7 +1040,6 @@ declare enum EnumDWT_CapSupportedSizes { TWSS_MAXSIZE = 54 } - /** CAP_FEEDERALIGNMENT values. */ declare enum EnumDWT_CapFeederAlignment { /** The alignment is free-floating. Applications should assume that the origin for frames is on the left. */ @@ -1257,7 +1255,6 @@ declare enum EnumDWT_MouseShape { */ // properties (get/set) / sync functions interface WebTwain { - /** * Returns or sets whether multi-page selection is supported. * @type {bool} @@ -2481,7 +2478,6 @@ interface WebTwain { */ HTTPUploadThroughPostAsMultiPagePDF(HTTPServer: string, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - /** * [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 @@ -2899,12 +2895,6 @@ interface WebTwain { SetCapItemsString(index: number, newVal: string): void; // --- SCAN end -- - - - - - - // --- View & Edit start -- /** @@ -3030,7 +3020,6 @@ interface WebTwain { */ GetSelectedImageIndex(sSelectedIndex: number): number; - /** * You can use the method to select images programatically which is ususally done by mouse clicking. * @method WebTwain#SetSelectedImageIndex @@ -3273,8 +3262,6 @@ interface WebTwain { Print(): boolean; // --- View & Edit end -- - - // --- Upload & Save end -- // --- Others --- @@ -3302,8 +3289,6 @@ interface WebTwain { */ EnableSource(): boolean; - - /** * Displays the source's built-in interface to acquire image. * @method WebTwain#AcquireImage @@ -3442,7 +3427,6 @@ interface WebTwain { */ SetSelectedImageArea(sImageIndex: number, left: number, top: number, right: number, bottom: number): boolean; - /** * Converts the images specified by the indices to base64. * @method WebTwain#ConvertToBase64 @@ -3472,4 +3456,4 @@ interface WebTwain { * @return {bool} */ SetHTTPHeader(key: string, value: string): boolean; -} \ No newline at end of file +} diff --git a/types/dwt/tslint.json b/types/dwt/tslint.json index 3db14f85ea..acce7c8a0b 100644 --- a/types/dwt/tslint.json +++ b/types/dwt/tslint.json @@ -1 +1,9 @@ -{ "extends": "dtslint/dt.json" } +{ + "extends": "dtslint/dt.json", + "rules": { + "max-line-length": [false], + "no-trailing-whitespace": false, + "space-before-function-paren": false, + "only-arrow-functions": [false] + } +}