1
- import type { LayoutKey } from '#build/types/layouts'
2
- import type { Theme } from 'shiki-es'
3
1
import type { StorageValue } from 'unstorage'
2
+ import type { LayoutKey } from '#build/types/layouts'
4
3
5
4
export interface ParsedContentInternalMeta {
6
5
/**
@@ -45,27 +44,22 @@ export interface ParsedContentInternalMeta {
45
44
_extension ?: 'md' | 'yaml' | 'yml' | 'json' | 'json5' | 'csv'
46
45
}
47
46
48
- export interface ParsedContentMeta extends ParsedContentInternalMeta {
49
- /**
50
- * Layout
51
- */
52
- layout ?: LayoutKey
47
+ //
53
48
54
- [ key : string ] : any
49
+ export interface TocLink {
50
+ id : string
51
+ text : string
52
+ depth : number
53
+ children ?: TocLink [ ]
55
54
}
56
55
57
- export interface ParsedContent extends ParsedContentMeta {
58
- /**
59
- * Excerpt
60
- */
61
- excerpt ?: MarkdownRoot
62
- /**
63
- * Content body
64
- */
65
- body : MarkdownRoot | null
56
+ export interface Toc {
57
+ title : string
58
+ depth : number
59
+ searchDepth : number
60
+ links : TocLink [ ]
66
61
}
67
62
68
- //
69
63
export interface MarkdownNode {
70
64
type : string
71
65
tag ?: string
@@ -78,18 +72,18 @@ export interface MarkdownNode {
78
72
fmAttributes ?: Record < string , any >
79
73
}
80
74
81
- export interface MarkdownHtmlNode extends MarkdownNode {
82
- type : 'html'
83
- value : string
84
- }
85
-
86
75
export interface MarkdownRoot {
87
76
type : 'root'
88
77
children : MarkdownNode [ ]
89
78
props ?: Record < string , any >
90
79
toc ?: Toc
91
80
}
92
81
82
+ export interface MarkdownHtmlNode extends MarkdownNode {
83
+ type : 'html'
84
+ value : string
85
+ }
86
+
93
87
export interface MarkdownPlugin extends Record < string , any > { }
94
88
95
89
export interface MarkdownOptions {
@@ -109,18 +103,24 @@ export interface MarkdownOptions {
109
103
rehypePlugins : Record < string , false | ( MarkdownPlugin & { instance : any } ) >
110
104
}
111
105
112
- export interface TocLink {
113
- id : string
114
- text : string
115
- depth : number
116
- children ?: TocLink [ ]
106
+ export interface ParsedContentMeta extends ParsedContentInternalMeta {
107
+ /**
108
+ * Layout
109
+ */
110
+ layout ?: LayoutKey
111
+
112
+ [ key : string ] : any
117
113
}
118
114
119
- export interface Toc {
120
- title : string
121
- depth : number
122
- searchDepth : number
123
- links : TocLink [ ]
115
+ export interface ParsedContent extends ParsedContentMeta {
116
+ /**
117
+ * Excerpt
118
+ */
119
+ excerpt ?: MarkdownRoot
120
+ /**
121
+ * Content body
122
+ */
123
+ body : MarkdownRoot | null
124
124
}
125
125
126
126
export interface MarkdownParsedContent extends ParsedContent {
@@ -413,7 +413,7 @@ export interface QueryBuilderWhere extends Partial<Record<keyof ParsedContentInt
413
413
**/
414
414
$in ?: string | Array < string | number | boolean >
415
415
416
- [ key : string ] : string | number | boolean | RegExp | QueryBuilderWhere | Array < string | number | boolean | QueryBuilderWhere >
416
+ [ key : string ] : undefined | string | number | boolean | RegExp | QueryBuilderWhere | Array < string | number | boolean | QueryBuilderWhere >
417
417
}
418
418
419
419
export interface QueryBuilderParams {
@@ -437,8 +437,8 @@ export interface QueryBuilder<T = ParsedContentMeta> {
437
437
/**
438
438
* Select a subset of fields
439
439
*/
440
- only < K extends keyof T | string > ( keys : K ) : QueryBuilder < Pick < T , K > >
441
- only < K extends ( keyof T | string ) [ ] > ( keys : K ) : QueryBuilder < Pick < T , K [ number ] > >
440
+ only < K extends keyof T > ( keys : K ) : QueryBuilder < Pick < T , K > >
441
+ only < K extends ( keyof T ) [ ] > ( keys : K ) : QueryBuilder < Pick < T , K [ number ] > >
442
442
443
443
/**
444
444
* Remove a subset of fields
@@ -495,7 +495,7 @@ export interface QueryBuilder<T = ParsedContentMeta> {
495
495
* Retrieve query builder params
496
496
* @internal
497
497
*/
498
- params : ( ) => readonly QueryBuilderParams
498
+ params : ( ) => QueryBuilderParams
499
499
}
500
500
501
501
export type QueryPipe < T = any > = ( data : Array < T > , param : QueryBuilderParams ) => Array < T > | void
0 commit comments