Skip to content

Instantly share code, notes, and snippets.

@twobit
Created August 17, 2017 05:26
Show Gist options
  • Select an option

  • Save twobit/cfb7f159b4419d3900b5063da1c4c2f2 to your computer and use it in GitHub Desktop.

Select an option

Save twobit/cfb7f159b4419d3900b5063da1c4c2f2 to your computer and use it in GitHub Desktop.

Revisions

  1. twobit created this gist Aug 17, 2017.
    32 changes: 32 additions & 0 deletions react-input-autosize.d.ts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,32 @@
    // Type definitions for react-input-autosize 1.1
    // Project: https://github.com/JedWatson/react-input-autosize
    // Definitions by: Stephen Murphy <https://github.com/twobit>
    // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

    /// <reference types="react"/>

    import * as React from 'react';

    interface AutosizeInputProps extends React.HTMLAttributes<HTMLInputElement> {
    /** className for the outer element */
    className?: string;
    /** default field value */
    defaultValue?: string;
    /** className for the input element */
    inputClassName?: string;
    /** css styles for the input element */
    inputStyle?: object;
    /** minimum width for input element */
    minWidth?: number | string;
    /** onAutosize handler */
    onAutosize?: (newWidth: number) => void;
    /** placeholder text */
    placeholder?: string;
    /** don't collapse size to less than the placeholder */
    placeholderIsMinWidth?: boolean;
    /** css styles for the outer element */
    style?: object;
    value?: string;
    }

    export default class AutosizeInput extends React.Component<AutosizeInputProps> {}