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

Commit 1d82cdc

Browse files
committed
perf(*): Remove union types to speed up autocomplete
1 parent 7897f73 commit 1d82cdc

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/core/media-query.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { CustomCSSProperties, ClassesObjectType, ExactClassesObjectType } from '../_internal';
22

33
export const media = (query: string, secondary?: string) => {
4-
return <T extends ClassesObjectType>(object: ExactClassesObjectType<T> | ClassesObjectType | CustomCSSProperties): ClassesObjectType => {
4+
return <T extends ClassesObjectType>(object: ExactClassesObjectType<T> | CustomCSSProperties): ClassesObjectType => {
55
const mediaQuery = `@media (${query}${secondary ? ' and ' + secondary : ''})`;
66

77
return { [mediaQuery]: object };

src/core/method/create.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { sheetCompiler, isInDevelopment, injectCSS, genBase62Hash } from '../../
33
import styles from '../styles/style.module.css';
44
import { createGlobalStyleSheetPromise, globalStyleSheetPromise, resolveGlobalStyleSheet } from './create-build-in-helper';
55

6-
export function create<T extends ClassesObjectType>(object: ExactClassesObjectType<T> | ClassesObjectType): ReturnStyleType<T> {
6+
export function create<T extends ClassesObjectType>(object: ExactClassesObjectType<T>): ReturnStyleType<T> {
77
const base62Hash = genBase62Hash(object, 5);
88
const { styleSheet } = sheetCompiler(object, base62Hash);
99
if (typeof globalStyleSheetPromise === 'undefined') createGlobalStyleSheetPromise();

src/core/style.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { global } from './method/global';
55
import { root } from './method/root';
66

77
export class Style {
8-
static create<T extends ClassesObjectType>(object: ExactClassesObjectType<T> | ClassesObjectType): ReturnStyleType<T> {
8+
static create<T extends ClassesObjectType>(object: ExactClassesObjectType<T>): ReturnStyleType<T> {
99
return create(object);
1010
}
1111
static set(object: CustomCSSProperties): string {

0 commit comments

Comments
 (0)