Giter Site home page Giter Site logo

Comments (4)

kreuzerk avatar kreuzerk commented on September 24, 2024

Hi @TitoMoi - Thanks for reporting this. I investigated a bit in this issue and I think you are missing the generateType: true in your config.

If I take your config and add the generateType: true option I get the following model.d.ts file.

export declare type IconType = 'expressionLess' | 'full' | 'laughing' | 'smilingFace';
export interface IconInterface {
    name: IconType;
    data: string;
}

from svg-to-ts.

kreuzerk avatar kreuzerk commented on September 24, 2024

does this fix the issue?

from svg-to-ts.

TitoMoi avatar TitoMoi commented on September 24, 2024

Hi @kreuzerk,

I've added the generateType: true and works perfectly, the model in the output build is correct and the model in the additionalModelOutputPath is correct, the difference I see is that in command line is not necessary to specify the generateTypeprop, that caused me confusion, this is my command line version:

svg-to-ts -s "projects/merca-icons/svgs/*.svg" -c files -o projects/merca-icons/svgs -d CAMEL -i IconInterface -t IconType -p "" --modelFileName merca-icon.model --additionalModelOutputPath projects/merca-icons/src/lib/icon --compileSources true

*the scaping " double comma is for windows users their command line doesn't like the globs so must be wrapped in double comma and package doesn't like double comma inside command so must be escaped.

btw awesome project!

from svg-to-ts.

kreuzerk avatar kreuzerk commented on September 24, 2024

Hi @TitoMoi

Thx a lot for reporting this issue. You were absolutely right, the default options were not correctly detected when provided over a config object. With this fix you should be able to remove the generateType: true from your svg-to-ts config.

It should now behave in the same way as the command line interface.

from svg-to-ts.

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.