Przeglądaj źródła

substitute S for T in SearchFn sort

Aneurin Barker Snook 2 lat temu
rodzic
commit
9f8872a86f
2 zmienionych plików z 2 dodań i 2 usunięć
  1. 1 1
      dist/lib/index.d.ts
  2. 1 1
      lib/index.ts

+ 1 - 1
dist/lib/index.d.ts

@@ -70,7 +70,7 @@ export declare type Terms<T> = {
  * A `SearchFn` function matches documents in a single collection and returns a `SearchResult` based on the given
  * `terms`, `limit`, and `sort`.
  */
-export declare type SearchFn<T extends Searchable, S extends Searchable = T> = (terms?: Terms<Document<DeepNonNullable<S>>>, limit?: Limit, sort?: Sort<Document<T>>[] | Sort<Document<T>>) => Promise<SearchResult<T>>;
+export declare type SearchFn<T extends Searchable, S extends Searchable = T> = (terms?: Terms<Document<DeepNonNullable<S>>>, limit?: Limit, sort?: Sort<Document<S>>[] | Sort<Document<S>>) => Promise<SearchResult<T>>;
 /**
  * Search results are a tuple of three values:
  *   1. The **total** number of matching documents in the searched collection, ignoring limit

+ 1 - 1
lib/index.ts

@@ -85,7 +85,7 @@ export type Terms<T> = {
 export type SearchFn<T extends Searchable, S extends Searchable = T> = (
   terms?: Terms<Document<DeepNonNullable<S>>>,
   limit?: Limit,
-  sort?: Sort<Document<T>>[] | Sort<Document<T>>
+  sort?: Sort<Document<S>>[] | Sort<Document<S>>
 ) => Promise<SearchResult<T>>
 
 /**