-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
55 lines (49 loc) · 1.13 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/// <reference types="node" />
// 豆瓣用户 'uid'
export interface userOptionsType {
uid: string
}
export interface doubanOptionsType {
urls: {
// 在看的电视
movie_do: string
// 想看的电影
movie_wish: string
// 看过的电影
movie_collect: string
}
}
export interface retMovieDataType {
pic: string | undefined
href: string | undefined
comment: string | undefined
title: {
name: string
}
intro: string
rating: {
star: number
date: string
}
}
export interface retMovieType<T = retMovieDataType> {
data: Array<T>
page: {
currentPage: number
totalPage: number
}
}
interface methods {
get: string
post: string
}
export default class doubanSpiderType {
constructor(userOptions?: userOptionsType, doubanOptions?: doubanOptionsType)
getMovieDo(page: number = 1): Promise<retMovieType>
getMovieWish(page: number = 1): Promise<retMovieType>
getMovieCollect(page: number = 1): Promise<retMovieType>
fetch(method: keyof methods): Promise<string>
userOptions: userOptionsType
doubanOptions: doubanOptionsType
}
// declare const doubanSpider: doubanSpiderType