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

Commit 7d7514f

Browse files
committed
perf(custom-html-type.ts): Separated for inference speed MediaQueryType and MediaQueryHTMLType other refactor.
1 parent 75da063 commit 7d7514f

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/_internal/types/custom/custom-html-type.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,27 @@ import type { CustomCSSProperties } from './custom-css-properties';
22

33
type JSXType = keyof JSX.IntrinsicElements | '*';
44
type HTMLType = {
5-
[K in JSXType]?: CustomCSSProperties;
5+
[K in JSXType]: CustomCSSProperties;
66
};
77

88
type ClassName = `.${string}`;
99
type ClassNameType = {
10-
[K in ClassName]?: CustomCSSProperties;
10+
[K in ClassName]: CustomCSSProperties;
1111
};
1212

1313
type Attribute = `${string}[${string}]${string}`;
1414
type AttributeType = {
15-
[K in Attribute]?: CustomCSSProperties;
15+
[K in Attribute]: CustomCSSProperties;
1616
};
1717

1818
type Consecutive = `${JSXType} ${string}`;
1919
type ConsecutiveType = {
20-
[K in Consecutive]?: CustomCSSProperties;
20+
[K in Consecutive]: CustomCSSProperties;
2121
};
2222

2323
type Pseudo = `${JSXType}:${string}`;
2424
type PseudoType = {
25-
[K in Pseudo]?: CustomCSSProperties;
25+
[K in Pseudo]: CustomCSSProperties;
2626
};
2727

2828
type KeyframeSelector = 'from' | 'to' | `${number}%`;
@@ -31,13 +31,17 @@ type KeyframesDefinition = {
3131
[K in KeyframeSelector]?: CustomCSSProperties;
3232
};
3333

34-
type AtKeyframes = {
34+
type KeyframesType = {
3535
[K in `@keyframes ${string}`]: KeyframesDefinition;
3636
};
3737

3838
export type MediaQuery = `@media ${string}`;
3939
export type MediaQueryType = {
40-
[key in MediaQuery]?: CustomCSSProperties | CustomHTMLType;
40+
[K in MediaQuery]: CustomCSSProperties;
4141
};
4242

43-
export type CustomHTMLType = HTMLType | ClassNameType | AttributeType | ConsecutiveType | PseudoType | AtKeyframes | MediaQueryType;
43+
type MediaQueryHTMLType = {
44+
[K in MediaQuery]: CustomHTMLType;
45+
};
46+
47+
export type CustomHTMLType = HTMLType | ClassNameType | AttributeType | ConsecutiveType | PseudoType | KeyframesType | MediaQueryHTMLType;

0 commit comments

Comments
 (0)