Skip to content
This repository was archived by the owner on Mar 11, 2022. It is now read-only.

Commit 6271c93

Browse files
authored
Merge pull request #351 from cloudant/fix-request-ts-import
Use named import for `request.CoreOptions` type
2 parents 38fa53d + 72d8e73 commit 6271c93

File tree

6 files changed

+24
-2
lines changed

6 files changed

+24
-2
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ jsdoc/
66
node_modules/
77
templates/
88
test/legacy/
9+
test/typescript/
910
tmp/

CHANGES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# UNRELEASED
2+
- [FIXED] Use named import for `request.CoreOptions` type.
3+
14
# 3.0.0 (2018-11-20)
25
- [FIXED] Expose `BasePlugin` type in Cloudant client.
36
- [FIXED] Set `parseUrl = false` on underlying Nano instance.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"uuid": "^3.0.1"
5454
},
5555
"scripts": {
56-
"test": "eslint --ignore-path .eslintignore . && mocha && npm run tslint && npm audit",
56+
"test": "eslint --ignore-path .eslintignore . && tsc test/typescript/*.ts && mocha && npm run tslint && npm audit",
5757
"test-verbose": "env DEBUG='*,-mocha:*' npm run test",
5858
"test-live": "NOCK_OFF=true mocha",
5959
"test-live-verbose": "env DEBUG='*,-mocha:*' npm run test-live",

test/mocha.opts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
--exclude test/typescript/*.js
12
--recursive
23
--timeout 10000

test/typescript/cloudant.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright © 2018 IBM Corp. All rights reserved.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// Ensure Cloudant type declaration files can be imported without error.
16+
17+
export import cloudant = require('../../types/index');

types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// limitations under the License.
1414

1515
import * as nano from 'nano';
16-
import CoreOptions from "request";
16+
import { CoreOptions } from 'request';
1717

1818
declare function cloudant(
1919
config: cloudant.Configuration | string,

0 commit comments

Comments
 (0)