mirror of
https://github.com/an-anime-team/an-anime-game-launcher.git
synced 2024-12-25 11:08:15 +03:00
Remove namespace and export default interface
This commit is contained in:
parent
3049aaeff2
commit
3d10bfc3c7
2 changed files with 63 additions and 65 deletions
6
src/ts/GIJSON.d.ts
vendored
6
src/ts/GIJSON.d.ts
vendored
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
|
@ -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);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue