Gavant / glint-template-types

MIT License
19 stars 20 forks source link

Add string type to transform parameter in FaIconComponentSignature #82

Closed 3P-GT closed 1 year ago

3P-GT commented 1 year ago

glint-template-types has types for the ember-fontawesome module.

Within ember-fontawesome the class FaIconComponent has an optional parameter named transform that is typed as Transform however the component also supports a string type for this parameter which is not currently supported by glint-template-types:

https://github.com/FortAwesome/ember-fontawesome/blob/50c5d0f93bb5d992633bad98f64e39ae52541e8e/addon/components/fa-icon.js#L91-L96

    const transform = objectWithKey(
      'transform',
      typeof this.args.transform === 'string'
        ? parse.transform(this.args.transform)
        : this.args.transform
    );

this pr adjusts the transform parameter type to permit a string argument:

    export interface FaIconComponentSignature {
        Element: SVGElement;
        Args: {
            icon: IconName;
            prefix?: IconPrefix;
            size?: SizeProp;
            rotation?: RotateProp;
            pull?: PullProp;
            pulse?: boolean;
            border?: boolean;
            listItem?: boolean;
            flip?: FlipProp;
            spin?: boolean;
            fixedWidth?: boolean;
-           transform?: Transform;
+           transform?: Transform | string;
            symbol?: boolean;
        };
    }