File tree Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -52,3 +52,11 @@ export interface InvalidURLError extends ErrorLike {
5252export interface BadRequestError extends ErrorLike {
5353 name : "BadRequestError" ;
5454}
55+
56+ /** 検索文字列を渡さないと出てくるエラー
57+ *
58+ * 実際のresponseではmessageしか返ってこないことに注意
59+ */
60+ export interface NoQueryError extends ErrorLike {
61+ name : "NoQueryError" ;
62+ }
Original file line number Diff line number Diff line change @@ -201,3 +201,37 @@ export interface TweetInfo {
201201 /** Tweetに添付された画像 */
202202 images : string [ ] ;
203203}
204+
205+ /** the response type of /api/pages/:projectname/search/titles */
206+ export interface SearchResult {
207+ /** 検索したprojectの名前 */
208+ projectName : string ;
209+ /** 検索文字列 */
210+ searchQuery : string ;
211+ /** 検索語句 */
212+ query : SearchQuery ;
213+ /** 検索件数の上限 */
214+ limit : number ;
215+ /** 検索件数 */
216+ count : number ;
217+ /** 検索文字列と完全一致するタイトルが見つかったら`true` */
218+ existsExactTitleMatch : boolean ;
219+ /** 全文検索エンジンの名前 */
220+ backend : string ;
221+ /** 見つかったページ */
222+ pages : {
223+ id : string ;
224+ title : string ;
225+ image : string ; // 無いときは''になる
226+ words : string [ ] ;
227+ lines : string [ ] ; //検索語句に一致した行。 タイトル行のみが一致した場合は、検索語句の有無にかかわらずその次の行のみが入る
228+ } [ ] ;
229+ }
230+
231+ /** 検索クエリ */
232+ export interface SearchQuery {
233+ /** AND検索に使う語句 */
234+ words : string [ ] ;
235+ /** NOT検索に使う語句 */
236+ excludes : string [ ] ;
237+ }
You can’t perform that action at this time.
0 commit comments