mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-22 11:57:33 +08:00
* Support Partial<> on setState now that TS 2.1 is out * Update readme to reflect setState being typed correctly * Switch setState to Pick * Restore cloneELement portion of readme * Use Pick<> | S for setState due to cast issue * state and props should be readonly * Fix nit + document why we * Add typescript compiler header * Update to properly order headers * Update readme to reflect 2.1.5 fixing stPick * Update readme now that 2.1.5 is out * All that depend on react now require 2.1 * Fix definition that fails due to readonly state
35 lines
1.3 KiB
TypeScript
35 lines
1.3 KiB
TypeScript
// Type definitions for react-highlight-words 0.6
|
|
// Project: https://github.com/bvaughn/react-highlight-words#readme
|
|
// Definitions by: Mohamed Hegazy <https://github.com/mhegazy>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
// TypeScript Version: 2.1
|
|
|
|
import React = require("react");
|
|
|
|
export = Highlighter;
|
|
|
|
interface HighlighterProps {
|
|
/** Escape characters which are meaningful in regular expressions */
|
|
autoEscape?: boolean;
|
|
/** Escape characters which are meaningful in regular expressions */
|
|
activeClassName?: string;
|
|
/** Specify the match index that should be actively highlighted. Use along with activeClassName */
|
|
activeIndex?: string;
|
|
/** CSS class name applied to highlighted text */
|
|
highlightClassName?: string;
|
|
/** Inline styles applied to highlighted text */
|
|
highlightStyle?: any;
|
|
/** Type of tag to wrap around highlighted matches; defaults to mark */
|
|
highlightTag?: string;
|
|
/** Process each search word and text to highlight before comparing (eg remove accents); signature (text: string): string */
|
|
sanitize?: (text: string) => string;
|
|
/** Array of search words */
|
|
searchWords: string[];
|
|
/** Text to highlight matches in */
|
|
textToHighlight: string;
|
|
}
|
|
|
|
declare class Highlighter extends React.Component<HighlighterProps, any> {
|
|
static propTypes: any;
|
|
}
|