mirror of
https://gitee.com/openharmony/interface_sdk-js
synced 2024-10-07 14:13:45 +00:00
【RichEditor】修改OnWill/OnDidChange接口
Signed-off-by: carnivore233 <xuyue51@huawei.com>
This commit is contained in:
parent
6474648b4e
commit
4fc6728024
32
api/@internal/component/ets/rich_editor.d.ts
vendored
32
api/@internal/component/ets/rich_editor.d.ts
vendored
@ -2501,17 +2501,17 @@ declare interface RichEditorDeleteValue {
|
||||
*/
|
||||
declare interface RichEditorChangeValue {
|
||||
/**
|
||||
* Spans to be replaced.
|
||||
* Range of content that will be replaced.
|
||||
*
|
||||
* @type { Array<RichEditorTextSpanResult> }
|
||||
* @type { TextRange }
|
||||
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
||||
* @crossplatform
|
||||
* @since 12
|
||||
*/
|
||||
originalSpans: Array<RichEditorTextSpanResult>;
|
||||
rangeBefore: TextRange;
|
||||
|
||||
/**
|
||||
* Spans to replace.
|
||||
* Text spans to replace.
|
||||
*
|
||||
* @type { Array<RichEditorTextSpanResult> }
|
||||
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
||||
@ -2519,6 +2519,26 @@ declare interface RichEditorChangeValue {
|
||||
* @since 12
|
||||
*/
|
||||
replacedSpans: Array<RichEditorTextSpanResult>;
|
||||
|
||||
/**
|
||||
* Image spans to replace.
|
||||
*
|
||||
* @type { Array<RichEditorImageSpanResult> }
|
||||
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
||||
* @crossplatform
|
||||
* @since 12
|
||||
*/
|
||||
replacedImageSpans: Array<RichEditorImageSpanResult>;
|
||||
|
||||
/**
|
||||
* Symbol spans to replace.
|
||||
*
|
||||
* @type { Array<RichEditorTextSpanResult> }
|
||||
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
||||
* @crossplatform
|
||||
* @since 12
|
||||
*/
|
||||
replacedSymbolSpans: Array<RichEditorTextSpanResult>;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -3352,13 +3372,13 @@ declare class RichEditorAttribute extends CommonMethod<RichEditorAttribute> {
|
||||
/**
|
||||
* Called after text changed.
|
||||
*
|
||||
* @param { Callback<Array<RichEditorTextSpanResult>> } callback - The triggered function after text content is about to change.
|
||||
* @param { OnDidChangeCallback } callback - The triggered function after content changed.
|
||||
* @returns { RichEditorAttribute }
|
||||
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
||||
* @crossplatform
|
||||
* @since 12
|
||||
*/
|
||||
onDidChange(callback: Callback<Array<RichEditorTextSpanResult>>) : RichEditorAttribute;
|
||||
onDidChange(callback: OnDidChangeCallback) : RichEditorAttribute;
|
||||
|
||||
/**
|
||||
* Called before the cut event.
|
||||
|
44
api/@internal/component/ets/text_common.d.ts
vendored
44
api/@internal/component/ets/text_common.d.ts
vendored
@ -145,3 +145,47 @@ declare interface TextDataDetectorConfig {
|
||||
*/
|
||||
onDetectResultUpdate?: (result: string) => void
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines range of text type component.
|
||||
*
|
||||
* @interface TextRange
|
||||
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
||||
* @crossplatform
|
||||
* @since 12
|
||||
*/
|
||||
declare interface TextRange {
|
||||
/**
|
||||
* Start offset.
|
||||
*
|
||||
* @type { ?number }
|
||||
* @default 0
|
||||
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
||||
* @crossplatform
|
||||
* @since 12
|
||||
*/
|
||||
start?: number;
|
||||
|
||||
/**
|
||||
* End offset.
|
||||
*
|
||||
* @type { ?number }
|
||||
* @default text length
|
||||
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
||||
* @crossplatform
|
||||
* @since 12
|
||||
*/
|
||||
end?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback after content changed.
|
||||
*
|
||||
* @typedef { function } OnDidChangeCallback
|
||||
* @param { TextRange } rangeBefore - Range of content that had been replaced.
|
||||
* @param { TextRange } rangeAfter - Range of content that newly added.
|
||||
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
||||
* @crossplatform
|
||||
* @since 12
|
||||
*/
|
||||
declare type OnDidChangeCallback = (rangeBefore: TextRange, rangeAfter: TextRange) => void;
|
||||
|
Loading…
Reference in New Issue
Block a user