These are chat archives for rdfjs/public
@awwright I’m using N3 in a couple of TypeScript projects at the moment, adding definitions would allow me to ensure the code I’m writing meets the spec of the library - parameter types, return value types, method signatures etc.
@phreed describes it well in the initial issue:
`== The typings offer a partial formal specification for the API ==
Even if you do not make use of TypeScript the definitions can provide
additional hints as to how the API is intended to be used.
Consider something as simple as the 'Util.createLiteral()' function.
Does it take one argument or two?
Does the type of the first argument matter?
What are the valid values of the second argument? is it just a string?
Most of these questions are answered in your documentation but they can be
partially answered in a formal way in the TypeScript definitions.
Therefore typings are a form of documentation.`
if(typeof argName!='string') throw new TypeError();