Skip to content
This repository was archived by the owner on Dec 30, 2021. It is now read-only.

Commit f794588

Browse files
authored
Merge pull request #158 from kaimallea/next-dev
Release next.3
2 parents 33e522b + cc6c77e commit f794588

48 files changed

Lines changed: 879 additions & 1332 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
module.exports = {
2+
root: true,
23
env: {
34
es2021: true,
45
node: true,
56
jest: true,
67
},
7-
extends: ['eslint:recommended', 'prettier'],
8+
parser: '@typescript-eslint/parser',
9+
plugins: ['@typescript-eslint'],
10+
extends: [
11+
'eslint:recommended',
12+
'plugin:@typescript-eslint/recommended',
13+
'prettier',
14+
],
815
parserOptions: {
916
ecmaVersion: 12,
1017
sourceType: 'module',

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,3 +186,43 @@ Favorite an image:
186186
```ts
187187
client.favoriteImage('someImageHash');
188188
```
189+
190+
### Get gallery images
191+
192+
```ts
193+
client.getGallery({
194+
section: 'hot',
195+
sort: 'viral',
196+
mature: false,
197+
});
198+
```
199+
200+
`getGallery()` accepts an object of type `GalleryOptions`. The follow options are available:
201+
202+
| Key | Required | Description |
203+
| ---------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
204+
| `section` | required | `hot` \| `top` \| `user` |
205+
| `sort` | optional | `viral` \| `top` \| `time` \| `rising` (only available with user section). Defaults to viral |
206+
| `page` | optional | `number` - the data paging number |
207+
| `window` | optional | Change the date range of the request if the section is `top`. Accepted values are `day` \| `week` \| `month` \| `year` \| `all`. Defaults to `day` |
208+
| `showViral` | optional | `true` \| `false` - Show or hide viral images from the `user` section. Defaults to `true` |
209+
| `mature` | optional | `true` \| `false` - Show or hide mature (nsfw) images in the response section. Defaults to `false`. NOTE: This parameter is only required if un-authed. The response for authed users will respect their account setting |
210+
| `album_previews` | optional | `true` \| `false` - Include image metadata for gallery posts which are albums |
211+
212+
### Get subreddit gallery images
213+
214+
```ts
215+
client.getSubredditGallery({
216+
subreddit: 'wallstreetbets',
217+
sort: 'time',
218+
});
219+
```
220+
221+
`getSubredditGallery()` accepts an object of type `SubredditGalleryOptions`. The follow options are available:
222+
223+
| Key | Required | Description |
224+
| ----------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
225+
| `subreddit` | required | A valid subreddit name |
226+
| `sort` | optional | `time` \| `top` - defaults to time |
227+
| `page` | optional | `number` - the data paging number |
228+
| `window` | optional | Change the date range of the request if the section is `top`. Accepted values are `day` \| `week` \| `month` \| `year` \| `all`. Defaults to `week` |

jest.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module.exports = {
2-
setupFilesAfterEnv: ['./jest.setup.js'],
2+
setupFilesAfterEnv: ['<rootDir>/src/mocks/jest.setup.ts'],
33
testPathIgnorePatterns: [
44
'<rootDir>/build/',
55
'<rootDir>/node_modules/',
6-
'<rootDir>/src/__tests__/mocks/',
6+
'<rootDir>/src/mocks/',
77
],
88
};

0 commit comments

Comments
 (0)