Ignoring the type error, Using the following binding on a resource correctly binds it on Cloudflare, but breaks type generation:
sst.cloudflare.binding({
type: "cloudflare.binding",
binding: "versionMetadata",
properties: {
type: "version_metadata", // Hack! The sdk spreads properties onto the final binding so this gets used instead of the one above which doesn't map to anything in SST.
name: this.#resourceName,
},
})
Produces (included supported resources for comparison):
// cloudflare
import * as cloudflare from "@cloudflare/workers-types";
declare module "sst" {
export interface Resource {
"Api": cloudflare.Service
"Auth": cloudflare.Service
"Hyperdrive": cloudflare.
"MailJobDLQ": cloudflare.Queue
"MailJobQueue": cloudflare.Queue
"VersionMetadata": cloudflare.
}
}