You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by gl...@apache.org on 2020/02/27 13:31:58 UTC
[couchdb-nano] branch master updated: fixed TypeScript definitions
for follow functions - fixes issue #194 (#206)
This is an automated email from the ASF dual-hosted git repository.
glynnbird pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/couchdb-nano.git
The following commit(s) were added to refs/heads/master by this push:
new 0e2b69e fixed TypeScript definitions for follow functions - fixes issue #194 (#206)
0e2b69e is described below
commit 0e2b69e5c676bbe87239bdbc33ab2cb289eeb9e6
Author: Glynn Bird <gl...@gmail.com>
AuthorDate: Thu Feb 27 13:31:53 2020 +0000
fixed TypeScript definitions for follow functions - fixes issue #194 (#206)
---
lib/nano.d.ts | 22 +++++++++++++++-------
1 file changed, 15 insertions(+), 7 deletions(-)
diff --git a/lib/nano.d.ts b/lib/nano.d.ts
index e287643..9f5d29f 100644
--- a/lib/nano.d.ts
+++ b/lib/nano.d.ts
@@ -44,11 +44,16 @@ declare namespace nano {
updates(callback?: Callback<DatabaseUpdatesResponse>): Promise<DatabaseUpdatesResponse>;
// http://docs.couchdb.org/en/latest/api/server/common.html#get--_db_updates
updates(params: UpdatesParams, callback?: Callback<DatabaseUpdatesResponse>): Promise<DatabaseUpdatesResponse>;
- followUpdates(callback?: Callback<any>): EventEmitter;
- followUpdates(params: any, callback?: Callback<any>): EventEmitter;
+ followUpdates(params?: any): FollowEmitter;
+ followUpdates(callback: Callback<any>);
+ followUpdates(params: any, callback: Callback<any>);
uuids(num: number, callback?: Callback<any>): Promise<UUIDObject>;
}
+ interface FollowEmitter extends EventEmitter {
+ follow();
+ }
+
interface UUIDObject {
uuids: string[]
}
@@ -99,9 +104,11 @@ declare namespace nano {
changesAsStream(name: string): Request;
// http://docs.couchdb.org/en/latest/api/database/compact.html#post--db-_compact
changesAsStream(name: string, params: DatabaseChangesParams): Request;
- follow(source: string, callback?: Callback<any>): EventEmitter;
- follow(source: string, params: DatabaseScopeFollowUpdatesParams, callback?: Callback<any>): EventEmitter;
- followUpdates(params?: any, callback?: Callback<any>): EventEmitter;
+ follow(source: string, params?: DatabaseScopeFollowUpdatesParams): FollowEmitter;
+ follow(source: string, params: DatabaseScopeFollowUpdatesParams, callback: Callback<any>);
+ followUpdates(params?: any): FollowEmitter;
+ followUpdates(params: DatabaseScopeFollowUpdatesParams, callback: Callback<any>);
+ followUpdates(callback: Callback<any>);
// http://docs.couchdb.org/en/latest/api/server/common.html#get--_db_updates
updates(callback?: Callback<DatabaseUpdatesResponse>): Promise<DatabaseUpdatesResponse>;
// http://docs.couchdb.org/en/latest/api/server/common.html#get--_db_updates
@@ -129,8 +136,9 @@ declare namespace nano {
changes(callback?: Callback<DatabaseChangesResponse>): Promise<DatabaseChangesResponse>;
// http://docs.couchdb.org/en/latest/api/database/changes.html#get--db-_changes
changes(params: DatabaseChangesParams, callback?: Callback<DatabaseChangesResponse>): Promise<DatabaseChangesResponse>;
- follow(callback?: Callback<any>): EventEmitter;
- follow(params: DocumentScopeFollowUpdatesParams, callback?: Callback<any>): EventEmitter;
+ follow(params?: DocumentScopeFollowUpdatesParams): FollowEmitter;
+ follow(params: DocumentScopeFollowUpdatesParams, callback: Callback<any>);
+ follow(callback: Callback<any>);
// http://docs.couchdb.org/en/latest/api/server/authn.html#cookie-authentication
auth(username: string, userpass: string, callback?: Callback<DatabaseAuthResponse>): Promise<DatabaseAuthResponse>;
// http://docs.couchdb.org/en/latest/api/server/authn.html#get--_session