diff --git a/.gitignore b/.gitignore index 2c6ebfe..f1cc977 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ node_modules .envrc -dist .vscode +dist +src/test.ts diff --git a/package.json b/package.json index 8852a55..460c064 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "node": ">=8" }, "main": "dist/index.js", + "types": "dist/index.d.ts", "scripts": { "add-contributor": "all-contributors add", "fmt": "prettier --write '**/*.{ts,js,json,md}'", diff --git a/src/index.ts b/src/index.ts index e7e3cb8..481263f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -54,8 +54,8 @@ const HASH_SECRET = '28c1fdd170a5204386cb1313c7077b34f83e4aaf4aa829ce78c231e05b0bae2c' const filter = 'for_ios' -export default class PixivApp { - camelcaseKeys = true as CamelcaseKeys +export default class PixivApp { + camelcaseKeys: CamelcaseKeys username: string | undefined password: string | undefined refreshToken: string @@ -76,6 +76,8 @@ export default class PixivApp { this._once = false if (options) { this.camelcaseKeys = Boolean(options.camelcaseKeys) as CamelcaseKeys + } else { + this.camelcaseKeys = true as CamelcaseKeys } } diff --git a/tsconfig.json b/tsconfig.json index d978a9f..e083f8d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,7 +3,8 @@ "compilerOptions": { "outDir": "dist", "strict": true, - "noImplicitAny": true + "noImplicitAny": true, + "declaration": true }, "include": ["src", "declarations.d.ts"] }