Skip to content

Commit 91b3e06

Browse files
author
dian.li
committed
增加 ts 文件
1 parent 2f1c23d commit 91b3e06

File tree

3 files changed

+36
-2
lines changed

3 files changed

+36
-2
lines changed

gulpfile.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ gulp.task("publish:clean", function(){
5252
.pipe(clean());
5353
})
5454

55+
gulp.task("publish:ts", ["publish:clean"], function(){
56+
return gulp.src('src/**/*.ts')
57+
.pipe(gulp.dest('dist'));
58+
})
59+
5560
//编译 js 文件
5661
gulp.task('publish:js', ["publish:clean"], function(){
5762
return gulp.src('src/**/*.{js,jsx}')
@@ -77,7 +82,7 @@ gulp.task('publish:css', ["publish:clean"], function(){
7782
})
7883

7984
//打包发布 npm
80-
gulp.task('publish', ["publish:clean", 'publish:js', 'publish:less']);
85+
gulp.task('publish', ["publish:clean", 'publish:ts', 'publish:js', 'publish:less']);
8186

8287
gulp.task('demo', ['deploy:demo']);
8388

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-pullload",
3-
"version": "1.1.0",
3+
"version": "1.2.0",
44
"description": "React compopnent pull down refresh and pull up load more",
55
"main": "./dist/index.js",
66
"scripts": {

src/index.d.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import * as React from "react";
2+
declare enum STATS {
3+
init = "",
4+
pulling = "pulling",
5+
enough = "pulling enough",
6+
refreshing = "refreshing",
7+
refreshed = "refreshed",
8+
reset = "reset",
9+
10+
loading = "loading" // loading more
11+
}
12+
13+
export interface PullLoadProps {
14+
action: STATS; //用于同步状态
15+
handleAction: (action: STATS) => void; //用于处理状态
16+
hasMore: boolean; //是否还有更多内容可加载
17+
offsetScrollTop?: number; //必须大于零,使触发刷新往下偏移,隐藏部分顶部内容
18+
downEnough?: number; //下拉满足刷新的距离
19+
distanceBottom?: number; //距离底部距离触发加载更多
20+
isBlockContainer?: boolean;
21+
22+
HeadNode?: React.ReactNode | string; //refresh message react dom
23+
FooterNode?: React.ReactNode | string; //refresh loading react dom
24+
children: React.ReactChild; // 子组件
25+
}
26+
export default class ReactPullLoad extends React.Component<
27+
PullLoadProps,
28+
any
29+
> {}

0 commit comments

Comments
 (0)