@stencil/types-output-target 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/generators/base.d.ts +42 -0
- package/dist/generators/preact.d.ts +12 -0
- package/dist/generators/react.d.ts +12 -0
- package/dist/generators/solid.d.ts +17 -0
- package/dist/generators/svelte.d.ts +12 -0
- package/dist/generators/vue.d.ts +12 -0
- package/dist/index.cjs +43 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +124 -0
- package/dist/index.js +334 -0
- package/dist/index.js.map +1 -0
- package/dist/utils/string-utils.d.ts +6 -0
- package/package.json +58 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ComponentCompilerMeta } from '@stencil/core/internal';
|
|
2
|
+
|
|
3
|
+
export interface BaseTypesOptions {
|
|
4
|
+
components: ComponentCompilerMeta[];
|
|
5
|
+
stencilPackageName: string;
|
|
6
|
+
excludeComponents?: string[];
|
|
7
|
+
}
|
|
8
|
+
export interface ComponentInfo {
|
|
9
|
+
tagName: string;
|
|
10
|
+
pascalName: string;
|
|
11
|
+
propsInterfaceName: string;
|
|
12
|
+
customEventType: string;
|
|
13
|
+
elementType: string;
|
|
14
|
+
properties: PropertyInfo[];
|
|
15
|
+
events: EventInfo[];
|
|
16
|
+
}
|
|
17
|
+
export interface PropertyInfo {
|
|
18
|
+
name: string;
|
|
19
|
+
type: string;
|
|
20
|
+
docs?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface EventInfo {
|
|
23
|
+
name: string;
|
|
24
|
+
type: string;
|
|
25
|
+
docs?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Filters components based on internal flag and exclude list.
|
|
29
|
+
*/
|
|
30
|
+
export declare function filterComponents(components: ComponentCompilerMeta[], excludeComponents?: string[]): ComponentCompilerMeta[];
|
|
31
|
+
/**
|
|
32
|
+
* Extracts component information needed for type generation.
|
|
33
|
+
*/
|
|
34
|
+
export declare function extractComponentInfo(component: ComponentCompilerMeta): ComponentInfo;
|
|
35
|
+
/**
|
|
36
|
+
* Collects all types that need to be imported from the Stencil package.
|
|
37
|
+
*/
|
|
38
|
+
export declare function collectImportTypes(components: ComponentCompilerMeta[], includeCustomEvents?: boolean): Set<string>;
|
|
39
|
+
/**
|
|
40
|
+
* Generates the standard file header comment.
|
|
41
|
+
*/
|
|
42
|
+
export declare function generateHeader(framework: string, stencilPackageName: string, importPath: string): string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseTypesOptions } from './base.js';
|
|
2
|
+
|
|
3
|
+
export interface PreactTypesOptions extends BaseTypesOptions {
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Creates a TypeScript declaration file (.d.ts) that provides type definitions
|
|
7
|
+
* for using Stencil web components as native custom elements in Preact.
|
|
8
|
+
*
|
|
9
|
+
* The generated file augments the `preact` module to provide proper
|
|
10
|
+
* typing for custom elements when used in Preact JSX.
|
|
11
|
+
*/
|
|
12
|
+
export declare function createPreactTypes({ components, stencilPackageName, excludeComponents }: PreactTypesOptions): string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseTypesOptions } from './base.js';
|
|
2
|
+
|
|
3
|
+
export interface ReactTypesOptions extends BaseTypesOptions {
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Creates a TypeScript declaration file (.d.ts) that provides type definitions
|
|
7
|
+
* for using Stencil web components as native custom elements in React 19+.
|
|
8
|
+
*
|
|
9
|
+
* The generated file augments the `react/jsx-runtime` module to provide proper
|
|
10
|
+
* typing for custom elements when used directly in JSX without wrapper components.
|
|
11
|
+
*/
|
|
12
|
+
export declare function createReactTypes({ components, stencilPackageName, excludeComponents }: ReactTypesOptions): string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BaseTypesOptions } from './base.js';
|
|
2
|
+
|
|
3
|
+
export interface SolidTypesOptions extends BaseTypesOptions {
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Creates a TypeScript declaration file (.d.ts) that provides type definitions
|
|
7
|
+
* for using Stencil web components as native custom elements in Solid.
|
|
8
|
+
*
|
|
9
|
+
* Solid distinguishes between:
|
|
10
|
+
* - Properties (prop:): Set via JavaScript property
|
|
11
|
+
* - Attributes (attr:): Set via HTML attribute
|
|
12
|
+
* - Events (on:): Custom event handlers
|
|
13
|
+
*
|
|
14
|
+
* The generated file augments the `solid-js` module to provide proper
|
|
15
|
+
* typing for custom elements when used in Solid JSX.
|
|
16
|
+
*/
|
|
17
|
+
export declare function createSolidTypes({ components, stencilPackageName, excludeComponents }: SolidTypesOptions): string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseTypesOptions } from './base.js';
|
|
2
|
+
|
|
3
|
+
export interface SvelteTypesOptions extends BaseTypesOptions {
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Creates a TypeScript declaration file (.d.ts) that provides type definitions
|
|
7
|
+
* for using Stencil web components as native custom elements in Svelte.
|
|
8
|
+
*
|
|
9
|
+
* The generated file augments the `svelte/elements` module to provide proper
|
|
10
|
+
* typing for custom elements when used in Svelte templates.
|
|
11
|
+
*/
|
|
12
|
+
export declare function createSvelteTypes({ components, stencilPackageName, excludeComponents }: SvelteTypesOptions): string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseTypesOptions } from './base.js';
|
|
2
|
+
|
|
3
|
+
export interface VueTypesOptions extends BaseTypesOptions {
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Creates a TypeScript declaration file (.d.ts) that provides type definitions
|
|
7
|
+
* for using Stencil web components as native custom elements in Vue 3.
|
|
8
|
+
*
|
|
9
|
+
* Vue uses kebab-case event names with @ prefix in templates (e.g., @my-event).
|
|
10
|
+
* The generated file augments Vue's GlobalComponents interface.
|
|
11
|
+
*/
|
|
12
|
+
export declare function createVueTypes({ components, stencilPackageName, excludeComponents }: VueTypesOptions): string;
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("node:path"),P=s=>s.toLowerCase().split("-").map(c=>c.charAt(0).toUpperCase()+c.slice(1)).join(""),N=s=>s.replace(/\/\/.*$/gm,"").replace(/\n/g," ").replace(/\s{2,}/g," ").trim();function j(s,c){return s.filter(a=>!(a.internal===!0||c!=null&&c.includes(a.tagName)))}function L(s){const c=s.tagName,a=P(c),r=(s.properties||[]).filter(n=>!n.internal),e=(s.events||[]).filter(n=>!n.internal),u=r.map(n=>{var i,t,p;return{name:n.name,type:N(((i=n.complexType)==null?void 0:i.original)||"any"),docs:(p=(t=n.docs)==null?void 0:t.text)==null?void 0:p.trim()}}),l=e.map(n=>{var i,t,p;return{name:n.name,type:N(((i=n.complexType)==null?void 0:i.original)||"void"),docs:(p=(t=n.docs)==null?void 0:t.text)==null?void 0:p.trim()}});return{tagName:c,pascalName:a,propsInterfaceName:`${a}NativeProps`,customEventType:`${a}CustomEvent`,elementType:`HTML${a}Element`,properties:u,events:l}}function A(s,c=!0){var r,e;const a=new Set;for(const u of s){const l=P(u.tagName),n=(u.events||[]).filter(t=>!t.internal);c&&n.length>0&&a.add(`${l}CustomEvent`);for(const t of n)if((r=t.complexType)!=null&&r.references)for(const[p,h]of Object.entries(t.complexType.references))h.location!=="global"&&a.add(p);const i=(u.properties||[]).filter(t=>!t.internal);for(const t of i)if((e=t.complexType)!=null&&e.references)for(const[p,h]of Object.entries(t.complexType.references))h.location!=="global"&&a.add(p)}return a}function I(s,c,a){return`/**
|
|
2
|
+
* This file was automatically generated by the Stencil Types Output Target.
|
|
3
|
+
* Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
|
|
4
|
+
*
|
|
5
|
+
* This file provides TypeScript type definitions for using Stencil web components
|
|
6
|
+
* as native custom elements in ${s}.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* Import this file in your application to get type support for custom elements:
|
|
10
|
+
* \`\`\`tsx
|
|
11
|
+
* import '${c}/${a}';
|
|
12
|
+
* \`\`\`
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/* eslint-disable */
|
|
16
|
+
/* tslint:disable */
|
|
17
|
+
`}const D=s=>`on${s.toLowerCase()}`;function w({components:s,stencilPackageName:c,excludeComponents:a}){const r=j(s,a);if(r.length===0)return"";const e=[];e.push(I("React 19+",c,"react-native-types")),e.push("// @ts-ignore - React types may not be available in all build contexts"),e.push("import 'react';"),e.push("// @ts-ignore - React types may not be available in all build contexts"),e.push("import type { DetailedHTMLProps, HTMLAttributes } from 'react';");const u=A(r);u.size>0&&e.push(`import type { ${Array.from(u).sort().join(", ")} } from '${c}';`),e.push("");for(const l of r){const n=L(l),i=[];for(const t of n.properties){const p=t.docs?` /** ${t.docs} */
|
|
18
|
+
`:"";i.push(`${p} '${t.name}'?: ${t.type};`)}for(const t of n.events){const p=t.docs?` /** Event: ${t.name} - ${t.docs} */
|
|
19
|
+
`:` /** Event: ${t.name} */
|
|
20
|
+
`,h=D(t.name);i.push(`${p} '${h}'?: (event: ${n.customEventType}<${t.type}>) => void;`)}i.length>0?(e.push(`interface ${n.propsInterfaceName} {`),e.push(i.join(`
|
|
21
|
+
`)),e.push("}")):e.push(`interface ${n.propsInterfaceName} {}`),e.push("")}e.push("declare module 'react/jsx-runtime' {"),e.push(" namespace JSX {"),e.push(" interface IntrinsicElements {");for(const l of r){const n=L(l);e.push(` '${n.tagName}': DetailedHTMLProps<HTMLAttributes<${n.elementType}> & ${n.propsInterfaceName}, ${n.elementType}>;`)}return e.push(" }"),e.push(" }"),e.push("}"),e.push(""),e.join(`
|
|
22
|
+
`)}const V=s=>`on${s.toLowerCase()}`;function F({components:s,stencilPackageName:c,excludeComponents:a}){const r=j(s,a);if(r.length===0)return"";const e=[];e.push(I("Svelte",c,"svelte-native-types")),e.push("// @ts-ignore - Svelte types may not be available in all build contexts"),e.push("import type { HTMLAttributes } from 'svelte/elements';");const u=A(r);u.size>0&&e.push(`import type { ${Array.from(u).sort().join(", ")} } from '${c}';`),e.push("");for(const l of r){const n=L(l),i=[];for(const t of n.properties){const p=t.docs?` /** ${t.docs} */
|
|
23
|
+
`:"";i.push(`${p} '${t.name}'?: ${t.type};`)}for(const t of n.events){const p=t.docs?` /** Event: ${t.name} - ${t.docs} */
|
|
24
|
+
`:` /** Event: ${t.name} */
|
|
25
|
+
`,h=V(t.name);i.push(`${p} '${h}'?: (event: ${n.customEventType}<${t.type}>) => void;`)}i.length>0?(e.push(`interface ${n.propsInterfaceName} {`),e.push(i.join(`
|
|
26
|
+
`)),e.push("}")):e.push(`interface ${n.propsInterfaceName} {}`),e.push("")}e.push("declare module 'svelte/elements' {"),e.push(" interface SvelteHTMLElements {");for(const l of r){const n=L(l);e.push(` '${n.tagName}': HTMLAttributes<${n.elementType}> & ${n.propsInterfaceName};`)}return e.push(" }"),e.push("}"),e.push(""),e.join(`
|
|
27
|
+
`)}function J({components:s,stencilPackageName:c,excludeComponents:a}){var l,n,i,t,p,h;const r=j(s,a);if(r.length===0)return"";const e=[];e.push(I("Solid",c,"solid-native-types")),e.push("// @ts-ignore - Solid types may not be available in all build contexts"),e.push("import 'solid-js';"),e.push("// @ts-ignore - Solid types may not be available in all build contexts"),e.push("import type { JSX } from 'solid-js';");const u=A(r);u.size>0&&e.push(`import type { ${Array.from(u).sort().join(", ")} } from '${c}';`),e.push("");for(const m of r){const $=m.tagName,y=P($),v=`${y}NativeProps`,b=`${y}CustomEvent`,d=[],E=(m.properties||[]).filter(o=>!o.internal);for(const o of E){const g=N(((l=o.complexType)==null?void 0:l.original)||"any"),f=(i=(n=o.docs)==null?void 0:n.text)==null?void 0:i.trim(),T=f?` /** ${f} */
|
|
28
|
+
`:"";d.push(`${T} 'prop:${o.name}'?: ${g};`),o.attribute&&d.push(`${T} 'attr:${o.attribute}'?: string;`)}const x=(m.events||[]).filter(o=>!o.internal);for(const o of x){const g=N(((t=o.complexType)==null?void 0:t.original)||"void"),f=(h=(p=o.docs)==null?void 0:p.text)==null?void 0:h.trim(),T=f?` /** Event: ${o.name} - ${f} */
|
|
29
|
+
`:` /** Event: ${o.name} */
|
|
30
|
+
`;d.push(`${T} 'on:${o.name}'?: (event: ${b}<${g}>) => void;`)}d.length>0?(e.push(`interface ${v} {`),e.push(d.join(`
|
|
31
|
+
`)),e.push("}")):e.push(`interface ${v} {}`),e.push("")}e.push("declare module 'solid-js' {"),e.push(" namespace JSX {"),e.push(" interface IntrinsicElements {");for(const m of r){const $=m.tagName,y=P($),v=`${y}NativeProps`,b=`HTML${y}Element`;e.push(` '${$}': JSX.HTMLAttributes<${b}> & ${v};`)}return e.push(" }"),e.push(" }"),e.push("}"),e.push(""),e.join(`
|
|
32
|
+
`)}function X({components:s,stencilPackageName:c,excludeComponents:a}){var l,n,i,t,p,h;const r=j(s,a);if(r.length===0)return"";const e=[];e.push(I("Vue 3",c,"vue-native-types")),e.push("// @ts-ignore - Vue types may not be available in all build contexts"),e.push("import type { DefineComponent, HTMLAttributes } from 'vue';");const u=A(r);u.size>0&&e.push(`import type { ${Array.from(u).sort().join(", ")} } from '${c}';`),e.push("");for(const m of r){const $=m.tagName,y=P($),v=`${y}NativeProps`,b=`${y}CustomEvent`,d=[],E=(m.properties||[]).filter(o=>!o.internal);for(const o of E){const g=N(((l=o.complexType)==null?void 0:l.original)||"any"),f=(i=(n=o.docs)==null?void 0:n.text)==null?void 0:i.trim(),T=f?` /** ${f} */
|
|
33
|
+
`:"";d.push(`${T} '${o.name}'?: ${g};`)}const x=(m.events||[]).filter(o=>!o.internal);for(const o of x){const g=N(((t=o.complexType)==null?void 0:t.original)||"void"),f=(h=(p=o.docs)==null?void 0:p.text)==null?void 0:h.trim(),T=f?` /** Event: ${o.name} - ${f} */
|
|
34
|
+
`:` /** Event: ${o.name} */
|
|
35
|
+
`,H=`on${o.name.charAt(0).toUpperCase()}${o.name.slice(1)}`;d.push(`${T} '${H}'?: (event: ${b}<${g}>) => void;`)}d.length>0?(e.push(`interface ${v} {`),e.push(d.join(`
|
|
36
|
+
`)),e.push("}")):e.push(`interface ${v} {}`),e.push("")}e.push("declare module 'vue' {"),e.push(" interface GlobalComponents {");for(const m of r){const $=m.tagName,v=`${P($)}NativeProps`;e.push(` '${$}': DefineComponent<${v} & HTMLAttributes>;`)}return e.push(" }"),e.push("}"),e.push(""),e.join(`
|
|
37
|
+
`)}const O=s=>`on${s.charAt(0).toUpperCase()}${s.slice(1)}`;function z({components:s,stencilPackageName:c,excludeComponents:a}){var l,n,i,t,p,h;const r=j(s,a);if(r.length===0)return"";const e=[];e.push(I("Preact",c,"preact-native-types")),e.push("// @ts-ignore - Preact types may not be available in all build contexts"),e.push("import 'preact';"),e.push("// @ts-ignore - Preact types may not be available in all build contexts"),e.push("import type { JSX } from 'preact';");const u=A(r);u.size>0&&e.push(`import type { ${Array.from(u).sort().join(", ")} } from '${c}';`),e.push("");for(const m of r){const $=m.tagName,y=P($),v=`${y}NativeProps`,b=`${y}CustomEvent`,d=[],E=(m.properties||[]).filter(o=>!o.internal);for(const o of E){const g=N(((l=o.complexType)==null?void 0:l.original)||"any"),f=(i=(n=o.docs)==null?void 0:n.text)==null?void 0:i.trim(),T=f?` /** ${f} */
|
|
38
|
+
`:"";d.push(`${T} '${o.name}'?: ${g};`)}const x=(m.events||[]).filter(o=>!o.internal);for(const o of x){const g=N(((t=o.complexType)==null?void 0:t.original)||"void"),f=(h=(p=o.docs)==null?void 0:p.text)==null?void 0:h.trim(),T=f?` /** Event: ${o.name} - ${f} */
|
|
39
|
+
`:` /** Event: ${o.name} */
|
|
40
|
+
`,H=O(o.name);d.push(`${T} '${H}'?: (event: ${b}<${g}>) => void;`)}d.length>0?(e.push(`interface ${v} {`),e.push(d.join(`
|
|
41
|
+
`)),e.push("}")):e.push(`interface ${v} {}`),e.push("")}e.push("declare module 'preact' {"),e.push(" namespace JSX {"),e.push(" interface IntrinsicElements {");for(const m of r){const $=m.tagName,y=P($),v=`${y}NativeProps`,b=`HTML${y}Element`;e.push(` '${$}': JSX.HTMLAttributes<${b}> & ${v};`)}return e.push(" }"),e.push(" }"),e.push("}"),e.push(""),e.join(`
|
|
42
|
+
`)}const C={react:"react-native-types.d.ts",svelte:"svelte-native-types.d.ts",solid:"solid-native-types.d.ts",vue:"vue-native-types.d.ts",preact:"preact-native-types.d.ts"};function S(s,c,a){let r=s.endsWith(".d.ts")?s:M.join(s,c);return!M.isAbsolute(r)&&a&&(r=M.join(a,r)),r}function R(s={}){return{type:"custom",name:"types-output-target",validate(c,a){s.reactTypesPath||s.svelteTypesPath||s.solidTypesPath||s.vueTypesPath||s.preactTypesPath||a.push({level:"error",type:"config",messageText:"The 'types-output-target' requires at least one framework path to be specified (reactTypesPath, svelteTypesPath, solidTypesPath, vueTypesPath, or preactTypesPath).",lines:[]})},async generator(c,a,r){const e=r.createTimeSpan("generate types output target started",!0),u=r.components,l=c.fsNamespace||"component-library",n=c.rootDir,i=[];if(s.reactTypesPath){const t=w({components:u,stencilPackageName:l,excludeComponents:s.excludeComponents});if(t){const p=S(s.reactTypesPath,C.react,n);i.push(a.fs.writeFile(p,t))}}if(s.svelteTypesPath){const t=F({components:u,stencilPackageName:l,excludeComponents:s.excludeComponents});if(t){const p=S(s.svelteTypesPath,C.svelte,n);i.push(a.fs.writeFile(p,t))}}if(s.solidTypesPath){const t=J({components:u,stencilPackageName:l,excludeComponents:s.excludeComponents});if(t){const p=S(s.solidTypesPath,C.solid,n);i.push(a.fs.writeFile(p,t))}}if(s.vueTypesPath){const t=X({components:u,stencilPackageName:l,excludeComponents:s.excludeComponents});if(t){const p=S(s.vueTypesPath,C.vue,n);i.push(a.fs.writeFile(p,t))}}if(s.preactTypesPath){const t=z({components:u,stencilPackageName:l,excludeComponents:s.excludeComponents});if(t){const p=S(s.preactTypesPath,C.preact,n);i.push(a.fs.writeFile(p,t))}}await Promise.all(i),e.finish("generate types output target finished")}}}exports.createPreactTypes=z;exports.createReactTypes=w;exports.createSolidTypes=J;exports.createSvelteTypes=F;exports.createVueTypes=X;exports.typesOutputTarget=R;
|
|
43
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../src/utils/string-utils.ts","../src/generators/base.ts","../src/generators/react.ts","../src/generators/svelte.ts","../src/generators/solid.ts","../src/generators/vue.ts","../src/generators/preact.ts","../src/index.ts"],"sourcesContent":["export const kebabToPascalCase = (str: string) =>\n str\n .toLowerCase()\n .split('-')\n .map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1))\n .join('');\n\n/**\n * Normalizes a type string by removing single-line comments and collapsing whitespace.\n * This is necessary because multiline types with comments would break when collapsed to a single line.\n */\nexport const normalizeTypeString = (type: string) =>\n type\n .replace(/\\/\\/.*$/gm, '') // Remove single-line comments\n .replace(/\\n/g, ' ') // Replace newlines with spaces\n .replace(/\\s{2,}/g, ' ') // Collapse multiple spaces\n .trim();\n","import type { ComponentCompilerMeta } from '@stencil/core/internal';\nimport { kebabToPascalCase, normalizeTypeString } from '../utils/string-utils.js';\n\nexport interface BaseTypesOptions {\n components: ComponentCompilerMeta[];\n stencilPackageName: string;\n excludeComponents?: string[];\n}\n\nexport interface ComponentInfo {\n tagName: string;\n pascalName: string;\n propsInterfaceName: string;\n customEventType: string;\n elementType: string;\n properties: PropertyInfo[];\n events: EventInfo[];\n}\n\nexport interface PropertyInfo {\n name: string;\n type: string;\n docs?: string;\n}\n\nexport interface EventInfo {\n name: string;\n type: string;\n docs?: string;\n}\n\n/**\n * Filters components based on internal flag and exclude list.\n */\nexport function filterComponents(\n components: ComponentCompilerMeta[],\n excludeComponents?: string[]\n): ComponentCompilerMeta[] {\n return components.filter((c) => {\n if (c.internal === true) return false;\n if (excludeComponents?.includes(c.tagName)) return false;\n return true;\n });\n}\n\n/**\n * Extracts component information needed for type generation.\n */\nexport function extractComponentInfo(component: ComponentCompilerMeta): ComponentInfo {\n const tagName = component.tagName;\n const pascalName = kebabToPascalCase(tagName);\n\n const publicProperties = (component.properties || []).filter((p) => !p.internal);\n const publicEvents = (component.events || []).filter((e) => !e.internal);\n\n const properties: PropertyInfo[] = publicProperties.map((prop) => ({\n name: prop.name,\n type: normalizeTypeString(prop.complexType?.original || 'any'),\n docs: prop.docs?.text?.trim(),\n }));\n\n const events: EventInfo[] = publicEvents.map((event) => ({\n name: event.name,\n type: normalizeTypeString(event.complexType?.original || 'void'),\n docs: event.docs?.text?.trim(),\n }));\n\n return {\n tagName,\n pascalName,\n propsInterfaceName: `${pascalName}NativeProps`,\n customEventType: `${pascalName}CustomEvent`,\n elementType: `HTML${pascalName}Element`,\n properties,\n events,\n };\n}\n\n/**\n * Collects all types that need to be imported from the Stencil package.\n */\nexport function collectImportTypes(\n components: ComponentCompilerMeta[],\n includeCustomEvents: boolean = true\n): Set<string> {\n const types = new Set<string>();\n\n for (const component of components) {\n const pascalName = kebabToPascalCase(component.tagName);\n const publicEvents = (component.events || []).filter((e) => !e.internal);\n\n if (includeCustomEvents && publicEvents.length > 0) {\n types.add(`${pascalName}CustomEvent`);\n }\n\n // Collect referenced types from events\n for (const event of publicEvents) {\n if (event.complexType?.references) {\n for (const [refKey, refValue] of Object.entries(event.complexType.references)) {\n if (refValue.location !== 'global') {\n types.add(refKey);\n }\n }\n }\n }\n\n // Collect referenced types from properties\n const publicProperties = (component.properties || []).filter((p) => !p.internal);\n for (const prop of publicProperties) {\n if (prop.complexType?.references) {\n for (const [refKey, refValue] of Object.entries(prop.complexType.references)) {\n if (refValue.location !== 'global') {\n types.add(refKey);\n }\n }\n }\n }\n }\n\n return types;\n}\n\n/**\n * Generates the standard file header comment.\n */\nexport function generateHeader(framework: string, stencilPackageName: string, importPath: string): string {\n return `/**\n * This file was automatically generated by the Stencil Types Output Target.\n * Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.\n *\n * This file provides TypeScript type definitions for using Stencil web components\n * as native custom elements in ${framework}.\n *\n * Usage:\n * Import this file in your application to get type support for custom elements:\n * \\`\\`\\`tsx\n * import '${stencilPackageName}/${importPath}';\n * \\`\\`\\`\n */\n\n/* eslint-disable */\n/* tslint:disable */\n`;\n}\n","import {\n type BaseTypesOptions,\n filterComponents,\n extractComponentInfo,\n collectImportTypes,\n generateHeader,\n} from './base.js';\n\nexport interface ReactTypesOptions extends BaseTypesOptions {}\n\n/**\n * Converts an event name to a lowercase React 19 event handler prop name.\n * React 19 lowercases the prop name (minus \"on\") to get the event name.\n * So for event \"myFocus\", the handler prop should be \"onmyfocus\".\n */\nconst toLowercaseEventHandler = (eventName: string): string => {\n return `on${eventName.toLowerCase()}`;\n};\n\n/**\n * Creates a TypeScript declaration file (.d.ts) that provides type definitions\n * for using Stencil web components as native custom elements in React 19+.\n *\n * The generated file augments the `react/jsx-runtime` module to provide proper\n * typing for custom elements when used directly in JSX without wrapper components.\n */\nexport function createReactTypes({ components, stencilPackageName, excludeComponents }: ReactTypesOptions): string {\n const filteredComponents = filterComponents(components, excludeComponents);\n\n if (filteredComponents.length === 0) {\n return '';\n }\n\n const lines: string[] = [];\n\n // Add header\n lines.push(generateHeader('React 19+', stencilPackageName, 'react-native-types'));\n\n // Add React imports with @ts-ignore for non-React contexts\n lines.push(`// @ts-ignore - React types may not be available in all build contexts`);\n lines.push(`import 'react';`);\n lines.push(`// @ts-ignore - React types may not be available in all build contexts`);\n lines.push(`import type { DetailedHTMLProps, HTMLAttributes } from 'react';`);\n\n // Collect and add imports from Stencil package\n const importTypes = collectImportTypes(filteredComponents);\n if (importTypes.size > 0) {\n lines.push(`import type { ${Array.from(importTypes).sort().join(', ')} } from '${stencilPackageName}';`);\n }\n\n lines.push('');\n\n // Generate interface for each component\n for (const component of filteredComponents) {\n const info = extractComponentInfo(component);\n const interfaceProperties: string[] = [];\n\n // Add properties\n for (const prop of info.properties) {\n const docs = prop.docs ? ` /** ${prop.docs} */\\n` : '';\n interfaceProperties.push(`${docs} '${prop.name}'?: ${prop.type};`);\n }\n\n // Add events with lowercase naming (React 19 style)\n for (const event of info.events) {\n const docs = event.docs ? ` /** Event: ${event.name} - ${event.docs} */\\n` : ` /** Event: ${event.name} */\\n`;\n const handlerName = toLowercaseEventHandler(event.name);\n interfaceProperties.push(`${docs} '${handlerName}'?: (event: ${info.customEventType}<${event.type}>) => void;`);\n }\n\n // Generate the props interface\n if (interfaceProperties.length > 0) {\n lines.push(`interface ${info.propsInterfaceName} {`);\n lines.push(interfaceProperties.join('\\n'));\n lines.push(`}`);\n } else {\n lines.push(`interface ${info.propsInterfaceName} {}`);\n }\n lines.push('');\n }\n\n // Generate module augmentation for react/jsx-runtime's JSX namespace\n lines.push(`declare module 'react/jsx-runtime' {`);\n lines.push(` namespace JSX {`);\n lines.push(` interface IntrinsicElements {`);\n\n for (const component of filteredComponents) {\n const info = extractComponentInfo(component);\n lines.push(\n ` '${info.tagName}': DetailedHTMLProps<HTMLAttributes<${info.elementType}> & ${info.propsInterfaceName}, ${info.elementType}>;`\n );\n }\n\n lines.push(` }`);\n lines.push(` }`);\n lines.push(`}`);\n lines.push('');\n\n return lines.join('\\n');\n}\n","import {\n type BaseTypesOptions,\n filterComponents,\n extractComponentInfo,\n collectImportTypes,\n generateHeader,\n} from './base.js';\n\nexport interface SvelteTypesOptions extends BaseTypesOptions {}\n\n/**\n * Converts an event name to a Svelte event handler prop name.\n * Svelte uses \"on:eventname\" syntax in templates, but for type definitions\n * we use the \"oneventname\" format (lowercase).\n */\nconst toSvelteEventHandler = (eventName: string): string => {\n return `on${eventName.toLowerCase()}`;\n};\n\n/**\n * Creates a TypeScript declaration file (.d.ts) that provides type definitions\n * for using Stencil web components as native custom elements in Svelte.\n *\n * The generated file augments the `svelte/elements` module to provide proper\n * typing for custom elements when used in Svelte templates.\n */\nexport function createSvelteTypes({ components, stencilPackageName, excludeComponents }: SvelteTypesOptions): string {\n const filteredComponents = filterComponents(components, excludeComponents);\n\n if (filteredComponents.length === 0) {\n return '';\n }\n\n const lines: string[] = [];\n\n // Add header\n lines.push(generateHeader('Svelte', stencilPackageName, 'svelte-native-types'));\n\n // Add Svelte imports\n lines.push(`// @ts-ignore - Svelte types may not be available in all build contexts`);\n lines.push(`import type { HTMLAttributes } from 'svelte/elements';`);\n\n // Collect and add imports from Stencil package\n const importTypes = collectImportTypes(filteredComponents);\n if (importTypes.size > 0) {\n lines.push(`import type { ${Array.from(importTypes).sort().join(', ')} } from '${stencilPackageName}';`);\n }\n\n lines.push('');\n\n // Generate interface for each component\n for (const component of filteredComponents) {\n const info = extractComponentInfo(component);\n const interfaceProperties: string[] = [];\n\n // Add properties\n for (const prop of info.properties) {\n const docs = prop.docs ? ` /** ${prop.docs} */\\n` : '';\n interfaceProperties.push(`${docs} '${prop.name}'?: ${prop.type};`);\n }\n\n // Add events\n for (const event of info.events) {\n const docs = event.docs ? ` /** Event: ${event.name} - ${event.docs} */\\n` : ` /** Event: ${event.name} */\\n`;\n const handlerName = toSvelteEventHandler(event.name);\n interfaceProperties.push(`${docs} '${handlerName}'?: (event: ${info.customEventType}<${event.type}>) => void;`);\n }\n\n // Generate the props interface\n if (interfaceProperties.length > 0) {\n lines.push(`interface ${info.propsInterfaceName} {`);\n lines.push(interfaceProperties.join('\\n'));\n lines.push(`}`);\n } else {\n lines.push(`interface ${info.propsInterfaceName} {}`);\n }\n lines.push('');\n }\n\n // Generate module augmentation for svelte/elements\n lines.push(`declare module 'svelte/elements' {`);\n lines.push(` interface SvelteHTMLElements {`);\n\n for (const component of filteredComponents) {\n const info = extractComponentInfo(component);\n lines.push(` '${info.tagName}': HTMLAttributes<${info.elementType}> & ${info.propsInterfaceName};`);\n }\n\n lines.push(` }`);\n lines.push(`}`);\n lines.push('');\n\n return lines.join('\\n');\n}\n","import { type BaseTypesOptions, filterComponents, collectImportTypes, generateHeader } from './base.js';\nimport { kebabToPascalCase, normalizeTypeString } from '../utils/string-utils.js';\n\nexport interface SolidTypesOptions extends BaseTypesOptions {}\n\n/**\n * Creates a TypeScript declaration file (.d.ts) that provides type definitions\n * for using Stencil web components as native custom elements in Solid.\n *\n * Solid distinguishes between:\n * - Properties (prop:): Set via JavaScript property\n * - Attributes (attr:): Set via HTML attribute\n * - Events (on:): Custom event handlers\n *\n * The generated file augments the `solid-js` module to provide proper\n * typing for custom elements when used in Solid JSX.\n */\nexport function createSolidTypes({ components, stencilPackageName, excludeComponents }: SolidTypesOptions): string {\n const filteredComponents = filterComponents(components, excludeComponents);\n\n if (filteredComponents.length === 0) {\n return '';\n }\n\n const lines: string[] = [];\n\n // Add header\n lines.push(generateHeader('Solid', stencilPackageName, 'solid-native-types'));\n\n // Add Solid imports\n lines.push(`// @ts-ignore - Solid types may not be available in all build contexts`);\n lines.push(`import 'solid-js';`);\n lines.push(`// @ts-ignore - Solid types may not be available in all build contexts`);\n lines.push(`import type { JSX } from 'solid-js';`);\n\n // Collect and add imports from Stencil package\n const importTypes = collectImportTypes(filteredComponents);\n if (importTypes.size > 0) {\n lines.push(`import type { ${Array.from(importTypes).sort().join(', ')} } from '${stencilPackageName}';`);\n }\n\n lines.push('');\n\n // Generate interface for each component\n for (const component of filteredComponents) {\n const tagName = component.tagName;\n const pascalName = kebabToPascalCase(tagName);\n const propsInterfaceName = `${pascalName}NativeProps`;\n const customEventType = `${pascalName}CustomEvent`;\n\n const interfaceProperties: string[] = [];\n\n // Add properties with both prop: and attr: prefixes where applicable\n const publicProperties = (component.properties || []).filter((p) => !p.internal);\n for (const prop of publicProperties) {\n const propType = normalizeTypeString(prop.complexType?.original || 'any');\n const docs = prop.docs?.text?.trim();\n const docsComment = docs ? ` /** ${docs} */\\n` : '';\n\n // JavaScript property (always available)\n interfaceProperties.push(`${docsComment} 'prop:${prop.name}'?: ${propType};`);\n\n // HTML attribute (only if reflected to attribute)\n if (prop.attribute) {\n interfaceProperties.push(`${docsComment} 'attr:${prop.attribute}'?: string;`);\n }\n }\n\n // Add events using Solid's on: syntax\n const publicEvents = (component.events || []).filter((e) => !e.internal);\n for (const event of publicEvents) {\n const eventType = normalizeTypeString(event.complexType?.original || 'void');\n const docs = event.docs?.text?.trim();\n const docsComment = docs ? ` /** Event: ${event.name} - ${docs} */\\n` : ` /** Event: ${event.name} */\\n`;\n interfaceProperties.push(\n `${docsComment} 'on:${event.name}'?: (event: ${customEventType}<${eventType}>) => void;`\n );\n }\n\n // Generate the props interface\n if (interfaceProperties.length > 0) {\n lines.push(`interface ${propsInterfaceName} {`);\n lines.push(interfaceProperties.join('\\n'));\n lines.push(`}`);\n } else {\n lines.push(`interface ${propsInterfaceName} {}`);\n }\n lines.push('');\n }\n\n // Generate module augmentation for solid-js\n lines.push(`declare module 'solid-js' {`);\n lines.push(` namespace JSX {`);\n lines.push(` interface IntrinsicElements {`);\n\n for (const component of filteredComponents) {\n const tagName = component.tagName;\n const pascalName = kebabToPascalCase(tagName);\n const propsInterfaceName = `${pascalName}NativeProps`;\n const elementType = `HTML${pascalName}Element`;\n\n lines.push(` '${tagName}': JSX.HTMLAttributes<${elementType}> & ${propsInterfaceName};`);\n }\n\n lines.push(` }`);\n lines.push(` }`);\n lines.push(`}`);\n lines.push('');\n\n return lines.join('\\n');\n}\n","import { type BaseTypesOptions, filterComponents, collectImportTypes, generateHeader } from './base.js';\nimport { kebabToPascalCase, normalizeTypeString } from '../utils/string-utils.js';\n\nexport interface VueTypesOptions extends BaseTypesOptions {}\n\n/**\n * Creates a TypeScript declaration file (.d.ts) that provides type definitions\n * for using Stencil web components as native custom elements in Vue 3.\n *\n * Vue uses kebab-case event names with @ prefix in templates (e.g., @my-event).\n * The generated file augments Vue's GlobalComponents interface.\n */\nexport function createVueTypes({ components, stencilPackageName, excludeComponents }: VueTypesOptions): string {\n const filteredComponents = filterComponents(components, excludeComponents);\n\n if (filteredComponents.length === 0) {\n return '';\n }\n\n const lines: string[] = [];\n\n // Add header\n lines.push(generateHeader('Vue 3', stencilPackageName, 'vue-native-types'));\n\n // Add Vue imports\n lines.push(`// @ts-ignore - Vue types may not be available in all build contexts`);\n lines.push(`import type { DefineComponent, HTMLAttributes } from 'vue';`);\n\n // Collect and add imports from Stencil package\n const importTypes = collectImportTypes(filteredComponents);\n if (importTypes.size > 0) {\n lines.push(`import type { ${Array.from(importTypes).sort().join(', ')} } from '${stencilPackageName}';`);\n }\n\n lines.push('');\n\n // Generate interface for each component\n for (const component of filteredComponents) {\n const tagName = component.tagName;\n const pascalName = kebabToPascalCase(tagName);\n const propsInterfaceName = `${pascalName}NativeProps`;\n const customEventType = `${pascalName}CustomEvent`;\n\n const interfaceProperties: string[] = [];\n\n // Add properties\n const publicProperties = (component.properties || []).filter((p) => !p.internal);\n for (const prop of publicProperties) {\n const propType = normalizeTypeString(prop.complexType?.original || 'any');\n const docs = prop.docs?.text?.trim();\n const docsComment = docs ? ` /** ${docs} */\\n` : '';\n interfaceProperties.push(`${docsComment} '${prop.name}'?: ${propType};`);\n }\n\n // Add events using Vue's onEventName convention\n const publicEvents = (component.events || []).filter((e) => !e.internal);\n for (const event of publicEvents) {\n const eventType = normalizeTypeString(event.complexType?.original || 'void');\n const docs = event.docs?.text?.trim();\n const docsComment = docs ? ` /** Event: ${event.name} - ${docs} */\\n` : ` /** Event: ${event.name} */\\n`;\n // Vue uses onEventName format for event handlers in props (onMyEvent for @my-event)\n const handlerName = `on${event.name.charAt(0).toUpperCase()}${event.name.slice(1)}`;\n interfaceProperties.push(`${docsComment} '${handlerName}'?: (event: ${customEventType}<${eventType}>) => void;`);\n }\n\n // Generate the props interface\n if (interfaceProperties.length > 0) {\n lines.push(`interface ${propsInterfaceName} {`);\n lines.push(interfaceProperties.join('\\n'));\n lines.push(`}`);\n } else {\n lines.push(`interface ${propsInterfaceName} {}`);\n }\n lines.push('');\n }\n\n // Generate module augmentation for Vue\n lines.push(`declare module 'vue' {`);\n lines.push(` interface GlobalComponents {`);\n\n for (const component of filteredComponents) {\n const tagName = component.tagName;\n const pascalName = kebabToPascalCase(tagName);\n const propsInterfaceName = `${pascalName}NativeProps`;\n\n // Vue expects DefineComponent for GlobalComponents\n lines.push(` '${tagName}': DefineComponent<${propsInterfaceName} & HTMLAttributes>;`);\n }\n\n lines.push(` }`);\n lines.push(`}`);\n lines.push('');\n\n return lines.join('\\n');\n}\n","import { type BaseTypesOptions, filterComponents, collectImportTypes, generateHeader } from './base.js';\nimport { kebabToPascalCase, normalizeTypeString } from '../utils/string-utils.js';\n\nexport interface PreactTypesOptions extends BaseTypesOptions {}\n\n/**\n * Converts an event name to a Preact event handler prop name.\n * Preact follows a similar pattern to React with onEventName.\n */\nconst toPreactEventHandler = (eventName: string): string => {\n return `on${eventName.charAt(0).toUpperCase()}${eventName.slice(1)}`;\n};\n\n/**\n * Creates a TypeScript declaration file (.d.ts) that provides type definitions\n * for using Stencil web components as native custom elements in Preact.\n *\n * The generated file augments the `preact` module to provide proper\n * typing for custom elements when used in Preact JSX.\n */\nexport function createPreactTypes({ components, stencilPackageName, excludeComponents }: PreactTypesOptions): string {\n const filteredComponents = filterComponents(components, excludeComponents);\n\n if (filteredComponents.length === 0) {\n return '';\n }\n\n const lines: string[] = [];\n\n // Add header\n lines.push(generateHeader('Preact', stencilPackageName, 'preact-native-types'));\n\n // Add Preact imports\n lines.push(`// @ts-ignore - Preact types may not be available in all build contexts`);\n lines.push(`import 'preact';`);\n lines.push(`// @ts-ignore - Preact types may not be available in all build contexts`);\n lines.push(`import type { JSX } from 'preact';`);\n\n // Collect and add imports from Stencil package\n const importTypes = collectImportTypes(filteredComponents);\n if (importTypes.size > 0) {\n lines.push(`import type { ${Array.from(importTypes).sort().join(', ')} } from '${stencilPackageName}';`);\n }\n\n lines.push('');\n\n // Generate interface for each component\n for (const component of filteredComponents) {\n const tagName = component.tagName;\n const pascalName = kebabToPascalCase(tagName);\n const propsInterfaceName = `${pascalName}NativeProps`;\n const customEventType = `${pascalName}CustomEvent`;\n\n const interfaceProperties: string[] = [];\n\n // Add properties\n const publicProperties = (component.properties || []).filter((p) => !p.internal);\n for (const prop of publicProperties) {\n const propType = normalizeTypeString(prop.complexType?.original || 'any');\n const docs = prop.docs?.text?.trim();\n const docsComment = docs ? ` /** ${docs} */\\n` : '';\n interfaceProperties.push(`${docsComment} '${prop.name}'?: ${propType};`);\n }\n\n // Add events\n const publicEvents = (component.events || []).filter((e) => !e.internal);\n for (const event of publicEvents) {\n const eventType = normalizeTypeString(event.complexType?.original || 'void');\n const docs = event.docs?.text?.trim();\n const docsComment = docs ? ` /** Event: ${event.name} - ${docs} */\\n` : ` /** Event: ${event.name} */\\n`;\n const handlerName = toPreactEventHandler(event.name);\n interfaceProperties.push(`${docsComment} '${handlerName}'?: (event: ${customEventType}<${eventType}>) => void;`);\n }\n\n // Generate the props interface\n if (interfaceProperties.length > 0) {\n lines.push(`interface ${propsInterfaceName} {`);\n lines.push(interfaceProperties.join('\\n'));\n lines.push(`}`);\n } else {\n lines.push(`interface ${propsInterfaceName} {}`);\n }\n lines.push('');\n }\n\n // Generate module augmentation for Preact\n lines.push(`declare module 'preact' {`);\n lines.push(` namespace JSX {`);\n lines.push(` interface IntrinsicElements {`);\n\n for (const component of filteredComponents) {\n const tagName = component.tagName;\n const pascalName = kebabToPascalCase(tagName);\n const propsInterfaceName = `${pascalName}NativeProps`;\n const elementType = `HTML${pascalName}Element`;\n\n lines.push(` '${tagName}': JSX.HTMLAttributes<${elementType}> & ${propsInterfaceName};`);\n }\n\n lines.push(` }`);\n lines.push(` }`);\n lines.push(`}`);\n lines.push('');\n\n return lines.join('\\n');\n}\n","import type { OutputTargetCustom } from '@stencil/core/internal';\nimport path from 'node:path';\n\nimport { createReactTypes } from './generators/react.js';\nimport { createSvelteTypes } from './generators/svelte.js';\nimport { createSolidTypes } from './generators/solid.js';\nimport { createVueTypes } from './generators/vue.js';\nimport { createPreactTypes } from './generators/preact.js';\n\nconst DEFAULT_FILENAMES = {\n react: 'react-native-types.d.ts',\n svelte: 'svelte-native-types.d.ts',\n solid: 'solid-native-types.d.ts',\n vue: 'vue-native-types.d.ts',\n preact: 'preact-native-types.d.ts',\n} as const;\n\nexport interface TypesOutputTargetOptions {\n /**\n * Specify the components that should be excluded from type generation.\n */\n excludeComponents?: string[];\n\n /**\n * Path to generate React 19+ type definitions.\n *\n * This can be either:\n * - A full file path ending in `.d.ts` (e.g., `'dist/types/react-types.d.ts'`)\n * - A directory path (e.g., `'dist/types'`), which will generate `react-native-types.d.ts`\n *\n * **Note:** Your component library's `package.json` should include `@types/react` as an\n * optional peer dependency to ensure proper TypeScript module resolution:\n * ```json\n * {\n * \"peerDependencies\": { \"@types/react\": \">=18\" },\n * \"peerDependenciesMeta\": { \"@types/react\": { \"optional\": true } }\n * }\n * ```\n */\n reactTypesPath?: string;\n\n /**\n * Path to generate Svelte type definitions.\n *\n * This can be either:\n * - A full file path ending in `.d.ts` (e.g., `'dist/types/svelte-types.d.ts'`)\n * - A directory path (e.g., `'dist/types'`), which will generate `svelte-native-types.d.ts`\n *\n * **Note:** Your component library's `package.json` should include `svelte` as an\n * optional peer dependency to ensure proper TypeScript module resolution:\n * ```json\n * {\n * \"peerDependencies\": { \"svelte\": \">=5\" },\n * \"peerDependenciesMeta\": { \"svelte\": { \"optional\": true } }\n * }\n * ```\n */\n svelteTypesPath?: string;\n\n /**\n * Path to generate Solid type definitions.\n *\n * This can be either:\n * - A full file path ending in `.d.ts` (e.g., `'dist/types/solid-types.d.ts'`)\n * - A directory path (e.g., `'dist/types'`), which will generate `solid-native-types.d.ts`\n *\n * **Note:** Your component library's `package.json` should include `solid-js` as an\n * optional peer dependency to ensure proper TypeScript module resolution:\n * ```json\n * {\n * \"peerDependencies\": { \"solid-js\": \">=1\" },\n * \"peerDependenciesMeta\": { \"solid-js\": { \"optional\": true } }\n * }\n * ```\n */\n solidTypesPath?: string;\n\n /**\n * Path to generate Vue 3 type definitions.\n *\n * This can be either:\n * - A full file path ending in `.d.ts` (e.g., `'dist/types/vue-types.d.ts'`)\n * - A directory path (e.g., `'dist/types'`), which will generate `vue-native-types.d.ts`\n *\n * **Note:** Your component library's `package.json` should include `vue` as an\n * optional peer dependency to ensure proper TypeScript module resolution:\n * ```json\n * {\n * \"peerDependencies\": { \"vue\": \">=3\" },\n * \"peerDependenciesMeta\": { \"vue\": { \"optional\": true } }\n * }\n * ```\n */\n vueTypesPath?: string;\n\n /**\n * Path to generate Preact type definitions.\n *\n * This can be either:\n * - A full file path ending in `.d.ts` (e.g., `'dist/types/preact-types.d.ts'`)\n * - A directory path (e.g., `'dist/types'`), which will generate `preact-native-types.d.ts`\n *\n * **Note:** Your component library's `package.json` should include `preact` as an\n * optional peer dependency to ensure proper TypeScript module resolution:\n * ```json\n * {\n * \"peerDependencies\": { \"preact\": \">=10\" },\n * \"peerDependenciesMeta\": { \"preact\": { \"optional\": true } }\n * }\n * ```\n */\n preactTypesPath?: string;\n}\n\n/**\n * Resolves a path option to an absolute file path.\n * If the path ends with .d.ts, use it as-is. Otherwise, append the default filename.\n */\nfunction resolveOutputPath(pathOption: string, defaultFilename: string, rootDir?: string): string {\n let outputPath = pathOption.endsWith('.d.ts') ? pathOption : path.join(pathOption, defaultFilename);\n\n if (!path.isAbsolute(outputPath) && rootDir) {\n outputPath = path.join(rootDir, outputPath);\n }\n\n return outputPath;\n}\n\n/**\n * Stencil output target for generating framework-specific type definitions.\n *\n * This output target generates TypeScript declaration files (.d.ts) that provide\n * type definitions for using Stencil web components as custom elements\n * in various frameworks.\n *\n * @example\n * ```ts\n * // stencil.config.ts\n * import { typesOutputTarget } from '@stencil/types-output-target';\n *\n * export const config: Config = {\n * outputTargets: [\n * typesOutputTarget({\n * reactTypesPath: 'dist/types',\n * svelteTypesPath: 'dist/types',\n * solidTypesPath: 'dist/types',\n * vueTypesPath: 'dist/types',\n * preactTypesPath: 'dist/types',\n * }),\n * ],\n * };\n * ```\n */\nexport function typesOutputTarget(options: TypesOutputTargetOptions = {}): OutputTargetCustom {\n return {\n type: 'custom',\n name: 'types-output-target',\n validate(_config, diagnostics) {\n const hasAnyPath =\n options.reactTypesPath ||\n options.svelteTypesPath ||\n options.solidTypesPath ||\n options.vueTypesPath ||\n options.preactTypesPath;\n\n if (!hasAnyPath) {\n diagnostics.push({\n level: 'error',\n type: 'config',\n messageText:\n \"The 'types-output-target' requires at least one framework path to be specified \" +\n '(reactTypesPath, svelteTypesPath, solidTypesPath, vueTypesPath, or preactTypesPath).',\n lines: [],\n });\n }\n },\n async generator(_config, compilerCtx, buildCtx) {\n const timespan = buildCtx.createTimeSpan('generate types output target started', true);\n\n const components = buildCtx.components;\n const stencilPackageName = _config.fsNamespace || 'component-library';\n const rootDir = _config.rootDir;\n\n const tasks: Promise<unknown>[] = [];\n\n // Generate React types\n if (options.reactTypesPath) {\n const content = createReactTypes({\n components,\n stencilPackageName,\n excludeComponents: options.excludeComponents,\n });\n if (content) {\n const outputPath = resolveOutputPath(options.reactTypesPath, DEFAULT_FILENAMES.react, rootDir);\n tasks.push(compilerCtx.fs.writeFile(outputPath, content));\n }\n }\n\n // Generate Svelte types\n if (options.svelteTypesPath) {\n const content = createSvelteTypes({\n components,\n stencilPackageName,\n excludeComponents: options.excludeComponents,\n });\n if (content) {\n const outputPath = resolveOutputPath(options.svelteTypesPath, DEFAULT_FILENAMES.svelte, rootDir);\n tasks.push(compilerCtx.fs.writeFile(outputPath, content));\n }\n }\n\n // Generate Solid types\n if (options.solidTypesPath) {\n const content = createSolidTypes({\n components,\n stencilPackageName,\n excludeComponents: options.excludeComponents,\n });\n if (content) {\n const outputPath = resolveOutputPath(options.solidTypesPath, DEFAULT_FILENAMES.solid, rootDir);\n tasks.push(compilerCtx.fs.writeFile(outputPath, content));\n }\n }\n\n // Generate Vue types\n if (options.vueTypesPath) {\n const content = createVueTypes({\n components,\n stencilPackageName,\n excludeComponents: options.excludeComponents,\n });\n if (content) {\n const outputPath = resolveOutputPath(options.vueTypesPath, DEFAULT_FILENAMES.vue, rootDir);\n tasks.push(compilerCtx.fs.writeFile(outputPath, content));\n }\n }\n\n // Generate Preact types\n if (options.preactTypesPath) {\n const content = createPreactTypes({\n components,\n stencilPackageName,\n excludeComponents: options.excludeComponents,\n });\n if (content) {\n const outputPath = resolveOutputPath(options.preactTypesPath, DEFAULT_FILENAMES.preact, rootDir);\n tasks.push(compilerCtx.fs.writeFile(outputPath, content));\n }\n }\n\n await Promise.all(tasks);\n\n timespan.finish('generate types output target finished');\n },\n };\n}\n\n// Re-export generators for advanced usage\nexport { createReactTypes } from './generators/react.js';\nexport { createSvelteTypes } from './generators/svelte.js';\nexport { createSolidTypes } from './generators/solid.js';\nexport { createVueTypes } from './generators/vue.js';\nexport { createPreactTypes } from './generators/preact.js';\n"],"names":["kebabToPascalCase","str","segment","normalizeTypeString","type","filterComponents","components","excludeComponents","c","extractComponentInfo","component","tagName","pascalName","publicProperties","p","publicEvents","e","properties","prop","_a","_c","_b","events","event","collectImportTypes","includeCustomEvents","types","refKey","refValue","generateHeader","framework","stencilPackageName","importPath","toLowercaseEventHandler","eventName","createReactTypes","filteredComponents","lines","importTypes","info","interfaceProperties","docs","handlerName","toSvelteEventHandler","createSvelteTypes","createSolidTypes","propsInterfaceName","customEventType","propType","docsComment","eventType","_d","_f","_e","elementType","createVueTypes","toPreactEventHandler","createPreactTypes","DEFAULT_FILENAMES","resolveOutputPath","pathOption","defaultFilename","rootDir","outputPath","path","typesOutputTarget","options","_config","diagnostics","compilerCtx","buildCtx","timespan","tasks","content"],"mappings":"6GAAaA,EAAqBC,GAChCA,EACG,YAAA,EACA,MAAM,GAAG,EACT,IAAKC,GAAYA,EAAQ,OAAO,CAAC,EAAE,cAAgBA,EAAQ,MAAM,CAAC,CAAC,EACnE,KAAK,EAAE,EAMCC,EAAuBC,GAClCA,EACG,QAAQ,YAAa,EAAE,EACvB,QAAQ,MAAO,GAAG,EAClB,QAAQ,UAAW,GAAG,EACtB,KAAK,ECkBM,SAAAC,EACdC,EACAC,EACyB,CAClB,OAAAD,EAAW,OAAQE,GACpB,EAAAA,EAAE,WAAa,IACfD,GAAA,MAAAA,EAAmB,SAASC,EAAE,SAEnC,CACH,CAKO,SAASC,EAAqBC,EAAiD,CACpF,MAAMC,EAAUD,EAAU,QACpBE,EAAaZ,EAAkBW,CAAO,EAEtCE,GAA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AIF,GAAIP,EAAQ,aAAc,CACxB,MAAMO,EAAUlB,EAAe,CAC7B,WAAAjD,EACA,mBAAAyB,EACA,kBAAmBmC,EAAQ,iBAAA,CAC5B,EACD,GAAIO,EAAS,CACX,MAAMV,EAAaJ,EAAkBO,EAAQ,aAAcR,EAAkB,IAAKI,CAAO,EACzFU,EAAM,KAAKH,EAAY,GAAG,UAAUN,EAAYU,CAAO,CAAC,CAAA,CAC1D,CAIF,GAAIP,EAAQ,gBAAiB,CAC3B,MAAMO,EAAUhB,EAAkB,CAChC,WAAAnD,EACA,mBAAAyB,EACA,kBAAmBmC,EAAQ,iBAAA,CAC5B,EACD,GAAIO,EAAS,CACX,MAAMV,EAAaJ,EAAkBO,EAAQ,gBAAiBR,EAAkB,OAAQI,CAAO,EAC/FU,EAAM,KAAKH,EAAY,GAAG,UAAUN,EAAYU,CAAO,CAAC,CAAA,CAC1D,CAGI,MAAA,QAAQ,IAAID,CAAK,EAEvBD,EAAS,OAAO,uCAAuC,CAAA,CAE3D,CACF"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { OutputTargetCustom } from '@stencil/core/internal';
|
|
2
|
+
|
|
3
|
+
export interface TypesOutputTargetOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Specify the components that should be excluded from type generation.
|
|
6
|
+
*/
|
|
7
|
+
excludeComponents?: string[];
|
|
8
|
+
/**
|
|
9
|
+
* Path to generate React 19+ type definitions.
|
|
10
|
+
*
|
|
11
|
+
* This can be either:
|
|
12
|
+
* - A full file path ending in `.d.ts` (e.g., `'dist/types/react-types.d.ts'`)
|
|
13
|
+
* - A directory path (e.g., `'dist/types'`), which will generate `react-native-types.d.ts`
|
|
14
|
+
*
|
|
15
|
+
* **Note:** Your component library's `package.json` should include `@types/react` as an
|
|
16
|
+
* optional peer dependency to ensure proper TypeScript module resolution:
|
|
17
|
+
* ```json
|
|
18
|
+
* {
|
|
19
|
+
* "peerDependencies": { "@types/react": ">=18" },
|
|
20
|
+
* "peerDependenciesMeta": { "@types/react": { "optional": true } }
|
|
21
|
+
* }
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
reactTypesPath?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Path to generate Svelte type definitions.
|
|
27
|
+
*
|
|
28
|
+
* This can be either:
|
|
29
|
+
* - A full file path ending in `.d.ts` (e.g., `'dist/types/svelte-types.d.ts'`)
|
|
30
|
+
* - A directory path (e.g., `'dist/types'`), which will generate `svelte-native-types.d.ts`
|
|
31
|
+
*
|
|
32
|
+
* **Note:** Your component library's `package.json` should include `svelte` as an
|
|
33
|
+
* optional peer dependency to ensure proper TypeScript module resolution:
|
|
34
|
+
* ```json
|
|
35
|
+
* {
|
|
36
|
+
* "peerDependencies": { "svelte": ">=5" },
|
|
37
|
+
* "peerDependenciesMeta": { "svelte": { "optional": true } }
|
|
38
|
+
* }
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
svelteTypesPath?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Path to generate Solid type definitions.
|
|
44
|
+
*
|
|
45
|
+
* This can be either:
|
|
46
|
+
* - A full file path ending in `.d.ts` (e.g., `'dist/types/solid-types.d.ts'`)
|
|
47
|
+
* - A directory path (e.g., `'dist/types'`), which will generate `solid-native-types.d.ts`
|
|
48
|
+
*
|
|
49
|
+
* **Note:** Your component library's `package.json` should include `solid-js` as an
|
|
50
|
+
* optional peer dependency to ensure proper TypeScript module resolution:
|
|
51
|
+
* ```json
|
|
52
|
+
* {
|
|
53
|
+
* "peerDependencies": { "solid-js": ">=1" },
|
|
54
|
+
* "peerDependenciesMeta": { "solid-js": { "optional": true } }
|
|
55
|
+
* }
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
solidTypesPath?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Path to generate Vue 3 type definitions.
|
|
61
|
+
*
|
|
62
|
+
* This can be either:
|
|
63
|
+
* - A full file path ending in `.d.ts` (e.g., `'dist/types/vue-types.d.ts'`)
|
|
64
|
+
* - A directory path (e.g., `'dist/types'`), which will generate `vue-native-types.d.ts`
|
|
65
|
+
*
|
|
66
|
+
* **Note:** Your component library's `package.json` should include `vue` as an
|
|
67
|
+
* optional peer dependency to ensure proper TypeScript module resolution:
|
|
68
|
+
* ```json
|
|
69
|
+
* {
|
|
70
|
+
* "peerDependencies": { "vue": ">=3" },
|
|
71
|
+
* "peerDependenciesMeta": { "vue": { "optional": true } }
|
|
72
|
+
* }
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
vueTypesPath?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Path to generate Preact type definitions.
|
|
78
|
+
*
|
|
79
|
+
* This can be either:
|
|
80
|
+
* - A full file path ending in `.d.ts` (e.g., `'dist/types/preact-types.d.ts'`)
|
|
81
|
+
* - A directory path (e.g., `'dist/types'`), which will generate `preact-native-types.d.ts`
|
|
82
|
+
*
|
|
83
|
+
* **Note:** Your component library's `package.json` should include `preact` as an
|
|
84
|
+
* optional peer dependency to ensure proper TypeScript module resolution:
|
|
85
|
+
* ```json
|
|
86
|
+
* {
|
|
87
|
+
* "peerDependencies": { "preact": ">=10" },
|
|
88
|
+
* "peerDependenciesMeta": { "preact": { "optional": true } }
|
|
89
|
+
* }
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
preactTypesPath?: string;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Stencil output target for generating framework-specific type definitions.
|
|
96
|
+
*
|
|
97
|
+
* This output target generates TypeScript declaration files (.d.ts) that provide
|
|
98
|
+
* type definitions for using Stencil web components as custom elements
|
|
99
|
+
* in various frameworks.
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* ```ts
|
|
103
|
+
* // stencil.config.ts
|
|
104
|
+
* import { typesOutputTarget } from '@stencil/types-output-target';
|
|
105
|
+
*
|
|
106
|
+
* export const config: Config = {
|
|
107
|
+
* outputTargets: [
|
|
108
|
+
* typesOutputTarget({
|
|
109
|
+
* reactTypesPath: 'dist/types',
|
|
110
|
+
* svelteTypesPath: 'dist/types',
|
|
111
|
+
* solidTypesPath: 'dist/types',
|
|
112
|
+
* vueTypesPath: 'dist/types',
|
|
113
|
+
* preactTypesPath: 'dist/types',
|
|
114
|
+
* }),
|
|
115
|
+
* ],
|
|
116
|
+
* };
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
119
|
+
export declare function typesOutputTarget(options?: TypesOutputTargetOptions): OutputTargetCustom;
|
|
120
|
+
export { createReactTypes } from './generators/react.js';
|
|
121
|
+
export { createSvelteTypes } from './generators/svelte.js';
|
|
122
|
+
export { createSolidTypes } from './generators/solid.js';
|
|
123
|
+
export { createVueTypes } from './generators/vue.js';
|
|
124
|
+
export { createPreactTypes } from './generators/preact.js';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
import w from "node:path";
|
|
2
|
+
const P = (s) => s.toLowerCase().split("-").map((c) => c.charAt(0).toUpperCase() + c.slice(1)).join(""), N = (s) => s.replace(/\/\/.*$/gm, "").replace(/\n/g, " ").replace(/\s{2,}/g, " ").trim();
|
|
3
|
+
function S(s, c) {
|
|
4
|
+
return s.filter((a) => !(a.internal === !0 || c != null && c.includes(a.tagName)));
|
|
5
|
+
}
|
|
6
|
+
function L(s) {
|
|
7
|
+
const c = s.tagName, a = P(c), r = (s.properties || []).filter((n) => !n.internal), e = (s.events || []).filter((n) => !n.internal), u = r.map((n) => {
|
|
8
|
+
var i, t, p;
|
|
9
|
+
return {
|
|
10
|
+
name: n.name,
|
|
11
|
+
type: N(((i = n.complexType) == null ? void 0 : i.original) || "any"),
|
|
12
|
+
docs: (p = (t = n.docs) == null ? void 0 : t.text) == null ? void 0 : p.trim()
|
|
13
|
+
};
|
|
14
|
+
}), l = e.map((n) => {
|
|
15
|
+
var i, t, p;
|
|
16
|
+
return {
|
|
17
|
+
name: n.name,
|
|
18
|
+
type: N(((i = n.complexType) == null ? void 0 : i.original) || "void"),
|
|
19
|
+
docs: (p = (t = n.docs) == null ? void 0 : t.text) == null ? void 0 : p.trim()
|
|
20
|
+
};
|
|
21
|
+
});
|
|
22
|
+
return {
|
|
23
|
+
tagName: c,
|
|
24
|
+
pascalName: a,
|
|
25
|
+
propsInterfaceName: `${a}NativeProps`,
|
|
26
|
+
customEventType: `${a}CustomEvent`,
|
|
27
|
+
elementType: `HTML${a}Element`,
|
|
28
|
+
properties: u,
|
|
29
|
+
events: l
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function A(s, c = !0) {
|
|
33
|
+
var r, e;
|
|
34
|
+
const a = /* @__PURE__ */ new Set();
|
|
35
|
+
for (const u of s) {
|
|
36
|
+
const l = P(u.tagName), n = (u.events || []).filter((t) => !t.internal);
|
|
37
|
+
c && n.length > 0 && a.add(`${l}CustomEvent`);
|
|
38
|
+
for (const t of n)
|
|
39
|
+
if ((r = t.complexType) != null && r.references)
|
|
40
|
+
for (const [p, h] of Object.entries(t.complexType.references))
|
|
41
|
+
h.location !== "global" && a.add(p);
|
|
42
|
+
const i = (u.properties || []).filter((t) => !t.internal);
|
|
43
|
+
for (const t of i)
|
|
44
|
+
if ((e = t.complexType) != null && e.references)
|
|
45
|
+
for (const [p, h] of Object.entries(t.complexType.references))
|
|
46
|
+
h.location !== "global" && a.add(p);
|
|
47
|
+
}
|
|
48
|
+
return a;
|
|
49
|
+
}
|
|
50
|
+
function I(s, c, a) {
|
|
51
|
+
return `/**
|
|
52
|
+
* This file was automatically generated by the Stencil Types Output Target.
|
|
53
|
+
* Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
|
|
54
|
+
*
|
|
55
|
+
* This file provides TypeScript type definitions for using Stencil web components
|
|
56
|
+
* as native custom elements in ${s}.
|
|
57
|
+
*
|
|
58
|
+
* Usage:
|
|
59
|
+
* Import this file in your application to get type support for custom elements:
|
|
60
|
+
* \`\`\`tsx
|
|
61
|
+
* import '${c}/${a}';
|
|
62
|
+
* \`\`\`
|
|
63
|
+
*/
|
|
64
|
+
|
|
65
|
+
/* eslint-disable */
|
|
66
|
+
/* tslint:disable */
|
|
67
|
+
`;
|
|
68
|
+
}
|
|
69
|
+
const M = (s) => `on${s.toLowerCase()}`;
|
|
70
|
+
function F({ components: s, stencilPackageName: c, excludeComponents: a }) {
|
|
71
|
+
const r = S(s, a);
|
|
72
|
+
if (r.length === 0)
|
|
73
|
+
return "";
|
|
74
|
+
const e = [];
|
|
75
|
+
e.push(I("React 19+", c, "react-native-types")), e.push("// @ts-ignore - React types may not be available in all build contexts"), e.push("import 'react';"), e.push("// @ts-ignore - React types may not be available in all build contexts"), e.push("import type { DetailedHTMLProps, HTMLAttributes } from 'react';");
|
|
76
|
+
const u = A(r);
|
|
77
|
+
u.size > 0 && e.push(`import type { ${Array.from(u).sort().join(", ")} } from '${c}';`), e.push("");
|
|
78
|
+
for (const l of r) {
|
|
79
|
+
const n = L(l), i = [];
|
|
80
|
+
for (const t of n.properties) {
|
|
81
|
+
const p = t.docs ? ` /** ${t.docs} */
|
|
82
|
+
` : "";
|
|
83
|
+
i.push(`${p} '${t.name}'?: ${t.type};`);
|
|
84
|
+
}
|
|
85
|
+
for (const t of n.events) {
|
|
86
|
+
const p = t.docs ? ` /** Event: ${t.name} - ${t.docs} */
|
|
87
|
+
` : ` /** Event: ${t.name} */
|
|
88
|
+
`, h = M(t.name);
|
|
89
|
+
i.push(`${p} '${h}'?: (event: ${n.customEventType}<${t.type}>) => void;`);
|
|
90
|
+
}
|
|
91
|
+
i.length > 0 ? (e.push(`interface ${n.propsInterfaceName} {`), e.push(i.join(`
|
|
92
|
+
`)), e.push("}")) : e.push(`interface ${n.propsInterfaceName} {}`), e.push("");
|
|
93
|
+
}
|
|
94
|
+
e.push("declare module 'react/jsx-runtime' {"), e.push(" namespace JSX {"), e.push(" interface IntrinsicElements {");
|
|
95
|
+
for (const l of r) {
|
|
96
|
+
const n = L(l);
|
|
97
|
+
e.push(
|
|
98
|
+
` '${n.tagName}': DetailedHTMLProps<HTMLAttributes<${n.elementType}> & ${n.propsInterfaceName}, ${n.elementType}>;`
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
return e.push(" }"), e.push(" }"), e.push("}"), e.push(""), e.join(`
|
|
102
|
+
`);
|
|
103
|
+
}
|
|
104
|
+
const J = (s) => `on${s.toLowerCase()}`;
|
|
105
|
+
function X({ components: s, stencilPackageName: c, excludeComponents: a }) {
|
|
106
|
+
const r = S(s, a);
|
|
107
|
+
if (r.length === 0)
|
|
108
|
+
return "";
|
|
109
|
+
const e = [];
|
|
110
|
+
e.push(I("Svelte", c, "svelte-native-types")), e.push("// @ts-ignore - Svelte types may not be available in all build contexts"), e.push("import type { HTMLAttributes } from 'svelte/elements';");
|
|
111
|
+
const u = A(r);
|
|
112
|
+
u.size > 0 && e.push(`import type { ${Array.from(u).sort().join(", ")} } from '${c}';`), e.push("");
|
|
113
|
+
for (const l of r) {
|
|
114
|
+
const n = L(l), i = [];
|
|
115
|
+
for (const t of n.properties) {
|
|
116
|
+
const p = t.docs ? ` /** ${t.docs} */
|
|
117
|
+
` : "";
|
|
118
|
+
i.push(`${p} '${t.name}'?: ${t.type};`);
|
|
119
|
+
}
|
|
120
|
+
for (const t of n.events) {
|
|
121
|
+
const p = t.docs ? ` /** Event: ${t.name} - ${t.docs} */
|
|
122
|
+
` : ` /** Event: ${t.name} */
|
|
123
|
+
`, h = J(t.name);
|
|
124
|
+
i.push(`${p} '${h}'?: (event: ${n.customEventType}<${t.type}>) => void;`);
|
|
125
|
+
}
|
|
126
|
+
i.length > 0 ? (e.push(`interface ${n.propsInterfaceName} {`), e.push(i.join(`
|
|
127
|
+
`)), e.push("}")) : e.push(`interface ${n.propsInterfaceName} {}`), e.push("");
|
|
128
|
+
}
|
|
129
|
+
e.push("declare module 'svelte/elements' {"), e.push(" interface SvelteHTMLElements {");
|
|
130
|
+
for (const l of r) {
|
|
131
|
+
const n = L(l);
|
|
132
|
+
e.push(` '${n.tagName}': HTMLAttributes<${n.elementType}> & ${n.propsInterfaceName};`);
|
|
133
|
+
}
|
|
134
|
+
return e.push(" }"), e.push("}"), e.push(""), e.join(`
|
|
135
|
+
`);
|
|
136
|
+
}
|
|
137
|
+
function z({ components: s, stencilPackageName: c, excludeComponents: a }) {
|
|
138
|
+
var l, n, i, t, p, h;
|
|
139
|
+
const r = S(s, a);
|
|
140
|
+
if (r.length === 0)
|
|
141
|
+
return "";
|
|
142
|
+
const e = [];
|
|
143
|
+
e.push(I("Solid", c, "solid-native-types")), e.push("// @ts-ignore - Solid types may not be available in all build contexts"), e.push("import 'solid-js';"), e.push("// @ts-ignore - Solid types may not be available in all build contexts"), e.push("import type { JSX } from 'solid-js';");
|
|
144
|
+
const u = A(r);
|
|
145
|
+
u.size > 0 && e.push(`import type { ${Array.from(u).sort().join(", ")} } from '${c}';`), e.push("");
|
|
146
|
+
for (const m of r) {
|
|
147
|
+
const $ = m.tagName, y = P($), v = `${y}NativeProps`, b = `${y}CustomEvent`, d = [], E = (m.properties || []).filter((o) => !o.internal);
|
|
148
|
+
for (const o of E) {
|
|
149
|
+
const g = N(((l = o.complexType) == null ? void 0 : l.original) || "any"), f = (i = (n = o.docs) == null ? void 0 : n.text) == null ? void 0 : i.trim(), T = f ? ` /** ${f} */
|
|
150
|
+
` : "";
|
|
151
|
+
d.push(`${T} 'prop:${o.name}'?: ${g};`), o.attribute && d.push(`${T} 'attr:${o.attribute}'?: string;`);
|
|
152
|
+
}
|
|
153
|
+
const x = (m.events || []).filter((o) => !o.internal);
|
|
154
|
+
for (const o of x) {
|
|
155
|
+
const g = N(((t = o.complexType) == null ? void 0 : t.original) || "void"), f = (h = (p = o.docs) == null ? void 0 : p.text) == null ? void 0 : h.trim(), T = f ? ` /** Event: ${o.name} - ${f} */
|
|
156
|
+
` : ` /** Event: ${o.name} */
|
|
157
|
+
`;
|
|
158
|
+
d.push(
|
|
159
|
+
`${T} 'on:${o.name}'?: (event: ${b}<${g}>) => void;`
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
d.length > 0 ? (e.push(`interface ${v} {`), e.push(d.join(`
|
|
163
|
+
`)), e.push("}")) : e.push(`interface ${v} {}`), e.push("");
|
|
164
|
+
}
|
|
165
|
+
e.push("declare module 'solid-js' {"), e.push(" namespace JSX {"), e.push(" interface IntrinsicElements {");
|
|
166
|
+
for (const m of r) {
|
|
167
|
+
const $ = m.tagName, y = P($), v = `${y}NativeProps`, b = `HTML${y}Element`;
|
|
168
|
+
e.push(` '${$}': JSX.HTMLAttributes<${b}> & ${v};`);
|
|
169
|
+
}
|
|
170
|
+
return e.push(" }"), e.push(" }"), e.push("}"), e.push(""), e.join(`
|
|
171
|
+
`);
|
|
172
|
+
}
|
|
173
|
+
function D({ components: s, stencilPackageName: c, excludeComponents: a }) {
|
|
174
|
+
var l, n, i, t, p, h;
|
|
175
|
+
const r = S(s, a);
|
|
176
|
+
if (r.length === 0)
|
|
177
|
+
return "";
|
|
178
|
+
const e = [];
|
|
179
|
+
e.push(I("Vue 3", c, "vue-native-types")), e.push("// @ts-ignore - Vue types may not be available in all build contexts"), e.push("import type { DefineComponent, HTMLAttributes } from 'vue';");
|
|
180
|
+
const u = A(r);
|
|
181
|
+
u.size > 0 && e.push(`import type { ${Array.from(u).sort().join(", ")} } from '${c}';`), e.push("");
|
|
182
|
+
for (const m of r) {
|
|
183
|
+
const $ = m.tagName, y = P($), v = `${y}NativeProps`, b = `${y}CustomEvent`, d = [], E = (m.properties || []).filter((o) => !o.internal);
|
|
184
|
+
for (const o of E) {
|
|
185
|
+
const g = N(((l = o.complexType) == null ? void 0 : l.original) || "any"), f = (i = (n = o.docs) == null ? void 0 : n.text) == null ? void 0 : i.trim(), T = f ? ` /** ${f} */
|
|
186
|
+
` : "";
|
|
187
|
+
d.push(`${T} '${o.name}'?: ${g};`);
|
|
188
|
+
}
|
|
189
|
+
const x = (m.events || []).filter((o) => !o.internal);
|
|
190
|
+
for (const o of x) {
|
|
191
|
+
const g = N(((t = o.complexType) == null ? void 0 : t.original) || "void"), f = (h = (p = o.docs) == null ? void 0 : p.text) == null ? void 0 : h.trim(), T = f ? ` /** Event: ${o.name} - ${f} */
|
|
192
|
+
` : ` /** Event: ${o.name} */
|
|
193
|
+
`, H = `on${o.name.charAt(0).toUpperCase()}${o.name.slice(1)}`;
|
|
194
|
+
d.push(`${T} '${H}'?: (event: ${b}<${g}>) => void;`);
|
|
195
|
+
}
|
|
196
|
+
d.length > 0 ? (e.push(`interface ${v} {`), e.push(d.join(`
|
|
197
|
+
`)), e.push("}")) : e.push(`interface ${v} {}`), e.push("");
|
|
198
|
+
}
|
|
199
|
+
e.push("declare module 'vue' {"), e.push(" interface GlobalComponents {");
|
|
200
|
+
for (const m of r) {
|
|
201
|
+
const $ = m.tagName, v = `${P($)}NativeProps`;
|
|
202
|
+
e.push(` '${$}': DefineComponent<${v} & HTMLAttributes>;`);
|
|
203
|
+
}
|
|
204
|
+
return e.push(" }"), e.push("}"), e.push(""), e.join(`
|
|
205
|
+
`);
|
|
206
|
+
}
|
|
207
|
+
const U = (s) => `on${s.charAt(0).toUpperCase()}${s.slice(1)}`;
|
|
208
|
+
function V({ components: s, stencilPackageName: c, excludeComponents: a }) {
|
|
209
|
+
var l, n, i, t, p, h;
|
|
210
|
+
const r = S(s, a);
|
|
211
|
+
if (r.length === 0)
|
|
212
|
+
return "";
|
|
213
|
+
const e = [];
|
|
214
|
+
e.push(I("Preact", c, "preact-native-types")), e.push("// @ts-ignore - Preact types may not be available in all build contexts"), e.push("import 'preact';"), e.push("// @ts-ignore - Preact types may not be available in all build contexts"), e.push("import type { JSX } from 'preact';");
|
|
215
|
+
const u = A(r);
|
|
216
|
+
u.size > 0 && e.push(`import type { ${Array.from(u).sort().join(", ")} } from '${c}';`), e.push("");
|
|
217
|
+
for (const m of r) {
|
|
218
|
+
const $ = m.tagName, y = P($), v = `${y}NativeProps`, b = `${y}CustomEvent`, d = [], E = (m.properties || []).filter((o) => !o.internal);
|
|
219
|
+
for (const o of E) {
|
|
220
|
+
const g = N(((l = o.complexType) == null ? void 0 : l.original) || "any"), f = (i = (n = o.docs) == null ? void 0 : n.text) == null ? void 0 : i.trim(), T = f ? ` /** ${f} */
|
|
221
|
+
` : "";
|
|
222
|
+
d.push(`${T} '${o.name}'?: ${g};`);
|
|
223
|
+
}
|
|
224
|
+
const x = (m.events || []).filter((o) => !o.internal);
|
|
225
|
+
for (const o of x) {
|
|
226
|
+
const g = N(((t = o.complexType) == null ? void 0 : t.original) || "void"), f = (h = (p = o.docs) == null ? void 0 : p.text) == null ? void 0 : h.trim(), T = f ? ` /** Event: ${o.name} - ${f} */
|
|
227
|
+
` : ` /** Event: ${o.name} */
|
|
228
|
+
`, H = U(o.name);
|
|
229
|
+
d.push(`${T} '${H}'?: (event: ${b}<${g}>) => void;`);
|
|
230
|
+
}
|
|
231
|
+
d.length > 0 ? (e.push(`interface ${v} {`), e.push(d.join(`
|
|
232
|
+
`)), e.push("}")) : e.push(`interface ${v} {}`), e.push("");
|
|
233
|
+
}
|
|
234
|
+
e.push("declare module 'preact' {"), e.push(" namespace JSX {"), e.push(" interface IntrinsicElements {");
|
|
235
|
+
for (const m of r) {
|
|
236
|
+
const $ = m.tagName, y = P($), v = `${y}NativeProps`, b = `HTML${y}Element`;
|
|
237
|
+
e.push(` '${$}': JSX.HTMLAttributes<${b}> & ${v};`);
|
|
238
|
+
}
|
|
239
|
+
return e.push(" }"), e.push(" }"), e.push("}"), e.push(""), e.join(`
|
|
240
|
+
`);
|
|
241
|
+
}
|
|
242
|
+
const C = {
|
|
243
|
+
react: "react-native-types.d.ts",
|
|
244
|
+
svelte: "svelte-native-types.d.ts",
|
|
245
|
+
solid: "solid-native-types.d.ts",
|
|
246
|
+
vue: "vue-native-types.d.ts",
|
|
247
|
+
preact: "preact-native-types.d.ts"
|
|
248
|
+
};
|
|
249
|
+
function j(s, c, a) {
|
|
250
|
+
let r = s.endsWith(".d.ts") ? s : w.join(s, c);
|
|
251
|
+
return !w.isAbsolute(r) && a && (r = w.join(a, r)), r;
|
|
252
|
+
}
|
|
253
|
+
function O(s = {}) {
|
|
254
|
+
return {
|
|
255
|
+
type: "custom",
|
|
256
|
+
name: "types-output-target",
|
|
257
|
+
validate(c, a) {
|
|
258
|
+
s.reactTypesPath || s.svelteTypesPath || s.solidTypesPath || s.vueTypesPath || s.preactTypesPath || a.push({
|
|
259
|
+
level: "error",
|
|
260
|
+
type: "config",
|
|
261
|
+
messageText: "The 'types-output-target' requires at least one framework path to be specified (reactTypesPath, svelteTypesPath, solidTypesPath, vueTypesPath, or preactTypesPath).",
|
|
262
|
+
lines: []
|
|
263
|
+
});
|
|
264
|
+
},
|
|
265
|
+
async generator(c, a, r) {
|
|
266
|
+
const e = r.createTimeSpan("generate types output target started", !0), u = r.components, l = c.fsNamespace || "component-library", n = c.rootDir, i = [];
|
|
267
|
+
if (s.reactTypesPath) {
|
|
268
|
+
const t = F({
|
|
269
|
+
components: u,
|
|
270
|
+
stencilPackageName: l,
|
|
271
|
+
excludeComponents: s.excludeComponents
|
|
272
|
+
});
|
|
273
|
+
if (t) {
|
|
274
|
+
const p = j(s.reactTypesPath, C.react, n);
|
|
275
|
+
i.push(a.fs.writeFile(p, t));
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
if (s.svelteTypesPath) {
|
|
279
|
+
const t = X({
|
|
280
|
+
components: u,
|
|
281
|
+
stencilPackageName: l,
|
|
282
|
+
excludeComponents: s.excludeComponents
|
|
283
|
+
});
|
|
284
|
+
if (t) {
|
|
285
|
+
const p = j(s.svelteTypesPath, C.svelte, n);
|
|
286
|
+
i.push(a.fs.writeFile(p, t));
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
if (s.solidTypesPath) {
|
|
290
|
+
const t = z({
|
|
291
|
+
components: u,
|
|
292
|
+
stencilPackageName: l,
|
|
293
|
+
excludeComponents: s.excludeComponents
|
|
294
|
+
});
|
|
295
|
+
if (t) {
|
|
296
|
+
const p = j(s.solidTypesPath, C.solid, n);
|
|
297
|
+
i.push(a.fs.writeFile(p, t));
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
if (s.vueTypesPath) {
|
|
301
|
+
const t = D({
|
|
302
|
+
components: u,
|
|
303
|
+
stencilPackageName: l,
|
|
304
|
+
excludeComponents: s.excludeComponents
|
|
305
|
+
});
|
|
306
|
+
if (t) {
|
|
307
|
+
const p = j(s.vueTypesPath, C.vue, n);
|
|
308
|
+
i.push(a.fs.writeFile(p, t));
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
if (s.preactTypesPath) {
|
|
312
|
+
const t = V({
|
|
313
|
+
components: u,
|
|
314
|
+
stencilPackageName: l,
|
|
315
|
+
excludeComponents: s.excludeComponents
|
|
316
|
+
});
|
|
317
|
+
if (t) {
|
|
318
|
+
const p = j(s.preactTypesPath, C.preact, n);
|
|
319
|
+
i.push(a.fs.writeFile(p, t));
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
await Promise.all(i), e.finish("generate types output target finished");
|
|
323
|
+
}
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
export {
|
|
327
|
+
V as createPreactTypes,
|
|
328
|
+
F as createReactTypes,
|
|
329
|
+
z as createSolidTypes,
|
|
330
|
+
X as createSvelteTypes,
|
|
331
|
+
D as createVueTypes,
|
|
332
|
+
O as typesOutputTarget
|
|
333
|
+
};
|
|
334
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/utils/string-utils.ts","../src/generators/base.ts","../src/generators/react.ts","../src/generators/svelte.ts","../src/generators/solid.ts","../src/generators/vue.ts","../src/generators/preact.ts","../src/index.ts"],"sourcesContent":["export const kebabToPascalCase = (str: string) =>\n str\n .toLowerCase()\n .split('-')\n .map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1))\n .join('');\n\n/**\n * Normalizes a type string by removing single-line comments and collapsing whitespace.\n * This is necessary because multiline types with comments would break when collapsed to a single line.\n */\nexport const normalizeTypeString = (type: string) =>\n type\n .replace(/\\/\\/.*$/gm, '') // Remove single-line comments\n .replace(/\\n/g, ' ') // Replace newlines with spaces\n .replace(/\\s{2,}/g, ' ') // Collapse multiple spaces\n .trim();\n","import type { ComponentCompilerMeta } from '@stencil/core/internal';\nimport { kebabToPascalCase, normalizeTypeString } from '../utils/string-utils.js';\n\nexport interface BaseTypesOptions {\n components: ComponentCompilerMeta[];\n stencilPackageName: string;\n excludeComponents?: string[];\n}\n\nexport interface ComponentInfo {\n tagName: string;\n pascalName: string;\n propsInterfaceName: string;\n customEventType: string;\n elementType: string;\n properties: PropertyInfo[];\n events: EventInfo[];\n}\n\nexport interface PropertyInfo {\n name: string;\n type: string;\n docs?: string;\n}\n\nexport interface EventInfo {\n name: string;\n type: string;\n docs?: string;\n}\n\n/**\n * Filters components based on internal flag and exclude list.\n */\nexport function filterComponents(\n components: ComponentCompilerMeta[],\n excludeComponents?: string[]\n): ComponentCompilerMeta[] {\n return components.filter((c) => {\n if (c.internal === true) return false;\n if (excludeComponents?.includes(c.tagName)) return false;\n return true;\n });\n}\n\n/**\n * Extracts component information needed for type generation.\n */\nexport function extractComponentInfo(component: ComponentCompilerMeta): ComponentInfo {\n const tagName = component.tagName;\n const pascalName = kebabToPascalCase(tagName);\n\n const publicProperties = (component.properties || []).filter((p) => !p.internal);\n const publicEvents = (component.events || []).filter((e) => !e.internal);\n\n const properties: PropertyInfo[] = publicProperties.map((prop) => ({\n name: prop.name,\n type: normalizeTypeString(prop.complexType?.original || 'any'),\n docs: prop.docs?.text?.trim(),\n }));\n\n const events: EventInfo[] = publicEvents.map((event) => ({\n name: event.name,\n type: normalizeTypeString(event.complexType?.original || 'void'),\n docs: event.docs?.text?.trim(),\n }));\n\n return {\n tagName,\n pascalName,\n propsInterfaceName: `${pascalName}NativeProps`,\n customEventType: `${pascalName}CustomEvent`,\n elementType: `HTML${pascalName}Element`,\n properties,\n events,\n };\n}\n\n/**\n * Collects all types that need to be imported from the Stencil package.\n */\nexport function collectImportTypes(\n components: ComponentCompilerMeta[],\n includeCustomEvents: boolean = true\n): Set<string> {\n const types = new Set<string>();\n\n for (const component of components) {\n const pascalName = kebabToPascalCase(component.tagName);\n const publicEvents = (component.events || []).filter((e) => !e.internal);\n\n if (includeCustomEvents && publicEvents.length > 0) {\n types.add(`${pascalName}CustomEvent`);\n }\n\n // Collect referenced types from events\n for (const event of publicEvents) {\n if (event.complexType?.references) {\n for (const [refKey, refValue] of Object.entries(event.complexType.references)) {\n if (refValue.location !== 'global') {\n types.add(refKey);\n }\n }\n }\n }\n\n // Collect referenced types from properties\n const publicProperties = (component.properties || []).filter((p) => !p.internal);\n for (const prop of publicProperties) {\n if (prop.complexType?.references) {\n for (const [refKey, refValue] of Object.entries(prop.complexType.references)) {\n if (refValue.location !== 'global') {\n types.add(refKey);\n }\n }\n }\n }\n }\n\n return types;\n}\n\n/**\n * Generates the standard file header comment.\n */\nexport function generateHeader(framework: string, stencilPackageName: string, importPath: string): string {\n return `/**\n * This file was automatically generated by the Stencil Types Output Target.\n * Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.\n *\n * This file provides TypeScript type definitions for using Stencil web components\n * as native custom elements in ${framework}.\n *\n * Usage:\n * Import this file in your application to get type support for custom elements:\n * \\`\\`\\`tsx\n * import '${stencilPackageName}/${importPath}';\n * \\`\\`\\`\n */\n\n/* eslint-disable */\n/* tslint:disable */\n`;\n}\n","import {\n type BaseTypesOptions,\n filterComponents,\n extractComponentInfo,\n collectImportTypes,\n generateHeader,\n} from './base.js';\n\nexport interface ReactTypesOptions extends BaseTypesOptions {}\n\n/**\n * Converts an event name to a lowercase React 19 event handler prop name.\n * React 19 lowercases the prop name (minus \"on\") to get the event name.\n * So for event \"myFocus\", the handler prop should be \"onmyfocus\".\n */\nconst toLowercaseEventHandler = (eventName: string): string => {\n return `on${eventName.toLowerCase()}`;\n};\n\n/**\n * Creates a TypeScript declaration file (.d.ts) that provides type definitions\n * for using Stencil web components as native custom elements in React 19+.\n *\n * The generated file augments the `react/jsx-runtime` module to provide proper\n * typing for custom elements when used directly in JSX without wrapper components.\n */\nexport function createReactTypes({ components, stencilPackageName, excludeComponents }: ReactTypesOptions): string {\n const filteredComponents = filterComponents(components, excludeComponents);\n\n if (filteredComponents.length === 0) {\n return '';\n }\n\n const lines: string[] = [];\n\n // Add header\n lines.push(generateHeader('React 19+', stencilPackageName, 'react-native-types'));\n\n // Add React imports with @ts-ignore for non-React contexts\n lines.push(`// @ts-ignore - React types may not be available in all build contexts`);\n lines.push(`import 'react';`);\n lines.push(`// @ts-ignore - React types may not be available in all build contexts`);\n lines.push(`import type { DetailedHTMLProps, HTMLAttributes } from 'react';`);\n\n // Collect and add imports from Stencil package\n const importTypes = collectImportTypes(filteredComponents);\n if (importTypes.size > 0) {\n lines.push(`import type { ${Array.from(importTypes).sort().join(', ')} } from '${stencilPackageName}';`);\n }\n\n lines.push('');\n\n // Generate interface for each component\n for (const component of filteredComponents) {\n const info = extractComponentInfo(component);\n const interfaceProperties: string[] = [];\n\n // Add properties\n for (const prop of info.properties) {\n const docs = prop.docs ? ` /** ${prop.docs} */\\n` : '';\n interfaceProperties.push(`${docs} '${prop.name}'?: ${prop.type};`);\n }\n\n // Add events with lowercase naming (React 19 style)\n for (const event of info.events) {\n const docs = event.docs ? ` /** Event: ${event.name} - ${event.docs} */\\n` : ` /** Event: ${event.name} */\\n`;\n const handlerName = toLowercaseEventHandler(event.name);\n interfaceProperties.push(`${docs} '${handlerName}'?: (event: ${info.customEventType}<${event.type}>) => void;`);\n }\n\n // Generate the props interface\n if (interfaceProperties.length > 0) {\n lines.push(`interface ${info.propsInterfaceName} {`);\n lines.push(interfaceProperties.join('\\n'));\n lines.push(`}`);\n } else {\n lines.push(`interface ${info.propsInterfaceName} {}`);\n }\n lines.push('');\n }\n\n // Generate module augmentation for react/jsx-runtime's JSX namespace\n lines.push(`declare module 'react/jsx-runtime' {`);\n lines.push(` namespace JSX {`);\n lines.push(` interface IntrinsicElements {`);\n\n for (const component of filteredComponents) {\n const info = extractComponentInfo(component);\n lines.push(\n ` '${info.tagName}': DetailedHTMLProps<HTMLAttributes<${info.elementType}> & ${info.propsInterfaceName}, ${info.elementType}>;`\n );\n }\n\n lines.push(` }`);\n lines.push(` }`);\n lines.push(`}`);\n lines.push('');\n\n return lines.join('\\n');\n}\n","import {\n type BaseTypesOptions,\n filterComponents,\n extractComponentInfo,\n collectImportTypes,\n generateHeader,\n} from './base.js';\n\nexport interface SvelteTypesOptions extends BaseTypesOptions {}\n\n/**\n * Converts an event name to a Svelte event handler prop name.\n * Svelte uses \"on:eventname\" syntax in templates, but for type definitions\n * we use the \"oneventname\" format (lowercase).\n */\nconst toSvelteEventHandler = (eventName: string): string => {\n return `on${eventName.toLowerCase()}`;\n};\n\n/**\n * Creates a TypeScript declaration file (.d.ts) that provides type definitions\n * for using Stencil web components as native custom elements in Svelte.\n *\n * The generated file augments the `svelte/elements` module to provide proper\n * typing for custom elements when used in Svelte templates.\n */\nexport function createSvelteTypes({ components, stencilPackageName, excludeComponents }: SvelteTypesOptions): string {\n const filteredComponents = filterComponents(components, excludeComponents);\n\n if (filteredComponents.length === 0) {\n return '';\n }\n\n const lines: string[] = [];\n\n // Add header\n lines.push(generateHeader('Svelte', stencilPackageName, 'svelte-native-types'));\n\n // Add Svelte imports\n lines.push(`// @ts-ignore - Svelte types may not be available in all build contexts`);\n lines.push(`import type { HTMLAttributes } from 'svelte/elements';`);\n\n // Collect and add imports from Stencil package\n const importTypes = collectImportTypes(filteredComponents);\n if (importTypes.size > 0) {\n lines.push(`import type { ${Array.from(importTypes).sort().join(', ')} } from '${stencilPackageName}';`);\n }\n\n lines.push('');\n\n // Generate interface for each component\n for (const component of filteredComponents) {\n const info = extractComponentInfo(component);\n const interfaceProperties: string[] = [];\n\n // Add properties\n for (const prop of info.properties) {\n const docs = prop.docs ? ` /** ${prop.docs} */\\n` : '';\n interfaceProperties.push(`${docs} '${prop.name}'?: ${prop.type};`);\n }\n\n // Add events\n for (const event of info.events) {\n const docs = event.docs ? ` /** Event: ${event.name} - ${event.docs} */\\n` : ` /** Event: ${event.name} */\\n`;\n const handlerName = toSvelteEventHandler(event.name);\n interfaceProperties.push(`${docs} '${handlerName}'?: (event: ${info.customEventType}<${event.type}>) => void;`);\n }\n\n // Generate the props interface\n if (interfaceProperties.length > 0) {\n lines.push(`interface ${info.propsInterfaceName} {`);\n lines.push(interfaceProperties.join('\\n'));\n lines.push(`}`);\n } else {\n lines.push(`interface ${info.propsInterfaceName} {}`);\n }\n lines.push('');\n }\n\n // Generate module augmentation for svelte/elements\n lines.push(`declare module 'svelte/elements' {`);\n lines.push(` interface SvelteHTMLElements {`);\n\n for (const component of filteredComponents) {\n const info = extractComponentInfo(component);\n lines.push(` '${info.tagName}': HTMLAttributes<${info.elementType}> & ${info.propsInterfaceName};`);\n }\n\n lines.push(` }`);\n lines.push(`}`);\n lines.push('');\n\n return lines.join('\\n');\n}\n","import { type BaseTypesOptions, filterComponents, collectImportTypes, generateHeader } from './base.js';\nimport { kebabToPascalCase, normalizeTypeString } from '../utils/string-utils.js';\n\nexport interface SolidTypesOptions extends BaseTypesOptions {}\n\n/**\n * Creates a TypeScript declaration file (.d.ts) that provides type definitions\n * for using Stencil web components as native custom elements in Solid.\n *\n * Solid distinguishes between:\n * - Properties (prop:): Set via JavaScript property\n * - Attributes (attr:): Set via HTML attribute\n * - Events (on:): Custom event handlers\n *\n * The generated file augments the `solid-js` module to provide proper\n * typing for custom elements when used in Solid JSX.\n */\nexport function createSolidTypes({ components, stencilPackageName, excludeComponents }: SolidTypesOptions): string {\n const filteredComponents = filterComponents(components, excludeComponents);\n\n if (filteredComponents.length === 0) {\n return '';\n }\n\n const lines: string[] = [];\n\n // Add header\n lines.push(generateHeader('Solid', stencilPackageName, 'solid-native-types'));\n\n // Add Solid imports\n lines.push(`// @ts-ignore - Solid types may not be available in all build contexts`);\n lines.push(`import 'solid-js';`);\n lines.push(`// @ts-ignore - Solid types may not be available in all build contexts`);\n lines.push(`import type { JSX } from 'solid-js';`);\n\n // Collect and add imports from Stencil package\n const importTypes = collectImportTypes(filteredComponents);\n if (importTypes.size > 0) {\n lines.push(`import type { ${Array.from(importTypes).sort().join(', ')} } from '${stencilPackageName}';`);\n }\n\n lines.push('');\n\n // Generate interface for each component\n for (const component of filteredComponents) {\n const tagName = component.tagName;\n const pascalName = kebabToPascalCase(tagName);\n const propsInterfaceName = `${pascalName}NativeProps`;\n const customEventType = `${pascalName}CustomEvent`;\n\n const interfaceProperties: string[] = [];\n\n // Add properties with both prop: and attr: prefixes where applicable\n const publicProperties = (component.properties || []).filter((p) => !p.internal);\n for (const prop of publicProperties) {\n const propType = normalizeTypeString(prop.complexType?.original || 'any');\n const docs = prop.docs?.text?.trim();\n const docsComment = docs ? ` /** ${docs} */\\n` : '';\n\n // JavaScript property (always available)\n interfaceProperties.push(`${docsComment} 'prop:${prop.name}'?: ${propType};`);\n\n // HTML attribute (only if reflected to attribute)\n if (prop.attribute) {\n interfaceProperties.push(`${docsComment} 'attr:${prop.attribute}'?: string;`);\n }\n }\n\n // Add events using Solid's on: syntax\n const publicEvents = (component.events || []).filter((e) => !e.internal);\n for (const event of publicEvents) {\n const eventType = normalizeTypeString(event.complexType?.original || 'void');\n const docs = event.docs?.text?.trim();\n const docsComment = docs ? ` /** Event: ${event.name} - ${docs} */\\n` : ` /** Event: ${event.name} */\\n`;\n interfaceProperties.push(\n `${docsComment} 'on:${event.name}'?: (event: ${customEventType}<${eventType}>) => void;`\n );\n }\n\n // Generate the props interface\n if (interfaceProperties.length > 0) {\n lines.push(`interface ${propsInterfaceName} {`);\n lines.push(interfaceProperties.join('\\n'));\n lines.push(`}`);\n } else {\n lines.push(`interface ${propsInterfaceName} {}`);\n }\n lines.push('');\n }\n\n // Generate module augmentation for solid-js\n lines.push(`declare module 'solid-js' {`);\n lines.push(` namespace JSX {`);\n lines.push(` interface IntrinsicElements {`);\n\n for (const component of filteredComponents) {\n const tagName = component.tagName;\n const pascalName = kebabToPascalCase(tagName);\n const propsInterfaceName = `${pascalName}NativeProps`;\n const elementType = `HTML${pascalName}Element`;\n\n lines.push(` '${tagName}': JSX.HTMLAttributes<${elementType}> & ${propsInterfaceName};`);\n }\n\n lines.push(` }`);\n lines.push(` }`);\n lines.push(`}`);\n lines.push('');\n\n return lines.join('\\n');\n}\n","import { type BaseTypesOptions, filterComponents, collectImportTypes, generateHeader } from './base.js';\nimport { kebabToPascalCase, normalizeTypeString } from '../utils/string-utils.js';\n\nexport interface VueTypesOptions extends BaseTypesOptions {}\n\n/**\n * Creates a TypeScript declaration file (.d.ts) that provides type definitions\n * for using Stencil web components as native custom elements in Vue 3.\n *\n * Vue uses kebab-case event names with @ prefix in templates (e.g., @my-event).\n * The generated file augments Vue's GlobalComponents interface.\n */\nexport function createVueTypes({ components, stencilPackageName, excludeComponents }: VueTypesOptions): string {\n const filteredComponents = filterComponents(components, excludeComponents);\n\n if (filteredComponents.length === 0) {\n return '';\n }\n\n const lines: string[] = [];\n\n // Add header\n lines.push(generateHeader('Vue 3', stencilPackageName, 'vue-native-types'));\n\n // Add Vue imports\n lines.push(`// @ts-ignore - Vue types may not be available in all build contexts`);\n lines.push(`import type { DefineComponent, HTMLAttributes } from 'vue';`);\n\n // Collect and add imports from Stencil package\n const importTypes = collectImportTypes(filteredComponents);\n if (importTypes.size > 0) {\n lines.push(`import type { ${Array.from(importTypes).sort().join(', ')} } from '${stencilPackageName}';`);\n }\n\n lines.push('');\n\n // Generate interface for each component\n for (const component of filteredComponents) {\n const tagName = component.tagName;\n const pascalName = kebabToPascalCase(tagName);\n const propsInterfaceName = `${pascalName}NativeProps`;\n const customEventType = `${pascalName}CustomEvent`;\n\n const interfaceProperties: string[] = [];\n\n // Add properties\n const publicProperties = (component.properties || []).filter((p) => !p.internal);\n for (const prop of publicProperties) {\n const propType = normalizeTypeString(prop.complexType?.original || 'any');\n const docs = prop.docs?.text?.trim();\n const docsComment = docs ? ` /** ${docs} */\\n` : '';\n interfaceProperties.push(`${docsComment} '${prop.name}'?: ${propType};`);\n }\n\n // Add events using Vue's onEventName convention\n const publicEvents = (component.events || []).filter((e) => !e.internal);\n for (const event of publicEvents) {\n const eventType = normalizeTypeString(event.complexType?.original || 'void');\n const docs = event.docs?.text?.trim();\n const docsComment = docs ? ` /** Event: ${event.name} - ${docs} */\\n` : ` /** Event: ${event.name} */\\n`;\n // Vue uses onEventName format for event handlers in props (onMyEvent for @my-event)\n const handlerName = `on${event.name.charAt(0).toUpperCase()}${event.name.slice(1)}`;\n interfaceProperties.push(`${docsComment} '${handlerName}'?: (event: ${customEventType}<${eventType}>) => void;`);\n }\n\n // Generate the props interface\n if (interfaceProperties.length > 0) {\n lines.push(`interface ${propsInterfaceName} {`);\n lines.push(interfaceProperties.join('\\n'));\n lines.push(`}`);\n } else {\n lines.push(`interface ${propsInterfaceName} {}`);\n }\n lines.push('');\n }\n\n // Generate module augmentation for Vue\n lines.push(`declare module 'vue' {`);\n lines.push(` interface GlobalComponents {`);\n\n for (const component of filteredComponents) {\n const tagName = component.tagName;\n const pascalName = kebabToPascalCase(tagName);\n const propsInterfaceName = `${pascalName}NativeProps`;\n\n // Vue expects DefineComponent for GlobalComponents\n lines.push(` '${tagName}': DefineComponent<${propsInterfaceName} & HTMLAttributes>;`);\n }\n\n lines.push(` }`);\n lines.push(`}`);\n lines.push('');\n\n return lines.join('\\n');\n}\n","import { type BaseTypesOptions, filterComponents, collectImportTypes, generateHeader } from './base.js';\nimport { kebabToPascalCase, normalizeTypeString } from '../utils/string-utils.js';\n\nexport interface PreactTypesOptions extends BaseTypesOptions {}\n\n/**\n * Converts an event name to a Preact event handler prop name.\n * Preact follows a similar pattern to React with onEventName.\n */\nconst toPreactEventHandler = (eventName: string): string => {\n return `on${eventName.charAt(0).toUpperCase()}${eventName.slice(1)}`;\n};\n\n/**\n * Creates a TypeScript declaration file (.d.ts) that provides type definitions\n * for using Stencil web components as native custom elements in Preact.\n *\n * The generated file augments the `preact` module to provide proper\n * typing for custom elements when used in Preact JSX.\n */\nexport function createPreactTypes({ components, stencilPackageName, excludeComponents }: PreactTypesOptions): string {\n const filteredComponents = filterComponents(components, excludeComponents);\n\n if (filteredComponents.length === 0) {\n return '';\n }\n\n const lines: string[] = [];\n\n // Add header\n lines.push(generateHeader('Preact', stencilPackageName, 'preact-native-types'));\n\n // Add Preact imports\n lines.push(`// @ts-ignore - Preact types may not be available in all build contexts`);\n lines.push(`import 'preact';`);\n lines.push(`// @ts-ignore - Preact types may not be available in all build contexts`);\n lines.push(`import type { JSX } from 'preact';`);\n\n // Collect and add imports from Stencil package\n const importTypes = collectImportTypes(filteredComponents);\n if (importTypes.size > 0) {\n lines.push(`import type { ${Array.from(importTypes).sort().join(', ')} } from '${stencilPackageName}';`);\n }\n\n lines.push('');\n\n // Generate interface for each component\n for (const component of filteredComponents) {\n const tagName = component.tagName;\n const pascalName = kebabToPascalCase(tagName);\n const propsInterfaceName = `${pascalName}NativeProps`;\n const customEventType = `${pascalName}CustomEvent`;\n\n const interfaceProperties: string[] = [];\n\n // Add properties\n const publicProperties = (component.properties || []).filter((p) => !p.internal);\n for (const prop of publicProperties) {\n const propType = normalizeTypeString(prop.complexType?.original || 'any');\n const docs = prop.docs?.text?.trim();\n const docsComment = docs ? ` /** ${docs} */\\n` : '';\n interfaceProperties.push(`${docsComment} '${prop.name}'?: ${propType};`);\n }\n\n // Add events\n const publicEvents = (component.events || []).filter((e) => !e.internal);\n for (const event of publicEvents) {\n const eventType = normalizeTypeString(event.complexType?.original || 'void');\n const docs = event.docs?.text?.trim();\n const docsComment = docs ? ` /** Event: ${event.name} - ${docs} */\\n` : ` /** Event: ${event.name} */\\n`;\n const handlerName = toPreactEventHandler(event.name);\n interfaceProperties.push(`${docsComment} '${handlerName}'?: (event: ${customEventType}<${eventType}>) => void;`);\n }\n\n // Generate the props interface\n if (interfaceProperties.length > 0) {\n lines.push(`interface ${propsInterfaceName} {`);\n lines.push(interfaceProperties.join('\\n'));\n lines.push(`}`);\n } else {\n lines.push(`interface ${propsInterfaceName} {}`);\n }\n lines.push('');\n }\n\n // Generate module augmentation for Preact\n lines.push(`declare module 'preact' {`);\n lines.push(` namespace JSX {`);\n lines.push(` interface IntrinsicElements {`);\n\n for (const component of filteredComponents) {\n const tagName = component.tagName;\n const pascalName = kebabToPascalCase(tagName);\n const propsInterfaceName = `${pascalName}NativeProps`;\n const elementType = `HTML${pascalName}Element`;\n\n lines.push(` '${tagName}': JSX.HTMLAttributes<${elementType}> & ${propsInterfaceName};`);\n }\n\n lines.push(` }`);\n lines.push(` }`);\n lines.push(`}`);\n lines.push('');\n\n return lines.join('\\n');\n}\n","import type { OutputTargetCustom } from '@stencil/core/internal';\nimport path from 'node:path';\n\nimport { createReactTypes } from './generators/react.js';\nimport { createSvelteTypes } from './generators/svelte.js';\nimport { createSolidTypes } from './generators/solid.js';\nimport { createVueTypes } from './generators/vue.js';\nimport { createPreactTypes } from './generators/preact.js';\n\nconst DEFAULT_FILENAMES = {\n react: 'react-native-types.d.ts',\n svelte: 'svelte-native-types.d.ts',\n solid: 'solid-native-types.d.ts',\n vue: 'vue-native-types.d.ts',\n preact: 'preact-native-types.d.ts',\n} as const;\n\nexport interface TypesOutputTargetOptions {\n /**\n * Specify the components that should be excluded from type generation.\n */\n excludeComponents?: string[];\n\n /**\n * Path to generate React 19+ type definitions.\n *\n * This can be either:\n * - A full file path ending in `.d.ts` (e.g., `'dist/types/react-types.d.ts'`)\n * - A directory path (e.g., `'dist/types'`), which will generate `react-native-types.d.ts`\n *\n * **Note:** Your component library's `package.json` should include `@types/react` as an\n * optional peer dependency to ensure proper TypeScript module resolution:\n * ```json\n * {\n * \"peerDependencies\": { \"@types/react\": \">=18\" },\n * \"peerDependenciesMeta\": { \"@types/react\": { \"optional\": true } }\n * }\n * ```\n */\n reactTypesPath?: string;\n\n /**\n * Path to generate Svelte type definitions.\n *\n * This can be either:\n * - A full file path ending in `.d.ts` (e.g., `'dist/types/svelte-types.d.ts'`)\n * - A directory path (e.g., `'dist/types'`), which will generate `svelte-native-types.d.ts`\n *\n * **Note:** Your component library's `package.json` should include `svelte` as an\n * optional peer dependency to ensure proper TypeScript module resolution:\n * ```json\n * {\n * \"peerDependencies\": { \"svelte\": \">=5\" },\n * \"peerDependenciesMeta\": { \"svelte\": { \"optional\": true } }\n * }\n * ```\n */\n svelteTypesPath?: string;\n\n /**\n * Path to generate Solid type definitions.\n *\n * This can be either:\n * - A full file path ending in `.d.ts` (e.g., `'dist/types/solid-types.d.ts'`)\n * - A directory path (e.g., `'dist/types'`), which will generate `solid-native-types.d.ts`\n *\n * **Note:** Your component library's `package.json` should include `solid-js` as an\n * optional peer dependency to ensure proper TypeScript module resolution:\n * ```json\n * {\n * \"peerDependencies\": { \"solid-js\": \">=1\" },\n * \"peerDependenciesMeta\": { \"solid-js\": { \"optional\": true } }\n * }\n * ```\n */\n solidTypesPath?: string;\n\n /**\n * Path to generate Vue 3 type definitions.\n *\n * This can be either:\n * - A full file path ending in `.d.ts` (e.g., `'dist/types/vue-types.d.ts'`)\n * - A directory path (e.g., `'dist/types'`), which will generate `vue-native-types.d.ts`\n *\n * **Note:** Your component library's `package.json` should include `vue` as an\n * optional peer dependency to ensure proper TypeScript module resolution:\n * ```json\n * {\n * \"peerDependencies\": { \"vue\": \">=3\" },\n * \"peerDependenciesMeta\": { \"vue\": { \"optional\": true } }\n * }\n * ```\n */\n vueTypesPath?: string;\n\n /**\n * Path to generate Preact type definitions.\n *\n * This can be either:\n * - A full file path ending in `.d.ts` (e.g., `'dist/types/preact-types.d.ts'`)\n * - A directory path (e.g., `'dist/types'`), which will generate `preact-native-types.d.ts`\n *\n * **Note:** Your component library's `package.json` should include `preact` as an\n * optional peer dependency to ensure proper TypeScript module resolution:\n * ```json\n * {\n * \"peerDependencies\": { \"preact\": \">=10\" },\n * \"peerDependenciesMeta\": { \"preact\": { \"optional\": true } }\n * }\n * ```\n */\n preactTypesPath?: string;\n}\n\n/**\n * Resolves a path option to an absolute file path.\n * If the path ends with .d.ts, use it as-is. Otherwise, append the default filename.\n */\nfunction resolveOutputPath(pathOption: string, defaultFilename: string, rootDir?: string): string {\n let outputPath = pathOption.endsWith('.d.ts') ? pathOption : path.join(pathOption, defaultFilename);\n\n if (!path.isAbsolute(outputPath) && rootDir) {\n outputPath = path.join(rootDir, outputPath);\n }\n\n return outputPath;\n}\n\n/**\n * Stencil output target for generating framework-specific type definitions.\n *\n * This output target generates TypeScript declaration files (.d.ts) that provide\n * type definitions for using Stencil web components as custom elements\n * in various frameworks.\n *\n * @example\n * ```ts\n * // stencil.config.ts\n * import { typesOutputTarget } from '@stencil/types-output-target';\n *\n * export const config: Config = {\n * outputTargets: [\n * typesOutputTarget({\n * reactTypesPath: 'dist/types',\n * svelteTypesPath: 'dist/types',\n * solidTypesPath: 'dist/types',\n * vueTypesPath: 'dist/types',\n * preactTypesPath: 'dist/types',\n * }),\n * ],\n * };\n * ```\n */\nexport function typesOutputTarget(options: TypesOutputTargetOptions = {}): OutputTargetCustom {\n return {\n type: 'custom',\n name: 'types-output-target',\n validate(_config, diagnostics) {\n const hasAnyPath =\n options.reactTypesPath ||\n options.svelteTypesPath ||\n options.solidTypesPath ||\n options.vueTypesPath ||\n options.preactTypesPath;\n\n if (!hasAnyPath) {\n diagnostics.push({\n level: 'error',\n type: 'config',\n messageText:\n \"The 'types-output-target' requires at least one framework path to be specified \" +\n '(reactTypesPath, svelteTypesPath, solidTypesPath, vueTypesPath, or preactTypesPath).',\n lines: [],\n });\n }\n },\n async generator(_config, compilerCtx, buildCtx) {\n const timespan = buildCtx.createTimeSpan('generate types output target started', true);\n\n const components = buildCtx.components;\n const stencilPackageName = _config.fsNamespace || 'component-library';\n const rootDir = _config.rootDir;\n\n const tasks: Promise<unknown>[] = [];\n\n // Generate React types\n if (options.reactTypesPath) {\n const content = createReactTypes({\n components,\n stencilPackageName,\n excludeComponents: options.excludeComponents,\n });\n if (content) {\n const outputPath = resolveOutputPath(options.reactTypesPath, DEFAULT_FILENAMES.react, rootDir);\n tasks.push(compilerCtx.fs.writeFile(outputPath, content));\n }\n }\n\n // Generate Svelte types\n if (options.svelteTypesPath) {\n const content = createSvelteTypes({\n components,\n stencilPackageName,\n excludeComponents: options.excludeComponents,\n });\n if (content) {\n const outputPath = resolveOutputPath(options.svelteTypesPath, DEFAULT_FILENAMES.svelte, rootDir);\n tasks.push(compilerCtx.fs.writeFile(outputPath, content));\n }\n }\n\n // Generate Solid types\n if (options.solidTypesPath) {\n const content = createSolidTypes({\n components,\n stencilPackageName,\n excludeComponents: options.excludeComponents,\n });\n if (content) {\n const outputPath = resolveOutputPath(options.solidTypesPath, DEFAULT_FILENAMES.solid, rootDir);\n tasks.push(compilerCtx.fs.writeFile(outputPath, content));\n }\n }\n\n // Generate Vue types\n if (options.vueTypesPath) {\n const content = createVueTypes({\n components,\n stencilPackageName,\n excludeComponents: options.excludeComponents,\n });\n if (content) {\n const outputPath = resolveOutputPath(options.vueTypesPath, DEFAULT_FILENAMES.vue, rootDir);\n tasks.push(compilerCtx.fs.writeFile(outputPath, content));\n }\n }\n\n // Generate Preact types\n if (options.preactTypesPath) {\n const content = createPreactTypes({\n components,\n stencilPackageName,\n excludeComponents: options.excludeComponents,\n });\n if (content) {\n const outputPath = resolveOutputPath(options.preactTypesPath, DEFAULT_FILENAMES.preact, rootDir);\n tasks.push(compilerCtx.fs.writeFile(outputPath, content));\n }\n }\n\n await Promise.all(tasks);\n\n timespan.finish('generate types output target finished');\n },\n };\n}\n\n// Re-export generators for advanced usage\nexport { createReactTypes } from './generators/react.js';\nexport { createSvelteTypes } from './generators/svelte.js';\nexport { createSolidTypes } from './generators/solid.js';\nexport { createVueTypes } from './generators/vue.js';\nexport { createPreactTypes } from './generators/preact.js';\n"],"names":["kebabToPascalCase","str","segment","normalizeTypeString","type","filterComponents","components","excludeComponents","c","extractComponentInfo","component","tagName","pascalName","publicProperties","p","publicEvents","e","properties","prop","_a","_c","_b","events","event","collectImportTypes","includeCustomEvents","types","refKey","refValue","generateHeader","framework","stencilPackageName","importPath","toLowercaseEventHandler","eventName","createReactTypes","filteredComponents","lines","importTypes","info","interfaceProperties","docs","handlerName","toSvelteEventHandler","createSvelteTypes","createSolidTypes","propsInterfaceName","customEventType","propType","docsComment","eventType","_d","_f","_e","elementType","createVueTypes","toPreactEventHandler","createPreactTypes","DEFAULT_FILENAMES","resolveOutputPath","pathOption","defaultFilename","rootDir","outputPath","path","typesOutputTarget","options","_config","diagnostics","compilerCtx","buildCtx","timespan","tasks","content"],"mappings":";AAAa,MAAAA,IAAoB,CAACC,MAChCA,EACG,YAAA,EACA,MAAM,GAAG,EACT,IAAI,CAACC,MAAYA,EAAQ,OAAO,CAAC,EAAE,gBAAgBA,EAAQ,MAAM,CAAC,CAAC,EACnE,KAAK,EAAE,GAMCC,IAAsB,CAACC,MAClCA,EACG,QAAQ,aAAa,EAAE,EACvB,QAAQ,OAAO,GAAG,EAClB,QAAQ,WAAW,GAAG,EACtB,KAAK;ACkBM,SAAAC,EACdC,GACAC,GACyB;AAClB,SAAAD,EAAW,OAAO,CAACE,MACpB,EAAAA,EAAE,aAAa,MACfD,KAAA,QAAAA,EAAmB,SAASC,EAAE,SAEnC;AACH;AAKO,SAASC,EAAqBC,GAAiD;AACpF,QAAMC,IAAUD,EAAU,SACpBE,IAAaZ,EAAkBW,CAAO,GAEtCE,KAAoBH,EAAU,cAAc,CAAA,GAAI,OAAO,CAACI,MAAM,CAACA,EAAE,QAAQ,GACzEC,KAAgBL,EAAU,UAAU,CAAA,GAAI,OAAO,CAACM,MAAM,CAACA,EAAE,QAAQ,GAEjEC,IAA6BJ,EAAiB,IAAI,CAACK,MAAU;;AAAA;AAAA,MACjE,MAAMA,EAAK;AAAA,MACX,MAAMf,IAAoBgB,IAAAD,EAAK,gBAAL,gBAAAC,EAAkB,aAAY,KAAK;AAAA,MAC7D,OAAMC,KAAAC,IAAAH,EAAK,SAAL,gBAAAG,EAAW,SAAX,gBAAAD,EAAiB;AAAA,IAAK;AAAA,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str: string) => string;
|
|
2
|
+
/**
|
|
3
|
+
* Normalizes a type string by removing single-line comments and collapsing whitespace.
|
|
4
|
+
* This is necessary because multiline types with comments would break when collapsed to a single line.
|
|
5
|
+
*/
|
|
6
|
+
export declare const normalizeTypeString: (type: string) => string;
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@stencil/types-output-target",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Generate native TypeScript type definitions for using Stencil web components in various frameworks (React, Vue, Svelte, Solid, Preact).",
|
|
5
|
+
"author": "Ionic Team",
|
|
6
|
+
"homepage": "https://stenciljs.com/",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"bugs": {
|
|
9
|
+
"url": "https://github.com/stenciljs/output-targets/issues"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist/"
|
|
13
|
+
],
|
|
14
|
+
"publishConfig": {
|
|
15
|
+
"access": "public"
|
|
16
|
+
},
|
|
17
|
+
"main": "./dist/index.js",
|
|
18
|
+
"module": "./dist/index.js",
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"type": "module",
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"import": "./dist/index.js",
|
|
25
|
+
"require": "./dist/index.cjs"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"prepublishOnly": "pnpm run build",
|
|
30
|
+
"build": "vite build",
|
|
31
|
+
"dev": "vite build --watch",
|
|
32
|
+
"version": "pnpm run build",
|
|
33
|
+
"prettier": "prettier \"./src/**/*.{html,ts,tsx,js,jsx}\" --write",
|
|
34
|
+
"release": "np",
|
|
35
|
+
"test": "vitest run",
|
|
36
|
+
"test.watch": "vitest --watch",
|
|
37
|
+
"coverage": "vitest run --coverage"
|
|
38
|
+
},
|
|
39
|
+
"repository": {
|
|
40
|
+
"type": "git",
|
|
41
|
+
"url": "git+https://github.com/stenciljs/output-targets.git"
|
|
42
|
+
},
|
|
43
|
+
"peerDependencies": {
|
|
44
|
+
"@stencil/core": ">=3 || >= 4.0.0-beta.0 || >= 4.0.0"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@stencil/core": "4.41.0",
|
|
48
|
+
"@types/node": "^20.14.12",
|
|
49
|
+
"typescript": "^5.4.4",
|
|
50
|
+
"vite": "^5.0.0",
|
|
51
|
+
"vite-plugin-dts": "^3.8.1"
|
|
52
|
+
},
|
|
53
|
+
"peerDependenciesMeta": {
|
|
54
|
+
"@stencil/core": {
|
|
55
|
+
"optional": false
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|