@cleanweb/oore 2.0.0-beta.10 → 2.0.0-beta.12
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/build/slots/types.d.ts +6 -6
- package/package.json +1 -1
package/build/slots/types.d.ts
CHANGED
|
@@ -17,10 +17,10 @@ export type TSlotsRecord<TKey extends TSlotAlias = TSlotAlias> = {
|
|
|
17
17
|
export type DisplayNamedComponent<TComponent extends ComponentType<any> = ComponentType<any>, TName extends string = string> = TComponent & {
|
|
18
18
|
displayName: TName;
|
|
19
19
|
};
|
|
20
|
-
interface
|
|
20
|
+
export interface ISlotInfo<TName> {
|
|
21
21
|
slotName: TName;
|
|
22
22
|
/**
|
|
23
|
-
* @deprecated The
|
|
23
|
+
* @deprecated The {@link WithSlotsConfig | Slots Config} should be responsible for indicating which slots it requires.
|
|
24
24
|
* Individual slot components may be reused by multiple slotted components with varying requirements.
|
|
25
25
|
*/
|
|
26
26
|
isRequiredSlot?: boolean;
|
|
@@ -77,7 +77,7 @@ interface ISlotConfig<TName> {
|
|
|
77
77
|
* extracts the props passed to the slot and handles
|
|
78
78
|
* what the slot actually renders.
|
|
79
79
|
*/
|
|
80
|
-
export type SlotComponent<TComponent extends JSXTagLike = ComponentType<any>, TName extends TSlotName = TSlotName> = (TComponent extends string ? TComponent : TComponent &
|
|
80
|
+
export type SlotComponent<TComponent extends JSXTagLike = ComponentType<any>, TName extends TSlotName = TSlotName> = (TComponent extends string ? TComponent : (TComponent & ISlotInfo<TName>));
|
|
81
81
|
/**
|
|
82
82
|
* A parent component which accepts content that can be grouped into predefined slots.
|
|
83
83
|
* By convention, it should have a `slots` property which is a {@link TSlotsRecord}.
|
|
@@ -97,10 +97,10 @@ export type TSlotNode<TConfig extends WithSlotsConfig<object>, Key extends keyof
|
|
|
97
97
|
* A record of slot aliases mapped to the corresponding `ReactNode`(s)
|
|
98
98
|
* to be rendered for that slot.
|
|
99
99
|
*/
|
|
100
|
-
export type TSlotNodes<TSlotted extends WithSlotsConfig
|
|
100
|
+
export type TSlotNodes<TSlotted extends WithSlotsConfig<object>> = {
|
|
101
101
|
[Key in keyof TSlotted['Slots']]?: Array<TSlotNode<TSlotted, Key>>;
|
|
102
102
|
};
|
|
103
|
-
export type TUseSlotsResult<TSlotted extends WithSlotsConfig
|
|
103
|
+
export type TUseSlotsResult<TSlotted extends WithSlotsConfig<object>> = Readonly<[
|
|
104
104
|
/**
|
|
105
105
|
* A record of slot aliases to their corresponding React nodes.
|
|
106
106
|
* Each alias maps to an array of one or more React nodes that were passed
|
|
@@ -120,7 +120,7 @@ export type TUseSlotsResult<TSlotted extends WithSlotsConfig> = Readonly<[
|
|
|
120
120
|
invalidChildren: any[]
|
|
121
121
|
]>;
|
|
122
122
|
export interface IUseSlots {
|
|
123
|
-
<TSlotted extends WithSlotsConfig
|
|
123
|
+
<TSlotted extends WithSlotsConfig<object>>(
|
|
124
124
|
/**
|
|
125
125
|
* Your component's `children` prop.
|
|
126
126
|
* The nodes it contains will be categorized and
|
package/package.json
CHANGED