feat: 타입 정의 개선 및 any 사용 제거
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user