Skip to content

Commit 8baff88

Browse files
docs: translate comments to English in rest/table.ts and improve table API documentation
1 parent ee6c636 commit 8baff88

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

rest/table.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const getTable_fromResponse: GetTable["fromResponse"] = async (res) =>
4141
async (error) =>
4242
error.response.status === 404
4343
? {
44-
// responseが空文字の時があるので、自前で組み立てる
44+
// Build error manually since response may be an empty string
4545
name: "NotFoundError",
4646
message: "Table not found.",
4747
}
@@ -60,13 +60,13 @@ export type TableError =
6060
| HTTPError;
6161

6262
export interface GetTable {
63-
/** /api/table/:project/:title/:filename.csv の要求を組み立てる
63+
/** Build a request for /api/table/:project/:title/:filename.csv endpoint
6464
*
65-
* @param project 取得したいページのproject名
66-
* @param title 取得したいページのtitle 大文字小文字は問わない
67-
* @param filename テーブルの名前
68-
* @param options オプション
69-
* @return request
65+
* @param project Name of the project containing the target page
66+
* @param title Title of the page (case-insensitive)
67+
* @param filename Name of the table to retrieve
68+
* @param options Additional configuration options
69+
* @return request object
7070
*/
7171
toRequest: (
7272
project: string,
@@ -75,10 +75,10 @@ export interface GetTable {
7575
options?: BaseOptions,
7676
) => Request;
7777

78-
/** 帰ってきた応答からページのJSONデータを取得する
78+
/** Extract page JSON data from the response
7979
*
80-
* @param res 応答
81-
* @return ページのJSONデータ
80+
* @param res Response from the server
81+
* @return Page data in JSON format
8282
*/
8383
fromResponse: (res: Response) => Promise<Result<string, TableError>>;
8484

@@ -90,12 +90,12 @@ export interface GetTable {
9090
): Promise<Result<string, TableError | FetchError>>;
9191
}
9292

93-
/** 指定したテーブルをCSV形式で得る
93+
/** Retrieve a specified table in CSV format
9494
*
95-
* @param project 取得したいページのproject名
96-
* @param title 取得したいページのtitle 大文字小文字は問わない
97-
* @param filename テーブルの名前
98-
* @param options オプション
95+
* @param project Name of the project containing the target page
96+
* @param title Title of the page (case-insensitive)
97+
* @param filename Name of the table to retrieve
98+
* @param options Additional configuration options
9999
*/
100100
export const getTable: GetTable = /* @__PURE__ */ (() => {
101101
const fn: GetTable = async (

0 commit comments

Comments
 (0)