Skip to content

Commit ae317d1

Browse files
committed
👍 横断検索用の型定義を追加した
1 parent e2cc966 commit ae317d1

File tree

1 file changed

+34
-3
lines changed

1 file changed

+34
-3
lines changed

api/response.ts

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,11 +220,42 @@ export interface SearchResult {
220220
backend: string;
221221
/** 見つかったページ */
222222
pages: {
223-
id: string;
223+
id: PageId;
224+
/** page title */
224225
title: string;
225-
image: string; // 無いときは''になる
226+
/** page thumbnail
227+
*
228+
* 無いときは空文字が入る
229+
*/
230+
image: string;
231+
/** 検索語句の中で、このページに含まれている語句 */
226232
words: string[];
227-
lines: string[]; //検索語句に一致した行。 タイトル行のみが一致した場合は、検索語句の有無にかかわらずその次の行のみが入る
233+
/** 検索語句に一致した行
234+
*
235+
* タイトル行のみが一致した場合は、検索語句の有無にかかわらずその次の行のみが入る
236+
*/
237+
lines: string[];
238+
}[];
239+
}
240+
241+
/** the response type of /api/projects/search/query and /api/projects/search/watch-list */
242+
export interface ProjectSearchResult {
243+
/** 検索文字列 */
244+
searchQuery: string;
245+
/** 検索語句 */
246+
query: SearchQuery;
247+
/** 見つかったprojects */
248+
projects: {
249+
_id: ProjectId;
250+
/** project name */
251+
name: string;
252+
/** projectの表示名 */
253+
displayName: string;
254+
/** project favicon
255+
*
256+
* 無いときは`null`が入るかproperty自体が存在しない
257+
*/
258+
image?: string | null;
228259
}[];
229260
}
230261

0 commit comments

Comments
 (0)