Skip to content

Commit

Permalink
fix: support exactOptionalPropertyTypes
Browse files Browse the repository at this point in the history
  • Loading branch information
mskelton committed Sep 20, 2023
1 parent b603611 commit ce86970
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,24 +152,24 @@ export type TVProps<
? ClassProp<ClassValue>
: {
[K in keyof V]?: isTrueOrArray<C["responsiveVariants"]> extends true
? StringToBoolean<keyof V[K]> | TVScreenPropsValue<V, S, K, C>
: StringToBoolean<keyof V[K]>;
? StringToBoolean<keyof V[K]> | TVScreenPropsValue<V, S, K, C> | undefined
: StringToBoolean<keyof V[K]> | undefined;
} & ClassProp<ClassValue>
: V extends undefined
? {
[K in keyof EV]?: isTrueOrArray<C["responsiveVariants"]> extends true
? StringToBoolean<keyof EV[K]> | TVScreenPropsValue<EV, ES, K, C>
: StringToBoolean<keyof EV[K]>;
? StringToBoolean<keyof EV[K]> | TVScreenPropsValue<EV, ES, K, C> | undefined
: StringToBoolean<keyof EV[K]> | undefined;
} & ClassProp<ClassValue>
: {
[K in keyof V | keyof EV]?: isTrueOrArray<C["responsiveVariants"]> extends true
?
| (K extends keyof V ? StringToBoolean<keyof V[K]> : never)
| (K extends keyof EV ? StringToBoolean<keyof EV[K]> : never)
| (K extends keyof V ? StringToBoolean<keyof V[K]> | undefined : never)
| (K extends keyof EV ? StringToBoolean<keyof EV[K]> | undefined : never)
| TVScreenPropsValue<EV & V, S, K, C>
:
| (K extends keyof V ? StringToBoolean<keyof V[K]> : never)
| (K extends keyof EV ? StringToBoolean<keyof EV[K]> : never);
| (K extends keyof V ? StringToBoolean<keyof V[K]> | undefined : never)
| (K extends keyof EV ? StringToBoolean<keyof EV[K]> | undefined : never);
} & ClassProp<ClassValue>;

export type TVVariantKeys<V extends TVVariants<S>, S extends TVSlots> = V extends Object
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"include": ["**/*.ts"],
"exclude": ["node_modules", "dist"],
"compilerOptions": {
"types": ["jest"],
"target": "esnext",
"module": "esnext",
"isolatedModules": true,
Expand Down

0 comments on commit ce86970

Please sign in to comment.