You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similar to #7073, provide a code action to create stubs for an anonymous implementation of a type:
interface Foo {
field: string,
func(): void
}
const bar: Foo = {}
// expand above line into...
const bar: Foo = {
field: 'string',
func(): void {
throw new Error('not yet implemented')
},
}
Ideally, this would also be able to stub in the anonymous implementation of a function argument, but that would require inference of the interface being targeted for implementation:
function example(arg: Foo): void { }
example({})
// expand above line into...
example({
field: string,
func(): void {
throw new Error('not yet implemented')
},
}
The text was updated successfully, but these errors were encountered:
tvald
changed the title
interface implementation stubbing for anonymous objects
interface stubbing for anonymous implementations
Jun 23, 2017
Similar to #7073, provide a code action to create stubs for an anonymous implementation of a type:
Ideally, this would also be able to stub in the anonymous implementation of a function argument, but that would require inference of the interface being targeted for implementation:
The text was updated successfully, but these errors were encountered: