Browse Source

Moving SzuruBooruClient to typescript module export and import

develop
Drew Short 5 years ago
parent
commit
435af1be6a
  1. 6
      src/module/szurubooru/client.ts
  2. 7
      src/module/szurubooru/index.ts

6
src/module/szurubooru/client.ts

@ -11,7 +11,7 @@ function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min)) + min; //The maximum is exclusive and the minimum is inclusive
}
class SzurubooruClient {
export class SzurubooruClient {
url: string;
baseUrl: string;
@ -132,6 +132,4 @@ class SzurubooruClient {
return null;
})
}
}
export { SzurubooruClient as Client };
}

7
src/module/szurubooru/index.ts

@ -4,9 +4,12 @@
let { AbstractModule } = require('../abstract');
let { logger } = require('../../logging');
let szurubooruClient = require('./client');
import { SzurubooruClient } from './client';
class SzurubooruModule extends AbstractModule {
client: SzurubooruClient;
constructor() {
super(
"Szurubooru",
@ -36,7 +39,7 @@ class SzurubooruModule extends AbstractModule {
postInit() {
super.postInit();
this.client = new szurubooruClient.Client(
this.client = new SzurubooruClient(
this.get("url"),
this.get("username"),
this.get("token")

Loading…
Cancel
Save