From 08c4d6ac7dae7a8d61ded59f64bab68ad7f39f92 Mon Sep 17 00:00:00 2001 From: junderw Date: Thu, 7 Mar 2019 14:16:45 +0900 Subject: [PATCH] Fix lint for templates --- src/templates/multisig/input.js | 2 +- src/templates/multisig/output.js | 4 ++-- src/templates/nulldata.js | 2 +- src/templates/pubkey/input.js | 5 +++-- src/templates/pubkey/output.js | 2 +- src/templates/pubkeyhash/input.js | 2 +- src/templates/pubkeyhash/output.js | 2 +- src/templates/scripthash/input.js | 2 +- src/templates/scripthash/output.js | 2 +- src/templates/witnesscommitment/output.js | 4 ++-- src/templates/witnesspubkeyhash/input.js | 2 +- src/templates/witnesspubkeyhash/output.js | 2 +- src/templates/witnessscripthash/input.js | 2 +- src/templates/witnessscripthash/output.js | 2 +- ts_src/templates/multisig/input.ts | 11 ++++++----- ts_src/templates/multisig/output.ts | 15 ++++++++------- ts_src/templates/nulldata.ts | 2 +- ts_src/templates/pubkey/input.ts | 10 ++++++---- ts_src/templates/pubkey/output.ts | 9 +++++---- ts_src/templates/pubkeyhash/input.ts | 11 ++++++----- ts_src/templates/pubkeyhash/output.ts | 2 +- ts_src/templates/scripthash/input.ts | 2 +- ts_src/templates/scripthash/output.ts | 2 +- ts_src/templates/witnesscommitment/output.ts | 6 +++--- ts_src/templates/witnesspubkeyhash/input.ts | 11 ++++++----- ts_src/templates/witnesspubkeyhash/output.ts | 2 +- ts_src/templates/witnessscripthash/input.ts | 7 ++----- ts_src/templates/witnessscripthash/output.ts | 2 +- types/templates/multisig/input.d.ts | 3 ++- types/templates/multisig/output.d.ts | 3 ++- types/templates/pubkey/input.d.ts | 3 ++- types/templates/pubkey/output.d.ts | 3 ++- types/templates/pubkeyhash/input.d.ts | 3 ++- types/templates/witnesspubkeyhash/input.d.ts | 3 ++- types/templates/witnessscripthash/input.d.ts | 2 +- 35 files changed, 79 insertions(+), 68 deletions(-) diff --git a/src/templates/multisig/input.js b/src/templates/multisig/input.js index 24a9710..4b4f395 100644 --- a/src/templates/multisig/input.js +++ b/src/templates/multisig/input.js @@ -18,6 +18,6 @@ function check(script, allowIncomplete) { return chunks.slice(1).every(bscript.isCanonicalScriptSignature); } exports.check = check; -check.toJSON = function () { +check.toJSON = () => { return 'multisig input'; }; diff --git a/src/templates/multisig/output.js b/src/templates/multisig/output.js index 64d07bc..c79fe9b 100644 --- a/src/templates/multisig/output.js +++ b/src/templates/multisig/output.js @@ -2,8 +2,8 @@ // m [pubKeys ...] n OP_CHECKMULTISIG Object.defineProperty(exports, "__esModule", { value: true }); const bscript = require("../../script"); -const types = require("../../types"); const script_1 = require("../../script"); +const types = require("../../types"); const OP_INT_BASE = script_1.OPS.OP_RESERVED; // OP_1 - 1 function check(script, allowIncomplete) { const chunks = bscript.decompile(script); @@ -31,6 +31,6 @@ function check(script, allowIncomplete) { return keys.every(bscript.isCanonicalPubKey); } exports.check = check; -check.toJSON = function () { +check.toJSON = () => { return 'multi-sig output'; }; diff --git a/src/templates/nulldata.js b/src/templates/nulldata.js index b5ffdce..29bee7a 100644 --- a/src/templates/nulldata.js +++ b/src/templates/nulldata.js @@ -8,7 +8,7 @@ function check(script) { return buffer.length > 1 && buffer[0] === OPS.OP_RETURN; } exports.check = check; -check.toJSON = function () { +check.toJSON = () => { return 'null data output'; }; const output = { check }; diff --git a/src/templates/pubkey/input.js b/src/templates/pubkey/input.js index 10d3c07..479fdc5 100644 --- a/src/templates/pubkey/input.js +++ b/src/templates/pubkey/input.js @@ -4,9 +4,10 @@ Object.defineProperty(exports, "__esModule", { value: true }); const bscript = require("../../script"); function check(script) { const chunks = bscript.decompile(script); - return (chunks.length === 1 && bscript.isCanonicalScriptSignature(chunks[0])); + return (chunks.length === 1 && + bscript.isCanonicalScriptSignature(chunks[0])); } exports.check = check; -check.toJSON = function () { +check.toJSON = () => { return 'pubKey input'; }; diff --git a/src/templates/pubkey/output.js b/src/templates/pubkey/output.js index e2f87c2..1f17990 100644 --- a/src/templates/pubkey/output.js +++ b/src/templates/pubkey/output.js @@ -10,6 +10,6 @@ function check(script) { chunks[1] === script_1.OPS.OP_CHECKSIG); } exports.check = check; -check.toJSON = function () { +check.toJSON = () => { return 'pubKey output'; }; diff --git a/src/templates/pubkeyhash/input.js b/src/templates/pubkeyhash/input.js index f03d391..7de30ec 100644 --- a/src/templates/pubkeyhash/input.js +++ b/src/templates/pubkeyhash/input.js @@ -9,6 +9,6 @@ function check(script) { bscript.isCanonicalPubKey(chunks[1])); } exports.check = check; -check.toJSON = function () { +check.toJSON = () => { return 'pubKeyHash input'; }; diff --git a/src/templates/pubkeyhash/output.js b/src/templates/pubkeyhash/output.js index 222244b..5ee692b 100644 --- a/src/templates/pubkeyhash/output.js +++ b/src/templates/pubkeyhash/output.js @@ -13,6 +13,6 @@ function check(script) { buffer[24] === script_1.OPS.OP_CHECKSIG); } exports.check = check; -check.toJSON = function () { +check.toJSON = () => { return 'pubKeyHash output'; }; diff --git a/src/templates/scripthash/input.js b/src/templates/scripthash/input.js index 5d2b576..488b931 100644 --- a/src/templates/scripthash/input.js +++ b/src/templates/scripthash/input.js @@ -39,6 +39,6 @@ function check(script, allowIncomplete) { return false; } exports.check = check; -check.toJSON = function () { +check.toJSON = () => { return 'scriptHash input'; }; diff --git a/src/templates/scripthash/output.js b/src/templates/scripthash/output.js index 5fd2f65..bf1246a 100644 --- a/src/templates/scripthash/output.js +++ b/src/templates/scripthash/output.js @@ -11,6 +11,6 @@ function check(script) { buffer[22] === script_1.OPS.OP_EQUAL); } exports.check = check; -check.toJSON = function () { +check.toJSON = () => { return 'scriptHash output'; }; diff --git a/src/templates/witnesscommitment/output.js b/src/templates/witnesscommitment/output.js index 38f622a..f4d6af0 100644 --- a/src/templates/witnesscommitment/output.js +++ b/src/templates/witnesscommitment/output.js @@ -2,9 +2,9 @@ // OP_RETURN {aa21a9ed} {commitment} Object.defineProperty(exports, "__esModule", { value: true }); const bscript = require("../../script"); +const script_1 = require("../../script"); const types = require("../../types"); const typeforce = require('typeforce'); -const script_1 = require("../../script"); const HEADER = Buffer.from('aa21a9ed', 'hex'); function check(script) { const buffer = bscript.compile(script); @@ -14,7 +14,7 @@ function check(script) { buffer.slice(2, 6).equals(HEADER)); } exports.check = check; -check.toJSON = function () { +check.toJSON = () => { return 'Witness commitment output'; }; function encode(commitment) { diff --git a/src/templates/witnesspubkeyhash/input.js b/src/templates/witnesspubkeyhash/input.js index 4585623..3d589e9 100644 --- a/src/templates/witnesspubkeyhash/input.js +++ b/src/templates/witnesspubkeyhash/input.js @@ -12,6 +12,6 @@ function check(script) { isCompressedCanonicalPubKey(chunks[1])); } exports.check = check; -check.toJSON = function () { +check.toJSON = () => { return 'witnessPubKeyHash input'; }; diff --git a/src/templates/witnesspubkeyhash/output.js b/src/templates/witnesspubkeyhash/output.js index 9c508a0..69aab11 100644 --- a/src/templates/witnesspubkeyhash/output.js +++ b/src/templates/witnesspubkeyhash/output.js @@ -8,6 +8,6 @@ function check(script) { return buffer.length === 22 && buffer[0] === script_1.OPS.OP_0 && buffer[1] === 0x14; } exports.check = check; -check.toJSON = function () { +check.toJSON = () => { return 'Witness pubKeyHash output'; }; diff --git a/src/templates/witnessscripthash/input.js b/src/templates/witnessscripthash/input.js index ca8c8b6..3f5c002 100644 --- a/src/templates/witnessscripthash/input.js +++ b/src/templates/witnessscripthash/input.js @@ -31,6 +31,6 @@ function check(chunks, allowIncomplete) { return false; } exports.check = check; -check.toJSON = function () { +check.toJSON = () => { return 'witnessScriptHash input'; }; diff --git a/src/templates/witnessscripthash/output.js b/src/templates/witnessscripthash/output.js index f283b86..a6d4d95 100644 --- a/src/templates/witnessscripthash/output.js +++ b/src/templates/witnessscripthash/output.js @@ -8,6 +8,6 @@ function check(script) { return buffer.length === 34 && buffer[0] === script_1.OPS.OP_0 && buffer[1] === 0x20; } exports.check = check; -check.toJSON = function () { +check.toJSON = () => { return 'Witness scriptHash output'; }; diff --git a/ts_src/templates/multisig/input.ts b/ts_src/templates/multisig/input.ts index 222ff10..57b73d2 100644 --- a/ts_src/templates/multisig/input.ts +++ b/ts_src/templates/multisig/input.ts @@ -1,19 +1,20 @@ // OP_0 [signatures ...] +import { Stack } from '../../payments'; import * as bscript from '../../script'; import { OPS } from '../../script'; function partialSignature(value: number | Buffer): boolean { return ( - value === OPS.OP_0 || bscript.isCanonicalScriptSignature(value) + value === OPS.OP_0 || bscript.isCanonicalScriptSignature(value as Buffer) ); } export function check( - script: Buffer | Array, + script: Buffer | Stack, allowIncomplete?: boolean, ): boolean { - const chunks = >bscript.decompile(script); + const chunks = bscript.decompile(script) as Stack; if (chunks.length < 2) return false; if (chunks[0] !== OPS.OP_0) return false; @@ -21,10 +22,10 @@ export function check( return chunks.slice(1).every(partialSignature); } - return (>chunks.slice(1)).every( + return (chunks.slice(1) as Buffer[]).every( bscript.isCanonicalScriptSignature, ); } -check.toJSON = function() { +check.toJSON = () => { return 'multisig input'; }; diff --git a/ts_src/templates/multisig/output.ts b/ts_src/templates/multisig/output.ts index 040649b..3ee0820 100644 --- a/ts_src/templates/multisig/output.ts +++ b/ts_src/templates/multisig/output.ts @@ -1,22 +1,23 @@ // m [pubKeys ...] n OP_CHECKMULTISIG +import { Stack } from '../../payments'; import * as bscript from '../../script'; -import * as types from '../../types'; import { OPS } from '../../script'; +import * as types from '../../types'; const OP_INT_BASE = OPS.OP_RESERVED; // OP_1 - 1 export function check( - script: Buffer | Array, + script: Buffer | Stack, allowIncomplete?: boolean, ): boolean { - const chunks = >bscript.decompile(script); + const chunks = bscript.decompile(script) as Stack; if (chunks.length < 4) return false; if (chunks[chunks.length - 1] !== OPS.OP_CHECKMULTISIG) return false; if (!types.Number(chunks[0])) return false; if (!types.Number(chunks[chunks.length - 2])) return false; - const m = chunks[0] - OP_INT_BASE; - const n = chunks[chunks.length - 2] - OP_INT_BASE; + const m = (chunks[0] as number) - OP_INT_BASE; + const n = (chunks[chunks.length - 2] as number) - OP_INT_BASE; if (m <= 0) return false; if (n > 16) return false; @@ -24,9 +25,9 @@ export function check( if (n !== chunks.length - 3) return false; if (allowIncomplete) return true; - const keys = >chunks.slice(1, -2); + const keys = chunks.slice(1, -2) as Buffer[]; return keys.every(bscript.isCanonicalPubKey); } -check.toJSON = function() { +check.toJSON = () => { return 'multi-sig output'; }; diff --git a/ts_src/templates/nulldata.ts b/ts_src/templates/nulldata.ts index f0694a3..bafe4a4 100644 --- a/ts_src/templates/nulldata.ts +++ b/ts_src/templates/nulldata.ts @@ -7,7 +7,7 @@ export function check(script: Buffer | Array): boolean { return buffer.length > 1 && buffer[0] === OPS.OP_RETURN; } -check.toJSON = function() { +check.toJSON = () => { return 'null data output'; }; diff --git a/ts_src/templates/pubkey/input.ts b/ts_src/templates/pubkey/input.ts index e9ea1be..7e07a94 100644 --- a/ts_src/templates/pubkey/input.ts +++ b/ts_src/templates/pubkey/input.ts @@ -1,14 +1,16 @@ // {signature} +import { Stack } from '../../payments'; import * as bscript from '../../script'; -export function check(script: Buffer | Array): boolean { - const chunks = >bscript.decompile(script); +export function check(script: Buffer | Stack): boolean { + const chunks = bscript.decompile(script) as Stack; return ( - chunks.length === 1 && bscript.isCanonicalScriptSignature(chunks[0]) + chunks.length === 1 && + bscript.isCanonicalScriptSignature(chunks[0] as Buffer) ); } -check.toJSON = function() { +check.toJSON = () => { return 'pubKey input'; }; diff --git a/ts_src/templates/pubkey/output.ts b/ts_src/templates/pubkey/output.ts index 8378870..d57422d 100644 --- a/ts_src/templates/pubkey/output.ts +++ b/ts_src/templates/pubkey/output.ts @@ -1,17 +1,18 @@ // {pubKey} OP_CHECKSIG +import { Stack } from '../../payments'; import * as bscript from '../../script'; import { OPS } from '../../script'; -export function check(script: Buffer | Array): boolean { - const chunks = >bscript.decompile(script); +export function check(script: Buffer | Stack): boolean { + const chunks = bscript.decompile(script) as Stack; return ( chunks.length === 2 && - bscript.isCanonicalPubKey(chunks[0]) && + bscript.isCanonicalPubKey(chunks[0] as Buffer) && chunks[1] === OPS.OP_CHECKSIG ); } -check.toJSON = function() { +check.toJSON = () => { return 'pubKey output'; }; diff --git a/ts_src/templates/pubkeyhash/input.ts b/ts_src/templates/pubkeyhash/input.ts index c091764..83da475 100644 --- a/ts_src/templates/pubkeyhash/input.ts +++ b/ts_src/templates/pubkeyhash/input.ts @@ -1,16 +1,17 @@ // {signature} {pubKey} +import { Stack } from '../../payments'; import * as bscript from '../../script'; -export function check(script: Buffer | Array): boolean { - const chunks = >bscript.decompile(script); +export function check(script: Buffer | Stack): boolean { + const chunks = bscript.decompile(script) as Stack; return ( chunks.length === 2 && - bscript.isCanonicalScriptSignature(chunks[0]) && - bscript.isCanonicalPubKey(chunks[1]) + bscript.isCanonicalScriptSignature(chunks[0] as Buffer) && + bscript.isCanonicalPubKey(chunks[1] as Buffer) ); } -check.toJSON = function() { +check.toJSON = () => { return 'pubKeyHash input'; }; diff --git a/ts_src/templates/pubkeyhash/output.ts b/ts_src/templates/pubkeyhash/output.ts index a5c5c9b..37070a3 100644 --- a/ts_src/templates/pubkeyhash/output.ts +++ b/ts_src/templates/pubkeyhash/output.ts @@ -15,6 +15,6 @@ export function check(script: Buffer | Array): boolean { buffer[24] === OPS.OP_CHECKSIG ); } -check.toJSON = function() { +check.toJSON = () => { return 'pubKeyHash output'; }; diff --git a/ts_src/templates/scripthash/input.ts b/ts_src/templates/scripthash/input.ts index 0b86d63..1e3f97d 100644 --- a/ts_src/templates/scripthash/input.ts +++ b/ts_src/templates/scripthash/input.ts @@ -56,6 +56,6 @@ export function check( return false; } -check.toJSON = function() { +check.toJSON = () => { return 'scriptHash input'; }; diff --git a/ts_src/templates/scripthash/output.ts b/ts_src/templates/scripthash/output.ts index 6ff138a..7eac30d 100644 --- a/ts_src/templates/scripthash/output.ts +++ b/ts_src/templates/scripthash/output.ts @@ -13,6 +13,6 @@ export function check(script: Buffer | Array): boolean { buffer[22] === OPS.OP_EQUAL ); } -check.toJSON = function() { +check.toJSON = () => { return 'scriptHash output'; }; diff --git a/ts_src/templates/witnesscommitment/output.ts b/ts_src/templates/witnesscommitment/output.ts index 29beb39..9439e4c 100644 --- a/ts_src/templates/witnesscommitment/output.ts +++ b/ts_src/templates/witnesscommitment/output.ts @@ -1,10 +1,10 @@ // OP_RETURN {aa21a9ed} {commitment} import * as bscript from '../../script'; +import { OPS } from '../../script'; import * as types from '../../types'; const typeforce = require('typeforce'); -import { OPS } from '../../script'; const HEADER: Buffer = Buffer.from('aa21a9ed', 'hex'); @@ -19,7 +19,7 @@ export function check(script: Buffer | Array): boolean { ); } -check.toJSON = function() { +check.toJSON = () => { return 'Witness commitment output'; }; @@ -36,5 +36,5 @@ export function encode(commitment: Buffer): Buffer { export function decode(buffer: Buffer): Buffer { typeforce(check, buffer); - return (bscript.decompile(buffer)![1]).slice(4, 36); + return (bscript.decompile(buffer)![1] as Buffer).slice(4, 36); } diff --git a/ts_src/templates/witnesspubkeyhash/input.ts b/ts_src/templates/witnesspubkeyhash/input.ts index 22fc2cf..aa3bef8 100644 --- a/ts_src/templates/witnesspubkeyhash/input.ts +++ b/ts_src/templates/witnesspubkeyhash/input.ts @@ -1,20 +1,21 @@ // {signature} {pubKey} +import { Stack } from '../../payments'; import * as bscript from '../../script'; function isCompressedCanonicalPubKey(pubKey: Buffer): boolean { return bscript.isCanonicalPubKey(pubKey) && pubKey.length === 33; } -export function check(script: Buffer | Array): boolean { - const chunks = >bscript.decompile(script); +export function check(script: Buffer | Stack): boolean { + const chunks = bscript.decompile(script) as Stack; return ( chunks.length === 2 && - bscript.isCanonicalScriptSignature(chunks[0]) && - isCompressedCanonicalPubKey(chunks[1]) + bscript.isCanonicalScriptSignature(chunks[0] as Buffer) && + isCompressedCanonicalPubKey(chunks[1] as Buffer) ); } -check.toJSON = function() { +check.toJSON = () => { return 'witnessPubKeyHash input'; }; diff --git a/ts_src/templates/witnesspubkeyhash/output.ts b/ts_src/templates/witnesspubkeyhash/output.ts index 09c49d0..0e9432c 100644 --- a/ts_src/templates/witnesspubkeyhash/output.ts +++ b/ts_src/templates/witnesspubkeyhash/output.ts @@ -8,6 +8,6 @@ export function check(script: Buffer | Array): boolean { return buffer.length === 22 && buffer[0] === OPS.OP_0 && buffer[1] === 0x14; } -check.toJSON = function() { +check.toJSON = () => { return 'Witness pubKeyHash output'; }; diff --git a/ts_src/templates/witnessscripthash/input.ts b/ts_src/templates/witnessscripthash/input.ts index 6cf35bf..42a13ac 100644 --- a/ts_src/templates/witnessscripthash/input.ts +++ b/ts_src/templates/witnessscripthash/input.ts @@ -7,10 +7,7 @@ import * as p2ms from '../multisig'; import * as p2pk from '../pubkey'; import * as p2pkh from '../pubkeyhash'; -export function check( - chunks: Array, - allowIncomplete?: boolean, -): boolean { +export function check(chunks: Buffer[], allowIncomplete?: boolean): boolean { typeforce(typeforce.Array, chunks); if (chunks.length < 1) return false; @@ -45,6 +42,6 @@ export function check( return false; } -check.toJSON = function() { +check.toJSON = () => { return 'witnessScriptHash input'; }; diff --git a/ts_src/templates/witnessscripthash/output.ts b/ts_src/templates/witnessscripthash/output.ts index 430cc4f..85034d1 100644 --- a/ts_src/templates/witnessscripthash/output.ts +++ b/ts_src/templates/witnessscripthash/output.ts @@ -8,6 +8,6 @@ export function check(script: Buffer | Array): boolean { return buffer.length === 34 && buffer[0] === OPS.OP_0 && buffer[1] === 0x20; } -check.toJSON = function() { +check.toJSON = () => { return 'Witness scriptHash output'; }; diff --git a/types/templates/multisig/input.d.ts b/types/templates/multisig/input.d.ts index a04d03c..a207dd6 100644 --- a/types/templates/multisig/input.d.ts +++ b/types/templates/multisig/input.d.ts @@ -1,5 +1,6 @@ /// -export declare function check(script: Buffer | Array, allowIncomplete?: boolean): boolean; +import { Stack } from '../../payments'; +export declare function check(script: Buffer | Stack, allowIncomplete?: boolean): boolean; export declare namespace check { var toJSON: () => string; } diff --git a/types/templates/multisig/output.d.ts b/types/templates/multisig/output.d.ts index a04d03c..a207dd6 100644 --- a/types/templates/multisig/output.d.ts +++ b/types/templates/multisig/output.d.ts @@ -1,5 +1,6 @@ /// -export declare function check(script: Buffer | Array, allowIncomplete?: boolean): boolean; +import { Stack } from '../../payments'; +export declare function check(script: Buffer | Stack, allowIncomplete?: boolean): boolean; export declare namespace check { var toJSON: () => string; } diff --git a/types/templates/pubkey/input.d.ts b/types/templates/pubkey/input.d.ts index 091758f..c4ffeab 100644 --- a/types/templates/pubkey/input.d.ts +++ b/types/templates/pubkey/input.d.ts @@ -1,5 +1,6 @@ /// -export declare function check(script: Buffer | Array): boolean; +import { Stack } from '../../payments'; +export declare function check(script: Buffer | Stack): boolean; export declare namespace check { var toJSON: () => string; } diff --git a/types/templates/pubkey/output.d.ts b/types/templates/pubkey/output.d.ts index 091758f..c4ffeab 100644 --- a/types/templates/pubkey/output.d.ts +++ b/types/templates/pubkey/output.d.ts @@ -1,5 +1,6 @@ /// -export declare function check(script: Buffer | Array): boolean; +import { Stack } from '../../payments'; +export declare function check(script: Buffer | Stack): boolean; export declare namespace check { var toJSON: () => string; } diff --git a/types/templates/pubkeyhash/input.d.ts b/types/templates/pubkeyhash/input.d.ts index 091758f..c4ffeab 100644 --- a/types/templates/pubkeyhash/input.d.ts +++ b/types/templates/pubkeyhash/input.d.ts @@ -1,5 +1,6 @@ /// -export declare function check(script: Buffer | Array): boolean; +import { Stack } from '../../payments'; +export declare function check(script: Buffer | Stack): boolean; export declare namespace check { var toJSON: () => string; } diff --git a/types/templates/witnesspubkeyhash/input.d.ts b/types/templates/witnesspubkeyhash/input.d.ts index 091758f..c4ffeab 100644 --- a/types/templates/witnesspubkeyhash/input.d.ts +++ b/types/templates/witnesspubkeyhash/input.d.ts @@ -1,5 +1,6 @@ /// -export declare function check(script: Buffer | Array): boolean; +import { Stack } from '../../payments'; +export declare function check(script: Buffer | Stack): boolean; export declare namespace check { var toJSON: () => string; } diff --git a/types/templates/witnessscripthash/input.d.ts b/types/templates/witnessscripthash/input.d.ts index 7786731..b2a6e8a 100644 --- a/types/templates/witnessscripthash/input.d.ts +++ b/types/templates/witnessscripthash/input.d.ts @@ -1,5 +1,5 @@ /// -export declare function check(chunks: Array, allowIncomplete?: boolean): boolean; +export declare function check(chunks: Buffer[], allowIncomplete?: boolean): boolean; export declare namespace check { var toJSON: () => string; }