aboutsummaryrefslogtreecommitdiff
path: root/packages/bun-types/tests/fsrouter.test-d.ts
blob: 05556f60a6edcfcbb96b404d63aaef2ee094a1a0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
import { FileSystemRouter } from "bun";
import { expectType } from "tsd";

const router = new FileSystemRouter({
  dir: import.meta.dir + "/pages",
  style: "nextjs",
});

const match = router.match("/");
expectType<string>(match?.name!);
expectType<string>(match?.pathname!);
expectType<Record<string, string>>(match?.query!);
expectType<Record<string, string>>(match?.params!);