rescript-association / genType

Auto generation of idiomatic bindings between Reason and JavaScript: either vanilla or typed with TypeScript/FlowType.

Home Page:https://rescript-lang.org/docs/gentype/latest/introduction

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot find module './Js.shim' or its corresponding type declarations.

Mng12345 opened this issue · comments

commented
...
@genType
let make = (data: Js.TypedArray2.Uint8Array.t, netSize: int, maxIteration: int, sample: int) => {
  {
    data: data,
    netSize: netSize,
    maxIteration: maxIteration,
    w: initNet(netSize, data),
    alpha: 0.9,
    sample: sample < 10 ? 10 : sample,
  }
}
...

In generated tsx file

import type {TypedArray2_Float32Array_t as Js_TypedArray2_Float32Array_t} from './Js.gen';

import type {TypedArray2_Uint8Array_t as Js_TypedArray2_Uint8Array_t} from './Js.gen';

It report en error: Cannot find module './Js.gen' or its corresponding type declarations.
There are no solutions in the related closed issues.

@Mng12345 see an example in the project here: #589

Notice the project is configured with this this inside bsconfig.json:

  "gentypeconfig": {
    "shims": {
      "Js": "Js",
...

and the relevant file is src/shims/Js.shim.ts.