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

Can't use types after upgrade #204

Open
MarcusElevait opened this issue Apr 23, 2024 · 1 comment
Open

Can't use types after upgrade #204

MarcusElevait opened this issue Apr 23, 2024 · 1 comment

Comments

@MarcusElevait
Copy link

3.0.2

20.11.0

We have an import like this:

import {
    http as graphDbHttp,
    parser as graphDbParser,
    query as graphDbQuery,
    repository as graphDbRepository,
} from 'graphdb';

And use it for example here:
private client: graphDbRepository.RDFRepositoryClient;

Now after the upgrade, we get the error:

TS2724:
"/home/marcus/Projects/aicosy/node_modules/graphdb/lib/index".repository
has no exported member named RDFRepositoryClient. Did you mean BaseRepositoryClient?

Probably this is related to the changed type generation here: commit

The export in the library code looks like this:

export namespace repository {
    let RepositoryClientConfig: typeof import("./repository/repository-client-config");
    let BaseRepositoryClient: typeof import("./repository/base-repository-client");
    let RDFRepositoryClient: typeof import("./repository/rdf-repository-client");
    let StatementPayload: typeof import("./repository/statement-payload");
    let AddStatementPayload: typeof import("./repository/add-statement-payload");
    let GetStatementsPayload: typeof import("./repository/get-statements-payload");
    let RepositoryType: {
        SE: string;
        MASTER: string;
        WORKER: string;
        FREE: string;
        ONTOP: string;
        GRAPHDB: string;
    };
    let RepositoryConfig: typeof import("./repository/repository-config");
}

So no member of the namespace is exported.

@FNieschalk
Copy link

Same issue using 3.0.3 and 3.0.4: While the constructors are available, the types can not be found. Both IDE (VSCode) and @nx/webpack build give me an error that the import can not be found.

Right now it is ok for us to get the type from the constructor's prototype...
type RDFRepositoryClient = typeof graphDbRepository.RDFRepositoryClient.prototype;
...but of course it would be nicer to have the actual type import from the library.

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

2 participants