GithubHelp home page GithubHelp logo

Comments (8)

rubenv avatar rubenv commented on July 26, 2024

I'm no expert on TypeScript typings, so I can't really say for sure what the fix is.

@septs Can you have a look at this?

from pofile.

septs avatar septs commented on July 26, 2024

@mrjpierce first, this package not is esmodule
The as designed,

module.exports = PO;

@rubenv the issue require use esmodule written this package
WARNING: This needs to break the API backwards compatibility

see https://www.typescriptlang.org/docs/handbook/modules.html#export--and-import--require

from pofile.

septs avatar septs commented on July 26, 2024

About get PO.Item instance type, please use the workaround code

type Item = InstanceType<typeof PO["Item"]>

See https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#conditional-types

from pofile.

mrjpierce avatar mrjpierce commented on July 26, 2024

@septs

type Item = typeof PO["Item"]["prototype"];

This seems to work for now ๐Ÿ‘. Xiรจxiรจ

from pofile.

septs avatar septs commented on July 26, 2024

@rubenv The issue closable

from pofile.

rubenv avatar rubenv commented on July 26, 2024

@septs thanks!

from pofile.

septs avatar septs commented on July 26, 2024

@rubenv I want to rewrite this codebase using TypeScript.

from pofile.

rubenv avatar rubenv commented on July 26, 2024

@septs Could you elaborate a bit on why and how you'd want to do this?

Keep in mind that this is a project I consider "finished": no big new functionality is needed (it does what it needs to do) and we can't break API / backwards compatibilty.

Rewrites are always risky. I'm all for strongly typing things, but it can only be done incrementally and in an extremely careful way: no user should ever see their code break.

from pofile.

Related Issues (14)

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.