UNPKG

2.14 kBTypeScriptView Raw
1import type { OutputTargetCustom } from '@stencil/core/internal';
2export interface ReactOutputTargetOptions {
3 /**
4 * Specify the output directory or path where the generated React components will be saved.
5 */
6 outDir: string;
7 /**
8 * Specify the components that should be excluded from the React output target.
9 */
10 excludeComponents?: string[];
11 /**
12 * The package name of the Stencil project.
13 *
14 * This value is automatically detected from the package.json file of the Stencil project.
15 * If the validation fails, you can manually assign the package name.
16 */
17 stencilPackageName?: string;
18 /**
19 * Enables generating the react components as ES modules.
20 * @default false
21 */
22 esModules?: boolean;
23 /**
24 * The directory where the custom elements are saved.
25 *
26 * This value is automatically detected from the Stencil configuration file for the dist-custom-elements output target.
27 * If you are working in an environment that uses absolute paths, consider setting this value manually.
28 */
29 customElementsDir?: string;
30 /**
31 * To enable server side rendering, provide the path to the hydrate module, e.g. `my-component/hydrate`.
32 * By default this value is undefined and server side rendering is disabled.
33 */
34 hydrateModule?: string;
35 /**
36 * Specify the components that should be excluded from server side rendering.
37 */
38 excludeServerSideRenderingFor?: string[];
39}
40interface ReactOutputTarget extends OutputTargetCustom {
41 __internal_getCustomElementsDir: () => string;
42}
43/**
44 * Creates an output target for binding Stencil components to be used in a React context
45 * @public
46 * @param outputTarget the user-defined output target defined in a Stencil configuration file
47 * @returns an output target that can be used by the Stencil compiler
48 */
49export declare const reactOutputTarget: ({ outDir, esModules, stencilPackageName, excludeComponents, customElementsDir: customElementsDirOverride, hydrateModule, excludeServerSideRenderingFor, }: ReactOutputTargetOptions) => ReactOutputTarget;
50export {};