From 35013236c78c0c5ecd7e024e84e8221a8b56b2f1 Mon Sep 17 00:00:00 2001 From: Max Battcher Date: Thu, 8 Jun 2017 21:58:45 -0400 Subject: [PATCH] Make a type for built-in reducers in pouchdb-mapreduce --- types/pouchdb-mapreduce/index.d.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/types/pouchdb-mapreduce/index.d.ts b/types/pouchdb-mapreduce/index.d.ts index 92ea09e172..883339bc82 100644 --- a/types/pouchdb-mapreduce/index.d.ts +++ b/types/pouchdb-mapreduce/index.d.ts @@ -10,6 +10,7 @@ /* tslint:disable:no-single-declare-module */ declare namespace PouchDB { + type BuiltInReducers = '_sum' | '_count' | '_stats'; type Map = (doc: Content) => void; /** * CouchDB-style Reduction function @@ -22,13 +23,13 @@ declare namespace PouchDB { interface Filter { map: Map; // Assume that Content[] | Reduction[] is enough leverage in most cases to handle intermediate map emits - reduce?: Reducer | '_sum' | '_count' | '_stats' | string; + reduce?: Reducer | BuiltInReducers | string; } namespace Query { interface Options { /** Reduce function, or the string name of a built-in function: '_sum', '_count', or '_stats'. */ - reduce?: Reducer | '_sum' | '_count' | '_stats' | boolean; + reduce?: Reducer | BuiltInReducers | boolean; /** Include the document in each row in the doc field. */ include_docs?: boolean; /** Include conflicts in the _conflicts field of a doc. */