interface SA {
read: () => void;
close?: () => void;
}
class S implements SA {
read() {
console.log("read");
}
}
let s = new S();
if (typeof (s as any).close === "function") {
(s as any).close();
} else {
console.log("oops");
}