Confusion in typescript interface object detection

topic description

defines an interface, but cannot detect the type

related codes

export interface Base {
  token: string; // token
  source?: number; // 
  mk: string; // 
  ct: string; // 
  [propName: string]: any;
};

export interface OrderCancel extends Base {
  ids: string[];
}

async cancel() {
    const {ctx, service} = this;
    const reqBody: OrderCancel = ctx.request.body;
    ctx.body = await service.order.cancel(reqBody);
    ctx.code = 0;
  }

what result do you expect? What is the error message actually seen?

what I expect is that the value passed in by request.body matches the interface OrderCancel to verify the incoming parameters. However, during the request, it is found that all requests can be passed, and there is no detection type. However, if the value is assigned directly according to the following, there will be detection

.
const {ctx, service} = this;
    const reqBody: OrderCancel = {
        token: 123
    };
    ctx.body = await service.order.cancel(reqBody);
    ctx.code = 0;

ask for answers, ask for help

Dec.27,2021

const {ctx, service} = this;
where does the this of this code come from?

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3e485-347af.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3e485-347af.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?