@vitus-labs/rocketstyle 2.2.1 → 2.4.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/lib/index.d.ts +17 -5
- package/package.json +2 -2
package/lib/index.d.ts
CHANGED
|
@@ -81,7 +81,19 @@ type ExtractNullableKeys<T> = { [P in keyof T as IsAny<T[P]> extends true ? P :
|
|
|
81
81
|
type SpreadTwo<L, R> = Id<Pick<L, Exclude<keyof L, keyof R>> & R>;
|
|
82
82
|
type Spread<A extends readonly [...any]> = A extends [infer L, ...infer R] ? SpreadTwo<L, Spread<R>> : unknown;
|
|
83
83
|
type MergeTypes<A extends readonly [...any]> = ExtractNullableKeys<Spread<A>>;
|
|
84
|
-
type ExtractProps<TComponentOrTProps> = TComponentOrTProps extends
|
|
84
|
+
type ExtractProps<TComponentOrTProps> = TComponentOrTProps extends {
|
|
85
|
+
(props: infer P1, ...args: any): any;
|
|
86
|
+
(props: infer P2, ...args: any): any;
|
|
87
|
+
(props: infer P3, ...args: any): any;
|
|
88
|
+
(props: infer P4, ...args: any): any;
|
|
89
|
+
} ? P1 | P2 | P3 | P4 : TComponentOrTProps extends {
|
|
90
|
+
(props: infer P1, ...args: any): any;
|
|
91
|
+
(props: infer P2, ...args: any): any;
|
|
92
|
+
(props: infer P3, ...args: any): any;
|
|
93
|
+
} ? P1 | P2 | P3 : TComponentOrTProps extends {
|
|
94
|
+
(props: infer P1, ...args: any): any;
|
|
95
|
+
(props: infer P2, ...args: any): any;
|
|
96
|
+
} ? P1 | P2 : TComponentOrTProps extends ComponentType<infer TProps> ? TProps : TComponentOrTProps;
|
|
85
97
|
//#endregion
|
|
86
98
|
//#region src/types/styles.d.ts
|
|
87
99
|
interface StylesDefault {}
|
|
@@ -234,7 +246,7 @@ type RocketStyleComponent<OA extends TObj = {}, EA extends TObj = {}, T extends
|
|
|
234
246
|
* @param DKP Dimensions key props.
|
|
235
247
|
* @param DFP Calculated final component props
|
|
236
248
|
*/
|
|
237
|
-
interface IRocketStyleComponent<OA extends TObj = {}, EA extends TObj = {}, T extends TObj = {}, CSS extends TObj = {}, S extends TObj = {}, HOC extends TObj = {}, D extends Dimensions = Dimensions, UB extends boolean = boolean, DKP extends TDKP = TDKP, DFP =
|
|
249
|
+
interface IRocketStyleComponent<OA extends TObj = {}, EA extends TObj = {}, T extends TObj = {}, CSS extends TObj = {}, S extends TObj = {}, HOC extends TObj = {}, D extends Dimensions = Dimensions, UB extends boolean = boolean, DKP extends TDKP = TDKP, DFP = (OA extends infer O ? Omit<O, keyof EA & keyof O> & Partial<Pick<O, keyof EA & keyof O>> & MergeTypes<[Partial<Omit<EA, keyof O>>, DefaultProps, ExtractDimensionProps<D, DKP, UB>]> : never)> {
|
|
238
250
|
(props: DFP & {
|
|
239
251
|
ref?: any;
|
|
240
252
|
}): ReactNode;
|
|
@@ -333,7 +345,7 @@ interface IRocketStyleComponent<OA extends TObj = {}, EA extends TObj = {}, T ex
|
|
|
333
345
|
* }))
|
|
334
346
|
* ```
|
|
335
347
|
*/
|
|
336
|
-
attrs: <P extends TObj
|
|
348
|
+
attrs: <P extends TObj = {}>(param: (P & Partial<NoInfer<DFP>>) | AttrsCb<MergeTypes<[DFP, P]>, Theme<T>>, config?: Partial<{
|
|
337
349
|
/**
|
|
338
350
|
* priority props will be resolved first and overwritten by normal `attrs`
|
|
339
351
|
* callbacks and `props` afterwards
|
|
@@ -342,8 +354,8 @@ interface IRocketStyleComponent<OA extends TObj = {}, EA extends TObj = {}, T ex
|
|
|
342
354
|
/**
|
|
343
355
|
* filter props will be omitted when passing to final component
|
|
344
356
|
*/
|
|
345
|
-
filter:
|
|
346
|
-
}>) =>
|
|
357
|
+
filter: (keyof MergeTypes<[EA, P]>)[];
|
|
358
|
+
}>) => RocketStyleComponent<OA, MergeTypes<[EA, P]>, T, CSS, S, HOC, D, UB, DKP>;
|
|
347
359
|
/**
|
|
348
360
|
* A chaining method to define default component theme
|
|
349
361
|
* @param param Can be either _object_ or a _callback_
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitus-labs/rocketstyle",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Vit Bokisch <vit@bokisch.cz>",
|
|
6
6
|
"maintainers": [
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"typecheck": "tsc --noEmit"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
|
-
"@vitus-labs/core": "^2.
|
|
67
|
+
"@vitus-labs/core": "^2.4.0",
|
|
68
68
|
"react": ">= 19"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|