Skip to content

Commit

Permalink
feat(*): export helper types
Browse files Browse the repository at this point in the history
  • Loading branch information
cschroeter committed May 22, 2024
1 parent 110cdcf commit 29bde01
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 3 deletions.
4 changes: 4 additions & 0 deletions packages/react/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ description: All notable changes will be documented in this file.

## [Unreleased]

### Added

- Exported `Assign` and `Optional` types.

### Changed

- Renamed `Environment` to `EnvironmentProvider` for consistency with other providers.
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from './components'
export * from './providers'
export type { Assign, Optional } from './types'
4 changes: 4 additions & 0 deletions packages/solid/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ description: All notable changes will be documented in this file.

## [Unreleased]

### Added

- Exported `Assign` and `Optional` types.

## [3.0.0-6] - 2024-05-19

### Changed
Expand Down
1 change: 1 addition & 0 deletions packages/solid/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from './components'
export * from './providers'
export type { Assign, Optional } from './types'
4 changes: 1 addition & 3 deletions packages/solid/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
type DistributiveOmit<T, K extends keyof any> = T extends any ? Omit<T, K> : never
export type Assign<T, U> = DistributiveOmit<T, keyof U> & U
export type Assign<T, U> = Omit<T, keyof U> & U
export type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>

export type CollectionItem = string | object
4 changes: 4 additions & 0 deletions packages/vue/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ description: All notable changes will be documented in this file.

## [Unreleased]

### Added

- Exported `Assign` and `Optional` types.

### Changed

- Renamed `Environment` to `EnvironmentProvider` for consistency with other providers.
Expand Down
1 change: 1 addition & 0 deletions packages/vue/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './components'
export * from './providers'
export { useEmitAsProps, useForwardProps, useForwardPropsEmits, useId } from './utils'
export type { Assign, Optional } from './types'
1 change: 1 addition & 0 deletions packages/vue/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* Type to make properties optional and preserve their type
*/
export type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>
export type Assign<T, U> = Omit<T, keyof U> & U

export type EmitFn<T> = <K extends keyof T>(
event: K,
Expand Down

0 comments on commit 29bde01

Please sign in to comment.