Skip to content

Commit

Permalink
doc: update readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
lgou2w committed Oct 13, 2021
1 parent 1285d20 commit 0086215
Showing 1 changed file with 168 additions and 1 deletion.
169 changes: 168 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,54 @@ type Options = {
}
```

### PicaComicError

```typescript
class PicaComicError extends Error {
readonly cause: got.HttpError | Error
readonly code: number
readonly error: string
readonly message: string
readonly detail?: string
}
```

### .register

```typescript
/**
* Register a PicaComic account with the given payload.
*
* @param payload - {
* name - Nickname (2 - 50 characters)
* email - Email (Allow: [0-9 a-z . _])
* password - Password (Greater than 8 characters)
* question1 - Security Question 1
* question2 - 2
* question3 - 3
* answer1 - Security question 1 answer
* answer2 - 2 answer
* answer3 - 3 answer
* birthday - Birthday ('YYYY-MM-DD' | Date | Milliseconds) Need to be 18 years or older
* gender - Gender ('m' | 'f' | 'bot')
* }
* @return Response
*/
PicaComicAPI.prototype.register(payload: {
name: string
email: string
password: string
question1: string
question2: string
question3: string
answer1: string
answer2: string
answer3: string
birthday: string | Date | number
gender: 'm' | 'f' | 'bot'
}): Promise<Response<void>>
```

### .signIn

```typescript
Expand All @@ -72,6 +120,46 @@ type Options = {
PicaComicAPI.prototype.signIn(payload: { email: string, password: string }): Promise<string>
```

### .punchIn

```typescript
/**
* Punch in to the PicaComic account with the given access token payload.
*
* @param payload - Access token payload
* @return PunchInResponse
*/
PicaComicAPI.prototype.punchIn(payload: { email: string, password: string }): Promise<PunchInResponse>
```

### .fetchUserProfile

```typescript
/**
* Fetch user profile using the given access token payload.
*
* @param payload - Access token payload
* @return User
*/
PicaComicAPI.prototype.fetchUserProfile(payload: { token: string }): Promise<User>
```

### .fetchUserFavourite

```typescript
/**
* Fetch user favourite comics using the given payload.
*
* @param payload - {
* token - Access token
* page - Page number (optional)
* sort - Sorting type (optional)
* }
* @return Comics
*/
PicaComicAPI.prototype.fetchUserFavourite(payload: { token: string, page?: number, sort?: 'ua' | 'dd' | 'da' | 'ld' | 'vd' }): Promise<Comics>
```

### .fetchCategories

```typescript
Expand Down Expand Up @@ -113,7 +201,23 @@ PicaComicAPI.prototype.fetchComics(payload: { token: string, category: string, p
* }
* @return ComicInfo
*/
PicaComicAPI.prototype.fetchComics(payload: { token: string, id: string }): Promise<ComicInfo>
PicaComicAPI.prototype.fetchComic(payload: { token: string, id: string }): Promise<ComicInfo>
```

### .fetchComicComments

```typescript
/**
* Fetch comic comments using the given payload.
*
* @param payload - {
* token - Access token
* comicId - Specify comic id
* page - Page number (optional)
* }
* @return ComicComments
*/
PicaComicAPI.prototype.fetchComicComments(payload: { token: string, comicId: string, page?: number }): Promise<ComicComments>
```

### .fetchComicEpisodes
Expand Down Expand Up @@ -180,6 +284,69 @@ PicaComicAPI.prototype.stringifyImageUrl(payload: { fileServer: string, path: st
PicaComicAPI.prototype.fetchImage(payload: { fileServer: string, path: string }): Promise<Duplex>
```

### .search

```typescript
/**
* Search comics using the given payload.
*
* @param payload - {
* token - Access token
* keyword - Keyword
* categories - Specify category name array (e.g.: ['Cosplay']) (optional)
* page - Page number (optional)
* sort - Sorting type (optional)
* }
* @return Comics
*/
PicaComicAPI.prototype.search(payload: { token: string, keyword: string, categories?: string[], page?: number, sort?: 'ua' | 'dd' | 'da' | 'ld' | 'vd' }): Promise<Comics>
```

### .switchComicLike

```typescript
/**
* Switch the comic as like or unlike using the given payload.
*
* @param payload - {
* toke - Access token
* id - Comic id
* }
* @return 'like' | 'unlike'
*/
PicaComicAPI.prototype.switchComicLike(payload: { token: string, id: string }): Promise<'like' | 'unlike'>
```

### .switchComicFavourite

```typescript
/**
* Switch the comic as favourite or un_favourite using the given payload.
*
* @param payload - {
* toke - Access token
* id - Comic id
* }
* @return 'favourite' | 'un_favourite'
*/
PicaComicAPI.prototype.switchComicFavourite(payload: { token: string, id: string }): Promise<'favourite' | 'un_favourite'>
```

### .setUserProfileSlogan

```typescript
/**
* Set the slogan of the user profile with the given payload.
*
* @param payload - {
* toke - Access token
* slogan - Slogan (Cannot be blank)
* }
* @return Response
*/
PicaComicAPI.prototype.setUserProfileSlogan(payload: { token: string, slogan: string }): Promise<Response<void>>
```

## License

Apache-2.0

0 comments on commit 0086215

Please sign in to comment.