#Can't figure out how to import from this .d.ts

8 messages · Page 1 of 1 (latest)

signal musk
#

Hi, sorry for the dumb question.

strophe.js has the following .d.ts:

declare global {
    namespace Strophe {
        class Connection {

For the life of me, I can't figure out how to import from this. Things that didn't work:

import { Strophe }    from 'strophe.js';  // no exported member 'Strophe'
import { Connection } from 'strophe.js';  // no exported member 'Connection'
import Strophe        from 'strophe.js';  // 'Status' does not exist on type 'typeof import(...
import * as Strophe   from 'strophe.js';  // TS can't find a useful member on the returned object, though node can

What do I do to get at members of this module?

#

notably,

$ node
Welcome to Node.js v19.8.1.
Type ".help" for more information.

> const r = require('strophe.js');
undefined

> Object.keys(r)
[ '$build', '$iq', '$msg', '$pres', 'Strophe' ]

It really seems like I ought to be able to import { Strophe } from 'strophe.js';

#

but that's from require, not import :/

mellow flint
#

it's global, you don't need to import it

signal musk
#

oh :/

#

i really don't like using javascript code this old.

#

this thing is made in coffeescript and jquery. it smells like cabbage.

#

thank you.