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

7
src/module/szurubooru/index.ts

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

Loading…
Cancel
Save