Skip to content

Commit

Permalink
🏷️ chore: 优化类型定义
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Feb 2, 2023
1 parent ceca23d commit 239158a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/functions/createGlobalStyle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { serializeStyles } from '@emotion/serialize';
import { memo } from 'react';

import { useTheme } from '@/hooks';
import { CSSStyle, StyledTheme } from '@/types';
import { CSSStyle, Theme } from '@/types';

export interface GlobalTheme {
theme: StyledTheme;
theme: Theme;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/functions/createStyles/response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { reactCss } from '@/pedestal';
import type { Breakpoint, BreakpointMapParams, CSSObject, ResponsiveMap } from '@/types';
import { isReactCssResult } from '@/utils';
import { convertBreakpointToResponsive } from '@/utils/responsive';
import type { SerializedStyles } from '@emotion/react';
import type { SerializedStyles } from '@emotion/serialize';
import { useMemo } from 'react';

export const useMediaQueryMap = (): ResponsiveMap => {
Expand Down
5 changes: 0 additions & 5 deletions src/types/function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ export interface EmotionReactCss {
(...args: Array<CSSInterpolation>): SerializedStyles;
}

export interface UtilReactCss {
(template: TemplateStringsArray, ...args: Array<CSSInterpolation>): string;
(...args: Array<CSSInterpolation>): string;
}

export type EmotionCX = (...classNames: ClassNamesArg[]) => string;

export type BreakpointMapParams = Partial<Record<ResponsiveKey, AtomInputType>>;
Expand Down
5 changes: 2 additions & 3 deletions src/types/styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ import * as React from 'react';

import { Theme } from './theme';

export type StyledTheme = Omit<Theme, 'stylish'>;

export type StyledTags = {
[Tag in keyof JSX.IntrinsicElements]: CreateStyledComponent<
{
theme?: StyledTheme;
theme?: Theme;
as?: React.ElementType;
},
JSX.IntrinsicElements[Tag]
Expand Down Expand Up @@ -93,4 +91,5 @@ export interface CreateStyled {
options?: StyledOptions<JSX.IntrinsicElements[Tag]>,
): CreateStyledComponent<{ theme?: Theme; as?: React.ElementType }, JSX.IntrinsicElements[Tag]>;
}

export interface CreateStyled extends BaseCreateStyled, StyledTags {}

0 comments on commit 239158a

Please sign in to comment.