Commit ff711a53 authored by Robert Knight's avatar Robert Knight

s/SearchResult/SearchResponse

Use the suffix "Response" rather than "Result" for consistency with
other API response types.
parent 2fa14126
...@@ -3,7 +3,7 @@ import { TinyEmitter } from 'tiny-emitter'; ...@@ -3,7 +3,7 @@ import { TinyEmitter } from 'tiny-emitter';
/** /**
* @typedef {import('../types/api').Annotation} Annotation * @typedef {import('../types/api').Annotation} Annotation
* @typedef {import('../types/api').SearchQuery} SearchQuery * @typedef {import('../types/api').SearchQuery} SearchQuery
* @typedef {import('../types/api').SearchResult} SearchResult * @typedef {import('../types/api').SearchResponse} SearchResponse
* *
*/ */
...@@ -47,7 +47,8 @@ function defaultPageSize(index) { ...@@ -47,7 +47,8 @@ function defaultPageSize(index) {
*/ */
export class SearchClient extends TinyEmitter { export class SearchClient extends TinyEmitter {
/** /**
* @param {(query: SearchQuery) => Promise<SearchResult>} searchFn - Function for querying the search API * @param {(query: SearchQuery) => Promise<SearchResponse>} searchFn -
* Callback that executes a search request against the Hypothesis API
* @param {object} options * @param {object} options
* @param {(index: number) => number} [options.getPageSize] - * @param {(index: number) => number} [options.getPageSize] -
* Callback that returns the page size to use when fetching the index'th * Callback that returns the page size to use when fetching the index'th
......
...@@ -231,7 +231,7 @@ ...@@ -231,7 +231,7 @@
* *
* See https://h.readthedocs.io/en/latest/api-reference/#tag/annotations/paths/~1search/get * See https://h.readthedocs.io/en/latest/api-reference/#tag/annotations/paths/~1search/get
* *
* @typedef SearchResult * @typedef SearchResponse
* @prop {number} total * @prop {number} total
* @prop {Annotation[]} rows * @prop {Annotation[]} rows
* @prop {Annotation[]} [replies] - Unofficial property that is populated if * @prop {Annotation[]} [replies] - Unofficial property that is populated if
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment