Fix type error after rebase

This commit is contained in:
Pavel Birukov 2018-10-12 11:48:46 +03:00
parent ffad9a34da
commit ba65cd288e
4 changed files with 12 additions and 6 deletions

6
package-lock.json generated
View File

@ -302,6 +302,12 @@
"integrity": "sha1-EYHsvh2XtwNODqHjXmLobMJrQi0=",
"dev": true
},
"@types/util.promisify": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@types/util.promisify/-/util.promisify-1.0.0.tgz",
"integrity": "sha512-JK7Ecs9ETHfYSoG5ZILe30Ar9fmMT7vZTirfZQQ9OAZDB8TfPVV6aQkYPtfx2MFfB+yrSY4jCfrvMdemv/9VHw==",
"dev": true
},
"JSONStream": {
"version": "1.3.4",
"resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.4.tgz",

View File

@ -16,11 +16,11 @@ export type BaseModelContructorOptions =
| BaseModelOptions & Required<Pick<BaseModelOptions, 'token'>>
| BaseModelOptions & Required<Pick<BaseModelOptions, 'oauthToken'>>;
class BaseModel {
protected url: string;
public url: string;
public readonly headers: { [header: string]: string | number};
public readonly rejectUnauthorized: boolean;
protected readonly requester: XhrStaticPromisified;
protected readonly useXMLHttpRequest: boolean;
public readonly requester: XhrStaticPromisified;
public readonly useXMLHttpRequest: boolean;
constructor({
token,

View File

@ -10,7 +10,7 @@ function Bundler<T extends { [K: string]: typeof BaseService }>(
}
return class Bundle implements BundleClass {
[K: string]: any;
constructor(baseOptions: BaseModelContructorOptions = {}) {
constructor(baseOptions: BaseModelContructorOptions) {
Object.keys(combined).forEach((serviceName) => {
this[serviceName] = new combined[serviceName](baseOptions);
});

View File

@ -13,8 +13,8 @@ class Test2 {
}
test('No classes passed to Bundler returns an empty Bundle', async () => {
const Bundle = Bundler();
const services = new Bundle();
const Bundle = Bundler(undefined as any);
const services = new Bundle(undefined as any);
expect(services).toEqual({});
});