diff --git a/packages/bun-types/bun.d.ts b/packages/bun-types/bun.d.ts index d8c9402e2871..541d9ea1a705 100644 --- a/packages/bun-types/bun.d.ts +++ b/packages/bun-types/bun.d.ts @@ -8421,6 +8421,11 @@ declare module "bun" { readonly name: string; readonly kind: "exact" | "catch-all" | "optional-catch-all" | "dynamic"; readonly src: string; + /** + * Legacy name for {@link MatchedRoute.src} (same value) + * @deprecated Use src instead + */ + readonly scriptSrc: string; } /** diff --git a/test/integration/bun-types/fixture/fsrouter.ts b/test/integration/bun-types/fixture/fsrouter.ts index d3a13d039c74..1a1dca053d43 100644 --- a/test/integration/bun-types/fixture/fsrouter.ts +++ b/test/integration/bun-types/fixture/fsrouter.ts @@ -8,6 +8,9 @@ const router = new FileSystemRouter({ const match = router.match("/"); expectType(match?.name!); +// scriptSrc is the runtime's legacy name for src. +expectType(match?.src!); +expectType(match?.scriptSrc!); expectType(match?.pathname!); expectType>(match?.query!); expectType>(match?.params!);