Interface: ISearchService
services.ISearchService
Hierarchy
Component
\<ISearchProps
>↳
ISearchService
Table of contents
Properties
- setReplaceValue
- setResult
- setSearchValue
- setValidateInfo
- state
- toggleCaseSensitive
- toggleMode
- togglePreserveCase
- toggleRegex
- toggleWholeWord
- updateStatus
Methods
Properties
setReplaceValue
• setReplaceValue: (value?
: string
) => void
Type declaration
▸ (value?
): void
Set replace value for replace input
Parameters
Name | Type |
---|---|
value? | string |
Returns
void
Defined in
src/services/workbench/searchService.ts:20
setResult
• setResult: (value?
: ITreeNodeItemProps
\<any
>[]) => void
Type declaration
▸ (value?
): void
Set result data for searching result
Parameters
Name | Type |
---|---|
value? | ITreeNodeItemProps \<any >[] |
Returns
void
Defined in
src/services/workbench/searchService.ts:24
setSearchValue
• setSearchValue: (value?
: string
) => void
Type declaration
▸ (value?
): void
Set search value for search input
Parameters
Name | Type |
---|---|
value? | string |
Returns
void
Defined in
src/services/workbench/searchService.ts:16
setValidateInfo
• setValidateInfo: (info
: undefined
| string
| { text
: string
; type
: "error"
| "warning"
| "info"
}) => void
Type declaration
▸ (info
): void
Set informations about validating,
Parameters
Name | Type | Description |
---|---|---|
info | undefined | string | { text : string ; type : "error" | "warning" | "info" } | If provided a string, molecule will set it type as info |
Returns
void
Defined in
src/services/workbench/searchService.ts:12
state
• Protected
Abstract
state: ISearchProps
Inherited from
Component.state
Defined in
toggleCaseSensitive
• toggleCaseSensitive: () => void
Type declaration
▸ (): void
Toggle the rule for case senstitive when searching
Returns
void
Defined in
src/services/workbench/searchService.ts:32
toggleMode
• toggleMode: (status
: boolean
) => void
Type declaration
▸ (status
): void
Toggle search mode, true
for replace mode
Parameters
Name | Type |
---|---|
status | boolean |
Returns
void
Defined in
src/services/workbench/searchService.ts:28
togglePreserveCase
• togglePreserveCase: () => void
Type declaration
▸ (): void
Toggle the rule for preserving case when replacing
Returns
void
Defined in
src/services/workbench/searchService.ts:44
toggleRegex
• toggleRegex: () => void
Type declaration
▸ (): void
Toggle the rule for enabling regex when searching
Returns
void
Defined in
src/services/workbench/searchService.ts:40
toggleWholeWord
• toggleWholeWord: () => void
Type declaration
▸ (): void
Toggle the rule for finding whole word when searching
Returns
void
Defined in
src/services/workbench/searchService.ts:36
updateStatus
• updateStatus: (addonId
: string
, checked
: boolean
) => void
Type declaration
▸ (addonId
, checked
): void
Update the status of specific addon icon to checked
Parameters
Name | Type |
---|---|
addonId | string |
checked | boolean |
Returns
void
Defined in
src/services/workbench/searchService.ts:48
Methods
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
Defined in
src/services/workbench/searchService.ts:56
onReplaceAll
▸ onReplaceAll(callback
): void
Listen to the event about replace all text in result
Parameters
Name | Type |
---|---|
callback | () => void |
Returns
void
Defined in
src/services/workbench/searchService.ts:75
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
Defined in
src/services/workbench/searchService.ts:79
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
Defined in
src/services/workbench/searchService.ts:60
reset
▸ reset(): void
Reset the search input data
Returns
void
Defined in
src/services/workbench/searchService.ts:52
subscribe
▸ subscribe(name
, listener
): void
Subscribe the service event
Parameters
Name | Type | Description |
---|---|---|
name | string | string [] | Event name |
listener | Function | Listener function |
Returns
void
Inherited from
Component.subscribe
Defined in
src/common/event/eventBus.ts:11
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
Inherited from
Component.unsubscribe