the docs also say to do something like ```ts interface Env { MY_SERVICE: Service<MyService>; }```
the docs also say to do something like
interface Env {
MY_SERVICE: Service<MyService>;
}You might do this by defining the interface in a separate shared TypeScript file, or by extracting a .d.ts type declaration file from your server code...

WorkerEntrypoint that I want to use as its default exportentrypoint?.wrangler directories and restarted my workers and now it's working? node_compat as a top-level option is legacy and should be avoided whenever possible.nodejs_compat as a compat flag is good and won't incur any kind of performance issues▲ [WARNING] This worker is bound to live services: PDFPARSER_SERVICE (pdfparser#PdfParserService)upload_source_maps or services -> entrypointhello as we couldn't find a wrangler dev session for service "pdfparser" to proxy to"[[services]]
binding = "PDFPARSER_SERVICE"
service = "pdfparser"compatibility_date = "2024-04-06"
compatibility_flags = [ "nodejs_compat" ]WorkerEntrypointentrypointnode_compatnodejs_compat▲ [WARNING] This worker is bound to live services: PDFPARSER_SERVICE (pdfparser#PdfParserService)upload_source_mapsservices -> entrypointhelloasync function membershipRequestHandler (request: Request, env: Env) {
const body = await request.arrayBuffer();
console.log(`Parsing PDF size ${body.byteLength / 1024 / 1024} MBs`)
const result = await env.PDFPARSER_SERVICE.parsePdf(body);export class PdfParserService extends WorkerEntrypoint<Env> {
async fetch() { return new Response("Hello from Worker B"); }
async parsePdf(data: ArrayBuffer) {
return await pdf2array(Buffer.from(data));
}
}[[services]]
binding = "PDFPARSER_SERVICE"
service = "pdfparser"
entrypoint = "PdfParserService"name = "newdo"
main = "src/index.ts"
compatibility_date = "2024-04-06"
compatibility_flags = [ "nodejs_compat" ]
logpush = true
upload_source_maps = true
[vars]
SERVICE_NAME = "datawrangler"
[[services]]
binding = "PDFPARSER_SERVICE"
service = "pdfparser"
entrypoint = "PdfParserService"
[[d1_databases]]
binding = "DB" # i.e. available in your Worker on env.DB
database_name = "memberships"
database_id = "xxxxxxxxxxx"
migrations_dir = "../database/src/migrations"
[[durable_objects.bindings]]
name = "MY_DURABLE_OBJECT"
class_name = "MyDurableObject"
[[migrations]]
tag = "v1"
new_classes = ["MyDurableObject"]