Service binding type

What is the correct type for a service binding (worker to worker)? I have currently typed as
Fetcher
but I'm getting an error trying to provide a body to the request:

interface Platform {
  env: {
    API: Fetcher
  }
}

const formData = new FormData()

const res = await platform.env.API.fetch("/send-otp", {
  method: "POST",
  body: formData,
})

This gives me an error on
body
:
Type 'FormData' is not assignable to type 'BodyInit | null | undefined'
so I assume I'm typing the binding incorrectly as
RequestInit
should accept
FormData
based on the docs for
Fetch
.

The docs suggest that Fetcher is the correct type, but as above that doesn't seem right? https://developers.cloudflare.com/workers/runtime-apis/service-bindings
Service bindings are an API that facilitate Worker-to-Worker communication via explicit bindings defined in your configuration. A Service binding
Was this page helpful?