mirror of
https://github.com/an-anime-team/an-anime-game-launcher.git
synced 2024-12-24 02:28: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
124
src/ts/GIJSON.d.ts
vendored
124
src/ts/GIJSON.d.ts
vendored
|
@ -1,73 +1,69 @@
|
|||
declare module GIJSON {
|
||||
interface VoicePack {
|
||||
language: string;
|
||||
name: string;
|
||||
path: string;
|
||||
size: string;
|
||||
md5: string;
|
||||
}
|
||||
|
||||
interface VoicePack {
|
||||
language: string;
|
||||
name: string;
|
||||
path: string;
|
||||
size: string;
|
||||
md5: string;
|
||||
}
|
||||
interface Latest {
|
||||
name: string;
|
||||
version: string;
|
||||
path: string;
|
||||
size: string;
|
||||
md5: string;
|
||||
entry: string;
|
||||
voice_packs: VoicePack[];
|
||||
decompressed_path: string;
|
||||
segments: any[];
|
||||
}
|
||||
|
||||
interface Latest {
|
||||
name: string;
|
||||
version: string;
|
||||
path: string;
|
||||
size: string;
|
||||
md5: string;
|
||||
entry: string;
|
||||
voice_packs: VoicePack[];
|
||||
decompressed_path: string;
|
||||
segments: any[];
|
||||
}
|
||||
interface Diff {
|
||||
name: string;
|
||||
version: string;
|
||||
path: string;
|
||||
size: string;
|
||||
md5: string;
|
||||
is_recommended_update: boolean;
|
||||
voice_packs: VoicePack[];
|
||||
}
|
||||
|
||||
interface Diff {
|
||||
name: string;
|
||||
version: string;
|
||||
path: string;
|
||||
size: string;
|
||||
md5: string;
|
||||
is_recommended_update: boolean;
|
||||
voice_packs: VoicePack[];
|
||||
}
|
||||
interface Game {
|
||||
latest: Latest;
|
||||
diffs: Diff[];
|
||||
}
|
||||
|
||||
interface Game {
|
||||
latest: Latest;
|
||||
diffs: Diff[];
|
||||
}
|
||||
interface Plugins {
|
||||
name: string;
|
||||
version: string;
|
||||
path: string;
|
||||
size: string;
|
||||
md5: string;
|
||||
entry: string;
|
||||
}
|
||||
|
||||
interface Plugins {
|
||||
name: string;
|
||||
version: string;
|
||||
path: string;
|
||||
size: string;
|
||||
md5: string;
|
||||
entry: string;
|
||||
}
|
||||
interface Plugin {
|
||||
plugins: Plugins[];
|
||||
version: string;
|
||||
}
|
||||
|
||||
interface Plugin {
|
||||
plugins: Plugins[];
|
||||
version: string;
|
||||
}
|
||||
interface DeprecatedPackage {
|
||||
name: string;
|
||||
md5: string;
|
||||
}
|
||||
|
||||
interface DeprecatedPackage {
|
||||
name: string;
|
||||
md5: string;
|
||||
}
|
||||
|
||||
interface Data {
|
||||
game: Game;
|
||||
plugin: Plugin;
|
||||
web_url: string;
|
||||
force_update?: any;
|
||||
pre_download_game?: any;
|
||||
deprecated_packages: DeprecatedPackage[];
|
||||
sdk?: any;
|
||||
}
|
||||
|
||||
export interface Type {
|
||||
retcode: number;
|
||||
message: string;
|
||||
data: Data;
|
||||
}
|
||||
interface Data {
|
||||
game: Game;
|
||||
plugin: Plugin;
|
||||
web_url: string;
|
||||
force_update?: any;
|
||||
pre_download_game?: any;
|
||||
deprecated_packages: DeprecatedPackage[];
|
||||
sdk?: any;
|
||||
}
|
||||
|
||||
export default interface GIJSON {
|
||||
retcode: number;
|
||||
message: string;
|
||||
data: Data;
|
||||
}
|
|
@ -1,3 +1,5 @@
|
|||
import GIJSON from "./GIJSON";
|
||||
|
||||
const https = require('https');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
@ -74,7 +76,7 @@ export class Genshinlib
|
|||
response.on('data', (chunk: any) => data += chunk);
|
||||
|
||||
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);
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue