Q: How extract interface from exist class in typescript I want extract interface from class so that not duplicate method declaration in class and interface.
typeof MyClass

not extract interface,
also I think what I can use simple MyClass intead insterface
but MyClass contain information about private methods and params
class MyClass {
  public get() {}
  private secret() {}
}

function run(e: MyClass) {  // need work with MyClassInterface
  e.get();
}

run(new MyClass());

run({
  get: () => {} // require secret method
});

run({
  get:() => {},
  secret: () => {}, // require what secret be private
});


A: The following type extracts public members from MyClass:
type MyClassInterface = { [k in keyof MyClass]: MyClass[k] };

Reference: Microsoft/TypeScript#471
