Skip to content

Commit

Permalink
type: fix eslint warning about typing
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 committed Sep 2, 2023
1 parent d0a35f9 commit fca94d3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
3 changes: 2 additions & 1 deletion packages/icons-react/src/components/AntdIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import { blue } from '@ant-design/colors';
import Context from './Context';
import type { IconBaseProps } from './Icon';
import ReactIcon from './IconBase';
import { getTwoToneColor, TwoToneColor, setTwoToneColor } from './twoTonePrimaryColor';
import { getTwoToneColor, setTwoToneColor } from './twoTonePrimaryColor';
import type { TwoToneColor } from './twoTonePrimaryColor';
import { normalizeTwoToneColors } from '../utils';

export interface AntdIconProps extends IconBaseProps {
Expand Down
2 changes: 1 addition & 1 deletion packages/icons-react/src/components/IconBase.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { AbstractNode, IconDefinition } from '@ant-design/icons-svg/lib/types';
import type { AbstractNode, IconDefinition } from '@ant-design/icons-svg/lib/types';
import { generate, getSecondaryColor, isIconDefinition, warning, useInsertStyles } from '../utils';

export interface IconProps {
Expand Down
5 changes: 3 additions & 2 deletions packages/icons-react/src/components/IconFont.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import * as React from 'react';
import Icon, { IconBaseProps } from './Icon';
import Icon from './Icon';
import type { IconBaseProps } from './Icon';

const customCache = new Set<string>();

export interface CustomIconOptions {
scriptUrl?: string | string[];
extraCommonProps?: { [key: string]: any };
extraCommonProps?: Record<string, unknown>;
}

export interface IconFontProps<T extends string = string> extends IconBaseProps {
Expand Down
6 changes: 2 additions & 4 deletions packages/icons-react/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,12 @@ export function normalizeAttrs(attrs: Attrs = {}): Attrs {
}, {});
}

export interface Attrs {
[key: string]: string;
}
export type Attrs = Record<string, string>;

export function generate(
node: AbstractNode,
key: string,
rootProps?: { [key: string]: any } | false,
rootProps?: Record<string, string> | false,
): any {
if (!rootProps) {
return React.createElement(
Expand Down

0 comments on commit fca94d3

Please sign in to comment.