Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions api/commits/project/pageId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,47 +68,47 @@ export type Change =
| CharsCountChange
| PinChange;

/** 既存の行を書き換える変更 */
/** change that rewrites an existing line */
export interface UpdateChange {
/** 書き換える行のID */
/** ID of the line to rewrite */
_update: LineId;

/** 行の変更内容 */
/** content changes of the line */
lines: ChangeLine;
}

/** ページ中のリンクが変更されると発生する */
/** occurs when links in a page are changed */
export interface LinksChange {
/** 新しいリンク */
/** new links */
links: string[];

/** 新しいリンク */
/** new links */
linksLc: StringLc[];
}

/** ページ中のproject linksが変更されると発生する */
/** occurs when project links in a page are changed */
export interface ProjectLinksChange {
/** 新しいリンク */
/** new links */
projectLinks: string[];

/** 新しいリンク */
/** new links */
projectLinksLc: StringLc[];
}

/** ページ中のiconsが変更されると発生する */
/** occurs when icons in a page are changed */
export interface IconsChange {
/** 新しいicons */
/** new icons */
icons: string[];

/** 新しいicons */
/** new icons */
iconsLc: StringLc[];
}

/** ページのタイトルが変更されると発生する */
/** occurs when the title of a page is changed */
export interface TitleChange {
/** 新しいタイトル */
/** new title */
title: string;

/** 新しいタイトル */
/** new title */
titleLc: StringLc;
}
10 changes: 5 additions & 5 deletions api/page-data/export/project.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import type { BaseLine, UnixTime } from "../../../base.ts";
import type { Page, UserInfo } from "../../pages/project/title.ts";

/** exportしたときのページデータ */
/** page data when exported */
export interface ExportedPage<hasMetadata extends true | false = false>
extends Pick<Page, "title" | "updated" | "created" | "id" | "views"> {
/** ページ本文
/** page content
*
* `hasMetadata === true`のときは行のmetadataが入る
* それ以外の場合は行のテキストが入る
* when `hasMetadata === true`, line metadata is included
* otherwise, line text is included
*/
lines: hasMetadata extends true ? Omit<BaseLine, "id">[] : string[];
}
Expand All @@ -20,7 +20,7 @@ export interface ExportedData<hasMetadata extends true | false = false> {
/** project's display name */
displayName: string;

/** このデータを生成した日時 (UNIX時刻) */
/** date and time when this data was generated (UNIX time) */
exported: UnixTime;

/** project members */
Expand Down
10 changes: 5 additions & 5 deletions api/page-data/import/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export interface ImportedData<hasMetadata extends true | false = false> {
pages: hasMetadata extends true ? ImportedPage[] : ImportedLightPage[];
}

/** メタデータ無しインポート用ページデータ */
/** import page data without metadata */
export interface ImportedLightPage {
/** page's title
*
Expand All @@ -20,18 +20,18 @@ export interface ImportedLightPage {
*/
lines: string[];
}
/** インポート用メタデータ付き行データ */
/** import line data with metadata */
export interface ImportedLine {
/** line text */
text: string;

/** 行の最終更新日時 (UNIX時刻) */
/** line last update date and time (UNIX time) */
updated?: UnixTime;

/** 行の最終作成日時 (UNIX時刻) */
/** line last creation date and time (UNIX time) */
created?: UnixTime;
}
/** メタデータ付きインポート用ページデータ */
/** import page data with metadata */
export interface ImportedPage {
/** page's title
*
Expand Down
6 changes: 3 additions & 3 deletions api/page-snapshots/project/pageId/timestampId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ export interface PageWithSnapshot extends BasePage {

/** a page snapshot */
export interface Snapshot {
/** snapshotを撮ったときのページタイトル */
/** page title when the snapshot was taken */
title: string;

/** snapshotの作成日時 */
/** snapshot creation date and time */
created: UnixTime;

/** snapshotしたページ本文 */
/** page content that was snapshotted */
lines: BaseLine[];
}
10 changes: 5 additions & 5 deletions api/pages/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ import type { PageId, UnixTime, UserId } from "../../base.ts";

/** the response type of https://scrpabox.io/api/pages/:projectname */
export interface PageList {
/** data取得先のproject名 */
/** project name from which data was retrieved */
projectName: string;

/** parameterに渡したskipと同じ */
/** same as skip passed in parameter */
skip: number;

/** parameterに渡したlimitと同じ */
/** same as limit passed in parameter */
limit: number;

/** projectの全ページ数 (中身のないページを除く) */
/** total number of pages in the project (excluding pages with no content) */
count: number;

/** 取得できたページ情報 */
/** page information that could be retrieved */
pages: PageSummary[];
}

Expand Down
4 changes: 2 additions & 2 deletions api/pages/project/search/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export interface SearchResult {
/** 検索したprojectの名前 */
projectName: string;

/** 検索文字列 */
/** search string */
searchQuery: string;

/** 検索語句 */
Expand All @@ -17,7 +17,7 @@ export interface SearchResult {
/** 検索件数 */
count: number;

/** 検索文字列と完全一致するタイトルが見つかったら`true` */
/** `true` if a title with exact match to the search string is found */
existsExactTitleMatch: boolean;

field: "title" | "helpfeels" | "lines";
Expand Down
2 changes: 1 addition & 1 deletion api/pages/project/search/watch-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { SearchQuery } from "./query.ts";

/** the response type of /api/projects/search/query and /api/projects/search/watch-list */
export interface ProjectSearchResult {
/** 検索文字列 */
/** search string */
searchQuery: string;

/** 検索語句 */
Expand Down
4 changes: 2 additions & 2 deletions api/pages/project/title.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export interface RelatedPages {
/** external links */
projectLinks1hop: ProjectRelatedPage[];

/** このページを参照しているページorアイコンがあればtrue */
/** true if there are pages or icons that reference this page */
hasBackLinksOrIcons: boolean;

/** 2 hop searchのquery */
Expand All @@ -210,7 +210,7 @@ export interface InfoboxResult {
truncated: boolean;
}

/** 関連ページのメタデータ */
/** related page metadata */
export interface RelatedPage extends
Pick<
BasePage,
Expand Down
8 changes: 4 additions & 4 deletions api/project-backup/project/backupId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import type { BaseLine, StringLc, UnixTime } from "../../../base.ts";
import type { UserForExport } from "../../page-data/export/project.ts";
import type { Page } from "../../pages/project/title.ts";

/** backupされるページデータ */
/** page data to be backed up */
export interface BackupedPage
extends Pick<Page, "title" | "updated" | "created" | "id" | "views"> {
/** ページ本文 */
/** page content */
lines: Pick<BaseLine, "text" | "created" | "updated" | "userId">[];

/** ページに含まれているリンク*/
/** links contained in the page */
linksLc: StringLc[];
}

Expand All @@ -20,7 +20,7 @@ export interface BackupData {
/** project's display name */
displayName: string;

/** このデータを生成した日時 (UNIX時刻) */
/** date and time when this data was generated (UNIX time) */
exported: UnixTime;

/** project members */
Expand Down
30 changes: 15 additions & 15 deletions base.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
/** scrapboxの行のメタデータ */
/** scrapbox line metadata */
export interface BaseLine {
id: LineId;

/** 行のテキスト */
/** text of the line */
text: string;

/** 一番最後に行を編集した人のid */
/** id of the user who last edited the line */
userId: UserId;

/** 行の作成日時 */
/** line creation date and time */
created: UnixTime;

/** 行の最終更新日時 */
/** line last update date and time */
updated: UnixTime;
}

/** basic information about a page */
export interface BasePage {
id: PageId;

/** 最新の編集コミットid */
/** latest edit commit id */
commitId: CommitId;

/** the title of a page */
Expand All @@ -37,29 +37,29 @@ export interface BasePage {
*/
descriptions: string[];

/** ピン留めの状態を表す数値
/** numeric value representing pin status
*
* - 0: ピンされてない
* - 0以外: ピンされている
* - 0: not pinned
* - non-zero: pinned
*/
pin: number;

/** ページの作成日時 */
/** page creation date and time */
created: UnixTime;

/** ページの最終更新日時 */
/** page last update date and time */
updated: UnixTime;

/** Date last visitedに使われる最終アクセス日時 */
/** last access date and time used for Date last visited */
accessed: UnixTime;

/** Page historyの最終生成日時 */
/** last generation date and time of page history */
snapshotCreated: UnixTime | null;

/** ページの閲覧回数 */
/** page view count */
views: number;

/** 被リンク数 */
/** number of incoming links */
linked: number;

/** page rank */
Expand Down
6 changes: 3 additions & 3 deletions blocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ export type Line =
/** section number */
number: number;

/** section開始行なら`true` */
/** `true` if section start line */
start: boolean;

/** section終了行なら`true` */
/** `true` if section end line */
end: boolean;
};
}
& ({
/** タイトル行だったときのみ生える */
/** appears only when it was a title line */
title?: true;
} | {
codeBlock: CodeBlock;
Expand Down
Loading