@interactive-inc/docs-client 0.0.10 → 0.0.13
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 +888 -1171
- package/build/index.js +2968 -2524
- package/build/models.d.ts +386 -103
- package/build/models.js +217 -80
- package/debug/debug.ts +40 -0
- package/package.json +2 -2
- 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, zDocFileIndexMetaInput, zDocFileIndexSchema, zDocFileIndexSchemaInput, zDocFileMd, zDocFileMdContent, zDocFileMdContentInput, zDocFileMdInput, zDocFileMdMeta, zDocFileMdMetaInput, 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パッケージの型を再エクスポート)
|
|
143
|
+
* Single boolean type schema field
|
|
305
144
|
*/
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
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スキーマを生成するビルダー
|
|
428
|
-
*/
|
|
429
|
-
declare class DocSchemaBuilder {
|
|
430
|
-
/**
|
|
431
|
-
* 動的にZodスキーマを生成
|
|
432
|
-
*/
|
|
433
|
-
createDynamicSchema(value: unknown): z.ZodTypeAny;
|
|
145
|
+
declare class DocSchemaFieldBooleanValue<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): DocSchemaFieldBooleanValue<RecordKey>;
|
|
163
|
+
static normalize(key: RecordKey, record: Record<RecordKey, unknown>): DocSchemaFieldBooleanValue<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: DocSchemaFieldMultiNumber;
|
|
172
|
+
constructor(key: T, value: DocSchemaFieldMultiNumber);
|
|
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: DocSchemaFieldMultiRelation;
|
|
196
|
+
constructor(key: T, value: DocSchemaFieldMultiRelation);
|
|
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: DocSchemaFieldMultiText;
|
|
273
|
+
constructor(key: T, value: DocSchemaFieldMultiText);
|
|
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
|
|
556
|
-
readonly key:
|
|
294
|
+
declare class DocSchemaFieldNumberValue<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): DocSchemaFieldNumberValue<RecordKey>;
|
|
312
|
+
static normalize(key: RecordKey, record: Record<RecordKey, unknown>): DocSchemaFieldNumberValue<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 DocSchemaFieldRelationValue<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): DocSchemaFieldRelationValue<RecordKey>;
|
|
337
|
+
static normalize(key: RecordKey, record: Record<RecordKey, unknown>): DocSchemaFieldRelationValue<RecordKey>;
|
|
596
338
|
}
|
|
597
339
|
|
|
598
340
|
/**
|
|
599
|
-
*
|
|
341
|
+
* Single select number type schema field
|
|
600
342
|
*/
|
|
601
|
-
declare class
|
|
602
|
-
readonly key:
|
|
343
|
+
declare class DocSchemaFieldSelectNumberValue<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,43 +355,21 @@ 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): DocSchemaFieldSelectNumberValue<T>;
|
|
363
|
+
static normalize(key: RecordKey, record: Record<RecordKey, unknown>): DocSchemaFieldSelectNumberValue<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: DocSchemaFieldMultiSelectText;
|
|
628
|
-
constructor(key: string, value: DocSchemaFieldMultiSelectText);
|
|
629
|
-
get type(): "multi-select-text";
|
|
630
|
-
get required(): boolean;
|
|
631
|
-
get title(): string;
|
|
632
|
-
get description(): string;
|
|
633
|
-
get default(): string[] | null;
|
|
634
|
-
get options(): string[];
|
|
635
|
-
readonly isArray = true;
|
|
636
|
-
readonly isSingle = false;
|
|
637
|
-
readonly isSelect = true;
|
|
638
|
-
readonly isTextSelect = true;
|
|
639
|
-
/**
|
|
640
|
-
* 値を検証する
|
|
641
|
-
*/
|
|
642
|
-
validate(value: unknown): boolean;
|
|
643
|
-
toJson(): DocSchemaField;
|
|
644
|
-
}
|
|
645
|
-
|
|
646
|
-
/**
|
|
647
|
-
* 単一選択テキスト型スキーマフィールド
|
|
648
|
-
*/
|
|
649
|
-
declare class DocSchemaFieldSelectTextSingleValue {
|
|
650
|
-
readonly key: string;
|
|
369
|
+
declare class DocSchemaFieldSelectTextValue<T extends RecordKey> {
|
|
370
|
+
readonly key: T;
|
|
651
371
|
readonly value: DocSchemaFieldSelectText;
|
|
652
|
-
constructor(key:
|
|
372
|
+
constructor(key: T, value: DocSchemaFieldSelectText);
|
|
653
373
|
get type(): "select-text";
|
|
654
374
|
get required(): boolean;
|
|
655
375
|
get title(): string;
|
|
@@ -660,42 +380,22 @@ declare class DocSchemaFieldSelectTextSingleValue {
|
|
|
660
380
|
readonly isSingle = true;
|
|
661
381
|
readonly isSelect = true;
|
|
662
382
|
readonly isTextSelect = true;
|
|
663
|
-
toJson():
|
|
383
|
+
toJson(): DocFileIndexSchemaField;
|
|
664
384
|
/**
|
|
665
|
-
*
|
|
385
|
+
* Validate value type
|
|
666
386
|
*/
|
|
667
387
|
validate(value: unknown): boolean;
|
|
388
|
+
static empty<T extends RecordKey>(key: T): DocSchemaFieldSelectTextValue<T>;
|
|
389
|
+
static normalize(key: RecordKey, record: Record<RecordKey, unknown>): DocSchemaFieldSelectTextValue<RecordKey>;
|
|
668
390
|
}
|
|
669
391
|
|
|
670
392
|
/**
|
|
671
|
-
*
|
|
393
|
+
* Single text type schema field
|
|
672
394
|
*/
|
|
673
|
-
declare class
|
|
674
|
-
readonly key:
|
|
675
|
-
readonly value: DocFieldMultiText;
|
|
676
|
-
constructor(key: string, value: DocFieldMultiText);
|
|
677
|
-
get type(): "multi-text";
|
|
678
|
-
get required(): boolean;
|
|
679
|
-
get title(): string;
|
|
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
|
-
|
|
692
|
-
/**
|
|
693
|
-
* 単一テキスト型スキーマフィールド
|
|
694
|
-
*/
|
|
695
|
-
declare class DocSchemaFieldTextSingleValue {
|
|
696
|
-
readonly key: string;
|
|
395
|
+
declare class DocSchemaFieldTextValue<T extends RecordKey> {
|
|
396
|
+
readonly key: T;
|
|
697
397
|
readonly value: DocSchemaFieldText;
|
|
698
|
-
constructor(key:
|
|
398
|
+
constructor(key: T, value: DocSchemaFieldText);
|
|
699
399
|
get type(): "text";
|
|
700
400
|
get required(): boolean;
|
|
701
401
|
get title(): string;
|
|
@@ -704,557 +404,810 @@ declare class DocSchemaFieldTextSingleValue {
|
|
|
704
404
|
readonly isArray = false;
|
|
705
405
|
readonly isSingle = true;
|
|
706
406
|
readonly isText = true;
|
|
707
|
-
toJson():
|
|
407
|
+
toJson(): DocFileIndexSchemaField;
|
|
708
408
|
/**
|
|
709
|
-
*
|
|
409
|
+
* Validate value type
|
|
710
410
|
*/
|
|
711
411
|
validate(value: unknown): boolean;
|
|
412
|
+
static empty(key: RecordKey): DocSchemaFieldTextValue<RecordKey>;
|
|
413
|
+
static normalize(key: RecordKey, record: Record<RecordKey, unknown>): DocSchemaFieldTextValue<RecordKey>;
|
|
712
414
|
}
|
|
713
415
|
|
|
714
416
|
/**
|
|
715
|
-
*
|
|
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 DocSchemaFieldMultiText = z.infer<typeof zDocSchemaFieldMultiText>;
|
|
432
|
+
/**
|
|
433
|
+
* Multi-number field type
|
|
434
|
+
*/
|
|
435
|
+
type DocSchemaFieldMultiNumber = 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 DocSchemaFieldMultiRelation = 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 | DocSchemaFieldMultiRelation;
|
|
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
|
+
* Index file type
|
|
543
|
+
*/
|
|
544
|
+
type DocFileIndex<T extends DocCustomSchema> = {
|
|
545
|
+
type: "index";
|
|
546
|
+
path: DocFilePath;
|
|
547
|
+
isArchived: boolean;
|
|
548
|
+
content: DocFileIndexContent<T>;
|
|
549
|
+
};
|
|
550
|
+
/**
|
|
551
|
+
* Type to check if two types are equal
|
|
552
|
+
*/
|
|
553
|
+
type Equals<T, U> = (<G>() => G extends T ? 1 : 2) extends <G>() => G extends U ? 1 : 2 ? true : false;
|
|
554
|
+
/**
|
|
555
|
+
* Extract relation field keys from schema
|
|
556
|
+
*/
|
|
557
|
+
type RelationKeys<T extends DocCustomSchema> = {
|
|
558
|
+
[K in keyof T]: T[K]["type"] extends "relation" ? K : never;
|
|
559
|
+
}[keyof T];
|
|
560
|
+
/**
|
|
561
|
+
* Extract multi-relation field keys from schema
|
|
562
|
+
*/
|
|
563
|
+
type MultiRelationKeys<T extends DocCustomSchema> = {
|
|
564
|
+
[K in keyof T]: T[K]["type"] extends "multi-relation" ? K : never;
|
|
565
|
+
}[keyof T];
|
|
566
|
+
/**
|
|
567
|
+
* Markdown file type (excluding index.md)
|
|
568
|
+
*/
|
|
569
|
+
type DocFileMd<T extends DocCustomSchema> = {
|
|
570
|
+
type: "markdown";
|
|
571
|
+
path: DocFilePath;
|
|
572
|
+
isArchived: boolean;
|
|
573
|
+
content: DocFileMdContent<T>;
|
|
574
|
+
};
|
|
575
|
+
/**
|
|
576
|
+
* Other file type (non-markdown)
|
|
577
|
+
*/
|
|
578
|
+
type DocFileUnknown = z.infer<typeof zDocFileUnknown>;
|
|
579
|
+
/**
|
|
580
|
+
* File union type (index.md, regular md, other)
|
|
581
|
+
*/
|
|
582
|
+
type DocFile<T extends DocCustomSchema> = DocFileIndex<T> | DocFileMd<T> | DocFileUnknown;
|
|
583
|
+
/**
|
|
584
|
+
* Directory FrontMatter type
|
|
585
|
+
*/
|
|
586
|
+
type DocFileIndexMeta<T extends DocCustomSchema> = {
|
|
587
|
+
type: "index-meta";
|
|
588
|
+
icon: string | null;
|
|
589
|
+
schema: DocFileIndexSchema<keyof T>;
|
|
590
|
+
};
|
|
591
|
+
/**
|
|
592
|
+
* Relation options type
|
|
593
|
+
*/
|
|
594
|
+
type DocRelationFile = z.infer<typeof zDocRelationFile>;
|
|
595
|
+
/**
|
|
596
|
+
* Relation information type
|
|
597
|
+
*/
|
|
598
|
+
type DocRelation = z.infer<typeof zDocRelation>;
|
|
599
|
+
/**
|
|
600
|
+
* Relation field type
|
|
601
|
+
*/
|
|
602
|
+
type DocRelationField = z.infer<typeof zDocRelationField>;
|
|
603
|
+
/**
|
|
604
|
+
* File path information type
|
|
605
|
+
*/
|
|
606
|
+
type DocFilePath = z.infer<typeof zDocFilePath>;
|
|
607
|
+
/**
|
|
608
|
+
* Markdown content information type
|
|
609
|
+
*/
|
|
610
|
+
type DocFileMdContent<T extends DocCustomSchema> = {
|
|
611
|
+
type: "markdown-content";
|
|
612
|
+
body: string;
|
|
613
|
+
title: string;
|
|
614
|
+
description: string;
|
|
615
|
+
meta: SchemaToValueType<T>;
|
|
616
|
+
};
|
|
617
|
+
/**
|
|
618
|
+
* Index file content information type
|
|
619
|
+
*/
|
|
620
|
+
type DocFileIndexContent<T extends DocCustomSchema> = {
|
|
621
|
+
type: "markdown-index";
|
|
622
|
+
body: string;
|
|
623
|
+
title: string;
|
|
624
|
+
description: string;
|
|
625
|
+
meta: DocFileIndexMeta<T>;
|
|
626
|
+
};
|
|
627
|
+
/**
|
|
628
|
+
* Directory response type (re-export from server package)
|
|
629
|
+
*/
|
|
630
|
+
type DocDirectory<T extends DocCustomSchema> = {
|
|
631
|
+
cwd: string;
|
|
632
|
+
indexFile: DocFileIndex<T>;
|
|
633
|
+
files: DocFile<T>[];
|
|
634
|
+
relations: DocRelation[];
|
|
635
|
+
};
|
|
636
|
+
type RecordKey = string | number | symbol;
|
|
637
|
+
/**
|
|
638
|
+
* DocClient configuration
|
|
639
|
+
*/
|
|
640
|
+
type DocClientConfig = z.infer<typeof zDocClientConfig>;
|
|
641
|
+
/**
|
|
642
|
+
* Type definitions for DocFileMdMetaValue
|
|
716
643
|
*/
|
|
717
|
-
type
|
|
644
|
+
type ExtractFieldType<T> = T extends {
|
|
645
|
+
type: infer Type;
|
|
646
|
+
} ? Type : never;
|
|
647
|
+
type ExtractRequired<T> = T extends {
|
|
648
|
+
required: infer Required;
|
|
649
|
+
} ? Required : false;
|
|
650
|
+
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;
|
|
651
|
+
type FieldValueType<Type, Required> = Required extends true ? BaseFieldValueType<Type> : BaseFieldValueType<Type> | null;
|
|
718
652
|
/**
|
|
719
|
-
*
|
|
653
|
+
* Extract required field keys
|
|
720
654
|
*/
|
|
721
|
-
type
|
|
655
|
+
type RequiredKeys<T extends DocCustomSchema> = {
|
|
656
|
+
[K in keyof T]: T[K] extends {
|
|
657
|
+
required: true;
|
|
658
|
+
} ? K : never;
|
|
659
|
+
}[keyof T];
|
|
722
660
|
/**
|
|
723
|
-
*
|
|
661
|
+
* Extract optional field keys
|
|
724
662
|
*/
|
|
725
|
-
type
|
|
663
|
+
type OptionalKeys<T extends DocCustomSchema> = {
|
|
664
|
+
[K in keyof T]: T[K] extends {
|
|
665
|
+
required: true;
|
|
666
|
+
} ? never : K;
|
|
667
|
+
}[keyof T];
|
|
726
668
|
/**
|
|
727
|
-
*
|
|
669
|
+
* Generate expected value type from schema (considering required)
|
|
728
670
|
*/
|
|
729
|
-
type
|
|
671
|
+
type SchemaToValueType<T extends DocCustomSchema> = {
|
|
672
|
+
[K in RequiredKeys<T>]: BaseFieldValueType<ExtractFieldType<T[K]>>;
|
|
673
|
+
} & {
|
|
674
|
+
[K in OptionalKeys<T>]?: BaseFieldValueType<ExtractFieldType<T[K]>>;
|
|
675
|
+
};
|
|
730
676
|
/**
|
|
731
|
-
*
|
|
677
|
+
* Helper type for type-safe property access
|
|
732
678
|
*/
|
|
733
|
-
type
|
|
679
|
+
type GetValueType<T extends DocCustomSchema, K extends keyof T> = K extends RequiredKeys<T> ? BaseFieldValueType<ExtractFieldType<T[K]>> : BaseFieldValueType<ExtractFieldType<T[K]>> | undefined;
|
|
734
680
|
/**
|
|
735
|
-
*
|
|
681
|
+
* Type definitions for DocFileIndexSchema
|
|
736
682
|
*/
|
|
737
|
-
type
|
|
683
|
+
type ExtractIndexFieldType<T> = T extends {
|
|
684
|
+
type: infer Type;
|
|
685
|
+
} ? Type : never;
|
|
686
|
+
type GetIndexFieldType<Schema extends DocFileIndexSchema<RecordKey>, K extends keyof Schema> = Schema[K] extends DocFileIndexSchemaField ? Schema[K] : never;
|
|
687
|
+
type GetIndexFieldValueType<Schema extends DocFileIndexSchema<RecordKey>, K extends keyof Schema> = Schema[K] extends {
|
|
688
|
+
type: infer Type;
|
|
689
|
+
} ? Type extends "text" ? DocSchemaFieldTextValue<K> : Type extends "number" ? DocSchemaFieldNumberValue<K> : Type extends "boolean" ? DocSchemaFieldBooleanValue<K> : Type extends "relation" ? DocSchemaFieldRelationValue<K> : Type extends "select-text" ? DocSchemaFieldSelectTextValue<K> : Type extends "select-number" ? DocSchemaFieldSelectNumberValue<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
690
|
|
|
739
691
|
/**
|
|
740
|
-
*
|
|
741
|
-
* @template T - Zodスキーマの型(オプショナル)
|
|
692
|
+
* Relation file
|
|
742
693
|
*/
|
|
743
|
-
declare class
|
|
744
|
-
readonly value
|
|
745
|
-
|
|
746
|
-
constructor(value: unknown, zodSchema?: T, schemaBuilder?: DocSchemaBuilder);
|
|
694
|
+
declare class DocRelationFileValue {
|
|
695
|
+
private readonly value;
|
|
696
|
+
constructor(value: DocRelationFile);
|
|
747
697
|
/**
|
|
748
|
-
*
|
|
749
|
-
* Zodスキーマを使用している場合は自動的に型安全
|
|
698
|
+
* File path
|
|
750
699
|
*/
|
|
751
|
-
get
|
|
700
|
+
get id(): string;
|
|
752
701
|
/**
|
|
753
|
-
*
|
|
754
|
-
* Zodスキーマを使用している場合は型安全
|
|
702
|
+
* Slug
|
|
755
703
|
*/
|
|
756
|
-
|
|
757
|
-
field(name: string): DocSchemaFieldValue | null;
|
|
704
|
+
get slug(): string;
|
|
758
705
|
/**
|
|
759
|
-
*
|
|
760
|
-
* 注意: 型安全性のため、個別にfield()メソッドを使用することを推奨
|
|
706
|
+
* Display label
|
|
761
707
|
*/
|
|
762
|
-
get
|
|
763
|
-
get relationFields(): (DocSchemaFieldRelationSingleValue | DocSchemaFieldRelationMultipleValue)[];
|
|
708
|
+
get label(): string;
|
|
764
709
|
/**
|
|
765
|
-
*
|
|
710
|
+
* Create from file path and title
|
|
766
711
|
*/
|
|
767
|
-
static
|
|
712
|
+
static from(filePath: string, title: string | null): DocRelationFileValue;
|
|
768
713
|
/**
|
|
769
|
-
*
|
|
714
|
+
* Extract file name from file path (without extension)
|
|
770
715
|
*/
|
|
771
|
-
|
|
716
|
+
private static extractFileName;
|
|
772
717
|
/**
|
|
773
|
-
*
|
|
718
|
+
* Convert to JSON format
|
|
774
719
|
*/
|
|
775
|
-
|
|
720
|
+
toJson(): DocRelationFile;
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
/**
|
|
724
|
+
* Manages relation information
|
|
725
|
+
*/
|
|
726
|
+
declare class DocRelationValue {
|
|
727
|
+
readonly value: DocRelation;
|
|
728
|
+
constructor(value: DocRelation);
|
|
776
729
|
/**
|
|
777
|
-
*
|
|
730
|
+
* Relation path
|
|
778
731
|
*/
|
|
779
|
-
|
|
732
|
+
get path(): string;
|
|
780
733
|
/**
|
|
781
|
-
*
|
|
734
|
+
* List of related files (value objects)
|
|
782
735
|
*/
|
|
783
|
-
|
|
736
|
+
get files(): DocRelationFileValue[];
|
|
784
737
|
/**
|
|
785
|
-
*
|
|
738
|
+
* Get file count
|
|
786
739
|
*/
|
|
787
|
-
|
|
740
|
+
get fileCount(): number;
|
|
788
741
|
/**
|
|
789
|
-
*
|
|
742
|
+
* Whether it's empty
|
|
790
743
|
*/
|
|
791
|
-
|
|
744
|
+
get isEmpty(): boolean;
|
|
792
745
|
/**
|
|
793
|
-
*
|
|
746
|
+
* Create empty relation entity
|
|
794
747
|
*/
|
|
795
|
-
|
|
748
|
+
static empty(path: string): DocRelationValue;
|
|
796
749
|
/**
|
|
797
|
-
*
|
|
750
|
+
* Export as JSON format
|
|
798
751
|
*/
|
|
799
|
-
|
|
752
|
+
toJson(): DocRelation;
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
type Props$8 = {
|
|
756
|
+
filePath: string;
|
|
757
|
+
fileSystem: DocFileSystem;
|
|
758
|
+
pathSystem: DocPathSystem;
|
|
759
|
+
};
|
|
760
|
+
/**
|
|
761
|
+
* Relation file reference
|
|
762
|
+
*/
|
|
763
|
+
declare class DocFileRelationReference {
|
|
764
|
+
private readonly props;
|
|
765
|
+
private readonly pathSystem;
|
|
766
|
+
constructor(props: Props$8);
|
|
767
|
+
get fileSystem(): DocFileSystem;
|
|
768
|
+
get basePath(): string;
|
|
800
769
|
/**
|
|
801
|
-
*
|
|
770
|
+
* Relation path
|
|
802
771
|
*/
|
|
803
|
-
|
|
772
|
+
get path(): string;
|
|
804
773
|
/**
|
|
805
|
-
*
|
|
774
|
+
* Full path
|
|
806
775
|
*/
|
|
807
|
-
|
|
776
|
+
get fullPath(): string;
|
|
777
|
+
read(): Promise<DocRelationValue | null>;
|
|
808
778
|
/**
|
|
809
|
-
*
|
|
779
|
+
* Read list of relation files
|
|
810
780
|
*/
|
|
811
|
-
|
|
781
|
+
readFiles(): Promise<DocRelationFileValue[]>;
|
|
812
782
|
/**
|
|
813
|
-
*
|
|
783
|
+
* Read single relation file
|
|
814
784
|
*/
|
|
815
|
-
|
|
785
|
+
readFile(filePath: string): Promise<DocRelationFileValue | null>;
|
|
816
786
|
/**
|
|
817
|
-
*
|
|
787
|
+
* Check if file exists
|
|
818
788
|
*/
|
|
819
|
-
|
|
789
|
+
exists(slug: string): Promise<boolean>;
|
|
820
790
|
/**
|
|
821
|
-
*
|
|
791
|
+
* Get list of file names (without extension)
|
|
822
792
|
*/
|
|
823
|
-
|
|
793
|
+
readSlugs(): Promise<string[]>;
|
|
824
794
|
/**
|
|
825
|
-
*
|
|
795
|
+
* Get file count
|
|
826
796
|
*/
|
|
827
|
-
|
|
797
|
+
count(): Promise<number>;
|
|
828
798
|
/**
|
|
829
|
-
*
|
|
799
|
+
* Check if empty
|
|
830
800
|
*/
|
|
831
|
-
|
|
801
|
+
isEmpty(): Promise<boolean>;
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
/**
|
|
805
|
+
* Type-safe schema value object
|
|
806
|
+
*/
|
|
807
|
+
declare class DocFileIndexSchemaValue<T extends DocCustomSchema> {
|
|
808
|
+
readonly value: DocFileIndexSchema<keyof T>;
|
|
809
|
+
readonly customSchema: T;
|
|
810
|
+
constructor(value: DocFileIndexSchema<keyof T>, customSchema: T);
|
|
832
811
|
/**
|
|
833
|
-
*
|
|
812
|
+
* Get list of field names
|
|
813
|
+
* Automatically type-safe when using Zod schema
|
|
834
814
|
*/
|
|
835
|
-
|
|
815
|
+
get fieldNames(): Array<keyof T>;
|
|
836
816
|
/**
|
|
837
|
-
*
|
|
817
|
+
* Get field with specified field name
|
|
818
|
+
* Returns type-safe specific field Value object
|
|
838
819
|
*/
|
|
839
|
-
|
|
820
|
+
field<K extends keyof T>(key: K): T[K]["type"] extends infer Type ? Type extends "text" ? DocSchemaFieldTextValue<K> : Type extends "number" ? DocSchemaFieldNumberValue<K> : Type extends "boolean" ? DocSchemaFieldBooleanValue<K> : Type extends "relation" ? DocSchemaFieldRelationValue<K> : Type extends "select-text" ? DocSchemaFieldSelectTextValue<K> : Type extends "select-number" ? DocSchemaFieldSelectNumberValue<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;
|
|
821
|
+
relation<K extends keyof T>(key: K): DocSchemaFieldRelationValue<K>;
|
|
822
|
+
multiRelation<K extends keyof T>(key: K): DocSchemaFieldMultiRelationValue<K>;
|
|
840
823
|
/**
|
|
841
|
-
*
|
|
824
|
+
* Get all fields
|
|
825
|
+
* Note: For type safety, it's recommended to use field() method individually
|
|
842
826
|
*/
|
|
843
|
-
|
|
844
|
-
|
|
827
|
+
get fields(): DocFileIndexSchema<keyof T>[keyof T][];
|
|
828
|
+
get relationFields(): (DocSchemaFieldRelationValue<string> | DocSchemaFieldMultiRelationValue<string>)[];
|
|
829
|
+
toJson(): DocFileIndexSchema<keyof T>;
|
|
845
830
|
/**
|
|
846
|
-
*
|
|
831
|
+
* Create empty schema entity
|
|
832
|
+
* biome-ignore lint/complexity/noBannedTypes: {} as DocCustomSchema
|
|
847
833
|
*/
|
|
848
|
-
|
|
834
|
+
static empty(): DocFileIndexSchemaValue<{}>;
|
|
849
835
|
}
|
|
850
836
|
|
|
851
837
|
/**
|
|
852
|
-
* FrontMatter
|
|
838
|
+
* File: index.md > content > FrontMatter
|
|
853
839
|
*/
|
|
854
|
-
declare class
|
|
855
|
-
readonly value:
|
|
856
|
-
|
|
840
|
+
declare class DocFileIndexMetaValue<T extends DocCustomSchema> {
|
|
841
|
+
readonly value: DocFileIndexMeta<T>;
|
|
842
|
+
readonly customSchema: T;
|
|
843
|
+
private readonly config;
|
|
857
844
|
/**
|
|
858
|
-
*
|
|
845
|
+
* Additional properties to include in the meta data
|
|
859
846
|
*/
|
|
860
|
-
|
|
847
|
+
private readonly additionalProperties;
|
|
848
|
+
constructor(value: DocFileIndexMeta<T>, customSchema: T, config: DocClientConfig, additionalProperties?: Record<string, unknown>);
|
|
861
849
|
/**
|
|
862
|
-
*
|
|
850
|
+
* Get icon
|
|
863
851
|
*/
|
|
864
|
-
|
|
852
|
+
get icon(): string | null;
|
|
865
853
|
/**
|
|
866
|
-
*
|
|
854
|
+
* Get schema
|
|
867
855
|
*/
|
|
868
|
-
|
|
856
|
+
schema(): DocFileIndexSchemaValue<T>;
|
|
869
857
|
/**
|
|
870
|
-
* schema
|
|
858
|
+
* Check if schema is defined
|
|
871
859
|
*/
|
|
872
|
-
|
|
860
|
+
get hasSchema(): boolean;
|
|
873
861
|
/**
|
|
874
|
-
*
|
|
862
|
+
* Update icon field
|
|
875
863
|
*/
|
|
876
|
-
|
|
864
|
+
withIcon(value: string | null): DocFileIndexMetaValue<T>;
|
|
877
865
|
/**
|
|
878
|
-
*
|
|
866
|
+
* Update schema field
|
|
879
867
|
*/
|
|
880
|
-
|
|
868
|
+
withSchema(value: DocFileIndexSchema<keyof T>): DocFileIndexMetaValue<T>;
|
|
881
869
|
/**
|
|
882
|
-
*
|
|
870
|
+
* Output in JSON format
|
|
883
871
|
*/
|
|
884
|
-
|
|
872
|
+
toJson(): DocFileIndexMeta<T>;
|
|
885
873
|
/**
|
|
886
|
-
*
|
|
874
|
+
* Output in YAML format
|
|
887
875
|
*/
|
|
888
|
-
|
|
876
|
+
toYaml(): string;
|
|
889
877
|
/**
|
|
890
|
-
* Markdown
|
|
878
|
+
* Generate from Markdown text (can process incomplete data)
|
|
891
879
|
*/
|
|
892
|
-
static from(markdownText: string):
|
|
880
|
+
static from<T extends DocCustomSchema>(markdownText: string, customSchema: T, config: DocClientConfig): DocFileIndexMetaValue<T>;
|
|
893
881
|
/**
|
|
894
|
-
*
|
|
882
|
+
* Generate directly from data (can process incomplete data)
|
|
895
883
|
*/
|
|
896
|
-
static fromRecord(record: Record<string, unknown
|
|
884
|
+
static fromRecord<T extends DocCustomSchema>(record: Record<string, unknown>, customSchema: T, config: DocClientConfig): DocFileIndexMetaValue<T>;
|
|
897
885
|
/**
|
|
898
|
-
*
|
|
886
|
+
* Generate empty FrontMatter
|
|
899
887
|
*/
|
|
900
|
-
static empty():
|
|
888
|
+
static empty<T extends DocCustomSchema>(customSchema: T, config: DocClientConfig): DocFileIndexMetaValue<T>;
|
|
901
889
|
/**
|
|
902
|
-
*
|
|
890
|
+
* Extract icon
|
|
903
891
|
*/
|
|
904
892
|
private static extractIcon;
|
|
905
893
|
/**
|
|
906
|
-
*
|
|
894
|
+
* Extract schema part
|
|
907
895
|
*/
|
|
908
896
|
private static extractSchema;
|
|
909
897
|
/**
|
|
910
|
-
*
|
|
898
|
+
* Normalize entire schema
|
|
911
899
|
*/
|
|
912
|
-
private static
|
|
900
|
+
private static normalizeSchema;
|
|
901
|
+
static emptySchema<T extends DocCustomSchema>(customSchema: T): DocFileIndexSchema<keyof T>;
|
|
913
902
|
}
|
|
914
903
|
|
|
915
904
|
/**
|
|
916
|
-
*
|
|
905
|
+
* File: index.md > content
|
|
917
906
|
*/
|
|
918
|
-
declare class
|
|
919
|
-
readonly value:
|
|
920
|
-
|
|
907
|
+
declare class DocFileIndexContentValue<T extends DocCustomSchema> {
|
|
908
|
+
readonly value: DocFileIndexContent<T>;
|
|
909
|
+
private readonly customSchema;
|
|
910
|
+
private readonly config;
|
|
911
|
+
constructor(value: DocFileIndexContent<T>, customSchema: T, config: DocClientConfig);
|
|
921
912
|
/**
|
|
922
|
-
*
|
|
913
|
+
* Content body (does not include frontMatter)
|
|
923
914
|
*/
|
|
924
915
|
get body(): string;
|
|
925
916
|
/**
|
|
926
|
-
*
|
|
917
|
+
* Title
|
|
927
918
|
*/
|
|
928
919
|
get title(): string;
|
|
929
920
|
/**
|
|
930
|
-
*
|
|
921
|
+
* Description
|
|
931
922
|
*/
|
|
932
923
|
get description(): string;
|
|
933
924
|
/**
|
|
934
925
|
* FrontMatter
|
|
935
926
|
*/
|
|
936
|
-
|
|
927
|
+
meta(): DocFileIndexMetaValue<T>;
|
|
937
928
|
/**
|
|
938
|
-
*
|
|
929
|
+
* Update title
|
|
939
930
|
*/
|
|
940
|
-
withTitle(title: string):
|
|
931
|
+
withTitle(title: string): DocFileIndexContentValue<T>;
|
|
941
932
|
/**
|
|
942
|
-
*
|
|
933
|
+
* Update description
|
|
943
934
|
*/
|
|
944
|
-
withDescription(description: string, defaultTitle?: string):
|
|
935
|
+
withDescription(description: string, defaultTitle?: string): DocFileIndexContentValue<T>;
|
|
945
936
|
/**
|
|
946
|
-
* Markdown
|
|
937
|
+
* Generate from Markdown text
|
|
947
938
|
*/
|
|
948
|
-
static fromMarkdown(markdown: string):
|
|
939
|
+
static fromMarkdown<T extends DocCustomSchema>(markdown: string, customSchema: T, config: DocClientConfig): DocFileIndexContentValue<T>;
|
|
949
940
|
/**
|
|
950
|
-
*
|
|
941
|
+
* Generate complete Markdown text
|
|
951
942
|
*/
|
|
952
943
|
toMarkdownText(): string;
|
|
953
944
|
/**
|
|
954
|
-
*
|
|
945
|
+
* Update content
|
|
955
946
|
*/
|
|
956
|
-
withContent(content: string):
|
|
947
|
+
withContent(content: string): DocFileIndexContentValue<T>;
|
|
957
948
|
/**
|
|
958
|
-
* FrontMatter
|
|
949
|
+
* Update FrontMatter
|
|
959
950
|
*/
|
|
960
|
-
|
|
951
|
+
withMeta(meta: DocFileIndexMeta<T>): DocFileIndexContentValue<T>;
|
|
961
952
|
/**
|
|
962
|
-
*
|
|
953
|
+
* Generate default index.md content
|
|
963
954
|
*/
|
|
964
|
-
static empty(directoryName: string):
|
|
955
|
+
static empty<T extends DocCustomSchema = DocCustomSchema>(directoryName: string, customSchema: T, config: DocClientConfig): DocFileIndexContentValue<T>;
|
|
965
956
|
/**
|
|
966
|
-
* FrontMatter
|
|
957
|
+
* Generate complete text combining FrontMatter and body
|
|
967
958
|
*/
|
|
968
959
|
toText(): string;
|
|
969
960
|
/**
|
|
970
|
-
* JSON
|
|
961
|
+
* Output in JSON format
|
|
971
962
|
*/
|
|
972
|
-
toJson():
|
|
963
|
+
toJson(): DocFileIndexContent<T>;
|
|
973
964
|
}
|
|
974
965
|
|
|
975
966
|
/**
|
|
976
|
-
*
|
|
967
|
+
* Document directory entity
|
|
977
968
|
*/
|
|
978
|
-
declare class DocFileIndexEntity {
|
|
979
|
-
readonly value: DocFileIndex
|
|
980
|
-
|
|
969
|
+
declare class DocFileIndexEntity<T extends DocCustomSchema> {
|
|
970
|
+
readonly value: DocFileIndex<T>;
|
|
971
|
+
private readonly customSchema;
|
|
972
|
+
private readonly config;
|
|
973
|
+
constructor(value: DocFileIndex<T>, customSchema: T, config?: DocClientConfig);
|
|
981
974
|
/**
|
|
982
|
-
*
|
|
975
|
+
* Content
|
|
983
976
|
*/
|
|
984
|
-
get content():
|
|
977
|
+
get content(): DocFileIndexContentValue<T>;
|
|
985
978
|
/**
|
|
986
|
-
*
|
|
979
|
+
* Path information
|
|
987
980
|
*/
|
|
988
981
|
get path(): DocFilePath;
|
|
989
982
|
/**
|
|
990
|
-
*
|
|
983
|
+
* Update content
|
|
991
984
|
*/
|
|
992
|
-
withContent(content:
|
|
985
|
+
withContent(content: DocFileIndexContentValue<T>): DocFileIndexEntity<T>;
|
|
993
986
|
/**
|
|
994
|
-
*
|
|
987
|
+
* Update path
|
|
995
988
|
*/
|
|
996
|
-
withPath(path: DocFilePath): DocFileIndexEntity
|
|
989
|
+
withPath(path: DocFilePath): DocFileIndexEntity<T>;
|
|
997
990
|
/**
|
|
998
|
-
*
|
|
991
|
+
* Convert to index file schema format
|
|
999
992
|
*/
|
|
1000
|
-
toJson(): DocFileIndex
|
|
993
|
+
toJson(): DocFileIndex<T>;
|
|
1001
994
|
}
|
|
1002
995
|
|
|
1003
|
-
type Props$7 = {
|
|
996
|
+
type Props$7<T extends DocCustomSchema> = {
|
|
997
|
+
customSchema: T;
|
|
1004
998
|
path: string;
|
|
1005
999
|
fileSystem: DocFileSystem;
|
|
1006
1000
|
pathSystem: DocPathSystem;
|
|
1001
|
+
config: DocClientConfig;
|
|
1007
1002
|
};
|
|
1008
1003
|
/**
|
|
1009
|
-
*
|
|
1004
|
+
* File reference class
|
|
1010
1005
|
*/
|
|
1011
|
-
declare class DocFileIndexReference {
|
|
1006
|
+
declare class DocFileIndexReference<T extends DocCustomSchema> {
|
|
1012
1007
|
private readonly props;
|
|
1013
1008
|
private readonly pathSystem;
|
|
1014
|
-
|
|
1009
|
+
private readonly customSchema;
|
|
1010
|
+
constructor(props: Props$7<T>);
|
|
1015
1011
|
get fileSystem(): DocFileSystem;
|
|
1016
1012
|
get basePath(): string;
|
|
1017
1013
|
get filePath(): string;
|
|
1018
1014
|
get fileFullPath(): string;
|
|
1019
1015
|
get durectoryPath(): string;
|
|
1020
|
-
read(): Promise<DocFileIndexEntity
|
|
1016
|
+
read(): Promise<DocFileIndexEntity<T>>;
|
|
1021
1017
|
/**
|
|
1022
|
-
*
|
|
1018
|
+
* Read file content
|
|
1023
1019
|
*/
|
|
1024
1020
|
readContent(): Promise<Error | string>;
|
|
1025
1021
|
/**
|
|
1026
|
-
*
|
|
1022
|
+
* Write content to file
|
|
1027
1023
|
*/
|
|
1028
1024
|
writeContent(content: string): Promise<void>;
|
|
1029
1025
|
/**
|
|
1030
|
-
*
|
|
1026
|
+
* Write entity
|
|
1031
1027
|
*/
|
|
1032
|
-
write(entity: DocFileIndexEntity): Promise<void>;
|
|
1028
|
+
write(entity: DocFileIndexEntity<T>): Promise<void>;
|
|
1033
1029
|
/**
|
|
1034
|
-
*
|
|
1030
|
+
* Create new file with default content
|
|
1035
1031
|
*/
|
|
1036
|
-
writeDefault(): Promise<
|
|
1032
|
+
writeDefault(): Promise<null>;
|
|
1037
1033
|
/**
|
|
1038
|
-
*
|
|
1034
|
+
* Delete file
|
|
1039
1035
|
*/
|
|
1040
1036
|
delete(): Promise<Error | null>;
|
|
1041
1037
|
/**
|
|
1042
|
-
*
|
|
1038
|
+
* Check if file exists
|
|
1043
1039
|
*/
|
|
1044
1040
|
exists(): Promise<boolean>;
|
|
1045
1041
|
relations(): Promise<DocFileRelationReference[]>;
|
|
1046
1042
|
readRelations(): Promise<DocRelationValue[]>;
|
|
1047
1043
|
/**
|
|
1048
|
-
*
|
|
1044
|
+
* Get file size in bytes
|
|
1049
1045
|
*/
|
|
1050
1046
|
size(): Promise<number>;
|
|
1051
1047
|
/**
|
|
1052
|
-
*
|
|
1048
|
+
* Get last modified date
|
|
1053
1049
|
*/
|
|
1054
1050
|
lastModified(): Promise<Date>;
|
|
1055
1051
|
/**
|
|
1056
|
-
*
|
|
1052
|
+
* Get file creation date
|
|
1057
1053
|
*/
|
|
1058
1054
|
createdAt(): Promise<Date>;
|
|
1059
1055
|
/**
|
|
1060
|
-
*
|
|
1056
|
+
* Move file to archive and return new reference
|
|
1061
1057
|
*/
|
|
1062
|
-
archive(archiveDirectoryName?: string): Promise<DocFileIndexReference
|
|
1058
|
+
archive(archiveDirectoryName?: string): Promise<DocFileIndexReference<T>>;
|
|
1063
1059
|
/**
|
|
1064
|
-
*
|
|
1060
|
+
* Restore file from archive and return new reference
|
|
1065
1061
|
*/
|
|
1066
|
-
restore(archiveDirectoryName?: string): Promise<DocFileIndexReference
|
|
1062
|
+
restore(archiveDirectoryName?: string): Promise<DocFileIndexReference<T>>;
|
|
1067
1063
|
}
|
|
1068
1064
|
|
|
1069
1065
|
/**
|
|
1070
|
-
*
|
|
1071
|
-
*/
|
|
1072
|
-
declare class
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1066
|
+
* Meta
|
|
1067
|
+
*/
|
|
1068
|
+
declare class DocFileMdMetaValue<T extends DocCustomSchema> {
|
|
1069
|
+
readonly value: SchemaToValueType<T>;
|
|
1070
|
+
readonly customSchema: T;
|
|
1071
|
+
constructor(value: SchemaToValueType<T>, customSchema: T);
|
|
1072
|
+
private validateValue;
|
|
1073
|
+
private getValueField;
|
|
1074
|
+
get keys(): Array<keyof T>;
|
|
1075
|
+
/**
|
|
1076
|
+
* Return a new instance with a single property updated
|
|
1077
|
+
*/
|
|
1078
|
+
withProperty<K extends keyof T>(key: K, value: BaseFieldValueType<ExtractFieldType<T[K]>>): DocFileMdMetaValue<T>;
|
|
1079
|
+
schemaField<K extends keyof T>(key: K): T[K];
|
|
1080
|
+
field<K extends keyof T>(key: K): FieldValueType<ExtractFieldType<T[K]>, ExtractRequired<T[K]>>;
|
|
1081
|
+
relation(key: keyof T): DocMetaFieldRelation;
|
|
1082
|
+
multiRelation(key: keyof T): DocMetaFieldMultiRelation;
|
|
1083
|
+
text(key: keyof T): DocMetaFieldText;
|
|
1084
|
+
number(key: keyof T): DocMetaFieldNumber;
|
|
1085
|
+
boolean(key: keyof T): DocMetaFieldBoolean;
|
|
1086
|
+
multiText(key: keyof T): DocMetaFieldMultiText;
|
|
1087
|
+
multiNumber(key: keyof T): DocMetaFieldMultiNumber;
|
|
1088
|
+
multiBoolean(key: keyof T): DocMetaFieldMultiBoolean;
|
|
1089
|
+
hasKey(key: keyof T): boolean;
|
|
1090
|
+
/**
|
|
1091
|
+
* Generate from Markdown text
|
|
1092
|
+
*/
|
|
1093
|
+
static fromYamlText<T extends DocCustomSchema>(yamlText: string, customSchema: T): DocFileMdMetaValue<T>;
|
|
1094
|
+
static empty<T extends DocCustomSchema>(customSchema: T): DocFileMdMetaValue<T>;
|
|
1095
|
+
toJson(): SchemaToValueType<T>;
|
|
1077
1096
|
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
1097
|
}
|
|
1152
1098
|
|
|
1153
1099
|
/**
|
|
1154
|
-
* Markdown
|
|
1100
|
+
* File: Markdown > Content
|
|
1155
1101
|
*/
|
|
1156
|
-
declare class
|
|
1157
|
-
readonly value:
|
|
1158
|
-
private readonly
|
|
1159
|
-
constructor(value:
|
|
1102
|
+
declare class DocFileMdContentValue<T extends DocCustomSchema> {
|
|
1103
|
+
readonly value: DocFileMdContent<T>;
|
|
1104
|
+
private readonly customSchema;
|
|
1105
|
+
constructor(value: DocFileMdContent<T>, customSchema: T);
|
|
1160
1106
|
/**
|
|
1161
|
-
*
|
|
1107
|
+
* Content body (does not include frontMatter)
|
|
1162
1108
|
*/
|
|
1163
1109
|
get body(): string;
|
|
1164
1110
|
/**
|
|
1165
|
-
*
|
|
1111
|
+
* Title
|
|
1166
1112
|
*/
|
|
1167
1113
|
get title(): string;
|
|
1168
1114
|
/**
|
|
1169
|
-
*
|
|
1115
|
+
* Description
|
|
1170
1116
|
*/
|
|
1171
1117
|
get description(): string;
|
|
1172
1118
|
/**
|
|
1173
|
-
* FrontMatter
|
|
1119
|
+
* FrontMatter (uses constructor's Zod schema or argument schema)
|
|
1174
1120
|
*/
|
|
1175
|
-
|
|
1121
|
+
meta(): DocFileMdMetaValue<T>;
|
|
1176
1122
|
/**
|
|
1177
|
-
*
|
|
1123
|
+
* Update title
|
|
1178
1124
|
*/
|
|
1179
|
-
withTitle(title: string):
|
|
1125
|
+
withTitle(title: string): DocFileMdContentValue<T>;
|
|
1180
1126
|
/**
|
|
1181
|
-
*
|
|
1127
|
+
* Update description
|
|
1182
1128
|
*/
|
|
1183
|
-
withDescription(description: string, defaultTitle?: string):
|
|
1129
|
+
withDescription(description: string, defaultTitle?: string): DocFileMdContentValue<T>;
|
|
1184
1130
|
/**
|
|
1185
|
-
*
|
|
1131
|
+
* Update content
|
|
1186
1132
|
*/
|
|
1187
|
-
withContent(content: string):
|
|
1133
|
+
withContent(content: string): DocFileMdContentValue<T>;
|
|
1188
1134
|
/**
|
|
1189
|
-
* FrontMatter
|
|
1135
|
+
* Update FrontMatter
|
|
1190
1136
|
*/
|
|
1191
|
-
|
|
1137
|
+
withMeta<U extends DocCustomSchema>(meta: DocFileMdMetaValue<U>): DocFileMdContentValue<U>;
|
|
1192
1138
|
/**
|
|
1193
|
-
* FrontMatter
|
|
1139
|
+
* Update specific property of FrontMatter
|
|
1194
1140
|
*/
|
|
1195
|
-
|
|
1141
|
+
withMetaProperty<K extends keyof T>(key: K, value: BaseFieldValueType<ExtractFieldType<T[K]>>): DocFileMdContentValue<T>;
|
|
1196
1142
|
/**
|
|
1197
|
-
* Markdown
|
|
1143
|
+
* Generate from Markdown text
|
|
1198
1144
|
*/
|
|
1199
|
-
static fromMarkdown<T extends
|
|
1145
|
+
static fromMarkdown<T extends DocCustomSchema>(markdown: string, customSchema: T): DocFileMdContentValue<T>;
|
|
1200
1146
|
/**
|
|
1201
|
-
*
|
|
1147
|
+
* Generate complete Markdown text
|
|
1202
1148
|
*/
|
|
1203
1149
|
toMarkdownText(): string;
|
|
1204
1150
|
/**
|
|
1205
|
-
* FrontMatter
|
|
1151
|
+
* Generate complete text combining FrontMatter and body
|
|
1206
1152
|
*/
|
|
1207
1153
|
toText(): string;
|
|
1208
1154
|
/**
|
|
1209
|
-
*
|
|
1155
|
+
* Generate empty content
|
|
1210
1156
|
*/
|
|
1211
|
-
static empty<T extends
|
|
1157
|
+
static empty<T extends DocCustomSchema = DocCustomSchema>(title: string, customSchema: T): DocFileMdContentValue<T>;
|
|
1212
1158
|
/**
|
|
1213
|
-
* JSON
|
|
1159
|
+
* Output in JSON format
|
|
1214
1160
|
*/
|
|
1215
|
-
toJson():
|
|
1161
|
+
toJson(): DocFileMdContent<T>;
|
|
1216
1162
|
}
|
|
1217
1163
|
|
|
1218
1164
|
/**
|
|
1219
|
-
*
|
|
1165
|
+
* Markdown file entity
|
|
1220
1166
|
*/
|
|
1221
|
-
declare class DocFileMdEntity {
|
|
1222
|
-
readonly value: DocFileMd
|
|
1223
|
-
|
|
1167
|
+
declare class DocFileMdEntity<T extends DocCustomSchema> {
|
|
1168
|
+
readonly value: DocFileMd<T>;
|
|
1169
|
+
private readonly customSchema;
|
|
1170
|
+
constructor(value: DocFileMd<T>, customSchema: T);
|
|
1224
1171
|
/**
|
|
1225
|
-
*
|
|
1172
|
+
* Content
|
|
1226
1173
|
*/
|
|
1227
|
-
get content():
|
|
1174
|
+
get content(): DocFileMdContentValue<T>;
|
|
1228
1175
|
/**
|
|
1229
|
-
*
|
|
1176
|
+
* Path information
|
|
1230
1177
|
*/
|
|
1231
1178
|
get path(): DocFilePath;
|
|
1232
1179
|
/**
|
|
1233
|
-
*
|
|
1180
|
+
* Update content
|
|
1234
1181
|
*/
|
|
1235
|
-
withContent(content:
|
|
1182
|
+
withContent(content: DocFileMdContentValue<T>): DocFileMdEntity<T>;
|
|
1236
1183
|
/**
|
|
1237
|
-
*
|
|
1184
|
+
* Update path
|
|
1238
1185
|
*/
|
|
1239
|
-
withPath(path: DocFilePath): DocFileMdEntity
|
|
1186
|
+
withPath(path: DocFilePath): DocFileMdEntity<T>;
|
|
1187
|
+
withMeta(meta: DocFileMdMetaValue<T>): DocFileMdEntity<T>;
|
|
1188
|
+
withTitle(title: string): DocFileMdEntity<T>;
|
|
1189
|
+
withDescription(description: string, defaultTitle?: string): DocFileMdEntity<T>;
|
|
1240
1190
|
/**
|
|
1241
|
-
* JSON
|
|
1191
|
+
* Convert to JSON format
|
|
1242
1192
|
*/
|
|
1243
|
-
toJson(): DocFileMd
|
|
1193
|
+
toJson(): DocFileMd<T>;
|
|
1244
1194
|
}
|
|
1245
1195
|
|
|
1246
|
-
type Props$6 = {
|
|
1196
|
+
type Props$6<T extends DocCustomSchema> = {
|
|
1247
1197
|
path: string;
|
|
1248
1198
|
fileSystem: DocFileSystem;
|
|
1249
1199
|
pathSystem: DocPathSystem;
|
|
1200
|
+
customSchema: T;
|
|
1201
|
+
config: DocClientConfig;
|
|
1250
1202
|
};
|
|
1251
1203
|
/**
|
|
1252
|
-
*
|
|
1204
|
+
* File reference
|
|
1253
1205
|
*/
|
|
1254
|
-
declare class DocFileMdReference {
|
|
1206
|
+
declare class DocFileMdReference<T extends DocCustomSchema> {
|
|
1255
1207
|
private readonly props;
|
|
1256
1208
|
private readonly pathSystem;
|
|
1257
|
-
|
|
1209
|
+
private readonly customSchema;
|
|
1210
|
+
constructor(props: Props$6<T>);
|
|
1258
1211
|
get fileSystem(): DocFileSystem;
|
|
1259
1212
|
get basePath(): string;
|
|
1260
1213
|
get path(): string;
|
|
@@ -1263,106 +1216,96 @@ declare class DocFileMdReference {
|
|
|
1263
1216
|
get archivedPath(): string;
|
|
1264
1217
|
get name(): string;
|
|
1265
1218
|
get nameWithExtension(): string;
|
|
1266
|
-
|
|
1267
|
-
read(): Promise<
|
|
1268
|
-
/**
|
|
1269
|
-
* ファイルの内容を読み込む
|
|
1270
|
-
*/
|
|
1271
|
-
readContent(): Promise<Error | string>;
|
|
1219
|
+
exists(): Promise<boolean>;
|
|
1220
|
+
read(): Promise<DocFileMdEntity<T> | Error>;
|
|
1272
1221
|
/**
|
|
1273
|
-
*
|
|
1222
|
+
* Read file content
|
|
1274
1223
|
*/
|
|
1275
|
-
|
|
1224
|
+
readText(): Promise<Error | string>;
|
|
1276
1225
|
/**
|
|
1277
|
-
*
|
|
1226
|
+
* Write entity
|
|
1278
1227
|
*/
|
|
1279
|
-
write(entity: DocFileMdEntity): Promise<
|
|
1228
|
+
write(entity: DocFileMdEntity<T>): Promise<null>;
|
|
1229
|
+
writeText(text: string): Promise<void>;
|
|
1280
1230
|
/**
|
|
1281
|
-
*
|
|
1231
|
+
* Create new file with default content
|
|
1282
1232
|
*/
|
|
1283
1233
|
writeDefault(): Promise<void>;
|
|
1284
1234
|
/**
|
|
1285
|
-
*
|
|
1235
|
+
* Delete file
|
|
1286
1236
|
*/
|
|
1287
1237
|
delete(): Promise<Error | null>;
|
|
1288
1238
|
/**
|
|
1289
|
-
*
|
|
1290
|
-
*/
|
|
1291
|
-
exists(): Promise<boolean>;
|
|
1292
|
-
/**
|
|
1293
|
-
* ファイルをコピー
|
|
1239
|
+
* Copy file
|
|
1294
1240
|
*/
|
|
1295
1241
|
copyTo(destinationPath: string): Promise<void>;
|
|
1296
1242
|
/**
|
|
1297
|
-
*
|
|
1243
|
+
* Move file
|
|
1298
1244
|
*/
|
|
1299
1245
|
moveTo(destinationPath: string): Promise<void>;
|
|
1300
1246
|
/**
|
|
1301
|
-
*
|
|
1247
|
+
* Move file to archive and return new reference
|
|
1302
1248
|
*/
|
|
1303
|
-
|
|
1304
|
-
/**
|
|
1305
|
-
* ファイルの最終更新日時を取得
|
|
1306
|
-
*/
|
|
1307
|
-
lastModified(): Promise<Date>;
|
|
1249
|
+
archive(archiveDirectoryName?: string): Promise<DocFileMdReference<T>>;
|
|
1308
1250
|
/**
|
|
1309
|
-
*
|
|
1251
|
+
* Restore file from archive and return new reference
|
|
1310
1252
|
*/
|
|
1311
|
-
|
|
1253
|
+
restore(archiveDirectoryName?: string): Promise<DocFileMdReference<T>>;
|
|
1312
1254
|
/**
|
|
1313
|
-
*
|
|
1255
|
+
* Get file size in bytes
|
|
1314
1256
|
*/
|
|
1315
|
-
|
|
1257
|
+
size(): Promise<number>;
|
|
1316
1258
|
/**
|
|
1317
|
-
*
|
|
1259
|
+
* Get file last modified time
|
|
1318
1260
|
*/
|
|
1319
|
-
|
|
1261
|
+
lastModified(): Promise<Date>;
|
|
1320
1262
|
/**
|
|
1321
|
-
*
|
|
1263
|
+
* Get file creation time
|
|
1322
1264
|
*/
|
|
1323
|
-
|
|
1265
|
+
createdAt(): Promise<Date>;
|
|
1266
|
+
directory(): DocDirectoryReference<T>;
|
|
1324
1267
|
/**
|
|
1325
|
-
*
|
|
1268
|
+
* Get relation based on schema
|
|
1326
1269
|
*/
|
|
1327
|
-
|
|
1270
|
+
relation<U extends DocCustomSchema = DocCustomSchema>(key: RelationKeys<T>, targetSchema?: U): Promise<DocFileMdReference<U> | Error | null>;
|
|
1328
1271
|
/**
|
|
1329
|
-
*
|
|
1272
|
+
* Get index.md in the same directory
|
|
1330
1273
|
*/
|
|
1331
|
-
|
|
1274
|
+
directoryIndex(): Promise<DocFileIndexReference<T> | null>;
|
|
1332
1275
|
/**
|
|
1333
|
-
*
|
|
1276
|
+
* Get multiple relations based on schema
|
|
1334
1277
|
*/
|
|
1335
|
-
|
|
1278
|
+
relations<U extends DocCustomSchema = DocCustomSchema>(key: MultiRelationKeys<T>, customSchema?: U): Promise<DocFileMdReference<U>[]>;
|
|
1336
1279
|
/**
|
|
1337
|
-
* FrontMatter
|
|
1280
|
+
* File: Markdown > FrontMatter
|
|
1338
1281
|
*/
|
|
1339
|
-
readFrontMatter
|
|
1282
|
+
readFrontMatter(): Promise<DocFileMdMetaValue<T> | Error>;
|
|
1340
1283
|
/**
|
|
1341
|
-
* FrontMatter
|
|
1284
|
+
* File: Markdown > FrontMatter
|
|
1342
1285
|
*/
|
|
1343
|
-
updateFrontMatter<
|
|
1286
|
+
updateFrontMatter<K extends keyof T>(key: K, value: BaseFieldValueType<ExtractFieldType<T[K]>>): Promise<this | Error>;
|
|
1344
1287
|
}
|
|
1345
1288
|
|
|
1346
1289
|
/**
|
|
1347
|
-
*
|
|
1290
|
+
* Unknown file entity
|
|
1348
1291
|
*/
|
|
1349
1292
|
declare class DocFileUnknownEntity {
|
|
1350
1293
|
readonly value: DocFileUnknown;
|
|
1351
1294
|
constructor(value: DocFileUnknown);
|
|
1352
1295
|
/**
|
|
1353
|
-
*
|
|
1296
|
+
* Content
|
|
1354
1297
|
*/
|
|
1355
1298
|
get content(): string;
|
|
1356
1299
|
/**
|
|
1357
|
-
*
|
|
1300
|
+
* Path information
|
|
1358
1301
|
*/
|
|
1359
1302
|
get path(): DocFilePath;
|
|
1360
1303
|
/**
|
|
1361
|
-
*
|
|
1304
|
+
* Update content
|
|
1362
1305
|
*/
|
|
1363
1306
|
withContent(content: string): DocFileUnknownEntity;
|
|
1364
1307
|
/**
|
|
1365
|
-
*
|
|
1308
|
+
* Update path
|
|
1366
1309
|
*/
|
|
1367
1310
|
withPath(path: DocFilePath): DocFileUnknownEntity;
|
|
1368
1311
|
toJson(): DocFileUnknown;
|
|
@@ -1372,9 +1315,10 @@ type Props$5 = {
|
|
|
1372
1315
|
path: string;
|
|
1373
1316
|
fileSystem: DocFileSystem;
|
|
1374
1317
|
pathSystem: DocPathSystem;
|
|
1318
|
+
config: DocClientConfig;
|
|
1375
1319
|
};
|
|
1376
1320
|
/**
|
|
1377
|
-
*
|
|
1321
|
+
* File reference
|
|
1378
1322
|
*/
|
|
1379
1323
|
declare class DocFileUnknownReference {
|
|
1380
1324
|
private readonly props;
|
|
@@ -1386,78 +1330,83 @@ declare class DocFileUnknownReference {
|
|
|
1386
1330
|
get directoryPath(): string;
|
|
1387
1331
|
get fileFullPath(): string;
|
|
1388
1332
|
get durectoryPath(): string;
|
|
1389
|
-
directory(): DocDirectoryReference
|
|
1390
|
-
|
|
1333
|
+
directory<T extends DocCustomSchema>(customSchema: T): DocDirectoryReference<T>;
|
|
1334
|
+
directory(): DocDirectoryReference<DocCustomSchema>;
|
|
1335
|
+
read(): Promise<Error | DocFileUnknownEntity>;
|
|
1391
1336
|
/**
|
|
1392
|
-
*
|
|
1337
|
+
* Read file content
|
|
1393
1338
|
*/
|
|
1394
1339
|
readContent(): Promise<Error | string>;
|
|
1395
1340
|
/**
|
|
1396
|
-
*
|
|
1341
|
+
* Write content to file
|
|
1397
1342
|
*/
|
|
1398
1343
|
writeContent(content: string): Promise<void>;
|
|
1399
1344
|
/**
|
|
1400
|
-
*
|
|
1345
|
+
* Write entity
|
|
1401
1346
|
*/
|
|
1402
1347
|
write(entity: DocFileUnknownEntity): Promise<void>;
|
|
1403
1348
|
/**
|
|
1404
|
-
*
|
|
1349
|
+
* Write raw content
|
|
1405
1350
|
*/
|
|
1406
1351
|
writeRaw(content: string): Promise<void>;
|
|
1407
1352
|
/**
|
|
1408
|
-
*
|
|
1353
|
+
* Delete file
|
|
1409
1354
|
*/
|
|
1410
1355
|
delete(): Promise<Error | null>;
|
|
1411
1356
|
/**
|
|
1412
|
-
*
|
|
1357
|
+
* Check if file exists
|
|
1413
1358
|
*/
|
|
1414
1359
|
exists(): Promise<boolean>;
|
|
1415
1360
|
/**
|
|
1416
|
-
*
|
|
1361
|
+
* Copy file
|
|
1417
1362
|
*/
|
|
1418
1363
|
copyTo(destinationPath: string): Promise<void>;
|
|
1419
1364
|
/**
|
|
1420
|
-
*
|
|
1365
|
+
* Move file
|
|
1421
1366
|
*/
|
|
1422
1367
|
moveTo(destinationPath: string): Promise<void>;
|
|
1423
1368
|
/**
|
|
1424
|
-
*
|
|
1369
|
+
* Get file size in bytes
|
|
1425
1370
|
*/
|
|
1426
1371
|
size(): Promise<number>;
|
|
1427
1372
|
/**
|
|
1428
|
-
*
|
|
1373
|
+
* Get file last modified time
|
|
1429
1374
|
*/
|
|
1430
1375
|
lastModified(): Promise<Date>;
|
|
1431
1376
|
/**
|
|
1432
|
-
*
|
|
1377
|
+
* Get file creation time
|
|
1433
1378
|
*/
|
|
1434
1379
|
createdAt(): Promise<Date>;
|
|
1435
1380
|
/**
|
|
1436
|
-
*
|
|
1381
|
+
* Move file to archive and return new reference
|
|
1437
1382
|
*/
|
|
1438
1383
|
archive(archiveDirectoryName?: string): Promise<DocFileUnknownReference>;
|
|
1439
1384
|
/**
|
|
1440
|
-
*
|
|
1385
|
+
* Restore file from archive and return new reference
|
|
1441
1386
|
*/
|
|
1442
1387
|
restore(archiveDirectoryName?: string): Promise<DocFileUnknownReference>;
|
|
1443
1388
|
}
|
|
1444
1389
|
|
|
1445
|
-
type Props$4 = {
|
|
1390
|
+
type Props$4<T extends DocCustomSchema> = {
|
|
1391
|
+
customSchema: T;
|
|
1446
1392
|
path: string;
|
|
1447
1393
|
indexFileName: string;
|
|
1448
1394
|
archiveDirectoryName: string;
|
|
1449
1395
|
fileSystem: DocFileSystem;
|
|
1450
1396
|
pathSystem: DocPathSystem;
|
|
1397
|
+
config: DocClientConfig;
|
|
1451
1398
|
};
|
|
1452
1399
|
/**
|
|
1453
|
-
*
|
|
1400
|
+
* Directory reference
|
|
1454
1401
|
*/
|
|
1455
|
-
declare class DocDirectoryReference {
|
|
1402
|
+
declare class DocDirectoryReference<T extends DocCustomSchema> {
|
|
1456
1403
|
private readonly props;
|
|
1457
1404
|
private readonly pathSystem;
|
|
1458
|
-
|
|
1405
|
+
private readonly customSchema;
|
|
1406
|
+
constructor(props: Props$4<T>);
|
|
1459
1407
|
get fileSystem(): DocFileSystem;
|
|
1460
1408
|
get basePath(): string;
|
|
1409
|
+
get config(): DocClientConfig;
|
|
1461
1410
|
get relativePath(): string;
|
|
1462
1411
|
get absolutePath(): string;
|
|
1463
1412
|
get indexFileName(): string;
|
|
@@ -1465,57 +1414,39 @@ declare class DocDirectoryReference {
|
|
|
1465
1414
|
get archiveDirectoryName(): string;
|
|
1466
1415
|
fileNames(): Promise<string[]>;
|
|
1467
1416
|
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
|
-
}[]>;
|
|
1417
|
+
filesGenerator(): AsyncGenerator<DocFileMdReference<T> | DocFileUnknownReference, void, unknown>;
|
|
1418
|
+
mdFilesGenerator(): AsyncGenerator<DocFileMdReference<T>, void, unknown>;
|
|
1419
|
+
files(): Promise<(DocFileMdReference<T> | DocFileUnknownReference)[]>;
|
|
1420
|
+
mdFiles(): Promise<DocFileMdReference<T>[]>;
|
|
1421
|
+
file(fileName: string): Promise<DocFileMdReference<T> | DocFileUnknownReference>;
|
|
1422
|
+
mdFile(fileName: string): Promise<DocFileMdReference<T>>;
|
|
1423
|
+
readFiles(): Promise<(DocFileMdEntity<T> | DocFileUnknownEntity)[]>;
|
|
1424
|
+
readMdFiles(): Promise<DocFileMdEntity<T>[]>;
|
|
1490
1425
|
readUnknownFiles(): Promise<DocFileUnknownEntity[]>;
|
|
1491
1426
|
/**
|
|
1492
|
-
*
|
|
1427
|
+
* Get list of subdirectory names
|
|
1493
1428
|
*/
|
|
1494
1429
|
directoryNames(): Promise<string[]>;
|
|
1495
1430
|
/**
|
|
1496
|
-
*
|
|
1431
|
+
* Get subdirectory references
|
|
1497
1432
|
*/
|
|
1498
|
-
directories(): Promise<DocDirectoryReference[]>;
|
|
1433
|
+
directories(): Promise<DocDirectoryReference<never>[]>;
|
|
1499
1434
|
/**
|
|
1500
|
-
*
|
|
1435
|
+
* Get single subdirectory reference
|
|
1501
1436
|
*/
|
|
1502
|
-
directory(directoryName: string): DocDirectoryReference
|
|
1503
|
-
indexFile(): DocFileIndexReference
|
|
1504
|
-
readIndexFile(): Promise<DocFileIndexEntity
|
|
1505
|
-
writeFile(entity: DocFileIndexEntity |
|
|
1437
|
+
directory(directoryName: string): DocDirectoryReference<T>;
|
|
1438
|
+
indexFile(): DocFileIndexReference<T>;
|
|
1439
|
+
readIndexFile(): Promise<DocFileIndexEntity<T>>;
|
|
1440
|
+
writeFile(entity: DocFileIndexEntity<T> | DocFileMdEntity<T> | DocFileUnknownEntity): Promise<Error | null>;
|
|
1506
1441
|
exists(): Promise<boolean>;
|
|
1507
1442
|
/**
|
|
1508
|
-
*
|
|
1443
|
+
* Generate unique filename
|
|
1509
1444
|
*/
|
|
1510
|
-
private
|
|
1445
|
+
private uniqueFileName;
|
|
1511
1446
|
/**
|
|
1512
|
-
*
|
|
1447
|
+
* Create new Markdown file
|
|
1513
1448
|
*/
|
|
1514
|
-
|
|
1515
|
-
/**
|
|
1516
|
-
* 新しいMarkdownファイルを作成する
|
|
1517
|
-
*/
|
|
1518
|
-
createMdFile(fileName?: string): Promise<DocFileMdReference>;
|
|
1449
|
+
createMdFile(fileName?: string): Promise<DocFileMdReference<T>>;
|
|
1519
1450
|
}
|
|
1520
1451
|
|
|
1521
1452
|
type Props$3 = {
|
|
@@ -1525,7 +1456,7 @@ type Props$3 = {
|
|
|
1525
1456
|
title: string;
|
|
1526
1457
|
};
|
|
1527
1458
|
/**
|
|
1528
|
-
*
|
|
1459
|
+
* Tree file node value object
|
|
1529
1460
|
*/
|
|
1530
1461
|
declare class DocTreeFileNodeValue {
|
|
1531
1462
|
private readonly props;
|
|
@@ -1536,28 +1467,30 @@ declare class DocTreeFileNodeValue {
|
|
|
1536
1467
|
get title(): string;
|
|
1537
1468
|
get type(): "file";
|
|
1538
1469
|
/**
|
|
1539
|
-
*
|
|
1470
|
+
* Convert to plain object
|
|
1540
1471
|
*/
|
|
1541
1472
|
toJson(): DocTreeFileNode;
|
|
1542
1473
|
/**
|
|
1543
|
-
*
|
|
1474
|
+
* Create from properties
|
|
1544
1475
|
*/
|
|
1545
1476
|
static from(props: Props$3): DocTreeFileNodeValue;
|
|
1546
1477
|
/**
|
|
1547
|
-
* JSON
|
|
1478
|
+
* Create from JSON object
|
|
1548
1479
|
*/
|
|
1549
1480
|
static fromJson(json: unknown): DocTreeFileNodeValue;
|
|
1550
1481
|
}
|
|
1551
1482
|
|
|
1483
|
+
type DocTreeNodeValue = DocTreeFileNodeValue | DocTreeDirectoryNodeValue;
|
|
1484
|
+
|
|
1552
1485
|
type Props$2 = {
|
|
1553
1486
|
name: string;
|
|
1554
1487
|
path: string;
|
|
1555
1488
|
icon: string;
|
|
1556
1489
|
title: string;
|
|
1557
|
-
children:
|
|
1490
|
+
children: DocTreeNodeValue[];
|
|
1558
1491
|
};
|
|
1559
1492
|
/**
|
|
1560
|
-
*
|
|
1493
|
+
* Tree directory node value object
|
|
1561
1494
|
*/
|
|
1562
1495
|
declare class DocTreeDirectoryNodeValue {
|
|
1563
1496
|
private readonly props;
|
|
@@ -1566,18 +1499,18 @@ declare class DocTreeDirectoryNodeValue {
|
|
|
1566
1499
|
get path(): string;
|
|
1567
1500
|
get icon(): string;
|
|
1568
1501
|
get title(): string;
|
|
1569
|
-
get children():
|
|
1502
|
+
get children(): DocTreeNodeValue[];
|
|
1570
1503
|
get type(): "directory";
|
|
1571
1504
|
/**
|
|
1572
|
-
*
|
|
1505
|
+
* Convert to plain object
|
|
1573
1506
|
*/
|
|
1574
1507
|
toJson(): DocTreeDirectoryNode;
|
|
1575
1508
|
/**
|
|
1576
|
-
*
|
|
1509
|
+
* Create from properties
|
|
1577
1510
|
*/
|
|
1578
1511
|
static from(props: Props$2): DocTreeDirectoryNodeValue;
|
|
1579
1512
|
/**
|
|
1580
|
-
* JSON
|
|
1513
|
+
* Create from JSON object
|
|
1581
1514
|
*/
|
|
1582
1515
|
static fromJson(json: unknown): DocTreeDirectoryNodeValue;
|
|
1583
1516
|
}
|
|
@@ -1587,83 +1520,85 @@ type Props$1 = {
|
|
|
1587
1520
|
pathSystem: DocPathSystem;
|
|
1588
1521
|
indexFileName: string;
|
|
1589
1522
|
archiveDirectoryName: string;
|
|
1523
|
+
config: DocClientConfig;
|
|
1590
1524
|
};
|
|
1591
1525
|
/**
|
|
1592
|
-
*
|
|
1526
|
+
* File tree building system
|
|
1593
1527
|
*/
|
|
1594
1528
|
declare class DocFileTreeSystem {
|
|
1595
1529
|
private readonly props;
|
|
1530
|
+
private readonly config;
|
|
1596
1531
|
constructor(props: Props$1);
|
|
1597
1532
|
/**
|
|
1598
|
-
*
|
|
1533
|
+
* Build file tree recursively
|
|
1599
1534
|
*/
|
|
1600
|
-
buildFileTree(directoryPath?: string): Promise<
|
|
1535
|
+
buildFileTree(directoryPath?: string): Promise<DocTreeNodeValue[]>;
|
|
1601
1536
|
/**
|
|
1602
|
-
*
|
|
1537
|
+
* Create file node
|
|
1603
1538
|
*/
|
|
1604
1539
|
private createFileNode;
|
|
1605
1540
|
/**
|
|
1606
|
-
*
|
|
1541
|
+
* Create directory node
|
|
1607
1542
|
*/
|
|
1608
1543
|
private createDirectoryNode;
|
|
1609
1544
|
/**
|
|
1610
|
-
*
|
|
1545
|
+
* Create index file reference
|
|
1611
1546
|
*/
|
|
1612
1547
|
private createIndexFileReference;
|
|
1613
1548
|
/**
|
|
1614
|
-
* MD
|
|
1549
|
+
* Create MD file reference
|
|
1615
1550
|
*/
|
|
1616
1551
|
private createMdFileReference;
|
|
1617
1552
|
/**
|
|
1618
|
-
*
|
|
1553
|
+
* Build directory tree recursively (directories only)
|
|
1619
1554
|
*/
|
|
1620
1555
|
buildDirectoryTree(directoryPath?: string): Promise<DocTreeDirectoryNodeValue[]>;
|
|
1621
1556
|
/**
|
|
1622
|
-
*
|
|
1557
|
+
* Create directory node for directory tree
|
|
1623
1558
|
*/
|
|
1624
1559
|
private createDirectoryNodeForTree;
|
|
1625
1560
|
}
|
|
1626
1561
|
|
|
1627
1562
|
/**
|
|
1628
|
-
* Markdown
|
|
1563
|
+
* Markdown parsing and processing system
|
|
1629
1564
|
*/
|
|
1630
1565
|
declare class DocMarkdownSystem {
|
|
1631
1566
|
private readonly frontMatterSeparator;
|
|
1632
1567
|
constructor();
|
|
1633
1568
|
/**
|
|
1634
|
-
* FrontMatter
|
|
1569
|
+
* Detect FrontMatter separator line
|
|
1635
1570
|
*/
|
|
1636
1571
|
private detectFrontMatterSeparator;
|
|
1637
1572
|
/**
|
|
1638
|
-
* FrontMatter
|
|
1573
|
+
* Extract FrontMatter
|
|
1639
1574
|
*/
|
|
1640
1575
|
extractFrontMatter(text: string): string | null;
|
|
1641
1576
|
/**
|
|
1642
|
-
* FrontMatter
|
|
1577
|
+
* Extract body without FrontMatter (includes title and description)
|
|
1643
1578
|
*/
|
|
1644
1579
|
extractBody(text: string): string;
|
|
1645
1580
|
/**
|
|
1646
|
-
*
|
|
1581
|
+
* Extract title
|
|
1647
1582
|
*/
|
|
1648
1583
|
extractTitle(text: string): string | null;
|
|
1649
1584
|
/**
|
|
1650
|
-
*
|
|
1585
|
+
* Extract description (first paragraph after title)
|
|
1651
1586
|
*/
|
|
1652
1587
|
extractDescription(text: string): string | null;
|
|
1653
1588
|
/**
|
|
1654
|
-
* body
|
|
1589
|
+
* Update title in body
|
|
1655
1590
|
*/
|
|
1656
1591
|
updateTitle(text: string, newTitle: string): string;
|
|
1657
1592
|
/**
|
|
1658
|
-
* body
|
|
1593
|
+
* Update description in body
|
|
1659
1594
|
*/
|
|
1660
1595
|
updateDescription(text: string, newDescription: string, defaultTitle: string): string;
|
|
1661
1596
|
/**
|
|
1662
|
-
*
|
|
1597
|
+
* Skip empty lines
|
|
1663
1598
|
*/
|
|
1664
1599
|
private skipEmptyLines;
|
|
1665
1600
|
/**
|
|
1666
|
-
* Markdown
|
|
1601
|
+
* Generate Markdown text (title + description + body)
|
|
1667
1602
|
*/
|
|
1668
1603
|
static from(title: string, description: string, body: string): string;
|
|
1669
1604
|
}
|
|
@@ -1674,327 +1609,109 @@ type Props = {
|
|
|
1674
1609
|
markdownSystem?: DocMarkdownSystem;
|
|
1675
1610
|
fileTreeSystem?: DocFileTreeSystem;
|
|
1676
1611
|
/**
|
|
1677
|
-
*
|
|
1678
|
-
*/
|
|
1679
|
-
indexFileName?: string;
|
|
1680
|
-
/**
|
|
1681
|
-
* default: "_"
|
|
1612
|
+
* Configuration
|
|
1682
1613
|
*/
|
|
1683
|
-
|
|
1614
|
+
config?: DocClientConfig;
|
|
1684
1615
|
};
|
|
1685
1616
|
declare class DocClient {
|
|
1686
1617
|
readonly fileSystem: DocFileSystem;
|
|
1687
1618
|
readonly pathSystem: DocPathSystem;
|
|
1688
1619
|
readonly markdownSystem: DocMarkdownSystem;
|
|
1689
1620
|
readonly fileTreeSystem: DocFileTreeSystem;
|
|
1690
|
-
readonly
|
|
1691
|
-
readonly archiveDirectoryName: string;
|
|
1621
|
+
readonly config: DocClientConfig;
|
|
1692
1622
|
constructor(props: Props);
|
|
1693
1623
|
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
|
-
*/
|
|
1624
|
+
file(relativePath: string): DocFileMdReference<DocCustomSchema> | DocFileUnknownReference;
|
|
1625
|
+
file<T extends DocCustomSchema>(relativePath: string, customSchema: T): DocFileMdReference<T> | DocFileUnknownReference;
|
|
1626
|
+
mdFile(relativePath: string): DocFileMdReference<DocCustomSchema>;
|
|
1627
|
+
mdFile<T extends DocCustomSchema>(relativePath: string, customSchema: T): DocFileMdReference<T>;
|
|
1628
|
+
indexFile(relativePath: string): DocFileIndexReference<DocCustomSchema>;
|
|
1629
|
+
indexFile<T extends DocCustomSchema>(relativePath: string, customSchema: T): DocFileIndexReference<T>;
|
|
1630
|
+
directory(relativePath: string): DocDirectoryReference<DocCustomSchema>;
|
|
1631
|
+
directory<T extends DocCustomSchema>(relativePath: string, customSchema: T): DocDirectoryReference<T>;
|
|
1632
|
+
fileTree(directoryPath?: string): Promise<DocTreeNode[]>;
|
|
1717
1633
|
directoryTree(directoryPath?: string): Promise<DocTreeDirectoryNode[]>;
|
|
1718
1634
|
}
|
|
1719
1635
|
|
|
1720
1636
|
/**
|
|
1721
|
-
*
|
|
1722
|
-
*/
|
|
1723
|
-
declare class
|
|
1724
|
-
|
|
1725
|
-
readonly
|
|
1726
|
-
constructor(
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
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
|
-
* ファイルパス情報の値オブジェクト
|
|
1836
|
-
*/
|
|
1837
|
-
declare class DocFilePathValue {
|
|
1838
|
-
readonly value: DocFilePath;
|
|
1839
|
-
private readonly pathSystem;
|
|
1840
|
-
constructor(value: DocFilePath, pathSystem: DocPathSystem);
|
|
1841
|
-
/**
|
|
1842
|
-
* ファイル名(拡張子なし)
|
|
1843
|
-
*/
|
|
1844
|
-
get name(): string;
|
|
1845
|
-
/**
|
|
1846
|
-
* ファイルパス(相対パス)
|
|
1847
|
-
*/
|
|
1848
|
-
get path(): string;
|
|
1849
|
-
/**
|
|
1850
|
-
* ファイル名(拡張子付き)
|
|
1851
|
-
*/
|
|
1852
|
-
get nameWithExtension(): string;
|
|
1853
|
-
/**
|
|
1854
|
-
* フルパス(絶対パス)
|
|
1855
|
-
*/
|
|
1856
|
-
get fullPath(): string;
|
|
1857
|
-
/**
|
|
1858
|
-
* ディレクトリパス
|
|
1859
|
-
*/
|
|
1860
|
-
get directoryPath(): string;
|
|
1861
|
-
/**
|
|
1862
|
-
* 拡張子
|
|
1863
|
-
*/
|
|
1864
|
-
get extension(): string;
|
|
1865
|
-
/**
|
|
1866
|
-
* アーカイブされているかどうか
|
|
1867
|
-
*/
|
|
1868
|
-
get isArchived(): boolean;
|
|
1869
|
-
/**
|
|
1870
|
-
* 相対パスからインスタンスを生成(DI対応)
|
|
1871
|
-
*/
|
|
1872
|
-
static fromPathWithSystem(filePath: string, pathSystem: DocPathSystem, basePath?: string): DocFilePathValue;
|
|
1873
|
-
/**
|
|
1874
|
-
* JSON形式で出力
|
|
1875
|
-
*/
|
|
1876
|
-
toJson(): DocFilePath;
|
|
1877
|
-
}
|
|
1878
|
-
|
|
1879
|
-
type DocDirectoryPath = {
|
|
1880
|
-
path: string;
|
|
1881
|
-
name: string;
|
|
1882
|
-
fullPath: string;
|
|
1883
|
-
};
|
|
1884
|
-
/**
|
|
1885
|
-
* ディレクトリパスを表す値オブジェクト
|
|
1886
|
-
*/
|
|
1887
|
-
declare class DocDirectoryPathValue {
|
|
1888
|
-
private readonly value;
|
|
1889
|
-
private readonly pathSystem;
|
|
1890
|
-
constructor(value: DocDirectoryPath, pathSystem: DocPathSystem);
|
|
1891
|
-
/**
|
|
1892
|
-
* 相対ディレクトリパス
|
|
1893
|
-
*/
|
|
1894
|
-
get path(): string;
|
|
1895
|
-
/**
|
|
1896
|
-
* ディレクトリ名
|
|
1897
|
-
*/
|
|
1898
|
-
get name(): string;
|
|
1899
|
-
/**
|
|
1900
|
-
* 親ディレクトリパスを取得
|
|
1901
|
-
*/
|
|
1902
|
-
get parent(): DocDirectoryPathValue | null;
|
|
1903
|
-
/**
|
|
1904
|
-
* 親ディレクトリパス
|
|
1905
|
-
*/
|
|
1906
|
-
get parentPath(): string;
|
|
1907
|
-
/**
|
|
1908
|
-
* 深さ(ディレクトリの階層数)
|
|
1909
|
-
*/
|
|
1910
|
-
get depth(): number;
|
|
1911
|
-
/**
|
|
1912
|
-
* パスセグメント(ディレクトリの配列)
|
|
1913
|
-
*/
|
|
1914
|
-
get segments(): string[];
|
|
1915
|
-
/**
|
|
1916
|
-
* ルートからの相対パス(先頭のスラッシュなし)
|
|
1917
|
-
*/
|
|
1918
|
-
get normalizedPath(): string;
|
|
1919
|
-
/**
|
|
1920
|
-
* アーカイブディレクトリかどうか(ディレクトリ名が「_」の場合)
|
|
1921
|
-
*/
|
|
1922
|
-
get isArchived(): boolean;
|
|
1637
|
+
* In-memory file system for testing
|
|
1638
|
+
*/
|
|
1639
|
+
declare class DocFileSystemDebug extends DocFileSystem {
|
|
1640
|
+
private files;
|
|
1641
|
+
private readonly _pathSystem;
|
|
1642
|
+
constructor(props: {
|
|
1643
|
+
basePath: string;
|
|
1644
|
+
pathSystem: DocPathSystem;
|
|
1645
|
+
});
|
|
1646
|
+
/**
|
|
1647
|
+
* PathSystem accessor (for testing)
|
|
1648
|
+
*/
|
|
1649
|
+
getPathSystem(): DocPathSystem;
|
|
1650
|
+
/**
|
|
1651
|
+
* Factory method for testing
|
|
1652
|
+
*/
|
|
1653
|
+
static createWithFiles(props: {
|
|
1654
|
+
basePath?: string;
|
|
1655
|
+
fileContents?: Record<string, string>;
|
|
1656
|
+
}): DocFileSystemDebug;
|
|
1657
|
+
readFile(filePath: string): Promise<string | null>;
|
|
1658
|
+
writeFile(filePath: string, content: string): Promise<void>;
|
|
1659
|
+
deleteFile(filePath: string): Promise<Error | null>;
|
|
1660
|
+
exists(filePath: string): Promise<boolean>;
|
|
1661
|
+
copyFile(source: string, destination: string): Promise<void>;
|
|
1662
|
+
moveFile(source: string, destination: string): Promise<void>;
|
|
1663
|
+
readDirectory(directoryPath: string): Promise<string[]>;
|
|
1664
|
+
readDirectoryRecursive(directoryPath: string): Promise<string[]>;
|
|
1665
|
+
readDirectoryFilePaths(directoryPath: string): Promise<string[]>;
|
|
1666
|
+
createDirectory(_directoryPath: string): Promise<void>;
|
|
1667
|
+
deleteDirectory(directoryPath: string): Promise<void>;
|
|
1668
|
+
getFileSize(filePath: string): Promise<number>;
|
|
1669
|
+
getFileModifiedTime(filePath: string): Promise<Date>;
|
|
1670
|
+
getFileCreatedTime(filePath: string): Promise<Date>;
|
|
1671
|
+
isDirectory(relativePath: string): Promise<boolean>;
|
|
1672
|
+
isFile(relativePath: string): Promise<boolean>;
|
|
1923
1673
|
/**
|
|
1924
|
-
*
|
|
1674
|
+
* Get list of entries in directory
|
|
1925
1675
|
*/
|
|
1926
|
-
|
|
1676
|
+
readDirectoryFileNames(directoryPath?: string): Promise<string[]>;
|
|
1927
1677
|
/**
|
|
1928
|
-
*
|
|
1678
|
+
* Check if directory exists
|
|
1929
1679
|
*/
|
|
1930
|
-
|
|
1680
|
+
directoryExists(relativePath: string): Promise<boolean>;
|
|
1931
1681
|
/**
|
|
1932
|
-
*
|
|
1682
|
+
* Check if file exists
|
|
1933
1683
|
*/
|
|
1934
|
-
|
|
1684
|
+
fileExists(relativePath: string): Promise<boolean>;
|
|
1935
1685
|
/**
|
|
1936
|
-
*
|
|
1686
|
+
* Create directory if it doesn't exist
|
|
1937
1687
|
*/
|
|
1938
|
-
|
|
1688
|
+
ensureDirectoryExists(_relativePath: string): Promise<void>;
|
|
1939
1689
|
/**
|
|
1940
|
-
*
|
|
1690
|
+
* Clear all files
|
|
1941
1691
|
*/
|
|
1942
|
-
|
|
1692
|
+
clear(): void;
|
|
1943
1693
|
/**
|
|
1944
|
-
*
|
|
1694
|
+
* Check file existence (for testing)
|
|
1945
1695
|
*/
|
|
1946
|
-
|
|
1696
|
+
hasFile(filePath: string): boolean;
|
|
1947
1697
|
/**
|
|
1948
|
-
*
|
|
1698
|
+
* Get file content (sync version, for testing)
|
|
1949
1699
|
*/
|
|
1950
|
-
|
|
1700
|
+
getFileContent(filePath: string): string | undefined;
|
|
1951
1701
|
/**
|
|
1952
|
-
*
|
|
1702
|
+
* Get all file paths (for testing)
|
|
1953
1703
|
*/
|
|
1954
|
-
|
|
1704
|
+
getAllFilePaths(): string[];
|
|
1955
1705
|
/**
|
|
1956
|
-
*
|
|
1706
|
+
* Get file count (for testing)
|
|
1957
1707
|
*/
|
|
1958
|
-
|
|
1708
|
+
getFileCount(): number;
|
|
1959
1709
|
/**
|
|
1960
|
-
*
|
|
1710
|
+
* Setup test data
|
|
1961
1711
|
*/
|
|
1962
|
-
|
|
1712
|
+
setupTestFiles(files: Record<string, string>): void;
|
|
1963
1713
|
}
|
|
1964
1714
|
|
|
1965
|
-
|
|
1966
|
-
* スキーマフィールドファクトリ
|
|
1967
|
-
*/
|
|
1968
|
-
declare class DocSchemaFieldFactory {
|
|
1969
|
-
constructor();
|
|
1970
|
-
/**
|
|
1971
|
-
* スキーマエントリから適切な型のフィールドを生成
|
|
1972
|
-
*/
|
|
1973
|
-
fromSchemaEntry(key: string, field: DocSchemaField): DocSchemaFieldValue;
|
|
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
|
-
}
|
|
1715
|
+
type DocFileEntity<T extends DocCustomSchema> = DocFileMdEntity<T> | DocFileIndexEntity<T> | DocFileUnknownEntity;
|
|
1999
1716
|
|
|
2000
|
-
export { DocClient,
|
|
1717
|
+
export { type BaseFieldValueType, DocClient, type DocClientConfig, 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, DocDirectoryReference, type DocFile, type DocFileEntity, type DocFileIndex, type DocFileIndexContent, DocFileIndexEntity, type DocFileIndexMeta, DocFileIndexReference, type DocFileIndexSchema, type DocFileIndexSchemaField, type DocFileMd, type DocFileMdContent, DocFileMdEntity, type DocFileMdMeta, DocFileMdReference, type DocFilePath, DocFileRelationReference, DocFileSystem, DocFileSystemDebug, 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, type DocSchemaFieldBoolean, type DocSchemaFieldMultiNumber, type DocSchemaFieldMultiRelation, type DocSchemaFieldMultiSelectNumber, type DocSchemaFieldMultiSelectText, type DocSchemaFieldMultiText, type DocSchemaFieldNumber, type DocSchemaFieldRelation, type DocSchemaFieldSelectNumber, type DocSchemaFieldSelectText, type DocSchemaFieldText, type DocSchemaRelationFieldUnion, type DocTreeDirectoryNode, type DocTreeFileNode, 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 };
|