react-scale-text icon indicating copy to clipboard operation
react-scale-text copied to clipboard

Needs typescript definitions

Open benhickson opened this issue 2 years ago • 1 comments

benhickson avatar Sep 26 '23 16:09 benhickson

chatGPT suggested these and seem to work (use at your own risk, I haven't checked if they're correct) :

declare module 'react-scale-text' {
  import * as React from 'react';

  interface ScaleTextProps {
    /** The minimum font size (in pixels) to be used when scaling down the text */
    minFontSize?: number;
    /** The maximum font size (in pixels) to be used when scaling up the text */
    maxFontSize?: number;
    /** Any additional class names to apply to the component */
    className?: string;
    /** Optional callback function that gets called when the font size changes */
    onFontSizeChange?: (fontSize: number) => void;
    /** Children components to be rendered inside the ScaleText component */
    children: React.ReactNode;
    /** If true, only the width of the text will be scaled */
    widthOnly?: boolean;
  }

  export default class ScaleText extends React.Component<ScaleTextProps> {}
}

maartenvandillen avatar Jun 25 '24 13:06 maartenvandillen