@interactive-inc/docs-client 0.0.10 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.d.ts +907 -1108
- package/build/index.js +2825 -2455
- package/build/models.d.ts +219 -113
- package/build/models.js +192 -80
- package/debug/debug.ts +40 -0
- package/package.json +1 -1
- package/PRODUCT.md +0 -108
package/build/index.d.ts
CHANGED
|
@@ -1,561 +1,300 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
export { zDocTreeDirectoryNode, zDocTreeFileNode, zDocTreeNode } from './models.js';
|
|
2
|
+
import { zDocClientConfig, zDocCustomSchemaField, zDocFilePath, zDocMetaFieldRelation, zDocMetaFieldMultiRelation, zDocMetaFieldText, zDocMetaFieldNumber, zDocMetaFieldBoolean, zDocMetaFieldMultiText, zDocMetaFieldMultiNumber, zDocMetaFieldMultiBoolean, zDocFileUnknown, zDocFileIndexSchemaField, zDocSchemaFieldText, zDocSchemaFieldNumber, zDocSchemaFieldBoolean, zDocSchemaFieldRelation, zDocSchemaFieldSelectText, zDocSchemaFieldSelectNumber, zDocSchemaFieldMultiText, zDocSchemaFieldMultiNumber, zDocSchemaFieldMultiRelation, zDocSchemaFieldMultiSelectText, zDocSchemaFieldMultiSelectNumber, zDocRelation, zDocRelationFile, zDocMetaField, zDocMetaFieldSelectText, zDocMetaFieldSelectNumber, zDocMetaFieldMultiSelectText, zDocMetaFieldMultiSelectNumber, zDocMetaFieldTypeText, zDocMetaFieldTypeNumber, zDocMetaFieldTypeBoolean, zDocMetaFieldTypeSelectText, zDocMetaFieldTypeSelectNumber, zDocMetaFieldTypeRelation, zDocMetaFieldType, zDocCustomSchemaFieldText, zDocCustomSchemaFieldNumber, zDocCustomSchemaFieldBoolean, zDocCustomSchemaFieldRelation, zDocCustomSchemaFieldSelectText, zDocCustomSchemaFieldSelectNumber, zDocCustomSchemaFieldMultiText, zDocCustomSchemaFieldMultiNumber, zDocCustomSchemaFieldMultiRelation, zDocCustomSchemaFieldMultiSelectText, zDocCustomSchemaFieldMultiSelectNumber, zDocRelationField } from './models.js';
|
|
3
|
+
export { zDocCustomSchema, zDocFile, zDocFileIndex, zDocFileIndexContent, zDocFileIndexMeta, zDocFileIndexSchema, zDocFileMd, zDocFileMdContent, zDocFileMdMeta, zDocMetaFieldTypeMultiNumber, zDocMetaFieldTypeMultiRelation, zDocMetaFieldTypeMultiSelectNumber, zDocMetaFieldTypeMultiSelectText, zDocMetaFieldTypeMultiText, zDocTreeDirectoryNode, zDocTreeFileNode, zDocTreeNode } from './models.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Path operations system
|
|
7
7
|
*/
|
|
8
8
|
declare class DocPathSystem {
|
|
9
|
-
|
|
9
|
+
readonly separator = "/";
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* Join paths
|
|
12
12
|
*/
|
|
13
13
|
join(...paths: string[]): string;
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* Get filename with extension
|
|
16
16
|
*/
|
|
17
17
|
basename(path: string, ext?: string): string;
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* Get directory name
|
|
20
20
|
*/
|
|
21
21
|
dirname(path: string): string;
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* Get extension
|
|
24
24
|
*/
|
|
25
25
|
extname(path: string): string;
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
27
|
+
* Calculate relative path
|
|
28
28
|
*/
|
|
29
29
|
relative(from: string, to: string): string;
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
31
|
+
* Convert to absolute path
|
|
32
32
|
*/
|
|
33
33
|
resolve(...paths: string[]): string;
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
35
|
+
* Normalize path
|
|
36
36
|
*/
|
|
37
37
|
normalize(path: string): string;
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
39
|
+
* Check if path is absolute
|
|
40
40
|
*/
|
|
41
41
|
isAbsolute(path: string): boolean;
|
|
42
|
-
/**
|
|
43
|
-
* パスのセパレータ
|
|
44
|
-
*/
|
|
45
|
-
get sep(): string;
|
|
46
42
|
}
|
|
47
43
|
|
|
48
44
|
type Props$9 = {
|
|
49
45
|
basePath: string;
|
|
50
|
-
pathSystem
|
|
46
|
+
pathSystem?: DocPathSystem;
|
|
51
47
|
};
|
|
52
48
|
/**
|
|
53
|
-
*
|
|
49
|
+
* File system wrapper
|
|
54
50
|
*/
|
|
55
51
|
declare class DocFileSystem {
|
|
56
52
|
private readonly basePath;
|
|
57
53
|
private readonly pathSystem;
|
|
58
54
|
constructor(props: Props$9);
|
|
59
55
|
/**
|
|
60
|
-
*
|
|
56
|
+
* Read file content at the specified path
|
|
61
57
|
*/
|
|
62
58
|
readFile(relativePath: string): Promise<string | null>;
|
|
63
59
|
/**
|
|
64
|
-
*
|
|
60
|
+
* Write content to file at the specified path (creates directory if needed)
|
|
65
61
|
*/
|
|
66
62
|
writeFile(relativePath: string, content: string): Promise<void>;
|
|
67
63
|
/**
|
|
68
|
-
*
|
|
64
|
+
* Delete file at the specified path
|
|
69
65
|
*/
|
|
70
66
|
deleteFile(relativePath: string): Promise<Error | null>;
|
|
71
67
|
/**
|
|
72
|
-
*
|
|
68
|
+
* Get file name from path
|
|
73
69
|
*/
|
|
74
70
|
readFileName(relativePath: string): string;
|
|
75
71
|
/**
|
|
76
|
-
*
|
|
72
|
+
* Get file extension from path
|
|
77
73
|
*/
|
|
78
74
|
readFileExtension(relativePath: string): string;
|
|
79
75
|
/**
|
|
80
|
-
*
|
|
76
|
+
* Get directory path where the file exists
|
|
81
77
|
*/
|
|
82
78
|
readFileDirectory(relativePath: string): string;
|
|
83
79
|
/**
|
|
84
|
-
*
|
|
80
|
+
* Get list of entries in directory
|
|
85
81
|
*/
|
|
86
82
|
readDirectoryFileNames(relativePath?: string): Promise<string[]>;
|
|
87
83
|
readDirectoryFilePaths(relativePath: string): Promise<string[]>;
|
|
88
84
|
/**
|
|
89
|
-
*
|
|
85
|
+
* Check if path is a directory
|
|
90
86
|
*/
|
|
91
87
|
isDirectory(relativePath: string): Promise<boolean>;
|
|
92
88
|
/**
|
|
93
|
-
*
|
|
89
|
+
* Check if path is a file
|
|
94
90
|
*/
|
|
95
91
|
isFile(relativePath: string): Promise<boolean>;
|
|
96
92
|
/**
|
|
97
|
-
*
|
|
93
|
+
* Check if file or directory exists
|
|
98
94
|
*/
|
|
99
95
|
exists(relativePath: string): Promise<boolean>;
|
|
100
96
|
/**
|
|
101
|
-
*
|
|
97
|
+
* Check if directory exists
|
|
102
98
|
*/
|
|
103
99
|
directoryExists(relativePath: string): Promise<boolean>;
|
|
104
100
|
/**
|
|
105
|
-
*
|
|
101
|
+
* Check if file exists
|
|
106
102
|
*/
|
|
107
103
|
fileExists(relativePath: string): Promise<boolean>;
|
|
108
104
|
/**
|
|
109
|
-
*
|
|
105
|
+
* Get base path
|
|
110
106
|
*/
|
|
111
107
|
getBasePath(): string;
|
|
112
108
|
/**
|
|
113
|
-
*
|
|
109
|
+
* Convert relative path to absolute path
|
|
114
110
|
*/
|
|
115
111
|
resolve(relativePath: string): string;
|
|
116
112
|
/**
|
|
117
|
-
*
|
|
113
|
+
* Create directory
|
|
118
114
|
*/
|
|
119
115
|
createDirectory(relativePath: string): Promise<void>;
|
|
120
116
|
/**
|
|
121
|
-
*
|
|
117
|
+
* Get file size in bytes
|
|
122
118
|
*/
|
|
123
119
|
getFileSize(relativePath: string): Promise<number>;
|
|
124
120
|
/**
|
|
125
|
-
*
|
|
121
|
+
* Create directory if it doesn't exist
|
|
126
122
|
*/
|
|
127
123
|
ensureDirectoryExists(relativePath: string): Promise<void>;
|
|
128
124
|
/**
|
|
129
|
-
*
|
|
125
|
+
* Copy file
|
|
130
126
|
*/
|
|
131
127
|
copyFile(sourcePath: string, destinationPath: string): Promise<void>;
|
|
132
128
|
/**
|
|
133
|
-
*
|
|
129
|
+
* Move file
|
|
134
130
|
*/
|
|
135
131
|
moveFile(sourcePath: string, destinationPath: string): Promise<void>;
|
|
136
132
|
/**
|
|
137
|
-
*
|
|
133
|
+
* Get file last modified time
|
|
138
134
|
*/
|
|
139
135
|
getFileModifiedTime(relativePath: string): Promise<Date>;
|
|
140
136
|
/**
|
|
141
|
-
*
|
|
137
|
+
* Get file creation time
|
|
142
138
|
*/
|
|
143
139
|
getFileCreatedTime(relativePath: string): Promise<Date>;
|
|
144
140
|
}
|
|
145
141
|
|
|
146
142
|
/**
|
|
147
|
-
*
|
|
148
|
-
* - ZodRecord: 動的なキーを持つ場合(デフォルト)
|
|
149
|
-
* - ZodObject: 固定されたキーを持つ場合(型安全)
|
|
150
|
-
*/
|
|
151
|
-
type FrontMatterSchema = z.ZodTypeAny;
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* スキーマフィールドで使用可能な型
|
|
155
|
-
*/
|
|
156
|
-
type FieldType = "text" | "number" | "boolean" | "multi-text" | "multi-number" | "multi-boolean" | "relation" | "multi-relation" | "select-text" | "select-number" | "multi-select-text" | "multi-select-number";
|
|
157
|
-
/**
|
|
158
|
-
* 文字列フィールドの型
|
|
159
|
-
*/
|
|
160
|
-
type DocSchemaFieldText = z.infer<typeof zDocSchemaFieldText>;
|
|
161
|
-
/**
|
|
162
|
-
* 数値フィールドの型
|
|
163
|
-
*/
|
|
164
|
-
type DocSchemaFieldNumber = z.infer<typeof zDocSchemaFieldNumber>;
|
|
165
|
-
/**
|
|
166
|
-
* ブールフィールドの型
|
|
167
|
-
*/
|
|
168
|
-
type DocSchemaFieldBoolean = z.infer<typeof zDocSchemaFieldBoolean>;
|
|
169
|
-
/**
|
|
170
|
-
* マルチテキストフィールドの型
|
|
171
|
-
*/
|
|
172
|
-
type DocFieldMultiText = z.infer<typeof zDocSchemaFieldMultiText>;
|
|
173
|
-
/**
|
|
174
|
-
* マルチ数値フィールドの型
|
|
175
|
-
*/
|
|
176
|
-
type DocFieldMultiNumber = z.infer<typeof zDocSchemaFieldMultiNumber>;
|
|
177
|
-
/**
|
|
178
|
-
* マルチブールフィールドの型
|
|
179
|
-
*/
|
|
180
|
-
type DocFieldMultiBoolean = z.infer<typeof zDocSchemaFieldMultiBoolean>;
|
|
181
|
-
/**
|
|
182
|
-
* リレーションフィールドの型
|
|
183
|
-
*/
|
|
184
|
-
type DocSchemaFieldRelation = z.infer<typeof zDocSchemaFieldRelation>;
|
|
185
|
-
/**
|
|
186
|
-
* マルチリレーションフィールドの型
|
|
187
|
-
*/
|
|
188
|
-
type DocFieldMultiRelation = z.infer<typeof zDocSchemaFieldMultiRelation>;
|
|
189
|
-
/**
|
|
190
|
-
* 選択テキストフィールドの型
|
|
191
|
-
*/
|
|
192
|
-
type DocSchemaFieldSelectText = z.infer<typeof zDocSchemaFieldSelectText>;
|
|
193
|
-
/**
|
|
194
|
-
* 選択数値フィールドの型
|
|
195
|
-
*/
|
|
196
|
-
type DocSchemaFieldSelectNumber = z.infer<typeof zDocSchemaFieldSelectNumber>;
|
|
197
|
-
/**
|
|
198
|
-
* マルチ選択テキストフィールドの型
|
|
199
|
-
*/
|
|
200
|
-
type DocSchemaFieldMultiSelectText = z.infer<typeof zDocSchemaFieldMultiSelectText>;
|
|
201
|
-
/**
|
|
202
|
-
* マルチ選択数値フィールドの型
|
|
203
|
-
*/
|
|
204
|
-
type DocSchemaFieldMultiSelectNumber = z.infer<typeof zDocSchemaFieldMultiSelectNumber>;
|
|
205
|
-
type DocFileMdFrontMatter = z.infer<typeof zDocFileMdFrontMatter>;
|
|
206
|
-
/**
|
|
207
|
-
* スキーマフィールドタイプの型
|
|
208
|
-
*/
|
|
209
|
-
type DocSchemaFieldType = z.infer<typeof zDocSchemaFieldType>;
|
|
210
|
-
/**
|
|
211
|
-
* スキーマフィールドの型
|
|
212
|
-
*/
|
|
213
|
-
type DocSchemaField = z.infer<typeof zDocSchemaField>;
|
|
214
|
-
/**
|
|
215
|
-
* スキーマ定義の型
|
|
216
|
-
*/
|
|
217
|
-
type DocSchemaRecord = z.infer<typeof zDocSchema>;
|
|
218
|
-
/**
|
|
219
|
-
* 最小限のスキーマフィールドの型
|
|
220
|
-
*/
|
|
221
|
-
type DocSchemaFieldMinimal = z.infer<typeof zDocSchemaFieldMinimal>;
|
|
222
|
-
/**
|
|
223
|
-
* 最小限のスキーマ定義の型
|
|
224
|
-
*/
|
|
225
|
-
type DocSchemaMinimal = z.infer<typeof zDocSchemaMinimal>;
|
|
226
|
-
/**
|
|
227
|
-
* リレーション型フィールドのUnion型
|
|
228
|
-
*/
|
|
229
|
-
type RelationFieldTypes = DocSchemaFieldRelation | DocFieldMultiRelation;
|
|
230
|
-
/**
|
|
231
|
-
* ファイルノードの型(ファイル専用)
|
|
232
|
-
*/
|
|
233
|
-
type DocTreeFileNode = {
|
|
234
|
-
type: "file";
|
|
235
|
-
name: string;
|
|
236
|
-
path: string;
|
|
237
|
-
icon: string;
|
|
238
|
-
title: string;
|
|
239
|
-
};
|
|
240
|
-
/**
|
|
241
|
-
* ディレクトリノードの型(ディレクトリ専用)
|
|
242
|
-
*/
|
|
243
|
-
type DocTreeDirectoryNode = {
|
|
244
|
-
type: "directory";
|
|
245
|
-
name: string;
|
|
246
|
-
path: string;
|
|
247
|
-
icon: string;
|
|
248
|
-
title: string;
|
|
249
|
-
children: DocTreeNode[];
|
|
250
|
-
};
|
|
251
|
-
/**
|
|
252
|
-
* ツリーノードの統合型
|
|
253
|
-
*/
|
|
254
|
-
type DocTreeNode = DocTreeFileNode | DocTreeDirectoryNode;
|
|
255
|
-
/**
|
|
256
|
-
* 後方互換性のためのエイリアス
|
|
257
|
-
*/
|
|
258
|
-
type DocFileNode = DocTreeNode;
|
|
259
|
-
/**
|
|
260
|
-
* インデックスファイルの型
|
|
261
|
-
*/
|
|
262
|
-
type DocFileIndex = z.infer<typeof zDocFileIndex>;
|
|
263
|
-
/**
|
|
264
|
-
* マークダウンファイル(index.md以外)の型
|
|
265
|
-
*/
|
|
266
|
-
type DocFileMd = z.infer<typeof zDocFileMd>;
|
|
267
|
-
/**
|
|
268
|
-
* その他のファイル(非マークダウン)の型
|
|
269
|
-
*/
|
|
270
|
-
type DocFileUnknown = z.infer<typeof zDocFileUnknown>;
|
|
271
|
-
/**
|
|
272
|
-
* ファイルのunion型(index.md、通常のmd、その他)
|
|
273
|
-
*/
|
|
274
|
-
type DocFile = z.infer<typeof zDocFile>;
|
|
275
|
-
/**
|
|
276
|
-
* ディレクトリFrontMatterの型
|
|
277
|
-
*/
|
|
278
|
-
type DocFileIndexFrontMatter = z.infer<typeof zDocFileIndexFrontMatter>;
|
|
279
|
-
/**
|
|
280
|
-
* リレーションオプションの型
|
|
281
|
-
*/
|
|
282
|
-
type DocRelationFile = z.infer<typeof zDocRelationFile>;
|
|
283
|
-
/**
|
|
284
|
-
* リレーション情報の型
|
|
285
|
-
*/
|
|
286
|
-
type DocRelation = z.infer<typeof zDocRelation>;
|
|
287
|
-
/**
|
|
288
|
-
* リレーションフィールドの型
|
|
289
|
-
*/
|
|
290
|
-
type DocRelationField = z.infer<typeof zDocRelationField>;
|
|
291
|
-
/**
|
|
292
|
-
* ファイルパス情報の型
|
|
293
|
-
*/
|
|
294
|
-
type DocFilePath = z.infer<typeof zDocFilePath>;
|
|
295
|
-
/**
|
|
296
|
-
* Markdownコンテンツ情報の型
|
|
297
|
-
*/
|
|
298
|
-
type DocFileContentMd = z.infer<typeof zDocFileContentMd>;
|
|
299
|
-
/**
|
|
300
|
-
* Indexファイルコンテンツ情報の型
|
|
301
|
-
*/
|
|
302
|
-
type DocFileContentIndex = z.infer<typeof zDocFileContentIndex>;
|
|
303
|
-
/**
|
|
304
|
-
* ディレクトリレスポンスの型(serverパッケージの型を再エクスポート)
|
|
305
|
-
*/
|
|
306
|
-
type DocDirectory = {
|
|
307
|
-
cwd: string;
|
|
308
|
-
indexFile: DocFileIndex;
|
|
309
|
-
files: DocFile[];
|
|
310
|
-
relations: DocRelation[];
|
|
311
|
-
};
|
|
312
|
-
|
|
313
|
-
/**
|
|
314
|
-
* リレーションファイル
|
|
315
|
-
*/
|
|
316
|
-
declare class DocRelationFileValue {
|
|
317
|
-
private readonly value;
|
|
318
|
-
constructor(value: DocRelationFile);
|
|
319
|
-
/**
|
|
320
|
-
* ファイルパス
|
|
321
|
-
*/
|
|
322
|
-
get id(): string;
|
|
323
|
-
/**
|
|
324
|
-
* スラッグ
|
|
325
|
-
*/
|
|
326
|
-
get slug(): string;
|
|
327
|
-
/**
|
|
328
|
-
* 表示用ラベル
|
|
329
|
-
*/
|
|
330
|
-
get label(): string;
|
|
331
|
-
/**
|
|
332
|
-
* ファイルパスとタイトルから生成
|
|
333
|
-
*/
|
|
334
|
-
static from(filePath: string, title: string | null): DocRelationFileValue;
|
|
335
|
-
/**
|
|
336
|
-
* ファイルパスからファイル名を抽出(拡張子なし)
|
|
337
|
-
*/
|
|
338
|
-
private static extractFileName;
|
|
339
|
-
/**
|
|
340
|
-
* JSON形式に変換
|
|
341
|
-
*/
|
|
342
|
-
toJson(): DocRelationFile;
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
/**
|
|
346
|
-
* リレーション情報を管理する
|
|
347
|
-
*/
|
|
348
|
-
declare class DocRelationValue {
|
|
349
|
-
readonly value: DocRelation;
|
|
350
|
-
constructor(value: DocRelation);
|
|
351
|
-
/**
|
|
352
|
-
* リレーションパス
|
|
353
|
-
*/
|
|
354
|
-
get path(): string;
|
|
355
|
-
/**
|
|
356
|
-
* リレーション対象ファイル一覧(値オブジェクト)
|
|
357
|
-
*/
|
|
358
|
-
get files(): DocRelationFileValue[];
|
|
359
|
-
/**
|
|
360
|
-
* ファイル数を取得
|
|
361
|
-
*/
|
|
362
|
-
get fileCount(): number;
|
|
363
|
-
/**
|
|
364
|
-
* 空かどうか
|
|
365
|
-
*/
|
|
366
|
-
get isEmpty(): boolean;
|
|
367
|
-
/**
|
|
368
|
-
* 空のリレーションエンティティを作成
|
|
369
|
-
*/
|
|
370
|
-
static empty(path: string): DocRelationValue;
|
|
371
|
-
/**
|
|
372
|
-
* JSON形式で出力
|
|
373
|
-
*/
|
|
374
|
-
toJson(): DocRelation;
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
type Props$8 = {
|
|
378
|
-
filePath: string;
|
|
379
|
-
fileSystem: DocFileSystem;
|
|
380
|
-
pathSystem: DocPathSystem;
|
|
381
|
-
};
|
|
382
|
-
/**
|
|
383
|
-
* リレーションファイルの参照
|
|
384
|
-
*/
|
|
385
|
-
declare class DocFileRelationReference {
|
|
386
|
-
private readonly props;
|
|
387
|
-
private readonly pathSystem;
|
|
388
|
-
constructor(props: Props$8);
|
|
389
|
-
get fileSystem(): DocFileSystem;
|
|
390
|
-
get basePath(): string;
|
|
391
|
-
/**
|
|
392
|
-
* リレーションパス
|
|
393
|
-
*/
|
|
394
|
-
get path(): string;
|
|
395
|
-
/**
|
|
396
|
-
* フルパス
|
|
397
|
-
*/
|
|
398
|
-
get fullPath(): string;
|
|
399
|
-
read(): Promise<DocRelationValue | null>;
|
|
400
|
-
/**
|
|
401
|
-
* リレーションファイルの一覧を読み込む
|
|
402
|
-
*/
|
|
403
|
-
readFiles(): Promise<DocRelationFileValue[]>;
|
|
404
|
-
/**
|
|
405
|
-
* 単一のリレーションファイルを読み込む
|
|
406
|
-
*/
|
|
407
|
-
readFile(filePath: string): Promise<DocRelationFileValue | null>;
|
|
408
|
-
/**
|
|
409
|
-
* ファイルの存在確認
|
|
410
|
-
*/
|
|
411
|
-
exists(slug: string): Promise<boolean>;
|
|
412
|
-
/**
|
|
413
|
-
* ファイル名の一覧を取得(拡張子なし)
|
|
414
|
-
*/
|
|
415
|
-
readSlugs(): Promise<string[]>;
|
|
416
|
-
/**
|
|
417
|
-
* ファイル数を取得
|
|
418
|
-
*/
|
|
419
|
-
count(): Promise<number>;
|
|
420
|
-
/**
|
|
421
|
-
* 空かどうかを確認
|
|
422
|
-
*/
|
|
423
|
-
isEmpty(): Promise<boolean>;
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
/**
|
|
427
|
-
* 動的にZodスキーマを生成するビルダー
|
|
143
|
+
* Single boolean type schema field
|
|
428
144
|
*/
|
|
429
|
-
declare class
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
145
|
+
declare class DocSchemaFieldBooleanSingleValue<T extends RecordKey> {
|
|
146
|
+
readonly key: T;
|
|
147
|
+
readonly value: DocSchemaFieldBoolean;
|
|
148
|
+
constructor(key: T, value: DocSchemaFieldBoolean);
|
|
149
|
+
get type(): "boolean";
|
|
150
|
+
get required(): boolean;
|
|
151
|
+
get title(): string;
|
|
152
|
+
get description(): string;
|
|
153
|
+
get default(): boolean | null;
|
|
154
|
+
readonly isArray = false;
|
|
155
|
+
readonly isSingle = true;
|
|
156
|
+
readonly isBoolean = true;
|
|
157
|
+
toJson(): DocFileIndexSchemaField;
|
|
434
158
|
/**
|
|
435
|
-
*
|
|
159
|
+
* Validate value type
|
|
436
160
|
*/
|
|
437
|
-
|
|
161
|
+
validate(value: unknown): boolean;
|
|
162
|
+
static empty(key: RecordKey): DocSchemaFieldBooleanSingleValue<RecordKey>;
|
|
163
|
+
static normalize(key: RecordKey, record: Record<RecordKey, unknown>): DocSchemaFieldBooleanSingleValue<RecordKey>;
|
|
438
164
|
}
|
|
439
165
|
|
|
440
166
|
/**
|
|
441
|
-
*
|
|
167
|
+
* Multiple number type schema field
|
|
442
168
|
*/
|
|
443
|
-
declare class
|
|
444
|
-
readonly key:
|
|
445
|
-
readonly value:
|
|
446
|
-
constructor(key:
|
|
447
|
-
get type(): "multi-
|
|
169
|
+
declare class DocSchemaFieldMultiNumberValue<T extends RecordKey> {
|
|
170
|
+
readonly key: T;
|
|
171
|
+
readonly value: DocFieldMultiNumber;
|
|
172
|
+
constructor(key: T, value: DocFieldMultiNumber);
|
|
173
|
+
get type(): "multi-number";
|
|
448
174
|
get required(): boolean;
|
|
449
175
|
get title(): string;
|
|
450
176
|
get description(): string;
|
|
451
|
-
get default():
|
|
452
|
-
get path(): string;
|
|
177
|
+
get default(): number[] | null;
|
|
453
178
|
readonly isArray = true;
|
|
454
179
|
readonly isSingle = false;
|
|
455
|
-
readonly
|
|
180
|
+
readonly isNumber = true;
|
|
456
181
|
/**
|
|
457
|
-
*
|
|
182
|
+
* Validate value
|
|
458
183
|
*/
|
|
459
184
|
validate(value: unknown): boolean;
|
|
460
|
-
toJson():
|
|
185
|
+
toJson(): DocFileIndexSchemaField;
|
|
186
|
+
static empty<T extends RecordKey>(key: T): DocSchemaFieldMultiNumberValue<T>;
|
|
187
|
+
static normalize(key: RecordKey, record: Record<RecordKey, unknown>): DocSchemaFieldMultiNumberValue<RecordKey>;
|
|
461
188
|
}
|
|
462
189
|
|
|
463
190
|
/**
|
|
464
|
-
*
|
|
191
|
+
* Multiple relation type schema field
|
|
465
192
|
*/
|
|
466
|
-
declare class
|
|
467
|
-
readonly key:
|
|
468
|
-
readonly value:
|
|
469
|
-
constructor(key:
|
|
470
|
-
get type(): "relation";
|
|
193
|
+
declare class DocSchemaFieldMultiRelationValue<T extends RecordKey> {
|
|
194
|
+
readonly key: T;
|
|
195
|
+
readonly value: DocFieldMultiRelation;
|
|
196
|
+
constructor(key: T, value: DocFieldMultiRelation);
|
|
197
|
+
get type(): "multi-relation";
|
|
471
198
|
get required(): boolean;
|
|
472
199
|
get title(): string;
|
|
473
200
|
get description(): string;
|
|
474
|
-
get default(): string | null;
|
|
201
|
+
get default(): string[] | null;
|
|
475
202
|
get path(): string;
|
|
476
|
-
readonly isArray =
|
|
477
|
-
readonly isSingle =
|
|
203
|
+
readonly isArray = true;
|
|
204
|
+
readonly isSingle = false;
|
|
478
205
|
readonly isRelation = true;
|
|
479
|
-
toJson(): DocSchemaField;
|
|
480
206
|
/**
|
|
481
|
-
*
|
|
207
|
+
* Validate value
|
|
482
208
|
*/
|
|
483
209
|
validate(value: unknown): boolean;
|
|
210
|
+
toJson(): DocFileIndexSchemaField;
|
|
211
|
+
static empty<T extends RecordKey>(key: T): DocSchemaFieldMultiRelationValue<T>;
|
|
212
|
+
static normalize(key: RecordKey, record: Record<RecordKey, unknown>): DocSchemaFieldMultiRelationValue<RecordKey>;
|
|
484
213
|
}
|
|
485
214
|
|
|
486
215
|
/**
|
|
487
|
-
*
|
|
216
|
+
* Multiple select number type schema field
|
|
488
217
|
*/
|
|
489
|
-
declare class
|
|
490
|
-
readonly key:
|
|
491
|
-
readonly value:
|
|
492
|
-
constructor(key:
|
|
493
|
-
get type(): "multi-
|
|
218
|
+
declare class DocSchemaFieldMultiSelectNumberValue<T extends RecordKey> {
|
|
219
|
+
readonly key: T;
|
|
220
|
+
readonly value: DocSchemaFieldMultiSelectNumber;
|
|
221
|
+
constructor(key: T, value: DocSchemaFieldMultiSelectNumber);
|
|
222
|
+
get type(): "multi-select-number";
|
|
494
223
|
get required(): boolean;
|
|
495
224
|
get title(): string;
|
|
496
225
|
get description(): string;
|
|
497
|
-
get default():
|
|
226
|
+
get default(): number[] | null;
|
|
227
|
+
get options(): number[];
|
|
498
228
|
readonly isArray = true;
|
|
499
229
|
readonly isSingle = false;
|
|
500
|
-
readonly
|
|
230
|
+
readonly isSelect = true;
|
|
231
|
+
readonly isNumberSelect = true;
|
|
501
232
|
/**
|
|
502
|
-
*
|
|
233
|
+
* Validate value
|
|
503
234
|
*/
|
|
504
235
|
validate(value: unknown): boolean;
|
|
505
|
-
toJson():
|
|
236
|
+
toJson(): DocFileIndexSchemaField;
|
|
237
|
+
static empty<T extends RecordKey>(key: T): DocSchemaFieldMultiSelectNumberValue<T>;
|
|
238
|
+
static normalize(key: RecordKey, record: Record<RecordKey, unknown>): DocSchemaFieldMultiSelectNumberValue<RecordKey>;
|
|
506
239
|
}
|
|
507
240
|
|
|
508
241
|
/**
|
|
509
|
-
*
|
|
242
|
+
* Multiple select text type schema field
|
|
510
243
|
*/
|
|
511
|
-
declare class
|
|
512
|
-
readonly key:
|
|
513
|
-
readonly value:
|
|
514
|
-
constructor(key:
|
|
515
|
-
get type(): "
|
|
244
|
+
declare class DocSchemaFieldMultiSelectTextValue<T extends RecordKey> {
|
|
245
|
+
readonly key: T;
|
|
246
|
+
readonly value: DocSchemaFieldMultiSelectText;
|
|
247
|
+
constructor(key: T, value: DocSchemaFieldMultiSelectText);
|
|
248
|
+
get type(): "multi-select-text";
|
|
516
249
|
get required(): boolean;
|
|
517
250
|
get title(): string;
|
|
518
251
|
get description(): string;
|
|
519
|
-
get default():
|
|
520
|
-
|
|
521
|
-
readonly
|
|
522
|
-
readonly
|
|
523
|
-
|
|
252
|
+
get default(): string[] | null;
|
|
253
|
+
get options(): string[];
|
|
254
|
+
readonly isArray = true;
|
|
255
|
+
readonly isSingle = false;
|
|
256
|
+
readonly isSelect = true;
|
|
257
|
+
readonly isTextSelect = true;
|
|
524
258
|
/**
|
|
525
|
-
*
|
|
259
|
+
* Validate value
|
|
526
260
|
*/
|
|
527
261
|
validate(value: unknown): boolean;
|
|
262
|
+
toJson(): DocFileIndexSchemaField;
|
|
263
|
+
static empty<T extends RecordKey>(key: T): DocSchemaFieldMultiSelectTextValue<T>;
|
|
264
|
+
static normalize(key: RecordKey, record: Record<RecordKey, unknown>): DocSchemaFieldMultiSelectTextValue<RecordKey>;
|
|
528
265
|
}
|
|
529
266
|
|
|
530
267
|
/**
|
|
531
|
-
*
|
|
268
|
+
* Multiple text type schema field
|
|
532
269
|
*/
|
|
533
|
-
declare class
|
|
534
|
-
readonly key:
|
|
535
|
-
readonly value:
|
|
536
|
-
constructor(key:
|
|
537
|
-
get type(): "multi-
|
|
270
|
+
declare class DocSchemaFieldMultiTextValue<T extends RecordKey> {
|
|
271
|
+
readonly key: T;
|
|
272
|
+
readonly value: DocFieldMultiText;
|
|
273
|
+
constructor(key: T, value: DocFieldMultiText);
|
|
274
|
+
get type(): "multi-text";
|
|
538
275
|
get required(): boolean;
|
|
539
276
|
get title(): string;
|
|
540
277
|
get description(): string;
|
|
541
|
-
get default():
|
|
278
|
+
get default(): string[] | null;
|
|
542
279
|
readonly isArray = true;
|
|
543
280
|
readonly isSingle = false;
|
|
544
|
-
readonly
|
|
281
|
+
readonly isText = true;
|
|
282
|
+
toJson(): DocFileIndexSchemaField;
|
|
545
283
|
/**
|
|
546
|
-
*
|
|
284
|
+
* Validate value type
|
|
547
285
|
*/
|
|
548
286
|
validate(value: unknown): boolean;
|
|
549
|
-
|
|
287
|
+
static empty<T extends RecordKey>(key: T): DocSchemaFieldMultiTextValue<T>;
|
|
288
|
+
static normalize(key: RecordKey, record: Record<RecordKey, unknown>): DocSchemaFieldMultiTextValue<RecordKey>;
|
|
550
289
|
}
|
|
551
290
|
|
|
552
291
|
/**
|
|
553
|
-
*
|
|
292
|
+
* Single number type schema field
|
|
554
293
|
*/
|
|
555
|
-
declare class DocSchemaFieldNumberSingleValue {
|
|
556
|
-
readonly key:
|
|
294
|
+
declare class DocSchemaFieldNumberSingleValue<T extends RecordKey> {
|
|
295
|
+
readonly key: T;
|
|
557
296
|
readonly value: DocSchemaFieldNumber;
|
|
558
|
-
constructor(key:
|
|
297
|
+
constructor(key: T, value: DocSchemaFieldNumber);
|
|
559
298
|
get type(): "number";
|
|
560
299
|
get required(): boolean;
|
|
561
300
|
get title(): string;
|
|
@@ -564,44 +303,47 @@ declare class DocSchemaFieldNumberSingleValue {
|
|
|
564
303
|
readonly isArray = false;
|
|
565
304
|
readonly isSingle = true;
|
|
566
305
|
readonly isNumber = true;
|
|
567
|
-
toJson():
|
|
306
|
+
toJson(): DocFileIndexSchemaField;
|
|
568
307
|
/**
|
|
569
|
-
*
|
|
308
|
+
* Validate value type
|
|
570
309
|
*/
|
|
571
310
|
validate(value: unknown): boolean;
|
|
311
|
+
static empty(key: RecordKey): DocSchemaFieldNumberSingleValue<RecordKey>;
|
|
312
|
+
static normalize(key: RecordKey, record: Record<RecordKey, unknown>): DocSchemaFieldNumberSingleValue<RecordKey>;
|
|
572
313
|
}
|
|
573
314
|
|
|
574
315
|
/**
|
|
575
|
-
*
|
|
316
|
+
* Single relation type schema field
|
|
576
317
|
*/
|
|
577
|
-
declare class
|
|
578
|
-
readonly key:
|
|
579
|
-
readonly value:
|
|
580
|
-
constructor(key:
|
|
581
|
-
get type(): "
|
|
318
|
+
declare class DocSchemaFieldRelationSingleValue<T extends RecordKey> {
|
|
319
|
+
readonly key: T;
|
|
320
|
+
readonly value: DocSchemaFieldRelation;
|
|
321
|
+
constructor(key: T, value: DocSchemaFieldRelation);
|
|
322
|
+
get type(): "relation";
|
|
582
323
|
get required(): boolean;
|
|
583
324
|
get title(): string;
|
|
584
325
|
get description(): string;
|
|
585
|
-
get default():
|
|
586
|
-
get
|
|
587
|
-
readonly isArray =
|
|
588
|
-
readonly isSingle =
|
|
589
|
-
readonly
|
|
590
|
-
|
|
326
|
+
get default(): string | null;
|
|
327
|
+
get path(): string;
|
|
328
|
+
readonly isArray = false;
|
|
329
|
+
readonly isSingle = true;
|
|
330
|
+
readonly isRelation = true;
|
|
331
|
+
toJson(): DocFileIndexSchemaField;
|
|
591
332
|
/**
|
|
592
|
-
*
|
|
333
|
+
* Validate value type
|
|
593
334
|
*/
|
|
594
335
|
validate(value: unknown): boolean;
|
|
595
|
-
|
|
336
|
+
static empty(key: RecordKey): DocSchemaFieldRelationSingleValue<RecordKey>;
|
|
337
|
+
static normalize(key: RecordKey, record: Record<RecordKey, unknown>): DocSchemaFieldRelationSingleValue<RecordKey>;
|
|
596
338
|
}
|
|
597
339
|
|
|
598
340
|
/**
|
|
599
|
-
*
|
|
341
|
+
* Single select number type schema field
|
|
600
342
|
*/
|
|
601
|
-
declare class DocSchemaFieldSelectNumberSingleValue {
|
|
602
|
-
readonly key:
|
|
343
|
+
declare class DocSchemaFieldSelectNumberSingleValue<T extends RecordKey> {
|
|
344
|
+
readonly key: T;
|
|
603
345
|
readonly value: DocSchemaFieldSelectNumber;
|
|
604
|
-
constructor(key:
|
|
346
|
+
constructor(key: T, value: DocSchemaFieldSelectNumber);
|
|
605
347
|
get type(): "select-number";
|
|
606
348
|
get required(): boolean;
|
|
607
349
|
get title(): string;
|
|
@@ -613,648 +355,881 @@ declare class DocSchemaFieldSelectNumberSingleValue {
|
|
|
613
355
|
readonly isSelect = true;
|
|
614
356
|
readonly isNumberSelect = true;
|
|
615
357
|
/**
|
|
616
|
-
*
|
|
358
|
+
* Validate value
|
|
617
359
|
*/
|
|
618
360
|
validate(value: unknown): boolean;
|
|
619
|
-
toJson():
|
|
361
|
+
toJson(): DocFileIndexSchemaField;
|
|
362
|
+
static empty<T extends RecordKey>(key: T): DocSchemaFieldSelectNumberSingleValue<T>;
|
|
363
|
+
static normalize(key: RecordKey, record: Record<RecordKey, unknown>): DocSchemaFieldSelectNumberSingleValue<RecordKey>;
|
|
620
364
|
}
|
|
621
365
|
|
|
622
366
|
/**
|
|
623
|
-
*
|
|
367
|
+
* Single select text type schema field
|
|
624
368
|
*/
|
|
625
|
-
declare class
|
|
626
|
-
readonly key:
|
|
627
|
-
readonly value:
|
|
628
|
-
constructor(key:
|
|
629
|
-
get type(): "
|
|
369
|
+
declare class DocSchemaFieldSelectTextSingleValue<T extends RecordKey> {
|
|
370
|
+
readonly key: T;
|
|
371
|
+
readonly value: DocSchemaFieldSelectText;
|
|
372
|
+
constructor(key: T, value: DocSchemaFieldSelectText);
|
|
373
|
+
get type(): "select-text";
|
|
630
374
|
get required(): boolean;
|
|
631
375
|
get title(): string;
|
|
632
376
|
get description(): string;
|
|
633
|
-
get default(): string
|
|
377
|
+
get default(): string | null;
|
|
634
378
|
get options(): string[];
|
|
635
|
-
readonly isArray =
|
|
636
|
-
readonly isSingle =
|
|
379
|
+
readonly isArray = false;
|
|
380
|
+
readonly isSingle = true;
|
|
637
381
|
readonly isSelect = true;
|
|
638
382
|
readonly isTextSelect = true;
|
|
383
|
+
toJson(): DocFileIndexSchemaField;
|
|
384
|
+
/**
|
|
385
|
+
* Validate value type
|
|
386
|
+
*/
|
|
387
|
+
validate(value: unknown): boolean;
|
|
388
|
+
static empty<T extends RecordKey>(key: T): DocSchemaFieldSelectTextSingleValue<T>;
|
|
389
|
+
static normalize(key: RecordKey, record: Record<RecordKey, unknown>): DocSchemaFieldSelectTextSingleValue<RecordKey>;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
* Single text type schema field
|
|
394
|
+
*/
|
|
395
|
+
declare class DocSchemaFieldTextSingleValue<T extends RecordKey> {
|
|
396
|
+
readonly key: T;
|
|
397
|
+
readonly value: DocSchemaFieldText;
|
|
398
|
+
constructor(key: T, value: DocSchemaFieldText);
|
|
399
|
+
get type(): "text";
|
|
400
|
+
get required(): boolean;
|
|
401
|
+
get title(): string;
|
|
402
|
+
get description(): string;
|
|
403
|
+
get default(): string | null;
|
|
404
|
+
readonly isArray = false;
|
|
405
|
+
readonly isSingle = true;
|
|
406
|
+
readonly isText = true;
|
|
407
|
+
toJson(): DocFileIndexSchemaField;
|
|
639
408
|
/**
|
|
640
|
-
*
|
|
409
|
+
* Validate value type
|
|
641
410
|
*/
|
|
642
411
|
validate(value: unknown): boolean;
|
|
643
|
-
|
|
412
|
+
static empty(key: RecordKey): DocSchemaFieldTextSingleValue<RecordKey>;
|
|
413
|
+
static normalize(key: RecordKey, record: Record<RecordKey, unknown>): DocSchemaFieldTextSingleValue<RecordKey>;
|
|
644
414
|
}
|
|
645
415
|
|
|
646
416
|
/**
|
|
647
|
-
*
|
|
417
|
+
* Text field type
|
|
418
|
+
*/
|
|
419
|
+
type DocSchemaFieldText = z.infer<typeof zDocSchemaFieldText>;
|
|
420
|
+
/**
|
|
421
|
+
* Number field type
|
|
422
|
+
*/
|
|
423
|
+
type DocSchemaFieldNumber = z.infer<typeof zDocSchemaFieldNumber>;
|
|
424
|
+
/**
|
|
425
|
+
* Boolean field type
|
|
426
|
+
*/
|
|
427
|
+
type DocSchemaFieldBoolean = z.infer<typeof zDocSchemaFieldBoolean>;
|
|
428
|
+
/**
|
|
429
|
+
* Multi-text field type
|
|
430
|
+
*/
|
|
431
|
+
type DocFieldMultiText = z.infer<typeof zDocSchemaFieldMultiText>;
|
|
432
|
+
/**
|
|
433
|
+
* Multi-number field type
|
|
434
|
+
*/
|
|
435
|
+
type DocFieldMultiNumber = z.infer<typeof zDocSchemaFieldMultiNumber>;
|
|
436
|
+
/**
|
|
437
|
+
* Relation field type
|
|
438
|
+
*/
|
|
439
|
+
type DocSchemaFieldRelation = z.infer<typeof zDocSchemaFieldRelation>;
|
|
440
|
+
/**
|
|
441
|
+
* Multi-relation field type
|
|
442
|
+
*/
|
|
443
|
+
type DocFieldMultiRelation = z.infer<typeof zDocSchemaFieldMultiRelation>;
|
|
444
|
+
/**
|
|
445
|
+
* Select text field type
|
|
446
|
+
*/
|
|
447
|
+
type DocSchemaFieldSelectText = z.infer<typeof zDocSchemaFieldSelectText>;
|
|
448
|
+
/**
|
|
449
|
+
* Select number field type
|
|
450
|
+
*/
|
|
451
|
+
type DocSchemaFieldSelectNumber = z.infer<typeof zDocSchemaFieldSelectNumber>;
|
|
452
|
+
/**
|
|
453
|
+
* Multi-select text field type
|
|
454
|
+
*/
|
|
455
|
+
type DocSchemaFieldMultiSelectText = z.infer<typeof zDocSchemaFieldMultiSelectText>;
|
|
456
|
+
/**
|
|
457
|
+
* Multi-select number field type
|
|
458
|
+
*/
|
|
459
|
+
type DocSchemaFieldMultiSelectNumber = z.infer<typeof zDocSchemaFieldMultiSelectNumber>;
|
|
460
|
+
type DocMetaField = z.infer<typeof zDocMetaField>;
|
|
461
|
+
type DocMetaFieldText = z.infer<typeof zDocMetaFieldText>;
|
|
462
|
+
type DocMetaFieldNumber = z.infer<typeof zDocMetaFieldNumber>;
|
|
463
|
+
type DocMetaFieldBoolean = z.infer<typeof zDocMetaFieldBoolean>;
|
|
464
|
+
type DocMetaFieldSelectText = z.infer<typeof zDocMetaFieldSelectText>;
|
|
465
|
+
type DocMetaFieldSelectNumber = z.infer<typeof zDocMetaFieldSelectNumber>;
|
|
466
|
+
type DocMetaFieldRelation = z.infer<typeof zDocMetaFieldRelation>;
|
|
467
|
+
type DocMetaFieldMultiText = z.infer<typeof zDocMetaFieldMultiText>;
|
|
468
|
+
type DocMetaFieldMultiNumber = z.infer<typeof zDocMetaFieldMultiNumber>;
|
|
469
|
+
type DocMetaFieldMultiBoolean = z.infer<typeof zDocMetaFieldMultiBoolean>;
|
|
470
|
+
type DocMetaFieldMultiSelectText = z.infer<typeof zDocMetaFieldMultiSelectText>;
|
|
471
|
+
type DocMetaFieldMultiSelectNumber = z.infer<typeof zDocMetaFieldMultiSelectNumber>;
|
|
472
|
+
type DocMetaFieldMultiRelation = z.infer<typeof zDocMetaFieldMultiRelation>;
|
|
473
|
+
type DocFileMdMeta<T extends RecordKey> = Record<T, DocMetaField>;
|
|
474
|
+
type DocMetaFieldTypeText = z.infer<typeof zDocMetaFieldTypeText>;
|
|
475
|
+
type DocMetaFieldTypeNumber = z.infer<typeof zDocMetaFieldTypeNumber>;
|
|
476
|
+
type DocMetaFieldTypeBoolean = z.infer<typeof zDocMetaFieldTypeBoolean>;
|
|
477
|
+
type DocMetaFieldTypeSelectText = z.infer<typeof zDocMetaFieldTypeSelectText>;
|
|
478
|
+
type DocMetaFieldTypeSelectNumber = z.infer<typeof zDocMetaFieldTypeSelectNumber>;
|
|
479
|
+
type DocMetaFieldTypeRelation = z.infer<typeof zDocMetaFieldTypeRelation>;
|
|
480
|
+
/**
|
|
481
|
+
* Schema field type
|
|
482
|
+
*/
|
|
483
|
+
type DocMetaFieldType = z.infer<typeof zDocMetaFieldType>;
|
|
484
|
+
type DocCustomSchemaFieldText = z.infer<typeof zDocCustomSchemaFieldText>;
|
|
485
|
+
type DocCustomSchemaFieldNumber = z.infer<typeof zDocCustomSchemaFieldNumber>;
|
|
486
|
+
type DocCustomSchemaFieldBoolean = z.infer<typeof zDocCustomSchemaFieldBoolean>;
|
|
487
|
+
type DocCustomSchemaFieldRelation = z.infer<typeof zDocCustomSchemaFieldRelation>;
|
|
488
|
+
type DocCustomSchemaFieldSelectText = z.infer<typeof zDocCustomSchemaFieldSelectText>;
|
|
489
|
+
type DocCustomSchemaFieldSelectNumber = z.infer<typeof zDocCustomSchemaFieldSelectNumber>;
|
|
490
|
+
type DocCustomSchemaFieldMultiText = z.infer<typeof zDocCustomSchemaFieldMultiText>;
|
|
491
|
+
type DocCustomSchemaFieldMultiNumber = z.infer<typeof zDocCustomSchemaFieldMultiNumber>;
|
|
492
|
+
type DocCustomSchemaFieldMultiRelation = z.infer<typeof zDocCustomSchemaFieldMultiRelation>;
|
|
493
|
+
type DocCustomSchemaFieldMultiSelectText = z.infer<typeof zDocCustomSchemaFieldMultiSelectText>;
|
|
494
|
+
type DocCustomSchemaFieldMultiSelectNumber = z.infer<typeof zDocCustomSchemaFieldMultiSelectNumber>;
|
|
495
|
+
/**
|
|
496
|
+
* Schema field type
|
|
497
|
+
*/
|
|
498
|
+
type DocFileIndexSchemaField = z.infer<typeof zDocFileIndexSchemaField>;
|
|
499
|
+
/**
|
|
500
|
+
* Schema definition type
|
|
501
|
+
*/
|
|
502
|
+
type DocFileIndexSchema<T extends RecordKey> = Record<T, DocFileIndexSchemaField>;
|
|
503
|
+
/**
|
|
504
|
+
* Schema field to override
|
|
505
|
+
* ex: { xxx: { type: "text", required: true } }
|
|
506
|
+
*/
|
|
507
|
+
type DocCustomSchemaField = z.infer<typeof zDocCustomSchemaField>;
|
|
508
|
+
/**
|
|
509
|
+
* Minimal schema definition type
|
|
510
|
+
*/
|
|
511
|
+
type DocCustomSchema<T extends RecordKey = RecordKey> = Record<T, DocCustomSchemaField>;
|
|
512
|
+
/**
|
|
513
|
+
* Union type for relation fields
|
|
514
|
+
*/
|
|
515
|
+
type DocSchemaRelationFieldUnion = DocSchemaFieldRelation | DocFieldMultiRelation;
|
|
516
|
+
/**
|
|
517
|
+
* File node type (for files only)
|
|
518
|
+
*/
|
|
519
|
+
type DocTreeFileNode = {
|
|
520
|
+
type: "file";
|
|
521
|
+
name: string;
|
|
522
|
+
path: string;
|
|
523
|
+
icon: string;
|
|
524
|
+
title: string;
|
|
525
|
+
};
|
|
526
|
+
/**
|
|
527
|
+
* Directory node type (for directories only)
|
|
528
|
+
*/
|
|
529
|
+
type DocTreeDirectoryNode = {
|
|
530
|
+
type: "directory";
|
|
531
|
+
name: string;
|
|
532
|
+
path: string;
|
|
533
|
+
icon: string;
|
|
534
|
+
title: string;
|
|
535
|
+
children: DocTreeNode[];
|
|
536
|
+
};
|
|
537
|
+
/**
|
|
538
|
+
* Unified tree node type
|
|
539
|
+
*/
|
|
540
|
+
type DocTreeNode = DocTreeFileNode | DocTreeDirectoryNode;
|
|
541
|
+
/**
|
|
542
|
+
* Alias for backward compatibility
|
|
543
|
+
*/
|
|
544
|
+
type DocFileNode = DocTreeNode;
|
|
545
|
+
/**
|
|
546
|
+
* Index file type
|
|
547
|
+
*/
|
|
548
|
+
type DocFileIndex<T extends DocCustomSchema> = {
|
|
549
|
+
type: "index";
|
|
550
|
+
path: DocFilePath;
|
|
551
|
+
isArchived: boolean;
|
|
552
|
+
content: DocFileIndexContent<T>;
|
|
553
|
+
};
|
|
554
|
+
/**
|
|
555
|
+
* Test helper types
|
|
556
|
+
*/
|
|
557
|
+
/**
|
|
558
|
+
* Type to check if two types are equal
|
|
559
|
+
*/
|
|
560
|
+
type Equals<T, U> = (<G>() => G extends T ? 1 : 2) extends <G>() => G extends U ? 1 : 2 ? true : false;
|
|
561
|
+
/**
|
|
562
|
+
* Extract relation field keys from schema
|
|
563
|
+
*/
|
|
564
|
+
type RelationKeys<T extends DocCustomSchema> = {
|
|
565
|
+
[K in keyof T]: T[K]["type"] extends "relation" ? K : never;
|
|
566
|
+
}[keyof T];
|
|
567
|
+
/**
|
|
568
|
+
* Extract multi-relation field keys from schema
|
|
569
|
+
*/
|
|
570
|
+
type MultiRelationKeys<T extends DocCustomSchema> = {
|
|
571
|
+
[K in keyof T]: T[K]["type"] extends "multi-relation" ? K : never;
|
|
572
|
+
}[keyof T];
|
|
573
|
+
/**
|
|
574
|
+
* Markdown file type (excluding index.md)
|
|
575
|
+
*/
|
|
576
|
+
type DocFileMd<T extends DocCustomSchema> = {
|
|
577
|
+
type: "markdown";
|
|
578
|
+
path: DocFilePath;
|
|
579
|
+
isArchived: boolean;
|
|
580
|
+
content: DocFileMdContent<T>;
|
|
581
|
+
};
|
|
582
|
+
/**
|
|
583
|
+
* Other file type (non-markdown)
|
|
584
|
+
*/
|
|
585
|
+
type DocFileUnknown = z.infer<typeof zDocFileUnknown>;
|
|
586
|
+
/**
|
|
587
|
+
* File union type (index.md, regular md, other)
|
|
588
|
+
*/
|
|
589
|
+
type DocFile<T extends DocCustomSchema> = DocFileIndex<T> | DocFileMd<T> | DocFileUnknown;
|
|
590
|
+
/**
|
|
591
|
+
* Directory FrontMatter type
|
|
592
|
+
*/
|
|
593
|
+
type DocFileIndexMeta<T extends DocCustomSchema> = {
|
|
594
|
+
type: "index-meta";
|
|
595
|
+
icon: string | null;
|
|
596
|
+
schema: DocFileIndexSchema<keyof T>;
|
|
597
|
+
};
|
|
598
|
+
/**
|
|
599
|
+
* Relation options type
|
|
600
|
+
*/
|
|
601
|
+
type DocRelationFile = z.infer<typeof zDocRelationFile>;
|
|
602
|
+
/**
|
|
603
|
+
* Relation information type
|
|
604
|
+
*/
|
|
605
|
+
type DocRelation = z.infer<typeof zDocRelation>;
|
|
606
|
+
/**
|
|
607
|
+
* Relation field type
|
|
608
|
+
*/
|
|
609
|
+
type DocRelationField = z.infer<typeof zDocRelationField>;
|
|
610
|
+
/**
|
|
611
|
+
* File path information type
|
|
648
612
|
*/
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
613
|
+
type DocFilePath = z.infer<typeof zDocFilePath>;
|
|
614
|
+
type DocSchemaFieldTypeText = z.infer<typeof zDocSchemaFieldText>;
|
|
615
|
+
type DocSchemaFieldTypeNumber = z.infer<typeof zDocSchemaFieldNumber>;
|
|
616
|
+
type DocSchemaFieldTypeBoolean = z.infer<typeof zDocSchemaFieldBoolean>;
|
|
617
|
+
type DocSchemaFieldTypeMultiText = z.infer<typeof zDocSchemaFieldMultiText>;
|
|
618
|
+
type DocSchemaFieldTypeMultiNumber = z.infer<typeof zDocSchemaFieldMultiNumber>;
|
|
619
|
+
type DocSchemaFieldTypeRelation = z.infer<typeof zDocSchemaFieldRelation>;
|
|
620
|
+
type DocSchemaFieldTypeMultiRelation = z.infer<typeof zDocSchemaFieldMultiRelation>;
|
|
621
|
+
type DocSchemaFieldTypeSelectText = z.infer<typeof zDocSchemaFieldSelectText>;
|
|
622
|
+
type DocSchemaFieldTypeSelectNumber = z.infer<typeof zDocSchemaFieldSelectNumber>;
|
|
623
|
+
type DocSchemaFieldTypeMultiSelectText = z.infer<typeof zDocSchemaFieldMultiSelectText>;
|
|
624
|
+
type DocSchemaFieldTypeMultiSelectNumber = z.infer<typeof zDocSchemaFieldMultiSelectNumber>;
|
|
625
|
+
/**
|
|
626
|
+
* Markdown content information type
|
|
627
|
+
*/
|
|
628
|
+
type DocFileMdContent<T extends DocCustomSchema> = {
|
|
629
|
+
type: "markdown-content";
|
|
630
|
+
body: string;
|
|
631
|
+
title: string;
|
|
632
|
+
description: string;
|
|
633
|
+
meta: SchemaToValueType<T>;
|
|
634
|
+
};
|
|
670
635
|
/**
|
|
671
|
-
*
|
|
636
|
+
* Index file content information type
|
|
672
637
|
*/
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
get description(): string;
|
|
681
|
-
get default(): string[] | null;
|
|
682
|
-
readonly isArray = true;
|
|
683
|
-
readonly isSingle = false;
|
|
684
|
-
readonly isText = true;
|
|
685
|
-
toJson(): DocSchemaField;
|
|
686
|
-
/**
|
|
687
|
-
* 値の型を検証する
|
|
688
|
-
*/
|
|
689
|
-
validate(value: unknown): boolean;
|
|
690
|
-
}
|
|
691
|
-
|
|
638
|
+
type DocFileIndexContent<T extends DocCustomSchema> = {
|
|
639
|
+
type: "markdown-index";
|
|
640
|
+
body: string;
|
|
641
|
+
title: string;
|
|
642
|
+
description: string;
|
|
643
|
+
meta: DocFileIndexMeta<T>;
|
|
644
|
+
};
|
|
692
645
|
/**
|
|
693
|
-
*
|
|
646
|
+
* Directory response type (re-export from server package)
|
|
694
647
|
*/
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
readonly isText = true;
|
|
707
|
-
toJson(): DocSchemaField;
|
|
708
|
-
/**
|
|
709
|
-
* 値の型を検証する
|
|
710
|
-
*/
|
|
711
|
-
validate(value: unknown): boolean;
|
|
712
|
-
}
|
|
713
|
-
|
|
648
|
+
type DocDirectory<T extends DocCustomSchema> = {
|
|
649
|
+
cwd: string;
|
|
650
|
+
indexFile: DocFileIndex<T>;
|
|
651
|
+
files: DocFile<T>[];
|
|
652
|
+
relations: DocRelation[];
|
|
653
|
+
};
|
|
654
|
+
type RecordKey = string | number | symbol;
|
|
655
|
+
/**
|
|
656
|
+
* DocClient configuration
|
|
657
|
+
*/
|
|
658
|
+
type DocClientConfig = z.infer<typeof zDocClientConfig>;
|
|
714
659
|
/**
|
|
715
|
-
*
|
|
660
|
+
* DocClient configuration input (all properties optional)
|
|
716
661
|
*/
|
|
717
|
-
type
|
|
662
|
+
type DocClientConfigInput = z.input<typeof zDocClientConfig>;
|
|
718
663
|
/**
|
|
719
|
-
*
|
|
664
|
+
* Type definitions for DocFileMdMetaValue
|
|
720
665
|
*/
|
|
721
|
-
type
|
|
666
|
+
type ExtractFieldType<T> = T extends {
|
|
667
|
+
type: infer Type;
|
|
668
|
+
} ? Type : never;
|
|
669
|
+
type ExtractRequired<T> = T extends {
|
|
670
|
+
required: infer Required;
|
|
671
|
+
} ? Required : false;
|
|
672
|
+
type BaseFieldValueType<Type> = Type extends "text" ? string : Type extends "number" ? number : Type extends "boolean" ? boolean : Type extends "multi-text" ? string[] : Type extends "multi-number" ? number[] : Type extends "multi-boolean" ? boolean[] : Type extends "relation" ? string : Type extends "multi-relation" ? string[] : Type extends "select-text" ? string : Type extends "select-number" ? number : Type extends "multi-select-text" ? string[] : Type extends "multi-select-number" ? number[] : never;
|
|
673
|
+
type FieldValueType<Type, Required> = Required extends true ? BaseFieldValueType<Type> : BaseFieldValueType<Type> | null;
|
|
722
674
|
/**
|
|
723
|
-
*
|
|
675
|
+
* Extract required field keys
|
|
724
676
|
*/
|
|
725
|
-
type
|
|
677
|
+
type RequiredKeys<T extends DocCustomSchema> = {
|
|
678
|
+
[K in keyof T]: T[K] extends {
|
|
679
|
+
required: true;
|
|
680
|
+
} ? K : never;
|
|
681
|
+
}[keyof T];
|
|
726
682
|
/**
|
|
727
|
-
*
|
|
683
|
+
* Extract optional field keys
|
|
728
684
|
*/
|
|
729
|
-
type
|
|
685
|
+
type OptionalKeys<T extends DocCustomSchema> = {
|
|
686
|
+
[K in keyof T]: T[K] extends {
|
|
687
|
+
required: true;
|
|
688
|
+
} ? never : K;
|
|
689
|
+
}[keyof T];
|
|
730
690
|
/**
|
|
731
|
-
*
|
|
691
|
+
* Generate expected value type from schema (considering required)
|
|
732
692
|
*/
|
|
733
|
-
type
|
|
693
|
+
type SchemaToValueType<T extends DocCustomSchema> = {
|
|
694
|
+
[K in RequiredKeys<T>]: BaseFieldValueType<ExtractFieldType<T[K]>>;
|
|
695
|
+
} & {
|
|
696
|
+
[K in OptionalKeys<T>]?: BaseFieldValueType<ExtractFieldType<T[K]>>;
|
|
697
|
+
};
|
|
698
|
+
/**
|
|
699
|
+
* Helper type for type-safe property access
|
|
700
|
+
*/
|
|
701
|
+
type GetValueType<T extends DocCustomSchema, K extends keyof T> = K extends RequiredKeys<T> ? BaseFieldValueType<ExtractFieldType<T[K]>> : BaseFieldValueType<ExtractFieldType<T[K]>> | undefined;
|
|
734
702
|
/**
|
|
735
|
-
*
|
|
703
|
+
* Type definitions for DocFileIndexSchema
|
|
736
704
|
*/
|
|
737
|
-
type
|
|
705
|
+
type ExtractIndexFieldType<T> = T extends {
|
|
706
|
+
type: infer Type;
|
|
707
|
+
} ? Type : never;
|
|
708
|
+
type GetIndexFieldType<Schema extends DocFileIndexSchema<RecordKey>, K extends keyof Schema> = Schema[K] extends DocFileIndexSchemaField ? Schema[K] : never;
|
|
709
|
+
type GetIndexFieldValueType<Schema extends DocFileIndexSchema<RecordKey>, K extends keyof Schema> = Schema[K] extends {
|
|
710
|
+
type: infer Type;
|
|
711
|
+
} ? Type extends "text" ? DocSchemaFieldTextSingleValue<K> : Type extends "number" ? DocSchemaFieldNumberSingleValue<K> : Type extends "boolean" ? DocSchemaFieldBooleanSingleValue<K> : Type extends "relation" ? DocSchemaFieldRelationSingleValue<K> : Type extends "select-text" ? DocSchemaFieldSelectTextSingleValue<K> : Type extends "select-number" ? DocSchemaFieldSelectNumberSingleValue<K> : Type extends "multi-text" ? DocSchemaFieldMultiTextValue<K> : Type extends "multi-number" ? DocSchemaFieldMultiNumberValue<K> : Type extends "multi-relation" ? DocSchemaFieldMultiRelationValue<K> : Type extends "multi-select-text" ? DocSchemaFieldMultiSelectTextValue<K> : Type extends "multi-select-number" ? DocSchemaFieldMultiSelectNumberValue<K> : never : never;
|
|
738
712
|
|
|
739
713
|
/**
|
|
740
|
-
*
|
|
741
|
-
* @template T - Zodスキーマの型(オプショナル)
|
|
714
|
+
* Relation file
|
|
742
715
|
*/
|
|
743
|
-
declare class
|
|
744
|
-
readonly value
|
|
745
|
-
|
|
746
|
-
constructor(value: unknown, zodSchema?: T, schemaBuilder?: DocSchemaBuilder);
|
|
716
|
+
declare class DocRelationFileValue {
|
|
717
|
+
private readonly value;
|
|
718
|
+
constructor(value: DocRelationFile);
|
|
747
719
|
/**
|
|
748
|
-
*
|
|
749
|
-
* Zodスキーマを使用している場合は自動的に型安全
|
|
720
|
+
* File path
|
|
750
721
|
*/
|
|
751
|
-
get
|
|
722
|
+
get id(): string;
|
|
752
723
|
/**
|
|
753
|
-
*
|
|
754
|
-
* Zodスキーマを使用している場合は型安全
|
|
724
|
+
* Slug
|
|
755
725
|
*/
|
|
756
|
-
|
|
757
|
-
field(name: string): DocSchemaFieldValue | null;
|
|
726
|
+
get slug(): string;
|
|
758
727
|
/**
|
|
759
|
-
*
|
|
760
|
-
* 注意: 型安全性のため、個別にfield()メソッドを使用することを推奨
|
|
728
|
+
* Display label
|
|
761
729
|
*/
|
|
762
|
-
get
|
|
763
|
-
get relationFields(): (DocSchemaFieldRelationSingleValue | DocSchemaFieldRelationMultipleValue)[];
|
|
730
|
+
get label(): string;
|
|
764
731
|
/**
|
|
765
|
-
*
|
|
732
|
+
* Create from file path and title
|
|
766
733
|
*/
|
|
767
|
-
static
|
|
734
|
+
static from(filePath: string, title: string | null): DocRelationFileValue;
|
|
768
735
|
/**
|
|
769
|
-
*
|
|
736
|
+
* Extract file name from file path (without extension)
|
|
770
737
|
*/
|
|
771
|
-
|
|
738
|
+
private static extractFileName;
|
|
772
739
|
/**
|
|
773
|
-
*
|
|
740
|
+
* Convert to JSON format
|
|
774
741
|
*/
|
|
775
|
-
|
|
742
|
+
toJson(): DocRelationFile;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
/**
|
|
746
|
+
* Manages relation information
|
|
747
|
+
*/
|
|
748
|
+
declare class DocRelationValue {
|
|
749
|
+
readonly value: DocRelation;
|
|
750
|
+
constructor(value: DocRelation);
|
|
776
751
|
/**
|
|
777
|
-
*
|
|
752
|
+
* Relation path
|
|
778
753
|
*/
|
|
779
|
-
|
|
754
|
+
get path(): string;
|
|
780
755
|
/**
|
|
781
|
-
*
|
|
756
|
+
* List of related files (value objects)
|
|
782
757
|
*/
|
|
783
|
-
|
|
758
|
+
get files(): DocRelationFileValue[];
|
|
784
759
|
/**
|
|
785
|
-
*
|
|
760
|
+
* Get file count
|
|
786
761
|
*/
|
|
787
|
-
|
|
762
|
+
get fileCount(): number;
|
|
788
763
|
/**
|
|
789
|
-
*
|
|
764
|
+
* Whether it's empty
|
|
790
765
|
*/
|
|
791
|
-
|
|
766
|
+
get isEmpty(): boolean;
|
|
792
767
|
/**
|
|
793
|
-
*
|
|
768
|
+
* Create empty relation entity
|
|
794
769
|
*/
|
|
795
|
-
|
|
770
|
+
static empty(path: string): DocRelationValue;
|
|
796
771
|
/**
|
|
797
|
-
*
|
|
772
|
+
* Export as JSON format
|
|
798
773
|
*/
|
|
799
|
-
|
|
774
|
+
toJson(): DocRelation;
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
type Props$8 = {
|
|
778
|
+
filePath: string;
|
|
779
|
+
fileSystem: DocFileSystem;
|
|
780
|
+
pathSystem: DocPathSystem;
|
|
781
|
+
};
|
|
782
|
+
/**
|
|
783
|
+
* Relation file reference
|
|
784
|
+
*/
|
|
785
|
+
declare class DocFileRelationReference {
|
|
786
|
+
private readonly props;
|
|
787
|
+
private readonly pathSystem;
|
|
788
|
+
constructor(props: Props$8);
|
|
789
|
+
get fileSystem(): DocFileSystem;
|
|
790
|
+
get basePath(): string;
|
|
800
791
|
/**
|
|
801
|
-
*
|
|
792
|
+
* Relation path
|
|
802
793
|
*/
|
|
803
|
-
|
|
794
|
+
get path(): string;
|
|
804
795
|
/**
|
|
805
|
-
*
|
|
796
|
+
* Full path
|
|
806
797
|
*/
|
|
807
|
-
|
|
798
|
+
get fullPath(): string;
|
|
799
|
+
read(): Promise<DocRelationValue | null>;
|
|
808
800
|
/**
|
|
809
|
-
*
|
|
801
|
+
* Read list of relation files
|
|
810
802
|
*/
|
|
811
|
-
|
|
803
|
+
readFiles(): Promise<DocRelationFileValue[]>;
|
|
812
804
|
/**
|
|
813
|
-
*
|
|
805
|
+
* Read single relation file
|
|
814
806
|
*/
|
|
815
|
-
|
|
807
|
+
readFile(filePath: string): Promise<DocRelationFileValue | null>;
|
|
816
808
|
/**
|
|
817
|
-
*
|
|
809
|
+
* Check if file exists
|
|
818
810
|
*/
|
|
819
|
-
|
|
811
|
+
exists(slug: string): Promise<boolean>;
|
|
820
812
|
/**
|
|
821
|
-
*
|
|
813
|
+
* Get list of file names (without extension)
|
|
822
814
|
*/
|
|
823
|
-
|
|
815
|
+
readSlugs(): Promise<string[]>;
|
|
824
816
|
/**
|
|
825
|
-
*
|
|
817
|
+
* Get file count
|
|
826
818
|
*/
|
|
827
|
-
|
|
819
|
+
count(): Promise<number>;
|
|
828
820
|
/**
|
|
829
|
-
*
|
|
821
|
+
* Check if empty
|
|
830
822
|
*/
|
|
831
|
-
|
|
823
|
+
isEmpty(): Promise<boolean>;
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
/**
|
|
827
|
+
* Type-safe schema value object
|
|
828
|
+
*/
|
|
829
|
+
declare class DocFileIndexSchemaValue<T extends DocCustomSchema> {
|
|
830
|
+
readonly value: DocFileIndexSchema<keyof T>;
|
|
831
|
+
readonly customSchema: T;
|
|
832
|
+
constructor(value: DocFileIndexSchema<keyof T>, customSchema: T);
|
|
832
833
|
/**
|
|
833
|
-
*
|
|
834
|
+
* Get list of field names
|
|
835
|
+
* Automatically type-safe when using Zod schema
|
|
834
836
|
*/
|
|
835
|
-
|
|
837
|
+
get fieldNames(): Array<keyof T>;
|
|
836
838
|
/**
|
|
837
|
-
*
|
|
839
|
+
* Get field with specified field name
|
|
840
|
+
* Returns type-safe specific field Value object
|
|
838
841
|
*/
|
|
839
|
-
|
|
842
|
+
field<K extends keyof T>(key: K): T[K]["type"] extends infer Type ? Type extends "text" ? DocSchemaFieldTextSingleValue<K> : Type extends "number" ? DocSchemaFieldNumberSingleValue<K> : Type extends "boolean" ? DocSchemaFieldBooleanSingleValue<K> : Type extends "relation" ? DocSchemaFieldRelationSingleValue<K> : Type extends "select-text" ? DocSchemaFieldSelectTextSingleValue<K> : Type extends "select-number" ? DocSchemaFieldSelectNumberSingleValue<K> : Type extends "multi-text" ? DocSchemaFieldMultiTextValue<K> : Type extends "multi-number" ? DocSchemaFieldMultiNumberValue<K> : Type extends "multi-relation" ? DocSchemaFieldMultiRelationValue<K> : Type extends "multi-select-text" ? DocSchemaFieldMultiSelectTextValue<K> : Type extends "multi-select-number" ? DocSchemaFieldMultiSelectNumberValue<K> : never : never;
|
|
843
|
+
relation<K extends keyof T>(key: K): DocSchemaFieldRelationSingleValue<K>;
|
|
844
|
+
multiRelation<K extends keyof T>(key: K): DocSchemaFieldMultiRelationValue<K>;
|
|
840
845
|
/**
|
|
841
|
-
*
|
|
846
|
+
* Get all fields
|
|
847
|
+
* Note: For type safety, it's recommended to use field() method individually
|
|
842
848
|
*/
|
|
843
|
-
|
|
844
|
-
|
|
849
|
+
get fields(): DocFileIndexSchema<keyof T>[keyof T][];
|
|
850
|
+
get relationFields(): (DocSchemaFieldRelationSingleValue<string> | DocSchemaFieldMultiRelationValue<string>)[];
|
|
851
|
+
toJson(): DocFileIndexSchema<keyof T>;
|
|
845
852
|
/**
|
|
846
|
-
*
|
|
853
|
+
* Create empty schema entity
|
|
854
|
+
* biome-ignore lint/complexity/noBannedTypes: {} as DocCustomSchema
|
|
847
855
|
*/
|
|
848
|
-
|
|
856
|
+
static empty(): DocFileIndexSchemaValue<{}>;
|
|
849
857
|
}
|
|
850
858
|
|
|
851
859
|
/**
|
|
852
|
-
* FrontMatter
|
|
860
|
+
* File: index.md > content > FrontMatter
|
|
853
861
|
*/
|
|
854
|
-
declare class
|
|
855
|
-
readonly value:
|
|
856
|
-
|
|
862
|
+
declare class DocFileIndexMetaValue<T extends DocCustomSchema> {
|
|
863
|
+
readonly value: DocFileIndexMeta<T>;
|
|
864
|
+
readonly customSchema: T;
|
|
865
|
+
private readonly config;
|
|
857
866
|
/**
|
|
858
|
-
*
|
|
867
|
+
* Additional properties to include in the meta data
|
|
859
868
|
*/
|
|
860
|
-
|
|
869
|
+
private readonly additionalProperties;
|
|
870
|
+
constructor(value: DocFileIndexMeta<T>, customSchema: T, config: DocClientConfig, additionalProperties?: Record<string, unknown>);
|
|
861
871
|
/**
|
|
862
|
-
*
|
|
872
|
+
* Get icon
|
|
863
873
|
*/
|
|
864
|
-
|
|
874
|
+
get icon(): string | null;
|
|
865
875
|
/**
|
|
866
|
-
*
|
|
876
|
+
* Get schema
|
|
867
877
|
*/
|
|
868
|
-
|
|
878
|
+
schema(): DocFileIndexSchemaValue<T>;
|
|
869
879
|
/**
|
|
870
|
-
* schema
|
|
880
|
+
* Check if schema is defined
|
|
871
881
|
*/
|
|
872
|
-
|
|
882
|
+
get hasSchema(): boolean;
|
|
873
883
|
/**
|
|
874
|
-
*
|
|
884
|
+
* Update icon field
|
|
875
885
|
*/
|
|
876
|
-
|
|
886
|
+
withIcon(value: string | null): DocFileIndexMetaValue<T>;
|
|
877
887
|
/**
|
|
878
|
-
*
|
|
888
|
+
* Update schema field
|
|
879
889
|
*/
|
|
880
|
-
|
|
890
|
+
withSchema(value: DocFileIndexSchema<keyof T>): DocFileIndexMetaValue<T>;
|
|
881
891
|
/**
|
|
882
|
-
*
|
|
892
|
+
* Output in JSON format
|
|
883
893
|
*/
|
|
884
|
-
|
|
894
|
+
toJson(): DocFileIndexMeta<T>;
|
|
885
895
|
/**
|
|
886
|
-
*
|
|
896
|
+
* Output in YAML format
|
|
887
897
|
*/
|
|
888
|
-
|
|
898
|
+
toYaml(): string;
|
|
889
899
|
/**
|
|
890
|
-
* Markdown
|
|
900
|
+
* Generate from Markdown text (can process incomplete data)
|
|
891
901
|
*/
|
|
892
|
-
static from(markdownText: string):
|
|
902
|
+
static from<T extends DocCustomSchema>(markdownText: string, customSchema: T, config: DocClientConfig): DocFileIndexMetaValue<T>;
|
|
893
903
|
/**
|
|
894
|
-
*
|
|
904
|
+
* Generate directly from data (can process incomplete data)
|
|
895
905
|
*/
|
|
896
|
-
static fromRecord(record: Record<string, unknown
|
|
906
|
+
static fromRecord<T extends DocCustomSchema>(record: Record<string, unknown>, customSchema: T, config: DocClientConfig): DocFileIndexMetaValue<T>;
|
|
897
907
|
/**
|
|
898
|
-
*
|
|
908
|
+
* Generate empty FrontMatter
|
|
899
909
|
*/
|
|
900
|
-
static empty():
|
|
910
|
+
static empty<T extends DocCustomSchema>(customSchema: T, config: DocClientConfig): DocFileIndexMetaValue<T>;
|
|
901
911
|
/**
|
|
902
|
-
*
|
|
912
|
+
* Extract icon
|
|
903
913
|
*/
|
|
904
914
|
private static extractIcon;
|
|
905
915
|
/**
|
|
906
|
-
*
|
|
916
|
+
* Extract schema part
|
|
907
917
|
*/
|
|
908
918
|
private static extractSchema;
|
|
909
919
|
/**
|
|
910
|
-
*
|
|
920
|
+
* Normalize entire schema
|
|
911
921
|
*/
|
|
912
|
-
private static
|
|
922
|
+
private static normalizeSchema;
|
|
923
|
+
static emptySchema<T extends DocCustomSchema>(customSchema: T): DocFileIndexSchema<keyof T>;
|
|
913
924
|
}
|
|
914
925
|
|
|
915
926
|
/**
|
|
916
|
-
*
|
|
927
|
+
* File: index.md > content
|
|
917
928
|
*/
|
|
918
|
-
declare class
|
|
919
|
-
readonly value:
|
|
920
|
-
|
|
929
|
+
declare class DocFileIndexContentValue<T extends DocCustomSchema> {
|
|
930
|
+
readonly value: DocFileIndexContent<T>;
|
|
931
|
+
private readonly customSchema;
|
|
932
|
+
private readonly config;
|
|
933
|
+
constructor(value: DocFileIndexContent<T>, customSchema: T, config: DocClientConfig);
|
|
921
934
|
/**
|
|
922
|
-
*
|
|
935
|
+
* Content body (does not include frontMatter)
|
|
923
936
|
*/
|
|
924
937
|
get body(): string;
|
|
925
938
|
/**
|
|
926
|
-
*
|
|
939
|
+
* Title
|
|
927
940
|
*/
|
|
928
941
|
get title(): string;
|
|
929
942
|
/**
|
|
930
|
-
*
|
|
943
|
+
* Description
|
|
931
944
|
*/
|
|
932
945
|
get description(): string;
|
|
933
946
|
/**
|
|
934
947
|
* FrontMatter
|
|
935
948
|
*/
|
|
936
|
-
|
|
949
|
+
meta(): DocFileIndexMetaValue<T>;
|
|
937
950
|
/**
|
|
938
|
-
*
|
|
951
|
+
* Update title
|
|
939
952
|
*/
|
|
940
|
-
withTitle(title: string):
|
|
953
|
+
withTitle(title: string): DocFileIndexContentValue<T>;
|
|
941
954
|
/**
|
|
942
|
-
*
|
|
955
|
+
* Update description
|
|
943
956
|
*/
|
|
944
|
-
withDescription(description: string, defaultTitle?: string):
|
|
957
|
+
withDescription(description: string, defaultTitle?: string): DocFileIndexContentValue<T>;
|
|
945
958
|
/**
|
|
946
|
-
* Markdown
|
|
959
|
+
* Generate from Markdown text
|
|
947
960
|
*/
|
|
948
|
-
static fromMarkdown(markdown: string):
|
|
961
|
+
static fromMarkdown<T extends DocCustomSchema>(markdown: string, customSchema: T, config: DocClientConfig): DocFileIndexContentValue<T>;
|
|
949
962
|
/**
|
|
950
|
-
*
|
|
963
|
+
* Generate complete Markdown text
|
|
951
964
|
*/
|
|
952
965
|
toMarkdownText(): string;
|
|
953
966
|
/**
|
|
954
|
-
*
|
|
967
|
+
* Update content
|
|
955
968
|
*/
|
|
956
|
-
withContent(content: string):
|
|
969
|
+
withContent(content: string): DocFileIndexContentValue<T>;
|
|
957
970
|
/**
|
|
958
|
-
* FrontMatter
|
|
971
|
+
* Update FrontMatter
|
|
959
972
|
*/
|
|
960
|
-
|
|
973
|
+
withMeta(meta: DocFileIndexMeta<T>): DocFileIndexContentValue<T>;
|
|
961
974
|
/**
|
|
962
|
-
*
|
|
975
|
+
* Generate default index.md content
|
|
963
976
|
*/
|
|
964
|
-
static empty(directoryName: string):
|
|
977
|
+
static empty<T extends DocCustomSchema = DocCustomSchema>(directoryName: string, customSchema: T, config: DocClientConfig): DocFileIndexContentValue<T>;
|
|
965
978
|
/**
|
|
966
|
-
* FrontMatter
|
|
979
|
+
* Generate complete text combining FrontMatter and body
|
|
967
980
|
*/
|
|
968
981
|
toText(): string;
|
|
969
982
|
/**
|
|
970
|
-
* JSON
|
|
983
|
+
* Output in JSON format
|
|
971
984
|
*/
|
|
972
|
-
toJson():
|
|
985
|
+
toJson(): DocFileIndexContent<T>;
|
|
973
986
|
}
|
|
974
987
|
|
|
975
988
|
/**
|
|
976
|
-
*
|
|
989
|
+
* Document directory entity
|
|
977
990
|
*/
|
|
978
|
-
declare class DocFileIndexEntity {
|
|
979
|
-
readonly value: DocFileIndex
|
|
980
|
-
|
|
991
|
+
declare class DocFileIndexEntity<T extends DocCustomSchema> {
|
|
992
|
+
readonly value: DocFileIndex<T>;
|
|
993
|
+
private readonly customSchema;
|
|
994
|
+
private readonly config;
|
|
995
|
+
constructor(value: DocFileIndex<T>, customSchema: T, config?: DocClientConfig);
|
|
981
996
|
/**
|
|
982
|
-
*
|
|
997
|
+
* Content
|
|
983
998
|
*/
|
|
984
|
-
get content():
|
|
999
|
+
get content(): DocFileIndexContentValue<T>;
|
|
985
1000
|
/**
|
|
986
|
-
*
|
|
1001
|
+
* Path information
|
|
987
1002
|
*/
|
|
988
1003
|
get path(): DocFilePath;
|
|
989
1004
|
/**
|
|
990
|
-
*
|
|
1005
|
+
* Update content
|
|
991
1006
|
*/
|
|
992
|
-
withContent(content:
|
|
1007
|
+
withContent(content: DocFileIndexContentValue<T>): DocFileIndexEntity<T>;
|
|
993
1008
|
/**
|
|
994
|
-
*
|
|
1009
|
+
* Update path
|
|
995
1010
|
*/
|
|
996
|
-
withPath(path: DocFilePath): DocFileIndexEntity
|
|
1011
|
+
withPath(path: DocFilePath): DocFileIndexEntity<T>;
|
|
997
1012
|
/**
|
|
998
|
-
*
|
|
1013
|
+
* Convert to index file schema format
|
|
999
1014
|
*/
|
|
1000
|
-
toJson(): DocFileIndex
|
|
1015
|
+
toJson(): DocFileIndex<T>;
|
|
1001
1016
|
}
|
|
1002
1017
|
|
|
1003
|
-
type Props$7 = {
|
|
1018
|
+
type Props$7<T extends DocCustomSchema> = {
|
|
1019
|
+
customSchema: T;
|
|
1004
1020
|
path: string;
|
|
1005
1021
|
fileSystem: DocFileSystem;
|
|
1006
1022
|
pathSystem: DocPathSystem;
|
|
1023
|
+
config: DocClientConfig;
|
|
1007
1024
|
};
|
|
1008
1025
|
/**
|
|
1009
|
-
*
|
|
1026
|
+
* File reference class
|
|
1010
1027
|
*/
|
|
1011
|
-
declare class DocFileIndexReference {
|
|
1028
|
+
declare class DocFileIndexReference<T extends DocCustomSchema> {
|
|
1012
1029
|
private readonly props;
|
|
1013
1030
|
private readonly pathSystem;
|
|
1014
|
-
|
|
1031
|
+
private readonly customSchema;
|
|
1032
|
+
constructor(props: Props$7<T>);
|
|
1015
1033
|
get fileSystem(): DocFileSystem;
|
|
1016
1034
|
get basePath(): string;
|
|
1017
1035
|
get filePath(): string;
|
|
1018
1036
|
get fileFullPath(): string;
|
|
1019
1037
|
get durectoryPath(): string;
|
|
1020
|
-
read(): Promise<DocFileIndexEntity
|
|
1038
|
+
read(): Promise<DocFileIndexEntity<T>>;
|
|
1021
1039
|
/**
|
|
1022
|
-
*
|
|
1040
|
+
* Read file content
|
|
1023
1041
|
*/
|
|
1024
1042
|
readContent(): Promise<Error | string>;
|
|
1025
1043
|
/**
|
|
1026
|
-
*
|
|
1044
|
+
* Write content to file
|
|
1027
1045
|
*/
|
|
1028
1046
|
writeContent(content: string): Promise<void>;
|
|
1029
1047
|
/**
|
|
1030
|
-
*
|
|
1048
|
+
* Write entity
|
|
1031
1049
|
*/
|
|
1032
|
-
write(entity: DocFileIndexEntity): Promise<void>;
|
|
1050
|
+
write(entity: DocFileIndexEntity<T>): Promise<void>;
|
|
1033
1051
|
/**
|
|
1034
|
-
*
|
|
1052
|
+
* Create new file with default content
|
|
1035
1053
|
*/
|
|
1036
|
-
writeDefault(): Promise<
|
|
1054
|
+
writeDefault(): Promise<null>;
|
|
1037
1055
|
/**
|
|
1038
|
-
*
|
|
1056
|
+
* Delete file
|
|
1039
1057
|
*/
|
|
1040
1058
|
delete(): Promise<Error | null>;
|
|
1041
1059
|
/**
|
|
1042
|
-
*
|
|
1060
|
+
* Check if file exists
|
|
1043
1061
|
*/
|
|
1044
1062
|
exists(): Promise<boolean>;
|
|
1045
1063
|
relations(): Promise<DocFileRelationReference[]>;
|
|
1046
1064
|
readRelations(): Promise<DocRelationValue[]>;
|
|
1047
1065
|
/**
|
|
1048
|
-
*
|
|
1066
|
+
* Get file size in bytes
|
|
1049
1067
|
*/
|
|
1050
1068
|
size(): Promise<number>;
|
|
1051
1069
|
/**
|
|
1052
|
-
*
|
|
1070
|
+
* Get last modified date
|
|
1053
1071
|
*/
|
|
1054
1072
|
lastModified(): Promise<Date>;
|
|
1055
1073
|
/**
|
|
1056
|
-
*
|
|
1074
|
+
* Get file creation date
|
|
1057
1075
|
*/
|
|
1058
1076
|
createdAt(): Promise<Date>;
|
|
1059
1077
|
/**
|
|
1060
|
-
*
|
|
1078
|
+
* Move file to archive and return new reference
|
|
1061
1079
|
*/
|
|
1062
|
-
archive(archiveDirectoryName?: string): Promise<DocFileIndexReference
|
|
1080
|
+
archive(archiveDirectoryName?: string): Promise<DocFileIndexReference<T>>;
|
|
1063
1081
|
/**
|
|
1064
|
-
*
|
|
1082
|
+
* Restore file from archive and return new reference
|
|
1065
1083
|
*/
|
|
1066
|
-
restore(archiveDirectoryName?: string): Promise<DocFileIndexReference
|
|
1084
|
+
restore(archiveDirectoryName?: string): Promise<DocFileIndexReference<T>>;
|
|
1067
1085
|
}
|
|
1068
1086
|
|
|
1069
1087
|
/**
|
|
1070
|
-
*
|
|
1071
|
-
*/
|
|
1072
|
-
declare class
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1088
|
+
* Meta
|
|
1089
|
+
*/
|
|
1090
|
+
declare class DocFileMdMetaValue<T extends DocCustomSchema> {
|
|
1091
|
+
readonly value: SchemaToValueType<T>;
|
|
1092
|
+
readonly customSchema: T;
|
|
1093
|
+
constructor(value: SchemaToValueType<T>, customSchema: T);
|
|
1094
|
+
private validateValue;
|
|
1095
|
+
private getValueField;
|
|
1096
|
+
get keys(): Array<keyof T>;
|
|
1097
|
+
/**
|
|
1098
|
+
* Return a new instance with a single property updated
|
|
1099
|
+
*/
|
|
1100
|
+
withProperty<K extends keyof T>(key: K, value: BaseFieldValueType<ExtractFieldType<T[K]>>): DocFileMdMetaValue<T>;
|
|
1101
|
+
schemaField<K extends keyof T>(key: K): T[K];
|
|
1102
|
+
field<K extends keyof T>(key: K): FieldValueType<ExtractFieldType<T[K]>, ExtractRequired<T[K]>>;
|
|
1103
|
+
relation(key: keyof T): DocMetaFieldRelation;
|
|
1104
|
+
multiRelation(key: keyof T): DocMetaFieldMultiRelation;
|
|
1105
|
+
text(key: keyof T): DocMetaFieldText;
|
|
1106
|
+
number(key: keyof T): DocMetaFieldNumber;
|
|
1107
|
+
boolean(key: keyof T): DocMetaFieldBoolean;
|
|
1108
|
+
multiText(key: keyof T): DocMetaFieldMultiText;
|
|
1109
|
+
multiNumber(key: keyof T): DocMetaFieldMultiNumber;
|
|
1110
|
+
multiBoolean(key: keyof T): DocMetaFieldMultiBoolean;
|
|
1111
|
+
hasKey(key: keyof T): boolean;
|
|
1112
|
+
/**
|
|
1113
|
+
* Generate from Markdown text
|
|
1114
|
+
*/
|
|
1115
|
+
static fromYamlText<T extends DocCustomSchema>(yamlText: string, customSchema: T): DocFileMdMetaValue<T>;
|
|
1116
|
+
static empty<T extends DocCustomSchema>(customSchema: T): DocFileMdMetaValue<T>;
|
|
1117
|
+
toJson(): SchemaToValueType<T>;
|
|
1077
1118
|
toYaml(): string;
|
|
1078
|
-
schema<U extends z.ZodTypeAny = z.ZodTypeAny>(zodSchema?: U): DocSchemaValue<U>;
|
|
1079
|
-
/**
|
|
1080
|
-
* Markdownテキストから生成
|
|
1081
|
-
*/
|
|
1082
|
-
static from<T extends FrontMatterSchema = typeof zDocFileMdFrontMatter>(markdownText: string, zodSchema: T): DocFrontMatterMdValue<T>;
|
|
1083
|
-
/**
|
|
1084
|
-
* 空のFrontMatterを生成
|
|
1085
|
-
*/
|
|
1086
|
-
static empty<T extends FrontMatterSchema = typeof zDocFileMdFrontMatter>(zodSchema: T): DocFrontMatterMdValue<T>;
|
|
1087
|
-
/**
|
|
1088
|
-
* データから直接生成
|
|
1089
|
-
*/
|
|
1090
|
-
static fromData<T extends FrontMatterSchema = typeof zDocFileMdFrontMatter>(data: unknown, zodSchema: T): DocFrontMatterMdValue<T>;
|
|
1091
|
-
/**
|
|
1092
|
-
* スキーマフィールドに基づいてデフォルト値を生成する
|
|
1093
|
-
*/
|
|
1094
|
-
static generateDefaultValueFromSchemaField(fieldDef: {
|
|
1095
|
-
type: string;
|
|
1096
|
-
default?: unknown;
|
|
1097
|
-
}): unknown;
|
|
1098
|
-
/**
|
|
1099
|
-
* 単一のプロパティを更新した新しいインスタンスを返す
|
|
1100
|
-
*/
|
|
1101
|
-
withProperty(key: string, value: unknown): DocFrontMatterMdValue<T>;
|
|
1102
|
-
/**
|
|
1103
|
-
* テキスト型のプロパティを取得
|
|
1104
|
-
*/
|
|
1105
|
-
text(key: string): string | null;
|
|
1106
|
-
/**
|
|
1107
|
-
* 数値型のプロパティを取得
|
|
1108
|
-
*/
|
|
1109
|
-
number(key: string): number | null;
|
|
1110
|
-
/**
|
|
1111
|
-
* 真偽値型のプロパティを取得
|
|
1112
|
-
*/
|
|
1113
|
-
boolean(key: string): boolean | null;
|
|
1114
|
-
/**
|
|
1115
|
-
* 単一リレーション型のプロパティを取得
|
|
1116
|
-
*/
|
|
1117
|
-
relation(key: string): string | null;
|
|
1118
|
-
/**
|
|
1119
|
-
* 複数リレーション型のプロパティを取得
|
|
1120
|
-
*/
|
|
1121
|
-
multiRelation(key: string): string[];
|
|
1122
|
-
/**
|
|
1123
|
-
* 複数テキスト型のプロパティを取得
|
|
1124
|
-
*/
|
|
1125
|
-
multiText(key: string): string[];
|
|
1126
|
-
/**
|
|
1127
|
-
* 複数数値型のプロパティを取得
|
|
1128
|
-
*/
|
|
1129
|
-
multiNumber(key: string): number[];
|
|
1130
|
-
/**
|
|
1131
|
-
* 複数真偽値型のプロパティを取得
|
|
1132
|
-
*/
|
|
1133
|
-
multiBoolean(key: string): boolean[];
|
|
1134
|
-
/**
|
|
1135
|
-
* プロパティが存在するかチェック
|
|
1136
|
-
*/
|
|
1137
|
-
has(key: string): boolean;
|
|
1138
|
-
/**
|
|
1139
|
-
* すべてのキーを取得
|
|
1140
|
-
*/
|
|
1141
|
-
get keys(): string[];
|
|
1142
|
-
/**
|
|
1143
|
-
* フィールドアクセス(Zodスキーマで型安全)
|
|
1144
|
-
*/
|
|
1145
|
-
field<K extends keyof z.infer<T> & string>(key: K): T extends z.ZodTypeAny ? z.infer<T>[K] | null : unknown;
|
|
1146
|
-
field(key: string): unknown;
|
|
1147
|
-
/**
|
|
1148
|
-
* 型安全な値の取得
|
|
1149
|
-
*/
|
|
1150
|
-
get typedValue(): z.infer<T> | null;
|
|
1151
1119
|
}
|
|
1152
1120
|
|
|
1153
1121
|
/**
|
|
1154
|
-
* Markdown
|
|
1122
|
+
* File: Markdown > Content
|
|
1155
1123
|
*/
|
|
1156
|
-
declare class
|
|
1157
|
-
readonly value:
|
|
1158
|
-
private readonly
|
|
1159
|
-
constructor(value:
|
|
1124
|
+
declare class DocFileMdContentValue<T extends DocCustomSchema> {
|
|
1125
|
+
readonly value: DocFileMdContent<T>;
|
|
1126
|
+
private readonly customSchema;
|
|
1127
|
+
constructor(value: DocFileMdContent<T>, customSchema: T);
|
|
1160
1128
|
/**
|
|
1161
|
-
*
|
|
1129
|
+
* Content body (does not include frontMatter)
|
|
1162
1130
|
*/
|
|
1163
1131
|
get body(): string;
|
|
1164
1132
|
/**
|
|
1165
|
-
*
|
|
1133
|
+
* Title
|
|
1166
1134
|
*/
|
|
1167
1135
|
get title(): string;
|
|
1168
1136
|
/**
|
|
1169
|
-
*
|
|
1137
|
+
* Description
|
|
1170
1138
|
*/
|
|
1171
1139
|
get description(): string;
|
|
1172
1140
|
/**
|
|
1173
|
-
* FrontMatter
|
|
1141
|
+
* FrontMatter (uses constructor's Zod schema or argument schema)
|
|
1174
1142
|
*/
|
|
1175
|
-
|
|
1143
|
+
meta(): DocFileMdMetaValue<T>;
|
|
1176
1144
|
/**
|
|
1177
|
-
*
|
|
1145
|
+
* Update title
|
|
1178
1146
|
*/
|
|
1179
|
-
withTitle(title: string):
|
|
1147
|
+
withTitle(title: string): DocFileMdContentValue<T>;
|
|
1180
1148
|
/**
|
|
1181
|
-
*
|
|
1149
|
+
* Update description
|
|
1182
1150
|
*/
|
|
1183
|
-
withDescription(description: string, defaultTitle?: string):
|
|
1151
|
+
withDescription(description: string, defaultTitle?: string): DocFileMdContentValue<T>;
|
|
1184
1152
|
/**
|
|
1185
|
-
*
|
|
1153
|
+
* Update content
|
|
1186
1154
|
*/
|
|
1187
|
-
withContent(content: string):
|
|
1155
|
+
withContent(content: string): DocFileMdContentValue<T>;
|
|
1188
1156
|
/**
|
|
1189
|
-
* FrontMatter
|
|
1157
|
+
* Update FrontMatter
|
|
1190
1158
|
*/
|
|
1191
|
-
|
|
1159
|
+
withMeta<U extends DocCustomSchema>(meta: DocFileMdMetaValue<U>): DocFileMdContentValue<U>;
|
|
1192
1160
|
/**
|
|
1193
|
-
* FrontMatter
|
|
1161
|
+
* Update specific property of FrontMatter
|
|
1194
1162
|
*/
|
|
1195
|
-
|
|
1163
|
+
withMetaProperty<K extends keyof T>(key: K, value: BaseFieldValueType<ExtractFieldType<T[K]>>): DocFileMdContentValue<T>;
|
|
1196
1164
|
/**
|
|
1197
|
-
* Markdown
|
|
1165
|
+
* Generate from Markdown text
|
|
1198
1166
|
*/
|
|
1199
|
-
static fromMarkdown<T extends
|
|
1167
|
+
static fromMarkdown<T extends DocCustomSchema>(markdown: string, customSchema: T): DocFileMdContentValue<T>;
|
|
1200
1168
|
/**
|
|
1201
|
-
*
|
|
1169
|
+
* Generate complete Markdown text
|
|
1202
1170
|
*/
|
|
1203
1171
|
toMarkdownText(): string;
|
|
1204
1172
|
/**
|
|
1205
|
-
* FrontMatter
|
|
1173
|
+
* Generate complete text combining FrontMatter and body
|
|
1206
1174
|
*/
|
|
1207
1175
|
toText(): string;
|
|
1208
1176
|
/**
|
|
1209
|
-
*
|
|
1177
|
+
* Generate empty content
|
|
1210
1178
|
*/
|
|
1211
|
-
static empty<T extends
|
|
1179
|
+
static empty<T extends DocCustomSchema = DocCustomSchema>(title: string, customSchema: T): DocFileMdContentValue<T>;
|
|
1212
1180
|
/**
|
|
1213
|
-
* JSON
|
|
1181
|
+
* Output in JSON format
|
|
1214
1182
|
*/
|
|
1215
|
-
toJson():
|
|
1183
|
+
toJson(): DocFileMdContent<T>;
|
|
1216
1184
|
}
|
|
1217
1185
|
|
|
1218
1186
|
/**
|
|
1219
|
-
*
|
|
1187
|
+
* Markdown file entity
|
|
1220
1188
|
*/
|
|
1221
|
-
declare class DocFileMdEntity {
|
|
1222
|
-
readonly value: DocFileMd
|
|
1223
|
-
|
|
1189
|
+
declare class DocFileMdEntity<T extends DocCustomSchema> {
|
|
1190
|
+
readonly value: DocFileMd<T>;
|
|
1191
|
+
private readonly customSchema;
|
|
1192
|
+
constructor(value: DocFileMd<T>, customSchema: T);
|
|
1224
1193
|
/**
|
|
1225
|
-
*
|
|
1194
|
+
* Content
|
|
1226
1195
|
*/
|
|
1227
|
-
get content():
|
|
1196
|
+
get content(): DocFileMdContentValue<T>;
|
|
1228
1197
|
/**
|
|
1229
|
-
*
|
|
1198
|
+
* Path information
|
|
1230
1199
|
*/
|
|
1231
1200
|
get path(): DocFilePath;
|
|
1232
1201
|
/**
|
|
1233
|
-
*
|
|
1202
|
+
* Update content
|
|
1234
1203
|
*/
|
|
1235
|
-
withContent(content:
|
|
1204
|
+
withContent(content: DocFileMdContentValue<T>): DocFileMdEntity<T>;
|
|
1236
1205
|
/**
|
|
1237
|
-
*
|
|
1206
|
+
* Update path
|
|
1238
1207
|
*/
|
|
1239
|
-
withPath(path: DocFilePath): DocFileMdEntity
|
|
1208
|
+
withPath(path: DocFilePath): DocFileMdEntity<T>;
|
|
1209
|
+
withMeta(meta: DocFileMdMetaValue<T>): DocFileMdEntity<T>;
|
|
1210
|
+
withTitle(title: string): DocFileMdEntity<T>;
|
|
1211
|
+
withDescription(description: string, defaultTitle?: string): DocFileMdEntity<T>;
|
|
1240
1212
|
/**
|
|
1241
|
-
* JSON
|
|
1213
|
+
* Convert to JSON format
|
|
1242
1214
|
*/
|
|
1243
|
-
toJson(): DocFileMd
|
|
1215
|
+
toJson(): DocFileMd<T>;
|
|
1244
1216
|
}
|
|
1245
1217
|
|
|
1246
|
-
type Props$6 = {
|
|
1218
|
+
type Props$6<T extends DocCustomSchema> = {
|
|
1247
1219
|
path: string;
|
|
1248
1220
|
fileSystem: DocFileSystem;
|
|
1249
1221
|
pathSystem: DocPathSystem;
|
|
1222
|
+
customSchema: T;
|
|
1223
|
+
config: DocClientConfig;
|
|
1250
1224
|
};
|
|
1251
1225
|
/**
|
|
1252
|
-
*
|
|
1226
|
+
* File reference
|
|
1253
1227
|
*/
|
|
1254
|
-
declare class DocFileMdReference {
|
|
1228
|
+
declare class DocFileMdReference<T extends DocCustomSchema> {
|
|
1255
1229
|
private readonly props;
|
|
1256
1230
|
private readonly pathSystem;
|
|
1257
|
-
|
|
1231
|
+
private readonly customSchema;
|
|
1232
|
+
constructor(props: Props$6<T>);
|
|
1258
1233
|
get fileSystem(): DocFileSystem;
|
|
1259
1234
|
get basePath(): string;
|
|
1260
1235
|
get path(): string;
|
|
@@ -1263,106 +1238,96 @@ declare class DocFileMdReference {
|
|
|
1263
1238
|
get archivedPath(): string;
|
|
1264
1239
|
get name(): string;
|
|
1265
1240
|
get nameWithExtension(): string;
|
|
1266
|
-
|
|
1267
|
-
read(): Promise<
|
|
1268
|
-
/**
|
|
1269
|
-
* ファイルの内容を読み込む
|
|
1270
|
-
*/
|
|
1271
|
-
readContent(): Promise<Error | string>;
|
|
1241
|
+
exists(): Promise<boolean>;
|
|
1242
|
+
read(): Promise<DocFileMdEntity<T> | Error>;
|
|
1272
1243
|
/**
|
|
1273
|
-
*
|
|
1244
|
+
* Read file content
|
|
1274
1245
|
*/
|
|
1275
|
-
|
|
1246
|
+
readText(): Promise<Error | string>;
|
|
1276
1247
|
/**
|
|
1277
|
-
*
|
|
1248
|
+
* Write entity
|
|
1278
1249
|
*/
|
|
1279
|
-
write(entity: DocFileMdEntity): Promise<
|
|
1250
|
+
write(entity: DocFileMdEntity<T>): Promise<null>;
|
|
1251
|
+
writeText(text: string): Promise<void>;
|
|
1280
1252
|
/**
|
|
1281
|
-
*
|
|
1253
|
+
* Create new file with default content
|
|
1282
1254
|
*/
|
|
1283
1255
|
writeDefault(): Promise<void>;
|
|
1284
1256
|
/**
|
|
1285
|
-
*
|
|
1257
|
+
* Delete file
|
|
1286
1258
|
*/
|
|
1287
1259
|
delete(): Promise<Error | null>;
|
|
1288
1260
|
/**
|
|
1289
|
-
*
|
|
1290
|
-
*/
|
|
1291
|
-
exists(): Promise<boolean>;
|
|
1292
|
-
/**
|
|
1293
|
-
* ファイルをコピー
|
|
1261
|
+
* Copy file
|
|
1294
1262
|
*/
|
|
1295
1263
|
copyTo(destinationPath: string): Promise<void>;
|
|
1296
1264
|
/**
|
|
1297
|
-
*
|
|
1265
|
+
* Move file
|
|
1298
1266
|
*/
|
|
1299
1267
|
moveTo(destinationPath: string): Promise<void>;
|
|
1300
1268
|
/**
|
|
1301
|
-
*
|
|
1302
|
-
*/
|
|
1303
|
-
size(): Promise<number>;
|
|
1304
|
-
/**
|
|
1305
|
-
* ファイルの最終更新日時を取得
|
|
1269
|
+
* Move file to archive and return new reference
|
|
1306
1270
|
*/
|
|
1307
|
-
|
|
1271
|
+
archive(archiveDirectoryName?: string): Promise<DocFileMdReference<T>>;
|
|
1308
1272
|
/**
|
|
1309
|
-
*
|
|
1273
|
+
* Restore file from archive and return new reference
|
|
1310
1274
|
*/
|
|
1311
|
-
|
|
1275
|
+
restore(archiveDirectoryName?: string): Promise<DocFileMdReference<T>>;
|
|
1312
1276
|
/**
|
|
1313
|
-
*
|
|
1277
|
+
* Get file size in bytes
|
|
1314
1278
|
*/
|
|
1315
|
-
|
|
1279
|
+
size(): Promise<number>;
|
|
1316
1280
|
/**
|
|
1317
|
-
*
|
|
1281
|
+
* Get file last modified time
|
|
1318
1282
|
*/
|
|
1319
|
-
|
|
1283
|
+
lastModified(): Promise<Date>;
|
|
1320
1284
|
/**
|
|
1321
|
-
*
|
|
1285
|
+
* Get file creation time
|
|
1322
1286
|
*/
|
|
1323
|
-
|
|
1287
|
+
createdAt(): Promise<Date>;
|
|
1288
|
+
directory(): DocDirectoryReference<T>;
|
|
1324
1289
|
/**
|
|
1325
|
-
*
|
|
1290
|
+
* Get relation based on schema
|
|
1326
1291
|
*/
|
|
1327
|
-
|
|
1292
|
+
relation<U extends DocCustomSchema = DocCustomSchema>(key: RelationKeys<T>, targetSchema?: U): Promise<DocFileMdReference<U> | Error | null>;
|
|
1328
1293
|
/**
|
|
1329
|
-
*
|
|
1294
|
+
* Get index.md in the same directory
|
|
1330
1295
|
*/
|
|
1331
|
-
|
|
1296
|
+
directoryIndex(): Promise<DocFileIndexReference<T> | null>;
|
|
1332
1297
|
/**
|
|
1333
|
-
*
|
|
1298
|
+
* Get multiple relations based on schema
|
|
1334
1299
|
*/
|
|
1335
|
-
|
|
1300
|
+
relations<U extends DocCustomSchema = DocCustomSchema>(key: MultiRelationKeys<T>, customSchema?: U): Promise<DocFileMdReference<U>[]>;
|
|
1336
1301
|
/**
|
|
1337
|
-
* FrontMatter
|
|
1302
|
+
* File: Markdown > FrontMatter
|
|
1338
1303
|
*/
|
|
1339
|
-
readFrontMatter
|
|
1304
|
+
readFrontMatter(): Promise<DocFileMdMetaValue<T> | Error>;
|
|
1340
1305
|
/**
|
|
1341
|
-
* FrontMatter
|
|
1306
|
+
* File: Markdown > FrontMatter
|
|
1342
1307
|
*/
|
|
1343
|
-
updateFrontMatter<
|
|
1308
|
+
updateFrontMatter<K extends keyof T>(key: K, value: BaseFieldValueType<ExtractFieldType<T[K]>>): Promise<this | Error>;
|
|
1344
1309
|
}
|
|
1345
1310
|
|
|
1346
1311
|
/**
|
|
1347
|
-
*
|
|
1312
|
+
* Unknown file entity
|
|
1348
1313
|
*/
|
|
1349
1314
|
declare class DocFileUnknownEntity {
|
|
1350
1315
|
readonly value: DocFileUnknown;
|
|
1351
1316
|
constructor(value: DocFileUnknown);
|
|
1352
1317
|
/**
|
|
1353
|
-
*
|
|
1318
|
+
* Content
|
|
1354
1319
|
*/
|
|
1355
1320
|
get content(): string;
|
|
1356
1321
|
/**
|
|
1357
|
-
*
|
|
1322
|
+
* Path information
|
|
1358
1323
|
*/
|
|
1359
1324
|
get path(): DocFilePath;
|
|
1360
1325
|
/**
|
|
1361
|
-
*
|
|
1326
|
+
* Update content
|
|
1362
1327
|
*/
|
|
1363
1328
|
withContent(content: string): DocFileUnknownEntity;
|
|
1364
1329
|
/**
|
|
1365
|
-
*
|
|
1330
|
+
* Update path
|
|
1366
1331
|
*/
|
|
1367
1332
|
withPath(path: DocFilePath): DocFileUnknownEntity;
|
|
1368
1333
|
toJson(): DocFileUnknown;
|
|
@@ -1372,9 +1337,10 @@ type Props$5 = {
|
|
|
1372
1337
|
path: string;
|
|
1373
1338
|
fileSystem: DocFileSystem;
|
|
1374
1339
|
pathSystem: DocPathSystem;
|
|
1340
|
+
config: DocClientConfig;
|
|
1375
1341
|
};
|
|
1376
1342
|
/**
|
|
1377
|
-
*
|
|
1343
|
+
* File reference
|
|
1378
1344
|
*/
|
|
1379
1345
|
declare class DocFileUnknownReference {
|
|
1380
1346
|
private readonly props;
|
|
@@ -1386,78 +1352,83 @@ declare class DocFileUnknownReference {
|
|
|
1386
1352
|
get directoryPath(): string;
|
|
1387
1353
|
get fileFullPath(): string;
|
|
1388
1354
|
get durectoryPath(): string;
|
|
1389
|
-
directory(): DocDirectoryReference
|
|
1390
|
-
|
|
1355
|
+
directory<T extends DocCustomSchema>(customSchema: T): DocDirectoryReference<T>;
|
|
1356
|
+
directory(): DocDirectoryReference<DocCustomSchema>;
|
|
1357
|
+
read(): Promise<Error | DocFileUnknownEntity>;
|
|
1391
1358
|
/**
|
|
1392
|
-
*
|
|
1359
|
+
* Read file content
|
|
1393
1360
|
*/
|
|
1394
1361
|
readContent(): Promise<Error | string>;
|
|
1395
1362
|
/**
|
|
1396
|
-
*
|
|
1363
|
+
* Write content to file
|
|
1397
1364
|
*/
|
|
1398
1365
|
writeContent(content: string): Promise<void>;
|
|
1399
1366
|
/**
|
|
1400
|
-
*
|
|
1367
|
+
* Write entity
|
|
1401
1368
|
*/
|
|
1402
1369
|
write(entity: DocFileUnknownEntity): Promise<void>;
|
|
1403
1370
|
/**
|
|
1404
|
-
*
|
|
1371
|
+
* Write raw content
|
|
1405
1372
|
*/
|
|
1406
1373
|
writeRaw(content: string): Promise<void>;
|
|
1407
1374
|
/**
|
|
1408
|
-
*
|
|
1375
|
+
* Delete file
|
|
1409
1376
|
*/
|
|
1410
1377
|
delete(): Promise<Error | null>;
|
|
1411
1378
|
/**
|
|
1412
|
-
*
|
|
1379
|
+
* Check if file exists
|
|
1413
1380
|
*/
|
|
1414
1381
|
exists(): Promise<boolean>;
|
|
1415
1382
|
/**
|
|
1416
|
-
*
|
|
1383
|
+
* Copy file
|
|
1417
1384
|
*/
|
|
1418
1385
|
copyTo(destinationPath: string): Promise<void>;
|
|
1419
1386
|
/**
|
|
1420
|
-
*
|
|
1387
|
+
* Move file
|
|
1421
1388
|
*/
|
|
1422
1389
|
moveTo(destinationPath: string): Promise<void>;
|
|
1423
1390
|
/**
|
|
1424
|
-
*
|
|
1391
|
+
* Get file size in bytes
|
|
1425
1392
|
*/
|
|
1426
1393
|
size(): Promise<number>;
|
|
1427
1394
|
/**
|
|
1428
|
-
*
|
|
1395
|
+
* Get file last modified time
|
|
1429
1396
|
*/
|
|
1430
1397
|
lastModified(): Promise<Date>;
|
|
1431
1398
|
/**
|
|
1432
|
-
*
|
|
1399
|
+
* Get file creation time
|
|
1433
1400
|
*/
|
|
1434
1401
|
createdAt(): Promise<Date>;
|
|
1435
1402
|
/**
|
|
1436
|
-
*
|
|
1403
|
+
* Move file to archive and return new reference
|
|
1437
1404
|
*/
|
|
1438
1405
|
archive(archiveDirectoryName?: string): Promise<DocFileUnknownReference>;
|
|
1439
1406
|
/**
|
|
1440
|
-
*
|
|
1407
|
+
* Restore file from archive and return new reference
|
|
1441
1408
|
*/
|
|
1442
1409
|
restore(archiveDirectoryName?: string): Promise<DocFileUnknownReference>;
|
|
1443
1410
|
}
|
|
1444
1411
|
|
|
1445
|
-
type Props$4 = {
|
|
1412
|
+
type Props$4<T extends DocCustomSchema> = {
|
|
1413
|
+
customSchema: T;
|
|
1446
1414
|
path: string;
|
|
1447
1415
|
indexFileName: string;
|
|
1448
1416
|
archiveDirectoryName: string;
|
|
1449
1417
|
fileSystem: DocFileSystem;
|
|
1450
1418
|
pathSystem: DocPathSystem;
|
|
1419
|
+
config: DocClientConfig;
|
|
1451
1420
|
};
|
|
1452
1421
|
/**
|
|
1453
|
-
*
|
|
1422
|
+
* Directory reference
|
|
1454
1423
|
*/
|
|
1455
|
-
declare class DocDirectoryReference {
|
|
1424
|
+
declare class DocDirectoryReference<T extends DocCustomSchema> {
|
|
1456
1425
|
private readonly props;
|
|
1457
1426
|
private readonly pathSystem;
|
|
1458
|
-
|
|
1427
|
+
private readonly customSchema;
|
|
1428
|
+
constructor(props: Props$4<T>);
|
|
1459
1429
|
get fileSystem(): DocFileSystem;
|
|
1460
1430
|
get basePath(): string;
|
|
1431
|
+
get config(): DocClientConfig;
|
|
1461
1432
|
get relativePath(): string;
|
|
1462
1433
|
get absolutePath(): string;
|
|
1463
1434
|
get indexFileName(): string;
|
|
@@ -1465,57 +1436,39 @@ declare class DocDirectoryReference {
|
|
|
1465
1436
|
get archiveDirectoryName(): string;
|
|
1466
1437
|
fileNames(): Promise<string[]>;
|
|
1467
1438
|
archivedFileNames(): Promise<string[]>;
|
|
1468
|
-
filesGenerator(): AsyncGenerator<DocFileMdReference | DocFileUnknownReference, void, unknown>;
|
|
1469
|
-
mdFilesGenerator(): AsyncGenerator<DocFileMdReference
|
|
1470
|
-
files(): Promise<(DocFileMdReference | DocFileUnknownReference)[]>;
|
|
1471
|
-
mdFiles(): Promise<DocFileMdReference[]>;
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
reference: DocFileMdReference;
|
|
1477
|
-
frontMatter: DocFrontMatterMdValue<T> | Error;
|
|
1478
|
-
}[]>;
|
|
1479
|
-
file(fileName: string): DocFileMdReference | DocFileUnknownReference;
|
|
1480
|
-
mdFile(fileName: string): DocFileMdReference;
|
|
1481
|
-
readFiles(): Promise<(DocFileMdEntity | DocFileUnknownEntity)[]>;
|
|
1482
|
-
readMdFiles(): Promise<DocFileMdEntity[]>;
|
|
1483
|
-
/**
|
|
1484
|
-
* Zodスキーマを使って型安全にMarkdownファイルのFrontMatterを読み込む
|
|
1485
|
-
*/
|
|
1486
|
-
readMdFilesWithSchema<T extends FrontMatterSchema = typeof zDocFileMdFrontMatter>(zodSchema: T): Promise<{
|
|
1487
|
-
entity: DocFileMdEntity;
|
|
1488
|
-
frontMatter: DocFrontMatterMdValue<T>;
|
|
1489
|
-
}[]>;
|
|
1439
|
+
filesGenerator(): AsyncGenerator<DocFileMdReference<T> | DocFileUnknownReference, void, unknown>;
|
|
1440
|
+
mdFilesGenerator(): AsyncGenerator<DocFileMdReference<T>, void, unknown>;
|
|
1441
|
+
files(): Promise<(DocFileMdReference<T> | DocFileUnknownReference)[]>;
|
|
1442
|
+
mdFiles(): Promise<DocFileMdReference<T>[]>;
|
|
1443
|
+
file(fileName: string): Promise<DocFileMdReference<T> | DocFileUnknownReference>;
|
|
1444
|
+
mdFile(fileName: string): Promise<DocFileMdReference<T>>;
|
|
1445
|
+
readFiles(): Promise<(DocFileMdEntity<T> | DocFileUnknownEntity)[]>;
|
|
1446
|
+
readMdFiles(): Promise<DocFileMdEntity<T>[]>;
|
|
1490
1447
|
readUnknownFiles(): Promise<DocFileUnknownEntity[]>;
|
|
1491
1448
|
/**
|
|
1492
|
-
*
|
|
1449
|
+
* Get list of subdirectory names
|
|
1493
1450
|
*/
|
|
1494
1451
|
directoryNames(): Promise<string[]>;
|
|
1495
1452
|
/**
|
|
1496
|
-
*
|
|
1453
|
+
* Get subdirectory references
|
|
1497
1454
|
*/
|
|
1498
|
-
directories(): Promise<DocDirectoryReference[]>;
|
|
1455
|
+
directories(): Promise<DocDirectoryReference<never>[]>;
|
|
1499
1456
|
/**
|
|
1500
|
-
*
|
|
1457
|
+
* Get single subdirectory reference
|
|
1501
1458
|
*/
|
|
1502
|
-
directory(directoryName: string): DocDirectoryReference
|
|
1503
|
-
indexFile(): DocFileIndexReference
|
|
1504
|
-
readIndexFile(): Promise<DocFileIndexEntity
|
|
1505
|
-
writeFile(entity: DocFileIndexEntity |
|
|
1459
|
+
directory(directoryName: string): DocDirectoryReference<T>;
|
|
1460
|
+
indexFile(): DocFileIndexReference<T>;
|
|
1461
|
+
readIndexFile(): Promise<DocFileIndexEntity<T>>;
|
|
1462
|
+
writeFile(entity: DocFileIndexEntity<T> | DocFileMdEntity<T> | DocFileUnknownEntity): Promise<Error | null>;
|
|
1506
1463
|
exists(): Promise<boolean>;
|
|
1507
1464
|
/**
|
|
1508
|
-
*
|
|
1509
|
-
*/
|
|
1510
|
-
private generateUniqueFileName;
|
|
1511
|
-
/**
|
|
1512
|
-
* 指定されたファイル名のファイルが存在するかチェック
|
|
1465
|
+
* Generate unique filename
|
|
1513
1466
|
*/
|
|
1514
|
-
private
|
|
1467
|
+
private uniqueFileName;
|
|
1515
1468
|
/**
|
|
1516
|
-
*
|
|
1469
|
+
* Create new Markdown file
|
|
1517
1470
|
*/
|
|
1518
|
-
createMdFile(fileName?: string): Promise<DocFileMdReference
|
|
1471
|
+
createMdFile(fileName?: string): Promise<DocFileMdReference<T>>;
|
|
1519
1472
|
}
|
|
1520
1473
|
|
|
1521
1474
|
type Props$3 = {
|
|
@@ -1525,7 +1478,7 @@ type Props$3 = {
|
|
|
1525
1478
|
title: string;
|
|
1526
1479
|
};
|
|
1527
1480
|
/**
|
|
1528
|
-
*
|
|
1481
|
+
* Tree file node value object
|
|
1529
1482
|
*/
|
|
1530
1483
|
declare class DocTreeFileNodeValue {
|
|
1531
1484
|
private readonly props;
|
|
@@ -1536,28 +1489,30 @@ declare class DocTreeFileNodeValue {
|
|
|
1536
1489
|
get title(): string;
|
|
1537
1490
|
get type(): "file";
|
|
1538
1491
|
/**
|
|
1539
|
-
*
|
|
1492
|
+
* Convert to plain object
|
|
1540
1493
|
*/
|
|
1541
1494
|
toJson(): DocTreeFileNode;
|
|
1542
1495
|
/**
|
|
1543
|
-
*
|
|
1496
|
+
* Create from properties
|
|
1544
1497
|
*/
|
|
1545
1498
|
static from(props: Props$3): DocTreeFileNodeValue;
|
|
1546
1499
|
/**
|
|
1547
|
-
* JSON
|
|
1500
|
+
* Create from JSON object
|
|
1548
1501
|
*/
|
|
1549
1502
|
static fromJson(json: unknown): DocTreeFileNodeValue;
|
|
1550
1503
|
}
|
|
1551
1504
|
|
|
1505
|
+
type DocTreeNodeValue = DocTreeFileNodeValue | DocTreeDirectoryNodeValue;
|
|
1506
|
+
|
|
1552
1507
|
type Props$2 = {
|
|
1553
1508
|
name: string;
|
|
1554
1509
|
path: string;
|
|
1555
1510
|
icon: string;
|
|
1556
1511
|
title: string;
|
|
1557
|
-
children:
|
|
1512
|
+
children: DocTreeNodeValue[];
|
|
1558
1513
|
};
|
|
1559
1514
|
/**
|
|
1560
|
-
*
|
|
1515
|
+
* Tree directory node value object
|
|
1561
1516
|
*/
|
|
1562
1517
|
declare class DocTreeDirectoryNodeValue {
|
|
1563
1518
|
private readonly props;
|
|
@@ -1566,18 +1521,18 @@ declare class DocTreeDirectoryNodeValue {
|
|
|
1566
1521
|
get path(): string;
|
|
1567
1522
|
get icon(): string;
|
|
1568
1523
|
get title(): string;
|
|
1569
|
-
get children():
|
|
1524
|
+
get children(): DocTreeNodeValue[];
|
|
1570
1525
|
get type(): "directory";
|
|
1571
1526
|
/**
|
|
1572
|
-
*
|
|
1527
|
+
* Convert to plain object
|
|
1573
1528
|
*/
|
|
1574
1529
|
toJson(): DocTreeDirectoryNode;
|
|
1575
1530
|
/**
|
|
1576
|
-
*
|
|
1531
|
+
* Create from properties
|
|
1577
1532
|
*/
|
|
1578
1533
|
static from(props: Props$2): DocTreeDirectoryNodeValue;
|
|
1579
1534
|
/**
|
|
1580
|
-
* JSON
|
|
1535
|
+
* Create from JSON object
|
|
1581
1536
|
*/
|
|
1582
1537
|
static fromJson(json: unknown): DocTreeDirectoryNodeValue;
|
|
1583
1538
|
}
|
|
@@ -1587,83 +1542,85 @@ type Props$1 = {
|
|
|
1587
1542
|
pathSystem: DocPathSystem;
|
|
1588
1543
|
indexFileName: string;
|
|
1589
1544
|
archiveDirectoryName: string;
|
|
1545
|
+
config: DocClientConfig;
|
|
1590
1546
|
};
|
|
1591
1547
|
/**
|
|
1592
|
-
*
|
|
1548
|
+
* File tree building system
|
|
1593
1549
|
*/
|
|
1594
1550
|
declare class DocFileTreeSystem {
|
|
1595
1551
|
private readonly props;
|
|
1552
|
+
private readonly config;
|
|
1596
1553
|
constructor(props: Props$1);
|
|
1597
1554
|
/**
|
|
1598
|
-
*
|
|
1555
|
+
* Build file tree recursively
|
|
1599
1556
|
*/
|
|
1600
|
-
buildFileTree(directoryPath?: string): Promise<
|
|
1557
|
+
buildFileTree(directoryPath?: string): Promise<DocTreeNodeValue[]>;
|
|
1601
1558
|
/**
|
|
1602
|
-
*
|
|
1559
|
+
* Create file node
|
|
1603
1560
|
*/
|
|
1604
1561
|
private createFileNode;
|
|
1605
1562
|
/**
|
|
1606
|
-
*
|
|
1563
|
+
* Create directory node
|
|
1607
1564
|
*/
|
|
1608
1565
|
private createDirectoryNode;
|
|
1609
1566
|
/**
|
|
1610
|
-
*
|
|
1567
|
+
* Create index file reference
|
|
1611
1568
|
*/
|
|
1612
1569
|
private createIndexFileReference;
|
|
1613
1570
|
/**
|
|
1614
|
-
* MD
|
|
1571
|
+
* Create MD file reference
|
|
1615
1572
|
*/
|
|
1616
1573
|
private createMdFileReference;
|
|
1617
1574
|
/**
|
|
1618
|
-
*
|
|
1575
|
+
* Build directory tree recursively (directories only)
|
|
1619
1576
|
*/
|
|
1620
1577
|
buildDirectoryTree(directoryPath?: string): Promise<DocTreeDirectoryNodeValue[]>;
|
|
1621
1578
|
/**
|
|
1622
|
-
*
|
|
1579
|
+
* Create directory node for directory tree
|
|
1623
1580
|
*/
|
|
1624
1581
|
private createDirectoryNodeForTree;
|
|
1625
1582
|
}
|
|
1626
1583
|
|
|
1627
1584
|
/**
|
|
1628
|
-
* Markdown
|
|
1585
|
+
* Markdown parsing and processing system
|
|
1629
1586
|
*/
|
|
1630
1587
|
declare class DocMarkdownSystem {
|
|
1631
1588
|
private readonly frontMatterSeparator;
|
|
1632
1589
|
constructor();
|
|
1633
1590
|
/**
|
|
1634
|
-
* FrontMatter
|
|
1591
|
+
* Detect FrontMatter separator line
|
|
1635
1592
|
*/
|
|
1636
1593
|
private detectFrontMatterSeparator;
|
|
1637
1594
|
/**
|
|
1638
|
-
* FrontMatter
|
|
1595
|
+
* Extract FrontMatter
|
|
1639
1596
|
*/
|
|
1640
1597
|
extractFrontMatter(text: string): string | null;
|
|
1641
1598
|
/**
|
|
1642
|
-
* FrontMatter
|
|
1599
|
+
* Extract body without FrontMatter (includes title and description)
|
|
1643
1600
|
*/
|
|
1644
1601
|
extractBody(text: string): string;
|
|
1645
1602
|
/**
|
|
1646
|
-
*
|
|
1603
|
+
* Extract title
|
|
1647
1604
|
*/
|
|
1648
1605
|
extractTitle(text: string): string | null;
|
|
1649
1606
|
/**
|
|
1650
|
-
*
|
|
1607
|
+
* Extract description (first paragraph after title)
|
|
1651
1608
|
*/
|
|
1652
1609
|
extractDescription(text: string): string | null;
|
|
1653
1610
|
/**
|
|
1654
|
-
* body
|
|
1611
|
+
* Update title in body
|
|
1655
1612
|
*/
|
|
1656
1613
|
updateTitle(text: string, newTitle: string): string;
|
|
1657
1614
|
/**
|
|
1658
|
-
* body
|
|
1615
|
+
* Update description in body
|
|
1659
1616
|
*/
|
|
1660
1617
|
updateDescription(text: string, newDescription: string, defaultTitle: string): string;
|
|
1661
1618
|
/**
|
|
1662
|
-
*
|
|
1619
|
+
* Skip empty lines
|
|
1663
1620
|
*/
|
|
1664
1621
|
private skipEmptyLines;
|
|
1665
1622
|
/**
|
|
1666
|
-
* Markdown
|
|
1623
|
+
* Generate Markdown text (title + description + body)
|
|
1667
1624
|
*/
|
|
1668
1625
|
static from(title: string, description: string, body: string): string;
|
|
1669
1626
|
}
|
|
@@ -1674,327 +1631,169 @@ type Props = {
|
|
|
1674
1631
|
markdownSystem?: DocMarkdownSystem;
|
|
1675
1632
|
fileTreeSystem?: DocFileTreeSystem;
|
|
1676
1633
|
/**
|
|
1677
|
-
*
|
|
1634
|
+
* Configuration
|
|
1678
1635
|
*/
|
|
1679
|
-
|
|
1680
|
-
/**
|
|
1681
|
-
* default: "_"
|
|
1682
|
-
*/
|
|
1683
|
-
archiveDirectoryName?: string;
|
|
1636
|
+
config?: DocClientConfig;
|
|
1684
1637
|
};
|
|
1685
1638
|
declare class DocClient {
|
|
1686
1639
|
readonly fileSystem: DocFileSystem;
|
|
1687
1640
|
readonly pathSystem: DocPathSystem;
|
|
1688
1641
|
readonly markdownSystem: DocMarkdownSystem;
|
|
1689
1642
|
readonly fileTreeSystem: DocFileTreeSystem;
|
|
1690
|
-
readonly
|
|
1691
|
-
readonly archiveDirectoryName: string;
|
|
1643
|
+
readonly config: DocClientConfig;
|
|
1692
1644
|
constructor(props: Props);
|
|
1693
1645
|
basePath(): string;
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
* インデックスファイル参照を取得
|
|
1704
|
-
*/
|
|
1705
|
-
indexFile(directoryPath: string): DocFileIndexReference;
|
|
1706
|
-
/**
|
|
1707
|
-
* ディレクトリ参照を取得
|
|
1708
|
-
*/
|
|
1709
|
-
directory(relativePath: string): DocDirectoryReference;
|
|
1710
|
-
/**
|
|
1711
|
-
* ファイルツリーを取得
|
|
1712
|
-
*/
|
|
1713
|
-
fileTree(directoryPath?: string): Promise<(DocTreeFileNode | DocTreeDirectoryNode)[]>;
|
|
1714
|
-
/**
|
|
1715
|
-
* ディレクトリツリーを取得(ディレクトリのみ)
|
|
1716
|
-
*/
|
|
1646
|
+
file(relativePath: string): DocFileMdReference<DocCustomSchema> | DocFileUnknownReference;
|
|
1647
|
+
file<T extends DocCustomSchema>(relativePath: string, customSchema: T): DocFileMdReference<T> | DocFileUnknownReference;
|
|
1648
|
+
mdFile(relativePath: string): DocFileMdReference<DocCustomSchema>;
|
|
1649
|
+
mdFile<T extends DocCustomSchema>(relativePath: string, customSchema: T): DocFileMdReference<T>;
|
|
1650
|
+
indexFile(relativePath: string): DocFileIndexReference<DocCustomSchema>;
|
|
1651
|
+
indexFile<T extends DocCustomSchema>(relativePath: string, customSchema: T): DocFileIndexReference<T>;
|
|
1652
|
+
directory(relativePath: string): DocDirectoryReference<DocCustomSchema>;
|
|
1653
|
+
directory<T extends DocCustomSchema>(relativePath: string, customSchema: T): DocDirectoryReference<T>;
|
|
1654
|
+
fileTree(directoryPath?: string): Promise<DocTreeNode[]>;
|
|
1717
1655
|
directoryTree(directoryPath?: string): Promise<DocTreeDirectoryNode[]>;
|
|
1718
1656
|
}
|
|
1719
1657
|
|
|
1720
1658
|
/**
|
|
1721
|
-
*
|
|
1722
|
-
*/
|
|
1723
|
-
declare class DocContentMdFrontMatterValue {
|
|
1724
|
-
readonly data: Record<string, unknown> | null;
|
|
1725
|
-
readonly yamlText: string;
|
|
1726
|
-
constructor(data: Record<string, unknown> | null, yamlText?: string);
|
|
1727
|
-
/**
|
|
1728
|
-
* YAMLテキストからフロントマターインスタンスを作成
|
|
1729
|
-
*/
|
|
1730
|
-
static fromYamlText(yamlText: string): DocContentMdFrontMatterValue;
|
|
1731
|
-
/**
|
|
1732
|
-
* Markdownテキストからフロントマターインスタンスを作成
|
|
1733
|
-
*/
|
|
1734
|
-
static fromMarkdown(markdownText: string): DocContentMdFrontMatterValue;
|
|
1735
|
-
/**
|
|
1736
|
-
* 空のフロントマターインスタンスを作成
|
|
1737
|
-
*/
|
|
1738
|
-
static empty(): DocContentMdFrontMatterValue;
|
|
1739
|
-
/**
|
|
1740
|
-
* フロントマターデータからインスタンスを作成
|
|
1741
|
-
*/
|
|
1742
|
-
static fromFrontMatter(data: Record<string, unknown>): DocContentMdFrontMatterValue;
|
|
1743
|
-
/**
|
|
1744
|
-
* フロントマターをYAMLテキストに変換
|
|
1745
|
-
*/
|
|
1746
|
-
frontMatterText(): string;
|
|
1747
|
-
/**
|
|
1748
|
-
* フロントマターを更新した新しいインスタンスを作成
|
|
1749
|
-
*/
|
|
1750
|
-
update(draft: Record<string, unknown>): DocContentMdFrontMatterValue;
|
|
1751
|
-
/**
|
|
1752
|
-
* フロントマターが空かどうか
|
|
1753
|
-
*/
|
|
1754
|
-
isEmpty(): boolean;
|
|
1755
|
-
/**
|
|
1756
|
-
* 指定したキーの値を取得
|
|
1757
|
-
*/
|
|
1758
|
-
get(key: string): unknown;
|
|
1759
|
-
/**
|
|
1760
|
-
* 指定したキーが存在するか
|
|
1761
|
-
*/
|
|
1762
|
-
has(key: string): boolean;
|
|
1763
|
-
/**
|
|
1764
|
-
* フロントマターのキー一覧を取得
|
|
1765
|
-
*/
|
|
1766
|
-
keys(): string[];
|
|
1767
|
-
}
|
|
1768
|
-
|
|
1769
|
-
/**
|
|
1770
|
-
* Markdownの解析と生成
|
|
1771
|
-
*/
|
|
1772
|
-
declare class DocContentMdValue {
|
|
1773
|
-
readonly text: string;
|
|
1774
|
-
constructor(text: string);
|
|
1775
|
-
/**
|
|
1776
|
-
* Front Matter
|
|
1777
|
-
*/
|
|
1778
|
-
get frontMatter(): DocContentMdFrontMatterValue;
|
|
1779
|
-
/**
|
|
1780
|
-
* body
|
|
1781
|
-
*/
|
|
1782
|
-
get content(): string;
|
|
1783
|
-
/**
|
|
1784
|
-
* title
|
|
1785
|
-
*/
|
|
1786
|
-
get title(): string;
|
|
1787
|
-
/**
|
|
1788
|
-
* H1の次の段落、またはH1がない場合は最初の段落をdescriptionとして取得する
|
|
1789
|
-
*/
|
|
1790
|
-
get description(): string | null;
|
|
1791
|
-
/**
|
|
1792
|
-
* 新しいフロントマターとコンテンツでMarkdownインスタンスを作成
|
|
1793
|
-
*/
|
|
1794
|
-
static fromProps(props: {
|
|
1795
|
-
frontMatter: Record<string, unknown>;
|
|
1796
|
-
content: string;
|
|
1797
|
-
}): DocContentMdValue;
|
|
1798
|
-
/**
|
|
1799
|
-
* 現在のフロントマターをYAMLテキストに変換する
|
|
1800
|
-
*/
|
|
1801
|
-
frontMatterToText(): string;
|
|
1802
|
-
/**
|
|
1803
|
-
* 現在のフロントマターを更新して新しいMarkdownテキストを生成
|
|
1804
|
-
*/
|
|
1805
|
-
updateFrontMatter(draft: Record<string, unknown>): string;
|
|
1806
|
-
/**
|
|
1807
|
-
* 新しいフロントマターでOpenMarkdownインスタンスを作成
|
|
1808
|
-
*/
|
|
1809
|
-
withFrontMatter(frontMatter: Record<string, unknown>): DocContentMdValue;
|
|
1810
|
-
/**
|
|
1811
|
-
* フロントマターを更新した新しいOpenMarkdownインスタンスを作成
|
|
1812
|
-
*/
|
|
1813
|
-
withUpdatedFrontMatter(draft: Record<string, unknown>): DocContentMdValue;
|
|
1814
|
-
/**
|
|
1815
|
-
* マークダウンをtitle、description、本文の3つの部分に分離する
|
|
1816
|
-
*/
|
|
1817
|
-
private parseContentParts;
|
|
1818
|
-
/**
|
|
1819
|
-
* title、description、本文からマークダウンを構築する
|
|
1820
|
-
*/
|
|
1821
|
-
private buildContent;
|
|
1822
|
-
/**
|
|
1823
|
-
* H1タイトルを更新した新しいOpenMarkdownインスタンスを作成
|
|
1824
|
-
*/
|
|
1825
|
-
withTitle(newTitle: string): DocContentMdValue;
|
|
1826
|
-
/**
|
|
1827
|
-
* H1の次のdescription段落を更新した新しいOpenMarkdownインスタンスを作成
|
|
1828
|
-
* @param newDescription 新しいdescription
|
|
1829
|
-
* @param defaultTitle H1がない場合に使用するデフォルトタイトル
|
|
1830
|
-
*/
|
|
1831
|
-
withDescription(newDescription: string, defaultTitle?: string): DocContentMdValue;
|
|
1832
|
-
}
|
|
1833
|
-
|
|
1834
|
-
/**
|
|
1835
|
-
* ファイルパス情報の値オブジェクト
|
|
1659
|
+
* Value object for file path information
|
|
1836
1660
|
*/
|
|
1837
1661
|
declare class DocFilePathValue {
|
|
1838
1662
|
readonly value: DocFilePath;
|
|
1839
1663
|
private readonly pathSystem;
|
|
1840
1664
|
constructor(value: DocFilePath, pathSystem: DocPathSystem);
|
|
1841
1665
|
/**
|
|
1842
|
-
*
|
|
1666
|
+
* File name without extension
|
|
1843
1667
|
*/
|
|
1844
1668
|
get name(): string;
|
|
1845
1669
|
/**
|
|
1846
|
-
*
|
|
1670
|
+
* File path (relative path)
|
|
1847
1671
|
*/
|
|
1848
1672
|
get path(): string;
|
|
1849
1673
|
/**
|
|
1850
|
-
*
|
|
1674
|
+
* File name with extension
|
|
1851
1675
|
*/
|
|
1852
1676
|
get nameWithExtension(): string;
|
|
1853
1677
|
/**
|
|
1854
|
-
*
|
|
1678
|
+
* Full path (absolute path)
|
|
1855
1679
|
*/
|
|
1856
1680
|
get fullPath(): string;
|
|
1857
1681
|
/**
|
|
1858
|
-
*
|
|
1682
|
+
* Directory path
|
|
1859
1683
|
*/
|
|
1860
1684
|
get directoryPath(): string;
|
|
1861
1685
|
/**
|
|
1862
|
-
*
|
|
1686
|
+
* Extension
|
|
1863
1687
|
*/
|
|
1864
1688
|
get extension(): string;
|
|
1865
1689
|
/**
|
|
1866
|
-
*
|
|
1690
|
+
* Whether the file is archived
|
|
1867
1691
|
*/
|
|
1868
1692
|
get isArchived(): boolean;
|
|
1869
1693
|
/**
|
|
1870
|
-
*
|
|
1694
|
+
* Create instance from relative path (DI support)
|
|
1871
1695
|
*/
|
|
1872
1696
|
static fromPathWithSystem(filePath: string, pathSystem: DocPathSystem, basePath?: string): DocFilePathValue;
|
|
1873
1697
|
/**
|
|
1874
|
-
* JSON
|
|
1698
|
+
* Export as JSON format
|
|
1875
1699
|
*/
|
|
1876
1700
|
toJson(): DocFilePath;
|
|
1877
1701
|
}
|
|
1878
1702
|
|
|
1879
|
-
type
|
|
1703
|
+
type Value = {
|
|
1880
1704
|
path: string;
|
|
1881
1705
|
name: string;
|
|
1882
1706
|
fullPath: string;
|
|
1883
1707
|
};
|
|
1884
1708
|
/**
|
|
1885
|
-
*
|
|
1709
|
+
* Value object representing a directory path
|
|
1886
1710
|
*/
|
|
1887
1711
|
declare class DocDirectoryPathValue {
|
|
1888
1712
|
private readonly value;
|
|
1889
1713
|
private readonly pathSystem;
|
|
1890
|
-
constructor(value:
|
|
1714
|
+
constructor(value: Value, pathSystem: DocPathSystem);
|
|
1891
1715
|
/**
|
|
1892
|
-
*
|
|
1716
|
+
* Relative directory path
|
|
1893
1717
|
*/
|
|
1894
1718
|
get path(): string;
|
|
1895
1719
|
/**
|
|
1896
|
-
*
|
|
1720
|
+
* Directory name
|
|
1897
1721
|
*/
|
|
1898
1722
|
get name(): string;
|
|
1899
1723
|
/**
|
|
1900
|
-
*
|
|
1724
|
+
* Get parent directory path
|
|
1901
1725
|
*/
|
|
1902
1726
|
get parent(): DocDirectoryPathValue | null;
|
|
1903
1727
|
/**
|
|
1904
|
-
*
|
|
1728
|
+
* Parent directory path
|
|
1905
1729
|
*/
|
|
1906
1730
|
get parentPath(): string;
|
|
1907
1731
|
/**
|
|
1908
|
-
*
|
|
1732
|
+
* Depth (number of directory levels)
|
|
1909
1733
|
*/
|
|
1910
1734
|
get depth(): number;
|
|
1911
1735
|
/**
|
|
1912
|
-
*
|
|
1736
|
+
* Path segments (array of directories)
|
|
1913
1737
|
*/
|
|
1914
1738
|
get segments(): string[];
|
|
1915
1739
|
/**
|
|
1916
|
-
*
|
|
1740
|
+
* Relative path from root (without leading slash)
|
|
1917
1741
|
*/
|
|
1918
1742
|
get normalizedPath(): string;
|
|
1919
1743
|
/**
|
|
1920
|
-
*
|
|
1744
|
+
* Whether this is an archive directory (directory name is "_")
|
|
1921
1745
|
*/
|
|
1922
1746
|
get isArchived(): boolean;
|
|
1923
1747
|
/**
|
|
1924
|
-
*
|
|
1748
|
+
* Whether this is a hidden directory
|
|
1925
1749
|
*/
|
|
1926
1750
|
get isHidden(): boolean;
|
|
1927
1751
|
/**
|
|
1928
|
-
*
|
|
1752
|
+
* Whether this is the root directory
|
|
1929
1753
|
*/
|
|
1930
1754
|
get isRoot(): boolean;
|
|
1931
1755
|
/**
|
|
1932
|
-
*
|
|
1756
|
+
* Absolute path
|
|
1933
1757
|
*/
|
|
1934
1758
|
get fullPath(): string;
|
|
1935
1759
|
/**
|
|
1936
|
-
*
|
|
1760
|
+
* Get index file path
|
|
1937
1761
|
*/
|
|
1938
1762
|
get indexFile(): DocFilePathValue;
|
|
1939
1763
|
/**
|
|
1940
|
-
*
|
|
1764
|
+
* Create file path
|
|
1941
1765
|
*/
|
|
1942
1766
|
file(fileName: string): DocFilePathValue;
|
|
1943
1767
|
/**
|
|
1944
|
-
*
|
|
1768
|
+
* Create subdirectory path
|
|
1945
1769
|
*/
|
|
1946
1770
|
subdirectory(dirName: string): DocDirectoryPathValue;
|
|
1947
1771
|
/**
|
|
1948
|
-
*
|
|
1772
|
+
* Create instance from relative path (DI support)
|
|
1949
1773
|
*/
|
|
1950
1774
|
static fromPathWithSystem(dirPath: string, basePath: string, pathSystem: DocPathSystem): DocDirectoryPathValue;
|
|
1951
1775
|
/**
|
|
1952
|
-
* JSON
|
|
1776
|
+
* Export as JSON format
|
|
1953
1777
|
*/
|
|
1954
|
-
toJson():
|
|
1778
|
+
toJson(): Value;
|
|
1955
1779
|
/**
|
|
1956
|
-
*
|
|
1780
|
+
* Check if paths are equal
|
|
1957
1781
|
*/
|
|
1958
1782
|
equals(other: DocDirectoryPathValue): boolean;
|
|
1959
1783
|
/**
|
|
1960
|
-
*
|
|
1784
|
+
* Check if specified directory is a descendant of this directory
|
|
1961
1785
|
*/
|
|
1962
1786
|
contains(other: DocDirectoryPathValue): boolean;
|
|
1963
1787
|
}
|
|
1964
1788
|
|
|
1965
1789
|
/**
|
|
1966
|
-
*
|
|
1790
|
+
* Multiple value type fields (multi-* types)
|
|
1967
1791
|
*/
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
/**
|
|
1975
|
-
* 未検証のデータから正規化して生成
|
|
1976
|
-
*/
|
|
1977
|
-
fromUnknown(key: string, data: unknown): DocSchemaFieldValue;
|
|
1978
|
-
/**
|
|
1979
|
-
* フィールド定義を正規化
|
|
1980
|
-
*/
|
|
1981
|
-
private normalizeField;
|
|
1982
|
-
/**
|
|
1983
|
-
* デフォルトのテキストフィールドを作成
|
|
1984
|
-
*/
|
|
1985
|
-
private createDefaultTextField;
|
|
1986
|
-
/**
|
|
1987
|
-
* 型名を正規化
|
|
1988
|
-
*/
|
|
1989
|
-
private normalizeType;
|
|
1990
|
-
/**
|
|
1991
|
-
* オブジェクトからプロパティを安全に取得
|
|
1992
|
-
*/
|
|
1993
|
-
private getFieldProperty;
|
|
1994
|
-
/**
|
|
1995
|
-
* 型固有のデフォルト値を取得(イミュータブル)
|
|
1996
|
-
*/
|
|
1997
|
-
private getTypeSpecificDefaults;
|
|
1998
|
-
}
|
|
1792
|
+
type DocSchemaFieldMultipleTypes<T extends RecordKey> = DocSchemaFieldMultiTextValue<T> | DocSchemaFieldMultiNumberValue<T> | DocSchemaFieldMultiSelectTextValue<T> | DocSchemaFieldMultiSelectNumberValue<T> | DocSchemaFieldMultiRelationValue<T>;
|
|
1793
|
+
/**
|
|
1794
|
+
* Single value type fields
|
|
1795
|
+
*/
|
|
1796
|
+
type DocSchemaFieldSingleTypes<T extends RecordKey> = DocSchemaFieldTextSingleValue<T> | DocSchemaFieldNumberSingleValue<T> | DocSchemaFieldBooleanSingleValue<T> | DocSchemaFieldSelectTextSingleValue<T> | DocSchemaFieldSelectNumberSingleValue<T> | DocSchemaFieldRelationSingleValue<T>;
|
|
1797
|
+
type DocSchemaFieldValue<T extends RecordKey> = DocSchemaFieldSingleTypes<T> | DocSchemaFieldMultipleTypes<T>;
|
|
1999
1798
|
|
|
2000
|
-
export { DocClient,
|
|
1799
|
+
export { type BaseFieldValueType, DocClient, type DocClientConfig, type DocClientConfigInput, type DocCustomSchema, type DocCustomSchemaField, type DocCustomSchemaFieldBoolean, type DocCustomSchemaFieldMultiNumber, type DocCustomSchemaFieldMultiRelation, type DocCustomSchemaFieldMultiSelectNumber, type DocCustomSchemaFieldMultiSelectText, type DocCustomSchemaFieldMultiText, type DocCustomSchemaFieldNumber, type DocCustomSchemaFieldRelation, type DocCustomSchemaFieldSelectNumber, type DocCustomSchemaFieldSelectText, type DocCustomSchemaFieldText, type DocDirectory, DocDirectoryPathValue, DocDirectoryReference, type DocFieldMultiNumber, type DocFieldMultiRelation, type DocFieldMultiText, type DocFile, type DocFileIndex, type DocFileIndexContent, DocFileIndexContentValue, DocFileIndexEntity, type DocFileIndexMeta, DocFileIndexMetaValue, DocFileIndexReference, type DocFileIndexSchema, type DocFileIndexSchemaField, DocFileIndexSchemaValue, type DocFileMd, type DocFileMdContent, DocFileMdContentValue, DocFileMdEntity, type DocFileMdMeta, DocFileMdMetaValue, DocFileMdReference, type DocFileNode, type DocFilePath, DocFilePathValue, DocFileRelationReference, DocFileSystem, type DocFileUnknown, DocFileUnknownEntity, DocFileUnknownReference, DocMarkdownSystem, type DocMetaField, type DocMetaFieldBoolean, type DocMetaFieldMultiBoolean, type DocMetaFieldMultiNumber, type DocMetaFieldMultiRelation, type DocMetaFieldMultiSelectNumber, type DocMetaFieldMultiSelectText, type DocMetaFieldMultiText, type DocMetaFieldNumber, type DocMetaFieldRelation, type DocMetaFieldSelectNumber, type DocMetaFieldSelectText, type DocMetaFieldText, type DocMetaFieldType, type DocMetaFieldTypeBoolean, type DocMetaFieldTypeNumber, type DocMetaFieldTypeRelation, type DocMetaFieldTypeSelectNumber, type DocMetaFieldTypeSelectText, type DocMetaFieldTypeText, DocPathSystem, type DocRelation, type DocRelationField, type DocRelationFile, DocRelationFileValue, DocRelationValue, type DocSchemaFieldBoolean, DocSchemaFieldBooleanSingleValue, type DocSchemaFieldMultiSelectNumber, type DocSchemaFieldMultiSelectText, type DocSchemaFieldNumber, DocSchemaFieldMultiNumberValue as DocSchemaFieldNumberMultipleValue, DocSchemaFieldNumberSingleValue, type DocSchemaFieldRelation, DocSchemaFieldMultiRelationValue as DocSchemaFieldRelationMultipleValue, DocSchemaFieldRelationSingleValue, type DocSchemaFieldSelectNumber, DocSchemaFieldMultiSelectNumberValue as DocSchemaFieldSelectNumberMultipleValue, DocSchemaFieldSelectNumberSingleValue, type DocSchemaFieldSelectText, DocSchemaFieldMultiSelectTextValue as DocSchemaFieldSelectTextMultipleValue, DocSchemaFieldSelectTextSingleValue, type DocSchemaFieldText, DocSchemaFieldMultiTextValue as DocSchemaFieldTextMultipleValue, DocSchemaFieldTextSingleValue, type DocSchemaFieldTypeBoolean, type DocSchemaFieldTypeMultiNumber, type DocSchemaFieldTypeMultiRelation, type DocSchemaFieldTypeMultiSelectNumber, type DocSchemaFieldTypeMultiSelectText, type DocSchemaFieldTypeMultiText, type DocSchemaFieldTypeNumber, type DocSchemaFieldTypeRelation, type DocSchemaFieldTypeSelectNumber, type DocSchemaFieldTypeSelectText, type DocSchemaFieldTypeText, type DocSchemaFieldValue, type DocSchemaRelationFieldUnion, type DocTreeDirectoryNode, DocTreeDirectoryNodeValue, type DocTreeFileNode, DocTreeFileNodeValue, type DocTreeNode, type Equals, type ExtractFieldType, type ExtractIndexFieldType, type ExtractRequired, type FieldValueType, DocFileTreeSystem as FileTreeSystem, type GetIndexFieldType, type GetIndexFieldValueType, type GetValueType, type MultiRelationKeys, type OptionalKeys, type RecordKey, type RelationKeys, type RequiredKeys, type SchemaToValueType, zDocClientConfig, zDocCustomSchemaField, zDocCustomSchemaFieldBoolean, zDocCustomSchemaFieldMultiNumber, zDocCustomSchemaFieldMultiRelation, zDocCustomSchemaFieldMultiSelectNumber, zDocCustomSchemaFieldMultiSelectText, zDocCustomSchemaFieldMultiText, zDocCustomSchemaFieldNumber, zDocCustomSchemaFieldRelation, zDocCustomSchemaFieldSelectNumber, zDocCustomSchemaFieldSelectText, zDocCustomSchemaFieldText, zDocFileIndexSchemaField, zDocFilePath, zDocFileUnknown, zDocMetaField, zDocMetaFieldBoolean, zDocMetaFieldMultiBoolean, zDocMetaFieldMultiNumber, zDocMetaFieldMultiRelation, zDocMetaFieldMultiSelectNumber, zDocMetaFieldMultiSelectText, zDocMetaFieldMultiText, zDocMetaFieldNumber, zDocMetaFieldRelation, zDocMetaFieldSelectNumber, zDocMetaFieldSelectText, zDocMetaFieldText, zDocMetaFieldType, zDocMetaFieldTypeBoolean, zDocMetaFieldTypeNumber, zDocMetaFieldTypeRelation, zDocMetaFieldTypeSelectNumber, zDocMetaFieldTypeSelectText, zDocMetaFieldTypeText, zDocRelation, zDocRelationField, zDocRelationFile, zDocSchemaFieldBoolean, zDocSchemaFieldMultiNumber, zDocSchemaFieldMultiRelation, zDocSchemaFieldMultiSelectNumber, zDocSchemaFieldMultiSelectText, zDocSchemaFieldMultiText, zDocSchemaFieldNumber, zDocSchemaFieldRelation, zDocSchemaFieldSelectNumber, zDocSchemaFieldSelectText, zDocSchemaFieldText };
|