As shown in the figure

https://sprotty.org/docs/concepts/extension-points/#creating-custom-model-elements
I think the correct code is
import { SEdgeImpl, SNodeImpl } from "sprotty";
export class CustomNode extends SNodeImpl {
}
export class CustomEdge extends SEdgeImpl {
}