已合并
add js-sdk #30900
mlyuestc创建于 2月24日
add js-sdk #30900
已合并
共 6 个文件变更+176-2
| @@ -12137,6 +12137,19 @@ declare interface MouseEvent extends BaseEvent { | |||
| 12137 | * @since 15 dynamic | 12137 | * @since 15 dynamic |
| 12138 | */ | 12138 | */ |
| 12139 | pressedButtons?: MouseButton[]; | 12139 | pressedButtons?: MouseButton[]; |
| 12140 | + | ||
| 12141 | + /** | ||
| 12142 | + * The unique handle for the event processing session. This handle must be used for any further operations on the | ||
| 12143 | + * event. The system ensures that for a given finger, only one event with this handle can be active at a time. | ||
| 12144 | + * | ||
| 12145 | + * @type { ?number } | ||
| 12146 | + * @syscap SystemCapability.ArkUI.ArkUI.Full | ||
| 12147 | + * @stagemodelonly | ||
| 12148 | + * @crossplatform | ||
| 12149 | + * @atomicservice | ||
| 12150 | + * @since 24 dynamic | ||
| 12151 | + */ | ||
| 12152 | + eventHandleId?: number; | ||
| 12140 | } | 12153 | } |
| 12141 | 12154 | ||
| 12142 | /** | 12155 | /** |
| @@ -12801,6 +12814,19 @@ declare interface TouchEvent extends BaseEvent { | |||
| 12801 | * @since 12 dynamic | 12814 | * @since 12 dynamic |
| 12802 | */ | 12815 | */ |
| 12803 | preventDefault: () => void; | 12816 | preventDefault: () => void; |
| 12817 | + | ||
| 12818 | + /** | ||
| 12819 | + * The unique handle for the event processing session. This handle must be used for any further operations on the | ||
| 12820 | + * event. The system ensures that for a given finger, only one event with this handle can be active at a time. | ||
| 12821 | + * | ||
| 12822 | + * @type { ?number } | ||
| 12823 | + * @syscap SystemCapability.ArkUI.ArkUI.Full | ||
| 12824 | + * @stagemodelonly | ||
| 12825 | + * @crossplatform | ||
| 12826 | + * @atomicservice | ||
| 12827 | + * @since 24 dynamic | ||
| 12828 | + */ | ||
| 12829 | + eventHandleId?: number; | ||
| 12804 | } | 12830 | } |
| 12805 | 12831 | ||
| 12806 | /** | 12832 | /** |
| @@ -12913,6 +12939,19 @@ declare interface AxisEvent extends BaseEvent { | |||
| 12913 | */ | 12939 | */ |
| 12914 | scrollStep?: number; | 12940 | scrollStep?: number; |
| 12915 | 12941 | ||
| 12942 | + /** | ||
| 12943 | + * The unique handle for the event processing session. This handle must be used for any further operations on the | ||
| 12944 | + * event. The system ensures that for a given finger, only one event with this handle can be active at a time. | ||
| 12945 | + * | ||
| 12946 | + * @type { ?number } | ||
| 12947 | + * @syscap SystemCapability.ArkUI.ArkUI.Full | ||
| 12948 | + * @stagemodelonly | ||
| 12949 | + * @crossplatform | ||
| 12950 | + * @atomicservice | ||
| 12951 | + * @since 24 dynamic | ||
| 12952 | + */ | ||
| 12953 | + eventHandleId?: number; | ||
| 12954 | + | ||
| 12916 | /** | 12955 | /** |
| 12917 | * Active event bubbling. | 12956 | * Active event bubbling. |
| 12918 | * | 12957 | * |
| @@ -11395,4 +11395,45 @@ declare enum AxisType { | |||
| 11395 | * @since 22 dynamic | 11395 | * @since 22 dynamic |
| 11396 | */ | 11396 | */ |
| 11397 | PINCH_AXIS = 2, | 11397 | PINCH_AXIS = 2, |
| 11398 | -} | 11398 | +} |
| 11399 | + | ||
| 11400 | + /** | ||
| 11401 | + * Defines whether a competition for gesture recognition results should occur between the event injector and the | ||
| 11402 | + * gesture recognizers of the target component. | ||
| 11403 | + * This strategy determines how the injected input event interacts with the target component's own gesture | ||
| 11404 | + * handling logic. | ||
| 11405 | + * | ||
| 11406 | + * @enum {number} | ||
| 11407 | + * @syscap SystemCapability.ArkUI.ArkUI.Full | ||
| 11408 | + * @stagemodelonly | ||
| 11409 | + * @crossplatform | ||
| 11410 | + * @atomicservice | ||
| 11411 | + * @since 24 dynamic | ||
| 11412 | + */ | ||
| 11413 | + declare enum CompetitionStrategy { | ||
| 11414 | + /** | ||
| 11415 | + * No competition strategy. | ||
| 11416 | + * The injected event does not compete with any existing gestures. | ||
| 11417 | + * Both the injected event and existing gestures can be processed independently and in parallel. | ||
| 11418 | + * | ||
| 11419 | + * @syscap SystemCapability.ArkUI.ArkUI.Full | ||
| 11420 | + * @stagemodelonly | ||
| 11421 | + * @crossplatform | ||
| 11422 | + * @atomicservice | ||
| 11423 | + * @since 24 dynamic | ||
| 11424 | + */ | ||
| 11425 | + DEFAULT = 0, | ||
| 11426 | + | ||
| 11427 | + /** | ||
| 11428 | + * Competition strategy. | ||
| 11429 | + * The gesture recognition result from the event injector will compete with those from the target component's own | ||
| 11430 | + * recognizers. | ||
| 11431 | + * | ||
| 11432 | + * @syscap SystemCapability.ArkUI.ArkUI.Full | ||
| 11433 | + * @stagemodelonly | ||
| 11434 | + * @crossplatform | ||
| 11435 | + * @atomicservice | ||
| 11436 | + * @since 24 dynamic | ||
| 11437 | + */ | ||
| 11438 | + COMPETITION = 1, | ||
| 11439 | + } | ||
| @@ -542,6 +542,21 @@ export class BuilderNode<Args extends Object[]> { | |||
| 542 | */ | 542 | */ |
| 543 | postInputEvent(event: InputEventType): boolean; | 543 | postInputEvent(event: InputEventType): boolean; |
| 544 | 544 | ||
| 545 | + /** | ||
| 546 | + * Dispatch event to targetNode with competition strategy. | ||
| 547 | + * | ||
| 548 | + * @param { InputEventType } event - The event which will be sent to the targetNode. | ||
| 549 | + * @param { CompetitionStrategy } competitionStrategy - The competition strategy. | ||
| 550 | + * @returns { boolean } - Returns true if the eventhas been successfully posted to the targetNode, | ||
| 551 | + * false otherwise. | ||
| 552 | + * @syscap SystemCapability.ArkUI.ArkUI.Full | ||
| 553 | + * @stagemodelonly | ||
| 554 | + * @crossplatform | ||
| 555 | + * @atomicservice | ||
| 556 | + * @since 24 dynamic | ||
| 557 | + */ | ||
| 558 | + postInputEventWithStrategy(event: InputEventType, competitionStrategy?: CompetitionStrategy): boolean; | ||
| 559 | + | ||
| 545 | /** | 560 | /** |
| 546 | * Set if the BuilderNode inherits the freezing policy of the parent CustomComponent, ComponentContent, or BuilderNode. | 561 | * Set if the BuilderNode inherits the freezing policy of the parent CustomComponent, ComponentContent, or BuilderNode. |
| 547 | * | 562 | * |
| @@ -25,6 +25,7 @@ import { Size } from 'arkui.Graphics'; | |||
| 25 | import { TouchEvent, MouseEvent, AxisEvent } from '@ohos.arkui.component'; | 25 | import { TouchEvent, MouseEvent, AxisEvent } from '@ohos.arkui.component'; |
| 26 | import { WrappedBuilder, CustomBuilder, CustomBuilderT } from '@ohos.arkui.component'; | 26 | import { WrappedBuilder, CustomBuilder, CustomBuilderT } from '@ohos.arkui.component'; |
| 27 | import { RecordData } from '@ohos.base'; | 27 | import { RecordData } from '@ohos.base'; |
| 28 | +import { CompetitionStrategy } from '@ohos.arkui.component'; | ||
| 28 | 29 | ||
| 29 | /** | 30 | /** |
| 30 | * Render type of the node using for indicating that | 31 | * Render type of the node using for indicating that |
| @@ -232,6 +233,19 @@ export declare class BuilderNode<T = undefined> { | |||
| 232 | */ | 233 | */ |
| 233 | postInputEvent(event: InputEventType): boolean; | 234 | postInputEvent(event: InputEventType): boolean; |
| 234 | 235 | ||
| 236 | + /** | ||
| 237 | + * Dispatch event to targetNode with competition strategy. | ||
| 238 | + * | ||
| 239 | + * @param { InputEventType } event - The event which will be sent to the targetNode. | ||
| 240 | + * @param { CompetitionStrategy } competitionStrategy - The competition strategy. | ||
| 241 | + * @returns { boolean } - Returns true if the eventhas been successfully posted to the targetNode, | ||
| 242 | + * false otherwise. | ||
| 243 | + * @syscap SystemCapability.ArkUI.ArkUI.Full | ||
| 244 | + * @stagemodelonly | ||
| 245 | + * @since 24 static | ||
| 246 | + */ | ||
| 247 | + postInputEventWithStrategy(event: InputEventType, competitionStrategy?: CompetitionStrategy): boolean; | ||
| 248 | + | ||
| 235 | /** | 249 | /** |
| 236 | * Set if the BuilderNode inherits the freezing policy of the parent CustomComponent, ComponentContent, | 250 | * Set if the BuilderNode inherits the freezing policy of the parent CustomComponent, ComponentContent, |
| 237 | * or BuilderNode. | 251 | * or BuilderNode. |
| @@ -4503,7 +4503,17 @@ export declare interface MouseEvent extends BaseEvent { | |||
| 4503 | * @stagemodelonly | 4503 | * @stagemodelonly |
| 4504 | * @since 23 static | 4504 | * @since 23 static |
| 4505 | */ | 4505 | */ |
| 4506 | - globalDisplayY?: double; | 4506 | + globalDisplayY?: double; |
| 4507 | + /** | ||
| 4508 | + * The unique handle for the event processing session. This handle must be used for any further operations on the | ||
| 4509 | + * event. The system ensures that for a given finger, only one event with this handle can be active at a time. | ||
| 4510 | + * | ||
| 4511 | + * @type { ?int } | ||
| 4512 | + * @syscap SystemCapability.ArkUI.ArkUI.Full | ||
| 4513 | + * @stagemodelonly | ||
| 4514 | + * @since 24 static | ||
| 4515 | + */ | ||
| 4516 | + eventHandleId?: int; | ||
| 4507 | } | 4517 | } |
| 4508 | /** | 4518 | /** |
| 4509 | * The accessibility hover action triggers this method invocation. | 4519 | * The accessibility hover action triggers this method invocation. |
| @@ -4820,6 +4830,16 @@ export declare interface TouchEvent extends BaseEvent { | |||
| 4820 | * @since 23 static | 4830 | * @since 23 static |
| 4821 | */ | 4831 | */ |
| 4822 | preventDefault(): void; | 4832 | preventDefault(): void; |
| 4833 | + /** | ||
| 4834 | + * The unique handle for the event processing session. This handle must be used for any further operations on the | ||
| 4835 | + * event. The system ensures that for a given finger, only one event with this handle can be active at a time. | ||
| 4836 | + * | ||
| 4837 | + * @type { ?int } | ||
| 4838 | + * @syscap SystemCapability.ArkUI.ArkUI.Full | ||
| 4839 | + * @stagemodelonly | ||
| 4840 | + * @since 24 static | ||
| 4841 | + */ | ||
| 4842 | + eventHandleId?: int; | ||
| 4823 | } | 4843 | } |
| 4824 | /** | 4844 | /** |
| 4825 | * The axis event triggers this method invocation. | 4845 | * The axis event triggers this method invocation. |
| @@ -4894,6 +4914,16 @@ export declare interface AxisEvent extends BaseEvent { | |||
| 4894 | * @since 23 static | 4914 | * @since 23 static |
| 4895 | */ | 4915 | */ |
| 4896 | scrollStep?: int; | 4916 | scrollStep?: int; |
| 4917 | + /** | ||
| 4918 | + * The unique handle for the event processing session. This handle must be used for any further operations on the | ||
| 4919 | + * event. The system ensures that for a given finger, only one event with this handle can be active at a time. | ||
| 4920 | + * | ||
| 4921 | + * @type { ?int } | ||
| 4922 | + * @syscap SystemCapability.ArkUI.ArkUI.Full | ||
| 4923 | + * @stagemodelonly | ||
| 4924 | + * @since 24 static | ||
| 4925 | + */ | ||
| 4926 | + eventHandleId?: int; | ||
| 4897 | /** | 4927 | /** |
| 4898 | * Active event bubbling. | 4928 | * Active event bubbling. |
| 4899 | * | 4929 | * |
| @@ -4209,6 +4209,41 @@ export declare enum AxisType { | |||
| 4209 | PINCH_AXIS = 2, | 4209 | PINCH_AXIS = 2, |
| 4210 | } | 4210 | } |
| 4211 | 4211 | ||
| 4212 | +/** | ||
| 4213 | + * Defines whether a competition for gesture recognition results should occur between the event injector and the | ||
| 4214 | + * gesture recognizers of the target component. | ||
| 4215 | + * This strategy determines how the injected input event interacts with the target component's own gesture | ||
| 4216 | + * handling logic. | ||
| 4217 | + * | ||
| 4218 | + * @enum { number } | ||
| 4219 | + * @syscap SystemCapability.ArkUI.ArkUI.Full | ||
| 4220 | + * @stagemodelonly | ||
| 4221 | + * @since 24 static | ||
| 4222 | + */ | ||
| 4223 | +export enum CompetitionStrategy { | ||
| 4224 | + /** | ||
| 4225 | + * No competition strategy. | ||
| 4226 | + * The injected event does not compete with any existing gestures. | ||
| 4227 | + * Both the injected event and existing gestures can be processed independently and in parallel. | ||
| 4228 | + * | ||
| 4229 | + * @syscap SystemCapability.ArkUI.ArkUI.Full | ||
| 4230 | + * @stagemodelonly | ||
| 4231 | + * @since 24 static | ||
| 4232 | + */ | ||
| 4233 | + DEFAULT = 0, | ||
| 4234 | + | ||
| 4235 | + /** | ||
| 4236 | + * Competition strategy. | ||
| 4237 | + * The gesture recognition result from the event injector will compete with those from the target component's own | ||
| 4238 | + * recognizers. | ||
| 4239 | + * | ||
| 4240 | + * @syscap SystemCapability.ArkUI.ArkUI.Full | ||
| 4241 | + * @stagemodelonly | ||
| 4242 | + * @since 24 static | ||
| 4243 | + */ | ||
| 4244 | + COMPETITION = 1, | ||
| 4245 | +} | ||
| 4246 | + | ||
| 4212 | /** | 4247 | /** |
| 4213 | * Defines the state types that can be monitored by AttributeModifiers. | 4248 | * Defines the state types that can be monitored by AttributeModifiers. |
| 4214 | * | 4249 | * |