implements 一个类可以准守一个或者多个接口去实现它: interface Pingable { ping(): void; } class Sonar implements Pingable ; } } class Ball implements Pingable { //Class 'Ball' incorrectly implements interface 'Pingable'. //Property 'ping' is missing in type 'Ball' but required in type 'Pingable'.
PQPING_NO_RESPONSE" NOTICE: starting server using "pg_ctl -w -D '/pgdata' start" INFO: demoted primary is pingable PQPING_NO_RESPONSE" NOTICE: starting server using "pg_ctl -w -D '/pgdata' start" INFO: demoted primary is pingable
如果类没有正确地实现这个接口,那么就会抛出一个错误: interface Pingable { ping(): void; } class Sonar implements Pingable { ; } } class Ball implements Pingable { ^ /* Class 'Ball' incorrectly implements interface 'Pingable'. Property 'ping' is missing in type 'Ball' but required in type 'Pingable'. */ pong() { console.log
server using "/pg13/pg13/bin/pg_ctl -w -D '/pg13/pgdata' start" INFO: node "lhrrepmgr64361" (ID: 1) is pingable server using "/pg13/pg13/bin/pg_ctl -w -D '/pg13/pgdata' start" INFO: node "lhrrepmgr64361" (ID: 1) is pingable