feat(react-lazylog): Add more fields for react-lazylog 4.4.1 (#40520)

* feat(react-lazylog): add more fields in Lazylog

* feat(react-lazylog): Add SearchBar

* Update LazyLog.d.ts

* Update index.d.ts

* Update index.d.ts

* Update index.d.ts

* (react-lazylog): text should be optional

* fix(react-lazylog): remove patch version of react-lazylog
This commit is contained in:
Kun Yan
2019-11-21 03:51:14 +08:00
committed by Sheetal Nandi
parent 31bb520ddb
commit eb5dae98df
3 changed files with 27 additions and 1 deletions

View File

@@ -3,6 +3,7 @@ import { Range } from "immutable";
export interface LazyLogProps {
url: string;
text?: string;
fetchOptions?: RequestInit;
stream?: boolean;
height?: string | number;
@@ -19,6 +20,11 @@ export interface LazyLogProps {
overscanRowCount?: number;
containerStyle?: CSSProperties;
style?: CSSProperties;
loadingComponent?: any;
lineClassName?: string;
highlightLineClassName?: string;
extraLines?: number;
caseInsensitive?: boolean;
}
export class LazyLog extends Component<LazyLogProps> {

View File

@@ -0,0 +1,14 @@
import { Component, ReactNode, CSSProperties } from "react";
export interface SearchBarProps {
onSearch?: (keyword: string) => void;
onClearSearch?: () => void;
onFilterLinesWithMatches?: (isFiltered: boolean) => void;
resultsCount?: number;
filterActive?: boolean;
disabled?: boolean;
}
export default class SearchBar extends Component<SearchBarProps> {
static defaultProps: Partial<SearchBarProps>;
}

View File

@@ -1,8 +1,14 @@
// Type definitions for react-lazylog 3.1
// Type definitions for react-lazylog 4.4
// Project: https://github.com/mozilla-frontend-infra/react-lazylog
// Definitions by: Benjamin Romano <https://github.com/benjaminRomano>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
export * from "./build/LazyLog";
export * from "./build/Line";
export * from "./build/LineContent";
export * from "./build/LineNumber";
export * from "./build/LinePart";
export * from "./build/Loading";
export * from "./build/ScrollFollow";
export * from "./build/SearchBar";