@nativescript/core
Version:
A JavaScript library providing an easy to use api for interacting with iOS and Android platform APIs.
151 lines (150 loc) • 8.86 kB
TypeScript
import type { Point, Position } from './view-interfaces';
import { ViewCommon, isEnabledProperty, originXProperty, originYProperty, isUserInteractionEnabledProperty, testIDProperty, iosGlassEffectProperty, GlassEffectType, GlassEffectVariant, statusBarStyleProperty } from './view-common';
import { ShowModalOptions, hiddenProperty } from '../view-base';
import { Background } from '../../styling/background';
import { perspectiveProperty, visibilityProperty, opacityProperty, rotateProperty, rotateXProperty, rotateYProperty, scaleXProperty, scaleYProperty, translateXProperty, translateYProperty, zIndexProperty, backgroundInternalProperty, directionProperty } from '../../styling/style-properties';
import { accessibilityEnabledProperty, accessibilityHiddenProperty, accessibilityHintProperty, accessibilityIdentifierProperty, accessibilityLabelProperty, accessibilityLanguageProperty, accessibilityLiveRegionProperty, accessibilityMediaSessionProperty, accessibilityRoleProperty, accessibilityStateProperty, accessibilityValueProperty, accessibilityIgnoresInvertColorsProperty } from '../../../accessibility/accessibility-properties';
import { AccessibilityEventOptions, AccessibilityRole, AccessibilityState } from '../../../accessibility';
import { CoreTypes } from '../../../core-types';
export * from './view-common';
export * from './view-helper';
export * from '../properties';
export declare class View extends ViewCommon {
[isEnabledProperty.getDefault]: () => boolean;
[isEnabledProperty.setNative]: (value: boolean) => void;
[originXProperty.getDefault]: () => number;
[originXProperty.setNative]: (value: number) => void;
[originYProperty.getDefault]: () => number;
[originYProperty.setNative]: (value: number) => void;
[testIDProperty.setNative]: (value: string) => void;
[accessibilityEnabledProperty.setNative]: (value: boolean) => void;
[accessibilityIdentifierProperty.getDefault]: () => string;
[accessibilityIdentifierProperty.setNative]: (value: string) => void;
[accessibilityRoleProperty.setNative]: (value: AccessibilityRole) => void;
[accessibilityValueProperty.setNative]: (value: string) => void;
[accessibilityLabelProperty.setNative]: (value: string) => void;
[accessibilityHintProperty.setNative]: (value: string) => void;
[accessibilityIgnoresInvertColorsProperty.setNative]: (value: boolean) => void;
[accessibilityLanguageProperty.setNative]: (value: string) => void;
[accessibilityHiddenProperty.setNative]: (value: boolean) => void;
[accessibilityLiveRegionProperty.setNative]: () => void;
[accessibilityStateProperty.setNative]: (value: AccessibilityState) => void;
[accessibilityMediaSessionProperty.setNative]: () => void;
[isUserInteractionEnabledProperty.getDefault]: () => boolean;
[isUserInteractionEnabledProperty.setNative]: (value: boolean) => void;
[hiddenProperty.getDefault]: () => boolean;
[hiddenProperty.setNative]: (value: boolean) => void;
[visibilityProperty.getDefault]: () => CoreTypes.VisibilityType;
[visibilityProperty.setNative]: (value: CoreTypes.VisibilityType) => void;
[opacityProperty.getDefault]: () => number;
[opacityProperty.setNative]: (value: number) => void;
[rotateProperty.getDefault]: () => number;
[rotateProperty.setNative]: (value: number) => void;
[rotateXProperty.getDefault]: () => number;
[rotateXProperty.setNative]: (value: number) => void;
[rotateYProperty.getDefault]: () => number;
[rotateYProperty.setNative]: (value: number) => void;
[perspectiveProperty.getDefault]: () => number;
[perspectiveProperty.setNative]: (value: number) => void;
[scaleXProperty.getDefault]: () => number;
[scaleXProperty.setNative]: (value: number) => void;
[scaleYProperty.getDefault]: () => number;
[scaleYProperty.setNative]: (value: number) => void;
[translateXProperty.getDefault]: () => CoreTypes.dip;
[translateXProperty.setNative]: (value: CoreTypes.dip) => void;
[translateYProperty.getDefault]: () => CoreTypes.dip;
[translateYProperty.setNative]: (value: CoreTypes.dip) => void;
[zIndexProperty.getDefault]: () => number;
[zIndexProperty.setNative]: (value: number) => void;
[backgroundInternalProperty.getDefault]: () => UIColor;
[backgroundInternalProperty.setNative]: (value: UIColor | Background) => void;
[statusBarStyleProperty.getDefault]: () => "dark" | "light";
[statusBarStyleProperty.setNative]: (value: "light" | "dark") => void;
[iosGlassEffectProperty.setNative]: (value: GlassEffectType) => void;
[directionProperty.setNative]: (value: CoreTypes.LayoutDirectionType) => void;
nativeViewProtected: UIView;
viewController: UIViewController;
private _popoverPresentationDelegate;
private _adaptivePresentationDelegate;
private _transitioningDelegate;
/**
* Track modal open animated options to use same option upon close
*/
private _modalAnimatedOptions;
private _isLaidOut;
private _isTransformed;
private _privateFlags;
private _cachedFrame;
private _suspendCATransaction;
/**
* Native background states.
* - `unset` - is the default, from this state it transitions to "invalid" in the base backgroundInternalProperty.setNative, overriding it without calling `super` will prevent the background from ever being drawn.
* - `invalid` - the view background must be redrawn on the next layot.
* - `drawn` - the view background has been property drawn, on subsequent layouts it may need to be redrawn if the background depends on the view's size.
*/
_nativeBackgroundState: 'unset' | 'invalid' | 'drawn';
/**
* Glass effect configuration
*/
private _glassEffectView;
private _glassEffectMeasure;
get isLayoutRequired(): boolean;
get isLayoutRequested(): boolean;
disposeNativeView(): void;
requestLayout(): void;
measure(widthMeasureSpec: number, heightMeasureSpec: number): void;
layout(left: number, top: number, right: number, bottom: number, setFrame?: boolean): void;
private updateBackground;
private layoutOuterShadows;
setMeasuredDimension(measuredWidth: number, measuredHeight: number): void;
onMeasure(widthMeasureSpec: number, heightMeasureSpec: number): void;
onLayout(left: number, top: number, right: number, bottom: number): void;
_modifyNativeViewFrame(nativeView: UIView, frame: CGRect): void;
_setNativeViewFrame(nativeView: UIView, frame: CGRect): void;
get isLayoutValid(): boolean;
layoutNativeView(left: number, top: number, right: number, bottom: number): void;
_layoutParent(): void;
_setLayoutFlags(left: number, top: number, right: number, bottom: number): void;
focus(): boolean;
protected applySafeAreaInsets(frame: CGRect): CGRect;
getSafeAreaInsets(): Position;
getLocationInWindow(): Point;
getLocationOnScreen(): Point;
getLocationRelativeTo(otherView: View): Point;
_onSizeChanged(): void;
updateNativeTransform(): void;
updateOriginPoint(originX: number, originY: number): void;
_suspendPresentationLayerUpdates(): void;
_resumePresentationLayerUpdates(): void;
_isPresentationLayerUpdateSuspended(): boolean;
protected _showNativeModalView(parent: View, options: ShowModalOptions): void;
protected _hideNativeModalView(parent: View, whenClosedCallback: () => void): void;
setAccessibilityIdentifier(view: any, value: string): void;
protected _applyGlassEffect(value: GlassEffectType, options: {
effectType: 'glass' | 'container';
targetView?: UIVisualEffectView;
toGlassStyleFn?: (variant?: GlassEffectVariant) => number;
onCreate?: (effectView: UIVisualEffectView, effect: UIVisualEffect) => void;
onUpdate?: (effectView: UIVisualEffectView, effect: UIVisualEffect, duration: number) => void;
}): UIVisualEffectView | undefined;
sendAccessibilityEvent(options: Partial<AccessibilityEventOptions>): void;
accessibilityAnnouncement(msg?: string): void;
accessibilityScreenChanged(): void;
toUIGlassStyle(value?: GlassEffectVariant): 0 | 1 | UIGlassEffectStyle;
_getCurrentLayoutBounds(): Position;
_redrawNativeBackground(value: UIColor | Background): void;
_setNativeClipToBounds(): void;
private _setupPopoverControllerDelegate;
private _setupAdaptiveControllerDelegate;
}
export declare class ContainerView extends View {
constructor();
}
export declare class CustomLayoutView extends ContainerView {
nativeViewProtected: UIView;
createNativeView(): UIView;
get ios(): UIView;
onMeasure(widthMeasureSpec: number, heightMeasureSpec: number): void;
_addViewToNativeVisualTree(child: View, atIndex: number): boolean;
_removeViewFromNativeVisualTree(child: View): void;
}