[TypeScript] Change API types from class to interface#408
[TypeScript] Change API types from class to interface#408
Conversation
Signed-off-by: Derek Wickern <dwickern@gmail.com>
|
@worksofliam can you look at this? I'm not familiar enough with TypeScript to review this. |
|
@kadler I am not able to leave reviews, but I'd say this is partially correct and therefore requires more changes (or maybe less changes). It makes sense to convert the @dwickern For your comparison there, you might be better off with |
|
Sorry, I'm not sure I understand your suggestion about instance methods. This PR fixes the types to match the runtime behavior. Unlike import odbc from 'odbc'
odbc.ColumnDefinition // undefined
odbc.Result // undefined
odbc.OdbcError // undefined
odbc.NodeOdbcError // undefined
odbc.Statement // undefined
odbc.Connection // undefined
odbc.Pool // undefined
odbc.Cursor // undefined |
|
@dwickern Hey again. Had a look properly this and yes, it makes sense. My bad, I forgot node-odbc is not TS! |
These types don't actually exist at runtime, or at least they are not exported.
For example, this code will compile but fail at runtime with
TypeError: Right-hand side of 'instanceof' is not an object: