Skip to content
This repository has been archived by the owner on Aug 10, 2024. It is now read-only.

nyanrus/XPIDL2DTS

Repository files navigation

XPIDL2DTS

Firefox's XPCOM has no type auto-complete in js!
So, I made a tool to convert XPIDL(XPCOM's IDL files) to d.ts!

this tool's purpose is to make better firefox's js development esp. Floorp-Projects/Floorp

How to run

pnpm i

to install libraries and

enter FIREFOX_ROOT to main.ts like

function main() {
  processAll4Test("[[FIREFOX_ROOT]]", [
    "xpcom",
    "netwerk/mime",
    "layout",
    "js",
  ]);
}

and run!

pnpm tsx main.ts

and you will get dist folder that includes pp (preprocessed) and p(processed)
then you can use the p(processed) folder's contents!

If you want to format to these dts, You can type

pnpm biome format --write ./dist/p

or you can use prettier and/or eslint if you install
and use like

pnpm prettier --write 'dist/p/**/*.d.ts' --ignore-path ""

(you should include --ignore-path "" because prettier ignores files that git ignores)
or

pnpm eslint --fix ./dist/p/**/*.d.ts