@cleanweb/oore 1.2.0-alpha.3 → 1.2.0-alpha.5

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.
@@ -1,19 +1,18 @@
1
- import type { ReactElement, ReactNode, JSXElementConstructor, FunctionComponent } from 'react';
1
+ import type { ReactElement, ReactNode, JSXElementConstructor } from 'react';
2
2
  export type TComponent = JSXElementConstructor<any>;
3
3
  export type TSlotName = keyof any;
4
4
  export type TSlotAlias = keyof any;
5
5
  export type TSlotsRecord<TKey extends TSlotAlias = TSlotAlias> = {
6
6
  [Key in TKey]: (string | SlotComponent);
7
7
  };
8
- export interface DisplayNamedComponent<TProps extends any = any> extends FunctionComponent<TProps> {
9
- displayName: string;
10
- }
11
- export interface SlotNamedComponent<TProps extends any = any, TSlotNameArg extends TSlotName = TSlotName> {
12
- (props: TProps): ReactNode;
8
+ export type DisplayNamedComponent<TComponentArg extends TComponent = TComponent, TDisplayNameArg extends string = string> = TComponentArg & {
9
+ displayName: TDisplayNameArg;
10
+ };
11
+ export type SlotNamedComponent<TComponentArg extends TComponent = TComponent, TSlotNameArg extends TSlotName = TSlotName> = TComponentArg & {
13
12
  slotName: TSlotNameArg;
14
- }
15
- export type SlotComponent<Component extends TComponent = TComponent> = SlotNamedComponent | DisplayNamedComponent<Component>;
16
- export type SlottedComponent<TComponentArg extends (props: unknown) => ReactNode, TSlotAliasArg extends TSlotAlias = TSlotAlias, TSlotsRecordArg extends TSlotsRecord<TSlotAliasArg> = TSlotsRecord<TSlotAliasArg>> = TComponentArg & {
13
+ };
14
+ export type SlotComponent<TComponentArg extends TComponent = TComponent> = SlotNamedComponent<TComponentArg> | DisplayNamedComponent<TComponentArg>;
15
+ export type SlottedComponent<TComponentArg extends TComponent = TComponent, TSlotAliasArg extends TSlotAlias = TSlotAlias, TSlotsRecordArg extends TSlotsRecord<TSlotAliasArg> = TSlotsRecord<TSlotAliasArg>> = TComponentArg & {
17
16
  Slots: TSlotsRecordArg;
18
17
  };
19
18
  export type TSlotNodes<TSlotAliasArg extends TSlotAlias> = {
@@ -1,4 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- ;
4
- ;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cleanweb/oore",
3
- "version": "1.2.0-alpha.3",
3
+ "version": "1.2.0-alpha.5",
4
4
  "description": "A library of helpers for writing cleaner React function components with object-oriented patterns.",
5
5
  "engines": {
6
6
  "node": ">=20"