-
Notifications
You must be signed in to change notification settings - Fork 231
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix & refactor: no longer merge config data and loader; use static im…
…ports to represent config struct
- Loading branch information
1 parent
12f6b1c
commit ae981fe
Showing
4 changed files
with
21 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,11 @@ | ||
import { ConfigBase } from "@/common/utils/ConfigBase"; | ||
import { LogLevel } from "@/common/utils/log"; | ||
import napCatDefaultConfig from '@/core/external/napcat.json'; | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging | ||
export interface NapCatConfig { | ||
fileLog: boolean, | ||
consoleLog: boolean, | ||
fileLogLevel: LogLevel, | ||
consoleLogLevel: LogLevel, | ||
} | ||
export type NapCatConfig = typeof napCatDefaultConfig; | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging | ||
export class NapCatConfig extends ConfigBase<NapCatConfig> { | ||
export class NapCatConfigLoader extends ConfigBase<NapCatConfig> { | ||
name = 'napcat'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,10 @@ | ||
import { ConfigBase } from '@/common/utils/ConfigBase'; | ||
import ob11DefaultConfig from '@/onebot/external/onebot11.json'; | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging | ||
export interface OB11Config { | ||
http: { | ||
enable: boolean; | ||
host: string; | ||
port: number; | ||
secret: string; | ||
enableHeart: boolean; | ||
enablePost: boolean; | ||
postUrls: string[]; | ||
}; | ||
ws: { | ||
enable: boolean; | ||
host: string; | ||
port: number; | ||
}; | ||
reverseWs: { | ||
enable: boolean; | ||
urls: string[]; | ||
}; | ||
|
||
debug: boolean; | ||
heartInterval: number; | ||
messagePostFormat: 'array' | 'string'; | ||
enableLocalFile2Url: boolean; | ||
musicSignUrl: string; | ||
reportSelfMessage: boolean; | ||
token: string; | ||
GroupLocalTime: { | ||
Record: boolean, | ||
RecordList: Array<string> | ||
}; | ||
} | ||
export type OB11Config = typeof ob11DefaultConfig; | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging | ||
export class OB11Config extends ConfigBase<OB11Config> { | ||
export class OB11ConfigLoader extends ConfigBase<OB11Config> { | ||
name = 'onebot11'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters