feat: 타입 정의 개선 및 any 사용 제거

This commit is contained in:
2026-01-05 17:19:32 +00:00
parent 7e58f7bac4
commit cb7e9c832f
17 changed files with 176 additions and 86 deletions
@@ -13,8 +13,8 @@ export interface TurnCommandSpecBase<TKey extends string = string> {
export interface TurnCommandModule<TSpec extends TurnCommandSpecBase = TurnCommandSpecBase> {
commandSpec: TSpec;
ActionDefinition: new (...args: any[]) => GeneralActionDefinition;
ActionResolver?: new (...args: any[]) => GeneralActionResolver;
CommandResolver?: new (...args: any[]) => any;
ActionDefinition: new (...args: unknown[]) => GeneralActionDefinition;
ActionResolver?: new (...args: unknown[]) => GeneralActionResolver;
CommandResolver?: new (...args: unknown[]) => unknown;
actionContextBuilder?: ActionContextBuilder;
}
@@ -35,7 +35,9 @@ export class ActionDefinition<
if (typeof raw !== 'object' || raw === null) {
return null;
}
const { buyRice, amount } = raw as any;
const record = raw as Record<string, unknown>;
const buyRice = record.buyRice;
const amount = record.amount;
if (typeof buyRice !== 'boolean' || typeof amount !== 'number') {
return null;
}