dijs / wiki

Wikipedia Interface for Node.js
MIT License
313 stars 62 forks source link

v4.11.0: Property 'tables' does not exist on type 'Page' #97

Closed divanvb closed 5 years ago

divanvb commented 5 years ago

Using the test example, I get the following error: Property 'tables' does not exist on type 'Page' on v4.11.0

EDIT: page.fullInfo() also doesn't exist and can't be used.

EDIT: I see there are a few typings for the page interface that aren't there such as tables & fullInfo

divanvb commented 5 years ago

Making a comment in case it fell off your radar again.

dijs commented 5 years ago

Most likely a old wikijs version issue. I could not reproduce this. Unless you have a code example which reproduces this, I am closing this issue.

divanvb commented 5 years ago

If I do: import * as wikijs from 'wikijs' and then do the whole implementation up until the point you call page.fullInfo() it throws that error. I'm using typescript and javascript aka the require way of importing the module if that makes sense?

dijs commented 5 years ago

Well, this is a good test case. I do not work in typescript at all. Can you not use default imports in Typescript?

e.g.

import wiki from 'wikijs'
divanvb commented 5 years ago

You can use imports and require with typescript as typescript gets compiled down to JavaScript anyway. Just better way of writing code etc.

I'll try and make a contribution to the typings file when I get a chance if you'd like? Just need to go through the code.

dijs commented 5 years ago

That would be awesome!