Skip to content

Commit 853cfd0

Browse files
committed
chore: update ts config
1 parent 1cce98e commit 853cfd0

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

src/index.tsx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1-
import Gallery from './Gallery';
1+
import type { GalleryRef, GalleryProps, ImageViewerProps } from './Type';
2+
import type { ComponentType } from 'react';
23

3-
export { default as ImageViewer } from './ImageViewer';
4-
export type { GalleryRef, GalleryProps, ImageViewerProps } from './Type';
5-
export default Gallery;
4+
export type { GalleryRef, GalleryProps, ImageViewerProps };
5+
6+
import GalleryImpl from './Gallery';
7+
import ImageViewerImpl from './ImageViewer';
8+
9+
const GalleryComponent: ComponentType<GalleryProps> = GalleryImpl;
10+
const ImageViewerComponent: ComponentType<ImageViewerProps> = ImageViewerImpl;
11+
12+
export { ImageViewerComponent as ImageViewer };
13+
export default GalleryComponent;

tsconfig.build.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{
2-
"extends": "./tsconfig",
2+
"extends": "./tsconfig.json",
33
"compilerOptions": {
44
"declaration": true,
55
"declarationDir": "lib/typescript",
66
"emitDeclarationOnly": true,
7-
"noEmit": false
7+
"noEmit": false,
8+
"declarationMap": true
89
},
910
"exclude": ["**/__tests__", "**/*.test.ts", "example"]
1011
}

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
"target": "ESNext",
2828
"verbatimModuleSyntax": true,
2929
"declaration": true,
30-
"declarationDir": "./lib/typescript"
30+
"declarationDir": "./lib/typescript",
31+
"declarationMap": true
3132
},
3233
"include": ["src"],
3334
"exclude": ["example", "lib", "node_modules"]

0 commit comments

Comments
 (0)