假设我定义了以下类型:
type queueParams = { durable: bool }; class type amqpChannelT = [@bs] { pub assertQueue: string => queueParams => Js.Promise.t(unit); };
然后调用以下命令:
channel##assertQueue("exampleQueue", {"durable": bool});
结果:
This has type: {. "durable": bool} But somewhere wanted: queueParams (defined as
我怎样才能通过正确的东西?为什么我传递的东西不是唱片?那个点符号的意思是什么?
let jsObject = {"durable": true}; let reasonRecord = {durable: true};
Js.t('a)
play around with an example here
https://bucklescript.github.io/docs/en/object-deprecated