-
Notifications
You must be signed in to change notification settings - Fork 67.1k
Expand file tree
/
Copy pathtypes.ts
More file actions
52 lines (47 loc) · 1.05 KB
/
types.ts
File metadata and controls
52 lines (47 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/**
* Types for the content-render module
*/
/**
* Context interface for content rendering operations
*/
export interface Context {
currentLanguage?: string
autotitleLanguage?: string
currentVersion?: string
currentProduct?: string
markdownRequested?: boolean
pages?: Record<string, unknown>
redirects?: Record<string, string>
page?: {
fullPath: string
[key: string]: unknown
}
[key: string]: unknown
}
/**
* Options for rendering operations
*/
export interface RenderOptions {
cache?: boolean | ((template: string, context: Context) => string | null)
filename?: string
textOnly?: boolean
[key: string]: unknown
}
/**
* Unified processor plugin function type
*/
export type UnifiedPlugin = (context?: Context) => unknown
/**
* VFile interface for unified processing
*/
export interface VFile {
toString(): string
[key: string]: unknown
}
/**
* Unified processor interface
*/
export interface UnifiedProcessor {
process(content: string): Promise<VFile>
use(plugin: unknown, ...args: unknown[]): UnifiedProcessor
}