UNPKG

2.34 kBTypeScriptView Raw
1import type { OutputTargetReact, PackageJSON } from './types';
2import type { CompilerCtx, ComponentCompilerMeta, Config } from '@stencil/core/internal';
3/**
4 * Generate and write the Stencil-React bindings to disc
5 * @param config the Stencil configuration associated with the project
6 * @param compilerCtx the compiler context of the current Stencil build
7 * @param outputTarget the output target configuration for generating the React wrapper
8 * @param components the components to generate the bindings for
9 */
10export declare function reactProxyOutput(config: Config, compilerCtx: CompilerCtx, outputTarget: OutputTargetReact, components: ReadonlyArray<ComponentCompilerMeta>): Promise<void>;
11/**
12 * Generate the code that will be responsible for creating the Stencil-React bindings
13 * @param config the Stencil configuration associated with the project
14 * @param components the Stencil components to generate wrappers for
15 * @param pkgData `package.json` data for the Stencil project
16 * @param outputTarget the output target configuration used to generate the Stencil-React bindings
17 * @param rootDir the directory of the Stencil project
18 * @returns the generated code to create the Stencil-React bindings
19 */
20export declare function generateProxies(config: Config, components: ReadonlyArray<ComponentCompilerMeta>, pkgData: PackageJSON, outputTarget: OutputTargetReact, rootDir: string): string;
21/**
22 * Defines the React component that developers will import to use in their applications.
23 * @param cmpMeta Meta data for a single Web Component
24 * @param includeCustomElement If `true`, the Web Component instance will be passed in to createReactComponent to be
25 * registered with the Custom Elements Registry.
26 * @returns An array where each entry is a string version of the React component definition.
27 */
28export declare function createComponentDefinition(cmpMeta: ComponentCompilerMeta, includeCustomElement?: boolean): ReadonlyArray<string>;
29/**
30 * Derive the path to the loader
31 * @param config the Stencil configuration for the project
32 * @param outputTarget the output target used for generating the Stencil-React bindings
33 * @returns the derived loader path
34 */
35export declare function getPathToCorePackageLoader(config: Config, outputTarget: OutputTargetReact): string;
36export declare const GENERATED_DTS = "components.d.ts";