-
-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve TypeScript definitions (#52)
* Include className as a prop * Include all properties * Improve TypeScript definitions * Update author notice in the typings and use semicolons consistently.
- Loading branch information
Showing
1 changed file
with
32 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
*/ | ||
|
@@ -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. | ||
*/ | ||
|