Typescript definitions missing for GridOptions.toolbar

3 posts, 0 answers
  1. Rowan
    Rowan avatar
    21 posts
    Member since:
    Jul 2014

    Posted 01 Mar 2015 Link to this post

    Hello,

    The Typescript definitions for GridOptions.toolbar declare it only as GridToolbarItem[]. However in Javascript that setting also supports a string or function passed in to allow custom html templates.

    The Typescript toolbar definition should either be changed to 'any', or use a union type of all options (Typescript 1.4).

    regards,
    Rowan
  2. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 04 Mar 2015 Link to this post

    Hello Rowan,

    Indeed, using union types is the best approach, yet we have not implemented them in our TS definitions yet. I'm afraid that using any would remove the typed benefits that are available now. You can change the definition to a union type until we start shipping the union types out of the box. Suggesting union types for implementation on UserVoice may shorten the time until they are available.

    Regards,
    Alex Gyoshev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. Dawid
    Dawid avatar
    1 posts
    Member since:
    Mar 2016

    Posted 30 Mar in reply to Rowan Link to this post

    Hi,

    The problem has been fixed few days ago:

    https://github.com/DefinitelyTyped/DefinitelyTyped/commit/b14601af3fb2ad72d5048e94188a569a1838fb9c#diff-a957eca1382f9b57c1a833b4264d680c

    Regards,
    Dawid Pytel

Back to Top