Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript Support Broken #989

Open
jordan-erisman opened this issue Oct 23, 2023 · 2 comments
Open

TypeScript Support Broken #989

jordan-erisman opened this issue Oct 23, 2023 · 2 comments

Comments

@jordan-erisman
Copy link

jordan-erisman commented Oct 23, 2023

Description

Types added in #983 breaks existing project using @types/enigma.js

Steps to Reproduce

const global = await enigma.create(config).open();

** Property openDoc does not exist on type  **
const app = await global.openDoc(appId);
Expected behavior

New types should match functionality available in library. Similar to @types/enigma.js

Actual behavior

Property openDoc does not exist on type

@nilzona
Copy link
Contributor

nilzona commented Nov 7, 2023

Hello @jordan-erisman. Can you expand your example a bit more? .. specifically I want to know if you have created your own global type or augmented the types in @types/enigma.js somehow. Because as you can see here https://www.npmjs.com/package/@types/enigma.js?activeTab=code .. there is actually no type for the global api there.

@PatoDeVille
Copy link

PatoDeVille commented Dec 2, 2023

i am encountering the same problem, where i am left with basically a type free module in my application (angular app with qlik integration via enigmajs) , because
i cant get these types as per the documentation here https://qlik.dev/apis/json-rpc/qix/field/#%23%2Fentries%2FField

(its showing field but i mean all of it) and it all starts when you..

import enigma from 'enigma.js'

const config: enigmaJS.IConfig = {
     // ...
    };
    
    const session: enigmaJS.ISession = await enigma.create(config);
    const global = await session.open()

    //Property 'openDoc' does not exist on type 'IGeneratedAPI'
    global.openDoc(...)

i dont know what i might be missing, or if i have to extend any types or something, funny thing...the code works if i keep any in most of it, so from there, documents, generic objects, etc etc. all is untyped and is very challenging to code unless you know your way through the api

i am using version 2.9.0 and version 2.2.2 for @types

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants