fazbdillahF
Denoβ€’3mo ago
fazbdillah

Load Typescript into deno_core::extension!

Hello,

As we know, deno_core provide extension that makes possible to create "built-in" functions or classes. But, I want to provide a typed API, if possible via Typescript.

Currently, I use deno_core to implement function to extract / mining data in Typescript. It will be very convenient to also provide built-in types that has type.

This is how I use the extension, notice the std:index.ts entry. Unfortunately, it doesn't work.

deno_core::extension!(
    ext_std,
    ops = [
        get_text_content,
    ],
    esm_entry_point = "std:index",
    esm = [
        dir "jsenv/stdlib",
        "std:index.ts" = "index.ts",
        "std:html" = "html.js",
        "std:locale" = "locale.js",
    ],
    docs = "A standard library for parsing data."
);


How to provide at least built-in type definition?
Was this page helpful?