From ae317d1f11fef1906751670854f30de1b33f476a Mon Sep 17 00:00:00 2001 From: takker99 <37929109+takker99@users.noreply.github.com> Date: Fri, 25 Mar 2022 19:27:58 +0900 Subject: [PATCH] =?UTF-8?q?:+1:=20=E6=A8=AA=E6=96=AD=E6=A4=9C=E7=B4=A2?= =?UTF-8?q?=E7=94=A8=E3=81=AE=E5=9E=8B=E5=AE=9A=E7=BE=A9=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/response.ts | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/api/response.ts b/api/response.ts index 57a04aa..39c8000 100644 --- a/api/response.ts +++ b/api/response.ts @@ -220,11 +220,42 @@ export interface SearchResult { backend: string; /** 見つかったページ */ pages: { - id: string; + id: PageId; + /** page title */ title: string; - image: string; // 無いときは''になる + /** page thumbnail + * + * 無いときは空文字が入る + */ + image: string; + /** 検索語句の中で、このページに含まれている語句 */ words: string[]; - lines: string[]; //検索語句に一致した行。 タイトル行のみが一致した場合は、検索語句の有無にかかわらずその次の行のみが入る + /** 検索語句に一致した行 + * + * タイトル行のみが一致した場合は、検索語句の有無にかかわらずその次の行のみが入る + */ + lines: string[]; + }[]; +} + +/** the response type of /api/projects/search/query and /api/projects/search/watch-list */ +export interface ProjectSearchResult { + /** 検索文字列 */ + searchQuery: string; + /** 検索語句 */ + query: SearchQuery; + /** 見つかったprojects */ + projects: { + _id: ProjectId; + /** project name */ + name: string; + /** projectの表示名 */ + displayName: string; + /** project favicon + * + * 無いときは`null`が入るかproperty自体が存在しない + */ + image?: string | null; }[]; }