Code Monkey home page Code Monkey logo

Comments (3)

JanMiksovsky avatar JanMiksovsky commented on June 10, 2024 1

I've finally had a chance to look at this. There are several things going on here.

  • The TypeScript declarations in ListBox.d.ts was missing SelectedValueAPIMixin, the mixin that defines the value property. I've checked in a fix for that in the main branch.
  • The render method isn't something that's exposed with a string name "render", it's defined with a Symbol called internal.render. For a long time, TypeScript had problems with Symbol-keyed methods like the ones Elix uses, so the Elix code base resorted to some shenanigans that, as a side effect, convinced TypeScript that there is a method called _render. I believe TypeScript has improved its support for Symbol-keyed methods, so it may be possible to drop those shenanigans.
  • Some of the plain components like PlainListBox are missing a .d.ts file. I've just checked in one for PlainListBox, and this partially addresses the problem. Using what's on the main branch, it should now be possible to get type information for an import from elix/src/base/ListBox.js or elix/src/plain/PlainListBox.js.
  • But there's still something preventing the list box types from going all the way through to an import from elix/define/ListBox.js. That's puzzling, as it is possible to get types for elix/define/DateComboBox.js, and as far as I can tell both the list box and date combo box are defined in exactly the same way.

I'd investigate further, but I really don't have much to go on.

from elix.

jmagaram avatar jmagaram commented on June 10, 2024

https://codesandbox.io/s/elix-typescript-yeprli

from elix.

jmagaram avatar jmagaram commented on June 10, 2024

This seems to work - import types from the base folder. Not sure why that is necessary.

import type ListBox from "elix/src/base/ListBox";

Well maybe not. I can access the selectedIndex and selectedItem props, but not value. There is a _render but not a render.

from elix.

Related Issues (20)

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.