diff --git a/api/@internal/component/ets/alphabet_indexer.d.ts b/api/@internal/component/ets/alphabet_indexer.d.ts index 26f03269ae917950238bf6c8bb854cba865eeecf..f937ef5afbbc62f9a27be132f997984c675eca90 100644 --- a/api/@internal/component/ets/alphabet_indexer.d.ts +++ b/api/@internal/component/ets/alphabet_indexer.d.ts @@ -18,12 +18,6 @@ * @kit ArkUI */ -/*** if arkts 1.2 */ -import { CommonMethod, BlurStyle, Bindable } from './common' -import { ResourceColor, Length, Position } from './units' -import { Font } from './units' -/*** endif */ - /** * indexer align property. * @@ -46,8 +40,7 @@ import { Font } from './units' * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare enum IndexerAlign { /** @@ -69,8 +62,7 @@ declare enum IndexerAlign { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ Left, @@ -93,8 +85,7 @@ declare enum IndexerAlign { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ Right, @@ -104,8 +95,7 @@ declare enum IndexerAlign { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ START, @@ -115,8 +105,7 @@ declare enum IndexerAlign { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ END, } @@ -128,8 +117,7 @@ declare enum IndexerAlign { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ interface AlphabetIndexerOptions { /** @@ -164,8 +152,7 @@ interface AlphabetIndexerOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ arrayValue: Array; /** @@ -203,17 +190,6 @@ interface AlphabetIndexerOptions { * @since 18 */ selected: number; - /** - * ID of the selected item. - * - * @type { number | Bindable } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - selected: number | Bindable; } /** @@ -238,8 +214,7 @@ interface AlphabetIndexerOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 * @noninterop */ interface AlphabetIndexerInterface { @@ -283,8 +258,7 @@ interface AlphabetIndexerInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ (options: AlphabetIndexerOptions): AlphabetIndexerAttribute; } @@ -297,8 +271,7 @@ interface AlphabetIndexerInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ declare type OnAlphabetIndexerSelectCallback = (index: number) => void; @@ -310,11 +283,9 @@ declare type OnAlphabetIndexerSelectCallback = (index: number) => void; * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ declare type OnAlphabetIndexerPopupSelectCallback = (index: number) => void; - /** * Defines an AlphabetIndexer callback when onRequestPopupData. * @@ -324,8 +295,7 @@ declare type OnAlphabetIndexerPopupSelectCallback = (index: number) => void; * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ declare type OnAlphabetIndexerRequestPopupDataCallback = (index: number) => Array; @@ -351,9 +321,7 @@ declare type OnAlphabetIndexerRequestPopupDataCallback = (index: number) => Arra * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 - * @noninterop + * @since 11 */ declare class AlphabetIndexerAttribute extends CommonMethod { /** @@ -393,8 +361,7 @@ declare class AlphabetIndexerAttribute extends CommonMethod } index - * @returns { AlphabetIndexerAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - selected(index: number | Bindable): AlphabetIndexerAttribute; /** * Position of the pop-up windows, relative to the midpoint of the top border of the indexer bar. @@ -982,8 +920,7 @@ declare class AlphabetIndexerAttribute extends CommonMethod { opacity(value: number): T; } -/** - * Provides interfaces for common transitions. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ -declare class CommonTransition { - /** - * Called when the slide in effect of the transition is set. - * - * @param { SlideEffect } value - * @returns { this } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - slide(value: SlideEffect): this; - - /** - * Called when the translation effect of page transition is set. - * - * @param { TranslateOptions } value - * @returns { this } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - translate(value: TranslateOptions): this; - - /** - * Called when setting the zoom effect of page transition. - * - * @param { ScaleOptions } value - * @returns { this } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - scale(value: ScaleOptions): this; - - /** - * Called when the transparency value of the starting point of entry or the ending point of exit is set. - * - * @param { number } value - * @returns { this } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - opacity(value: number): this; -} - /** * Defines pageTransition constructor parameters. * @@ -536,8 +457,7 @@ declare class CommonTransition { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare interface PageTransitionOptions { /** @@ -559,8 +479,7 @@ declare interface PageTransitionOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ type?: RouteType; /** @@ -582,8 +501,7 @@ declare interface PageTransitionOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ duration?: number; /** @@ -608,8 +526,7 @@ declare interface PageTransitionOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ curve?: Curve | string | ICurve; /** @@ -634,8 +551,7 @@ declare interface PageTransitionOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ delay?: number; } @@ -649,8 +565,7 @@ declare interface PageTransitionOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ declare type PageTransitionCallback = (type: RouteType, progress: number) => void; @@ -756,47 +671,6 @@ interface PageTransitionEnterInterface extends CommonTransition = [T1, T2]; @@ -44,8 +36,7 @@ declare type ParticleTuple = [T1, T2]; * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ declare interface VelocityOptions { /** @@ -71,8 +62,7 @@ declare interface VelocityOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ speed: ParticleTuple; @@ -99,8 +89,7 @@ declare interface VelocityOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts{ '1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ angle: ParticleTuple; } @@ -173,42 +162,6 @@ declare interface AccelerationOptions< angle?: ParticlePropertyOptions; } -/** - * Defines acceleration options. - * - * @interface AccelerationOptions - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ -declare interface AccelerationOptions { - /** - * Speed property options. - * - * @type { ?ParticlePropertyOptions } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - speed?: ParticlePropertyOptions; - - /** - * Angle property options. - * - * @type { ?ParticlePropertyOptions } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - angle?: ParticlePropertyOptions; -} - /** * Defines the ParticleOptions Interface. * @interface ParticleOptions @@ -387,102 +340,6 @@ interface ParticleOptions< spin?: ParticlePropertyOptions; } -/** - * Defines the ParticleOptions Interface. - * @interface ParticleOptions - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ -interface ParticleOptions { - /** - * Particle emitter. - * @type { EmitterOptions } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - emitter: EmitterOptions; - - /** - * Particle color. - * @type { ?ParticleColorPropertyOptions } - * @default {range:['#FFFFFF','#FFFFFF']} - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - color?: ParticleColorPropertyOptions; - - /** - * Particle opacity. - * @type { ?ParticlePropertyOptions } - * @default {range:[1.0,1.0]} - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - opacity?: ParticlePropertyOptions; - - /** - * Particle scale. - * @type { ?ParticlePropertyOptions } - * @default {range:[1.0,1.0]} - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - scale?: ParticlePropertyOptions; - - /** - * Particle velocity. - * - * @type { ?VelocityOptions } - * @default {speed:[0,0];angle:[0,0]} - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - velocity?: VelocityOptions; - - /** - * Particle acceleration. - * - * @type { ?AccelerationOptions } - * @default {speed:{range:[0,0]};angle:{range:[0,0]}} - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - acceleration?: AccelerationOptions; - - /** - * Particle spin. - * @type { ?ParticlePropertyOptions } - * @default {range:[0,0]} - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - spin?: ParticlePropertyOptions; -} - /** * Defines the parameters for a point-like particle. * @interface PointParticleParameters @@ -496,8 +353,7 @@ interface ParticleOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ interface PointParticleParameters { /** @@ -513,8 +369,7 @@ interface PointParticleParameters { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ radius: VP; } @@ -532,8 +387,7 @@ interface PointParticleParameters { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ interface ImageParticleParameters { /** @@ -549,8 +403,7 @@ interface ImageParticleParameters { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ src: ResourceStr; @@ -577,8 +430,7 @@ interface ImageParticleParameters { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ size: ParticleTuple; @@ -597,8 +449,7 @@ interface ImageParticleParameters { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ objectFit?: ImageFit; } @@ -654,17 +505,6 @@ interface ParticleConfigs { [ParticleType.IMAGE]: ImageParticleParameters; } -/** - * Defines the particle configs. - * @typedef {PointParticleParameters | ImageParticleParameters} ParticleConfigs - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ -declare type ParticleConfigs = PointParticleParameters | ImageParticleParameters; - /** * Defines the emitter property. * @@ -672,8 +512,7 @@ declare type ParticleConfigs = PointParticleParameters | ImageParticleParameters * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ interface EmitterProperty { @@ -684,8 +523,7 @@ interface EmitterProperty { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ index: number; @@ -696,8 +534,7 @@ interface EmitterProperty { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ emitRate?: number; @@ -708,8 +545,7 @@ interface EmitterProperty { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ position?: PositionT; @@ -720,8 +556,7 @@ interface EmitterProperty { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ size?: SizeT; @@ -733,7 +568,6 @@ interface EmitterProperty { * @crossplatform * @atomicservice * @since 20 - * @arkts 1.1&1.2 */ annulusRegion?: ParticleAnnulusRegion; } @@ -883,81 +717,6 @@ interface EmitterParticleOptions { lifetimeRange?: number; } -/** - * Defines parameters of particles used by emitters. - * - * @interface EmitterParticleOptions - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ -interface EmitterParticleOptions { - /** - * Particle type. - * - * @type { ParticleType } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - type: ParticleType; - - /** - * Particle config. - * - * @type { ParticleConfigs } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - config: ParticleConfigs; - - /** - * Particle count. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - count: number; - - /** - * Particle lifetime. - * - * @type { ?number } - * @default 1000 - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - lifetime?: number; - - /** - * Particle lifetimeRange,value range [0, ∞). - * when lifetimeRange>lifetime,minimum lifetime is 0. - * - * @type { ?number } - * @default 0 - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - lifetimeRange?: number; -} - /** * Defines the emitter Options. * @interface EmitterOptions @@ -1124,96 +883,6 @@ interface EmitterOptions { annulusRegion?: ParticleAnnulusRegion; } -/** - * Defines the emitter Options. - * @interface EmitterOptions - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ -interface EmitterOptions { - /** - * Set particle config. - * - * @type { EmitterParticleOptions } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - particle: EmitterParticleOptions; - - /** - * Emitting rate, that is, the number of particles produced per second. - * @type { ?number } - * @default 5 - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - emitRate?: number; - - /** - * Shape of emitter. - * @type { ?ParticleEmitterShape } - * @default ParticleEmitterShape.RECTANGLE - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - shape?: ParticleEmitterShape; - - /** - * Position of emitter. - * The first element means X-axis location. - * The second element means the Y-axis location. - * - * @type { ?ParticleTuple } - * @default [0,0] - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - position?: ParticleTuple; - - /** - * Size of emitter. - * The first element means emitter width. - * The second element means emitter height. - * - * @type { ?ParticleTuple } - * @default ['100%','100%'] - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - size?: ParticleTuple; - - /** - * the description of the annulus region. This parameter is valid only for emitter whose shape is annulus. - * - * @type { ?ParticleAnnulusRegion } - * @default {innerRadius:LengthMetrics.vp(0),outerRadius:LengthMetrics.vp(0)} - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - annulusRegion?: ParticleAnnulusRegion; -} - /** * Defines the particle property updater configs. * @interface ParticlePropertyUpdaterConfigs @@ -1294,17 +963,6 @@ interface ParticlePropertyUpdaterConfigs { [ParticleUpdater.CURVE]: Array>; } -/** - * Defines the particle property updater configs. - * @typedef { undefined | ParticleTuple | Array> } ParticlePropertyUpdaterConfigs - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ -declare type ParticlePropertyUpdaterConfigs = undefined | ParticleTuple | Array>; - /** * Defines the particle updater options. * @@ -1370,42 +1028,6 @@ interface ParticleUpdaterOptions { config: ParticlePropertyUpdaterConfigs[UPDATER]; } -/** - * Defines the particle updater options. - * - * @typedef ParticleUpdaterOptions - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ -interface ParticleUpdaterOptions { - /** - * Particle updater type. - * - * @type { ParticleUpdater } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - type: ParticleUpdater; - - /** - * Particle updater configuration. - * - * @type { ParticlePropertyUpdaterConfigs } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - config: ParticlePropertyUpdaterConfigs; -} - /** * Defines the particle color options. * @@ -1413,8 +1035,7 @@ interface ParticleUpdaterOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ interface ParticleColorOptions { /** @@ -1440,8 +1061,7 @@ interface ParticleColorOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts{ '1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ r: ParticleTuple; @@ -1468,8 +1088,7 @@ interface ParticleColorOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts{ '1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ g: ParticleTuple; @@ -1496,8 +1115,7 @@ interface ParticleColorOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ b: ParticleTuple; @@ -1524,8 +1142,7 @@ interface ParticleColorOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ a: ParticleTuple; } @@ -1595,42 +1212,6 @@ interface ParticleColorUpdaterOptions { config: ParticleColorPropertyUpdaterConfigs[UPDATER]; } -/** - * Defines the particle color updater options. - * - * @interface ParticleColorUpdaterOptions - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ -interface ParticleColorUpdaterOptions { - /** - * Color updater. - * - * @type { ParticleUpdater } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - type: ParticleUpdater; - - /** - * Color updater configuration. - * - * @type { ParticleColorPropertyUpdaterConfigs } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - config: ParticleColorPropertyUpdaterConfigs; -} - /** * Defines the particle property Options. * @interface ParticlePropertyOptions @@ -1705,42 +1286,6 @@ interface ParticlePropertyOptions { updater?: ParticleUpdaterOptions; } -/** - * Defines the particle property Options. - * @interface ParticlePropertyOptions - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ -interface ParticlePropertyOptions { - /** - * Initial range, within which the initial value are randomly generated. - * - * @type { ParticleTuple } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - range: ParticleTuple; - - /** - * Particle property updater. - * - * @type { ?ParticleUpdaterOptions } - * @default {type:UPDATER.NONE;config:undefined} - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - updater?: ParticleUpdaterOptions; -} - /** * Defines the particle color property updater configs. * @interface ParticleColorPropertyUpdaterConfigs @@ -1823,17 +1368,6 @@ interface ParticleColorPropertyUpdaterConfigs { [ParticleUpdater.CURVE]: Array>; } -/** - * Defines the particle color property updater configs. - * @typedef {undefined | ParticleColorOptions | Array>} ParticleColorPropertyUpdaterConfigs - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ -declare type ParticleColorPropertyUpdaterConfigs = undefined | ParticleColorOptions | Array>; - /** * Defines the particle color property updater configs which can support generics. * @interface ParticleColorPropertyOptions @@ -1919,54 +1453,6 @@ interface ParticleColorPropertyOptions { updater?: ParticleColorUpdaterOptions; } -/** - * Defines the particle color property updater. - * @interface ParticleColorPropertyOptions - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ -interface ParticleColorPropertyOptions { - /** - * Initial color range, within which the initial color is randomly generated. - * - * @type { ParticleTuple } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - range: ParticleTuple; - - /** - * Distribution type of particle color. - * @type { ?DistributionType } - * @default DistributionType.UNIFORM - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - distributionType?: DistributionType; - - /** - * Particle color property updater. - * - * @type { ?ParticleColorUpdaterOptions } - * @default {type:UPDATER.NONE;config:undefined} - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - updater?: ParticleColorUpdaterOptions; -} - /** * Defines the particle property lifecycle. * @interface ParticlePropertyAnimation @@ -1980,8 +1466,7 @@ interface ParticleColorPropertyOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ interface ParticlePropertyAnimation { /** @@ -1997,8 +1482,7 @@ interface ParticlePropertyAnimation { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ from: T; @@ -2015,8 +1499,7 @@ interface ParticlePropertyAnimation { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ to: T; @@ -2033,8 +1516,7 @@ interface ParticlePropertyAnimation { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ startMillis: number; @@ -2051,8 +1533,7 @@ interface ParticlePropertyAnimation { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ endMillis: number; @@ -2071,8 +1552,7 @@ interface ParticlePropertyAnimation { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ curve?: Curve | ICurve; } @@ -2133,30 +1613,6 @@ interface Particles< >; } -/** - * Defines the Particles interface. - * - * @interface Particles - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ -interface Particles { - /** - * Array of particles. - * - * @type { Array } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - particles: Array; -} - /** * Defines the particle Interface. * @interface ParticleInterface @@ -2170,8 +1626,7 @@ interface Particles { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 * @noninterop */ interface ParticleInterface { @@ -2223,19 +1678,6 @@ interface ParticleInterface { ACC_ANGLE_UPDATER, SPIN_UPDATER >): ParticleAttribute; - - /** - * create a particle array. - * - * @param { Particles } particles - Array of particles. - * @returns { ParticleAttribute } Returns the particle attribute. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - (particles: Particles): ParticleAttribute; } /** @@ -2251,8 +1693,7 @@ interface ParticleInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare enum ParticleType { /** @@ -2266,8 +1707,7 @@ declare enum ParticleType { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ POINT = 'point', @@ -2282,8 +1722,7 @@ declare enum ParticleType { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ IMAGE = 'image', } @@ -2301,8 +1740,7 @@ declare enum ParticleType { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare enum ParticleEmitterShape { /** @@ -2316,8 +1754,7 @@ declare enum ParticleEmitterShape { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ RECTANGLE = 'rectangle', @@ -2332,8 +1769,7 @@ declare enum ParticleEmitterShape { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ CIRCLE = 'circle', @@ -2348,8 +1784,7 @@ declare enum ParticleEmitterShape { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ ELLIPSE = 'ellipse', @@ -2359,7 +1794,6 @@ declare enum ParticleEmitterShape { * @crossplatform * @atomicservice * @since 20 - * @arkts 1.1&1.2 */ ANNULUS = 'annulus', } @@ -2371,8 +1805,7 @@ declare enum ParticleEmitterShape { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare enum DistributionType { /** @@ -2381,19 +1814,17 @@ declare enum DistributionType { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ UNIFORM = 0, /** * Gaussian distribution. - * + * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ GAUSSIAN = 1, } @@ -2411,8 +1842,7 @@ declare enum DistributionType { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare enum ParticleUpdater { /** @@ -2426,8 +1856,7 @@ declare enum ParticleUpdater { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ NONE = 'none', @@ -2442,8 +1871,7 @@ declare enum ParticleUpdater { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ RANDOM = 'random', @@ -2458,8 +1886,7 @@ declare enum ParticleUpdater { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ CURVE = 'curve', } @@ -2475,7 +1902,7 @@ declare enum ParticleUpdater { */ declare type SizeT = import('../api/arkui/Graphics').SizeT; - /** +/** * Defines the PositionT type. * * @typedef { import('../api/arkui/Graphics').PositionT } @@ -2499,8 +1926,7 @@ declare type PositionT = import('../api/arkui/Graphics').PositionT; * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 * @noninterop */ declare class ParticleAttribute extends CommonMethod { @@ -2512,8 +1938,7 @@ declare class ParticleAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ disturbanceFields(fields: Array): ParticleAttribute; @@ -2525,8 +1950,7 @@ declare class ParticleAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ emitter(value : Array) : ParticleAttribute; } @@ -2553,8 +1977,7 @@ declare const Particle: ParticleInterface; * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare interface DisturbanceFieldOptions { @@ -2568,8 +1991,7 @@ declare interface DisturbanceFieldOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ strength?: number; @@ -2581,8 +2003,7 @@ declare interface DisturbanceFieldOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ shape?: DisturbanceFieldShape; @@ -2594,8 +2015,7 @@ declare interface DisturbanceFieldOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ size?: SizeT; @@ -2607,8 +2027,7 @@ declare interface DisturbanceFieldOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ position?: PositionT; @@ -2624,8 +2043,7 @@ declare interface DisturbanceFieldOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ feather?: number; @@ -2637,12 +2055,11 @@ declare interface DisturbanceFieldOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ noiseScale?: number; - /** + /** * Noise frequency with a value greater or equal 0. * * @type { ?number } @@ -2650,8 +2067,7 @@ declare interface DisturbanceFieldOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ noiseFrequency?: number; @@ -2663,8 +2079,7 @@ declare interface DisturbanceFieldOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ noiseAmplitude?: number; } @@ -2676,8 +2091,7 @@ declare interface DisturbanceFieldOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare enum DisturbanceFieldShape { @@ -2687,21 +2101,19 @@ declare enum DisturbanceFieldShape { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ - RECT, + RECT = 0, - /** + /** * Shape circle. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ - CIRCLE, + CIRCLE = 1, /** * Shape eclipse. @@ -2709,11 +2121,9 @@ declare enum DisturbanceFieldShape { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ - ELLIPSE - + ELLIPSE = 2 } /** @@ -2723,7 +2133,6 @@ declare enum DisturbanceFieldShape { * @crossplatform * @atomicservice * @since 20 - * @arkts 1.1&1.2 */ declare interface ParticleAnnulusRegion { /** @@ -2735,7 +2144,6 @@ declare interface ParticleAnnulusRegion { * @crossplatform * @atomicservice * @since 20 - * @arkts 1.1&1.2 */ center?: PositionT, /** @@ -2746,7 +2154,6 @@ declare interface ParticleAnnulusRegion { * @crossplatform * @atomicservice * @since 20 - * @arkts 1.1&1.2 */ outerRadius: LengthMetrics, /** @@ -2757,7 +2164,6 @@ declare interface ParticleAnnulusRegion { * @crossplatform * @atomicservice * @since 20 - * @arkts 1.1&1.2 */ innerRadius: LengthMetrics, /** @@ -2769,7 +2175,6 @@ declare interface ParticleAnnulusRegion { * @crossplatform * @atomicservice * @since 20 - * @arkts 1.1&1.2 */ startAngle?: number, /** @@ -2781,7 +2186,6 @@ declare interface ParticleAnnulusRegion { * @crossplatform * @atomicservice * @since 20 - * @arkts 1.1&1.2 */ endAngle?: number, } diff --git a/api/@internal/component/ets/tab_content.d.ts b/api/@internal/component/ets/tab_content.d.ts index 28b5954258fa869f248a2f142fda58720f8edf75..89af3678c4367e7fa671a7cacda7730bf3803d75 100644 --- a/api/@internal/component/ets/tab_content.d.ts +++ b/api/@internal/component/ets/tab_content.d.ts @@ -18,15 +18,6 @@ * @kit ArkUI */ -/*** if arkts 1.2 */ -import { CommonMethod } from './common'; -import { CustomBuilder } from './builder' -import { TextHeightAdaptivePolicy, TextOverflow, VerticalAlign } from './enums'; -import { Dimension, Font, Length, LocalizedPadding, Padding, Resource, ResourceColor, ResourceStr, VoidCallback } from './units'; -import { ComponentContent } from '../ComponentContent' -import { SymbolGlyphModifier } from '../SymbolGlyphModifier'; -/*** endif */ - /** * Enum for the mode of the tab bar when selected. * @@ -42,8 +33,7 @@ import { SymbolGlyphModifier } from '../SymbolGlyphModifier'; * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare enum SelectedMode { /** @@ -59,8 +49,7 @@ declare enum SelectedMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ INDICATOR, @@ -77,8 +66,7 @@ declare enum SelectedMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ BOARD } @@ -98,8 +86,7 @@ declare enum SelectedMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare enum LayoutMode { @@ -116,8 +103,7 @@ declare enum LayoutMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ AUTO = 0, /** @@ -133,8 +119,7 @@ declare enum LayoutMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ VERTICAL = 1, @@ -151,8 +136,7 @@ declare enum LayoutMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ HORIZONTAL = 2 } @@ -284,77 +268,6 @@ interface IndicatorStyle { marginTop?: Length; } -/** - * Provide an interface for the style of an SubTabBar indicator including color, height, width, border radius - * and margin top - * - * @interface SubTabBarIndicatorStyle - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - * @arkts 1.2 - */ -declare interface SubTabBarIndicatorStyle { - /** - * Define the color of the indicator - * - * @type { ?ResourceColor } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - color?: ResourceColor; - - /** - * Define the height of the indicator - * - * @type { ?Length } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - height?: Length; - - /** - * Define the width of the indicator. - * If it is 0, the width will be equal to the width of the content - * - * @type { ?Length } - * @default 0 - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - width?: Length; - - /** - * Define the border radius of the indicator - * - * @type { ?Length } - * @default 0 - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - borderRadius?: Length; - - /** - * Define the margin top of the indicator - * - * @type { ?Length } - * @default 8 - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - marginTop?: Length; -} - /** * Provide an interface for the style of an indicator including border radius * @@ -370,8 +283,7 @@ declare interface SubTabBarIndicatorStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ interface BoardStyle { /** @@ -389,8 +301,7 @@ interface BoardStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ borderRadius?: Length; } @@ -555,115 +466,6 @@ declare interface LabelStyle { unselectedColor?: ResourceColor; } -/** - * TabBarLabelStyle object. - * - * @interface TabBarLabelStyle - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ -declare interface TabBarLabelStyle { - - /** - * overflow mode. - * - * @type { ?TextOverflow } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - overflow?: TextOverflow; - - /** - * Label max lines. - * - * @type { ?number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - maxLines?: number; - - /** - * Min font size for adapted height. - * - * @type { ?(number | ResourceStr) } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - minFontSize?: number | ResourceStr; - - /** - * Max font size for adapted height. - * - * @type { ?(number | ResourceStr) } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - maxFontSize?: number | ResourceStr; - - /** - * Adapt text height option. - * - * @type { ?TextHeightAdaptivePolicy } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - heightAdaptivePolicy?: TextHeightAdaptivePolicy; - - /** - * Font style. - * - * @type { ?Font } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - font?: Font; - - /** - * The text color of the selected tab bar. - * - * @type { ?ResourceColor } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - selectedColor?: ResourceColor; - - /** - * The text color of the unselected tab bar. - * - * @type { ?ResourceColor } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - unselectedColor?: ResourceColor; -} - /** * TabBarIconStyle object. * @@ -671,8 +473,7 @@ declare interface TabBarLabelStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare interface TabBarIconStyle { /** @@ -682,8 +483,7 @@ declare interface TabBarIconStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ selectedColor?: ResourceColor; @@ -694,8 +494,7 @@ declare interface TabBarIconStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ unselectedColor?: ResourceColor; } @@ -714,7 +513,6 @@ declare interface TabBarIconStyle { * @crossplatform * @atomicservice * @since 20 - * @arkts 1.1&1.2 * @noninterop */ declare class TabBarSymbol { @@ -736,7 +534,6 @@ declare class TabBarSymbol { * @crossplatform * @atomicservice * @since 20 - * @arkts 1.1&1.2 */ normal: SymbolGlyphModifier; @@ -758,7 +555,6 @@ declare class TabBarSymbol { * @crossplatform * @atomicservice * @since 20 - * @arkts 1.1&1.2 */ selected?: SymbolGlyphModifier; } @@ -770,8 +566,7 @@ declare class TabBarSymbol { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ declare interface TabBarOptions { /** @@ -811,8 +606,7 @@ declare interface TabBarOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ icon?: string | Resource; @@ -848,8 +642,7 @@ declare interface TabBarOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ text?: string | Resource } @@ -873,8 +666,7 @@ declare interface TabBarOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare class SubTabBarStyle { /** @@ -899,8 +691,7 @@ declare class SubTabBarStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ constructor(content: ResourceStr); /** @@ -910,8 +701,7 @@ declare class SubTabBarStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ constructor(content: ResourceStr | ComponentContent); @@ -934,8 +724,7 @@ declare class SubTabBarStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ static of(content: ResourceStr): SubTabBarStyle; /** @@ -947,8 +736,7 @@ declare class SubTabBarStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ static of(content: ResourceStr | ComponentContent): SubTabBarStyle; @@ -973,18 +761,6 @@ declare class SubTabBarStyle { */ indicator(value: IndicatorStyle): SubTabBarStyle; - /** - * Set the style of the indicator when selected - * - * @param { SubTabBarIndicatorStyle } style - indicates the indicator style of the sub tab bar - * @returns { SubTabBarStyle } the style of the sub tab bar - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - indicator(style: SubTabBarIndicatorStyle): SubTabBarStyle; - /** * Set the mode of the indicator when selected * @@ -1006,8 +782,7 @@ declare class SubTabBarStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ selectedMode(value: SelectedMode): SubTabBarStyle; @@ -1032,8 +807,7 @@ declare class SubTabBarStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ board(value: BoardStyle): SubTabBarStyle; @@ -1058,18 +832,6 @@ declare class SubTabBarStyle { */ labelStyle(value: LabelStyle): SubTabBarStyle; - /** - * Set the label style of the sub tab bar - * - * @param { TabBarLabelStyle } style - indicates the label style of the sub tab bar - * @returns { SubTabBarStyle } the style of the sub tab bar - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - labelStyle(style: TabBarLabelStyle): SubTabBarStyle; - /** * Set the padding of the sub tab bar * @@ -1092,8 +854,7 @@ declare class SubTabBarStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ padding(value: Padding | Dimension): SubTabBarStyle; @@ -1109,8 +870,7 @@ declare class SubTabBarStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ padding(padding: LocalizedPadding): SubTabBarStyle; @@ -1131,8 +891,7 @@ declare class SubTabBarStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ id(value: string): SubTabBarStyle; } @@ -1156,8 +915,7 @@ declare class SubTabBarStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare class BottomTabBarStyle { /** @@ -1195,8 +953,7 @@ declare class BottomTabBarStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ constructor(icon: ResourceStr | TabBarSymbol, text: ResourceStr); @@ -1233,8 +990,7 @@ declare class BottomTabBarStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ static of(icon: ResourceStr | TabBarSymbol, text: ResourceStr): BottomTabBarStyle; @@ -1259,18 +1015,6 @@ declare class BottomTabBarStyle { */ labelStyle(value: LabelStyle): BottomTabBarStyle; - /** - * Set the label style of the bottom tab bar - * - * @param { TabBarLabelStyle } style - indicates the label style of the bottom tab bar - * @returns { BottomTabBarStyle } the style of the bottom tab bar - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - labelStyle(style: TabBarLabelStyle): BottomTabBarStyle; - /** * Set the padding of the bottom tab bar * @@ -1304,8 +1048,7 @@ declare class BottomTabBarStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ padding(value: Padding | Dimension | LocalizedPadding): BottomTabBarStyle; @@ -1327,8 +1070,7 @@ declare class BottomTabBarStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ layoutMode(value: LayoutMode): BottomTabBarStyle; @@ -1350,8 +1092,7 @@ declare class BottomTabBarStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ verticalAlign(value: VerticalAlign): BottomTabBarStyle; @@ -1377,8 +1118,7 @@ declare class BottomTabBarStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ symmetricExtensible(value: boolean): BottomTabBarStyle; @@ -1399,8 +1139,7 @@ declare class BottomTabBarStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ id(value: string): BottomTabBarStyle; @@ -1412,8 +1151,7 @@ declare class BottomTabBarStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ iconStyle(style: TabBarIconStyle): BottomTabBarStyle; } @@ -1440,8 +1178,7 @@ declare class BottomTabBarStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 * @noninterop */ interface TabContentInterface { @@ -1467,8 +1204,7 @@ interface TabContentInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ (): TabContentAttribute; } @@ -1495,8 +1231,7 @@ interface TabContentInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 * @noninterop */ declare class TabContentAttribute extends CommonMethod { @@ -1602,8 +1337,7 @@ declare class TabContentAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ tabBar(content: ComponentContent | SubTabBarStyle | BottomTabBarStyle | string | Resource | CustomBuilder | TabBarOptions): TabContentAttribute; @@ -1617,8 +1351,7 @@ declare class TabContentAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ onWillShow(event: VoidCallback): TabContentAttribute; @@ -1631,8 +1364,7 @@ declare class TabContentAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ onWillHide(event: VoidCallback): TabContentAttribute; } diff --git a/api/@internal/component/ets/tabs.d.ts b/api/@internal/component/ets/tabs.d.ts index 664f57f74920f9871b76805549806f88790b3fec..486ee7f689aabb6bd5e18edec751cee7a07404dc 100644 --- a/api/@internal/component/ets/tabs.d.ts +++ b/api/@internal/component/ets/tabs.d.ts @@ -18,12 +18,6 @@ * @kit ArkUI */ -/*** if arkts 1.2 */ -import { BackgroundBlurStyleOptions, BackgroundEffectOptions, BlurStyle, Callback, CommonMethod, Optional, TranslateOptions, DividerStyle, Bindable } from './common'; -import { EdgeEffect, PageFlipMode } from './enums'; -import { Dimension, Length, ResourceColor } from './units'; -/*** endif */ - /** * CommonModifier * @@ -58,8 +52,7 @@ declare type CommonModifier = import('../api/arkui/CommonModifier').CommonModifi * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare enum BarMode { /** @@ -83,8 +76,7 @@ declare enum BarMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ Scrollable = 0, @@ -108,10 +100,9 @@ declare enum BarMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ - Fixed = 1, + Fixed = 1 } /** @@ -121,8 +112,7 @@ declare enum BarMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare enum AnimationMode { /** @@ -131,8 +121,7 @@ declare enum AnimationMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ CONTENT_FIRST = 0, @@ -142,8 +131,7 @@ declare enum AnimationMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ ACTION_FIRST = 1, @@ -153,8 +141,7 @@ declare enum AnimationMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ NO_ANIMATION = 2, @@ -165,8 +152,7 @@ declare enum AnimationMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'15','1.2':'20'} - * @arkts 1.1&1.2 + * @since 15 */ CONTENT_FIRST_WITH_JUMP = 3, @@ -177,8 +163,7 @@ declare enum AnimationMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'15','1.2':'20'} - * @arkts 1.1&1.2 + * @since 15 */ ACTION_FIRST_WITH_JUMP = 4, } @@ -205,8 +190,7 @@ declare enum AnimationMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare enum BarPosition { /** @@ -228,8 +212,7 @@ declare enum BarPosition { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ Start, @@ -252,8 +235,7 @@ declare enum BarPosition { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ End, } @@ -273,8 +255,7 @@ declare enum BarPosition { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare enum LayoutStyle { /** @@ -291,8 +272,7 @@ declare enum LayoutStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ ALWAYS_CENTER = 0, /** @@ -309,8 +289,7 @@ declare enum LayoutStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ ALWAYS_AVERAGE_SPLIT = 1, /** @@ -330,8 +309,7 @@ declare enum LayoutStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ SPACE_BETWEEN_OR_CENTER = 2 } @@ -343,8 +321,7 @@ declare enum LayoutStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ declare enum TabsCacheMode { /** @@ -353,8 +330,7 @@ declare enum TabsCacheMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ CACHE_BOTH_SIDE = 0, @@ -364,8 +340,7 @@ declare enum TabsCacheMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ CACHE_LATEST_SWITCHED = 1 } @@ -389,8 +364,7 @@ declare enum TabsCacheMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare class TabsController { /** @@ -412,8 +386,7 @@ declare class TabsController { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ constructor(); @@ -440,8 +413,7 @@ declare class TabsController { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ changeIndex(value: number): void; @@ -457,8 +429,7 @@ declare class TabsController { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ preloadItems(indices: Optional>): Promise; @@ -469,8 +440,7 @@ declare class TabsController { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'13','1.2':'20'} - * @arkts 1.1&1.2 + * @since 13 */ setTabBarTranslate(translate: TranslateOptions): void; @@ -481,8 +451,7 @@ declare class TabsController { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'13','1.2':'20'} - * @arkts 1.1&1.2 + * @since 13 */ setTabBarOpacity(opacity: number): void; } @@ -494,8 +463,7 @@ declare class TabsController { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'15','1.2':'20'} - * @arkts 1.1&1.2 + * @since 15 * @noninterop */ declare interface TabsOptions { @@ -521,8 +489,7 @@ declare interface TabsOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ barPosition?: BarPosition; @@ -551,17 +518,6 @@ declare interface TabsOptions { * @since 11 */ index?: number; - /** - * Set the index of the currently displayed tab. - * - * @type { ?(number | Bindable) } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - index?: number | Bindable; /** * Set the Tabs controller. @@ -585,10 +541,9 @@ declare interface TabsOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ - controller?: TabsController + controller?: TabsController; /** * Set common attributes to tabbar. @@ -624,8 +579,7 @@ declare interface TabsOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 * @noninterop */ interface TabsInterface { @@ -664,8 +618,7 @@ interface TabsInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'15','1.2':'20'} - * @arkts 1.1&1.2 + * @since 15 */ (options?: TabsOptions): TabsAttribute; } @@ -790,8 +743,7 @@ interface DividerStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare interface TabsAnimationEvent { /** @@ -811,8 +763,7 @@ declare interface TabsAnimationEvent { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ currentOffset: number; @@ -833,8 +784,7 @@ declare interface TabsAnimationEvent { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ targetOffset: number; @@ -855,8 +805,7 @@ declare interface TabsAnimationEvent { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ velocity: number; } @@ -876,8 +825,7 @@ declare interface TabsAnimationEvent { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ interface BarGridColumnOptions { /** @@ -897,8 +845,7 @@ interface BarGridColumnOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ sm?: number; @@ -919,8 +866,7 @@ interface BarGridColumnOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ md?: number; @@ -941,8 +887,7 @@ interface BarGridColumnOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ lg?: number; @@ -962,8 +907,7 @@ interface BarGridColumnOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ margin?: Dimension; @@ -983,8 +927,7 @@ interface BarGridColumnOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ gutter?: Dimension; } @@ -1004,8 +947,7 @@ interface BarGridColumnOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ interface ScrollableBarModeOptions { /** @@ -1024,8 +966,7 @@ interface ScrollableBarModeOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ margin?: Dimension; @@ -1045,8 +986,7 @@ interface ScrollableBarModeOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ nonScrollableLayoutStyle?: LayoutStyle; } @@ -1061,8 +1001,7 @@ interface ScrollableBarModeOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ declare type OnTabsAnimationStartCallback = (index: number, targetIndex: number, extraInfo: TabsAnimationEvent) => void; @@ -1075,8 +1014,7 @@ declare type OnTabsAnimationStartCallback = (index: number, targetIndex: number, * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ declare type OnTabsAnimationEndCallback = (index: number, extraInfo: TabsAnimationEvent) => void; @@ -1089,8 +1027,7 @@ declare type OnTabsAnimationEndCallback = (index: number, extraInfo: TabsAnimati * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ declare type OnTabsGestureSwipeCallback = (index: number, extraInfo: TabsAnimationEvent) => void; @@ -1104,8 +1041,7 @@ declare type OnTabsGestureSwipeCallback = (index: number, extraInfo: TabsAnimati * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ declare type TabsCustomContentTransitionCallback = (from: number, to: number) => TabContentAnimatedTransition | undefined; @@ -1121,8 +1057,7 @@ declare type TabsCustomContentTransitionCallback = (from: number, to: number) => * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ declare type OnTabsContentWillChangeCallback = (currentIndex: number, comingIndex: number) => boolean; @@ -1148,8 +1083,7 @@ declare type OnTabsContentWillChangeCallback = (currentIndex: number, comingInde * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 * @noninterop */ declare class TabsAttribute extends CommonMethod { @@ -1178,8 +1112,7 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ vertical(value: boolean): TabsAttribute; @@ -1208,8 +1141,7 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ barPosition(value: BarPosition): TabsAttribute; @@ -1238,8 +1170,7 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ scrollable(value: boolean): TabsAttribute; @@ -1319,8 +1250,7 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ barMode(value: BarMode, options?: ScrollableBarModeOptions): TabsAttribute; @@ -1362,8 +1292,7 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ barWidth(value: Length): TabsAttribute; @@ -1405,12 +1334,11 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ barHeight(value: Length): TabsAttribute; - /** + /** * Called when the height of the bar graph is set. * Notice: barHeight only supports Number type on 7, supports Length type since 8. * @@ -1423,7 +1351,7 @@ declare class TabsAttribute extends CommonMethod { * @atomicservice * @since 20 */ - barHeight(height: Length, noMinHeightLimit: boolean): TabsAttribute; + barHeight(height: Length, noMinHeightLimit: boolean): TabsAttribute; /** * Sets the animation curve @@ -1441,7 +1369,7 @@ declare class TabsAttribute extends CommonMethod { * @atomicservice * @since 20 */ - animationCurve(curve: Curve | ICurve): TabsAttribute; + animationCurve(curve: Curve | ICurve): TabsAttribute; /** * Called when the animation duration of the bar graph is set. @@ -1469,8 +1397,7 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ animationDuration(value: number): TabsAttribute; @@ -1484,8 +1411,7 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ animationMode(mode: Optional): TabsAttribute; @@ -1498,8 +1424,7 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ edgeEffect(edgeEffect: Optional): TabsAttribute; @@ -1547,23 +1472,21 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ onChange(event: Callback): TabsAttribute; /** - * Called when a new tab becomes selected. Animation is not necessarily complete. + * Called when a new tab becomes unselected. Animation is not necessarily complete. * - * @param { Callback } event - callback to notify which index has been selected + * @param { Callback } event - callback to notify which index has been unselected * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ - onSelected(event: Callback): TabsAttribute; + onUnselected(event: Callback): TabsAttribute; /** * Called when the tab is clicked. @@ -1593,24 +1516,10 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ onTabBarClick(event: Callback): TabsAttribute; - /** - * Called when a new tab becomes unselected. Animation is not necessarily complete. - * - * @param { Callback } event - callback to notify which index has been unselected - * @returns { TabsAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 - */ - onUnselected(event: Callback): TabsAttribute; - /** * Called when the tab content flip animation start. * @@ -1645,8 +1554,7 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ onAnimationStart(handler: OnTabsAnimationStartCallback): TabsAttribute; @@ -1682,8 +1590,7 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ onAnimationEnd(handler: OnTabsAnimationEndCallback): TabsAttribute; @@ -1719,8 +1626,7 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ onGestureSwipe(handler: OnTabsGestureSwipeCallback): TabsAttribute; @@ -1747,8 +1653,7 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ fadingEdge(value: boolean): TabsAttribute; @@ -1769,8 +1674,7 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ divider(value: DividerStyle | null): TabsAttribute; @@ -1790,8 +1694,7 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ barOverlap(value: boolean): TabsAttribute; @@ -1812,8 +1715,7 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ barBackgroundColor(value: ResourceColor): TabsAttribute; @@ -1838,8 +1740,7 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ barGridAlign(value: BarGridColumnOptions): TabsAttribute; @@ -1897,8 +1798,7 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ customContentTransition(delegate: TabsCustomContentTransitionCallback): TabsAttribute; @@ -1910,8 +1810,7 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ barBackgroundBlurStyle(value: BlurStyle): TabsAttribute; @@ -1923,8 +1822,7 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'15','1.2':'20'} - * @arkts 1.1&1.2 + * @since 15 */ pageFlipMode(mode: Optional): TabsAttribute; @@ -1937,8 +1835,7 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ barBackgroundBlurStyle(style: BlurStyle, options: BackgroundBlurStyleOptions): TabsAttribute; @@ -1950,11 +1847,23 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ barBackgroundEffect(options: BackgroundEffectOptions): TabsAttribute; + /** + * Sets the maximum number of child components to be cached. + * + * @param { number } count - the maximum number of child components to be cached. + * @param { TabsCacheMode } mode - the mode of caching child components. + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 19 + */ + cachedMaxCount(count: number, mode: TabsCacheMode): TabsAttribute; + /** * Called when content will change. * @@ -1988,24 +1897,21 @@ declare class TabsAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ onContentWillChange(handler: OnTabsContentWillChangeCallback): TabsAttribute; /** - * Sets the maximum number of child components to be cached. + * Called when a new tab becomes selected. Animation is not necessarily complete. * - * @param { number } count - the maximum number of child components to be cached. - * @param { TabsCacheMode } mode - the mode of caching child components. + * @param { Callback } event - callback to notify which index has been selected * @returns { TabsAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ - cachedMaxCount(count: number, mode: TabsCacheMode): TabsAttribute; + onSelected(event: Callback): TabsAttribute; } /** @@ -2025,8 +1931,7 @@ declare class TabsAttribute extends CommonMethod { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare interface TabContentAnimatedTransition { /** @@ -2050,8 +1955,7 @@ declare interface TabContentAnimatedTransition { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ timeout?: number; @@ -2083,8 +1987,7 @@ declare interface TabContentAnimatedTransition { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ transition: Callback; } @@ -2106,8 +2009,7 @@ declare interface TabContentAnimatedTransition { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare interface TabContentTransitionProxy { /** @@ -2127,8 +2029,7 @@ declare interface TabContentTransitionProxy { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ from: number; @@ -2149,8 +2050,7 @@ declare interface TabContentTransitionProxy { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ to: number; @@ -2169,8 +2069,7 @@ declare interface TabContentTransitionProxy { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ finishTransition(): void; } diff --git a/api/@ohos.animator.d.ts b/api/@ohos.animator.d.ts index 7b40c6e1ec838c62541ade25dc2380d6f1021b24..296ec868c8fe17df89b1d98cdb927b1f1e069910 100644 --- a/api/@ohos.animator.d.ts +++ b/api/@ohos.animator.d.ts @@ -18,11 +18,6 @@ * @kit ArkUI */ -/*** if arkts 1.2 */ -import { FillMode, PlayMode } from './arkui/component/enums'; -import { ExpectedFrameRateRange } from './arkui/component/common'; -/*** endif */ - /** * Defines the animator options. * @interface AnimatorOptions @@ -42,8 +37,7 @@ import { ExpectedFrameRateRange } from './arkui/component/common'; * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ export interface AnimatorOptions { /** @@ -68,8 +62,7 @@ export interface AnimatorOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ duration: number; @@ -141,8 +134,7 @@ export interface AnimatorOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ easing: string; @@ -168,8 +160,7 @@ export interface AnimatorOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ delay: number; @@ -198,8 +189,7 @@ export interface AnimatorOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ fill: "none" | "forwards" | "backwards" | "both"; @@ -225,8 +215,7 @@ export interface AnimatorOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ direction: "normal" | "reverse" | "alternate" | "alternate-reverse"; @@ -252,8 +241,7 @@ export interface AnimatorOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ iterations: number; @@ -279,8 +267,7 @@ export interface AnimatorOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ begin: number; @@ -306,8 +293,7 @@ export interface AnimatorOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ end: number; } @@ -318,8 +304,7 @@ export interface AnimatorOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ export declare class SimpleAnimatorOptions { /** @@ -330,8 +315,7 @@ export declare class SimpleAnimatorOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ constructor(begin: number, end: number); @@ -343,8 +327,7 @@ export declare class SimpleAnimatorOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ duration(duration: number): SimpleAnimatorOptions; @@ -370,8 +353,7 @@ export declare class SimpleAnimatorOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ easing(curve: string): SimpleAnimatorOptions; @@ -383,8 +365,7 @@ export declare class SimpleAnimatorOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ delay(delay: number): SimpleAnimatorOptions; @@ -396,8 +377,7 @@ export declare class SimpleAnimatorOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ fill(fillMode: FillMode): SimpleAnimatorOptions; @@ -409,8 +389,7 @@ export declare class SimpleAnimatorOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ direction(direction: PlayMode): SimpleAnimatorOptions; @@ -422,8 +401,7 @@ export declare class SimpleAnimatorOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ iterations(iterations: number): SimpleAnimatorOptions; } @@ -447,8 +425,7 @@ export declare class SimpleAnimatorOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ export interface AnimatorResult { /** @@ -495,8 +472,7 @@ export interface AnimatorResult { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ reset(options: AnimatorOptions): void; @@ -511,8 +487,7 @@ export interface AnimatorResult { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ reset(options: AnimatorOptions | SimpleAnimatorOptions): void; @@ -532,8 +507,7 @@ export interface AnimatorResult { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ play(): void; @@ -553,8 +527,7 @@ export interface AnimatorResult { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ finish(): void; @@ -574,8 +547,7 @@ export interface AnimatorResult { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ pause(): void; @@ -595,8 +567,7 @@ export interface AnimatorResult { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ cancel(): void; @@ -617,8 +588,7 @@ export interface AnimatorResult { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ reverse(): void; @@ -651,8 +621,7 @@ export interface AnimatorResult { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ onFrame: (progress: number) => void; @@ -685,8 +654,7 @@ export interface AnimatorResult { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ onFinish: () => void; @@ -719,8 +687,7 @@ export interface AnimatorResult { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ onCancel: () => void; @@ -753,8 +720,7 @@ export interface AnimatorResult { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ onRepeat: () => void; @@ -763,8 +729,7 @@ export interface AnimatorResult { * @param { ExpectedFrameRateRange } rateRange - Indicates ExpectedFrameRateRange. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ setExpectedFrameRateRange(rateRange: ExpectedFrameRateRange): void; } @@ -787,15 +752,7 @@ export interface AnimatorResult { * @atomicservice * @since 11 */ -/** - * Defines the Animator class. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.1&1.2 - */ -declare class Animator { +export default class Animator { /** * Create an animator object for custom animation. * @param { AnimatorOptions } options - Options. @@ -858,10 +815,7 @@ declare class Animator { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ static create(options: AnimatorOptions | SimpleAnimatorOptions): AnimatorResult; } - -export default Animator; diff --git a/api/@ohos.animator.static.d.ets b/api/@ohos.animator.static.d.ets new file mode 100644 index 0000000000000000000000000000000000000000..6ce2c66ed0cc8f3006785b33aa5cf835199cf9c0 --- /dev/null +++ b/api/@ohos.animator.static.d.ets @@ -0,0 +1,359 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"), + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit ArkUI + * @arkts 1.2 + */ + +/** + * Contains interpolator functions such as initialization, third-order Bezier curves, and spring curves. + * + * @namespace curves + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +declare namespace curves { + + /** + * enum Curve. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export enum Curve { + + /** + * Linear. Indicates that the animation has the same velocity from start to finish. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Linear, + + /** + * Ease. Indicates that the animation starts at a low speed, then speeds up, and slows down before the end, + * CubicBezier(0.25, 0.1, 0.25, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Ease, + + /** + * EaseIn. Indicates that the animation starts at a low speed, Cubic Bezier (0.42, 0.0, 1.0, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + EaseIn, + + /** + * EaseOut. Indicates that the animation ends at low speed, CubicBezier (0.0, 0.0, 0.58, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + EaseOut, + + /** + * EaseInOut. Indicates that the animation starts and ends at low speed, CubicBezier (0.42, 0.0, 0.58, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + EaseInOut, + + /** + * FastOutSlowIn. Standard curve, cubic-bezier (0.4, 0.0, 0.2, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + FastOutSlowIn, + + /** + * LinearOutSlowIn. Deceleration curve, cubic-bezier (0.0, 0.0, 0.2, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + LinearOutSlowIn, + + /** + * FastOutLinearIn. Acceleration curve, cubic-bezier (0.4, 0.0, 1.0, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + FastOutLinearIn, + + /** + * ExtremeDeceleration. Abrupt curve, cubic-bezier (0.0, 0.0, 0.0, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + ExtremeDeceleration, + + /** + * Sharp. Sharp curves, cubic-bezier (0.33, 0.0, 0.67, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Sharp, + + /** + * Rhythm. Rhythmic curve, cubic-bezier (0.7, 0.0, 0.2, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Rhythm, + + /** + * Smooth. Smooth curves, cubic-bezier (0.4, 0.0, 0.4, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Smooth, + + /** + * Friction. Damping curves, CubicBezier (0.2, 0.0, 0.2, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Friction + } + + /** + * Interface for curve object. + * + * @interface ICurve + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export interface ICurve { + /** + * Get curve value by fraction. + * + * @param { number } fraction -Indicates the current normalized time parameter. Value range: [0, 1]. + * Note: If the value is less than 0, it will be processed as 0. If the value is greater than 1, 1 is used. + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + interpolate(fraction: number): number; + } + + /** + * Implements initialization for the interpolation curve, + * which is used to create an interpolation curve based on the input parameter. + * + * @param { Curve } [curve] - Curve type.
Default value: **Curve.Linear**. + * @returns { ICurve } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export function initCurve(curve?: Curve): ICurve; + + /** + * Creates a step curve. + * + * @param { number } count - Number of steps. The value must be a positive integer.
Value range: [1, +∞). + *

**NOTE**: + *
A value less than 1 evaluates to the value **1**. + *

+ * @param { boolean } end -Whether jumping occurs when the interpolation ends. + * **true**: Jumping occurs when the interpolation ends. + * *false**: Jumping occurs when the interpolation starts. + * @returns { ICurve } Interpolation curve. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export function stepsCurve(count: number, end: boolean): ICurve; + + /** + * Creates a custom curve. + * + * @param { function } interpolate - Custom interpolation callback.fraction: input x value for interpolation. + * when the animation starts. Value range: [0, 1]The return value is the y value of the curve. Value range: [0, 1]. + *

**NOTE**: + *
If fraction is 0, the return value 0 corresponds to the animation start point; any other return value means that + *
the animation jumps at the start point.If fraction is 1, the return value 1 corresponds to the animation + *
end point; any other return value means that the end value of the animation is not the value of the state + *
variable, which will result in an effect of transition from that end value to the value of the state variable. + *

+ * @returns { ICurve } Interpolation curve. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export function customCurve(interpolate: (fraction: number) => number): ICurve; + + /** + * Creates a cubic Bezier curve. The curve values must be between 0 and 1. + * + * @param { number } x1 - X coordinate of the first point on the Bezier curve.
Value range: [0, 1]. + *

**NOTE**: + *
A value less than 0 is handed as **0**. A value greater than 1 is handed as **1**. + *

+ * @param { number } y1 - Y coordinate of the first point on the Bezier curve.
Value range: (-∞, +∞). + * @param { number } x2 - X coordinate of the second point on the Bezier curve.
Value range: [0, 1]. + *

**NOTE**: + *
A value less than 0 is handed as **0**. A value greater than 1 is handed as **1**. + *

+ * @param { number } y2 - Y coordinate of the second point on the Bezier curve.
Value range: (-∞, +∞). + * @returns { ICurve } Interpolation curve. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export function cubicBezierCurve(x1: number, y1: number, x2: number, y2: number): ICurve; + + /** + * Creates a spring curve. The curve shape is subject to the spring parameters, and the animation duration + * is subject to the **duration** parameter in **animation** and **animateTo**. + * + * @param { number } velocity - Initial velocity. It is applied by external factors to the spring animation, + * designed to help ensure the smooth transition from the previous motion state. The velocity is the normalized + * velocity, and its value is equal to the actual velocity at the beginning of the animation divided by the + * animation attribute change value.Value range: (-∞, +∞). + * @param { number } mass - Mass, which influences the inertia in the spring system. The greater the mass, + * the greater the amplitude of the oscillation, and the slower the speed of restoring to the equilibrium position. + * Value range: (0, +∞). + *

**NOTE**: + *
If this parameter is set to a value less than or equal to 0, the value 1 is used. + *

+ * @param { number } stiffness - Stiffness.It is the degree to which an object deforms by resisting the force + * applied. In an elastic system, the greater the stiffness, the stronger the ability to resist deformation, + * and the faster the speed of restoring to the equilibrium position.Value range: (0, +∞). + *

**NOTE**: + *
If this parameter is set to a value less than or equal to 0, the value 1 is used. + *

+ * @param { number } damping -Damping. It is used to describe the oscillation and attenuation of the system + * after being disturbed. The larger the damping, the smaller the number of oscillations of elastic motion, + * and the smaller the oscillation amplitude.Value range: (0, +∞). + *

**NOTE**: + *
If this parameter is set to a value less than or equal to 0, the value 1 is used. + *

+ * @returns { ICurve } Interpolation curve. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export function springCurve(velocity: number, mass: number, stiffness: number, damping: number): ICurve; + + /** + * Creates a spring animation curve. + * If multiple spring animations are applied to the same attribute of an object, + * each animation replaces their predecessor and inherits the velocity. + * + * @param { number } [response] Duration of one complete oscillation. + *
Default value: **0.55**.
Unit: second
Value range: (0, +∞). + *

**NOTE**: + *
If this parameter is set to a value less than or equal to 0, the default value **0.55** is used. + *

+ * @param { number } [dampingFraction] Damping coefficient. + * **0**: undamped. In this case, the spring oscillates forever.
> 0 and < 1: underdamped. + * In this case, the spring overshoots the equilibrium position.
**1**: critically damped. + * 1: overdamped. In this case, the spring approaches equilibrium gradually.
Default value: **0.825**. + * Unit: second. + * Value range: [0, +∞). + *

**NOTE**: + *
A value less than 0 evaluates to the default value **0.825**. + *

+ * @param { number } [overlapDuration] Duration for animations to overlap, in seconds. + * When animations overlap, the **response** values of these animations will transit smoothly over this duratio + * if they are different.
Default value: **0**
Unit: second
Value range: [0, +∞). + *

**NOTE** + *
A value less than 0 evaluates to the default value **0**. + *
The spring animation curve is physics-based. Its duration depends on the **springMotion** parameters and + * the previous velocity, rather than the **duration** parameter in animation, animateTo, or pageTransition. + * The time cannot be normalized. Therefore, the interpolation cannot be obtained using + * the **interpolate** function of the curve. + *

+ * @returns { ICurve } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export function springMotion(response?: number, dampingFraction?: number, overlapDuration?: number): ICurve; + + /** + * Creates a responsive spring animation curve. It is a special case of [springMotion](#curvesspringmotion9), + * with the only difference in the default values. It can be used together with **springMotion**. + * + * @param { number } [response] See **response** in **springMotion**.
Default value: **0.15**. + * Unit: second
Value range: (0, +∞). + *

**NOTE**: + *
If this parameter is set to a value less than or equal to 0, the default value **0.15** is used. + *

+ * @param { number } [dampingFraction] See **dampingFraction** in **springMotion**.
Default value: **0.86**. + * Unit: second
Value range: [0, +∞). + *

**NOTE** + *
A value less than 0 evaluates to the default value **0.86**. + *

+ * @param { number } [overlapDuration] See **overlapDuration** in **springMotion**.
Default value: **0.25**. + * Unit: second
Value range: [0, +∞). + *

**NOTE**: + *
A value less than 0 evaluates to the default value **0.25**. + *
To apply custom settings for a spring animation, you are advised to use **springMotion**. + *
When using **responsiveSpringMotion**, you are advised to retain the default settings. + *
The duration of the responsive spring animation depends on the **responsiveSpringMotion** parameters and the + * previous velocity, rather than the duration parameter in animation, animateTo, or pageTransition. + *
In addition, the interpolation cannot be obtained using the **interpolate** function of the curve. + *

+ * @returns { ICurve } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export function responsiveSpringMotion(response?: number, dampingFraction?: number, overlapDuration?: number): ICurve; + + /** + * Creates an interpolating spring curve animated from 0 to 1. The actual animation value is calculated based + * on the curve. The animation duration is subject to the curve parameters, rather than the **duration** parameter + * in **animation** or **animateTo**. + * + * @param { number } velocity - Initial velocity. It is applied by external factors to the spring animation, + * designed to help ensure the smooth transition from the previous motion state. + * The velocity is the normalized velocity, and its value is equal to the actual velocity at the beginning of + * the animation divided by the animation attribute change value.
Value range: (-∞, +∞). + * @param { number } mass - Mass, which influences the inertia in the spring system. The greater the mass, + * the greater the amplitude of the oscillation, and the slower the speed of restoring to the equilibrium position. + *
Value range: (0, +∞). + *

**NOTE**: + *
If this parameter is set to a value less than or equal to 0, the value **1** is used. + *

+ * @param { number } stiffness - Stiffness. It is the degree to which an object deforms by resisting + * the force applied. In an elastic system, the greater the stiffness, the stronger the ability to resist + * deformation, and the faster the speed of restoring to the equilibrium position.
Value range: (0, +∞). + *

**NOTE**: + *
If this parameter is set to a value less than or equal to 0, the value **1** is used. + *

+ * @param { number } damping - Damping. It is used to describe the oscillation and attenuation of the system + * after being disturbed. The larger the damping, the smaller the number of oscillations of elastic motion, + * and the smaller the oscillation amplitude.
Value range: (0, +∞)
+ *

**NOTE**: + *
If this parameter is set to a value less than or equal to 0, the value **1** is used. + *

+ * @returns { ICurve } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export function interpolatingSpring(velocity: number, mass: number, stiffness: number, damping: number): ICurve; +} +export default curves; diff --git a/api/@ohos.arkui.ArcAlphabetIndexer.d.ts b/api/@ohos.arkui.ArcAlphabetIndexer.d.ts index 2342aff27044a7faa8fb27d8c8824498250950cf..0c926da8c71401ffa426852660f3028498a540c7 100755 --- a/api/@ohos.arkui.ArcAlphabetIndexer.d.ts +++ b/api/@ohos.arkui.ArcAlphabetIndexer.d.ts @@ -1,6 +1,6 @@ /* * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Licensed under the Apache License, Version 2.0 (the "License"), * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * @@ -276,6 +276,15 @@ declare class ArcAlphabetIndexerAttribute extends CommonMethod) } * @syscap SystemCapability.ArkUI.ArkUI.Full * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ radius?: number | string | Array; } @@ -91,18 +84,16 @@ export interface RectShapeOptions extends ShapeSize { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ -export interface RoundRectShapeOptions extends ShapeSize { +interface RoundRectShapeOptions extends ShapeSize { /** * Defines the width of the corner radius for RectShape. * @type { ? (number | string) } * @syscap SystemCapability.ArkUI.ArkUI.Full * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ radiusWidth?: number | string; @@ -112,8 +103,7 @@ export interface RoundRectShapeOptions extends ShapeSize { * @syscap SystemCapability.ArkUI.ArkUI.Full * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ radiusHeight?: number | string; } @@ -126,18 +116,16 @@ export interface RoundRectShapeOptions extends ShapeSize { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ -export interface PathShapeOptions { +interface PathShapeOptions { /** * Defines the commands for drawing the PathShape. * @type { ?string } * @syscap SystemCapability.ArkUI.ArkUI.Full * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ commands?: string; } @@ -149,8 +137,7 @@ export interface PathShapeOptions { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare class CommonShapeMethod { /** @@ -162,8 +149,7 @@ declare class CommonShapeMethod { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ offset(offset: Position): T; @@ -176,8 +162,7 @@ declare class CommonShapeMethod { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ fill(color: ResourceColor): T; @@ -190,8 +175,7 @@ declare class CommonShapeMethod { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ position(position: Position): T; } @@ -204,8 +188,7 @@ declare class CommonShapeMethod { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare class BaseShape extends CommonShapeMethod { /** @@ -217,8 +200,7 @@ declare class BaseShape extends CommonShapeMethod { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ width(width: Length): T; @@ -231,8 +213,7 @@ declare class BaseShape extends CommonShapeMethod { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ height(height: Length): T; @@ -245,8 +226,7 @@ declare class BaseShape extends CommonShapeMethod { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ size(size: SizeOptions): T; } @@ -259,8 +239,7 @@ declare class BaseShape extends CommonShapeMethod { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ export declare class RectShape extends BaseShape { /** @@ -271,8 +250,7 @@ export declare class RectShape extends BaseShape { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ constructor(options?: RectShapeOptions | RoundRectShapeOptions); @@ -285,8 +263,7 @@ export declare class RectShape extends BaseShape { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ radiusWidth(rWidth: number | string): RectShape; @@ -299,8 +276,7 @@ export declare class RectShape extends BaseShape { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ radiusHeight(rHeight: number | string): RectShape; @@ -313,8 +289,7 @@ export declare class RectShape extends BaseShape { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ radius(radius: number | string | Array): RectShape; } @@ -327,8 +302,7 @@ export declare class RectShape extends BaseShape { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ export declare class CircleShape extends BaseShape { /** @@ -339,8 +313,7 @@ export declare class CircleShape extends BaseShape { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ constructor(options?: ShapeSize); } @@ -353,8 +326,7 @@ export declare class CircleShape extends BaseShape { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ export declare class EllipseShape extends BaseShape { /** @@ -365,8 +337,7 @@ export declare class EllipseShape extends BaseShape { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ constructor(options?: ShapeSize); } @@ -379,8 +350,7 @@ export declare class EllipseShape extends BaseShape { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ export declare class PathShape extends CommonShapeMethod { /** @@ -391,8 +361,7 @@ export declare class PathShape extends CommonShapeMethod { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ constructor(options?: PathShapeOptions); @@ -405,8 +374,7 @@ export declare class PathShape extends CommonShapeMethod { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ commands(commands: string): PathShape; } \ No newline at end of file diff --git a/api/@ohos.arkui.shape.static.d.ets b/api/@ohos.arkui.shape.static.d.ets new file mode 100644 index 0000000000000000000000000000000000000000..6ce2c66ed0cc8f3006785b33aa5cf835199cf9c0 --- /dev/null +++ b/api/@ohos.arkui.shape.static.d.ets @@ -0,0 +1,359 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"), + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit ArkUI + * @arkts 1.2 + */ + +/** + * Contains interpolator functions such as initialization, third-order Bezier curves, and spring curves. + * + * @namespace curves + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +declare namespace curves { + + /** + * enum Curve. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export enum Curve { + + /** + * Linear. Indicates that the animation has the same velocity from start to finish. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Linear, + + /** + * Ease. Indicates that the animation starts at a low speed, then speeds up, and slows down before the end, + * CubicBezier(0.25, 0.1, 0.25, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Ease, + + /** + * EaseIn. Indicates that the animation starts at a low speed, Cubic Bezier (0.42, 0.0, 1.0, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + EaseIn, + + /** + * EaseOut. Indicates that the animation ends at low speed, CubicBezier (0.0, 0.0, 0.58, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + EaseOut, + + /** + * EaseInOut. Indicates that the animation starts and ends at low speed, CubicBezier (0.42, 0.0, 0.58, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + EaseInOut, + + /** + * FastOutSlowIn. Standard curve, cubic-bezier (0.4, 0.0, 0.2, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + FastOutSlowIn, + + /** + * LinearOutSlowIn. Deceleration curve, cubic-bezier (0.0, 0.0, 0.2, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + LinearOutSlowIn, + + /** + * FastOutLinearIn. Acceleration curve, cubic-bezier (0.4, 0.0, 1.0, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + FastOutLinearIn, + + /** + * ExtremeDeceleration. Abrupt curve, cubic-bezier (0.0, 0.0, 0.0, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + ExtremeDeceleration, + + /** + * Sharp. Sharp curves, cubic-bezier (0.33, 0.0, 0.67, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Sharp, + + /** + * Rhythm. Rhythmic curve, cubic-bezier (0.7, 0.0, 0.2, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Rhythm, + + /** + * Smooth. Smooth curves, cubic-bezier (0.4, 0.0, 0.4, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Smooth, + + /** + * Friction. Damping curves, CubicBezier (0.2, 0.0, 0.2, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Friction + } + + /** + * Interface for curve object. + * + * @interface ICurve + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export interface ICurve { + /** + * Get curve value by fraction. + * + * @param { number } fraction -Indicates the current normalized time parameter. Value range: [0, 1]. + * Note: If the value is less than 0, it will be processed as 0. If the value is greater than 1, 1 is used. + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + interpolate(fraction: number): number; + } + + /** + * Implements initialization for the interpolation curve, + * which is used to create an interpolation curve based on the input parameter. + * + * @param { Curve } [curve] - Curve type.
Default value: **Curve.Linear**. + * @returns { ICurve } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export function initCurve(curve?: Curve): ICurve; + + /** + * Creates a step curve. + * + * @param { number } count - Number of steps. The value must be a positive integer.
Value range: [1, +∞). + *

**NOTE**: + *
A value less than 1 evaluates to the value **1**. + *

+ * @param { boolean } end -Whether jumping occurs when the interpolation ends. + * **true**: Jumping occurs when the interpolation ends. + * *false**: Jumping occurs when the interpolation starts. + * @returns { ICurve } Interpolation curve. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export function stepsCurve(count: number, end: boolean): ICurve; + + /** + * Creates a custom curve. + * + * @param { function } interpolate - Custom interpolation callback.fraction: input x value for interpolation. + * when the animation starts. Value range: [0, 1]The return value is the y value of the curve. Value range: [0, 1]. + *

**NOTE**: + *
If fraction is 0, the return value 0 corresponds to the animation start point; any other return value means that + *
the animation jumps at the start point.If fraction is 1, the return value 1 corresponds to the animation + *
end point; any other return value means that the end value of the animation is not the value of the state + *
variable, which will result in an effect of transition from that end value to the value of the state variable. + *

+ * @returns { ICurve } Interpolation curve. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export function customCurve(interpolate: (fraction: number) => number): ICurve; + + /** + * Creates a cubic Bezier curve. The curve values must be between 0 and 1. + * + * @param { number } x1 - X coordinate of the first point on the Bezier curve.
Value range: [0, 1]. + *

**NOTE**: + *
A value less than 0 is handed as **0**. A value greater than 1 is handed as **1**. + *

+ * @param { number } y1 - Y coordinate of the first point on the Bezier curve.
Value range: (-∞, +∞). + * @param { number } x2 - X coordinate of the second point on the Bezier curve.
Value range: [0, 1]. + *

**NOTE**: + *
A value less than 0 is handed as **0**. A value greater than 1 is handed as **1**. + *

+ * @param { number } y2 - Y coordinate of the second point on the Bezier curve.
Value range: (-∞, +∞). + * @returns { ICurve } Interpolation curve. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export function cubicBezierCurve(x1: number, y1: number, x2: number, y2: number): ICurve; + + /** + * Creates a spring curve. The curve shape is subject to the spring parameters, and the animation duration + * is subject to the **duration** parameter in **animation** and **animateTo**. + * + * @param { number } velocity - Initial velocity. It is applied by external factors to the spring animation, + * designed to help ensure the smooth transition from the previous motion state. The velocity is the normalized + * velocity, and its value is equal to the actual velocity at the beginning of the animation divided by the + * animation attribute change value.Value range: (-∞, +∞). + * @param { number } mass - Mass, which influences the inertia in the spring system. The greater the mass, + * the greater the amplitude of the oscillation, and the slower the speed of restoring to the equilibrium position. + * Value range: (0, +∞). + *

**NOTE**: + *
If this parameter is set to a value less than or equal to 0, the value 1 is used. + *

+ * @param { number } stiffness - Stiffness.It is the degree to which an object deforms by resisting the force + * applied. In an elastic system, the greater the stiffness, the stronger the ability to resist deformation, + * and the faster the speed of restoring to the equilibrium position.Value range: (0, +∞). + *

**NOTE**: + *
If this parameter is set to a value less than or equal to 0, the value 1 is used. + *

+ * @param { number } damping -Damping. It is used to describe the oscillation and attenuation of the system + * after being disturbed. The larger the damping, the smaller the number of oscillations of elastic motion, + * and the smaller the oscillation amplitude.Value range: (0, +∞). + *

**NOTE**: + *
If this parameter is set to a value less than or equal to 0, the value 1 is used. + *

+ * @returns { ICurve } Interpolation curve. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export function springCurve(velocity: number, mass: number, stiffness: number, damping: number): ICurve; + + /** + * Creates a spring animation curve. + * If multiple spring animations are applied to the same attribute of an object, + * each animation replaces their predecessor and inherits the velocity. + * + * @param { number } [response] Duration of one complete oscillation. + *
Default value: **0.55**.
Unit: second
Value range: (0, +∞). + *

**NOTE**: + *
If this parameter is set to a value less than or equal to 0, the default value **0.55** is used. + *

+ * @param { number } [dampingFraction] Damping coefficient. + * **0**: undamped. In this case, the spring oscillates forever.
> 0 and < 1: underdamped. + * In this case, the spring overshoots the equilibrium position.
**1**: critically damped. + * 1: overdamped. In this case, the spring approaches equilibrium gradually.
Default value: **0.825**. + * Unit: second. + * Value range: [0, +∞). + *

**NOTE**: + *
A value less than 0 evaluates to the default value **0.825**. + *

+ * @param { number } [overlapDuration] Duration for animations to overlap, in seconds. + * When animations overlap, the **response** values of these animations will transit smoothly over this duratio + * if they are different.
Default value: **0**
Unit: second
Value range: [0, +∞). + *

**NOTE** + *
A value less than 0 evaluates to the default value **0**. + *
The spring animation curve is physics-based. Its duration depends on the **springMotion** parameters and + * the previous velocity, rather than the **duration** parameter in animation, animateTo, or pageTransition. + * The time cannot be normalized. Therefore, the interpolation cannot be obtained using + * the **interpolate** function of the curve. + *

+ * @returns { ICurve } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export function springMotion(response?: number, dampingFraction?: number, overlapDuration?: number): ICurve; + + /** + * Creates a responsive spring animation curve. It is a special case of [springMotion](#curvesspringmotion9), + * with the only difference in the default values. It can be used together with **springMotion**. + * + * @param { number } [response] See **response** in **springMotion**.
Default value: **0.15**. + * Unit: second
Value range: (0, +∞). + *

**NOTE**: + *
If this parameter is set to a value less than or equal to 0, the default value **0.15** is used. + *

+ * @param { number } [dampingFraction] See **dampingFraction** in **springMotion**.
Default value: **0.86**. + * Unit: second
Value range: [0, +∞). + *

**NOTE** + *
A value less than 0 evaluates to the default value **0.86**. + *

+ * @param { number } [overlapDuration] See **overlapDuration** in **springMotion**.
Default value: **0.25**. + * Unit: second
Value range: [0, +∞). + *

**NOTE**: + *
A value less than 0 evaluates to the default value **0.25**. + *
To apply custom settings for a spring animation, you are advised to use **springMotion**. + *
When using **responsiveSpringMotion**, you are advised to retain the default settings. + *
The duration of the responsive spring animation depends on the **responsiveSpringMotion** parameters and the + * previous velocity, rather than the duration parameter in animation, animateTo, or pageTransition. + *
In addition, the interpolation cannot be obtained using the **interpolate** function of the curve. + *

+ * @returns { ICurve } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export function responsiveSpringMotion(response?: number, dampingFraction?: number, overlapDuration?: number): ICurve; + + /** + * Creates an interpolating spring curve animated from 0 to 1. The actual animation value is calculated based + * on the curve. The animation duration is subject to the curve parameters, rather than the **duration** parameter + * in **animation** or **animateTo**. + * + * @param { number } velocity - Initial velocity. It is applied by external factors to the spring animation, + * designed to help ensure the smooth transition from the previous motion state. + * The velocity is the normalized velocity, and its value is equal to the actual velocity at the beginning of + * the animation divided by the animation attribute change value.
Value range: (-∞, +∞). + * @param { number } mass - Mass, which influences the inertia in the spring system. The greater the mass, + * the greater the amplitude of the oscillation, and the slower the speed of restoring to the equilibrium position. + *
Value range: (0, +∞). + *

**NOTE**: + *
If this parameter is set to a value less than or equal to 0, the value **1** is used. + *

+ * @param { number } stiffness - Stiffness. It is the degree to which an object deforms by resisting + * the force applied. In an elastic system, the greater the stiffness, the stronger the ability to resist + * deformation, and the faster the speed of restoring to the equilibrium position.
Value range: (0, +∞). + *

**NOTE**: + *
If this parameter is set to a value less than or equal to 0, the value **1** is used. + *

+ * @param { number } damping - Damping. It is used to describe the oscillation and attenuation of the system + * after being disturbed. The larger the damping, the smaller the number of oscillations of elastic motion, + * and the smaller the oscillation amplitude.
Value range: (0, +∞)
+ *

**NOTE**: + *
If this parameter is set to a value less than or equal to 0, the value **1** is used. + *

+ * @returns { ICurve } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export function interpolatingSpring(velocity: number, mass: number, stiffness: number, damping: number): ICurve; +} +export default curves; diff --git a/api/@ohos.curves.d.ts b/api/@ohos.curves.d.ts index 6e9f42033bd1b286e920b84aebe88c31541f769f..06e4518f4340932316c194a8a4d39dd5724fe793 100644 --- a/api/@ohos.curves.d.ts +++ b/api/@ohos.curves.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2025 Huawei Device Co., Ltd. + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -42,17 +42,6 @@ * @atomicservice * @since 11 */ -/** - * Contains interpolator functions such as initialization, third-order Bezier curves, and spring curves. - * - * @namespace curves - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.1&1.2 - */ declare namespace curves { /** * enum Curve. @@ -78,18 +67,7 @@ declare namespace curves { * @atomicservice * @since 11 */ - /** - * enum Curve. - * - * @enum { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.1&1.2 - */ - export enum Curve { + enum Curve { /** * Linear. Indicates that the animation has the same velocity from start to finish. * @@ -111,16 +89,6 @@ declare namespace curves { * @atomicservice * @since 11 */ - /** - * Linear. Indicates that the animation has the same velocity from start to finish. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.1&1.2 - */ Linear, /** * Ease. Indicates that the animation starts at a low speed, then speeds up, and slows down before the end, @@ -146,17 +114,6 @@ declare namespace curves { * @atomicservice * @since 11 */ - /** - * Ease. Indicates that the animation starts at a low speed, then speeds up, and slows down before the end, - * CubicBezier(0.25, 0.1, 0.25, 1.0). - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.1&1.2 - */ Ease, /** * EaseIn. Indicates that the animation starts at a low speed, Cubic Bezier (0.42, 0.0, 1.0, 1.0). @@ -179,16 +136,6 @@ declare namespace curves { * @atomicservice * @since 11 */ - /** - * EaseIn. Indicates that the animation starts at a low speed, Cubic Bezier (0.42, 0.0, 1.0, 1.0). - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.1&1.2 - */ EaseIn, /** * EaseOut. Indicates that the animation ends at low speed, CubicBezier (0.0, 0.0, 0.58, 1.0). @@ -211,16 +158,6 @@ declare namespace curves { * @atomicservice * @since 11 */ - /** - * EaseOut. Indicates that the animation ends at low speed, CubicBezier (0.0, 0.0, 0.58, 1.0). - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.1&1.2 - */ EaseOut, /** * EaseInOut. Indicates that the animation starts and ends at low speed, CubicBezier (0.42, 0.0, 0.58, 1.0). @@ -243,16 +180,6 @@ declare namespace curves { * @atomicservice * @since 11 */ - /** - * EaseInOut. Indicates that the animation starts and ends at low speed, CubicBezier (0.42, 0.0, 0.58, 1.0). - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.1&1.2 - */ EaseInOut, /** * FastOutSlowIn. Standard curve, cubic-bezier (0.4, 0.0, 0.2, 1.0). @@ -275,16 +202,6 @@ declare namespace curves { * @atomicservice * @since 11 */ - /** - * FastOutSlowIn. Standard curve, cubic-bezier (0.4, 0.0, 0.2, 1.0). - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.1&1.2 - */ FastOutSlowIn, /** * LinearOutSlowIn. Deceleration curve, cubic-bezier (0.0, 0.0, 0.2, 1.0). @@ -307,16 +224,6 @@ declare namespace curves { * @atomicservice * @since 11 */ - /** - * LinearOutSlowIn. Deceleration curve, cubic-bezier (0.0, 0.0, 0.2, 1.0). - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.1&1.2 - */ LinearOutSlowIn, /** * FastOutLinearIn. Acceleration curve, cubic-bezier (0.4, 0.0, 1.0, 1.0). @@ -339,16 +246,6 @@ declare namespace curves { * @atomicservice * @since 11 */ - /** - * FastOutLinearIn. Acceleration curve, cubic-bezier (0.4, 0.0, 1.0, 1.0). - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.1&1.2 - */ FastOutLinearIn, /** * ExtremeDeceleration. Abrupt curve, cubic-bezier (0.0, 0.0, 0.0, 1.0). @@ -371,16 +268,6 @@ declare namespace curves { * @atomicservice * @since 11 */ - /** - * ExtremeDeceleration. Abrupt curve, cubic-bezier (0.0, 0.0, 0.0, 1.0). - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.1&1.2 - */ ExtremeDeceleration, /** * Sharp. Sharp curves, cubic-bezier (0.33, 0.0, 0.67, 1.0). @@ -403,16 +290,6 @@ declare namespace curves { * @atomicservice * @since 11 */ - /** - * Sharp. Sharp curves, cubic-bezier (0.33, 0.0, 0.67, 1.0). - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.1&1.2 - */ Sharp, /** * Rhythm. Rhythmic curve, cubic-bezier (0.7, 0.0, 0.2, 1.0). @@ -435,16 +312,6 @@ declare namespace curves { * @atomicservice * @since 11 */ - /** - * Rhythm. Rhythmic curve, cubic-bezier (0.7, 0.0, 0.2, 1.0). - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.1&1.2 - */ Rhythm, /** * Smooth. Smooth curves, cubic-bezier (0.4, 0.0, 0.4, 1.0). @@ -467,16 +334,6 @@ declare namespace curves { * @atomicservice * @since 11 */ - /** - * Smooth. Smooth curves, cubic-bezier (0.4, 0.0, 0.4, 1.0). - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.1&1.2 - */ Smooth, /** * Friction. Damping curves, CubicBezier (0.2, 0.0, 0.2, 1.0). @@ -499,16 +356,6 @@ declare namespace curves { * @atomicservice * @since 11 */ - /** - * Friction. Damping curves, CubicBezier (0.2, 0.0, 0.2, 1.0). - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.1&1.2 - */ Friction, } @@ -536,18 +383,7 @@ declare namespace curves { * @atomicservice * @since 11 */ - /** - * Interface for curve object. - * - * @interface ICurve - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.1&1.2 - */ - export interface ICurve { + interface ICurve { /** * Get curve value by fraction. * @@ -580,19 +416,6 @@ declare namespace curves { * @atomicservice * @since 11 */ - /** - * Get curve value by fraction. - * - * @param { number } fraction -Indicates the current normalized time parameter. Value range: [0, 1]. - * Note: If the value is less than 0, it will be processed as 0. If the value is greater than 1, 1 is used. - * @returns { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.1&1.2 - */ interpolate(fraction: number): number; } @@ -622,10 +445,9 @@ declare namespace curves { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ - export function initCurve(curve?: Curve): ICurve; + function initCurve(curve?: Curve): ICurve; /** * Initializes the interpolator curve when called. @@ -672,10 +494,9 @@ declare namespace curves { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ - export function stepsCurve(count: number, end: boolean): ICurve; + function stepsCurve(count: number, end: boolean): ICurve; /** * Constructs a custom curve when called. @@ -701,8 +522,7 @@ declare namespace curves { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ export function customCurve(interpolate: (fraction: number) => number): ICurve; @@ -762,10 +582,9 @@ declare namespace curves { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ - export function cubicBezierCurve(x1: number, y1: number, x2: number, y2: number): ICurve; + function cubicBezierCurve(x1: number, y1: number, x2: number, y2: number): ICurve; /** * Creates a cubic Bezier curve. The curve value must range from 0 to 1. This API is deprecated since API version 9. @@ -838,10 +657,9 @@ declare namespace curves { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ - export function springCurve(velocity: number, mass: number, stiffness: number, damping: number): ICurve; + function springCurve(velocity: number, mass: number, stiffness: number, damping: number): ICurve; /** * Constructs a spring curve when called. @@ -920,10 +738,9 @@ declare namespace curves { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ - export function springMotion(response?: number, dampingFraction?: number, overlapDuration?: number): ICurve; + function springMotion(response?: number, dampingFraction?: number, overlapDuration?: number): ICurve; /** * Constructs a responsive spring motion when called. @@ -980,10 +797,9 @@ declare namespace curves { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ - export function responsiveSpringMotion(response?: number, dampingFraction?: number, overlapDuration?: number): ICurve; + function responsiveSpringMotion(response?: number, dampingFraction?: number, overlapDuration?: number): ICurve; /** * Constructs an interpolating spring curve when called, the animation duration can not be specified manually, @@ -1034,10 +850,9 @@ declare namespace curves { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ - export function interpolatingSpring(velocity: number, mass: number, stiffness: number, damping: number): ICurve; + function interpolatingSpring(velocity: number, mass: number, stiffness: number, damping: number): ICurve; } export default curves; diff --git a/api/@ohos.curves.static.d.ets b/api/@ohos.curves.static.d.ets new file mode 100644 index 0000000000000000000000000000000000000000..6ce2c66ed0cc8f3006785b33aa5cf835199cf9c0 --- /dev/null +++ b/api/@ohos.curves.static.d.ets @@ -0,0 +1,359 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"), + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit ArkUI + * @arkts 1.2 + */ + +/** + * Contains interpolator functions such as initialization, third-order Bezier curves, and spring curves. + * + * @namespace curves + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +declare namespace curves { + + /** + * enum Curve. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export enum Curve { + + /** + * Linear. Indicates that the animation has the same velocity from start to finish. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Linear, + + /** + * Ease. Indicates that the animation starts at a low speed, then speeds up, and slows down before the end, + * CubicBezier(0.25, 0.1, 0.25, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Ease, + + /** + * EaseIn. Indicates that the animation starts at a low speed, Cubic Bezier (0.42, 0.0, 1.0, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + EaseIn, + + /** + * EaseOut. Indicates that the animation ends at low speed, CubicBezier (0.0, 0.0, 0.58, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + EaseOut, + + /** + * EaseInOut. Indicates that the animation starts and ends at low speed, CubicBezier (0.42, 0.0, 0.58, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + EaseInOut, + + /** + * FastOutSlowIn. Standard curve, cubic-bezier (0.4, 0.0, 0.2, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + FastOutSlowIn, + + /** + * LinearOutSlowIn. Deceleration curve, cubic-bezier (0.0, 0.0, 0.2, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + LinearOutSlowIn, + + /** + * FastOutLinearIn. Acceleration curve, cubic-bezier (0.4, 0.0, 1.0, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + FastOutLinearIn, + + /** + * ExtremeDeceleration. Abrupt curve, cubic-bezier (0.0, 0.0, 0.0, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + ExtremeDeceleration, + + /** + * Sharp. Sharp curves, cubic-bezier (0.33, 0.0, 0.67, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Sharp, + + /** + * Rhythm. Rhythmic curve, cubic-bezier (0.7, 0.0, 0.2, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Rhythm, + + /** + * Smooth. Smooth curves, cubic-bezier (0.4, 0.0, 0.4, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Smooth, + + /** + * Friction. Damping curves, CubicBezier (0.2, 0.0, 0.2, 1.0). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Friction + } + + /** + * Interface for curve object. + * + * @interface ICurve + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export interface ICurve { + /** + * Get curve value by fraction. + * + * @param { number } fraction -Indicates the current normalized time parameter. Value range: [0, 1]. + * Note: If the value is less than 0, it will be processed as 0. If the value is greater than 1, 1 is used. + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + interpolate(fraction: number): number; + } + + /** + * Implements initialization for the interpolation curve, + * which is used to create an interpolation curve based on the input parameter. + * + * @param { Curve } [curve] - Curve type.
Default value: **Curve.Linear**. + * @returns { ICurve } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export function initCurve(curve?: Curve): ICurve; + + /** + * Creates a step curve. + * + * @param { number } count - Number of steps. The value must be a positive integer.
Value range: [1, +∞). + *

**NOTE**: + *
A value less than 1 evaluates to the value **1**. + *

+ * @param { boolean } end -Whether jumping occurs when the interpolation ends. + * **true**: Jumping occurs when the interpolation ends. + * *false**: Jumping occurs when the interpolation starts. + * @returns { ICurve } Interpolation curve. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export function stepsCurve(count: number, end: boolean): ICurve; + + /** + * Creates a custom curve. + * + * @param { function } interpolate - Custom interpolation callback.fraction: input x value for interpolation. + * when the animation starts. Value range: [0, 1]The return value is the y value of the curve. Value range: [0, 1]. + *

**NOTE**: + *
If fraction is 0, the return value 0 corresponds to the animation start point; any other return value means that + *
the animation jumps at the start point.If fraction is 1, the return value 1 corresponds to the animation + *
end point; any other return value means that the end value of the animation is not the value of the state + *
variable, which will result in an effect of transition from that end value to the value of the state variable. + *

+ * @returns { ICurve } Interpolation curve. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export function customCurve(interpolate: (fraction: number) => number): ICurve; + + /** + * Creates a cubic Bezier curve. The curve values must be between 0 and 1. + * + * @param { number } x1 - X coordinate of the first point on the Bezier curve.
Value range: [0, 1]. + *

**NOTE**: + *
A value less than 0 is handed as **0**. A value greater than 1 is handed as **1**. + *

+ * @param { number } y1 - Y coordinate of the first point on the Bezier curve.
Value range: (-∞, +∞). + * @param { number } x2 - X coordinate of the second point on the Bezier curve.
Value range: [0, 1]. + *

**NOTE**: + *
A value less than 0 is handed as **0**. A value greater than 1 is handed as **1**. + *

+ * @param { number } y2 - Y coordinate of the second point on the Bezier curve.
Value range: (-∞, +∞). + * @returns { ICurve } Interpolation curve. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export function cubicBezierCurve(x1: number, y1: number, x2: number, y2: number): ICurve; + + /** + * Creates a spring curve. The curve shape is subject to the spring parameters, and the animation duration + * is subject to the **duration** parameter in **animation** and **animateTo**. + * + * @param { number } velocity - Initial velocity. It is applied by external factors to the spring animation, + * designed to help ensure the smooth transition from the previous motion state. The velocity is the normalized + * velocity, and its value is equal to the actual velocity at the beginning of the animation divided by the + * animation attribute change value.Value range: (-∞, +∞). + * @param { number } mass - Mass, which influences the inertia in the spring system. The greater the mass, + * the greater the amplitude of the oscillation, and the slower the speed of restoring to the equilibrium position. + * Value range: (0, +∞). + *

**NOTE**: + *
If this parameter is set to a value less than or equal to 0, the value 1 is used. + *

+ * @param { number } stiffness - Stiffness.It is the degree to which an object deforms by resisting the force + * applied. In an elastic system, the greater the stiffness, the stronger the ability to resist deformation, + * and the faster the speed of restoring to the equilibrium position.Value range: (0, +∞). + *

**NOTE**: + *
If this parameter is set to a value less than or equal to 0, the value 1 is used. + *

+ * @param { number } damping -Damping. It is used to describe the oscillation and attenuation of the system + * after being disturbed. The larger the damping, the smaller the number of oscillations of elastic motion, + * and the smaller the oscillation amplitude.Value range: (0, +∞). + *

**NOTE**: + *
If this parameter is set to a value less than or equal to 0, the value 1 is used. + *

+ * @returns { ICurve } Interpolation curve. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export function springCurve(velocity: number, mass: number, stiffness: number, damping: number): ICurve; + + /** + * Creates a spring animation curve. + * If multiple spring animations are applied to the same attribute of an object, + * each animation replaces their predecessor and inherits the velocity. + * + * @param { number } [response] Duration of one complete oscillation. + *
Default value: **0.55**.
Unit: second
Value range: (0, +∞). + *

**NOTE**: + *
If this parameter is set to a value less than or equal to 0, the default value **0.55** is used. + *

+ * @param { number } [dampingFraction] Damping coefficient. + * **0**: undamped. In this case, the spring oscillates forever.
> 0 and < 1: underdamped. + * In this case, the spring overshoots the equilibrium position.
**1**: critically damped. + * 1: overdamped. In this case, the spring approaches equilibrium gradually.
Default value: **0.825**. + * Unit: second. + * Value range: [0, +∞). + *

**NOTE**: + *
A value less than 0 evaluates to the default value **0.825**. + *

+ * @param { number } [overlapDuration] Duration for animations to overlap, in seconds. + * When animations overlap, the **response** values of these animations will transit smoothly over this duratio + * if they are different.
Default value: **0**
Unit: second
Value range: [0, +∞). + *

**NOTE** + *
A value less than 0 evaluates to the default value **0**. + *
The spring animation curve is physics-based. Its duration depends on the **springMotion** parameters and + * the previous velocity, rather than the **duration** parameter in animation, animateTo, or pageTransition. + * The time cannot be normalized. Therefore, the interpolation cannot be obtained using + * the **interpolate** function of the curve. + *

+ * @returns { ICurve } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export function springMotion(response?: number, dampingFraction?: number, overlapDuration?: number): ICurve; + + /** + * Creates a responsive spring animation curve. It is a special case of [springMotion](#curvesspringmotion9), + * with the only difference in the default values. It can be used together with **springMotion**. + * + * @param { number } [response] See **response** in **springMotion**.
Default value: **0.15**. + * Unit: second
Value range: (0, +∞). + *

**NOTE**: + *
If this parameter is set to a value less than or equal to 0, the default value **0.15** is used. + *

+ * @param { number } [dampingFraction] See **dampingFraction** in **springMotion**.
Default value: **0.86**. + * Unit: second
Value range: [0, +∞). + *

**NOTE** + *
A value less than 0 evaluates to the default value **0.86**. + *

+ * @param { number } [overlapDuration] See **overlapDuration** in **springMotion**.
Default value: **0.25**. + * Unit: second
Value range: [0, +∞). + *

**NOTE**: + *
A value less than 0 evaluates to the default value **0.25**. + *
To apply custom settings for a spring animation, you are advised to use **springMotion**. + *
When using **responsiveSpringMotion**, you are advised to retain the default settings. + *
The duration of the responsive spring animation depends on the **responsiveSpringMotion** parameters and the + * previous velocity, rather than the duration parameter in animation, animateTo, or pageTransition. + *
In addition, the interpolation cannot be obtained using the **interpolate** function of the curve. + *

+ * @returns { ICurve } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export function responsiveSpringMotion(response?: number, dampingFraction?: number, overlapDuration?: number): ICurve; + + /** + * Creates an interpolating spring curve animated from 0 to 1. The actual animation value is calculated based + * on the curve. The animation duration is subject to the curve parameters, rather than the **duration** parameter + * in **animation** or **animateTo**. + * + * @param { number } velocity - Initial velocity. It is applied by external factors to the spring animation, + * designed to help ensure the smooth transition from the previous motion state. + * The velocity is the normalized velocity, and its value is equal to the actual velocity at the beginning of + * the animation divided by the animation attribute change value.
Value range: (-∞, +∞). + * @param { number } mass - Mass, which influences the inertia in the spring system. The greater the mass, + * the greater the amplitude of the oscillation, and the slower the speed of restoring to the equilibrium position. + *
Value range: (0, +∞). + *

**NOTE**: + *
If this parameter is set to a value less than or equal to 0, the value **1** is used. + *

+ * @param { number } stiffness - Stiffness. It is the degree to which an object deforms by resisting + * the force applied. In an elastic system, the greater the stiffness, the stronger the ability to resist + * deformation, and the faster the speed of restoring to the equilibrium position.
Value range: (0, +∞). + *

**NOTE**: + *
If this parameter is set to a value less than or equal to 0, the value **1** is used. + *

+ * @param { number } damping - Damping. It is used to describe the oscillation and attenuation of the system + * after being disturbed. The larger the damping, the smaller the number of oscillations of elastic motion, + * and the smaller the oscillation amplitude.
Value range: (0, +∞)
+ *

**NOTE**: + *
If this parameter is set to a value less than or equal to 0, the value **1** is used. + *

+ * @returns { ICurve } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export function interpolatingSpring(velocity: number, mass: number, stiffness: number, damping: number): ICurve; +} +export default curves; diff --git a/api/@ohos.matrix4.d.ts b/api/@ohos.matrix4.d.ts index ae8ae432e4aefa318ac4d98a197e100b7602ed31..1aa87f826f96aeffd783336f434280a9e5b337d6 100644 --- a/api/@ohos.matrix4.d.ts +++ b/api/@ohos.matrix4.d.ts @@ -40,8 +40,7 @@ * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare namespace matrix4 { /** @@ -66,10 +65,9 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ - export interface TranslateOption { + interface TranslateOption { /** * Indicates the translation distance of the x-axis, in px. * @@ -95,8 +93,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ x?: number; @@ -125,8 +122,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ y?: number; @@ -155,8 +151,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ z?: number; } @@ -183,10 +178,9 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ - export interface ScaleOption { + interface ScaleOption { /** * Zoom factor of the x-axis. * @@ -213,8 +207,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ x?: number; @@ -244,8 +237,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ y?: number; @@ -275,8 +267,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ z?: number; @@ -305,8 +296,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ centerX?: number; @@ -335,8 +325,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ centerY?: number; } @@ -363,10 +352,9 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ - export interface RotateOption { + interface RotateOption { /** * Axis of rotation vector x coordinate. * @@ -391,8 +379,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ x?: number; @@ -420,8 +407,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ y?: number; @@ -450,8 +436,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ z?: number; @@ -482,8 +467,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ centerX?: number; @@ -514,8 +498,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ centerY?: number; @@ -542,8 +525,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ angle?: number; } @@ -556,8 +538,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ export interface Point { @@ -568,8 +549,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ x: number; @@ -580,8 +560,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ y: number; } @@ -593,8 +572,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ export interface PolyToPolyOptions { @@ -605,8 +583,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ src: Array; @@ -617,8 +594,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ srcIndex?: number; @@ -629,8 +605,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ dst:Array; @@ -642,8 +617,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ dstIndex?: number; @@ -657,8 +631,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ pointCount?:number; @@ -685,10 +658,9 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ - export interface Matrix4Transit { + interface Matrix4Transit { /** * Copy function of Matrix, which can copy a copy of the current matrix object. * @@ -711,8 +683,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ copy(): Matrix4Transit; @@ -738,8 +709,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ invert(): Matrix4Transit; @@ -768,8 +738,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ combine(options: Matrix4Transit): Matrix4Transit; @@ -798,8 +767,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ translate(options: TranslateOption): Matrix4Transit; @@ -828,8 +796,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ scale(options: ScaleOption): Matrix4Transit; @@ -842,8 +809,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ skew(x: number, y: number): Matrix4Transit; @@ -872,8 +838,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ rotate(options: RotateOption): Matrix4Transit; @@ -902,8 +867,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ transformPoint(options: [number, number]): [number, number]; @@ -915,11 +879,9 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ setPolyToPoly(options: PolyToPolyOptions): Matrix4Transit - } /** @@ -1012,8 +974,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ function init( options: [ @@ -1058,8 +1019,7 @@ declare namespace matrix4 { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ function identity(): Matrix4Transit; diff --git a/api/@ohos.matrix4.static.d.ets b/api/@ohos.matrix4.static.d.ets new file mode 100644 index 0000000000000000000000000000000000000000..e58cde437616e07e8a5d947215857662c0b3ffc6 --- /dev/null +++ b/api/@ohos.matrix4.static.d.ets @@ -0,0 +1,442 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"), + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit ArkUI + * @arkts 1.2 + */ + +/** + * Used to do matrix operations + * + * @namespace matrix4 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +declare namespace matrix4 { + + /** + * Set translation parameters + * + * @interface TranslateOption + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export interface TranslateOption { + + /** + * Indicates the translation distance of the x-axis, in px. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + x?: number; + + /** + * Indicates the translation distance of the y-axis, in px. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + y?: number; + + /** + * Indicates the translation distance of the z-axis, in px. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + z?: number; + } + + /** + * Set scaling parameters + * + * @interface ScaleOption + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export interface ScaleOption { + + /** + * Zoom factor of the x-axis. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + x?: number; + + + /** + * Zoom factor of the y-axis. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + y?: number; + + /** + * Zoom factor of the z-axis. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + z?: number; + + + /** + * Transform the x-axis coordinate of the center point. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + centerX?: number; + + /** + * Transform the y-axis coordinate of the center point. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + centerY?: number; + } + + /** + * Set Rotation Parameters. + * + * @interface RotateOption + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export interface RotateOption { + + /** + * Axis of rotation vector x coordinate. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + x?: number; + + /** + * Axis of rotation vector y coordinate. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + y?: number; + + /** + * Axis of rotation vector z coordinate. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + z?: number; + + /** + * Transform the x-axis coordinate of the center point. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + centerX?: number; + + /** + * Transform the y-axis coordinate of the center point. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + centerY?: number; + + /** + * Rotation angle. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + angle?: number; + } + /** + * Set poly to poly point. + * + * @interface Point + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export interface Point { + /** + * Point x. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + x: number; + /** + * Point y. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + y: number; + } + /** + * Set poly to poly point options. + * + * @interface PolyToPolyOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export interface PolyToPolyOptions { + /** + * Array of point coordinates for the source polygon. + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + src: Array; + /** + * Start point index of the source polygon, which defaults to 0. + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + srcIndex?: number; + /** + * Array of point coordinates for the target polygon. + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + dst: Array; + /** + * Start index of the target polygon, which defaults to 0. + * + * @type { ?number } + * @default src.Length/2 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + dstIndex?: number; + /** + * The number of points to be used. + * If it is 0, it returns the identity matrix. + * If it is 1, it returns a translation matrix that changed before two points. + * If it is 2-4, it returns a transformation matrix. + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + pointCount?: number; + } + + + /** + * Matrix4Transit. + * + * @interface Matrix4Transit + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + export interface Matrix4Transit { + + + /** + * Copy function of Matrix, which can copy a copy of the current matrix object. + * + * @returns { Matrix4Transit } Return to Matrix4Transit + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + copy(): Matrix4Transit; + + + /** + * The inverse function of Matrix returns an inverse matrix of the current matrix object, that is, the effect is exactly the opposite. + * + * @returns { Matrix4Transit } Return to Matrix4Transit + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + invert(): Matrix4Transit; + + + /** + * Matrix superposition function, which can superpose the effects of two matrices to generate a new matrix object. + * + * @param { Matrix4Transit } options + * @returns { Matrix4Transit } Return to Matrix4Transit + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + combine(options: Matrix4Transit): Matrix4Transit; + + + /** + * Matrix translation function, which can add the x-axis, Y-axis, or Z-axis translation effect to the current matrix. + * + * @param { TranslateOption } options + * @returns { Matrix4Transit } Return to Matrix4Transit + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + translate(options: TranslateOption): Matrix4Transit; + + + /** + * Scaling function of the Matrix, which can add the x-axis, Y-axis, or Z-axis scaling effect to the current matrix. + * + * @param { ScaleOption } options + * @returns { Matrix4Transit } Return to Matrix4Transit + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + scale(options: ScaleOption): Matrix4Transit; + /** + * Skew function of the Matrix, which can add the x-axis, y-axis skew effect to the current matrix. + * Skew function takes a generic point with coordinates (x0, y0, z0) to the point (x0 + x*y0, y0 + y*x0, z0), + * where x, y are fixed parameters, called the shear factors. + * + * @param { number } x - the shear factor of x-axis. + * @param { number } y - the shear factor of y-axis. + * @returns { Matrix4Transit } Return to Matrix4Transit + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + skew(x: number, y: number): Matrix4Transit; + + + /** + * Rotation function of the Matrix. You can add the x-axis, Y-axis, or Z-axis rotation effect to the current matrix. + * + * @param { RotateOption } options + * @returns { Matrix4Transit } Return to Matrix4Transit + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + rotate(options: RotateOption): Matrix4Transit; + + + /** + * Matrix coordinate point conversion function, which can apply the current transformation effect to a coordinate point. + * + * @param { [number, number] } options + * @returns { [number, number] } Return to Matrix4Transit + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + transformPoint(options: [ + number, + number + ]): [ + number, + number + ]; + /** + * Sets matrix to map src to dst. + * + * @param { PolyToPolyOptions } options - polyToPoly options + * @returns { Matrix4Transit } Return to Matrix4Transit + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + setPolyToPoly(options: PolyToPolyOptions): Matrix4Transit; + } + + + + /** + * Constructor of Matrix, which can create a fourth-order matrix based on the input parameters. The matrix is column-first. + * + * @param { [number,number,number,number,number,number,number,number,number,number,number,number,number,number,number,number] } options + * options indicates a fourth-order matrix + * The default value: + * [1, 0, 0, 0, + * 0, 1, 0, 0, + * 0, 0, 1, 0, + * 0, 0, 0, 1] + * Fourth-order matrix notes: + * m00 { number } -The x-axis scale value, the identity matrix defaults to 1. + * m01 { number } -The second value, the rotation and skew of the xyz axis affects this value. + * m02 { number } -The third value, the rotation of the xyz axis affects this value. + * m03 { number } -The fourth value, the perspective projection affects this value. + * m10 { number } -The fifth value, the rotation and skew of the xyz axis affects this value. + * m11 { number } -The y-axis scales the value, and the identity matrix defaults to 1. + * m12 { number } -The 7th value, the rotation of the xyz axis affects this value. + * m13 { number } -The 8th value, the perspective projection affects this value. + * m20 { number } -The 9th value, the rotation of the xyz axis affects this value. + * m21 { number } -The 10th value, xyz axis rotation affects this value. + * m22 { number } -The z-axis scale value, the identity matrix defaults to 1. + * m23 { number } -The 12th value, the perspective projection affects this value. + * m30 { number } -The x-axis translation value in px, the identity matrix defaults to 0. + * m31 { number } -Y-axis translation value, in px, the identity matrix defaults to 0. + * m32 { number } -The z-axis translation value in px, the identity matrix defaults to 0. + * m33 { number } -It takes effect in homogeneous coordinates to produce a perspective projection effect. + * @returns { Matrix4Transit } Return to Matrix4Transit + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + function init(options: [ + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number + ]): Matrix4Transit; + + + /** + * Matrix initialization function, which can return an identity matrix object. + * + * @returns { Matrix4Transit } Return to Matrix4Transit + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + function identity(): Matrix4Transit; +} +export default matrix4; diff --git a/api/arkui/AlphabetIndexerModifier.d.ts b/api/arkui/AlphabetIndexerModifier.d.ts index 2f845144dfd715ea7a5c38632d1c3003d093ea1e..dd66d4039cd821a630672b68c2a6ffc192e96ebd 100755 --- a/api/arkui/AlphabetIndexerModifier.d.ts +++ b/api/arkui/AlphabetIndexerModifier.d.ts @@ -28,7 +28,7 @@ * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 12 -*/ + */ /** * Defines AlphabetIndexer Modifier * diff --git a/api/arkui/component/alphabetIndexer.static.d.ets b/api/arkui/component/alphabetIndexer.static.d.ets new file mode 100644 index 0000000000000000000000000000000000000000..aa73f27fa1205ae42e617f89592e7f615326e07a --- /dev/null +++ b/api/arkui/component/alphabetIndexer.static.d.ets @@ -0,0 +1,396 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"), + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit ArkUI + * @arkts 1.2 + */ + +import { CommonMethod, BlurStyle, Bindable } from './common'; +import { ResourceColor, Length, Position } from "./units"; +import { Font } from "./units"; +import { memo, ComponentBuilder } from "./../stateManagement/runtime"; +import { AttributeModifier, CommonMethod } from "./common"; +/** + * indexer align property. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare enum IndexerAlign { + /** + * A dialog box is displayed on the right of the index bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Left, + /** + * A dialog box is displayed on the left of the index bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Right, + /** + * A dialog box is displayed on the start of the index bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + START, + /** + * A dialog box is displayed on the end of the index bar. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + END +} +/** + * AlphabetIndexer constructor options. + * + * @interface AlphabetIndexerOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export interface AlphabetIndexerOptions { + /** + * Alphabetical index string array. + * Anonymous Object Rectification. + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + arrayValue: Array; + /** + * ID of the selected item. + * + * @type { number | Bindable } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + selected: number | Bindable; +} +/** + * Defines an AlphabetIndexer callback when onSelect. + * + * @typedef { function } OnAlphabetIndexerSelectCallback + * @param { number } index - selected index + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export type OnAlphabetIndexerSelectCallback = (index: number) => void; +/** + * Defines an AlphabetIndexer callback when onPopupSelect. + * + * @typedef { function } OnAlphabetIndexerPopupSelectCallback + * @param { number } index - selected index + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export type OnAlphabetIndexerPopupSelectCallback = (index: number) => void; +/** + * Defines an AlphabetIndexer callback when onRequestPopupData. + * + * @typedef { function } OnAlphabetIndexerRequestPopupDataCallback + * @param { number } index - selected index + * @returns { Array } string array corresponding to the index + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export type OnAlphabetIndexerRequestPopupDataCallback = (index: number) => Array; + +/** + * The AlphabetIndexerAttribute. + * + * @extends CommonMethod + * @interface AlphabetIndexerAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface AlphabetIndexerAttribute extends CommonMethod { + /** + * Definitions color. + * + * @param { ResourceColor } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + color(value: ResourceColor | undefined): this; + /** + * Select the text color. + * + * @param { ResourceColor } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + selectedColor(value: ResourceColor | undefined): this; + /** + * Font color of the pop-up prompt text. + * + * @param { ResourceColor } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + popupColor(value: ResourceColor | undefined): this; + /** + * Select the text background color. + * + * @param { ResourceColor } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + selectedBackgroundColor(value: ResourceColor | undefined): this; + /** + * Background color of the pop-up window index. + * + * @param { ResourceColor } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + popupBackground(value: ResourceColor | undefined): this; + /** + * Set the selected font color of non-alphabetic part of the pop-up window. + * + * @param { ResourceColor } value - indicates the color of the selected font. + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + popupSelectedColor(value: ResourceColor | undefined): this; + /** + * Set the unselected font color of non-alphabetic part of the pop-up window. + * + * @param { ResourceColor } value - indicates the color of the unselected font. + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + popupUnselectedColor(value: ResourceColor | undefined): this; + /** + * Set the background color of non-alphabetic part of the pop-up window. + * + * @param { ResourceColor } value - indicates the color of background. + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + popupItemBackgroundColor(value: ResourceColor | undefined): this; + /** + * Whether to use pop-up index hints. + * + * @param { boolean } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + usingPopup(value: boolean | undefined): this; + /** + * Select the text text style, + * + * @param { Font } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + selectedFont(value: Font | undefined): this; + /** + * Select the text background color. + * + * @param { Font } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + popupFont(value: Font | undefined): this; + /** + * Set the font style of non-alphabetic part of the prompt pop-up window. + * Family and style are not supported currently and will be fixed in future. + * + * @param { Font } value - indicates the style of the font. + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + popupItemFont(value: Font | undefined): this; + /** + * Size of the letter area on the letter index bar. The letter area is a square. Set the length of the square side. + * + * @param { string | number } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + itemSize(value: string | number | undefined): this; + /** + * Definitions fonts. + * + * @param { Font } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + font(value: Font | undefined): this; + /** + * Alphabet index bar alignment style. The left and right alignment styles are supported, + * which affects the pop-up position of the pop-up window. + * + * @param { IndexerAlign } value - indicates the alignment style of Alphabet index. + * @param { Length } [offset] - indicates the horizontal space between pop-up window and indexer bar. + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + alignStyle(value: IndexerAlign | undefined, offset?: Length | undefined): this; + /** + * Index bar selection callback. + * Anonymous Object Rectification. + * + * @param { OnAlphabetIndexerSelectCallback } callback + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + onSelect(callback: OnAlphabetIndexerSelectCallback | undefined): this; + /** + * Index bar selection callback and return the strings which display on pop-up. + * Anonymous Object Rectification. + * + * @param { OnAlphabetIndexerRequestPopupDataCallback } callback + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + onRequestPopupData(callback: OnAlphabetIndexerRequestPopupDataCallback | undefined): this; + /** + * Pop-up selection callback. + * Anonymous Object Rectification. + * + * @param { OnAlphabetIndexerPopupSelectCallback } callback + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + onPopupSelect(callback: OnAlphabetIndexerPopupSelectCallback | undefined): this; + /** + * Sets the selected index. + * + * @param { number | Bindable } index + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + selected(index: number | Bindable | undefined): this; + /** + * Position of the pop-up windows, relative to the midpoint of the top border of the indexer bar. + * + * @param { Position } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + popupPosition(value: Position | undefined): this; + /** + * Automatically collapses the characters when the indexer bar not high enough to display all characters. + * + * @param { boolean } value - A boolean value determines whether auto collapses is enabled for indexer bar. + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + autoCollapse(value: boolean | undefined): this; + /** + * Set the radius of the item of the pop-up window. + * + * @param { number } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + popupItemBorderRadius(value: number | undefined): this; + /** + * Set the radius of the item of the indexer. + * + * @param { number } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + itemBorderRadius(value: number | undefined): this; + /** + * Set the background blurStyle of title of the pop-up window. + * + * @param { BlurStyle } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + popupBackgroundBlurStyle(value: BlurStyle | undefined): this; + /** + * Set the background color of title of the pop-up window. + * + * @param { ResourceColor } value + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + popupTitleBackground(value: ResourceColor | undefined): this; + /** + * Enable or disable haptic feedback. + * + * @param { boolean } value - Default value is true, set false to disable haptic feedback. + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + enableHapticFeedback(value: boolean | undefined): this; + + /** + * Set the attribute modifier of the component. + * + * @param { AttributeModifier | AttributeModifier | undefined } modifier - + * Set the AlphabetIndexer modifier to the component. + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + attributeModifier(modifier: AttributeModifier | AttributeModifier | undefined): this; +} + +/** + * Defines AlphabetIndexer Component + * + * @param { AlphabetIndexerOptions } options - indexer constructor options + * @param { function } [content_] - container + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +@memo +@ComponentBuilder +export declare function AlphabetIndexer( + options: AlphabetIndexerOptions, + @memo + content_?: () => void, +): AlphabetIndexerAttribute diff --git a/api/arkui/component/pageTransition.static.d.ets b/api/arkui/component/pageTransition.static.d.ets new file mode 100644 index 0000000000000000000000000000000000000000..6e641e20274799c9272cc14d3cc914c8652141a4 --- /dev/null +++ b/api/arkui/component/pageTransition.static.d.ets @@ -0,0 +1,258 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"), + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit ArkUI + * @arkts 1.2 + */ + + +import { ICurve, TranslateOptions, ScaleOptions } from './common'; +import { Curve } from "./enums"; +import { memo, ComponentBuilder } from "./../stateManagement/runtime"; +import { AttributeModifier, CommonMethod } from "./common"; +/** + * Declare the jump method. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare enum RouteType { + /** + * The page is not redirected. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + None, + /** + * Go to the next page. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Push, + /** + * Redirect to a specified page. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Pop +} +/** + * Declare the sliding effect of transition. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare enum SlideEffect { + /** + * Swipe left. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Left, + /** + * Swipe right. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Right, + /** + * Swipe top. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Top, + /** + * Swipe bottom. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Bottom, + /** + * Swipe start. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + START = 5, + /** + * Swipe end. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + END = 6 +} +/** + * Provides interfaces for common transitions. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare class CommonTransition { + /** + * Called when the slide in effect of the transition is set. + * + * @param { SlideEffect } value + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + slide(value: SlideEffect): this; + /** + * Called when the translation effect of page transition is set. + * + * @param { TranslateOptions } value + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + translate(value: TranslateOptions): this; + /** + * Called when setting the zoom effect of page transition. + * + * @param { ScaleOptions } value + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + scale(value: ScaleOptions): this; + /** + * Called when the transparency value of the starting point of entry or the ending point of exit is set. + * + * @param { number } value + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + opacity(value: number): this; +} +/** + * Defines pageTransition constructor parameters. + * + * @interface PageTransitionOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface PageTransitionOptions { + /** + * RouteType in which the pageTransition can work. + * @type { ?RouteType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + type?: RouteType; + /** + * PageTransition animation duration, in ms. + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + duration?: number; + /** + * PageTransition animation curve. + * @type { ?(Curve | string | ICurve) } + * @default Curve.Linear + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + curve?: Curve | string | ICurve; + /** + * PageTransition animation delay time, in ms. + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + delay?: number; +} +/** + * Callback used to report page trasition events. + * + * @typedef { function } PageTransitionCallback + * @param { RouteType } type - transition route type + * @param { number } progress - transition progess + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export type PageTransitionCallback = (type: RouteType, progress: number) => void; +/** + * Provides an interface to set transition style when a page enters. + * + * @extends CommonTransition + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare class PageTransitionEnter extends CommonTransition { + /** + * Called when page Jump animation is used. + * + * @param { PageTransitionOptions } value - pageTransition options + * @returns { PageTransitionEnter } + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + static $_invoke(value: PageTransitionOptions): PageTransitionEnter; + /** + * Called frame by frame to customize pageTransition animation when the page enters. + * The incoming parameter is the normalized progress of the current incoming animation. + * + * @param { PageTransitionCallback } event - animation callback frame by frame + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + onEnter(event: PageTransitionCallback): this; +} +/** + * Provide an interface to set transition style when a page exits. + * + * @extends CommonTransition + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare class PageTransitionExit extends CommonTransition { + /** + * Called when page Jump animation is used. + * + * @param { PageTransitionOptions } value - pageTransition options + * @returns { PageTransitionExit } + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + static $_invoke(value: PageTransitionOptions): PageTransitionExit; + /** + * Called frame by frame to customize pageTransition animation when the page exits. + * The input parameter is the normalized progress of the current exit animation. + * + * @param { PageTransitionCallback } event + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + onExit(event: PageTransitionCallback): this; +} diff --git a/api/arkui/component/particle.static.d.ets b/api/arkui/component/particle.static.d.ets new file mode 100644 index 0000000000000000000000000000000000000000..c1ddb0ff1cef0fc983294412c574c755a81177b4 --- /dev/null +++ b/api/arkui/component/particle.static.d.ets @@ -0,0 +1,918 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"), + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit ArkUI + * @arkts 1.2 + */ + +import { LengthMetrics, SizeT, PositionT } from '../../arkui/Graphics'; +import { VP, ResourceStr, Dimension, ResourceColor } from "./units"; +import { ImageFit, Curve } from "./enums"; +import { ICurve, CommonMethod } from './common'; +import { memo, ComponentBuilder } from "./../stateManagement/runtime"; +import { AttributeModifier, CommonMethod } from "./common"; +/** + * Defines a pair of given type for particle. + * + * @typedef { [T1, T2] } ParticleTuple + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export type ParticleTuple = [ + T1, + T2 +]; +/** + * Defines velocity options. + * + * @typedef VelocityOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface VelocityOptions { + /** + * Particle speed. + * + * Anonymous Object Rectification. + * @type { ParticleTuple } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + speed: ParticleTuple; + /** + * Angle of particle's direction. + * + * Anonymous Object Rectification. + * @type { ParticleTuple } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + angle: ParticleTuple; +} +/** + * Defines acceleration options. + * + * @interface AccelerationOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface AccelerationOptions { + /** + * Speed property options. + * + * @type { ?ParticlePropertyOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + speed?: ParticlePropertyOptions; + /** + * Angle property options. + * + * @type { ?ParticlePropertyOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + angle?: ParticlePropertyOptions; +} +/** + * Defines the ParticleOptions Interface. + * @interface ParticleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export interface ParticleOptions { + /** + * Particle emitter. + * @type { EmitterOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + emitter: EmitterOptions; + /** + * Particle color. + * @type { ?ParticleColorPropertyOptions } + * @default {range:['#FFFFFF','#FFFFFF']} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + color?: ParticleColorPropertyOptions; + /** + * Particle opacity. + * @type { ?ParticlePropertyOptions } + * @default {range:[1.0,1.0]} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + opacity?: ParticlePropertyOptions; + /** + * Particle scale. + * @type { ?ParticlePropertyOptions } + * @default {range:[1.0,1.0]} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + scale?: ParticlePropertyOptions; + /** + * Particle velocity. + * + * @type { ?VelocityOptions } + * @default {speed:[0,0];angle:[0,0]} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + velocity?: VelocityOptions; + /** + * Particle acceleration. + * + * @type { ?AccelerationOptions } + * @default {speed:{range:[0,0]};angle:{range:[0,0]}} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + acceleration?: AccelerationOptions; + /** + * Particle spin. + * @type { ?ParticlePropertyOptions } + * @default {range:[0,0]} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + spin?: ParticlePropertyOptions; +} +/** + * Defines the parameters for a point-like particle. + * @interface PointParticleParameters + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export interface PointParticleParameters { + /** + * Particle radius. + * @type { VP } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + radius: VP; +} +/** + * Defines the parameters for an image-like particle. + * @interface ImageParticleParameters + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export interface ImageParticleParameters { + /** + * Particle image pixelMap. + * @type { ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + src: ResourceStr; + /** + * Particle image size. + * + * Anonymous Object Rectification. + * @type { ParticleTuple } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + size: ParticleTuple; + /** + * Image fit. + * @type { ?ImageFit } + * @default ImageFit.Cover + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + objectFit?: ImageFit; +} +/** + * Defines the particle configs. + * @typedef {PointParticleParameters | ImageParticleParameters} ParticleConfigs + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export type ParticleConfigs = PointParticleParameters | ImageParticleParameters; +/** + * Defines the emitter property. + * + * @interface EmitterProperty + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export interface EmitterProperty { + /** + * Emitter index. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + index: number; + /** + * Emitter emission rate. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + emitRate?: number; + /** + * Emitter emission rate. Only support number type. + * + * @type { ?PositionT } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + position?: PositionT; + /** + * Emitter emission window size. Only support number type. + * + * @type { ?SizeT } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + size?: SizeT; + /** + * the description of the annulus region. This parameter is valid only for emitter whose shape is annulus. + * + * @type { ?ParticleAnnulusRegion } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + annulusRegion?: ParticleAnnulusRegion; +} +/** + * Defines parameters of particles used by emitters. + * + * @interface EmitterParticleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export interface EmitterParticleOptions { + /** + * Particle type. + * + * @type { ParticleType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + type: ParticleType; + /** + * Particle config. + * + * @type { ParticleConfigs } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + config: ParticleConfigs; + /** + * Particle count. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + count: number; + /** + * Particle lifetime. + * + * @type { ?number } + * @default 1000 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + lifetime?: number; + /** + * Particle lifetimeRange,value range [0, ∞). + * when lifetimeRange>lifetime,minimum lifetime is 0. + * + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + lifetimeRange?: number; +} +/** + * Defines the emitter Options. + * @interface EmitterOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export interface EmitterOptions { + /** + * Set particle config. + * + * @type { EmitterParticleOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + particle: EmitterParticleOptions; + /** + * Emitting rate, that is, the number of particles produced per second. + * @type { ?number } + * @default 5 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + emitRate?: number; + /** + * Shape of emitter. + * @type { ?ParticleEmitterShape } + * @default ParticleEmitterShape.RECTANGLE + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + shape?: ParticleEmitterShape; + /** + * Position of emitter. + * The first element means X-axis location. + * The second element means the Y-axis location. + * + * @type { ?ParticleTuple } + * @default [0,0] + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + position?: ParticleTuple; + /** + * Size of emitter. + * The first element means emitter width. + * The second element means emitter height. + * + * @type { ?ParticleTuple } + * @default ['100%','100%'] + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + size?: ParticleTuple; + /** + * the description of the annulus region. This parameter is valid only for emitter whose shape is annulus. + * + * @type { ?ParticleAnnulusRegion } + * @default {innerRadius:LengthMetrics.vp(0),outerRadius:LengthMetrics.vp(0)} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + annulusRegion?: ParticleAnnulusRegion; +} +/** + * Defines the particle property updater configs. + * @typedef { undefined | ParticleTuple | Array> } ParticlePropertyUpdaterConfigs + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export type ParticlePropertyUpdaterConfigs = undefined | ParticleTuple | Array>; +/** + * Defines the particle updater options. + * + * @typedef ParticleUpdaterOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export interface ParticleUpdaterOptions { + /** + * Particle updater type. + * + * @type { ParticleUpdater } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + type: ParticleUpdater; + /** + * Particle updater configuration. + * + * @type { ParticlePropertyUpdaterConfigs } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + config: ParticlePropertyUpdaterConfigs; +} +/** + * Defines the particle color options. + * + * @typedef ParticleColorOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export interface ParticleColorOptions { + /** + * Red component of particle color. + * + * Anonymous Object Rectification. + * @type { ParticleTuple } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + r: ParticleTuple; + /** + * Green component of particle color. + * + * Anonymous Object Rectification. + * @type { ParticleTuple } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + g: ParticleTuple; + /** + * Blue component of particle color. + * + * Anonymous Object Rectification. + * @type { ParticleTuple } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + b: ParticleTuple; + /** + * Opacity component of particle color. + * + * Anonymous Object Rectification. + * @type { ParticleTuple } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + a: ParticleTuple; +} +/** + * Defines the particle color updater options. + * + * @interface ParticleColorUpdaterOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export interface ParticleColorUpdaterOptions { + /** + * Color updater. + * + * @type { ParticleUpdater } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + type: ParticleUpdater; + /** + * Color updater configuration. + * + * @type { ParticleColorPropertyUpdaterConfigs } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + config: ParticleColorPropertyUpdaterConfigs; +} +/** + * Defines the particle property Options. + * @interface ParticlePropertyOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export interface ParticlePropertyOptions { + /** + * Initial range, within which the initial value are randomly generated. + * + * @type { ParticleTuple } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + range: ParticleTuple; + /** + * Particle property updater. + * + * @type { ?ParticleUpdaterOptions } + * @default {type:UPDATER.NONE;config:undefined} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + updater?: ParticleUpdaterOptions; +} +/** + * Defines the particle color property updater configs. + * @typedef {undefined | ParticleColorOptions | Array>} ParticleColorPropertyUpdaterConfigs + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export type ParticleColorPropertyUpdaterConfigs = undefined | ParticleColorOptions | Array>; +/** + * Defines the particle color property updater. + * @interface ParticleColorPropertyOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export interface ParticleColorPropertyOptions { + /** + * Initial color range, within which the initial color is randomly generated. + * + * @type { ParticleTuple } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + range: ParticleTuple; + /** + * Distribution type of particle color. + * @type { ?DistributionType } + * @default DistributionType.UNIFORM + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + distributionType?: DistributionType; + /** + * Particle color property updater. + * + * @type { ?ParticleColorUpdaterOptions } + * @default {type:UPDATER.NONE;config:undefined} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + updater?: ParticleColorUpdaterOptions; +} +/** + * Defines the particle property lifecycle. + * @interface ParticlePropertyAnimation + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export interface ParticlePropertyAnimation { + /** + * Start position of the particle animation. + * @type { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + from: T; + /** + * End position of the particle animation. + * @type { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + to: T; + /** + * Start millis of the particle animation. + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + startMillis: number; + /** + * End millis of the particle animation. + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + endMillis: number; + /** + * Curve of the particle animation. + * @type { ?(Curve | ICurve) } + * @default Curve.Linear + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + curve?: Curve | ICurve; +} +/** + * Defines the Particles interface. + * + * @interface Particles + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export interface Particles { + /** + * Array of particles. + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + particles: Array; +} +/** + * Enumerates the particle types. + * @enum { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare enum ParticleType { + /** + * Point-like particle. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + POINT = 'point', + /** + * Image-like particle. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + IMAGE = 'image' +} +/** + * Enumerates the emitter shapes of a particle. + * @enum { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare enum ParticleEmitterShape { + /** + * Rectangle. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + RECTANGLE = 'rectangle', + /** + * Circle. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + CIRCLE = 'circle', + /** + * Ellipse. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + ELLIPSE = 'ellipse', + /** + * Annulus. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + ANNULUS = 'annulus' +} +/** + * Enumerates the color distribution types of a particle. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare enum DistributionType { + /** + * Uniform distribution. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + UNIFORM = 0, + /** + * Gaussian distribution. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + GAUSSIAN = 1 +} +/** + * Enumerates the updater types of a particle. + * @enum { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare enum ParticleUpdater { + /** + * No updater is used. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + NONE = 'none', + /** + * Random updater. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + RANDOM = 'random', + /** + * Curve updater. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + CURVE = 'curve' +} +export declare interface ParticleAttribute extends CommonMethod { + /** + * Particle disturbance Field. + * + * @param { Array } fields - particle disturbance Field params. + * @returns { ParticleAttribute } Returns the particle attribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + disturbanceFields(fields: Array | undefined): this; + /** + * Add particle animation component properties. + * + * @param { Array } value - The emitter property. + * @returns { ParticleAttribute } Returns the particle attribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + emitter(value: Array | undefined): this; + + /** + * Add particle attribute modifier. + * + * @param { AttributeModifier | AttributeModifier | undefined } modifier - + * The AttributeModifier. + * @returns { ParticleAttribute } Returns the particle attribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + attributeModifier(modifier: AttributeModifier | AttributeModifier | undefined): this; +} +/** + * Defines particle disturbance Field params. + * @interface DisturbanceFieldOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface DisturbanceFieldOptions { + /** + * Strength of the repulsive force from the center outward, + * with positive numbers indicating outward repulsion and negative numbers indicating + * inward attraction. + * + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + strength?: number; + /** + * Disturbance filed shape. + * + * @type { ?DisturbanceFieldShape } + * @default DisturbanceFieldShape.RECT + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + shape?: DisturbanceFieldShape; + /** + * Disturbance filed size width value width, height. + * + * @type { ?SizeT } + * @default {width:0,height:0} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + size?: SizeT; + /** + * Disturbance filed position width value x, y. + * + * @type { ?PositionT } + * @default {x:0,y:0} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + position?: PositionT; + /** + * Attenuation degree of the field from the center point to the field boundary. + * ranging from 0 to 100 integers. If 0, it indicates that the field is a rigid body, + * and all particles within the range will be excluded. + * a larger feather value indicates a greater degree of relaxation in the field, + * and more particles near the center point will appear in the field strength range. The default value is 0. + * + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + feather?: number; + /** + * Scaling parameter is used to control the overall size of noise, with a value greater or equal 0. + * + * @type { ?number } + * @default 1 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + noiseScale?: number; + /** + * Noise frequency with a value greater or equal 0. + * + * @type { ?number } + * @default 1 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + noiseFrequency?: number; + /** + * NoiseAmplitude fluctuation range of noise, value, + * + * @type { ?number } + * @default 1 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + noiseAmplitude?: number; +} +/** + * Defines particle disturbance shape. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare enum DisturbanceFieldShape { + /** + * Shape rect. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + RECT, + /** + * Shape circle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + CIRCLE, + /** + * Shape eclipse. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + ELLIPSE +} +/** + * Defines particle annuslus region params. + * @interface ParticleAnnulusRegion + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface ParticleAnnulusRegion { + /** + * The coordinates of the center of the annulus + * + * @type { ?PositionT } + * @default {x:LengthMetrics.percent(0.5),y:LengthMetrics.percent(0.5)} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + center?: PositionT; + /** + * The outer radius of the annulus + * + * @type { LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + outerRadius: LengthMetrics; + /** + * The inner radius of the annulus + * + * @type { LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + innerRadius: LengthMetrics; + /** + * The start angle of the annulus, in degree + * + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + startAngle?: number; + /** + * The end angle of the annulus, in degree + * + * @type { ?number } + * @default 360 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + endAngle?: number; +} + + +/** + * Defines Particle Component + * + * @param { Particles } particles - particle constructor options + * @param { function } [content_] - container + * @returns { ParticleAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +@memo +@ComponentBuilder +export declare function Particle( + particles: Particles, + @memo + content_?: () => void, +): ParticleAttribute diff --git a/api/arkui/component/tabContent.static.d.ets b/api/arkui/component/tabContent.static.d.ets new file mode 100644 index 0000000000000000000000000000000000000000..93860249b2a0365e48a3791a917b9b56c95876a5 --- /dev/null +++ b/api/arkui/component/tabContent.static.d.ets @@ -0,0 +1,611 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"), + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit ArkUI + * @arkts 1.2 + */ + +import { CommonMethod } from './common'; +import { CustomBuilder } from './builder'; +import { TextHeightAdaptivePolicy, TextOverflow, VerticalAlign } from "./enums"; +import { Dimension, Font, Length, LocalizedPadding, Padding, Resource, ResourceColor, ResourceStr, VoidCallback } from "./units"; +import { ComponentContent } from '../ComponentContent'; +import { SymbolGlyphModifier } from '../SymbolGlyphModifier'; +import { memo, ComponentBuilder } from "./../stateManagement/runtime"; +import { AttributeModifier, CommonMethod } from "./common"; + +/** + * Enum for the mode of the tab bar when selected. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare enum SelectedMode { + /** + * Indicator mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + INDICATOR = 0, + /** + * Board mode. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + BOARD = 1 +} +/** + * Enum for the layout mode of the content in the tab bar. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare enum LayoutMode { + /** + * The the content is laid vertically or horizontally, according to its width. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + AUTO = 0, + /** + * The the content is laid vertically + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + VERTICAL = 1, + /** + * The the content is laid horizontally + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + HORIZONTAL = 2 +} +/** + * Provide an interface for the style of an SubTabBar indicator including color, height, width, border radius + * and margin top + * + * @interface SubTabBarIndicatorStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface SubTabBarIndicatorStyle { + /** + * Define the color of the indicator + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + color?: ResourceColor; + /** + * Define the height of the indicator + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + height?: Length; + /** + * Define the width of the indicator. + * If it is 0, the width will be equal to the width of the content + * + * @type { ?Length } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + width?: Length; + /** + * Define the border radius of the indicator + * + * @type { ?Length } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + borderRadius?: Length; + /** + * Define the margin top of the indicator + * + * @type { ?Length } + * @default 8 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + marginTop?: Length; +} +/** + * Provide an interface for the style of an indicator including border radius + * + * @interface BoardStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export interface BoardStyle { + /** + * Define the border radius of the board + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + borderRadius?: Length; +} +/** + * TabBarLabelStyle object. + * + * @interface TabBarLabelStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface TabBarLabelStyle { + /** + * overflow mode. + * + * @type { ?TextOverflow } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + overflow?: TextOverflow; + /** + * Label max lines. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + maxLines?: number; + /** + * Min font size for adapted height. + * + * @type { ?(number | ResourceStr) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + minFontSize?: number | ResourceStr; + /** + * Max font size for adapted height. + * + * @type { ?(number | ResourceStr) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + maxFontSize?: number | ResourceStr; + /** + * Adapt text height option. + * + * @type { ?TextHeightAdaptivePolicy } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + heightAdaptivePolicy?: TextHeightAdaptivePolicy; + /** + * Font style. + * + * @type { ?Font } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + font?: Font; + /** + * The text color of the selected tab bar. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + selectedColor?: ResourceColor; + /** + * The text color of the unselected tab bar. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + unselectedColor?: ResourceColor; +} +/** + * TabBarIconStyle object. + * + * @interface TabBarIconStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface TabBarIconStyle { + /** + * The icon color of the selected tab bar. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + selectedColor?: ResourceColor; + /** + * The icon color of the unselected tab bar. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + unselectedColor?: ResourceColor; +} +/** + * TabBarSymbol object. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare class TabBarSymbol { + /** + * Symbol icon in the normal style. + * + * @type { SymbolGlyphModifier } + * @default fontColor: #66182431, renderingStrategy: SymbolRenderingStrategy.MULTIPLE_OPACITY, fontSize: 24vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + normal: SymbolGlyphModifier; + /** + * Symbol icon in the selected style. + * + * @type { ?SymbolGlyphModifier } + * @default fontColor: #ff007dff, renderingStrategy: SymbolRenderingStrategy.MULTIPLE_OPACITY, fontSize: 24vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + selected?: SymbolGlyphModifier; +} +/** + * Icon and text for TabBar. + * + * @typedef TabBarOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface TabBarOptions { + /** + * TabBar icon. + * Anonymous Object Rectification + * + *

NOTE: + *
If the icon uses an SVG image, the width and height attributes of the SVG image must be deleted. + * Otherwise, the icon size will be determined by the width and height attributes of the SVG image. + *

+ * + * @type { ?(string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + icon?: string | Resource; + /** + * TabBar text. + * Anonymous Object Rectification + * + * @type { ?(string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + text?: string | Resource; +} +/** + * Define SubTabBarStyle, the style is text and underline. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare class SubTabBarStyle { + /** + * constructor. + * + * @param { ResourceStr } content - indicates the content of the sub tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + constructor(content: ResourceStr); + /** + * constructor. + * + * @param { ResourceStr | ComponentContent } content - indicates the content of the sub tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + constructor(content: ResourceStr | ComponentContent); + /** + * Static constructor used to create a SubTabBarStyle instance. + * + * @param { ResourceStr } content - indicates the content of the sub tab bar + * @returns { SubTabBarStyle } the style of the sub tab bar + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + static of(content: ResourceStr): SubTabBarStyle; + /** + * Static constructor used to create a SubTabBarStyle instance. You can set custom content with ComponentContent. + * + * @param { ResourceStr | ComponentContent } content - indicates the content of the sub tab bar + * @returns { SubTabBarStyle } the style of the sub tab bar + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + static of(content: ResourceStr | ComponentContent): SubTabBarStyle; + /** + * Set the style of the indicator when selected + * + * @param { SubTabBarIndicatorStyle } style - indicates the indicator style of the sub tab bar + * @returns { SubTabBarStyle } the style of the sub tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + indicator(style: SubTabBarIndicatorStyle): SubTabBarStyle; + /** + * Sets the display mode of the selected subtab. + * + *

NOTE: + *
It takes effect only in the horizontal layout. + *

+ * + * @param { SelectedMode } value - display mode of the selected subtab. Default value is SelectedMode.INDICATOR. + * @returns { SubTabBarStyle } the style of the sub tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + selectedMode(value: SelectedMode): SubTabBarStyle; + /** + * Sets the background style (board style) of the selected subtab. + * + *

NOTE: + *
It takes effect only in the horizontal layout. + *

+ * + * @param { BoardStyle } value - background style object for the selected subtab. + * @returns { SubTabBarStyle } the style of the sub tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + board(value: BoardStyle): SubTabBarStyle; + /** + * Set the label style of the sub tab bar + * + * @param { TabBarLabelStyle } style - indicates the label style of the sub tab bar + * @returns { SubTabBarStyle } the style of the sub tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + labelStyle(style: TabBarLabelStyle): SubTabBarStyle; + /** + * Set the padding of the sub tab bar + * + *

NOTE: + *
It cannot be set in percentage. + *
When the parameter is of the Dimension type, the value applies to all sides. + *

+ * + * @param { Padding | Dimension } value - indicates the padding of the sub tab bar + * @returns { SubTabBarStyle } the style of the sub tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + padding(value: Padding | Dimension): SubTabBarStyle; + /** + * Set the padding of the sub tab bar + * + *

NOTE: + *
This API supports mirroring but does not support percentage-based settings. + *

+ * + * @param { LocalizedPadding } padding - indicates the padding of the sub tab bar + * @returns { SubTabBarStyle } the style of the sub tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + padding(padding: LocalizedPadding): SubTabBarStyle; + /** + * Set an id to the sub tab bar to identify it + * + * @param { string } value - id of the sub tab bar to identify it + * @returns { SubTabBarStyle } the style of the sub tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + id(value: string): SubTabBarStyle; +} +/** + * Define BottomTabBarStyle, the style is icon and text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare class BottomTabBarStyle { + /** + * constructor. + * + * @param { ResourceStr | TabBarSymbol } icon - indicates the icon of the bottom tab bar + * @param { ResourceStr } text - indicates the text of the bottom tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + constructor(icon: ResourceStr | TabBarSymbol, text: ResourceStr); + /** + * Static constructor used to create a BottomTabBarStyle instance. + * + * @param { ResourceStr | TabBarSymbol } icon - indicates the icon of the bottom tab bar + * @param { ResourceStr } text - indicates the text of the bottom tab bar + * @returns { BottomTabBarStyle } the style of the bottom tab bar + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + static of(icon: ResourceStr | TabBarSymbol, text: ResourceStr): BottomTabBarStyle; + /** + * Set the label style of the bottom tab bar + * + * @param { TabBarLabelStyle } style - indicates the label style of the bottom tab bar + * @returns { BottomTabBarStyle } the style of the bottom tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + labelStyle(style: TabBarLabelStyle): BottomTabBarStyle; + /** + * Set the padding of the bottom tab bar + * + *

NOTE: + *
It cannot be set in percentage. + *
When the parameter is of the Dimension type, the value applies to all sides. + *

+ * + * @param { Padding | Dimension | LocalizedPadding } value - indicates the padding of the bottom tab bar + * Default value is { left:4.0vp, right:4.0vp, top:0.0vp, bottom:0.0vp }. + * @returns { BottomTabBarStyle } the style of the bottom tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + padding(value: Padding | Dimension | LocalizedPadding): BottomTabBarStyle; + /** + * Sets the layout mode of the images and texts on the bottom tab. + * + * @param { LayoutMode } value - layout mode of the images and text on the bottom tab. + * Default value is LayoutMode.VERTICAL. + * @returns { BottomTabBarStyle } the style of the bottom tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + layoutMode(value: LayoutMode): BottomTabBarStyle; + /** + * Sets the vertical alignment mode of the images and text on the bottom tab. + * + * @param { VerticalAlign } value - vertical alignment mode of the images and text on the bottom tab. + * Default value is VerticalAlign.Center. + * @returns { BottomTabBarStyle } the style of the bottom tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + verticalAlign(value: VerticalAlign): BottomTabBarStyle; + /** + * Sets whether the images and text on the bottom tab can be symmetrically extended by + * the minimum value of the available space on the left and right bottom tabs. + * + *

NOTE: + *
This parameter is valid only between bottom tabs in fixed horizontal mode. + *

+ * + * @param { boolean } value - indicates whether the bottom tab bar is extensible. Default value is false. + * @returns { BottomTabBarStyle } the style of the bottom tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + symmetricExtensible(value: boolean): BottomTabBarStyle; + /** + * Set an id to the bottom tab bar to identify it + * + * @param { string } value - id of the bottom tab bar to identify it + * @returns { BottomTabBarStyle } the style of the bottom tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + id(value: string): BottomTabBarStyle; + /** + * Sets the style of the label icon on the bottom tab. + * + * @param { TabBarIconStyle } style - style of the label icon on the bottom tab. + * @returns { BottomTabBarStyle } the style of the bottom tab bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + iconStyle(style: TabBarIconStyle): BottomTabBarStyle; +} + +/** + * Define the TabContentAttribute. + * + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface TabContentAttribute extends CommonMethod { + /** + * Sets the content displayed on the tab bar. + * Anonymous Object Rectification + * + *

NOTE: + *
If BottomTabBarStyle or TabBarOptions is used and an icon is set, + * a gray block will be displayed if the icon is invalid. + *
If the content exceeds the space provided by the tab bar, it will be clipped. + *

+ * + * @param { ComponentContent | SubTabBarStyle | BottomTabBarStyle | string | Resource | CustomBuilder | TabBarOptions } content + * Content displayed on the tab bar. + * @returns { TabContentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + tabBar(content: ComponentContent | SubTabBarStyle | BottomTabBarStyle | string | Resource | CustomBuilder | TabBarOptions | undefined): this; + /** + * Called when the tab content is about to be displayed. The scenarios include the first-time display, + * tab switching, page switching, and window switching between the foreground and background. + * + * @param { VoidCallback } event + * @returns { TabContentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + onWillShow(event: VoidCallback | undefined): this; + /** + * Called when the tab content is about to be hidden. The scenarios include the tab switching, + * page switching, and window switching between the foreground and background. + * + * @param { VoidCallback } event + * @returns { TabContentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + onWillHide(event: VoidCallback | undefined): this; + + /** + * Set the attribute modifier for TabContent. + * + * @param { AttributeModifier | AttributeModifier | undefined } modifier + * @returns { TabContentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + attributeModifier(modifier: AttributeModifier | AttributeModifier | undefined): this; +} + +/** + * Defines TabContent Component + * + * @param { function } [content_] - TabContent + * @returns { TabContentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +@memo +@ComponentBuilder +export declare function TabContent( + + @memo + content_?: () => void, +): TabContentAttribute; diff --git a/api/arkui/component/tabs.static.d.ets b/api/arkui/component/tabs.static.d.ets new file mode 100644 index 0000000000000000000000000000000000000000..6448ffa65522fc55b2627afbf214ee3cbbef9769 --- /dev/null +++ b/api/arkui/component/tabs.static.d.ets @@ -0,0 +1,861 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"), + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit ArkUI + * @arkts 1.2 + */ + +import { BackgroundBlurStyleOptions, BackgroundEffectOptions, BlurStyle, Callback, CommonMethod, Optional, TranslateOptions, DividerStyle, Bindable } from './common'; +import { EdgeEffect, PageFlipMode } from "./enums"; +import { Dimension, Length, ResourceColor } from "./units"; +import { memo, ComponentBuilder } from "./../stateManagement/runtime"; +import { AttributeModifier, CommonMethod } from "./common"; +/** + * Declare the graphic format of the bar chart. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare enum BarMode { + /** + * The width of each tab is determined by the actual layout. The tabs are scrollable in the following case: + * In horizontal layout, the total width exceeds the tab bar width; in vertical layout, + * the total height exceeds the tab bar height. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Scrollable = 0, + /** + * The width of each tab is determined by equally dividing the number of tabs by the bar width + * (or bar height in the vertical layout). + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Fixed = 1 +} +/** + * Declare the animation mode of tab content. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare enum AnimationMode { + /** + * Load the content of the target page before starting the switching animation. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + CONTENT_FIRST = 0, + /** + * Start the switching animation before loading the content of the target page. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + ACTION_FIRST = 1, + /** + * Disable the default switching animation. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + NO_ANIMATION = 2, + /** + * Load the content of the target page first, then jump to the vicinity of the target page without animation, + * and finally jump to the target page with animation. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + CONTENT_FIRST_WITH_JUMP = 3, + /** + * Jump to the vicinity of the target page without animation first, + * then jump to the target page with animation, and finally load the content of the target page. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + ACTION_FIRST_WITH_JUMP = 4 +} +/** + * Declare the location of the bar chart. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare enum BarPosition { + /** + * When the vertical attribute method is set to true, the tab is on the left of the container. When the vertical property method is set to false, the tab is at the top of the container. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Start, + /** + * When the vertical attribute method is set to true, the tab is located on the right of the container. When the vertical property method is set to false, the tab is at the bottom of the container. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + End +} +/** + * Declare the layout style of the tab bar items. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare enum LayoutStyle { + /** + * If the tab content exceeds the tab bar width, the tabs are scrollable. + * If not, the tabs are compactly centered on the tab bar and not scrollable. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + ALWAYS_CENTER = 0, + /** + * If the tab content exceeds the tab bar width, the tabs are scrollable. + * If not, the tabs are not scrollable, and the width of the tab bar is evenly distributed among all tabs. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + ALWAYS_AVERAGE_SPLIT = 1, + /** + * If the tab content exceeds the tab bar width, the tabs are scrollable. If the tab content exceeds + * half the width of the tab bar but is still within the tab bar width, the tabs are compactly centered and + * not scrollable.If the tab content does not exceed half the width of the tab bar, the tabs are centered within + * half the width of the tab bar with even spacing between them and are not scrollable. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + SPACE_BETWEEN_OR_CENTER = 2 +} +/** + * Declare the cache mode of the child components. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare enum TabsCacheMode { + /** + * Caches the child components on both sides of the current child components. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + CACHE_BOTH_SIDE = 0, + /** + * Caches the latest switched child components. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + CACHE_LATEST_SWITCHED = 1 +} +/** + * Provides methods for switching tabs. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare class TabsController { + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + constructor(); + /** + * Switches to the specified tab. + * + * @param { number } value - Index of the tab. If this parameter is set to a value less than 0 + * or greater than the maximum number, the default value 0 is used. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + changeIndex(value: number): void; + /** + * Called when need to preload specified tab content. + * + * @param { Optional> } indices - Indices of tab content to be preloaded. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - Parameter invalid. Possible causes: + *
1. The parameter type is not Array. + *
2. The parameter is an empty array. + *
3. The parameter contains an invalid index. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + preloadItems(indices: Optional>): Promise; + /** + * Set tab bar translate. + * + * @param { TranslateOptions } translate - translate options + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + setTabBarTranslate(translate: TranslateOptions): void; + /** + * Set tab bar opacity. + * + * @param { number } opacity - opacity + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + setTabBarOpacity(opacity: number): void; +} +/** + * Options used to create Tabs. + * + * @typedef TabsOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface TabsOptions { + /** + * Set the tab location for Tabs. + * + * @type { ?BarPosition } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + barPosition?: BarPosition; + /** + * Set the index of the currently displayed tab. + * + * @type { ?(number | Bindable) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + index?: number | Bindable; + /** + * Set the Tabs controller. + * + * @type { ?TabsController } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + controller?: TabsController; +} +/** + * Provides an interface for tabs animation. + * + * @interface TabsAnimationEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface TabsAnimationEvent { + /** + * Offset of the current page to the start position of the tabs main axis. The unit is vp. + * + * @type { number } + * @default 0.0 vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + currentOffset: number; + /** + * Offset of the target page to the start position of the tabs main axis. The unit is vp. + * + * @type { number } + * @default 0.0 vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + targetOffset: number; + /** + * Start speed of the page-turning animation. The unit is vp/s. + * + * @type { number } + * @default 0.0 vp/s + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + velocity: number; +} +/** + * Provides an interface for the grid column options of an tab bar including sm, md, lg, margin and gutter. + * + * @interface BarGridColumnOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export interface BarGridColumnOptions { + /** + * Number of columns occupied by a tab on a screen whose width is + * greater than or equal to 320 vp but less than 600 vp. The value must be a non-negative even number. + * + * @type { ?number } + * @default -1 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + sm?: number; + /** + * Number of columns occupied by a tab on a screen whose width is + * greater than or equal to 600 vp but less than 800 vp. The value must be a non-negative even number. + * + * @type { ?number } + * @default -1 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + md?: number; + /** + * Number of columns occupied by a tab on a screen whose width is + * greater than or equal to 840 vp but less than 1024 vp. The value must be a non-negative even number. + * + * @type { ?number } + * @default -1 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + lg?: number; + /** + * Column margin in grid mode. It cannot be set in percentage. + * + * @type { ?Dimension } + * @default 24vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + margin?: Dimension; + /** + * Column gutter (that is, gap between columns) in grid mode. It cannot be set in percentage. + * + * @type { ?Dimension } + * @default 24vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + gutter?: Dimension; +} +/** + * Provides an interface for the options for the scrollable bar mode including margin and nonScrollableLayoutStyle. + * + * @interface ScrollableBarModeOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export interface ScrollableBarModeOptions { + /** + * Left and right margin of the tab bar in scrollable mode. It cannot be set in percentage. + * + * @type { ?Dimension } + * @default 0vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + margin?: Dimension; + /** + * Tab layout mode of the tab bar when not scrolling in scrollable mode. + * + * @type { ?LayoutStyle } + * @default LayoutStyle.ALWAYS_CENTER + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + nonScrollableLayoutStyle?: LayoutStyle; +} +/** + * Defines a tabs callback when onAnimationStart. + * + * @typedef { function } OnTabsAnimationStartCallback + * @param { number } index - The index value of the tab that when animation start. + * @param { number } targetIndex - The target index value of the tab that when animation start. + * @param { TabsAnimationEvent } extraInfo - The extra callback info. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export type OnTabsAnimationStartCallback = (index: number, targetIndex: number, extraInfo: TabsAnimationEvent) => void; +/** + * Defines a tabs callback when onAnimationEnd. + * + * @typedef { function } OnTabsAnimationEndCallback + * @param { number } index - The index value of the tab that when animation end. + * @param { TabsAnimationEvent } extraInfo - The extra callback info. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export type OnTabsAnimationEndCallback = (index: number, extraInfo: TabsAnimationEvent) => void; +/** + * Defines a tabs callback when onGestureSwipe. + * + * @typedef { function } OnTabsGestureSwipeCallback + * @param { number } index - The index value of the tab before gesture swipe. + * @param { TabsAnimationEvent } extraInfo - The extra callback info. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export type OnTabsGestureSwipeCallback = (index: number, extraInfo: TabsAnimationEvent) => void; +/** + * Defines a tabs callback when customContentTransition. + * + * @typedef { function } TabsCustomContentTransitionCallback + * @param { number } from - The index value of the current tab when the animation begins. + * @param { number } to - The index value of the target tab when the animation begins. + * @returns { TabContentAnimatedTransition | undefined } Returns animated transition options of tab or undefined. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export type TabsCustomContentTransitionCallback = (from: number, to: number) => TabContentAnimatedTransition | undefined; +/** + * Defines a tabs callback when onContentWillChange. + * + * @typedef { function } OnTabsContentWillChangeCallback + * @param { number } currentIndex - The index value of the current tab. + * @param { number } comingIndex - The index value of the tab that will change. + * @returns { boolean } + * Tabs can change from currentIndex to comingIndex if function return true. + * Tabs can not change from currentIndex to comingIndex if function return false. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export type OnTabsContentWillChangeCallback = (currentIndex: number, comingIndex: number) => boolean; + +/** + * The TabsAttribute. + * + * @extends CommonMethod + * @interface TabsAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface TabsAttribute extends CommonMethod { + /** + * Sets whether to use vertical tabs. + * + * @param { boolean } value - Whether to use vertical tabs. Default value is false. + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + vertical(value: boolean | undefined): this; + /** + * Sets the position of the Tabs component. + * + * @param { BarPosition } value - Position of the Tabs component. Default value is BarPosition.Start. + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + barPosition(value: BarPosition | undefined): this; + /** + * Sets whether the tabs are scrollable. + * + * @param { boolean } value - Whether the tabs are scrollable. Default value is true. + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + scrollable(value: boolean | undefined): this; + /** + * Sets the tab bar layout mode. + * + * @param { BarMode } value - Layout mode. Default value is BarMode.Fixed. + * @param { ScrollableBarModeOptions } [options] - Layout style of the tab bar in scrollable mode. + * This parameter is effective only when the tab bar is in horizontal scrollable mode. + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + barMode(value: BarMode | undefined, options?: ScrollableBarModeOptions | undefined): this; + /** + * Sets the width of the tab bar. + * Notice: barWidth only supports Number type on 7, supports Length type since 8. + * + * @param { Length } value - Width of the tab bar. If the set value is less than 0 + * or greater than the width of the Tabs component, the default value is used. + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + barWidth(value: Length | undefined): this; + /** + * Sets the height of the tab bar. + * Notice: barHeight only supports Number type on 7, supports Length type since 8. + * + * @param { Length } value - Height of the tab bar. If the set value is less than 0 or + * greater than the height of the Tabs component, the default value is used. + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + barHeight(value: Length | undefined): this; + /** + * Sets the length of time required to complete the tab switching animation, + * which is initiated by clicking a specific tab or by calling the changeIndex API of TabsController. + * + * @param { number } value + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + animationDuration(value: number | undefined): this; + /** + * Sets the animation mode for tab switching initiated by clicking a specific tab or + * by calling the changeIndex API of TabsController. + * + * @param { Optional } mode - animation mode for tabs switch animation. + * Default value is AnimationMode.CONTENT_FIRST. + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + animationMode(mode: AnimationMode | undefined): this; + /** + * Sets the edge effect used when the boundary of the scrolling area is reached. + * + * @param { Optional } edgeEffect - Effect used when the boundary of the scrolling area is reached. + * Default value is EdgeEffect.Spring. + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + edgeEffect(edgeEffect: EdgeEffect | undefined): this; + /** + * Triggered when a tab is switched. + * Anonymous Object Rectification + * + *

NOTE: + *
This event is triggered when any of the following conditions is met: + * 1. The swiping animation is completed, followed by tab switching. + * 2. The Controller API is called. + * 3. The attribute value is updated using a state variable. + * 4. A tab is clicked. + *

+ * + * @param { Callback } event + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + onChange(event: Callback | undefined): this; + /** + * Called when a new tab becomes selected. Animation is not necessarily complete. + * + * @param { Callback } event - callback to notify which index has been selected + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + onSelected(event: Callback | undefined): this; + /** + * Triggered when a tab is clicked. + * Anonymous Object Rectification + * + * @param { Callback } event + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + onTabBarClick(event: Callback | undefined): this; + /** + * Called when a new tab becomes unselected. Animation is not necessarily complete. + * + * @param { Callback } event - callback to notify which index has been unselected + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + onUnselected(event: Callback | undefined): this; + /** + * Triggered when the tab switching animation starts. + * Anonymous Object Rectification + * + * @param { OnTabsAnimationStartCallback } handler + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + onAnimationStart(handler: OnTabsAnimationStartCallback | undefined): this; + /** + * Triggered when the tab switching animation ends. + * Anonymous Object Rectification + * + * @param { OnTabsAnimationEndCallback } handler + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + onAnimationEnd(handler: OnTabsAnimationEndCallback | undefined): this; + /** + * Triggered on a frame-by-frame basis when the tab is switched by a swipe. + * Anonymous Object Rectification + * + * @param { OnTabsGestureSwipeCallback } handler + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + onGestureSwipe(handler: OnTabsGestureSwipeCallback | undefined): this; + /** + * Sets whether the tab fades out when it exceeds the container width. + * + *

NOTE: + *
It is recommended that this attribute be used together with the barBackgroundColor attribute. + * If the barBackgroundColor attribute is not defined, the tab fades out in white + * when it exceeds the container width by default. + *

+ * + * @param { boolean } value - Whether the tab fades out when it exceeds the container width. Default value is true. + * @returns { TabsAttribute } the attribute of the tabs + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + fadingEdge(value: boolean | undefined): this; + /** + * Set the divider between tab bar and tab content. + * + * @param { DividerStyle | null } value - indicates the style of the indicator. Default value is null. + * @returns { TabsAttribute } the attribute of the tabs + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + divider(value: DividerStyle | null | undefined): this; + /** + * Sets whether the tab bar is superimposed on the TabContent component after having its background blurred. + * + * @param { boolean } value - indicates whether the tab bar overlaps with the tab content. Default value is false. + * @returns { TabsAttribute } the attribute of the tabs + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + barOverlap(value: boolean | undefined): this; + /** + * Set the background color of the tab bar. + * + * @param { ResourceColor } value - indicates the background color of the tab bar. + * Default value is Color.Transparent. + * @returns { TabsAttribute } the attribute of the tabs + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + barBackgroundColor(value: ResourceColor | undefined): this; + /** + * Sets the visible area of the tab bar in grid mode. + * + *

NOTE: + *
This attribute is effective only in horizontal mode. It is not applicable to XS, XL, and XXL devices. + *

+ * + * @param { BarGridColumnOptions } value - indicates the bar grid alignment options. + * @returns { TabsAttribute } the attribute of the tabs + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + barGridAlign(value: BarGridColumnOptions | undefined): this; + /** + * Custom tab content transition animation. + * When undefined is set, this interface does not take effect. + * Anonymous Object Rectification + * + *

NOTE: + *
Instructions: + *
1. When the custom tab switching animation is used, the default switching animation of + * the Tabs component is disabled, and tabs cannot be switched through swiping. + *
2. The value undefined means not to use the custom tab switching animation, + * in which case the default switching animation is used. + *
3. The custom tab switching animation cannot be interrupted. + *
4. Currently, the custom tab switching animation can be triggered only by clicking a tab + * or by calling the TabsController.changeIndex() API. + *
5. When the custom tab switching animation is used, + * the Tabs component supports all events except onGestureSwipe. + *
6. Notes about the onChange and onAnimationEnd events: If the second custom animation is triggered + * during the execution of the first custom animation, the onChange and onAnimationEnd events of + * the first custom animation will be triggered when the second custom animation starts. + *
7. When the custom animation is used, the stack layout is used for pages involved in the animation. + * If the zIndex attribute is not set for related pages, the zIndex values of all pages are the same. + * In this case, the pages are rendered in the order in which they are added to + * the component tree(that is, the sequence of page indexes). In light of this, + * to control the rendering levels of pages, set the zIndex attribute of the pages. + *

+ * + * @param { TabsCustomContentTransitionCallback } delegate - Custom content transition animation. + * @returns { TabsAttribute } The attribute of the tabs. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + customContentTransition(delegate: TabsCustomContentTransitionCallback | undefined): this; + /** + * Sets the background blur style of the tab bar. + * + * @param { BlurStyle } value - Background blur style of the tab bar. Default value is BlurStyle.NONE. + * @returns { TabsAttribute } the attribute of the tabs + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + barBackgroundBlurStyle(value: BlurStyle | undefined): this; + /** + * Setting page flip mode on mouse wheel event. + * + * @param { Optional } mode - page flip mode on mouse wheel event. The default value is PageFlipMode.CONTINUOUS. + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + pageFlipMode(mode: PageFlipMode | undefined): this; + /** + * Set the BlurStyle of the tab bar. + * + * @param { BlurStyle } style - style indicate the blur style for the tab bar + * @param { BackgroundBlurStyleOptions } options - options indicate the options for the tab bar + * @returns { TabsAttribute } the attribute of the tabs + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + barBackgroundBlurStyle(style: BlurStyle | undefined, options: BackgroundBlurStyleOptions | undefined): this; + /** + * Set the BackgroundEffect of the tab bar. + * + * @param { BackgroundEffectOptions } options - options indicate the options for the tab bar + * @returns { TabsAttribute } the attribute of the tabs + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + barBackgroundEffect(options: BackgroundEffectOptions | undefined): this; + /** + * Triggered when a new page is about to be displayed. + * Anonymous Object Rectification + * + *

NOTE: + *
This event is triggered when any of the following conditions is met: + * 1. When the user swipes on the TabContent component (provided that it supports swiping) to switch to a new page. + * 2. When TabsController.changeIndex is called to switch to a new page. + * 3. When the **index** attribute is changed to switch to a new page. + * 4. When the user clicks a tab on the tab bar to switch to a new page. + * 5. When the user presses the left or right arrow key on the keyboard to switch to a new page + * while the tab bar is focused. + *

+ * + * @param { OnTabsContentWillChangeCallback } handler + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + onContentWillChange(handler: OnTabsContentWillChangeCallback | undefined): this; + /** + * Sets the maximum number of child components to be cached. + * + * @param { number } count - the maximum number of child components to be cached. + * @param { TabsCacheMode } mode - the mode of caching child components. + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + cachedMaxCount(count: number | undefined, mode: TabsCacheMode | undefined): this; + + /** + * Sets the attribute modifier to Tabs. + * + * @param { numberAttributeModifier | AttributeModifier | undefined } modifier - + * the input modifier. + * @returns { TabsAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + attributeModifier(modifier: AttributeModifier | AttributeModifier | undefined): this; +} +/** + * Defines the Tab Content animated transition options. + * + * @interface TabContentAnimatedTransition + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface TabContentAnimatedTransition { + /** + * Defines the timeout of custom content transition animation. The unit is ms. + * If TabContentTransitionProxy.finishTransition() is not invoked, use the timeout as animation end time. + * + * @type { ?number } + * @default 1000 ms + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + timeout?: number; + /** + * Called when custom content transition animation start. + * Anonymous Object Rectification + * + * @type { Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + transition: Callback; +} +/** + * The proxy of TabContentAnimatedTransition. + * + * @interface TabContentTransitionProxy + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface TabContentTransitionProxy { + /** + * The index of current tab content. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + from: number; + /** + * The index of target tab content. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + to: number; + /** + * Notifies Tabs component the custom content transition animation is complete. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + finishTransition(): void; +} + +/** + * Defines Tabs Component + * + * @param { TabsOptions } [options] - tabs constructor options + * @param { function } [content_] - container + * @returns { FlowItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +@memo +@ComponentBuilder +export declare function Tabs( + options?: TabsOptions, + @memo + content_?: () => void, +): TabsAttribute