diff options
author | 2022-11-22 02:13:03 -0800 | |
---|---|---|
committer | 2022-11-22 02:13:03 -0800 | |
commit | d21aee514375e12335c61936ae302cd67f1f73bf (patch) | |
tree | e4985c55d27f7d1bcb7c8fa56441bd4711e15433 /src/bun.js/api/filesystem_router.classes.ts | |
parent | 65a56c2560a1ef7b036995a8eade45236f76f819 (diff) | |
download | bun-d21aee514375e12335c61936ae302cd67f1f73bf.tar.gz bun-d21aee514375e12335c61936ae302cd67f1f73bf.tar.zst bun-d21aee514375e12335c61936ae302cd67f1f73bf.zip |
Introduce `Bun.FileSystemRouter` API
Diffstat (limited to 'src/bun.js/api/filesystem_router.classes.ts')
-rw-r--r-- | src/bun.js/api/filesystem_router.classes.ts | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/src/bun.js/api/filesystem_router.classes.ts b/src/bun.js/api/filesystem_router.classes.ts new file mode 100644 index 000000000..bf492a1c2 --- /dev/null +++ b/src/bun.js/api/filesystem_router.classes.ts @@ -0,0 +1,69 @@ +import { define } from "../scripts/class-definitions"; + +export default [ + define({ + name: "FileSystemRouter", + construct: true, + finalize: true, + JSType: "0b11101110", + + proto: { + match: { + fn: "match", + length: 1, + }, + routes: { + getter: "getRoutes", + cache: true, + }, + reload: { + fn: "reload", + length: 0, + }, + origin: { + getter: "getOrigin", + cache: true, + }, + style: { + getter: "getStyle", + cache: true, + }, + }, + klass: {}, + }), + + define({ + name: "MatchedRoute", + noConstructor: true, + JSType: "0b11101110", + construct: true, + finalize: true, + proto: { + params: { + getter: "getParams", + cache: true, + }, + pathname: { + getter: "getPathname", + cache: true, + }, + query: { + getter: "getQuery", + cache: true, + }, + name: { + getter: "getName", + cache: true, + }, + kind: { + getter: "getKind", + cache: true, + }, + filePath: { + getter: "getFilePath", + cache: true, + }, + }, + klass: {}, + }), +]; |