Skip to content

Commit b6d818e

Browse files
committedAug 29, 2023
type: fix type error.
1 parent f1cdcb8 commit b6d818e

File tree

7 files changed

+68
-63
lines changed

7 files changed

+68
-63
lines changed
 

‎core/coverage.d.ts

+12-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
declare module '@uiw/react-shields/coverage' {
2-
import Container from '@uiw/react-shields/esm/common/Container';
3-
import Coverages from '@uiw/react-shields/esm/coverages/Coverages';
4-
import Codacy from '@uiw/react-shields/esm/coverages/Codacy';
5-
type CoverageComponent = typeof Container & {
6-
Coverages: typeof Coverages;
7-
Codacy: typeof Codacy;
2+
import { ContainerProps } from '@uiw/react-shields/esm/common/Container';
3+
4+
const Coverage: {
5+
(props: ContainerProps): import('react/jsx-runtime').JSX.Element;
6+
Coverages: import('react').ForwardRefExoticComponent<
7+
import('@uiw/react-shields/esm/coverages/Coverages').CoveragesProps &
8+
import('react').RefAttributes<HTMLImageElement>
9+
>;
10+
Codacy: import('react').ForwardRefExoticComponent<
11+
import('@uiw/react-shields/esm/coverages/Codacy').CodacyProps & import('react').RefAttributes<HTMLImageElement>
12+
>;
13+
displayName: string;
814
};
9-
const Coverage: CoverageComponent;
1015
export default Coverage;
1116
}

‎core/github.d.ts

+28-19
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,32 @@
11
declare module '@uiw/react-shields/github' {
2-
import Container from '@uiw/react-shields/esm/common/Container';
3-
import Issues from '@uiw/react-shields/esm/github/Issues';
4-
import Size from '@uiw/react-shields/esm/github/Size';
5-
import Downloads from '@uiw/react-shields/esm/github/Downloads';
6-
import Activity from '@uiw/react-shields/esm/github/Activity';
7-
import Version from '@uiw/react-shields/esm/github/Version';
8-
import License from '@uiw/react-shields/esm/github/License';
9-
import Analysis from '@uiw/react-shields/esm/github/Analysis';
10-
import Social from '@uiw/react-shields/esm/github/Social';
11-
type GithubComponent = typeof Container & {
12-
Issues: typeof Issues;
13-
Size: typeof Size;
14-
Downloads: typeof Downloads;
15-
License: typeof License;
16-
Activity: typeof Activity;
17-
Analysis: typeof Analysis;
18-
Version: typeof Version;
19-
Social: typeof Social;
2+
import { ContainerProps } from '@uiw/react-shields/esm/common/Container';
3+
const Github: {
4+
(props: ContainerProps): import('react/jsx-runtime').JSX.Element;
5+
Issues: import('react').ForwardRefExoticComponent<
6+
import('@uiw/react-shields/esm/github/Issues').IssuesProps & import('react').RefAttributes<HTMLImageElement>
7+
>;
8+
Size: import('react').ForwardRefExoticComponent<
9+
import('@uiw/react-shields/esm/github/Size').SizeProps & import('react').RefAttributes<HTMLImageElement>
10+
>;
11+
Downloads: import('react').ForwardRefExoticComponent<
12+
import('@uiw/react-shields/esm/github/Downloads').DownloadsProps & import('react').RefAttributes<HTMLImageElement>
13+
>;
14+
License: import('react').ForwardRefExoticComponent<
15+
import('@uiw/react-shields/esm/github/License').LicenseProps & import('react').RefAttributes<HTMLImageElement>
16+
>;
17+
Activity: import('react').ForwardRefExoticComponent<
18+
import('@uiw/react-shields/esm/github/Activity').ActivityProps & import('react').RefAttributes<HTMLImageElement>
19+
>;
20+
Analysis: import('react').ForwardRefExoticComponent<
21+
import('@uiw/react-shields/esm/github/Analysis').AnalysisProps & import('react').RefAttributes<HTMLImageElement>
22+
>;
23+
Version: import('react').ForwardRefExoticComponent<
24+
import('@uiw/react-shields/esm/github/Version').VersionProps & import('react').RefAttributes<HTMLImageElement>
25+
>;
26+
Social: import('react').ForwardRefExoticComponent<
27+
import('@uiw/react-shields/esm/github/Social').SocialProps & import('react').RefAttributes<HTMLImageElement>
28+
>;
29+
displayName: string;
2030
};
21-
const Github: GithubComponent;
2231
export default Github;
2332
}

‎core/npm.d.ts

+13-9
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
declare module '@uiw/react-shields/npm' {
2-
import Container from '@uiw/react-shields/esm/common/Container';
3-
import Version from '@uiw/react-shields/esm/npm/Version';
4-
import Size from '@uiw/react-shields/esm/npm/Size';
5-
import Downloads from '@uiw/react-shields/esm/npm/Downloads';
6-
type NpmComponent = typeof Container & {
7-
Version: typeof Version;
8-
Size: typeof Size;
9-
Downloads: typeof Downloads;
2+
import { ContainerProps } from '@uiw/react-shields/esm/common/Container';
3+
const Npm: {
4+
(props: ContainerProps): import('react/jsx-runtime').JSX.Element;
5+
Version: import('react').ForwardRefExoticComponent<
6+
import('@uiw/react-shields/esm/npm/Version').VersionProps & import('react').RefAttributes<HTMLImageElement>
7+
>;
8+
Size: import('react').ForwardRefExoticComponent<
9+
import('@uiw/react-shields/esm/npm/Size').SizeProps & import('react').RefAttributes<HTMLImageElement>
10+
>;
11+
Downloads: import('react').ForwardRefExoticComponent<
12+
import('@uiw/react-shields/esm/npm/Downloads').DownloadProps & import('react').RefAttributes<HTMLImageElement>
13+
>;
14+
displayName: string;
1015
};
11-
const Npm: NpmComponent;
1216
export default Npm;
1317
}

‎core/src/coverages/index.tsx

+1-6
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,7 @@ import Container, { ContainerProps } from '../common/Container';
22
import Coverages from './Coverages';
33
import Codacy from './Codacy';
44

5-
type CoverageComponent = typeof Container & {
6-
Coverages: typeof Coverages;
7-
Codacy: typeof Codacy;
8-
};
9-
10-
const Coverage = (props: ContainerProps) => (<Container {...props} />) as unknown as CoverageComponent;
5+
const Coverage = (props: ContainerProps) => <Container {...props} />;
116
Coverage.Coverages = Coverages;
127
Coverage.Codacy = Codacy;
138
Coverage.displayName = 'Github';

‎core/src/github/index.tsx

+1-12
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,7 @@ import Version from './Version';
88
import Analysis from './Analysis';
99
import Social from './Social';
1010

11-
type GithubComponent = typeof Container & {
12-
Issues: typeof Issues;
13-
Size: typeof Size;
14-
Downloads: typeof Downloads;
15-
License: typeof License;
16-
Activity: typeof Activity;
17-
Analysis: typeof Analysis;
18-
Version: typeof Version;
19-
Social: typeof Social;
20-
};
21-
22-
const Github = (props: ContainerProps) => (<Container {...props} />) as unknown as GithubComponent;
11+
const Github = (props: ContainerProps) => <Container {...props} />;
2312

2413
Github.Issues = Issues;
2514
Github.Size = Size;

‎core/src/npm/index.tsx

+1-7
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,7 @@ import Version from './Version';
33
import Size from './Size';
44
import Downloads from './Downloads';
55

6-
type NpmComponent = typeof Container & {
7-
Version: typeof Version;
8-
Size: typeof Size;
9-
Downloads: typeof Downloads;
10-
};
11-
12-
const Npm = (props: ContainerProps) => (<Container {...props} />) as unknown as NpmComponent;
6+
const Npm = (props: ContainerProps) => <Container {...props} />;
137

148
Npm.Version = Version;
159
Npm.Size = Size;

‎www/src/index.tsx

+12-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { createRoot } from 'react-dom/client';
22
import MarkdownPreviewExample from '@uiw/react-markdown-preview-example';
3-
// import Github from '@uiw/react-shields/github';
4-
// import Npm from '@uiw/react-shields/npm';
3+
import Github from '@uiw/react-shields/github';
4+
import Npm from '@uiw/react-shields/npm';
55
import data from '../../core/README.md';
66
import pkg from '../../core/package.json';
77

@@ -21,7 +21,16 @@ root.render(
2121
>
2222
<GithubEx href="https://github.com/uiwjs/react-shields" />
2323
<Example>
24-
<div></div>
24+
<div>
25+
<Github.Social user="jaywcjlove" repo="uiw" href="https://github.com/jaywcjlove" />
26+
<Github user="uiwjs" repo="react-shields">
27+
<Github.Social type="forks" />
28+
<Github.Social type="stars" />
29+
<Github.Social type="watchers" />
30+
<Github.Social type="followers" />
31+
<Npm.Version scope="@uiw" packageName="react-shields" />
32+
</Github>
33+
</div>
2534
</Example>
2635
</MarkdownPreviewExample>,
2736
);

0 commit comments

Comments
 (0)
Please sign in to comment.