How to correctly import spread sheets + designer in typescript?

Posted by: wowakkom1 on 12 April 2021, 3:48 am EST

    • Post Options:
    • Link

    Posted 12 April 2021, 3:48 am EST

    Hi!

    I’m evaluating the purchase of SpreadJs, and it looks promising so far!

    My question is, what’s the correct way to import both spread sheets and spread sheets designer in typescript? I want to have correct intellisense in Visual Studio Code. I installed the packages via npm.

    I was unable to import it using the “import” syntax. e.g.

    import * as GC from “@grapecity/spread-sheets”;

    import * as GCDesigner from “@grapecity/spread-sheets-designer”;

    I can import spread sheets alone, but if I try to import spread designer too, my webpack-based compilation process dies (some kind of a memory overflow).

    What I managed to do was to use the triple slash directive syntax.

    ///

    ///

    And I added the .js files to my build process.

    BUT to make it work, I had to delete the “export = GC;” lines in both d.ts files.

    What am I doing wrong?

  • Posted 12 April 2021, 11:46 pm EST

    Hi,

    The first import statement(import * as GC from “@grapecity/spread-sheets”;

    import * as GCDesigner from “@grapecity/spread-sheets-designer”;) is the recommended way to use the designer. It should not throw any errors. Could you please share a small sample that replicates the issue so that we could investigate it further and assist you accordingly?

    You may also refer to the following attached sample that we used for testing.

    Regards

    Avinash

    angularSample.zip

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels