UNPKG

2.75 kBTypeScriptView Raw
1import { Argv as Yargs } from 'yargs';
2import { Plugin } from '../lib/Plugin';
3import { BabelRC } from '../config/babel';
4export declare type Env = 'production' | 'development';
5export declare type ThemeConfig = Record<string, any>;
6export interface DocgenConfig {
7 handlers?: any[];
8 resolver?: (ast: any, recast: any) => any;
9 propFilter?: (prop: any) => boolean;
10 searchPath: string;
11}
12export interface Menu {
13 name: string;
14 route?: string;
15 href?: string;
16 menu?: Menu[];
17}
18export interface HtmlContext {
19 lang: string;
20 favicon?: string;
21 head?: {
22 meta: any[];
23 links: any[];
24 raw: string;
25 scripts: any[];
26 };
27 body?: {
28 raw: string;
29 scripts: any[];
30 };
31}
32export interface Argv {
33 base: string;
34 src: string;
35 files: string | string[];
36 ignore: string[];
37 watchIgnore: string;
38 public: string;
39 dest: string;
40 editBranch: string;
41 config: string;
42 debug: boolean;
43 clearConsole: boolean;
44 typescript: boolean;
45 propsParser: boolean;
46 host: string;
47 port: number;
48 websocketPort: number;
49 websocketHost: string;
50 native: boolean;
51 codeSandbox: boolean;
52 sourcemaps: boolean;
53 notUseSpecifiers: boolean;
54 title: string;
55 description: string;
56 theme: string;
57 wrapper?: string;
58 indexHtml?: string;
59 /** slugify separator */
60 separator: string;
61}
62export interface Config extends Argv {
63 paths: Record<string, any>;
64 plugins: Plugin[];
65 mdPlugins: any[];
66 hastPlugins: any[];
67 menu: Menu[];
68 htmlContext: HtmlContext;
69 themeConfig: ThemeConfig;
70 docgenConfig: DocgenConfig;
71 filterComponents: (files: string[]) => string[];
72 modifyBundlerConfig<C>(config: C, dev: boolean, args: Config): C;
73 modifyBabelRc(babelrc: BabelRC, args: Config): BabelRC;
74 onCreateWebpackChain<C>(c: C, dev: boolean, args: Config): void;
75}
76export declare const setArgs: (yargs: Yargs<{}>) => Yargs<{
77 base: any;
78} & {
79 source: any;
80} & {
81 files: any;
82} & {
83 ignore: any;
84} & {
85 public: any;
86} & {
87 dest: any;
88} & {
89 editBranch: any;
90} & {
91 config: any;
92} & {
93 title: any;
94} & {
95 description: any;
96} & {
97 theme: any;
98} & {
99 typescript: any;
100} & {
101 propsParser: any;
102} & {
103 wrapper: any;
104} & {
105 indexHtml: any;
106} & {
107 debug: any;
108} & {
109 clearConsole: any;
110} & {
111 host: any;
112} & {
113 port: any;
114} & {
115 websocketHost: any;
116} & {
117 websocketPort: any;
118} & {
119 native: any;
120} & {
121 codeSandbox: any;
122} & {
123 sourcemaps: any;
124} & {
125 separator: any;
126} & {
127 open: boolean;
128}>;