Updated tslint.json

This commit is contained in:
yushulx
2017-05-03 11:02:16 +08:00
parent b87bce1967
commit e039b174b8
3 changed files with 20 additions and 29 deletions
+6 -7
View File
@@ -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) => {});
}
}
}
+5 -21
View File
@@ -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 <https://github.com/yushulx/>
// 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;
}
}
+9 -1
View File
@@ -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]
}
}