Level / abstract-leveldown

An abstract prototype matching the leveldown API.
MIT License
146 stars 53 forks source link

Error TS1005: ',' expected when compile with tsc #206

Closed dr15x86 closed 6 years ago

dr15x86 commented 6 years ago

Hello. I try using this project with Typescript Version 2.7.2

But compilation failed with errors

node_modules/abstract-leveldown/index.d.ts:43:27 - error TS1005: ',' expected.

43 export type Batch<K=any, V?=any> = PutBatch<K, V> | DelBatch<K>
                             ~

node_modules/abstract-leveldown/index.d.ts:43:28 - error TS1139: Type parameter declaration expected.

43 export type Batch<K=any, V?=any> = PutBatch<K, V> | DelBatch<K>
                          ~

How reproduce

mkdir tst_abstract-leveldown/
cd tst_abstract-leveldown/
npm init -f
npm install --save typescript abstract-leveldown
./node_modules/.bin/tsc --init

create file test.ts with content

import * as ald from 'abstract-leveldown'

console.log(ald)

and run compile

./node_modules/.bin/tsc --pretty

Versions tools:

tsc Version 2.7.2
abstract-leveldown 4.0.2
NodeJS v9.5.0
npm 5.6.0
vweevers commented 6 years ago

We're working on a fix in #204.

vweevers commented 6 years ago

Fix published in 4.0.3.