DenoDDeno
Powered by
hiyayakk0H
Denoβ€’17mo ago
hiyayakk0

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" />
/// <reference types="npm:obsidian/obsidian.d.ts" />
and
/// <reference types="npm:obsidian" />
/// <reference types="npm:obsidian" />


but I still get reference errors:
error: Uncaught (in promise) ReferenceError: Plugin is not defined
error: Uncaught (in promise) ReferenceError: Plugin is not defined


I've also tried addind
npm:obsidian
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.
obsidian-api/obsidian.d.ts at master Β· obsidianmd/obsidian-api
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,944Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

walk() include only last directory...
MqxMMqx / help
3y ago
deno check: Module '"internal:///missing_dependency.d.ts"' has no exported member...
Patrick (he/him)PPatrick (he/him) / help
3y ago