-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor: Added Typings, updated docs #20
Conversation
package-lock.json
Outdated
@@ -0,0 +1,7795 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove package-lock.json
. use yarn.
@@ -2,8 +2,8 @@ | |||
"extends": "@akameco/tsconfig", | |||
"compilerOptions": { | |||
"outDir": "dist", | |||
"strict": false, | |||
"noImplicitAny": false | |||
"strict": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
.prettierrc
Outdated
"semi": false, | ||
"singleQuote": true | ||
"singleQuote": false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep "singleQuote": true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not change .prettierrc
src/index.ts
Outdated
const filter = "for_ios" | ||
|
||
export default class PixivApp<B extends boolean> { | ||
public camelcaseKeys = true as B |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool 💯
@Tenpi Thank you 👍 |
What: I added typings for Typescript users, every function now returns either CamelCased types or snake_cased types depending on the value of
camelcaseKeys
. Example:Other changes:
-Removed almost every
any
type-Changed all
.then()
chains to async/await-Added the new endpoint
/v1/ugoira/metadata
-Updated the docs
Broken endpoints:
-Some endpoints no longer work, I got this error while testing them:
Specified end-point doesn't exist
. I added comments to these functions, most notably they involve adding/deleting follows or bookmarks.-I don't know what this function does
nextQuery()
since it always returns undefined. However, I left it as is.Why: Using this library is a pain for Typescript users due to the lack of type definitions. Especially since it's written with Typescript, it should return types for all of the functions.
How: I added type definitions in these two files:
PixivTypes.ts
andPixiv_Types.ts
and I imported them inindex.ts
.Checklist: