DenoDDeno
Powered by
fazbdillahF
Denoβ€’5mo 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
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."
);
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?
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,944Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

deno_core Extension with Global Access
orvitOorvit / help
4y ago
Deno + TypeScript
TimTTim / help
2y ago