Skip to content

Commit 330c602

Browse files
committed
types: Change DomAttributes to SVGAttributes
1 parent e08a91c commit 330c602

File tree

12 files changed

+24
-48
lines changed

12 files changed

+24
-48
lines changed

snapshots/demo-js/IconAlipay.d.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
/* eslint-disable */
22

3-
import { CSSProperties, DOMAttributes, FunctionComponent } from 'react';
3+
import { SVGAttributes, FunctionComponent } from 'react';
44

5-
interface Props extends DOMAttributes<SVGElement> {
5+
interface Props extends Omit<SVGAttributes<SVGElement>, 'color'> {
66
size?: number;
77
color?: string | string[];
8-
style?: CSSProperties;
9-
className?: string;
108
}
119

1210
declare const IconAlipay: FunctionComponent<Props>;

snapshots/demo-js/IconSetup.d.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
/* eslint-disable */
22

3-
import { CSSProperties, DOMAttributes, FunctionComponent } from 'react';
3+
import { SVGAttributes, FunctionComponent } from 'react';
44

5-
interface Props extends DOMAttributes<SVGElement> {
5+
interface Props extends Omit<SVGAttributes<SVGElement>, 'color'> {
66
size?: number;
77
color?: string | string[];
8-
style?: CSSProperties;
9-
className?: string;
108
}
119

1210
declare const IconSetup: FunctionComponent<Props>;

snapshots/demo-js/IconUser.d.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
/* eslint-disable */
22

3-
import { CSSProperties, DOMAttributes, FunctionComponent } from 'react';
3+
import { SVGAttributes, FunctionComponent } from 'react';
44

5-
interface Props extends DOMAttributes<SVGElement> {
5+
interface Props extends Omit<SVGAttributes<SVGElement>, 'color'> {
66
size?: number;
77
color?: string | string[];
8-
style?: CSSProperties;
9-
className?: string;
108
}
119

1210
declare const IconUser: FunctionComponent<Props>;

snapshots/demo-js/index.d.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
/* eslint-disable */
22

3-
import { CSSProperties, DOMAttributes, FunctionComponent } from 'react';
3+
import { SVGAttributes, FunctionComponent } from 'react';
44

5-
interface Props extends DOMAttributes<SVGElement> {
5+
interface Props extends Omit<SVGAttributes<SVGElement>, 'color'> {
66
name: 'alipay' | 'user' | 'setup';
77
size?: number;
88
color?: string | string[];
9-
style?: CSSProperties;
10-
className?: string;
119
}
1210

1311
declare const IconFont: FunctionComponent<Props>;

snapshots/demo-ts/IconAlipay.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
/* tslint:disable */
22
/* eslint-disable */
33

4-
import React, { CSSProperties, DOMAttributes, FunctionComponent } from 'react';
4+
import React, { CSSProperties, SVGAttributes, FunctionComponent } from 'react';
55
import { getIconColor } from './helper';
66

7-
interface Props extends DOMAttributes<SVGElement> {
7+
interface Props extends Omit<SVGAttributes<SVGElement>, 'color'> {
88
size?: number;
99
color?: string | string[];
10-
style?: CSSProperties;
11-
className?: string;
1210
}
1311

1412
const DEFAULT_STYLE: CSSProperties = {

snapshots/demo-ts/IconSetup.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
/* tslint:disable */
22
/* eslint-disable */
33

4-
import React, { CSSProperties, DOMAttributes, FunctionComponent } from 'react';
4+
import React, { CSSProperties, SVGAttributes, FunctionComponent } from 'react';
55
import { getIconColor } from './helper';
66

7-
interface Props extends DOMAttributes<SVGElement> {
7+
interface Props extends Omit<SVGAttributes<SVGElement>, 'color'> {
88
size?: number;
99
color?: string | string[];
10-
style?: CSSProperties;
11-
className?: string;
1210
}
1311

1412
const DEFAULT_STYLE: CSSProperties = {

snapshots/demo-ts/IconUser.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
/* tslint:disable */
22
/* eslint-disable */
33

4-
import React, { CSSProperties, DOMAttributes, FunctionComponent } from 'react';
4+
import React, { CSSProperties, SVGAttributes, FunctionComponent } from 'react';
55
import { getIconColor } from './helper';
66

7-
interface Props extends DOMAttributes<SVGElement> {
7+
interface Props extends Omit<SVGAttributes<SVGElement>, 'color'> {
88
size?: number;
99
color?: string | string[];
10-
style?: CSSProperties;
11-
className?: string;
1210
}
1311

1412
const DEFAULT_STYLE: CSSProperties = {

snapshots/demo-ts/index.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
/* tslint:disable */
22
/* eslint-disable */
33

4-
import React, { CSSProperties, DOMAttributes, FunctionComponent } from 'react';
4+
import React, { SVGAttributes, FunctionComponent } from 'react';
55
import IconAlipay from './IconAlipay';
66
import IconUser from './IconUser';
77
import IconSetup from './IconSetup';
88

99
export type IconNames = 'alipay' | 'user' | 'setup';
1010

11-
interface Props extends DOMAttributes<SVGElement> {
11+
interface Props extends Omit<SVGAttributes<SVGElement>, 'color'> {
1212
name: IconNames;
1313
size?: number;
1414
color?: string | string[];
15-
style?: CSSProperties;
16-
className?: string;
1715
}
1816

1917
const IconFont: FunctionComponent<Props> = ({ name, ...rest }) => {

src/templates/Icon.d.ts.template

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
/* eslint-disable */
22

3-
import { CSSProperties, DOMAttributes, FunctionComponent } from 'react';
3+
import { SVGAttributes, FunctionComponent } from 'react';
44

5-
interface Props extends DOMAttributes<SVGElement> {
5+
interface Props extends Omit<SVGAttributes<SVGElement>, 'color'> {
66
name: '#names#';
77
size?: number;
88
color?: string | string[];
9-
style?: CSSProperties;
10-
className?: string;
119
}
1210

1311
declare const IconFont: FunctionComponent<Props>;

src/templates/Icon.tsx.template

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
/* tslint:disable */
22
/* eslint-disable */
33

4-
import React, { CSSProperties, DOMAttributes, FunctionComponent } from 'react';
4+
import React, { SVGAttributes, FunctionComponent } from 'react';
55
#imports#
66

77
export type IconNames = '#names#';
88

9-
interface Props extends DOMAttributes<SVGElement> {
9+
interface Props extends Omit<SVGAttributes<SVGElement>, 'color'> {
1010
name: IconNames;
1111
size?: number;
1212
color?: string | string[];
13-
style?: CSSProperties;
14-
className?: string;
1513
}
1614

1715
const IconFont: FunctionComponent<Props> = ({ name, ...rest }) => {

0 commit comments

Comments
 (0)