-1
@Bind()
sdffsf() {
 this.sdffsf.fff = 'sdfsd';
}

like this, typescript always reminds me fff didn't exist wanna know how to declare the interface of this method

oneCiting
  • 21
  • 4

1 Answers1

0

I learned something new here.

I found this answer https://stackoverflow.com/a/28920916/13257176:

they also linked to TS this doc: https://www.typescriptlang.org/docs/handbook/2/functions.html#declaring-this-in-a-function

sdffsf(this: {sdffsf:{fff:string}}) {
   this.sdffsf.fff = 'sdfsd';
}

I did not test this, you might have to make this a function or class method. Ie:

function sdffsf(this: {sdffsf:{fff:string}}) {
   this.sdffsf.fff = 'sdfsd';
}

or

class x {
  sdffsf(this: {sdffsf:{fff:string}}) {
    this.sdffsf.fff = 'sdfsd';
  }
}
WanderMen
  • 16
  • 1