From 024925861b9edba81d04a22d4e868141d6fe09fe Mon Sep 17 00:00:00 2001
From: muqiuhan baby is an OCaml library that offers several implementations of balanced binary search trees. [ANN] Preview of Stripe client and mock server - DkStdRestApis. [ANN] CAISAR release 2.0, a platform for characterizing AI safety and robustness.
+
+新消息
+
+有价值的文章
+
+dune build.有趣的项目
+
+]]>@genType 被合并进编译器,无需任何依赖就能使用,当在 Rescript 中 @genType 了使用某些 Rescript built-in 的基本类型时,可能会生成有问题的 import 相关代码,例如:
@genType |
status 函数具有 Js.Json.t => option<Js.Json.t> 类型,那么在生成的 TypeScript 文件中,会出现这样的 import:
import type { Json_t as Js_Json_t } from "./Js.gen.tsx" |
而 Js.gen.tsx 这个文件是不存在的,解决方案是使用 @genType 的 shim:
在 rescript.json 中的 gentypeconfig 中添加 shim 配置:
... |
然后新建 Js.shim.ts:
export type Json_t = unknown; |
删除原来由 @genType 生成的 TypeScript 文件并重新生成
现在生成的 TypeScript 文件将会从 Js.shim.ts import 类型:
import type {Json_t as Js_Json_t} from '../../src/model/Js.shim.ts'; |
@genType 被合并进编译器,无需任何依赖就能使用,当在 Rescript 中 @genType 了使用某些 Rescript built-in 的基本类型时,可能会生成有问题的 import 相关代码,例如:
-@genType |
status 函数具有 Js.Json.t => option<Js.Json.t> 类型,那么在生成的 TypeScript 文件中,会出现这样的 import:
import type { Json_t as Js_Json_t } from "./Js.gen.tsx" |
而 Js.gen.tsx 这个文件是不存在的,解决方案是使用 @genType 的 shim:
在 rescript.json 中的 gentypeconfig 中添加 shim 配置:
... |
然后新建 Js.shim.ts:
export type Json_t = unknown; |
删除原来由 @genType 生成的 TypeScript 文件并重新生成
现在生成的 TypeScript 文件将会从 Js.shim.ts import 类型:
import type {Json_t as Js_Json_t} from '../../src/model/Js.shim.ts'; |
她看着我说到站了,我拉着她的手下车,该回家了,等下还要去买支圆珠笔,中性笔没法在药盒子上写用法用量。
+]]>“欢迎醒来,乐乐”
我抖了抖身上的花瓣,还未说话,就听见了爸爸兴奋的欢呼声。爷爷奶奶眼睛一亮,立刻跑了过来,春天的风似乎都柔软了,我摊了摊手,将他们卷到自己怀里。
春暖花开,一切都在,真好。
-]]> -