-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.ts
More file actions
29 lines (26 loc) · 837 Bytes
/
config.ts
File metadata and controls
29 lines (26 loc) · 837 Bytes
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
export interface ReactDocsConfig {
basePath: string;
contentPath: string;
searchApiPath: string;
aiChatApiPath: string;
}
export interface ReactDocsConfigOptions {
basePath?: string;
contentPath?: string;
searchApiPath?: string;
aiChatApiPath?: string;
}
const DEFAULT_CONFIG: ReactDocsConfig = {
basePath: "/docs",
contentPath: "content/docs",
searchApiPath: "/api/docs/search-index",
aiChatApiPath: "/api/docs/chat",
};
export function createReactDocsConfig(options: ReactDocsConfigOptions = {}): ReactDocsConfig {
return {
basePath: options.basePath ?? DEFAULT_CONFIG.basePath,
contentPath: options.contentPath ?? DEFAULT_CONFIG.contentPath,
searchApiPath: options.searchApiPath ?? DEFAULT_CONFIG.searchApiPath,
aiChatApiPath: options.aiChatApiPath ?? DEFAULT_CONFIG.aiChatApiPath,
};
}