Skip to main content
Version: 1.x

Interface: ISearchService

molecule.ISearchService

Hierarchy​

Implemented by​

Properties​

state​

• Protected Abstract state: ISearchProps

Inherited from​

Component.state

Defined in​

react/component.ts:44

Methods​

count​

▸ count(name): number

Count the service event

Parameters​

NameTypeDescription
namestringEvent name

Returns​

number

Inherited from​

Component.count

Defined in​

common/event/eventBus.ts:28


emit​

▸ emit(name, ...args): void

Emit the service event

Parameters​

NameTypeDescription
namestringEvent name
...argsanyArguments

Returns​

void

Inherited from​

Component.emit

Defined in​

common/event/eventBus.ts:20


forceUpdate​

▸ forceUpdate(): void

Force to update the Component

Returns​

void

Inherited from​

Component.forceUpdate

Defined in​

react/component.ts:81


getState​

▸ getState(): ISearchProps

Get the Component state

Returns​

ISearchProps

Inherited from​

Component.getState

Defined in​

react/component.ts:85


onChange​

▸ onChange(callback): void

Listen to the event about the value of search input changed

Parameters​

NameType
callback(value: string, replaceValue: string) => void

Returns​

void

Defined in​

services/workbench/searchService.ts:63


onReplaceAll​

▸ onReplaceAll(callback): void

Listen to the event about replace all text in result

Parameters​

NameType
callback() => void

Returns​

void

Defined in​

services/workbench/searchService.ts:82


onResultClick​

▸ onResultClick(callback): void

Listen to the click event in result data

Parameters​

NameType
callback(item: ITreeNodeItemProps<any>, resultData: ITreeNodeItemProps<any>[]) => void

Returns​

void

Defined in​

services/workbench/searchService.ts:86


onSearch​

▸ onSearch(callback): void

Listen to the event about going to search result via values or config changed

Parameters​

NameType
callback(value: string, replaceValue: string, config: { isCaseSensitive: boolean ; isRegex: boolean ; isWholeWords: boolean ; preserveCase: boolean }) => void

Returns​

void

Defined in​

services/workbench/searchService.ts:67


onUpdateState​

▸ onUpdateState(listener): void

Listen to the Component state update event

Parameters​

NameType
listener(prevState: ISearchProps, nextState: ISearchProps) => void

Returns​

void

Inherited from​

Component.onUpdateState

Defined in​

react/component.ts:73


removeOnUpdateState​

▸ removeOnUpdateState(listener?): void

Remove the Component update event listening, default is remove all, also you can remove one by pass the listener

Parameters​

NameType
listener?Function

Returns​

void

Inherited from​

Component.removeOnUpdateState

Defined in​

react/component.ts:77


render​

▸ render(nextState?): void

Initiative notify the component to render the view by the state

Parameters​

NameType
nextState?ISearchProps

Returns​

void

Inherited from​

Component.render

Defined in​

react/component.ts:69


reset​

▸ reset(): void

Reset the search input data

Returns​

void

Defined in​

services/workbench/searchService.ts:59


setReplaceValue​

▸ setReplaceValue(value?): void

Set replace value for replace input

Parameters​

NameType
value?string

Returns​

void

Defined in​

services/workbench/searchService.ts:27


setResult​

▸ setResult(value?): void

Set result data for searching result

Parameters​

NameType
value?ITreeNodeItemProps<any>[]

Returns​

void

Defined in​

services/workbench/searchService.ts:31


setSearchValue​

▸ setSearchValue(value?): void

Set search value for search input

Parameters​

NameType
value?string

Returns​

void

Defined in​

services/workbench/searchService.ts:23


setState​

▸ setState(values, callback?): void

Set the state values, and notify the view component to re render

Parameters​

NameTypeDescription
valuesPartial<ISearchProps>update target state values
callback?(prevState: ISearchProps, nextState: ISearchProps) => void-

Returns​

void

Inherited from​

Component.setState

Defined in​

react/component.ts:56


setValidateInfo​

▸ setValidateInfo(info): void

Set informations about validating,

Parameters​

NameTypeDescription
infoundefined | string | { text: string ; type: "warning" | "info" | "error" }If provided a string, molecule will set it type as info

Returns​

void

Defined in​

services/workbench/searchService.ts:19


subscribe​

▸ subscribe(name, listener): void

Subscribe the service event

Parameters​

NameTypeDescription
namestring | string[]Event name
listenerFunctionListener function

Returns​

void

Inherited from​

Component.subscribe

Defined in​

common/event/eventBus.ts:11


toggleCaseSensitive​

▸ toggleCaseSensitive(): void

Toggle the rule for case senstitive when searching

Returns​

void

Defined in​

services/workbench/searchService.ts:39


toggleMode​

▸ toggleMode(status): void

Toggle search mode, true for replace mode

Parameters​

NameType
statusboolean

Returns​

void

Defined in​

services/workbench/searchService.ts:35


togglePreserveCase​

▸ togglePreserveCase(): void

Toggle the rule for preserving case when replacing

Returns​

void

Defined in​

services/workbench/searchService.ts:51


toggleRegex​

▸ toggleRegex(): void

Toggle the rule for enabling regex when searching

Returns​

void

Defined in​

services/workbench/searchService.ts:47


toggleWholeWord​

▸ toggleWholeWord(): void

Toggle the rule for finding whole word when searching

Returns​

void

Defined in​

services/workbench/searchService.ts:43


unsubscribe​

▸ unsubscribe(name, listener?): void

Unsubscribe the specific event and the listener function

Parameters​

NameTypeDescription
nameanyThe event name
listener?Functionoptional, it unsubscribes events via name if not pass the listener function

Returns​

void

Inherited from​

Component.unsubscribe

Defined in​

common/event/eventBus.ts:37


updateStatus​

▸ updateStatus(addonId, checked): void

Update the status of specific addon icon to checked

Parameters​

NameType
addonIdstring
checkedboolean

Returns​

void

Defined in​

services/workbench/searchService.ts:55