Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

178
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda