const ox = await new Promise(resolve=>
libFunc(x=> {
// yを作成
resolve(x)
return y
}))
とかじゃ駄目なん?