mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-06 13:05:09 +00:00
Add payload and return schemas to OneBot actions
Introduced explicit payloadSchema and returnSchema definitions for all OneBotAction classes using @sinclair/typebox. This improves type safety, API documentation, and validation for action payloads and return values. Also refactored method signatures and types for consistency across the codebase.
This commit is contained in:
@@ -2,9 +2,12 @@ import { ActionName } from '@/napcat-onebot/action/router';
|
||||
import { OneBotAction } from '@/napcat-onebot/action/OneBotAction';
|
||||
import { join } from 'node:path';
|
||||
import { readdir, unlink } from 'node:fs/promises';
|
||||
import { Type } from '@sinclair/typebox';
|
||||
|
||||
export class CleanStreamTempFile extends OneBotAction<void, void> {
|
||||
override actionName = ActionName.CleanStreamTempFile;
|
||||
override payloadSchema = Type.Object({});
|
||||
override returnSchema = Type.Null();
|
||||
|
||||
async _handle (_payload: void): Promise<void> {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user