forked from OnedocLabs/react-print-pdf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.ts
34 lines (29 loc) · 729 Bytes
/
types.ts
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
import React from "react";
import type { CompileOptions } from "../src/compile/compile";
export interface Example {
description?: string;
name?: string;
template: React.ReactElement;
compileOptions?: CompileOptions;
imports?: string[];
externalImports?: string[];
}
export interface EnrichedExample extends Example {
templateString: string;
}
export interface ConfigComponentDoc<T = Example> {
server: boolean;
client: boolean;
examples?: {
[key: string]: T;
};
}
export interface DocConfig<T = Example> {
name?: string;
icon?: string;
description: string;
components: {
[componentName: string]: ConfigComponentDoc<T>;
};
}
export type ExtendedDocConfig = DocConfig<EnrichedExample>;