1 | import WebpackDevServer from 'webpack-dev-server';
|
2 | import { Configuration, loader } from 'webpack';
|
3 | import { TransformOptions } from 'buble';
|
4 | import { Handler, DocumentationObject, PropDescriptor } from 'react-docgen';
|
5 | import { ASTNode } from 'ast-types';
|
6 | import { NodePath } from 'ast-types/lib/node-path';
|
7 | import { Styles } from 'jss';
|
8 | import { RecursivePartial } from './RecursivePartial';
|
9 | import { ExpandMode } from './RsgComponent';
|
10 | import { PropsObject } from './RsgPropsObject';
|
11 | import { CodeExample } from './RsgExample';
|
12 | import { ConfigSection, Section } from './RsgSection';
|
13 | import { Theme } from './RsgTheme';
|
14 | export interface StyleguidistLoaderContext extends loader.LoaderContext {
|
15 | _styleguidist: SanitizedStyleguidistConfig;
|
16 | }
|
17 | interface BaseStyleguidistConfig {
|
18 | assetsDir: string | string[];
|
19 | tocMode: ExpandMode;
|
20 | compilerConfig: TransformOptions;
|
21 | components: (() => string[]) | string | string[];
|
22 | configDir: string;
|
23 | context: Record<string, any>;
|
24 | contextDependencies: string[];
|
25 | configureServer(server: WebpackDevServer, env: string): string;
|
26 | dangerouslyUpdateWebpackConfig: (server: Configuration, env: string) => Configuration;
|
27 | defaultExample: string | false;
|
28 | exampleMode: ExpandMode;
|
29 | editorConfig: {
|
30 | theme: string;
|
31 | };
|
32 | getComponentPathLine(componentPath: string): string;
|
33 | getExampleFilename(componentPath: string): string;
|
34 | handlers: (componentPath: string) => Handler[];
|
35 | ignore: string[];
|
36 | logger: {
|
37 | info(message: string): void;
|
38 | warn(message: string): void;
|
39 | debug(message: string): void;
|
40 | };
|
41 | minimize: boolean;
|
42 | mountPointId: string;
|
43 | moduleAliases: Record<string, string>;
|
44 | pagePerSection: boolean;
|
45 | previewDelay: number;
|
46 | printBuildInstructions(config: SanitizedStyleguidistConfig): void;
|
47 | printServerInstructions(config: SanitizedStyleguidistConfig, options: {
|
48 | isHttps: boolean;
|
49 | }): void;
|
50 | propsParser(filePath: string, code: string, resolver: (ast: ASTNode, parser: {
|
51 | parse: (code: string) => ASTNode;
|
52 | }) => NodePath<any, any> | NodePath[], handlers: Handler[]): DocumentationObject;
|
53 | require: string[];
|
54 | resolver(ast: ASTNode, parser: {
|
55 | parse: (code: string) => ASTNode;
|
56 | }): NodePath<any, any> | NodePath[];
|
57 | ribbon?: {
|
58 | text?: string;
|
59 | url: string;
|
60 | };
|
61 | serverHost: string;
|
62 | serverPort: number;
|
63 | showCode: boolean;
|
64 | showUsage: boolean;
|
65 | showSidebar: boolean;
|
66 | skipComponentsWithoutExample: boolean;
|
67 | sortProps(props: PropDescriptor[]): PropDescriptor[];
|
68 | styleguideComponents: Record<string, string>;
|
69 | styleguideDir: string;
|
70 | styles: Styles | string | ((theme: Theme) => Styles);
|
71 | template: any;
|
72 | theme: RecursivePartial<Theme> | string;
|
73 | title: string;
|
74 | updateDocs(doc: PropsObject, file: string): PropsObject;
|
75 | updateExample(props: Omit<CodeExample, 'type'>, ressourcePath: string): Omit<CodeExample, 'type'>;
|
76 | updateWebpackConfig(config: Configuration): Configuration;
|
77 | usageMode: ExpandMode;
|
78 | verbose: boolean;
|
79 | version: string;
|
80 | webpackConfig: Configuration | ((env?: string) => Configuration);
|
81 | }
|
82 | export interface ProcessedStyleguidistConfig extends BaseStyleguidistConfig {
|
83 | sections: Section[];
|
84 | theme: RecursivePartial<Theme>;
|
85 | styles: ((th: Theme) => Styles) | Styles;
|
86 | }
|
87 | export declare type ProcessedStyleguidistCSSConfig = Pick<ProcessedStyleguidistConfig, 'theme'> & Pick<ProcessedStyleguidistConfig, 'styles'>;
|
88 | export interface SanitizedStyleguidistConfig extends BaseStyleguidistConfig {
|
89 | sections: ConfigSection[];
|
90 | }
|
91 | /**
|
92 | * definition of the config object where everything is optional
|
93 | * note that teh default example can be both a string and a boolean but ends
|
94 | * up only being a string after sanitizing
|
95 | */
|
96 | export interface StyleguidistConfig extends RecursivePartial<Omit<SanitizedStyleguidistConfig, 'defaultExample'>> {
|
97 | defaultExample?: string | boolean;
|
98 | }
|
99 | export {};
|
100 |
|
\ | No newline at end of file |