Skip to content

Commit 872a09b

Browse files
committed
Merge branch 'develop'
2 parents 205e90e + a23696a commit 872a09b

File tree

2 files changed

+52
-2
lines changed

2 files changed

+52
-2
lines changed

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
{
22
"name": "react-scrollmagic",
3-
"version": "2.0.0",
3+
"version": "2.1.0",
44
"description": "React declarative component for ScrollMagic",
55
"author": "bitworking",
66
"license": "MIT",
77
"repository": "bitworking/react-scrollmagic",
88
"main": "dist/index.js",
99
"module": "dist/index.es.js",
1010
"jsnext:main": "dist/index.es.js",
11+
"types": "dist/index.d.ts",
1112
"engines": {
1213
"node": ">=8",
1314
"npm": ">=5"
@@ -17,7 +18,8 @@
1718
"test:watch": "react-scripts test --env=jsdom",
1819
"build": "rollup -c",
1920
"start": "rollup -c -w",
20-
"prepare": "yarn run build",
21+
"copy": "copy \"src\\index.d.ts\" \"dist\\index.d.ts\"",
22+
"prepare": "yarn run build && npm run copy",
2123
"predeploy": "cd example && yarn install && yarn run build",
2224
"deploy": "gh-pages -d example/build"
2325
},

src/index.d.ts

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
declare module 'react-scrollmagic' {
2+
import * as React from 'react';
3+
4+
export type ControllerProps = {
5+
children: React.ReactNode,
6+
container?: any,
7+
vertical?: boolean,
8+
globalSceneOptions?: any,
9+
loglevel?: number,
10+
refreshInterval?: number,
11+
12+
};
13+
14+
export type ControllerState = {
15+
controller: any | null,
16+
17+
};
18+
19+
export type PinSettings = {
20+
pushFollowers?: boolean,
21+
spacerClass?: string,
22+
23+
};
24+
25+
export type SceneProps = {
26+
children: React.ReactNode | Function,
27+
28+
// scene parameters
29+
duration?: number | string,
30+
offset?: number | string,
31+
triggerElement?: string | object,
32+
triggerHook?: number | string,
33+
reverse?: boolean,
34+
loglevel?: number,
35+
indicators?: boolean,
36+
enabled?: boolean,
37+
38+
/* setClassToggle */
39+
classToggle?: string | string[],
40+
41+
/* setPin */
42+
pin?: boolean | PinSettings,
43+
44+
};
45+
46+
export class Controller extends React.Component<ControllerProps, ControllerState> {}
47+
export class Scene extends React.PureComponent<SceneProps> {}
48+
}

0 commit comments

Comments
 (0)