typescript implements

Posted May 27, 20201 min read

  1. First of all, what does the interface know?
    interface is the restriction on the parameter function array class

  2. In addition to class restrictions
    Such as interface test {

    name:string

}
funcrtion t(agr:test) {
}
The representative parameters must be in accordance with the test specifications, but if not, an error will be reported

  1. The wording of restricted classes will use implements

Such as interface test {

name:string;
go(str:string):void

}

class newTest implements test {

There must be parameters and methods set by test

}