Skip to content

Commit

Permalink
Improve TypeScript definitions (#52)
Browse files Browse the repository at this point in the history
* Include className as a prop

* Include all properties

* Improve TypeScript definitions

* Update author notice in the typings and use semicolons consistently.
  • Loading branch information
gvso authored and leMaik committed Jul 29, 2018
1 parent 49eb850 commit 424bc99
Showing 1 changed file with 32 additions and 7 deletions.
39 changes: 32 additions & 7 deletions src/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,45 @@
// Type definitions for Material Search Bar
// Project: https://github.com/TeamWertarbyte/material-ui-search-bar
// Definitions by: [Tyler Kellogg] <[email protected]>
// Original definitions by: [Tyler Kellogg] <[email protected]>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

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

declare module 'material-ui-search-bar' {
export interface SearchBarProps {
/**
* Whether to clear search on escape.
*/
cancelOnEscape?: boolean;
/**
* Override or extend the styles applied to the component.
*/
classes?: {
root?: string,
iconButton?: string,
iconButtonHidden?: string,
iconButtonDisabled?: string,
searchIconButton?: string,
icon?: string,
input?: string,
searchContainer?: string
};
/**
* Custom top-level class.
*/
className?: string;
/**
* Override the close icon.
*/
closeIcon?: any;
closeIcon?: JSX.Element;
/**
* Disables text field.
*/
disabled?: any;
disabled?: boolean;
/**
* Sets placeholder for the embedded text field.
* Fired when the search is cancelled.
*/
placeholder?: any;
onCancelSearch?(): void;
/**
* Fired when the text value changes.
*/
Expand All @@ -27,14 +48,18 @@ declare module 'material-ui-search-bar' {
* Fired when the search icon is clicked.
*/
onRequestSearch?(): void;
/**
* Sets placeholder for the embedded text field.
*/
placeholder?: string;
/**
* Override the search icon.
*/
searchIcon?: any;
searchIcon?: JSX.Element;
/**
* Override the inline-styles of the root element.
*/
style?: any;
style?: object;
/**
* The value of the text field.
*/
Expand Down

0 comments on commit 424bc99

Please sign in to comment.