Skip to content

Commit

Permalink
fix (TypeScript): Upgrade TypeScript to latest and fix declares / reo…
Browse files Browse the repository at this point in the history
…rder export #61
  • Loading branch information
cnguy committed Dec 31, 2018
1 parent a584354 commit ad294e5
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 deletions.
4 changes: 2 additions & 2 deletions lib/RequestClient/DDragonRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ DDragonRequest.prototype.region = function(region) {
DDragonRequest.prototype.then = function then(resolve, reject) {
const self = this
return new Promise((innerResolve, innerReject) =>
self.callback((err, res) =>
err ? innerReject(err) : innerResolve(res),
self.callback(
(err, res) => (err ? innerReject(err) : innerResolve(res)),
),
).then(resolve, reject)
}
Expand Down
4 changes: 2 additions & 2 deletions lib/RequestClient/Request.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ Request.prototype.query = function(obj) {
Request.prototype.then = function then(resolve, reject) {
const self = this
return new Promise((innerResolve, innerReject) =>
self.callback((err, res) =>
err ? innerReject(err) : innerResolve(res),
self.callback(
(err, res) => (err ? innerReject(err) : innerResolve(res)),
),
).then(resolve, reject)
}
Expand Down
13 changes: 7 additions & 6 deletions typings/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import * as dtos from './dtos'

declare module 'kayn' {
export function Kayn(key?: string): (config?: KaynConfig) => KaynClass

class KaynClass {
flushCache(cb?: callback<'OK'>): Promise<'OK'>

Expand Down Expand Up @@ -290,7 +292,7 @@ type KaynError = {
error: any
}

class KaynRequest<T> {
declare class KaynRequest<T> {
region(region: region): KaynRequest<T>
query(query: Object): KaynRequest<T>
then(
Expand Down Expand Up @@ -332,21 +334,20 @@ interface KaynConfig {

type region = string
type queueName = string
export function Kayn(key?: string): (config?: KaynConfig) => KaynClass

class BasicJSCache {
declare class BasicJSCache {
constructor()
}

class LRUCache {
declare class LRUCache {
constructor(opts?: {
max?: number
length?: (value: any, key: any) => number
dispose?: (key: any, value: any) => void
})
}

class RedisCache {
declare class RedisCache {
constructor(opts?: {
host?: string
port?: number
Expand All @@ -355,7 +356,7 @@ class RedisCache {
})
}

enum REGIONS {
declare enum REGIONS {
BRAZIL = 'br',
EUROPE = 'eune',
EUROPE_WEST = 'euw',
Expand Down
2 changes: 1 addition & 1 deletion typings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {},
"devDependencies": {
"kayn": "^0.9.0",
"typescript": "^2.4.2"
"typescript": "^3.2.2"
},
"dependencies": {
"@types/dotenv": "^4.0.0",
Expand Down
7 changes: 4 additions & 3 deletions typings/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -708,9 +708,10 @@ tweetnacl@^0.14.3, tweetnacl@~0.14.0:
resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64"
integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=

typescript@^2.4.2:
version "2.5.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.5.3.tgz#df3dcdc38f3beb800d4bc322646b04a3f6ca7f0d"
typescript@^3.2.2:
version "3.2.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.2.2.tgz#fe8101c46aa123f8353523ebdcf5730c2ae493e5"
integrity sha512-VCj5UiSyHBjwfYacmDuc/NOk4QQixbE+Wn7MFJuS0nRuPQbof132Pw4u53dm264O8LPc2MVsc7RJNml5szurkg==

uri-js@^4.2.2:
version "4.2.2"
Expand Down

0 comments on commit ad294e5

Please sign in to comment.