diff --git a/src/bindings/ejdb2_node/index.d.ts b/src/bindings/ejdb2_node/index.d.ts index a02868ca..d74ac732 100644 --- a/src/bindings/ejdb2_node/index.d.ts +++ b/src/bindings/ejdb2_node/index.d.ts @@ -50,7 +50,7 @@ declare namespace ejdb2_node { /** * EJDB document. */ - interface JBDOC { + interface JBDOC { /** * Document identifier */ @@ -59,7 +59,7 @@ declare namespace ejdb2_node { /** * Document JSON object */ - json: any; + json: T; /** * String represen @@ -67,8 +67,8 @@ declare namespace ejdb2_node { toString(): string; } - interface JBDOCStream { - [Symbol.asyncIterator](): AsyncIterableIterator; + interface JBDOCStream { + [Symbol.asyncIterator](): AsyncIterableIterator>; } /** @@ -105,7 +105,7 @@ declare namespace ejdb2_node { * readable stream of matched documents. * */ - stream(opts?: QueryOptions): JBDOCStream; + stream(opts?: QueryOptions): JBDOCStream; /** * Executes this query and waits its completion. @@ -122,18 +122,18 @@ declare namespace ejdb2_node { * Returns result set as a list. * Use it with caution on large data sets. */ - list(opts?: QueryOptions): Promise>; + list(opts?: QueryOptions): Promise>>; /** * Collects up to [n] documents from result set into array. */ - firstN(n: number, opts?: QueryOptions): Promise>; + firstN(n: number, opts?: QueryOptions): Promise>>; /** * Returns a first record in result set. * If record is not found promise with `undefined` will be returned. */ - first(opts?: QueryOptions): Promise; + first(opts?: QueryOptions): Promise | undefined>; /** * Set [json] at the specified [placeholder]. @@ -380,14 +380,14 @@ declare namespace ejdb2_node { * If document with given `id` is not found then `Error` will be thrown. * Not found error can be detected by {@link JBE.isNotFound} */ - get(collection: string, id: number): Promise; + get(collection: string, id: number): Promise; /** * Get json body of document identified by [id] and stored in [collection]. * * If document with given `id` is not found then `null` will be resoved. */ - getOrNull(collection: string, id: number): Promise; + getOrNull(collection: string, id: number): Promise; /** * Get json body with database metadata.