mirror of
https://gitee.com/openharmony/interface_sdk-js
synced 2025-02-25 19:52:16 +00:00
add interface LengthMetric
Signed-off-by: xiangshouxing <xiangshouxing@huawei.com> Change-Id: I0b6910d6f3bd3ceb1eed420f38fdfc8bcf4ea20d Signed-off-by: xiangshouxing <xiangshouxing@huawei.com>
This commit is contained in:
parent
efa9f0ae7f
commit
7d8bd5a868
2
api/@ohos.arkui.node.d.ts
vendored
2
api/@ohos.arkui.node.d.ts
vendored
@ -61,7 +61,7 @@ export { DrawContext, Size, Offset, Position, Pivot, Scale, Translation, Matrix4
|
||||
* @crossplatform
|
||||
* @since 12
|
||||
*/
|
||||
export { LengthUnit, SizeT, LengthMetric } from './arkui/Graphics';
|
||||
export { LengthUnit, SizeT, LengthMetrics } from './arkui/Graphics';
|
||||
|
||||
/**
|
||||
* Export RenderNode. RenderNode contains node tree operations and render property operations on node.
|
||||
|
18
api/arkui/FrameNode.d.ts
vendored
18
api/arkui/FrameNode.d.ts
vendored
@ -20,7 +20,7 @@
|
||||
|
||||
import { UIContext } from '../@ohos.arkui.UIContext';
|
||||
import { RenderNode } from './RenderNode';
|
||||
import { Size, Position, Edges, LengthMetric, SizeT } from './Graphics';
|
||||
import { Size, Position, Edges, LengthMetrics, SizeT } from './Graphics';
|
||||
import { UICommonEvent } from 'commonEvent';
|
||||
import { CommonAttribute } from 'commonAttribute';
|
||||
|
||||
@ -246,42 +246,42 @@ export class FrameNode {
|
||||
/**
|
||||
* Get the user config border width of the FrameNode.
|
||||
*
|
||||
* @returns { Edges<LengthMetric> } - Returns the user config border width of the FrameNode.
|
||||
* @returns { Edges<LengthMetrics> } - Returns the user config border width of the FrameNode.
|
||||
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
||||
* @crossplatform
|
||||
* @since 12
|
||||
*/
|
||||
getUserConfigBorderWidth(): Edges<LengthMetric>;
|
||||
getUserConfigBorderWidth(): Edges<LengthMetrics>;
|
||||
|
||||
/**
|
||||
* Get the user config padding of the FrameNode.
|
||||
*
|
||||
* @returns { Edges<LengthMetric> } - Returns the user config padding of the FrameNode.
|
||||
* @returns { Edges<LengthMetrics> } - Returns the user config padding of the FrameNode.
|
||||
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
||||
* @crossplatform
|
||||
* @since 12
|
||||
*/
|
||||
getUserConfigPadding(): Edges<LengthMetric>;
|
||||
getUserConfigPadding(): Edges<LengthMetrics>;
|
||||
|
||||
/**
|
||||
* Get the user config margin of the FrameNode.
|
||||
*
|
||||
* @returns { Edges<LengthMetric> } - Returns the user config margin of the FrameNode.
|
||||
* @returns { Edges<LengthMetrics> } - Returns the user config margin of the FrameNode.
|
||||
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
||||
* @crossplatform
|
||||
* @since 12
|
||||
*/
|
||||
getUserConfigMargin(): Edges<LengthMetric>;
|
||||
getUserConfigMargin(): Edges<LengthMetrics>;
|
||||
|
||||
/**
|
||||
* Get the user config size of the FrameNode.
|
||||
*
|
||||
* @returns { SizeT<LengthMetric> } - Returns the user config size of the FrameNode.
|
||||
* @returns { SizeT<LengthMetrics> } - Returns the user config size of the FrameNode.
|
||||
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
||||
* @crossplatform
|
||||
* @since 12
|
||||
*/
|
||||
getUserConfigSize(): SizeT<LengthMetric>;
|
||||
getUserConfigSize(): SizeT<LengthMetrics>;
|
||||
|
||||
/**
|
||||
* Get the id of the FrameNode.
|
||||
|
101
api/arkui/Graphics.d.ts
vendored
101
api/arkui/Graphics.d.ts
vendored
@ -721,6 +721,107 @@ declare class LengthMetric {
|
||||
public value: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines the Length Metrics.
|
||||
*
|
||||
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
||||
* @crossplatform
|
||||
* @since 12
|
||||
*/
|
||||
declare class LengthMetrics {
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param { number } value - The value of length.
|
||||
* @param { LengthUnit } [unit] - The length unit.
|
||||
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
||||
* @crossplatform
|
||||
* @since 12
|
||||
*/
|
||||
constructor(value: number, unit?:LengthUnit);
|
||||
|
||||
/**
|
||||
* Init a lengthMetrics with px unit.
|
||||
*
|
||||
* @param { number } value - The value of the length metrics.
|
||||
* @returns { LengthMetrics } Returns the lengthMetrics object with unit px.
|
||||
* @static
|
||||
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
||||
* @crossplatform
|
||||
* @since 12
|
||||
*/
|
||||
static px(value: number): LengthMetrics;
|
||||
|
||||
/**
|
||||
* Init a lengthMetrics with vp unit.
|
||||
*
|
||||
* @param { number } value - The value of the length metrics.
|
||||
* @returns { LengthMetrics } - Returns the lengthMetrics object with unit vp.
|
||||
* @static
|
||||
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
||||
* @crossplatform
|
||||
* @since 12
|
||||
*/
|
||||
static vp(value: number): LengthMetrics;
|
||||
|
||||
/**
|
||||
* Init a lengthMetrics with fp unit.
|
||||
*
|
||||
* @param { number } value - The value of the length metrics.
|
||||
* @returns { LengthMetrics } Returns the lengthMetrics object with unit fp.
|
||||
* @static
|
||||
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
||||
* @crossplatform
|
||||
* @since 12
|
||||
*/
|
||||
static fp(value: number): LengthMetrics;
|
||||
|
||||
/**
|
||||
* Init a lengthMetrics with percent unit.
|
||||
*
|
||||
* @param { number } value - The value of the length metrics.
|
||||
* @returns { LengthMetrics } Returns the lengthMetrics object with unit percent.
|
||||
* @static
|
||||
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
||||
* @crossplatform
|
||||
* @since 12
|
||||
*/
|
||||
static percent(value: number): LengthMetrics;
|
||||
|
||||
/**
|
||||
* Init a lengthMetrics with lpx unit.
|
||||
*
|
||||
* @param { number } value - The value of the length metrics.
|
||||
* @returns { LengthMetrics } Returns the lengthMetrics object with unit lpx.
|
||||
* @static
|
||||
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
||||
* @crossplatform
|
||||
* @since 12
|
||||
*/
|
||||
static lpx(value: number): LengthMetrics;
|
||||
|
||||
/**
|
||||
* The unit of the LengthMetrics. The default value is VP.
|
||||
*
|
||||
* @type { LengthUnit }
|
||||
* @default VP
|
||||
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
||||
* @crossplatform
|
||||
* @since 12
|
||||
*/
|
||||
public unit: LengthUnit;
|
||||
|
||||
/**
|
||||
* The value of the LengthMetrics.
|
||||
*
|
||||
* @type { number }
|
||||
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
||||
* @crossplatform
|
||||
* @since 12
|
||||
*/
|
||||
public value: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines the Corner property.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user