@@ -68,6 +68,14 @@ pub extern fn readDirNames(path: String) -> [String];
6868/// `Deno.statSync(path).size` in bytes.
6969pub extern fn statSize(path: String) -> Int;
7070
71+ /// `Deno.statSync(path).isFile` — true if `path` is a regular file.
72+ /// Throws on a missing path (pair with `isNotFound` for the absent case).
73+ pub extern fn statIsFile(path: String) -> Bool;
74+
75+ /// `Deno.statSync(path).isDirectory` — true if `path` is a directory.
76+ /// Throws on a missing path (pair with `isNotFound` for the absent case).
77+ pub extern fn statIsDirectory(path: String) -> Bool;
78+
7179/// Recursive walk under `root` — every file path beneath it, depth-first.
7280/// Mirrors `std/fs/walk` for the common case (no glob filter; callers
7381/// filter by extension). Throws on a missing root via `Deno.readDirSync`.
@@ -164,29 +172,14 @@ pub extern fn dateNow() -> Int;
164172/// returns epoch millis as `Int`.
165173pub extern fn dateNowIso() -> String;
166174
167- /// `performance.now()` — high-resolution sub-millisecond timer in
168- /// milliseconds since process start. Use for fine-grained timings (the
169- /// existing `dateNow()` returns coarse epoch-millis as Int). Standard
170- /// JS performance API, present in Deno, Node ≥ 16, and modern browsers.
171- pub extern fn performance_now() -> Float;
172-
173- // ── Randomness (PRNG, non-crypto) ──────────────────────────────────
174- //
175- // Bound on `Math.random()` — the JS PRNG, **not cryptographically
176- // secure**. Sufficient for property-test input generation, sampling,
177- // and simulations. For cryptographic random bytes, a separate
178- // `crypto_random_bytes` binding routing to `crypto.getRandomValues()`
179- // belongs in a different sub-issue (different host call, different
180- // threat model).
181-
182- /// `Math.random()` — uniform pseudo-random Float in `[0, 1)`.
183- pub extern fn math_random() -> Float;
184-
185- /// Uniform u32 in `[0, 2^32)`, derived from `math_random()`.
186- pub extern fn random_u32() -> Int;
175+ // ── Module identity ────────────────────────────────────────────────
187176
188- /// Uniform Int in `[lo, hi)`. Undefined behaviour if `hi <= lo`.
189- pub extern fn random_in_range(lo: Int, hi: Int) -> Int;
177+ /// `import.meta.url` — the absolute URL of the importing module. The JS
178+ /// idiom for "find my own location" (cf. `__dirname` / `__filename`). At
179+ /// Deno-ESM top level, lowers to the bare `import.meta.url` expression;
180+ /// callers parse it (`new URL(...)`/`fileURLToPath`/string split) for
181+ /// directory-relative behaviour.
182+ pub extern fn importMetaUrl() -> String;
190183
191184// ── CLI ────────────────────────────────────────────────────────────
192185
0 commit comments