!11973 修复richeditor元能力标签缺失及匿名问题

Merge pull request !11973 from 姚明/bugfix
This commit is contained in:
openharmony_ci 2024-07-08 06:31:11 +00:00 committed by Gitee
commit bc1977935f
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 196 additions and 40 deletions

View File

@ -381,7 +381,16 @@ declare interface RichEditorTextStyle {
* @atomicservice
* @since 11
*/
decoration?: { type: TextDecorationType; color?: ResourceColor; };
/**
* Font decoration.
*
* @type { ?DecorationStyleInterface }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
decoration?: DecorationStyleInterface;
/**
* Text shadow
@ -592,7 +601,16 @@ declare interface PasteEvent {
* @atomicservice
* @since 11
*/
preventDefault?: () => void;
/**
* Override system paste event.
*
* @type { ?Callback<void> }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
preventDefault?: Callback<void>;
}
/**
@ -1052,7 +1070,16 @@ declare interface RichEditorTextStyleResult {
* @atomicservice
* @since 11
*/
decoration: { type: TextDecorationType; color: ResourceColor; };
/**
* Font decoration.
*
* @type { DecorationStyleResult }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
decoration: DecorationStyleResult;
/**
* letter spacing.
@ -1487,6 +1514,7 @@ declare interface RichEditorImageSpanStyleResult {
* @type { ?RichEditorLayoutStyle }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
layoutStyle?: RichEditorLayoutStyle;
@ -1756,16 +1784,16 @@ declare interface RichEditorGesture {
* @crossplatform
* @since 11
*/
/**
/**
* Trigger a click event when a click is clicked.
*
* @type { ?function }
* @type { ?Callback<ClickEvent> }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
onClick?: (event: ClickEvent) => void;
onClick?: Callback<ClickEvent>;
/**
* Trigger a gesture event when long press event is complete.
@ -1778,13 +1806,13 @@ declare interface RichEditorGesture {
/**
* Trigger a gesture event when long press event is complete.
*
* @type { ?function }
* @type { ?Callback<GestureEvent> }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
onLongPress?: (event: GestureEvent) => void;
onLongPress?: Callback<GestureEvent>;
}
/**
@ -1885,6 +1913,7 @@ declare interface RichEditorTextSpanOptions {
* @interface KeyboardOptions
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
declare interface KeyboardOptions {
@ -1894,6 +1923,7 @@ declare interface KeyboardOptions {
* @type { ?boolean }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
supportAvoidance?: boolean;
@ -2644,7 +2674,16 @@ declare interface SelectionMenuOptions {
* @atomicservice
* @since 11
*/
onDisappear?: () => void;
/**
* Callback function when the selection menu disappears.
*
* @type { ?Callback<void> }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
onDisappear?: Callback<void>;
}
/**
@ -3155,39 +3194,59 @@ declare class RichEditorAttribute extends CommonMethod<RichEditorAttribute> {
* @atomicservice
* @since 11
*/
onReady(callback: () => void): RichEditorAttribute;
/**
* Called when the content is selected.
* Called when on ready.
*
* @param { function } callback - The triggered function when select text.
* @returns { RichEditorAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 10
*/
/**
* Called when the content is selected.
*
* @param { function } callback - The triggered function when select text.
* @returns { RichEditorAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 11
*/
onSelect(callback: (value: RichEditorSelection) => void): RichEditorAttribute;
/**
* Called when selection range or caret position is changed.
*
* @param { function } callback - The triggered function when change selection range or caret position.
* @param { Callback<void> } callback - The triggered function when rich editor is ready.
* @returns { RichEditorAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
onSelectionChange(callback: (value: RichEditorRange) => void): RichEditorAttribute;
onReady(callback: Callback<void>): RichEditorAttribute;
/**
* Called when the content is selected.
*
* @param { function } callback - The triggered function when select text.
* @returns { RichEditorAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 10
*/
/**
* Called when the content is selected.
*
* @param { function } callback - The triggered function when select text.
* @returns { RichEditorAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 11
*/
/**
* Called when the content is selected.
*
* @param { Callback<RichEditorSelection> } callback - The triggered function when select text.
* @returns { RichEditorAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
onSelect(callback: Callback<RichEditorSelection>): RichEditorAttribute;
/**
* Called when selection range or caret position is changed.
*
* @param { Callback<RichEditorRange> } callback - The triggered function when change selection range or caret position.
* @returns { RichEditorAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
onSelectionChange(callback: Callback<RichEditorRange>): RichEditorAttribute;
/**
* Get text value information when about to input.
@ -3207,7 +3266,17 @@ declare class RichEditorAttribute extends CommonMethod<RichEditorAttribute> {
* @atomicservice
* @since 11
*/
aboutToIMEInput(callback: (value: RichEditorInsertValue) => boolean): RichEditorAttribute;
/**
* Get text value information when about to input.
*
* @param { Callback<RichEditorInsertValue, boolean> } callback - The triggered function when text content is about to insert.
* @returns { RichEditorAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
aboutToIMEInput(callback: Callback<RichEditorInsertValue, boolean>): RichEditorAttribute;
/**
* Get text value information when completed input.
@ -3227,7 +3296,17 @@ declare class RichEditorAttribute extends CommonMethod<RichEditorAttribute> {
* @atomicservice
* @since 11
*/
onIMEInputComplete(callback: (value: RichEditorTextSpanResult) => void): RichEditorAttribute;
/**
* Get text value information when completed input.
*
* @param { Callback<RichEditorTextSpanResult> } callback - The triggered function when text content has been inserted.
* @returns { RichEditorAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
onIMEInputComplete(callback: Callback<RichEditorTextSpanResult>): RichEditorAttribute;
/**
* Get text value information when about to delete.
@ -3247,7 +3326,17 @@ declare class RichEditorAttribute extends CommonMethod<RichEditorAttribute> {
* @atomicservice
* @since 11
*/
aboutToDelete(callback: (value: RichEditorDeleteValue) => boolean): RichEditorAttribute;
/**
* Get text value information when about to delete.
*
* @param { Callback<RichEditorDeleteValue, boolean> } callback - The triggered function when text content is about to delete.
* @returns { RichEditorAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
aboutToDelete(callback: Callback<RichEditorDeleteValue, boolean>): RichEditorAttribute;
/**
* Notify that the deletion has been completed
@ -3267,7 +3356,17 @@ declare class RichEditorAttribute extends CommonMethod<RichEditorAttribute> {
* @atomicservice
* @since 11
*/
onDeleteComplete(callback: () => void): RichEditorAttribute;
/**
* Notify that the deletion has been completed
*
* @param { Callback<void> } callback - The triggered function when text content has been deleted.
* @returns { RichEditorAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
onDeleteComplete(callback: Callback<void>): RichEditorAttribute;
/**
* Allow replication.
@ -3363,14 +3462,14 @@ declare class RichEditorAttribute extends CommonMethod<RichEditorAttribute> {
/**
* Defines onPaste callback.
*
* @param { function } callback Executed when a paste operation is performed.
* @param { PasteEventCallback } callback Executed when a paste operation is performed.
* @returns { RichEditorAttribute } returns the instance of the RichEditorAttribute.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
onPaste(callback: (event?: PasteEvent) => void): RichEditorAttribute;
onPaste(callback: PasteEventCallback): RichEditorAttribute;
/**
* Enable data detector.
@ -3614,6 +3713,18 @@ declare type SubmitCallback = (enterKey: EnterKeyType, event: SubmitEvent) => vo
*/
declare type MenuOnAppearCallback = (start: number, end: number) => void;
/**
* Callback function when a paste operation is performed.
*
* @typedef { function } PasteEventCallback
* @param { PasteEvent } [event] - The paste event.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
declare type PasteEventCallback = (event?: PasteEvent) => void;
/**
* Provides an interface for writing texts.
*

View File

@ -843,4 +843,48 @@ declare interface EditMenuOptions {
* @since 12
*/
onMenuItemClick(menuItem: TextMenuItem, range: TextRange): boolean;
}
/**
* Defines the font decoration result.
*
* @interface DecorationStyleResult
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
interface DecorationStyleResult {
/**
* Font decoration type.
*
* @type { TextDecorationType }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
type: TextDecorationType;
/**
* Font decoration color.
*
* @type { ResourceColor }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
color: ResourceColor;
/**
* The style value of the decoration property object.
*
* @type { ?TextDecorationStyle }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
style?: TextDecorationStyle;
}

View File

@ -456,6 +456,7 @@ inspected
inspectors
instanced
intercepted
intercepting
interchanged
interleaved
internalformat