hiyayakk0
hiyayakk02w ago

Include d.ts only module with global module

I'm trying to write a plugin for obsidian, which works by providing globals in place. They provide a package for the types for these globals in npm "obsidian" https://github.com/obsidianmd/obsidian-api/blob/master/obsidian.d.ts I have tried using a triple slash reference like /// <reference types="npm:obsidian/obsidian.d.ts" /> and /// <reference types="npm:obsidian" /> but I still get reference errors: error: Uncaught (in promise) ReferenceError: Plugin is not defined I've also tried addind npm:obsidian as a dependency and importing the classes into the file but I get module resolution errors:
error: Could not resolve 'npm:obsidian@1.7.2'.

Caused by:
[ERR_MODULE_NOT_FOUND] Cannot find module 'file:///var/home/<user>/.cache/deno/npm/registry.npmjs.org/obsidian/1.7.2/index.js'
error: Could not resolve 'npm:obsidian@1.7.2'.

Caused by:
[ERR_MODULE_NOT_FOUND] Cannot find module 'file:///var/home/<user>/.cache/deno/npm/registry.npmjs.org/obsidian/1.7.2/index.js'
Lastly I've tried setting it in compiler options in deno.json but it also hasn't worked. Thanks in advance for any help.
GitHub
obsidian-api/obsidian.d.ts at master · obsidianmd/obsidian-api
Type definitions for the latest Obsidian API. Contribute to obsidianmd/obsidian-api development by creating an account on GitHub.
0 Replies
No replies yetBe the first to reply to this messageJoin