Class: SearchService
molecule.SearchService
Hierarchy
↳
SearchService
Implements
Constructors
constructor
• new SearchService()
Overrides
Defined in
services/workbench/searchService.ts:101
Properties
builtinService
• Private builtinService: IBuiltinService
Defined in
services/workbench/searchService.ts:100
state
• Protected state: ISearchProps
Implementation of
Overrides
Defined in
services/workbench/searchService.ts:99
Methods
count
▸ count(name): number
Count the service event
Parameters
| Name | Type | Description |
|---|---|---|
name | string | Event name |
Returns
number
Implementation of
Inherited from
Defined in
emit
▸ emit(name, ...args): void
Emit the service event
Parameters
| Name | Type | Description |
|---|---|---|
name | string | Event name |
...args | any | Arguments |
Returns
void
Implementation of
Inherited from
Defined in
forceUpdate
▸ forceUpdate(): void
Force to update the Component
Returns
void
Implementation of
Inherited from
Defined in
getState
▸ getState(): ISearchProps
Get the Component state
Returns
Implementation of
Inherited from
Defined in
onChange
▸ onChange(callback): void
Listen to the event about the value of search input changed
Parameters
| Name | Type |
|---|---|
callback | (value: string, replaceValue: string) => void |
Returns
void
Implementation of
Defined in
services/workbench/searchService.ts:230
onReplaceAll
▸ onReplaceAll(callback): void
Listen to the event about replace all text in result
Parameters
| Name | Type |
|---|---|
callback | () => void |
Returns
void
Implementation of
Defined in
services/workbench/searchService.ts:226
onResultClick
▸ onResultClick(callback): void
Listen to the click event in result data
Parameters
| Name | Type |
|---|---|
callback | (item: ITreeNodeItemProps<any>, resultData: ITreeNodeItemProps<any>[]) => void |
Returns
void
Implementation of
Defined in
services/workbench/searchService.ts:251
onSearch
▸ onSearch(callback): void
Listen to the event about going to search result via values or config changed
Parameters
| Name | Type |
|---|---|
callback | (value: string, replaceValue: string, config: { isCaseSensitive: boolean ; isRegex: boolean ; isWholeWords: boolean ; preserveCase: boolean }) => void |
Returns
void
Implementation of
Defined in
services/workbench/searchService.ts:236
onUpdateState
▸ onUpdateState(listener): void
Listen to the Component state update event
Parameters
| Name | Type |
|---|---|
listener | (prevState: ISearchProps, nextState: ISearchProps) => void |
Returns
void
Implementation of
Inherited from
Defined in
removeOnUpdateState
▸ removeOnUpdateState(listener?): void
Remove the Component update event listening, default is remove all, also you can remove one by pass the listener
Parameters
| Name | Type |
|---|---|
listener? | Function |
Returns
void
Implementation of
ISearchService.removeOnUpdateState
Inherited from
Defined in
render
▸ render(nextState?): void
Initiative notify the component to render the view by the state
Parameters
| Name | Type |
|---|---|
nextState? | ISearchProps |
Returns
void
Implementation of
Inherited from
Defined in
reset
▸ reset(): void
Reset the search input data
Returns
void
Implementation of
Defined in
services/workbench/searchService.ts:209
setReplaceValue
▸ setReplaceValue(value?): void
Set replace value for replace input
Parameters
| Name | Type |
|---|---|
value? | string |
Returns
void
Implementation of
ISearchService.setReplaceValue
Defined in
services/workbench/searchService.ts:125
setResult
▸ setResult(value?): void
Set result data for searching result
Parameters
| Name | Type |
|---|---|
value? | ITreeNodeItemProps<any>[] |
Returns
void
Implementation of
Defined in
services/workbench/searchService.ts:131
setSearchValue
▸ setSearchValue(value?): void
Set search value for search input
Parameters
| Name | Type |
|---|---|
value? | string |
Returns
void
Implementation of
Defined in
services/workbench/searchService.ts:119
setState
▸ setState(values, callback?): void
Set the state values, and notify the view component to re render
Parameters
| Name | Type | Description |
|---|---|---|
values | Partial<ISearchProps> | update target state values |
callback? | (prevState: ISearchProps, nextState: ISearchProps) => void | - |
Returns
void
Implementation of
Inherited from
Defined in
setValidateInfo
▸ setValidateInfo(info): void
Set informations about validating,
Parameters
| Name | Type |
|---|---|
info | undefined | string | { text: string ; type: "warning" | "info" | "error" } |
Returns
void
Implementation of
ISearchService.setValidateInfo
Defined in
services/workbench/searchService.ts:107
subscribe
▸ subscribe(name, listener): void
Subscribe the service event
Parameters
| Name | Type | Description |
|---|---|---|
name | string | string[] | Event name |
listener | Function | Listener function |
Returns
void
Implementation of
Inherited from
Defined in
toggleCaseSensitive
▸ toggleCaseSensitive(): void
Toggle the rule for case senstitive when searching
Returns
void
Implementation of
ISearchService.toggleCaseSensitive
Defined in
services/workbench/searchService.ts:143
toggleMode
▸ toggleMode(status): void
Toggle search mode, true for replace mode
Parameters
| Name | Type |
|---|---|
status | boolean |
Returns
void
Implementation of
Defined in
services/workbench/searchService.ts:137
togglePreserveCase
▸ togglePreserveCase(): void
Toggle the rule for preserving case when replacing
Returns
void
Implementation of
ISearchService.togglePreserveCase
Defined in
services/workbench/searchService.ts:182
toggleRegex
▸ toggleRegex(): void
Toggle the rule for enabling regex when searching
Returns
void
Implementation of
Defined in
services/workbench/searchService.ts:170
toggleWholeWord
▸ toggleWholeWord(): void
Toggle the rule for finding whole word when searching
Returns
void
Implementation of
ISearchService.toggleWholeWord
Defined in
services/workbench/searchService.ts:158
unsubscribe
▸ unsubscribe(name, listener?): void
Unsubscribe the specific event and the listener function
Parameters
| Name | Type | Description |
|---|---|---|
name | any | The event name |
listener? | Function | optional, it unsubscribes events via name if not pass the listener function |
Returns
void
Implementation of
Inherited from
Defined in
updateStatus
▸ updateStatus(addonId, checked): void
Update the status of specific addon icon to checked
Parameters
| Name | Type |
|---|---|
addonId | string |
checked | boolean |
Returns
void