@univerjs/find-replace v0.4.2 • Docs
Interface: IFindReplaceService
This service works as a core of the find & replace feature.
Properties
Property | Modifier | Type | Description | Defined in |
---|---|---|---|---|
currentMatch$ | readonly | Observable <Nullable <IFindMatch <unknown >>> | - | packages/find-replace/src/services/find-replace.service.ts:102 (opens in a new tab) |
focusSignal$ | readonly | Observable <void > | - | packages/find-replace/src/services/find-replace.service.ts:106 (opens in a new tab) |
replaceRevealed | readonly | boolean | - | packages/find-replace/src/services/find-replace.service.ts:109 (opens in a new tab) |
replaceables$ | readonly | Observable <IReplaceableMatch []> | An observable value of all matches those could be replaced. | packages/find-replace/src/services/find-replace.service.ts:104 (opens in a new tab) |
revealed | readonly | boolean | - | packages/find-replace/src/services/find-replace.service.ts:108 (opens in a new tab) |
state$ | readonly | Observable <IFindReplaceState > | - | packages/find-replace/src/services/find-replace.service.ts:100 (opens in a new tab) |
stateUpdates$ | readonly | Observable <Partial <IFindReplaceState >> | - | packages/find-replace/src/services/find-replace.service.ts:99 (opens in a new tab) |
Methods
changeCaseSensitive()
changeCaseSensitive(sensitive): void
Parameters
Parameter | Type |
---|---|
sensitive | boolean |
Returns
void
Defined in
packages/find-replace/src/services/find-replace.service.ts:147 (opens in a new tab)
changeFindBy()
changeFindBy(findBy): void
Parameters
Parameter | Type |
---|---|
findBy | FindBy |
Returns
void
Defined in
packages/find-replace/src/services/find-replace.service.ts:151 (opens in a new tab)
changeFindDirection()
changeFindDirection(direction): void
Parameters
Parameter | Type |
---|---|
direction | FindDirection |
Returns
void
Defined in
packages/find-replace/src/services/find-replace.service.ts:150 (opens in a new tab)
changeFindScope()
changeFindScope(scope): void
Parameters
Parameter | Type |
---|---|
scope | FindScope |
Returns
void
Defined in
packages/find-replace/src/services/find-replace.service.ts:149 (opens in a new tab)
changeFindString()
changeFindString(value): void
Parameters
Parameter | Type |
---|---|
value | string |
Returns
void
Defined in
packages/find-replace/src/services/find-replace.service.ts:144 (opens in a new tab)
changeInputtingFindString()
changeInputtingFindString(value): void
Parameters
Parameter | Type |
---|---|
value | string |
Returns
void
Defined in
packages/find-replace/src/services/find-replace.service.ts:145 (opens in a new tab)
changeMatchesTheWholeCell()
changeMatchesTheWholeCell(wholeCell): void
Parameters
Parameter | Type |
---|---|
wholeCell | boolean |
Returns
void
Defined in
packages/find-replace/src/services/find-replace.service.ts:148 (opens in a new tab)
changeReplaceString()
changeReplaceString(value): void
Parameters
Parameter | Type |
---|---|
value | string |
Returns
void
Defined in
packages/find-replace/src/services/find-replace.service.ts:146 (opens in a new tab)
find()
find(): void
Start searching with the current conditions.
Returns
void
Defined in
packages/find-replace/src/services/find-replace.service.ts:139 (opens in a new tab)
focusFindInput()
focusFindInput(): void
Returns
void
Defined in
packages/find-replace/src/services/find-replace.service.ts:141 (opens in a new tab)
getFindString()
getFindString(): string
Get find string from the internal state.
Returns
string
Defined in
packages/find-replace/src/services/find-replace.service.ts:122 (opens in a new tab)
moveToNextMatch()
moveToNextMatch(): void
Returns
void
Defined in
packages/find-replace/src/services/find-replace.service.ts:153 (opens in a new tab)
moveToPreviousMatch()
moveToPreviousMatch(): void
Returns
void
Defined in
packages/find-replace/src/services/find-replace.service.ts:154 (opens in a new tab)
registerFindReplaceProvider()
registerFindReplaceProvider(provider): IDisposable
Register a find replace provider to the service. The provider is the actual bearer to perform the find in different kinds of documents or different environments.
Parameters
Parameter | Type | Description |
---|---|---|
provider | IFindReplaceProvider | the find replace provider |
Returns
Defined in
packages/find-replace/src/services/find-replace.service.ts:117 (opens in a new tab)
replace()
replace(): Promise<boolean>
Returns
Promise
<boolean
>
Defined in
packages/find-replace/src/services/find-replace.service.ts:156 (opens in a new tab)
replaceAll()
replaceAll(): Promise<IReplaceAllResult>
Returns
Promise
<IReplaceAllResult
>
Defined in
packages/find-replace/src/services/find-replace.service.ts:157 (opens in a new tab)
revealReplace()
revealReplace(): void
Returns
void
Defined in
packages/find-replace/src/services/find-replace.service.ts:143 (opens in a new tab)
start()
start(revealReplace?): boolean
Start a find & replace session.
Parameters
Parameter | Type |
---|---|
revealReplace ? | boolean |
Returns
boolean
execution result
Defined in
packages/find-replace/src/services/find-replace.service.ts:129 (opens in a new tab)
terminate()
terminate(): void
Terminate a find session and clear all caches.
Returns
void
Defined in
packages/find-replace/src/services/find-replace.service.ts:134 (opens in a new tab)