Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -504,8 +504,15 @@ func (ts *Typescript) parse(obj types.Object) error {
})
}

if underNamed.NumEmbeddeds() == 0 && underNamed.NumMethods() > 0 {
// type <Name> interface{ <methods> }
// Do not generate anything for interfaces.
return nil
}

if underNamed.NumEmbeddeds() == 0 {
// type <Name> interface{}
// A typed `any` is still a type. A strange one to use, but still valid.
// TODO: This has not been fully investigated. This line should only be triggered
// on simple `any` types. If this generates something more complex, this will be wrong.
ts.updateNode(objectIdentifier.Ref(), func(n *typescriptNode) {
Expand Down
3 changes: 0 additions & 3 deletions testdata/interface/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,3 @@ export interface Foo extends Bar, GenBar<string> {
export interface GenBar<T extends Comparable> {
readonly GenBarField: T;
}

// From codersdk/interface.go
export type IgnoreMe = any;