I'm trying to write some code that uses Deno and rdflib. And failing miserably.
Here's my test program:
// @deno-types="https://dev.jspm.io/npm:rdflib@2.2.7/lib/index.d.ts"
import { Namespace } from 'https://dev.jspm.io/npm:rdflib@2.2.7/lib/index'
when I ask deno to cache the remote packages, it fails:
$ deno --unstable cache rdflib.ts
Check file:///home/ian/projects/personal/deno-experiments/rdflib.ts
error: TS2502 [ERROR]: 'thisArg' is referenced directly or indirectly in its own type annotation.
bind<T>(this: T, thisArg: ThisParameterType<T>): OmitThisParameter<T>;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
at asset:///lib.es5.d.ts:350:22
TS2614 [ERROR]: Module '"https://dev.jspm.io/npm:rdflib@2.2.7/lib/query"' has no exported member 'Query'. Did you mean to use 'import Query from "https://dev.jspm.io/npm:rdflib@2.2.7/lib/query"' instead?
import { Query } from './query';
~~~~~
at https://dev.jspm.io/npm:rdflib@2.2.7/lib/index.d.ts:16:10
TS2614 [ERROR]: Module '"https://dev.jspm.io/npm:rdflib@2.2.7/lib/updates-via"' has no exported member 'UpdatesSocket'. Did you mean to use 'import UpdatesSocket from "https://dev.jspm.io/npm:rdflib@2.2.7/lib/updates-via"' instead?
import { UpdatesSocket } from './updates-via';
~~~~~~~~~~~~~
at https://dev.jspm.io/npm:rdflib@2.2.7/lib/index.d.ts:26:10
TS2614 [ERROR]: Module '"https://dev.jspm.io/npm:rdflib@2.2.7/lib/updates-via"' has no exported member 'UpdatesVia'. Did you mean to use 'import UpdatesVia from "https://dev.jspm.io/npm:rdflib@2.2.7/lib/updates-via"' instead?
import { UpdatesVia } from './updates-via';
~~~~~~~~~~
at https://dev.jspm.io/npm:rdflib@2.2.7/lib/index.d.ts:27:10
TS2749 [ERROR]: 'Store' refers to a value, but is being used as a type here. Did you mean 'typeof Store'?
at https://dev.jspm.io/npm:rdflib@2.2.7/lib/index.d.ts:32:32
... many more lines ...
TS2614 [ERROR]: Module '"https://dev.jspm.io/npm:rdflib@2.2.7/lib/utils/termValue"' has no exported member 'termValue'. Did you mean to use 'import termValue from "https://dev.jspm.io/npm:rdflib@2.2.7/lib/utils/termValue"' instead?
export { termValue } from './utils/termValue';
~~~~~~~~~
at https://dev.jspm.io/npm:rdflib@2.2.7/lib/index.d.ts:40:10
Found 44 errors.
As far as I can tell, the problem is with lines in the remote code that do relative imports. Do such relative imports not work with Deno, or am I missing some vital step, or is my approach doomed?
Version info:
$ deno --version
deno 1.12.2 (release, x86_64-unknown-linux-gnu)
v8 9.2.230.14
typescript 4.3.5