Skip to content

Commit

Permalink
Merge pull request #156 from break-stuff/fix-union-types
Browse files Browse the repository at this point in the history
update to use intersection types
  • Loading branch information
break-stuff authored Oct 10, 2024
2 parents 66cce8e + 0b65896 commit 3da36e4
Show file tree
Hide file tree
Showing 14 changed files with 32 additions and 11 deletions.
8 changes: 4 additions & 4 deletions demo/lit-app/custom-elements-svelte.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export type CustomElements = {
* ### **CSS Parts:**
* - **radio-label** - Applies custom styles the radio group label
*/
"radio-group": Partial<RadioGroupProps | BaseProps | BaseEvents>;
"radio-group": Partial<RadioGroupProps & BaseProps & BaseEvents>;

/**
* Radio buttons allow users to select a single option from a group. Here is its [documentation](https://my-site.com/documentation).
Expand All @@ -162,7 +162,7 @@ export type CustomElements = {
* ### **Slots:**
* - _default_ - add text here to label your radio button
*/
"radio-button": Partial<RadioButtonProps | BaseProps | BaseEvents>;
"radio-button": Partial<RadioButtonProps & BaseProps & BaseEvents>;

/**
* @deprecated An example of a deprecated element
Expand All @@ -172,7 +172,7 @@ export type CustomElements = {
*
*/
"deprecated-element": Partial<
DeprecatedElementProps | BaseProps | BaseEvents
DeprecatedElementProps & BaseProps & BaseEvents
>;

/**
Expand All @@ -181,7 +181,7 @@ export type CustomElements = {
* ---
*
*/
"my-button": Partial<MyButtonProps | BaseProps | BaseEvents>;
"my-button": Partial<MyButtonProps & BaseProps & BaseEvents>;
};

declare namespace svelteHTML {
Expand Down
4 changes: 4 additions & 0 deletions packages/jsx-integration/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## 1.5.3

- Updated to use intersection types rather than union types

## 1.5.2

- Fixed async file output
Expand Down
2 changes: 1 addition & 1 deletion packages/jsx-integration/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "custom-element-jsx-integration",
"version": "1.5.2",
"version": "1.5.3",
"description": "Tools for integrating custom elements into JSX projects",
"main": "index.js",
"module": "index.js",
Expand Down
4 changes: 4 additions & 0 deletions packages/react-wrappers/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## 1.6.8

- Updated to import `React` in types

## 1.6.7

- Fixed binding for custom event listener
Expand Down
2 changes: 1 addition & 1 deletion packages/react-wrappers/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "custom-element-react-wrappers",
"version": "1.6.7",
"version": "1.6.8",
"description": "A tool for generating react-compatible wrappers for custom elements",
"main": "index.js",
"module": "index.js",
Expand Down
1 change: 1 addition & 0 deletions packages/react-wrappers/src/wrapper-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ function getTypeDefinitionTemplate(
const eventTypes = getCustomEventTypes(component);

return `
import React from "react";
import {
${config.defaultExport ? "default" : component.name} as ${
component.name
Expand Down
4 changes: 4 additions & 0 deletions packages/solidjs-integration/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## 1.8.2

- Updated to use intersection types rather than union types

## 1.8.1

- Fixed async file output
Expand Down
2 changes: 1 addition & 1 deletion packages/solidjs-integration/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "custom-element-solidjs-integration",
"version": "1.8.1",
"version": "1.8.2",
"description": "Tools for integrating custom elements into SolidJS",
"main": "index.js",
"module": "index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/solidjs-integration/src/type-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ ${components
*/
"${options.prefix}${component.tagName}${options.suffix}": Partial<${
component.name
}Props | BaseProps | BaseEvents>;`;
}Props & BaseProps & BaseEvents>;`;
})
.join("\n")}
}
Expand Down
4 changes: 4 additions & 0 deletions packages/svelte-integration/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## 1.1.2

- Updated to use intersection types rather than union types

## 1.1.1

- Fixed async file output
Expand Down
2 changes: 1 addition & 1 deletion packages/svelte-integration/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "custom-element-svelte-integration",
"version": "1.1.1",
"version": "1.1.2",
"description": "Tools for integrating custom elements into a Svelte project",
"main": "index.js",
"module": "index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/svelte-integration/src/type-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ ${components
*/
"${options.prefix}${component.tagName}${options.suffix}": Partial<${
component.name
}Props | BaseProps | BaseEvents>;`;
}Props & BaseProps & BaseEvents>;`;
})
.join("\n")}
}
Expand Down
4 changes: 4 additions & 0 deletions packages/vuejs-integration/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## 1.3.3

- Updated to use intersection types rather than union types

## 1.3.2

- Fixed async file output
Expand Down
2 changes: 1 addition & 1 deletion packages/vuejs-integration/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "custom-element-vuejs-integration",
"version": "1.3.2",
"version": "1.3.3",
"description": "Types for integrating custom elements into Vue.js projects",
"main": "index.js",
"module": "index.js",
Expand Down

0 comments on commit 3da36e4

Please sign in to comment.