Skip to content

Commit 29bc378

Browse files
committed
fix: declaration file
1 parent d6dbdc7 commit 29bc378

File tree

6 files changed

+22
-24
lines changed

6 files changed

+22
-24
lines changed

package.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@
2828
},
2929
"files": [
3030
"dist/",
31-
"src/index.d.ts"
31+
"types/index.d.ts"
3232
],
3333
"main": "dist/index.js",
34-
"types": "src/index.d.ts",
34+
"types": "types/index.d.ts",
3535
"scripts": {
3636
"build": "tsc",
3737
"test": "jest",
@@ -68,8 +68,5 @@
6868
},
6969
"publishConfig": {
7070
"registry": "https://registry.npmjs.org"
71-
},
72-
"dependencies": {
73-
"ionic-react-header-parallax": "^0.0.5"
7471
}
7572
}

src/index.d.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
export { useIonHeaderParallax } from './useIonicHeaderParallax'
2-
export type { UseIonHeaderParallaxInputResult, UseIonicHeaderParallaxInput } from './useIonicHeaderParallax'
2+
export type { UseIonHeaderParallaxInputResult, UseIonHeaderParallaxInput } from './useIonicHeaderParallax'

src/useIonicHeaderParallax.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react'
22

3-
export type UseIonicHeaderParallaxInput = {
3+
export type UseIonHeaderParallaxInput = {
44
image: string
55
expandedColor: string
66
titleColor: string
@@ -17,7 +17,7 @@ export function useIonHeaderParallax({
1717
image,
1818
expandedColor,
1919
maximumHeight = 300,
20-
}: UseIonicHeaderParallaxInput): UseIonHeaderParallaxInputResult {
20+
}: UseIonHeaderParallaxInput): UseIonHeaderParallaxInputResult {
2121
const headerRef = React.useRef<HTMLElement>(null)
2222

2323
let header: HTMLElement

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,6 @@
6969
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
7070
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
7171
},
72-
"include": ["src"],
72+
"include": ["src", "types/index.d.ts"],
7373
"exclude": ["node_modules", "src/**/*.spec.tsx", "src/**/*.spec.ts"]
7474
}

types/index.d.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
export type UseIonHeaderParallaxInput = {
2+
image: string
3+
expandedColor: string
4+
titleColor: string
5+
maximumHeight?: number
6+
}
7+
8+
export type UseIonHeaderParallaxInputResult = {
9+
ref: React.MutableRefObject<HTMLElement | null>
10+
onScroll: () => void
11+
}
12+
13+
14+
export function useIonHeaderParallax(input: UseIonHeaderParallaxInput): UseIonHeaderParallaxInputResult;
15+
16+

0 commit comments

Comments
 (0)