Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

179
Visualizações
TS2345: Argument of type x is not assignable to parameter of type y, x is extends y

I want to run the sigma.js\examples\custom-rendering example, when I run npm start, I got TS2345: Argument of type 'Graph<Attributes, Attributes, Attributes>' is not assignable to parameter of type 'AbstractGraph<Attributes, Attributes, Attributes>'. errors.

I find the Graph type declaration is the following.

export default class Graph<
  NodeAttributes extends Attributes = Attributes,
  EdgeAttributes extends Attributes = Attributes,
  GraphAttributes extends Attributes = Attributes
> extends AbstractGraph<NodeAttributes, EdgeAttributes, GraphAttributes> {}

declare abstract class AbstractGraph<
  NodeAttributes extends Attributes = Attributes,
  EdgeAttributes extends Attributes = Attributes,
  GraphAttributes extends Attributes = Attributes
> extends EventEmitter<NodeAttributes, EdgeAttributes, GraphAttributes> { ... }

It seems typescript does not accept Graph<Attributes, Attributes, Attributes> as an AbstractGraph<Attributes, Attributes, Attributes> instance. That's different from what I have learn in Java/C#.

What's wrong with it?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda