Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.

Commit 50c27e8

Browse files
committed
fix(classes-object-type.ts): improve types
1 parent 6a3146c commit 50c27e8

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed
Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
import type { CustomCSSProperties } from './custom-css-properties';
22
import { MediaQuery } from './custom-html-type';
33

4-
export type ClassesObjectType = {
5-
[key in MediaQuery]: {
6-
[className: string]: CustomCSSProperties;
7-
};
8-
};
9-
10-
type Exact<T, U> = T extends U ? T : never;
4+
export type ClassesObjectType = Record<MediaQuery, Record<string, CustomCSSProperties>>;
115

126
export type ExactClassesObjectType<T> = {
13-
[K in keyof T | string]: K extends keyof T ? Exact<T[K], CustomCSSProperties> : CustomCSSProperties;
7+
readonly [K in keyof T | string]: K extends keyof T ? Pick<T, K> : CustomCSSProperties;
148
};
159

1610
export type ReturnStyleType<T> = { [key in keyof T]: string };

0 commit comments

Comments
 (0)