mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-03-01 16:20:25 +00:00
fix
This commit is contained in:
@@ -1,21 +1,22 @@
|
||||
import { ConfigBase } from '@/common/config-base';
|
||||
import { NapCatCore } from '@/core';
|
||||
import { z } from 'zod';
|
||||
import { Type, Static } from '@sinclair/typebox';
|
||||
import { AnySchema } from 'ajv';
|
||||
|
||||
export const NapcatConfigSchema = z.object({
|
||||
fileLog: z.boolean().default(false),
|
||||
consoleLog: z.boolean().default(true),
|
||||
fileLogLevel: z.string().default('debug'),
|
||||
consoleLogLevel: z.string().default('info'),
|
||||
packetBackend: z.string().default('auto'),
|
||||
packetServer: z.string().default(''),
|
||||
o3HookMode: z.number().default(0),
|
||||
export const NapcatConfigSchema = Type.Object({
|
||||
fileLog: Type.Boolean({ default: false }),
|
||||
consoleLog: Type.Boolean({ default: true }),
|
||||
fileLogLevel: Type.String({ default: 'debug' }),
|
||||
consoleLogLevel: Type.String({ default: 'info' }),
|
||||
packetBackend: Type.String({ default: 'auto' }),
|
||||
packetServer: Type.String({ default: '' }),
|
||||
o3HookMode: Type.Number({ default: 0 }),
|
||||
});
|
||||
|
||||
export type NapcatConfig = z.infer<typeof NapcatConfigSchema>;
|
||||
export type NapcatConfig = Static<typeof NapcatConfigSchema>;
|
||||
|
||||
export class NapCatConfigLoader extends ConfigBase<NapcatConfig> {
|
||||
constructor(core: NapCatCore, configPath: string, schema: z.ZodType<any>) {
|
||||
constructor(core: NapCatCore, configPath: string, schema: AnySchema) {
|
||||
super('napcat', core, configPath, schema);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user