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 definitions for core client? #125

Open
sekhavati opened this issue Jun 10, 2022 · 1 comment
Open

Typescript definitions for core client? #125

sekhavati opened this issue Jun 10, 2022 · 1 comment

Comments

@sekhavati
Copy link

sekhavati commented Jun 10, 2022

Hello 👋 When using this module as per the readme instructions, we don't get type definitions for the core client object. It comes back as any type. This then has repercussions for the rest of its usage throughout an app. For example:

const gocardless = require('gocardless-nodejs');

const client = gocardless(...); // ==> client is of type 'any'

const mandate = await client.mandates.find(mandateId); // ==> mandate is of type 'any'

etc etc

Perhaps I've missed something blatantly obvious...?

@sekhavati sekhavati changed the title Typescript definitions missing? Typescript definitions for client? Jun 13, 2022
@sekhavati sekhavati changed the title Typescript definitions for client? Typescript definitions for core client? Jun 13, 2022
@mauricedoepke
Copy link

mauricedoepke commented Dec 9, 2022

@sekhavati

You can use it like this to get typings:

import { Environments } from "gocardless-nodejs/constants";
import { GoCardlessClient } from "gocardless-nodejs/client";
const client = new GoCardlessClient("your_access_token_here", Environments.Sandbox);

The way defined in the docs seems broken.

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