Skip to content
Discussion options

You must be logged in to vote

It is not possible to generate interfaces instead of types.

If you want to extend them with an interface you can simply use the extends keyword.

type A = {
  a: number;
  b: number; 
}


interface B extends A {
  c: 1
}

function a(b: B) {
  b.a
  b.b
  b.c
}

Example on TypeScript Playground

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@TheDutchCoder
Comment options

@ardatan
Comment options

ardatan Jul 21, 2022
Collaborator

@TheDutchCoder
Comment options

@n1ru4l
Comment options

n1ru4l Jul 22, 2022
Collaborator

@TheDutchCoder
Comment options

Answer selected by n1ru4l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants