Code Monkey home page Code Monkey logo

Comments (8)

bpedroza avatar bpedroza commented on June 12, 2024

I'm not sure where you're seeing Promise<any>. In the exported declaration file, I am seeing it as expected. It may be because the interfaces aren't included in the package. If you could tell me how to reproduce it would be very helpful.

from js-pkce.

mirai-will avatar mirai-will commented on June 12, 2024

@bpedroza

mkdir js-pkce-test
cd js-pkce-test
npm init
npm i typescript js-pkce
npx tsx --init
import PKCE from 'js-pkce'

const pkce = new PKCE({
    client_id: 'myclientid',
    redirect_uri: 'http://localhost:8080/auth',
    authorization_endpoint: 'https://authserver.com/oauth/authorize',
    token_endpoint: 'https://authserver.com/oauth/token',
    requested_scopes: '*',
  });

pkce.exchangeForAccessToken('dummy',{})

In VSCode small window, that return type was infered as Promise<any>

Strangely, in this reproduction, PHPStorm infers correctly. (My project does not.)

I think it is not js-pkce problem. Sorry.

from js-pkce.

bpedroza avatar bpedroza commented on June 12, 2024

Ok. I'm going to try to recreate on my own with vscode and see if I can fix it. Thanks.

from js-pkce.

pauliusg avatar pauliusg commented on June 12, 2024

Looks like npm package does not have types:
image

from js-pkce.

bpedroza avatar bpedroza commented on June 12, 2024

I'll have another look at this. Thanks for the additional detail.

from js-pkce.

marcosfreitas avatar marcosfreitas commented on June 12, 2024

How do you guys use this package in the browser? What is your tsconfig?

from js-pkce.

bpedroza avatar bpedroza commented on June 12, 2024

The readme has example of use in browser. You don't need a tsconfig.

from js-pkce.

bpedroza avatar bpedroza commented on June 12, 2024

This issue should be resolved in version 1.2.1

from js-pkce.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.