rescript-association / genType

Auto generation of idiomatic bindings between Reason and JavaScript: either vanilla or typed with TypeScript/FlowType.
https://rescript-lang.org/docs/gentype/latest/introduction
MIT License
758 stars 44 forks source link

Missing shim for `Null.t` #636

Closed sgrove closed 1 year ago

sgrove commented 1 year ago

I suspect this is likely to show up quite a bit (and maybe there's a way to shim it in user land?), so just bringing it up.

While using pgtyped-rescript, I was experimenting with getting all the way into my typescript code from Rescript-generated code, but this is currently one of the show-stoppers:

(generated) block__sql.res:

/** 'InsertBlock' parameters type */
type insertBlockParams = {
  camel_case_name?: Null.t<string>,
  chain_id?: Null.t<string>,
  description?: Null.t<string>,
  id?: Null.t<string>,
  kind?: Null.t<string>,
  local_schema?: Null.t<string>,
  source_code?: Null.t<string>,
  title?: Null.t<string>,
}

block__sql.gen.tsx

src/sql/block__sql.gen.tsx:10:34 - error TS2307: Cannot find module './Null.gen.js' or its corresponding type declarations.

10 import type { t as Null_t } from "./Null.gen.js";