inkdrop-model 2.11.5 → 2.11.6

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/lib/index.d.ts CHANGED
@@ -1,7 +1,598 @@
1
- export * from './note';
2
- export * from './book';
3
- export * from './tag';
4
- export * from './file';
5
- export * from './crypto';
6
- export * from './validator';
7
- export * from './utils';
1
+ import { ErrorObject, ValidateFunction } from "ajv";
2
+
3
+ //#region json-schema/note.json.d.ts
4
+ declare let $schema$3: string;
5
+ declare let $id$3: string;
6
+ declare let title$3: string;
7
+ declare let description$3: string;
8
+ declare let type$3: string;
9
+ declare namespace properties$3 {
10
+ export namespace _id {
11
+ let description_1: string;
12
+ export { description_1 as description };
13
+ let type_1: string;
14
+ export { type_1 as type };
15
+ export let minLength: number;
16
+ export let maxLength: number;
17
+ export let pattern: string;
18
+ }
19
+ export namespace _rev {
20
+ let description_2: string;
21
+ export { description_2 as description };
22
+ let type_2: string;
23
+ export { type_2 as type };
24
+ }
25
+ export namespace bookId {
26
+ let description_3: string;
27
+ export { description_3 as description };
28
+ let type_3: string;
29
+ export { type_3 as type };
30
+ let minLength_1: number;
31
+ export { minLength_1 as minLength };
32
+ let maxLength_1: number;
33
+ export { maxLength_1 as maxLength };
34
+ let pattern_1: string;
35
+ export { pattern_1 as pattern };
36
+ }
37
+ export namespace title_1 {
38
+ let description_4: string;
39
+ export { description_4 as description };
40
+ let type_4: string;
41
+ export { type_4 as type };
42
+ let maxLength_2: number;
43
+ export { maxLength_2 as maxLength };
44
+ }
45
+ export { title_1 as title };
46
+ export namespace doctype {
47
+ let description_5: string;
48
+ export { description_5 as description };
49
+ let type_5: string;
50
+ export { type_5 as type };
51
+ let _enum: string[];
52
+ export { _enum as enum };
53
+ }
54
+ export namespace body {
55
+ let description_6: string;
56
+ export { description_6 as description };
57
+ let type_6: string;
58
+ export { type_6 as type };
59
+ let maxLength_3: number;
60
+ export { maxLength_3 as maxLength };
61
+ }
62
+ export namespace updatedAt {
63
+ let description_7: string;
64
+ export { description_7 as description };
65
+ let type_7: string;
66
+ export { type_7 as type };
67
+ }
68
+ export namespace createdAt {
69
+ let description_8: string;
70
+ export { description_8 as description };
71
+ let type_8: string;
72
+ export { type_8 as type };
73
+ }
74
+ export namespace tags {
75
+ let description_9: string;
76
+ export { description_9 as description };
77
+ let type_9: string;
78
+ export { type_9 as type };
79
+ export namespace items {
80
+ let type_10: string;
81
+ export { type_10 as type };
82
+ }
83
+ export let uniqueItems: boolean;
84
+ }
85
+ export namespace numOfTasks {
86
+ let description_10: string;
87
+ export { description_10 as description };
88
+ let type_11: string;
89
+ export { type_11 as type };
90
+ }
91
+ export namespace numOfCheckedTasks {
92
+ let description_11: string;
93
+ export { description_11 as description };
94
+ let type_12: string;
95
+ export { type_12 as type };
96
+ }
97
+ export namespace migratedBy {
98
+ let description_12: string;
99
+ export { description_12 as description };
100
+ let type_13: string;
101
+ export { type_13 as type };
102
+ let maxLength_4: number;
103
+ export { maxLength_4 as maxLength };
104
+ }
105
+ export namespace status {
106
+ let description_13: string;
107
+ export { description_13 as description };
108
+ let type_14: string;
109
+ export { type_14 as type };
110
+ let _enum_1: string[];
111
+ export { _enum_1 as enum };
112
+ }
113
+ export namespace share {
114
+ let description_14: string;
115
+ export { description_14 as description };
116
+ let type_15: string;
117
+ export { type_15 as type };
118
+ let _enum_2: string[];
119
+ export { _enum_2 as enum };
120
+ }
121
+ export namespace pinned {
122
+ let description_15: string;
123
+ export { description_15 as description };
124
+ let type_16: string;
125
+ export { type_16 as type };
126
+ }
127
+ export namespace timestamp {
128
+ let description_16: string;
129
+ export { description_16 as description };
130
+ let type_17: string;
131
+ export { type_17 as type };
132
+ }
133
+ export namespace _conflicts {
134
+ let description_17: string;
135
+ export { description_17 as description };
136
+ let type_18: string;
137
+ export { type_18 as type };
138
+ export namespace items_1 {
139
+ let type_19: string;
140
+ export { type_19 as type };
141
+ }
142
+ export { items_1 as items };
143
+ let uniqueItems_1: boolean;
144
+ export { uniqueItems_1 as uniqueItems };
145
+ }
146
+ }
147
+ declare let required$2: string[];
148
+ declare namespace __json_default_export$2 {
149
+ export { $schema$3 as $schema, $id$3 as $id, title$3 as title, description$3 as description, type$3 as type, properties$3 as properties, required$2 as required };
150
+ }
151
+ //#endregion
152
+ //#region src/crypto.d.ts
153
+ type EncryptionMetadata = {
154
+ algorithm: string;
155
+ iv: string;
156
+ tag: string;
157
+ };
158
+ type EncryptedData = EncryptionMetadata & {
159
+ content: string | Buffer;
160
+ };
161
+ //#endregion
162
+ //#region src/note.d.ts
163
+ type TrashBookId = 'trash';
164
+ type NoteStatus = 'none' | 'active' | 'onHold' | 'completed' | 'dropped';
165
+ type NoteVisibility = 'private' | 'public';
166
+ type NoteMetadata = {
167
+ _id: string;
168
+ _rev?: string;
169
+ bookId: string;
170
+ doctype: string;
171
+ updatedAt: number;
172
+ createdAt: number;
173
+ tags?: string[];
174
+ numOfTasks?: number;
175
+ numOfCheckedTasks?: number;
176
+ migratedBy?: string;
177
+ status?: NoteStatus;
178
+ share?: NoteVisibility;
179
+ pinned?: boolean;
180
+ timestamp: number;
181
+ _conflicts?: string[];
182
+ };
183
+ declare const NOTE_DOCID_PREFIX = "note:";
184
+ type Note = NoteMetadata & {
185
+ title: string;
186
+ body: string;
187
+ };
188
+ type EncryptedNote = NoteMetadata & {
189
+ encryptedData: EncryptedData;
190
+ };
191
+ declare const TRASH_BOOK_ID = "trash";
192
+ declare const NOTE_STATUS: Readonly<{
193
+ NONE: 'none';
194
+ ACTIVE: 'active';
195
+ ON_HOLD: 'onHold';
196
+ COMPLETED: 'completed';
197
+ DROPPED: 'dropped';
198
+ }>;
199
+ declare const NOTE_VISIBILITY: Readonly<{
200
+ PRIVATE: 'private';
201
+ PUBLIC: 'public';
202
+ }>;
203
+ declare const validateNote: ValidateFunction<Note>;
204
+ declare const NOTE_TITLE_MAX_LENGTH: number;
205
+ declare function createNoteId(): string;
206
+ declare function validateNoteId(docId: string): boolean;
207
+ //#endregion
208
+ //#region json-schema/book.json.d.ts
209
+ declare let $schema$2: string;
210
+ declare let $id$2: string;
211
+ declare let title$2: string;
212
+ declare let description$2: string;
213
+ declare let type$2: string;
214
+ declare namespace properties$2 {
215
+ namespace _id {
216
+ let description_1: string;
217
+ export { description_1 as description };
218
+ let type_1: string;
219
+ export { type_1 as type };
220
+ export let minLength: number;
221
+ export let maxLength: number;
222
+ export let pattern: string;
223
+ }
224
+ namespace _rev {
225
+ let description_2: string;
226
+ export { description_2 as description };
227
+ let type_2: string;
228
+ export { type_2 as type };
229
+ }
230
+ namespace name {
231
+ let description_3: string;
232
+ export { description_3 as description };
233
+ let type_3: string;
234
+ export { type_3 as type };
235
+ let minLength_1: number;
236
+ export { minLength_1 as minLength };
237
+ let maxLength_1: number;
238
+ export { maxLength_1 as maxLength };
239
+ }
240
+ namespace updatedAt {
241
+ let description_4: string;
242
+ export { description_4 as description };
243
+ let type_4: string;
244
+ export { type_4 as type };
245
+ }
246
+ namespace createdAt {
247
+ let description_5: string;
248
+ export { description_5 as description };
249
+ let type_5: string;
250
+ export { type_5 as type };
251
+ }
252
+ namespace count {
253
+ let description_6: string;
254
+ export { description_6 as description };
255
+ let type_6: string;
256
+ export { type_6 as type };
257
+ }
258
+ namespace parentBookId {
259
+ let description_7: string;
260
+ export { description_7 as description };
261
+ let type_7: string[];
262
+ export { type_7 as type };
263
+ }
264
+ namespace order {
265
+ let description_8: string;
266
+ export { description_8 as description };
267
+ let type_8: string;
268
+ export { type_8 as type };
269
+ }
270
+ namespace icon {
271
+ let description_9: string;
272
+ export { description_9 as description };
273
+ let type_9: string;
274
+ export { type_9 as type };
275
+ export let oneOf: ({
276
+ properties: {
277
+ type: {
278
+ description: string;
279
+ const: string;
280
+ };
281
+ svg: {
282
+ description: string;
283
+ type: string;
284
+ maxLength: number;
285
+ };
286
+ docId?: undefined;
287
+ };
288
+ required: string[];
289
+ } | {
290
+ properties: {
291
+ type: {
292
+ description: string;
293
+ const: string;
294
+ };
295
+ docId: {
296
+ description: string;
297
+ type: string;
298
+ pattern: string;
299
+ minLength: number;
300
+ maxLength: number;
301
+ };
302
+ svg?: undefined;
303
+ };
304
+ required: string[];
305
+ })[];
306
+ }
307
+ }
308
+ declare let required$1: string[];
309
+ declare namespace __json_default_export {
310
+ export { $schema$2 as $schema, $id$2 as $id, title$2 as title, description$2 as description, type$2 as type, properties$2 as properties, required$1 as required };
311
+ }
312
+ //#endregion
313
+ //#region src/book.d.ts
314
+ type BookIconInline = {
315
+ type: 'inline';
316
+ svg: string;
317
+ };
318
+ type BookIconFile = {
319
+ type: 'file';
320
+ docId: string;
321
+ };
322
+ type BookIcon = BookIconInline | BookIconFile;
323
+ type BookMetadata = {
324
+ _id: string;
325
+ _rev?: string;
326
+ updatedAt: number;
327
+ createdAt: number;
328
+ count?: number;
329
+ parentBookId?: null | string;
330
+ migratedBy?: string;
331
+ icon?: BookIcon;
332
+ order?: number;
333
+ };
334
+ type Book = BookMetadata & {
335
+ name: string;
336
+ };
337
+ type EncryptedBook = BookMetadata & {
338
+ encryptedData: EncryptedData;
339
+ };
340
+ declare const BOOK_DOCID_PREFIX = "book:";
341
+ declare const validateBook: ValidateFunction<Book>;
342
+ declare function createBookId(): string;
343
+ declare function validateBookId(docId: string): boolean;
344
+ //#endregion
345
+ //#region json-schema/tag.json.d.ts
346
+ declare let $schema$1: string;
347
+ declare let $id$1: string;
348
+ declare let title$1: string;
349
+ declare let description$1: string;
350
+ declare let type$1: string;
351
+ declare namespace properties$1 {
352
+ namespace _id {
353
+ let description_1: string;
354
+ export { description_1 as description };
355
+ let type_1: string;
356
+ export { type_1 as type };
357
+ export let minLength: number;
358
+ export let maxLength: number;
359
+ export let pattern: string;
360
+ }
361
+ namespace _rev {
362
+ let description_2: string;
363
+ export { description_2 as description };
364
+ let type_2: string;
365
+ export { type_2 as type };
366
+ }
367
+ namespace name {
368
+ let description_3: string;
369
+ export { description_3 as description };
370
+ let type_3: string;
371
+ export { type_3 as type };
372
+ let maxLength_1: number;
373
+ export { maxLength_1 as maxLength };
374
+ }
375
+ namespace count {
376
+ let description_4: string;
377
+ export { description_4 as description };
378
+ let type_4: string;
379
+ export { type_4 as type };
380
+ }
381
+ namespace color {
382
+ let description_5: string;
383
+ export { description_5 as description };
384
+ let type_5: string;
385
+ export { type_5 as type };
386
+ let _enum: string[];
387
+ export { _enum as enum };
388
+ }
389
+ namespace updatedAt {
390
+ let description_6: string;
391
+ export { description_6 as description };
392
+ let type_6: string;
393
+ export { type_6 as type };
394
+ }
395
+ namespace createdAt {
396
+ let description_7: string;
397
+ export { description_7 as description };
398
+ let type_7: string;
399
+ export { type_7 as type };
400
+ }
401
+ }
402
+ declare let required: string[];
403
+ declare namespace __json_default_export$3 {
404
+ export { $schema$1 as $schema, $id$1 as $id, title$1 as title, description$1 as description, type$1 as type, properties$1 as properties, required };
405
+ }
406
+ //#endregion
407
+ //#region src/tag.d.ts
408
+ type TagColor = 'default' | 'red' | 'orange' | 'yellow' | 'olive' | 'green' | 'teal' | 'blue' | 'violet' | 'purple' | 'pink' | 'brown' | 'grey' | 'black';
409
+ declare const TAG_COLOR: Readonly<{
410
+ DEFAULT: 'default';
411
+ RED: 'red';
412
+ ORANGE: 'orange';
413
+ YELLOW: 'yellow';
414
+ OLIVE: 'olive';
415
+ GREEN: 'green';
416
+ TEAL: 'teal';
417
+ BLUE: 'blue';
418
+ VIOLET: 'violet';
419
+ PURPLE: 'purple';
420
+ PINK: 'pink';
421
+ BROWN: 'brown';
422
+ GREY: 'grey';
423
+ BLACK: 'black';
424
+ }>;
425
+ type TagMetadata = {
426
+ _id: string;
427
+ _rev?: string;
428
+ count?: number;
429
+ color: TagColor;
430
+ updatedAt: number;
431
+ createdAt: number;
432
+ };
433
+ type Tag = TagMetadata & {
434
+ name: string;
435
+ };
436
+ type EncryptedTag = TagMetadata & {
437
+ encryptedData: EncryptedData;
438
+ };
439
+ declare const TAG_DOCID_PREFIX = "tag:";
440
+ declare const validateTag: ValidateFunction<Tag>;
441
+ declare function createTagId(): string;
442
+ declare function validateTagId(docId: string): boolean;
443
+ //#endregion
444
+ //#region json-schema/file.json.d.ts
445
+ declare let $schema: string;
446
+ declare let $id: string;
447
+ declare let title: string;
448
+ declare let description: string;
449
+ declare let type: string;
450
+ declare namespace properties {
451
+ namespace _id {
452
+ let description_1: string;
453
+ export { description_1 as description };
454
+ let type_1: string;
455
+ export { type_1 as type };
456
+ export let minLength: number;
457
+ export let maxLength: number;
458
+ export let pattern: string;
459
+ }
460
+ namespace _rev {
461
+ let description_2: string;
462
+ export { description_2 as description };
463
+ let type_2: string;
464
+ export { type_2 as type };
465
+ }
466
+ namespace name {
467
+ let description_3: string;
468
+ export { description_3 as description };
469
+ let type_3: string;
470
+ export { type_3 as type };
471
+ let minLength_1: number;
472
+ export { minLength_1 as minLength };
473
+ let maxLength_1: number;
474
+ export { maxLength_1 as maxLength };
475
+ }
476
+ namespace createdAt {
477
+ let description_4: string;
478
+ export { description_4 as description };
479
+ let type_4: string;
480
+ export { type_4 as type };
481
+ }
482
+ namespace contentType {
483
+ let description_5: string;
484
+ export { description_5 as description };
485
+ let type_5: string;
486
+ export { type_5 as type };
487
+ let _enum: string[];
488
+ export { _enum as enum };
489
+ let maxLength_2: number;
490
+ export { maxLength_2 as maxLength };
491
+ }
492
+ namespace contentLength {
493
+ let description_6: string;
494
+ export { description_6 as description };
495
+ let type_6: string;
496
+ export { type_6 as type };
497
+ export let maximum: number;
498
+ }
499
+ namespace publicIn {
500
+ let description_7: string;
501
+ export { description_7 as description };
502
+ let type_7: string;
503
+ export { type_7 as type };
504
+ export namespace items {
505
+ let type_8: string;
506
+ export { type_8 as type };
507
+ }
508
+ export let uniqueItems: boolean;
509
+ }
510
+ namespace _attachments {
511
+ let description_8: string;
512
+ export { description_8 as description };
513
+ let type_9: string;
514
+ export { type_9 as type };
515
+ export namespace properties_1 {
516
+ namespace index {
517
+ let description_9: string;
518
+ export { description_9 as description };
519
+ let type_10: string;
520
+ export { type_10 as type };
521
+ export namespace properties_2 {
522
+ namespace content_type {
523
+ let description_10: string;
524
+ export { description_10 as description };
525
+ let type_11: string;
526
+ export { type_11 as type };
527
+ let _enum_1: string[];
528
+ export { _enum_1 as enum };
529
+ }
530
+ namespace data {
531
+ let description_11: string;
532
+ export { description_11 as description };
533
+ let type_12: string[];
534
+ export { type_12 as type };
535
+ }
536
+ }
537
+ export { properties_2 as properties };
538
+ export let required: string[];
539
+ }
540
+ }
541
+ export { properties_1 as properties };
542
+ let required_1: string[];
543
+ export { required_1 as required };
544
+ }
545
+ }
546
+ declare let required_2: string[];
547
+ declare namespace __json_default_export$1 {
548
+ export { $schema, $id, title, description, type, properties, required_2 as required };
549
+ }
550
+ //#endregion
551
+ //#region src/file.d.ts
552
+ type ImageFileType = 'image/png' | 'image/jpeg' | 'image/jpg' | 'image/svg+xml' | 'image/gif' | 'image/heic' | 'image/heif';
553
+ declare const supportedImageFileTypes: ReadonlyArray<ImageFileType>;
554
+ declare const SUPPORTED_IMAGE_MIME_TYPES: {
555
+ readonly [mime: string]: ImageFileType;
556
+ };
557
+ declare const maxAttachmentFileSize: number;
558
+ type FileAttachmentItem = {
559
+ digest?: string;
560
+ content_type: ImageFileType;
561
+ data: Buffer | string;
562
+ length?: number;
563
+ };
564
+ type File = {
565
+ _id: string;
566
+ _rev?: string;
567
+ name: string;
568
+ createdAt: number;
569
+ contentType: ImageFileType;
570
+ contentLength: number;
571
+ publicIn: string[];
572
+ _attachments: {
573
+ index: FileAttachmentItem;
574
+ };
575
+ md5digest?: string;
576
+ };
577
+ type EncryptedFile = File & {
578
+ encryptionData: EncryptionMetadata;
579
+ };
580
+ declare const FILE_DOCID_PREFIX = "file:";
581
+ declare const validateFile: ValidateFunction<File>;
582
+ declare function createFileId(): string;
583
+ declare function validateFileId(docId: string): boolean;
584
+ //#endregion
585
+ //#region src/validator.d.ts
586
+ declare function validationErrorsToMessage(errors: ErrorObject[]): string;
587
+ declare class InvalidDataError extends Error {
588
+ name: string;
589
+ errors: ErrorObject[];
590
+ constructor(message: string, errors: ErrorObject[]);
591
+ }
592
+ declare function validateDocId(prefix: string, docId: string): boolean;
593
+ //#endregion
594
+ //#region src/utils.d.ts
595
+ declare function createDocId(prefix: string): string;
596
+ //#endregion
597
+ export { BOOK_DOCID_PREFIX, Book, BookIcon, BookIconFile, BookIconInline, BookMetadata, __json_default_export as BookSchema, EncryptedBook, EncryptedData, EncryptedFile, EncryptedNote, EncryptedTag, EncryptionMetadata, FILE_DOCID_PREFIX, File, FileAttachmentItem, __json_default_export$1 as FileSchema, ImageFileType, InvalidDataError, NOTE_DOCID_PREFIX, NOTE_STATUS, NOTE_TITLE_MAX_LENGTH, NOTE_VISIBILITY, Note, NoteMetadata, __json_default_export$2 as NoteSchema, NoteStatus, NoteVisibility, SUPPORTED_IMAGE_MIME_TYPES, TAG_COLOR, TAG_DOCID_PREFIX, TRASH_BOOK_ID, Tag, TagColor, TagMetadata, __json_default_export$3 as TagSchema, TrashBookId, createBookId, createDocId, createFileId, createNoteId, createTagId, maxAttachmentFileSize, supportedImageFileTypes, validateBook, validateBookId, validateDocId, validateFile, validateFileId, validateNote, validateNoteId, validateTag, validateTagId, validationErrorsToMessage };
598
+ //# sourceMappingURL=index.d.ts.map