Remove namespace and export default interface

This commit is contained in:
Maroxy 2021-10-17 22:28:26 +02:00
parent 3049aaeff2
commit 3d10bfc3c7
2 changed files with 63 additions and 65 deletions

6
src/ts/GIJSON.d.ts vendored
View file

@ -1,5 +1,3 @@
declare module GIJSON {
interface VoicePack { interface VoicePack {
language: string; language: string;
name: string; name: string;
@ -64,10 +62,8 @@ declare module GIJSON {
sdk?: any; sdk?: any;
} }
export interface Type { export default interface GIJSON {
retcode: number; retcode: number;
message: string; message: string;
data: Data; data: Data;
} }
}

View file

@ -1,3 +1,5 @@
import GIJSON from "./GIJSON";
const https = require('https'); const https = require('https');
const fs = require('fs'); const fs = require('fs');
const path = require('path'); const path = require('path');
@ -74,7 +76,7 @@ export class Genshinlib
response.on('data', (chunk: any) => data += chunk); response.on('data', (chunk: any) => data += chunk);
response.on('end', () => { response.on('end', () => {
let jsondata: GIJSON.Type = JSON.parse(data); let jsondata: GIJSON = JSON.parse(data);
return jsondata.message === 'OK' ? resolve(jsondata.data) : reject(null); return jsondata.message === 'OK' ? resolve(jsondata.data) : reject(null);
}); });