I’m wrapping a JS/TS library, and everything works fine until I need to wrap a method that has an optional second argument. It starts like this:
module Graphology = {
type directedGraph = {
addNode: (string) => string,
addEdge: (string, string) => string,
}
@new @module("graphology")
external createDirectedGraph: unit => directedGraph = "DirectedGraph"
}
and this works. However, addNode() has an overload with an extra argument like here. What would be the way to wrap that?