@nativescript/core
- Version 9.1.1
- Published
- 29.4 MB
- 12 dependencies
- Apache-2.0 license
Install
npm i @nativescript/coreyarn add @nativescript/corepnpm add @nativescript/coreOverview
A JavaScript library providing an easy to use api for interacting with iOS and Android platform APIs.
Index
Variables
- addCss
- android
- androidDynamicElevationOffsetProperty
- androidElevationProperty
- AnimationCurve
- Application
- autocapitalizationTypeProperty
- autocorrectProperty
- backgroundColorProperty
- backgroundEvent
- backgroundImageProperty
- backgroundInternalProperty
- backgroundPositionProperty
- backgroundRepeatProperty
- backgroundSizeProperty
- borderBottomColorProperty
- borderBottomLeftRadiusProperty
- borderBottomRightRadiusProperty
- borderBottomWidthProperty
- borderLeftColorProperty
- borderLeftWidthProperty
- borderRightColorProperty
- borderRightWidthProperty
- borderTopColorProperty
- borderTopLeftRadiusProperty
- borderTopRightRadiusProperty
- borderTopWidthProperty
- clipPathProperty
- colorProperty
- columnGapProperty
- cornerShapeProperty
- CSSHelper
- Device
- Dialogs
- directionProperty
- discardedErrorEvent
- displayedEvent
- editableProperty
- Enums
- exitEvent
- fontFamilyProperty
- fontInternalProperty
- fontScaleChangedEvent
- fontScaleInternalProperty
- fontSizeProperty
- fontStyleProperty
- fontVariationSettingsProperty
- fontWeightProperty
- foregroundEvent
- getCssFileName
- getMainEntry
- getNativeApplication
- getResources
- getRootView
- hasLaunched
- hasListeners
- heightProperty
- hintProperty
- horizontalAlignmentProperty
- inBackground
- ios
- isAndroid
- isApple
- isIOS
- isUserInteractionEnabledProperty
- isVisionOS
- keyboardTypeProperty
- launchEvent
- layoutDirection
- layoutDirectionChanged
- layoutDirectionChangedEvent
- letterSpacingProperty
- lineHeightProperty
- loadAppCss
- lowMemoryEvent
- marginBottomProperty
- marginLeftProperty
- marginRightProperty
- marginTopProperty
- maxHeightProperty
- maxLengthProperty
- maxWidthProperty
- minHeightProperty
- minWidthProperty
- NativeWindowEvents
- notify
- off
- on
- opacityProperty
- orientation
- orientationChangedEvent
- paddingBottomProperty
- paddingInternalProperty
- paddingLeftProperty
- paddingRightProperty
- paddingTopProperty
- perspectiveProperty
- placeholderColorProperty
- platformNames
- resetRootView
- resumeEvent
- returnKeyTypeProperty
- rotateProperty
- rotateXProperty
- rotateYProperty
- rowGapProperty
- run
- scaleXProperty
- scaleYProperty
- SceneEvents
- setAutoSystemAppearanceChanged
- setCssFileName
- setMaxRefreshRate
- setResources
- suspended
- suspendEvent
- systemAppearance
- systemAppearanceChanged
- systemAppearanceChangedEvent
- textAlignmentProperty
- textDecorationProperty
- textOverflowProperty
- textShadowProperty
- textStrokeProperty
- textTransformProperty
- translateXProperty
- translateYProperty
- uncaughtErrorEvent
- unsetValue
- updateTextTriggerProperty
- VALID_FONT_SCALES
- verticalAlignmentProperty
- visibilityProperty
- whiteSpaceProperty
- widthProperty
- WindowEvents
- zIndexProperty
Functions
- action()
- addTaggedAdditionalCSS()
- addWeakEventListener()
- alert()
- animationTimingFunctionConverter()
- booleanConverter()
- confirm()
- CSSType()
- eachDescendant()
- fromObject()
- fromObjectRecursive()
- getAncestor()
- getAndroidAccessibilityManager()
- getCurrentFontScale()
- getCurrentPage()
- getFileAccess()
- getLastFocusedViewOnPage()
- getNativeApp()
- getRootLayout()
- getRootLayoutById()
- getTransformedText()
- getViewById()
- isAccessibilityServiceEnabled()
- isEmbedded()
- login()
- makeParser()
- makeValidator()
- parseCSSShadow()
- parseCSSStroke()
- parseKeyframeDeclarations()
- profile()
- profilingDisable()
- profilingDumpProfiles()
- profilingEnable()
- profilingIsRunning()
- profilingResetProfiles()
- profilingStart()
- profilingStartCPU()
- profilingStop()
- profilingStopCPU()
- profilingTime()
- profilingUptime()
- prompt()
- PseudoClassHandler()
- querySelectorAll()
- removeTaggedAdditionalCSS()
- removeWeakEventListener()
- resolveFileNameFromUrl()
- sanitizeModuleName()
- sendAccessibilityEvent()
- setActivityCallbacks()
- setNativeApp()
- timeConverter()
- updateAccessibilityProperties()
Classes
AndroidApplication
- activityBackPressedEvent
- activityBackPressedEvent
- activityCreatedEvent
- activityCreatedEvent
- activityDestroyedEvent
- activityDestroyedEvent
- activityNewIntentEvent
- activityNewIntentEvent
- activityPausedEvent
- activityPausedEvent
- activityRequestPermissionsEvent
- activityRequestPermissionsEvent
- activityResultEvent
- activityResultEvent
- activityResumedEvent
- activityResumedEvent
- activityStartedEvent
- activityStartedEvent
- activityStoppedEvent
- activityStoppedEvent
- backgrounded
- context
- foregroundActivity
- getNativeApplication()
- getRegisteredBroadcastReceiver()
- getRegisteredBroadcastReceivers()
- nativeApp
- on
- openWindow()
- packageName
- paused
- registerBroadcastReceiver()
- saveActivityStateEvent
- saveActivityStateEvent
- startActivity
- unregisterBroadcastReceiver()
ApplicationCommon
- activeWindow
- addCss()
- android
- AndroidApplication
- applyCssClass()
- autoSystemAppearanceChanged
- backgroundEvent
- createRootView()
- cssChangedEvent
- discardedErrorEvent
- displayedEvent
- exitEvent
- fontScaleChangedEvent
- foregroundEvent
- getCssFileName()
- getLayoutDirection()
- getMainEntry()
- getNativeApplication()
- getOrientation()
- getResources()
- getRootView()
- getSystemAppearance()
- getWindowById()
- getWindowContentResolver()
- getWindows()
- hasLaunched()
- hasListeners
- hasListeners
- inBackground
- initRootView()
- initRootViewEvent
- ios
- iOSApplication
- launchEvent
- layoutDirection()
- layoutDirectionChanged()
- layoutDirectionChangedEvent
- livesyncEvent
- loadAppCss()
- loadAppCssEvent
- lowMemoryEvent
- mainEntry
- notify
- notify
- notifyLaunch()
- off
- off
- on
- on
- once
- once
- openWindow()
- orientation()
- orientationChanged()
- orientationChangedEvent
- primaryWindow
- primaryWindowChangedEvent
- readyEvent
- resetRootView()
- resumeEvent
- run()
- setAutoSystemAppearanceChanged()
- setCssFileName()
- setInBackground()
- setLayoutDirection()
- setMaxRefreshRate()
- setOrientation()
- setResources()
- setSuspended()
- setSystemAppearance()
- setWindowContentResolver()
- started
- suspended
- suspendEvent
- systemAppearance()
- systemAppearanceChanged()
- systemAppearanceChangedEvent
- uncaughtErrorEvent
- windowCloseEvent
- windowOpenEvent
Background
- borderBottomColor
- borderBottomLeftRadius
- borderBottomRightRadius
- borderBottomWidth
- borderLeftColor
- borderLeftWidth
- borderRightColor
- borderRightWidth
- borderTopColor
- borderTopLeftRadius
- borderTopRightRadius
- borderTopWidth
- boxShadows
- clearFlags
- clipPath
- color
- cornerShape
- default
- equals()
- getBoxShadows()
- getUniformBorderColor()
- getUniformBorderRadius()
- getUniformBorderWidth()
- hasBorder()
- hasBorderColor()
- hasBorderRadius()
- hasBorderWidth()
- hasBoxShadows()
- hasUniformBorder()
- hasUniformBorderColor()
- hasUniformBorderRadius()
- hasUniformBorderWidth()
- image
- isEmpty()
- position
- repeat
- size
- toString()
- withBorderBottomColor()
- withBorderBottomLeftRadius()
- withBorderBottomRightRadius()
- withBorderBottomWidth()
- withBorderLeftColor()
- withBorderLeftWidth()
- withBorderRightColor()
- withBorderRightWidth()
- withBorderTopColor()
- withBorderTopLeftRadius()
- withBorderTopRightRadius()
- withBorderTopWidth()
- withBoxShadows()
- withClipPath()
- withColor()
- withCornerShape()
- withImage()
- withPosition()
- withRepeat()
- withSize()
Frame
- actionBarVisibility
- android
- androidOptionSelectedEvent
- animated
- backStack
- canGoBack()
- currentEntry
- currentPage
- defaultAnimatedNavigation
- defaultPage
- defaultTransition
- getFrameById()
- getNavigationQueueContextByEntry()
- goBack()
- ios
- iosNavigationBarClass
- iosToolbarClass
- isCurrent()
- navigate()
- navigatedToEvent
- navigatingToEvent
- navigationBarHeight
- navigationQueueIsEmpty()
- on()
- performNavigation()
- reloadPage()
- setCurrent()
- topmost()
- transition
ImageSource
- android
- fromAsset()
- fromBase64()
- fromBase64Sync()
- fromData()
- fromDataSync()
- fromFile()
- fromFileOrResourceSync()
- fromFileSync()
- fromFontIconCodeSync()
- fromResource()
- fromResourceSync()
- fromSystemImage()
- fromSystemImageSync()
- fromUrl()
- getNativeSource()
- height
- ios
- iosSymbolScaleFor()
- loadFromBase64()
- loadFromData()
- loadFromFile()
- loadFromFontIconCode()
- loadFromResource()
- resize()
- resizeAsync()
- rotationAngle
- saveToFile()
- saveToFileAsync()
- setNativeSource()
- toBase64String()
- toBase64StringAsync()
- width
iOSApplication
- addDelegateHandler()
- addNotificationObserver()
- closeWindow()
- defaultDiscardSceneSessions()
- defaultSceneConfiguration()
- delegate
- getAllScenes()
- getAllWindows()
- getPrimaryScene()
- getPrimaryWindow()
- getWindowScenes()
- isUsingSceneLifecycle()
- nativeApp
- on
- onSceneConfiguration
- openWindow()
- removeNotificationObserver()
- rootController
- sceneDelegate
- setWindowRootView()
- shouldDelayLaunchEvent
- supportsMultipleScenes()
- supportsScenes()
- window
ListView
- android
- ios
- iosEstimatedRowHeight
- iosSearchInsetBehavior
- isItemAtIndexVisible()
- itemIdGenerator
- itemLoadingEvent
- items
- itemTapEvent
- itemTemplate
- itemTemplates
- itemTemplateSelector
- loadMoreItemsEvent
- on()
- refresh()
- rowHeight
- scrollToIndex()
- scrollToIndexAnimated()
- searchAutoHide
- searchChangeEvent
- sectioned
- separatorColor
- showSearch
- stickyHeader
- stickyHeaderHeight
- stickyHeaderTemplate
- stickyHeaderTopPadding
Page
- accessibilityAnnouncePageEnabled
- accessibilityScreenChanged()
- actionBar
- actionBarHidden
- androidStatusBarBackground
- backgroundSpanUnderStatusBar
- enableSwipeBackNavigation
- frame
- getKeyframeAnimationWithName()
- hasActionBar
- navigatedFromEvent
- navigatedToEvent
- navigatingFromEvent
- navigatingToEvent
- navigationContext
- on()
- onAccessibilityPerformEscape
- onNavigatedFrom()
- onNavigatedTo()
- onNavigatingFrom()
- onNavigatingTo()
PageBase
- accessibilityAnnouncePageEnabled
- accessibilityScreenChanged()
- actionBar
- actionBarHidden
- androidStatusBarBackground
- backgroundSpanUnderStatusBar
- eachChildView()
- enableSwipeBackNavigation
- frame
- getKeyframeAnimationWithName()
- hasActionBar
- navigatedFromEvent
- navigatedToEvent
- navigatingFromEvent
- navigatingToEvent
- navigationContext
- onNavigatedFrom()
- onNavigatedTo()
- onNavigatingFrom()
- onNavigatingTo()
- page
Style
- accessibilityHidden
- accessibilityLanguage
- accessibilityLiveRegion
- accessibilityMediaSession
- accessibilityRole
- accessibilityState
- accessibilityStep
- accessible
- alignContent
- alignItems
- alignSelf
- androidContentInset
- androidContentInsetLeft
- androidContentInsetRight
- androidDynamicElevationOffset
- androidElevation
- androidSelectedTabHighlightColor
- androidStatusBarBackground
- background
- backgroundColor
- backgroundImage
- backgroundInternal
- backgroundPosition
- backgroundRepeat
- backgroundSize
- borderBottomColor
- borderBottomLeftRadius
- borderBottomRightRadius
- borderBottomWidth
- borderColor
- borderLeftColor
- borderLeftWidth
- borderRadius
- borderRightColor
- borderRightWidth
- borderTopColor
- borderTopLeftRadius
- borderTopRightRadius
- borderTopWidth
- borderWidth
- boxShadow
- clipPath
- color
- columnGap
- cornerShape
- direction
- flex
- flexDirection
- flexFlow
- flexGrow
- flexShrink
- flexWrap
- flexWrapBefore
- font
- fontFamily
- fontInternal
- fontScaleInternal
- fontSize
- fontStyle
- fontVariationSettings
- fontWeight
- gap
- getCssVariable()
- height
- horizontalAlignment
- iconFontFamily
- iosAccessibilityAdjustsFontSize
- iosAccessibilityMaxFontScale
- iosAccessibilityMinFontScale
- justifyContent
- letterSpacing
- lineHeight
- margin
- marginBottom
- marginLeft
- marginRight
- marginTop
- maxHeight
- maxLines
- maxWidth
- minHeight
- minWidth
- opacity
- order
- padding
- paddingBottom
- paddingInternal
- paddingLeft
- paddingRight
- paddingTop
- perspective
- placeholderColor
- PropertyBag
- removeScopedCssVariable()
- removeUnscopedCssVariable()
- resetScopedCssVariables()
- resetUnscopedCssVariables()
- rotate
- rotateX
- rotateY
- rowGap
- scaleX
- scaleY
- selectedBackgroundColor
- selectedTabTextColor
- selectedTextColor
- separatorColor
- setScopedCssVariable()
- setUnscopedCssVariable()
- statusBarStyle
- tabBackgroundColor
- tabTextColor
- tabTextFontSize
- textAlignment
- textDecoration
- textOverflow
- textShadow
- textStroke
- textTransform
- tintColor
- toString()
- translateX
- translateY
- verticalAlignment
- view
- viewRef
- visibility
- whiteSpace
- width
- zIndex
TabView
- android
- androidIconRenderingMode
- androidOffscreenTabLimit
- androidSelectedTabHighlightColor
- androidSwipeEnabled
- androidTabsPosition
- ios
- iosBottomAccessory
- iosIconRenderingMode
- iosTabBarMinimizeBehavior
- items
- on()
- selectedIndex
- selectedIndexChangedEvent
- selectedTabTextColor
- tabBackgroundColor
- tabTextColor
- tabTextFontSize
Transition
- androidFragmentTransactionCallback()
- AndroidTransitionType
- animateIOSTransition()
- createAndroidAnimator()
- getCurve()
- getDuration()
- id
- interactiveController
- iosDismissedController()
- iosInteractionDismiss()
- iosInteractionPresented()
- iosNavigatedController()
- iosPresentedController()
- name
- presented
- presenting
- setDuration()
- setupInteractiveGesture()
- sharedElements
- transitionController
View
- accessibilityAnnouncement()
- accessibilityBlurEvent
- accessibilityFocusChangedEvent
- accessibilityFocusEvent
- accessibilityHidden
- accessibilityHint
- accessibilityIdentifier
- accessibilityIgnoresInvertColors
- accessibilityLabel
- accessibilityLanguage
- accessibilityLiveRegion
- accessibilityMediaSession
- accessibilityRole
- accessibilityScreenChanged()
- accessibilityState
- accessibilityValue
- accessible
- addCss()
- addCssFile()
- android
- androidDynamicElevationOffset
- androidElevation
- androidOverflowInsetEvent
- animate()
- automationText
- background
- backgroundColor
- backgroundImage
- bindingContext
- borderBottomColor
- borderBottomLeftRadius
- borderBottomRightRadius
- borderBottomWidth
- borderColor
- borderLeftColor
- borderLeftWidth
- borderRadius
- borderRightColor
- borderRightWidth
- borderTopColor
- borderTopLeftRadius
- borderTopRightRadius
- borderTopWidth
- borderWidth
- boxShadow
- changeCssFile()
- closedModallyEvent
- color
- combineMeasuredStates()
- createAnimation()
- css
- cssClasses
- cssPseudoClasses
- cssType
- direction
- eachChildView()
- flex
- flexFlow
- focus()
- getActualSize()
- getGestureObservers()
- getLocationInWindow()
- getLocationOnScreen()
- getLocationRelativeTo()
- getMeasuredHeight()
- getMeasuredState()
- getMeasuredWidth()
- getNativeWindow()
- getSafeAreaInsets()
- hasGestureObservers()
- height
- horizontalAlignment
- ignoreTouchAnimation
- ios
- iosAccessibilityAdjustsFontSize
- iosAccessibilityMaxFontScale
- iosAccessibilityMinFontScale
- iosGlassEffect
- iosIgnoreSafeArea
- iosOverflowSafeArea
- iosOverflowSafeAreaEnabled
- isEnabled
- isLayoutRequired
- isLayoutValid
- isUserInteractionEnabled
- layout()
- layoutChangedEvent
- layoutChild()
- layoutNativeView()
- margin
- marginBottom
- marginLeft
- marginRight
- marginTop
- maxHeight
- maxWidth
- measure()
- measureChild()
- minHeight
- minWidth
- modal
- nativeBackgroundState
- needsNativeDrawableFill
- off()
- on()
- onBackPressed()
- onLayout()
- onMeasure()
- opacity
- originX
- originY
- perspective
- resolveSizeAndState()
- rotate
- rotateX
- rotateY
- scaleX
- scaleY
- sendAccessibilityEvent()
- setMeasuredDimension()
- setOnTouchListener()
- showingModallyEvent
- shownModallyEvent
- statusBarStyle
- testID
- touchAnimation
- touchDelay
- translateX
- translateY
- verticalAlignment
- visibility
- visionHoverStyle
- visionIgnoreHoverStyle
- width
ViewBase
- ['class']
- addPseudoClass()
- alignSelf
- android
- bind()
- bindingContext
- callLoaded()
- callUnloaded()
- className
- closeModal()
- col
- colSpan
- column
- columnSpan
- createdEvent
- createNativeView()
- cssClasses
- cssPseudoClasses
- cssType
- defaultVisualState
- deletePseudoClass()
- destroyNode()
- disposeNativeView()
- disposeNativeViewEvent
- dock
- domNode
- eachChild()
- effectiveBorderBottomWidth
- effectiveBorderLeftWidth
- effectiveBorderRightWidth
- effectiveBorderTopWidth
- effectiveColumnGap
- effectiveHeight
- effectiveLeft
- effectiveMarginBottom
- effectiveMarginLeft
- effectiveMarginRight
- effectiveMarginTop
- effectiveMaxHeight
- effectiveMaxWidth
- effectiveMinHeight
- effectiveMinWidth
- effectivePaddingBottom
- effectivePaddingLeft
- effectivePaddingRight
- effectivePaddingTop
- effectiveRowGap
- effectiveTop
- effectiveWidth
- ensureDomNode()
- flexGrow
- flexShrink
- flexWrapBefore
- getEffectivePaddingShorthand()
- getViewByDomId()
- getViewById()
- hidden
- id
- initNativeView()
- ios
- isCollapsed
- isLoaded
- left
- loadedEvent
- loadView()
- nativeView
- nativeViewProtected
- onLoaded()
- onResumeNativeUpdates()
- onUnloaded()
- order
- page
- parent
- parentNode
- recycleNativeView
- requestLayout()
- resetNativeView()
- reusable
- row
- rowSpan
- set()
- setInlineStyle()
- setNativeView()
- sharedTransitionIgnore
- sharedTransitionTag
- showModal()
- style
- top
- toString()
- typeName
- unbind()
- unloadedEvent
- unloadView()
- viewController
- visualState
Interfaces
Enums
ImageSymbolEffects
- Appear
- AppearDown
- AppearUp
- Bounce
- BounceDown
- BounceUp
- Breathe
- BreathePlain
- BreathePulse
- Disappear
- DisappearDown
- DisappearUp
- Pulse
- Rotate
- RotateClockwise
- RotateCounterClockwise
- Scale
- ScaleDown
- ScaleUp
- VariableColor
- Wiggle
- WiggleBackward
- WiggleClockwise
- WiggleCounterClockwise
- WiggleDown
- WiggleForward
- WiggleLeft
- WiggleRight
- WiggleUp
Type Aliases
- AlignContent
- AlignItems
- AlignSelf
- AnimationPromise
- dip
- Flex
- FlexDirection
- FlexFlow
- FlexWrap
- FontStyleType
- FontVariationSettingsType
- FontWeightType
- GlassEffectConfig
- GlassEffectType
- GlassEffectVariant
- GridUnitType
- Headers
- HorizontalAlignment
- InstrumentationMode
- iosSymbolScaleType
- JustifyContent
- LengthDipUnit
- LengthPercentUnit
- LengthPxUnit
- LengthType
- ModuleListProvider
- NativeWindowEventName
- percent
- PercentLengthType
- px
- SceneEventName
- SharedTransitionTagProperties
- SplitBehavior
- SplitDisplayMode
- SplitRole
- SplitStyle
- TouchAnimationOptions
- Transformation
- TransformationType
- TransformationValue
- TransformFunctionsInfo
- VerticalAlignment
- VisionHoverOptions
- WebViewNavigationType
- WindowContentResolver
- WindowRole
- WindowState
Namespaces
CoreTypes
- AndroidOverflow
- AutocapitalizationInputType
- AutofillType
- BackgroundRepeatType
- CornerShapeType
- CSSWideKeywords
- DeviceOrientationType
- dip
- DockType
- FixedLengthType
- HorizontalAlignmentType
- ImageStretchType
- KeyboardInputType
- LayoutDirectionType
- LengthDipUnit
- LengthPercentUnit
- LengthPxUnit
- LengthType
- MaxLinesType
- OrientationType
- percent
- PercentLengthType
- px
- ReturnKeyButtonType
- TextAlignmentType
- TextDecorationType
- TextOverflowType
- TextTransformType
- UpdateTextTriggerType
- VerticalAlignmentTextType
- VerticalAlignmentType
- VisibilityType
- WhiteSpaceType
- zeroLength
CSSUtils
- CLASS_PREFIX
- getModalRootViewCssClass()
- getRootViewCssClasses()
- getSystemCssClasses()
- LAYOUT_DIRECTION_CSS_CLASSES
- MODAL_ROOT_VIEW_CSS_CLASS
- ORIENTATION_CSS_CLASSES
- pushToRootViewCssClasses()
- pushToSystemCssClasses()
- removeFromRootViewCssClasses()
- removeSystemCssClass()
- ROOT_VIEW_CSS_CLASS
- SYSTEM_APPEARANCE_CSS_CLASSES
- WINDOW_SCOPED_CSS_CLASSES
IOSHelper
- expandBeyondSafeArea()
- getFrameFromPosition()
- getParentWithViewController()
- getPositionFromFrame()
- hasIOSManagedInsetAncestor()
- invalidateStatusBarAppearance()
- layoutView()
- shrinkToSafeArea()
- traitCollectionColorAppearanceChangedEvent
- traitCollectionLayoutDirectionChangedEvent
- UIAdaptivePresentationControllerDelegateImp
- UILayoutViewController
- UIPopoverPresentationControllerDelegateImp
- updateAutoAdjustScrollInsets()
- updateConstraints()
Utils
- ad
- android
- ClassInfo
- clearInterval()
- clearTimeout()
- convertString()
- copyToClipboard()
- CORE_ANIMATION_DEFAULTS
- dataDeserialize()
- dataSerialize()
- debounce()
- debug
- dismissKeyboard()
- dismissSoftInput()
- dispatchToMainThread()
- dispatchToUIThread()
- eliminateDuplicates()
- escapeRegexSymbols()
- executeOnMainThread()
- executeOnUIThread()
- FILE_PREFIX
- FONT_PREFIX
- GC()
- getBaseClasses()
- getClass()
- getClassInfo()
- getDurationWithDampingFromSpring()
- getFileExtension()
- getModuleName()
- getWindow()
- hasDuplicates()
- ios
- iOSNativeHelper
- isBoolean()
- isDataURI()
- isDefined()
- isEmoji()
- isFileOrResourcePath()
- isFontIconURI()
- isFunction()
- isMainThread()
- isNullOrUndefined()
- isNumber()
- isObject()
- isRealDevice()
- isString()
- isSystemURI()
- isUndefined()
- mainThreadify()
- merge()
- mergeSort()
- numberHasDecimals()
- numberIs64Bit()
- openFile()
- openUrl()
- openUrlAsync()
- PlatformWindow
- queueGC()
- queueMacrotask()
- releaseNativeObject()
- RESOURCE_PREFIX
- sanitizeModuleName()
- ScopeError
- SDK_VERSION
- setInterval()
- setTimeout()
- Source
- SourceError
- supportsGlass()
- SYSTEM_PREFIX
- throttle()
- toUIString()
- verifyCallback()
Utils.layout
- AT_MOST
- EXACTLY
- getDisplayDensity()
- getMeasureSpecMode()
- getMeasureSpecSize()
- getMode()
- hasRtlSupport()
- makeMeasureSpec()
- MEASURED_HEIGHT_STATE_SHIFT
- MEASURED_SIZE_MASK
- MEASURED_STATE_MASK
- MEASURED_STATE_TOO_SMALL
- measureNativeView()
- measureSpecToString()
- MODE_MASK
- MODE_SHIFT
- round()
- toDeviceIndependentPixels()
- toDevicePixels()
- UNSPECIFIED
Variables
variable addCss
const addCss: any;Deprecated
Deep imports into the Application module are deprecated and will be removed in a future release. Use the
Applicationclass imported from "@nativescript/core" instead:import { Application } from "@nativescript/core";Application.addCss()
variable android
const android: AndroidApplication;Deprecated
Deep imports into the Application module are deprecated and will be removed in a future release. Use the
Applicationclass imported from "@nativescript/core" instead:import { Application } from "@nativescript/core";Application.android
variable androidDynamicElevationOffsetProperty
const androidDynamicElevationOffsetProperty: CssProperty<Style, number>;variable androidElevationProperty
const androidElevationProperty: CssProperty<Style, number>;variable AnimationCurve
const AnimationCurve: typeof CoreTypes.AnimationCurve;Deprecated
Use
CoreTypes.AnimationCurveinstead.
variable Application
const Application: ApplicationCommon;variable autocapitalizationTypeProperty
const autocapitalizationTypeProperty: Property< EditableTextBase, CoreTypes.AutocapitalizationInputType>;variable autocorrectProperty
const autocorrectProperty: Property<EditableTextBase, boolean>;variable backgroundColorProperty
const backgroundColorProperty: CssAnimationProperty<Style, Color>;variable backgroundEvent
const backgroundEvent: string;Deprecated
Deep imports into the Application module are deprecated and will be removed in a future release. Use the
Applicationclass imported from "@nativescript/core" instead:import { Application } from "@nativescript/core";Application.backgroundEvent
variable backgroundImageProperty
const backgroundImageProperty: CssProperty<Style, string | LinearGradient>;variable backgroundInternalProperty
const backgroundInternalProperty: CssProperty<Style, Background>;variable backgroundPositionProperty
const backgroundPositionProperty: CssProperty<Style, string>;variable backgroundRepeatProperty
const backgroundRepeatProperty: CssProperty<Style, CoreTypes.BackgroundRepeatType>;variable backgroundSizeProperty
const backgroundSizeProperty: CssProperty<Style, string>;variable borderBottomColorProperty
const borderBottomColorProperty: CssProperty<Style, Color>;variable borderBottomLeftRadiusProperty
const borderBottomLeftRadiusProperty: CssProperty<Style, CoreTypes.LengthType>;variable borderBottomRightRadiusProperty
const borderBottomRightRadiusProperty: CssProperty<Style, CoreTypes.LengthType>;variable borderBottomWidthProperty
const borderBottomWidthProperty: CssProperty<Style, CoreTypes.LengthType>;variable borderLeftColorProperty
const borderLeftColorProperty: CssProperty<Style, Color>;variable borderLeftWidthProperty
const borderLeftWidthProperty: CssProperty<Style, CoreTypes.LengthType>;variable borderRightColorProperty
const borderRightColorProperty: CssProperty<Style, Color>;variable borderRightWidthProperty
const borderRightWidthProperty: CssProperty<Style, CoreTypes.LengthType>;variable borderTopColorProperty
const borderTopColorProperty: CssProperty<Style, Color>;variable borderTopLeftRadiusProperty
const borderTopLeftRadiusProperty: CssProperty<Style, CoreTypes.LengthType>;variable borderTopRightRadiusProperty
const borderTopRightRadiusProperty: CssProperty<Style, CoreTypes.LengthType>;variable borderTopWidthProperty
const borderTopWidthProperty: CssProperty<Style, CoreTypes.LengthType>;variable clipPathProperty
const clipPathProperty: CssProperty<Style, string | ClipPathFunction>;variable colorProperty
const colorProperty: InheritedCssProperty<Style, Color>;variable columnGapProperty
const columnGapProperty: CssProperty<Style, CoreTypes.LengthType>;variable cornerShapeProperty
const cornerShapeProperty: CssProperty<Style, CoreTypes.CornerShapeType>;variable CSSHelper
const CSSHelper: { createSelector: typeof createSelector; SelectorCore: typeof SelectorCore; SimpleSelector: typeof SimpleSelector; InvalidSelector: typeof InvalidSelector; UniversalSelector: typeof UniversalSelector; TypeSelector: typeof TypeSelector; ClassSelector: typeof ClassSelector; AttributeSelector: typeof AttributeSelector; PseudoClassSelector: typeof PseudoClassSelector; SimpleSelectorSequence: typeof SimpleSelectorSequence; Selector: typeof Selector; RuleSet: typeof RuleSet; SelectorScope: typeof SelectorScope; MediaQuerySelectorScope: typeof MediaQuerySelectorScope; StyleSheetSelectorScope: typeof StyleSheetSelectorScope; fromAstNode: typeof fromAstNode; SelectorsMatch: typeof SelectorsMatch; matchSelectorCandidates: typeof matchSelectorCandidates;};variable Device
const Device: IDevice;Gets the current device information.
variable Dialogs
const Dialogs: { alert: typeof alert; confirm: typeof confirm; prompt: typeof prompt; login: typeof login; action: typeof action;};Singular rollup for convenience of all dialog methods
variable directionProperty
const directionProperty: InheritedCssProperty<Style, CoreTypes.LayoutDirectionType>;variable discardedErrorEvent
const discardedErrorEvent: string;Deprecated
Deep imports into the Application module are deprecated and will be removed in a future release. Use the
Applicationclass imported from "@nativescript/core" instead:import { Application } from "@nativescript/core";Application.discardedErrorEvent
variable displayedEvent
const displayedEvent: string;Deprecated
Deep imports into the Application module are deprecated and will be removed in a future release. Use the
Applicationclass imported from "@nativescript/core" instead:import { Application } from "@nativescript/core";Application.displayedEvent
variable editableProperty
const editableProperty: Property<EditableTextBase, boolean>;variable Enums
const Enums: { Accuracy: typeof CoreTypes.Accuracy; AndroidActionBarIconVisibility: typeof CoreTypes.AndroidActionBarIconVisibility; AndroidActionItemPosition: typeof CoreTypes.AndroidActionItemPosition; AnimationCurve: typeof CoreTypes.AnimationCurve; AutocapitalizationType: typeof CoreTypes.AutocapitalizationType; BackgroundRepeat: typeof CoreTypes.BackgroundRepeat; DeviceOrientation: typeof CoreTypes.DeviceOrientation; DeviceType: typeof CoreTypes.DeviceType; Dock: typeof CoreTypes.Dock; FontAttributes: typeof CoreTypes.FontAttributes; FontStyle: typeof CoreTypes.FontStyle; FontWeight: typeof CoreTypes.FontWeight; HorizontalAlignment: typeof CoreTypes.HorizontalAlignment; IOSActionItemPosition: typeof CoreTypes.IOSActionItemPosition; ImageFormat: typeof CoreTypes.ImageFormat; KeyboardType: typeof CoreTypes.KeyboardType; NavigationBarVisibility: typeof CoreTypes.NavigationBarVisibility; Orientation: typeof CoreTypes.Orientation; ReturnKeyType: typeof CoreTypes.ReturnKeyType; StatusBarStyle: typeof CoreTypes.StatusBarStyle; Stretch: typeof CoreTypes.ImageStretch; SystemAppearance: typeof CoreTypes.SystemAppearance; LayoutDirection: typeof CoreTypes.LayoutDirection; TextAlignment: typeof CoreTypes.TextAlignment; TextDecoration: typeof CoreTypes.TextDecoration; TextTransform: typeof CoreTypes.TextTransform; UpdateTextTrigger: typeof CoreTypes.UpdateTextTrigger; VerticalAlignment: typeof CoreTypes.VerticalAlignment; Visibility: typeof CoreTypes.Visibility; WhiteSpace: typeof CoreTypes.WhiteSpace;};Deprecated
Use
CoreTypesinstead. Enums will be removed in 9.0
variable exitEvent
const exitEvent: string;Deprecated
Deep imports into the Application module are deprecated and will be removed in a future release. Use the
Applicationclass imported from "@nativescript/core" instead:import { Application } from "@nativescript/core";Application.exitEvent
variable fontFamilyProperty
const fontFamilyProperty: InheritedCssProperty<Style, string>;variable fontInternalProperty
const fontInternalProperty: CssProperty<Style, Font>;variable fontScaleChangedEvent
const fontScaleChangedEvent: string;Deprecated
Deep imports into the Application module are deprecated and will be removed in a future release. Use the
Applicationclass imported from "@nativescript/core" instead:import { Application } from "@nativescript/core";Application.fontScaleChangedEvent
variable fontScaleInternalProperty
const fontScaleInternalProperty: InheritedCssProperty<Style, number>;variable fontSizeProperty
const fontSizeProperty: InheritedCssProperty<Style, number>;variable fontStyleProperty
const fontStyleProperty: InheritedCssProperty<Style, FontStyleType>;variable fontVariationSettingsProperty
const fontVariationSettingsProperty: InheritedCssProperty< Style, FontVariationSettingsType[]>;variable fontWeightProperty
const fontWeightProperty: InheritedCssProperty<Style, FontWeightType>;variable foregroundEvent
const foregroundEvent: string;Deprecated
Deep imports into the Application module are deprecated and will be removed in a future release. Use the
Applicationclass imported from "@nativescript/core" instead:import { Application } from "@nativescript/core";Application.foregroundEvent
variable getCssFileName
const getCssFileName: any;Deprecated
Deep imports into the Application module are deprecated and will be removed in a future release. Use the
Applicationclass imported from "@nativescript/core" instead:import { Application } from "@nativescript/core";Application.getCssFileName()
variable getMainEntry
const getMainEntry: any;Deprecated
Deep imports into the Application module are deprecated and will be removed in a future release. Use the
Applicationclass imported from "@nativescript/core" instead:import { Application } from "@nativescript/core";Application.getMainEntry()
variable getNativeApplication
const getNativeApplication: any;Deprecated
Deep imports into the Application module are deprecated and will be removed in a future release. Use the
Applicationclass imported from "@nativescript/core" instead:import { Application } from "@nativescript/core";Application.getNativeApplication()
variable getResources
const getResources: any;Deprecated
Deep imports into the Application module are deprecated and will be removed in a future release. Use the
Applicationclass imported from "@nativescript/core" instead:import { Application } from "@nativescript/core";Application.getResources()
variable getRootView
const getRootView: any;Deprecated
Deep imports into the Application module are deprecated and will be removed in a future release. Use the
Applicationclass imported from "@nativescript/core" instead:import { Application } from "@nativescript/core";Application.getRootView()
variable hasLaunched
const hasLaunched: any;Deprecated
Deep imports into the Application module are deprecated and will be removed in a future release. Use the
Applicationclass imported from "@nativescript/core" instead:import { Application } from "@nativescript/core";Application.hasLaunched()
variable hasListeners
const hasListeners: any;Deprecated
Deep imports into the Application module are deprecated and will be removed in a future release. Use the
Applicationclass imported from "@nativescript/core" instead:import { Application } from "@nativescript/core";Application.hasListeners()
variable heightProperty
const heightProperty: CssAnimationProperty<Style, CoreTypes.PercentLengthType>;variable hintProperty
const hintProperty: Property<EditableTextBase, string>;variable horizontalAlignmentProperty
const horizontalAlignmentProperty: CssProperty< Style, CoreTypes.HorizontalAlignmentType>;variable inBackground
const inBackground: boolean;Deprecated
Deep imports into the Application module are deprecated and will be removed in a future release. Use the
Applicationclass imported from "@nativescript/core" instead:import { Application } from "@nativescript/core";Application.inBackground
variable ios
const ios: iOSApplication;Deprecated
Deep imports into the Application module are deprecated and will be removed in a future release. Use the
Applicationclass imported from "@nativescript/core" instead:import { Application } from "@nativescript/core";Application.ios
variable isAndroid
const isAndroid: boolean;Gets a value indicating if the app is running on the Android platform.
variable isApple
const isApple: boolean;Gets a value indicating if the app is running on an Apple platform.
variable isIOS
const isIOS: boolean;Gets a value indicating if the app is running on the iOS platform.
variable isUserInteractionEnabledProperty
const isUserInteractionEnabledProperty: Property<View, boolean>;variable isVisionOS
const isVisionOS: boolean;Gets a value indicating if the app is running on the iOS platform.
variable keyboardTypeProperty
const keyboardTypeProperty: Property<EditableTextBase, CoreTypes.KeyboardInputType>;variable launchEvent
const launchEvent: string;Deprecated
Deep imports into the Application module are deprecated and will be removed in a future release. Use the
Applicationclass imported from "@nativescript/core" instead:import { Application } from "@nativescript/core";Application.launchEvent
variable layoutDirection
const layoutDirection: any;Deprecated
Deep imports into the Application module are deprecated and will be removed in a future release. Use the
Applicationclass imported from "@nativescript/core" instead:import { Application } from "@nativescript/core";Application.layoutDirection()
variable layoutDirectionChanged
const layoutDirectionChanged: any;Deprecated
Deep imports into the Application module are deprecated and will be removed in a future release. Use the
Applicationclass imported from "@nativescript/core" instead:import { Application } from "@nativescript/core";Application.layoutDirectionChanged()
variable layoutDirectionChangedEvent
const layoutDirectionChangedEvent: string;Deprecated
Deep imports into the Application module are deprecated and will be removed in a future release. Use the
Applicationclass imported from "@nativescript/core" instead:import { Application } from "@nativescript/core";Application.layoutDirectionChangedEvent
variable letterSpacingProperty
const letterSpacingProperty: InheritedCssProperty<Style, number>;variable lineHeightProperty
const lineHeightProperty: InheritedCssProperty<Style, number>;variable loadAppCss
const loadAppCss: any;Deprecated
Deep imports into the Application module are deprecated and will be removed in a future release. Use the
Applicationclass imported from "@nativescript/core" instead:import { Application } from "@nativescript/core";Application.loadAppCss()
variable lowMemoryEvent
const lowMemoryEvent: string;Deprecated
Deep imports into the Application module are deprecated and will be removed in a future release. Use the
Applicationclass imported from "@nativescript/core" instead:import { Application } from "@nativescript/core";Application.lowMemoryEvent
variable marginBottomProperty
const marginBottomProperty: CssProperty<Style, CoreTypes.PercentLengthType>;variable marginLeftProperty
const marginLeftProperty: CssProperty<Style, CoreTypes.PercentLengthType>;variable marginRightProperty
const marginRightProperty: CssProperty<Style, CoreTypes.PercentLengthType>;variable marginTopProperty
const marginTopProperty: CssProperty<Style, CoreTypes.PercentLengthType>;variable maxHeightProperty
const maxHeightProperty: CssProperty<Style, CoreTypes.PercentLengthType>;variable maxLengthProperty
const maxLengthProperty: Property<EditableTextBase, number>;variable maxWidthProperty
const maxWidthProperty: CssProperty<Style, CoreTypes.PercentLengthType>;variable minHeightProperty
const minHeightProperty: CssProperty<Style, CoreTypes.LengthType>;variable minWidthProperty
const minWidthProperty: CssProperty<Style, CoreTypes.LengthType>;variable NativeWindowEvents
const NativeWindowEvents: { readonly activate: 'activate'; readonly deactivate: 'deactivate'; readonly background: 'background'; readonly foreground: 'foreground'; readonly close: 'close'; readonly attached: 'attached'; readonly detached: 'detached'; readonly displayed: 'displayed'; readonly contentLoaded: 'contentLoaded'; readonly orientationChanged: 'orientationChanged'; readonly systemAppearanceChanged: 'systemAppearanceChanged'; readonly layoutDirectionChanged: 'layoutDirectionChanged'; readonly sceneWillConnect: 'sceneWillConnect'; readonly sceneDidActivate: 'sceneDidActivate'; readonly sceneWillResignActive: 'sceneWillResignActive'; readonly sceneWillEnterForeground: 'sceneWillEnterForeground'; readonly sceneDidEnterBackground: 'sceneDidEnterBackground'; readonly sceneDidDisconnect: 'sceneDidDisconnect'; readonly sceneOpenURLContexts: 'sceneOpenURLContexts'; readonly sceneContinueUserActivity: 'sceneContinueUserActivity'; readonly scenePerformActionForShortcutItem: 'scenePerformActionForShortcutItem'; readonly activityCreated: 'activityCreated'; readonly activityDestroyed: 'activityDestroyed'; readonly activityStarted: 'activityStarted'; readonly activityPaused: 'activityPaused'; readonly activityResumed: 'activityResumed'; readonly activityStopped: 'activityStopped'; readonly saveActivityState: 'saveActivityState'; readonly activityResult: 'activityResult'; readonly activityBackPressed: 'activityBackPressed'; readonly activityNewIntent: 'activityNewIntent'; readonly activityRequestPermissions: 'activityRequestPermissions';};Events emitted by a NativeWindow instance.
variable notify
const notify: any;Deprecated
Deep imports into the Application module are deprecated and will be removed in a future release. Use the
Applicationclass imported from "@nativescript/core" instead:import { Application } from "@nativescript/core";Application.notify()
variable off
const off: any;Deprecated
Deep imports into the Application module are deprecated and will be removed in a future release. Use the
Applicationclass imported from "@nativescript/core" instead:import { Application } from "@nativescript/core";Application.off()
variable on
const on: any;Deprecated
Deep imports into the Application module are deprecated and will be removed in a future release. Use the
Applicationclass imported from "@nativescript/core" instead:import { Application } from "@nativescript/core";Application.on()
variable opacityProperty
const opacityProperty: CssAnimationProperty<Style, number>;variable orientation
const orientation: any;Deprecated
Deep imports into the Application module are deprecated and will be removed in a future release. Use the
Applicationclass imported from "@nativescript/core" instead:import { Application } from "@nativescript/core";Application.orientation()
variable orientationChangedEvent
const orientationChangedEvent: string;Deprecated
Deep imports into the Application module are deprecated and will be removed in a future release. Use the
Applicationclass imported from "@nativescript/core" instead:import { Application } from "@nativescript/core";Application.orientationChangedEvent
variable paddingBottomProperty
const paddingBottomProperty: CssProperty<Style, CoreTypes.LengthType>;variable paddingInternalProperty
const paddingInternalProperty: CssProperty<Style, string>;variable paddingLeftProperty
const paddingLeftProperty: CssProperty<Style, CoreTypes.LengthType>;variable paddingRightProperty
const paddingRightProperty: CssProperty<Style, CoreTypes.LengthType>;variable paddingTopProperty
const paddingTopProperty: CssProperty<Style, CoreTypes.LengthType>;variable perspectiveProperty
const perspectiveProperty: CssAnimationProperty<Style, number>;variable placeholderColorProperty
const placeholderColorProperty: CssProperty<Style, Color>;variable platformNames
const platformNames: { android: string; ios: string; visionos: string; apple: string;};variable resetRootView
const resetRootView: any;Deprecated
Deep imports into the Application module are deprecated and will be removed in a future release. Use the
Applicationclass imported from "@nativescript/core" instead:import { Application } from "@nativescript/core";Application.resetRootView()
variable resumeEvent
const resumeEvent: string;Deprecated
Deep imports into the Application module are deprecated and will be removed in a future release. Use the
Applicationclass imported from "@nativescript/core" instead:import { Application } from "@nativescript/core";Application.resumeEvent
variable returnKeyTypeProperty
const returnKeyTypeProperty: Property< EditableTextBase, CoreTypes.ReturnKeyButtonType>;variable rotateProperty
const rotateProperty: CssAnimationProperty<Style, number>;variable rotateXProperty
const rotateXProperty: CssAnimationProperty<Style, number>;variable rotateYProperty
const rotateYProperty: CssAnimationProperty<Style, number>;variable rowGapProperty
const rowGapProperty: CssProperty<Style, CoreTypes.LengthType>;variable run
const run: any;Deprecated
Deep imports into the Application module are deprecated and will be removed in a future release. Use the
Applicationclass imported from "@nativescript/core" instead:import { Application } from "@nativescript/core";Application.run()
variable scaleXProperty
const scaleXProperty: CssAnimationProperty<Style, number>;variable scaleYProperty
const scaleYProperty: CssAnimationProperty<Style, number>;variable SceneEvents
const SceneEvents: { sceneWillConnect: string; sceneDidActivate: string; sceneWillResignActive: string; sceneWillEnterForeground: string; sceneDidEnterBackground: string; sceneDidDisconnect: string; sceneContentSetup: string;};Deprecated
Use
NativeWindowEventsfrom@nativescript/core/native-windowinstead.
variable setAutoSystemAppearanceChanged
const setAutoSystemAppearanceChanged: any;Deprecated
Deep imports into the Application module are deprecated and will be removed in a future release. Use the
Applicationclass imported from "@nativescript/core" instead:import { Application } from "@nativescript/core";Application.setAutoSystemAppearanceChanged()
variable setCssFileName
const setCssFileName: any;Deprecated
Deep imports into the Application module are deprecated and will be removed in a future release. Use the
Applicationclass imported from "@nativescript/core" instead:import { Application } from "@nativescript/core";Application.setCssFileName()
variable setMaxRefreshRate
const setMaxRefreshRate: any;Deprecated
Deep imports into the Application module are deprecated and will be removed in a future release. Use the
Applicationclass imported from "@nativescript/core" instead:import { Application } from "@nativescript/core";Application.setMaxRefreshRate()
variable setResources
const setResources: any;Deprecated
Deep imports into the Application module are deprecated and will be removed in a future release. Use the
Applicationclass imported from "@nativescript/core" instead:import { Application } from "@nativescript/core";Application.setResources()
variable suspended
const suspended: boolean;Deprecated
Deep imports into the Application module are deprecated and will be removed in a future release. Use the
Applicationclass imported from "@nativescript/core" instead:import { Application } from "@nativescript/core";Application.suspended
variable suspendEvent
const suspendEvent: string;Deprecated
Deep imports into the Application module are deprecated and will be removed in a future release. Use the
Applicationclass imported from "@nativescript/core" instead:import { Application } from "@nativescript/core";Application.suspendEvent
variable systemAppearance
const systemAppearance: any;Deprecated
Deep imports into the Application module are deprecated and will be removed in a future release. Use the
Applicationclass imported from "@nativescript/core" instead:import { Application } from "@nativescript/core";Application.systemAppearance()
variable systemAppearanceChanged
const systemAppearanceChanged: any;Deprecated
Deep imports into the Application module are deprecated and will be removed in a future release. Use the
Applicationclass imported from "@nativescript/core" instead:import { Application } from "@nativescript/core";Application.systemAppearanceChanged()
variable systemAppearanceChangedEvent
const systemAppearanceChangedEvent: string;Deprecated
Deep imports into the Application module are deprecated and will be removed in a future release. Use the
Applicationclass imported from "@nativescript/core" instead:import { Application } from "@nativescript/core";Application.systemAppearanceChangedEvent
variable textAlignmentProperty
const textAlignmentProperty: InheritedCssProperty< Style, CoreTypes.TextAlignmentType>;variable textDecorationProperty
const textDecorationProperty: CssProperty<Style, CoreTypes.TextDecorationType>;variable textOverflowProperty
const textOverflowProperty: CssProperty<Style, CoreTypes.TextOverflowType>;variable textShadowProperty
const textShadowProperty: InheritedCssProperty<Style, ShadowCSSValues>;variable textStrokeProperty
const textStrokeProperty: InheritedCssProperty<Style, StrokeCSSValues>;variable textTransformProperty
const textTransformProperty: InheritedCssProperty< Style, CoreTypes.TextTransformType>;variable translateXProperty
const translateXProperty: CssAnimationProperty<Style, CoreTypes.FixedLengthType>;variable translateYProperty
const translateYProperty: CssAnimationProperty<Style, CoreTypes.FixedLengthType>;variable uncaughtErrorEvent
const uncaughtErrorEvent: string;Deprecated
Deep imports into the Application module are deprecated and will be removed in a future release. Use the
Applicationclass imported from "@nativescript/core" instead:import { Application } from "@nativescript/core";Application.uncaughtErrorEvent
variable unsetValue
const unsetValue: any;Value specifying that Property should be set to its initial value.
variable updateTextTriggerProperty
const updateTextTriggerProperty: Property< EditableTextBase, CoreTypes.UpdateTextTriggerType>;variable VALID_FONT_SCALES
const VALID_FONT_SCALES: number[];variable verticalAlignmentProperty
const verticalAlignmentProperty: CssProperty< Style, CoreTypes.VerticalAlignmentTextType>;variable visibilityProperty
const visibilityProperty: CssProperty<Style, CoreTypes.VisibilityType>;variable whiteSpaceProperty
const whiteSpaceProperty: InheritedCssProperty<Style, CoreTypes.WhiteSpaceType>;variable widthProperty
const widthProperty: CssAnimationProperty<Style, CoreTypes.PercentLengthType>;variable WindowEvents
const WindowEvents: { readonly windowOpen: 'windowOpen'; readonly windowClose: 'windowClose'; readonly primaryWindowChanged: 'primaryWindowChanged';};Application-level events related to window management.
variable zIndexProperty
const zIndexProperty: CssProperty<Style, number>;Functions
function action
action: { ( message: string, cancelButtonText: string, actions: Array<string> ): Promise<string>; (options: ActionOptions): Promise<string>;};The action() method displays a action box that prompts the visitor to choose some action.
Parameter message
The text to display in the dialog box.
Parameter cancelButtonText
The text to display in the cancel button.
Parameter actions
List of available actions.
The action() method displays a action box that prompts the visitor to choose some action.
Parameter options
The options for the dialog box.
function addTaggedAdditionalCSS
addTaggedAdditionalCSS: (cssText: string, tag?: string | number) => boolean;function addWeakEventListener
addWeakEventListener: ( source: Observable, eventName: string, handler: (eventData: EventData) => void, target: any) => void;Attaches a WeakEventListener.
Parameter source
Observable class which emits the event.
Parameter eventName
The event name.
Parameter handler
The function which should be called when event occurs.
Parameter target
Subscriber (target) of the event listener. It will be used as a thisArg in the handler function.
function alert
alert: { (message: string | number | boolean): Promise<void>; (options: AlertOptions): Promise<void>;};The alert() method displays an alert box with a specified message.
Parameter message
Specifies the text to display in the alert box.
The alert() method displays an alert box with a specified message.
Parameter options
Specifies the options for the alert box.
function animationTimingFunctionConverter
animationTimingFunctionConverter: (value: string) => any;function booleanConverter
booleanConverter: (v: string | boolean) => boolean;function confirm
confirm: { (message: string): Promise<boolean>; (options: ConfirmOptions): Promise<boolean>;};The confirm() method displays a dialog box with a specified message.
Parameter message
Specifies the text to display in the confirm box.
The confirm() method displays a dialog box with a specified message.
Parameter options
Specifies the options for the confirm box.
function CSSType
CSSType: (type: string) => ClassDecorator;Specifies the type name for the instances of this View class, that is used when matching CSS type selectors.
Usage:
@CSSType("Button")class Button extends View {}Internally the decorator set
Button.prototype.cssType = "Button".Parameter type
The type name, e. g. "Button", "Label", etc.
function eachDescendant
eachDescendant: (view: ViewBase, callback: (child: ViewBase) => boolean) => void;Iterates through all child views (via visual tree) and executes a function.
Parameter view
Starting view (parent container).
Parameter callback
A function to execute on every child. If function returns false it breaks the iteration.
function fromObject
fromObject: (source: any) => Observable;Creates an Observable instance and sets its properties according to the supplied JavaScript object. param obj - A JavaScript object used to initialize nativescript Observable instance.
function fromObjectRecursive
fromObjectRecursive: (source: any) => Observable;Creates an Observable instance and sets its properties according to the supplied JavaScript object. This function will create new Observable for each nested object (expect arrays and functions) from supplied JavaScript object. param obj - A JavaScript object used to initialize nativescript Observable instance.
function getAncestor
getAncestor: <T extends ViewBase = ViewBase>( view: T, criterion: string | { new (): any }) => T;Gets an ancestor from a given type.
Parameter view
Starting view (child view).
Parameter criterion
The type of ancestor view we are looking for. Could be a string containing a class name or an actual type. Returns an instance of a view (if found), otherwise undefined.
function getAndroidAccessibilityManager
getAndroidAccessibilityManager: () => android.view.accessibility.AccessibilityManager | null;function getCurrentFontScale
getCurrentFontScale: () => number;function getCurrentPage
getCurrentPage: () => Page;function getFileAccess
getFileAccess: () => FileSystemAccess;Returns FileSystemAccess, a shared singleton utility class to provide methods to access and work with the file system. This is used under the hood of all the file system apis in @nativescript/core and provided as a lower level convenience if needed.
Returns
FileSystemAccess
function getLastFocusedViewOnPage
getLastFocusedViewOnPage: (page: Page) => View | null;Find the last view focused on a page.
function getNativeApp
getNativeApp: <T extends unknown>() => T;Get the current application instance.
Returns
current application instance, UIApplication on iOS or android.app.Application on Android.
function getRootLayout
getRootLayout: () => RootLayout;function getRootLayoutById
getRootLayoutById: (id: string) => RootLayout;function getTransformedText
getTransformedText: ( text: string, textTransform: CoreTypes.TextTransformType) => string;function getViewById
getViewById: (view: ViewBase, id: string) => ViewBase;Gets a child view by id.
Parameter view
The parent (container) view of the view to look for.
Parameter id
The id of the view to look for. Returns an instance of a view (if found), otherwise undefined.
function isAccessibilityServiceEnabled
isAccessibilityServiceEnabled: () => boolean;Is Android TalkBack or iOS VoiceOver enabled?
function isEmbedded
isEmbedded: () => boolean;Whether the app is embedded into a host project or standalone project
function login
login: { ( message: string, userNameHint?: string, passwordHint?: string, userName?: string, password?: string ): Promise<LoginResult>; ( message: string, userNameHint?: string, passwordHint?: string ): Promise<LoginResult>; (options: LoginOptions): Promise<LoginResult>;};The login() method displays a login dialog box that prompts the visitor for user name and password.
Parameter message
The text to display in the dialog box.
Parameter userNameHint
The default text to display as a hint in the username input. Optional.
Parameter passwordHint
The default text to display as a hint in the password input. Optional.
Parameter userName
The default text to display in the user name input box. Optional.
Parameter password
The default text to display in the password input box. Optional.
The login() method displays a login dialog box that prompts the visitor for user name and password.
Parameter message
The text to display in the dialog box.
Parameter userNameHint
The default text to display as a hint in the username input. Optional.
Parameter passwordHint
The default text to display as a hint in the password input. Optional.
The login() method displays a login dialog box that prompts the visitor for user name and password.
Parameter options
The options for the dialog box.
function makeParser
makeParser: <T>( isValid: (value: any) => boolean, allowNumbers?: boolean) => (value: any) => T;function makeValidator
makeValidator: <T>(...values: T[]) => (value: any) => value is T;function parseCSSShadow
parseCSSShadow: (value: string) => ShadowCSSValues;Parse a string into ShadowCSSValues Supports any valid css box/text shadow combination.
inspired by https://github.com/jxnblk/css-box-shadow/blob/master/index.js (MIT License)
Parameter value
function parseCSSStroke
parseCSSStroke: (value: string) => StrokeCSSValues;Parse a string into StrokeCSSValues https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-text-stroke
Parameter value
function parseKeyframeDeclarations
parseKeyframeDeclarations: ( unparsedKeyframeDeclarations: KeyframeDeclaration[]) => KeyframeDeclaration[];function profile
profile: { (name?: string): MethodDecorator; <F extends Function>(fn: F): F; <F extends Function>(name: string, fn: F): F; <T>( target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T> ): void | TypedPropertyDescriptor<T>; (): any;};Method decorator factory. It will intercept the method call and start and pause a timer before and after the method call. Works only if profiling is enabled.
Parameter name
Name of the timer which will be used for method calls. If not provided - the name of the method will be used.
Function factory. It will intercept the function call and start and pause a timer before and after the function call. Works only if profiling is enabled. Works only if profiling is enabled.
Parameter fn
The function to wrap. Uses the function name to track the times.
Function factory. It will intercept the function call and start and pause a timer before and after the function call. Works only if profiling is enabled.
Parameter name
The name used to track calls and times.
Parameter fn
The function to wrap.
Method decorator. It will intercept the method calls and start and pause a timer before and after the method call. Works only if profiling is enabled.
function profilingDisable
profilingDisable: () => void;Disables profiling.
function profilingDumpProfiles
profilingDumpProfiles: () => void;Prints the timer for all methods instrumented with profile decorator.
function profilingEnable
profilingEnable: (type?: InstrumentationMode) => void;Enables profiling.
Upon loading of the module it will cache the package.json of the app and check if there is a "profiling" key set, its value can be one of the options available for InstrumentationMode, and if set, enable() will be called in pre app start with the value in the package.json.
An example for an
app/package.jsonenabling the manual instrumentation profiling is:{"main": "main.js","profiling": "timeline"}Parameter type
Profiling mode to use. - "counters" - Accumulates method call counts and times until dumpProfiles is called and then prints aggregated statistic in the console. This is the default. - "timeline" - Outputs method names along start/end timestamps in the console on the go. - "lifecycle" - Outputs basic non-verbose times for startup, navigation, etc.
function profilingIsRunning
profilingIsRunning: (name: string) => boolean;Returns true if a timer is currently running.
Parameter name
Name of the timer.
Returns
true is the timer is currently running.
function profilingResetProfiles
profilingResetProfiles: () => void;Resets the timers for all methods instrumented with profile decorator.
function profilingStart
profilingStart: (name: string) => void;Starts a timer with a specific name. Works only if profiling is enabled.
Parameter name
Name of the timer.
function profilingStartCPU
profilingStartCPU: (name: string) => void;Starts android cpu profiling.
Parameter name
Name of the cpu profiling session.
function profilingStop
profilingStop: (name: string) => TimerInfo;Pauses a timer with a specific name. This will increase call count and accumulate time. Works only if profiling is enabled.
Parameter name
Name of the timer.
Returns
TimerInfo for the paused timer.
function profilingStopCPU
profilingStopCPU: (name: string) => void;Stops android cpu profiling.
Parameter name
Name of the cpu profiling session.
function profilingTime
profilingTime: () => number;Gets accurate system timestamp in ms.
function profilingUptime
profilingUptime: () => number;Gets the uptime of the current process in milliseconds.
function prompt
prompt: { (message: string, defaultText?: string): Promise<PromptResult>; (options: PromptOptions): Promise<PromptResult>;};The prompt() method displays a dialog box that prompts the visitor for input.
Parameter message
The text to display in the dialog box.
Parameter defaultText
The default text to display in the input box. Optional.
The prompt() method displays a dialog box that prompts the visitor for input.
Parameter options
The options for the dialog box.
function PseudoClassHandler
PseudoClassHandler: (...pseudoClasses: string[]) => MethodDecorator;function querySelectorAll
querySelectorAll: (view: ViewBase, selector: string) => Array<ViewBase>;Gets a child view by selector.
Parameter view
The parent (container) view of the view to look for.
Parameter selector
The selector of the view to look for. Returns an instance of a view (if found), otherwise undefined.
function removeTaggedAdditionalCSS
removeTaggedAdditionalCSS: (tag: string | number) => boolean;function removeWeakEventListener
removeWeakEventListener: ( source: Observable, eventName: string, handler: (eventData: EventData) => void, target: any) => void;Removes a WeakEventListener.
Parameter source
Observable class which emits the event.
Parameter eventName
The event name.
Parameter handler
The function which should be called when event occurs.
Parameter target
Subscriber (target) of the event listener. It will be used as a thisArg in the handler function.
function resolveFileNameFromUrl
resolveFileNameFromUrl: ( url: string, appDirectory: string, fileExists: (name: string) => boolean, importSource?: string) => string;function sanitizeModuleName
sanitizeModuleName: (moduleName: string, removeExtension?: boolean) => string;Helps sanitize a module name if it is prefixed with '~/', '~' or '/'
Parameter moduleName
the name
Parameter removeExtension
whether to remove extension
function sendAccessibilityEvent
sendAccessibilityEvent: ( View: View, eventName: AndroidAccessibilityEvent, text?: string) => void;Android: helper function for triggering accessibility events
function setActivityCallbacks
setActivityCallbacks: (activity: any) => void;function setNativeApp
setNativeApp: (app: NativeApp) => void;This is called internally to set the native application instance. You typically do not need to call this directly. However, it's exposed for special case purposes, such as custom application initialization.
Parameter app
The native application instance to set. This should be called once during application startup to set the native app instance.
function timeConverter
timeConverter: (value: string) => number;function updateAccessibilityProperties
updateAccessibilityProperties: (view: View) => void;Update accessibility properties on nativeView
Classes
class AbsoluteLayout
class AbsoluteLayout extends LayoutBase {}A layout that lets you specify exact locations (left/top coordinates) of its children.
AbsoluteLayout
method getLeft
static getLeft: (view: View) => CoreTypes.LengthType;Gets the value of the Left property from a given View.
method getTop
static getTop: (view: View) => CoreTypes.LengthType;Gets the value of the Top property from a given View.
method setLeft
static setLeft: (view: View, value: CoreTypes.LengthType) => void;Sets the value of the Left property from a given View.
method setTop
static setTop: (view: View, value: CoreTypes.LengthType) => void;Sets the value of the Top property from a given View.
class ActionBar
class ActionBar extends View {}Provides an abstraction over the ActionBar (android) and NavigationBar (iOS).
ActionBar
property actionItems
actionItems: ActionItems;Gets the collection of action items.
property android
android: AndroidActionBarSettings;Gets the android specific options of the action bar.
property effectiveContentInsetLeft
effectiveContentInsetLeft: number;property effectiveContentInsetRight
effectiveContentInsetRight: number;property flat
flat: boolean;Removes the shadow/border at the bottom of the ActionBar and removes translucency on iOS. Default false.
property ios
ios: any;Gets the native iOS [UINavigationBar](https://developer.apple.com/documentation/uikit/uinavigationbar) that represents the user interface for this component. Valid only when running on iOS.
property iosIconRenderingMode
iosIconRenderingMode: 'automatic' | 'alwaysOriginal' | 'alwaysTemplate';Gets or set the UIImageRenderingMode of the action bar icons in iOS. Defaults to "alwaysOriginal" Valid values are: - automatic - alwaysOriginal - alwaysTemplate
property navigationButton
navigationButton: NavigationButton;Gets or sets the navigation button (a.k.a. the back button).
property title
title: string;Gets or sets the action bar title.
property titleView
titleView: View;Gets or sets the title view. When set - replaces the title with a custom view.
method update
update: () => any;Updates the action bar.
class ActionItem
class ActionItem extends ViewBase {}Represents an action item in the action bar.
ActionItem
property actionBar
actionBar: ActionBar;Gets the action bar that contains the action item.
property actionView
actionView: View;Gets or sets the custom action view of the action item.
property android
android: AndroidActionItemSettings;Gets the Android specific options of the action item.
property icon
icon: string;Gets or sets the icon of the action item.
property ios
ios: IOSActionItemSettings;Gets the iOS specific options of the action item.
property tapEvent
static tapEvent: string;String value used when hooking to layoutChanged event.
{EventData} tap
property text
text: string;Gets or sets the text of the action item.
property visibility
visibility: string;Gets or sets the visibility of the action item.
method on
on: { (eventName: string, callback: (data: EventData) => void): void; (event: 'tap', callback: (args: EventData) => void): void;};Adds a listener for the specified event name.
Parameter eventName
The name of the event.
Parameter callback
The event listener to add. Will be called when an event of the given name is raised.
Parameter thisArg
An optional parameter which, when set, will be bound as the
thiscontext when the callback is called. Falsy values will be not be bound.Raised when a tap event occurs.
class ActionItems
class ActionItems {}Represents a collection of ActionItems.
method addItem
addItem: (item: ActionItem) => void;Adds an item to the collection.
Parameter item
the item to be added
method getItemAt
getItemAt: (index: number) => ActionItem;Gets an item at a specified index.
Parameter index
The index.
method getItems
getItems: () => Array<ActionItem>;Gets an array of the current action items in the collection.
method removeItem
removeItem: (item: ActionItem) => void;Removes an item to the collection.
Parameter item
The item to be removed.
class ActivityIndicator
class ActivityIndicator extends View {}Represents a UI widget which displays a progress indicator hinting the user for some background operation running.
ActivityIndicator
property android
android: any;Gets the native [android widget](http://developer.android.com/reference/android/widget/ProgressBar.html) that represents the user interface for this component. Valid only when running on Android OS.
property busy
busy: boolean;Gets or sets a value indicating whether the widget is currently displaying progress.
property ios
ios: any;Gets the native iOS [UIActivityIndicatorView](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIActivityIndicatorView_Class/index.html) that represents the user interface for this component. Valid only when running on iOS.
property iosIndicatorViewStyle
iosIndicatorViewStyle: IOSIndicatorViewStyle;Gets or sets the iOS indicator view style (e.g. medium, large).
class AndroidApplication
class AndroidApplication extends ApplicationCommon {}property activityBackPressedEvent
static readonly activityBackPressedEvent: string;property activityBackPressedEvent
readonly activityBackPressedEvent: string;property activityCreatedEvent
static readonly activityCreatedEvent: string;property activityCreatedEvent
readonly activityCreatedEvent: string;property activityDestroyedEvent
static readonly activityDestroyedEvent: string;property activityDestroyedEvent
readonly activityDestroyedEvent: string;property activityNewIntentEvent
static readonly activityNewIntentEvent: string;property activityNewIntentEvent
readonly activityNewIntentEvent: string;property activityPausedEvent
static readonly activityPausedEvent: string;property activityPausedEvent
readonly activityPausedEvent: string;property activityRequestPermissionsEvent
static readonly activityRequestPermissionsEvent: string;property activityRequestPermissionsEvent
readonly activityRequestPermissionsEvent: string;property activityResultEvent
static readonly activityResultEvent: string;property activityResultEvent
readonly activityResultEvent: string;property activityResumedEvent
static readonly activityResumedEvent: string;property activityResumedEvent
readonly activityResumedEvent: string;property activityStartedEvent
static readonly activityStartedEvent: string;property activityStartedEvent
readonly activityStartedEvent: string;property activityStoppedEvent
static readonly activityStoppedEvent: string;property activityStoppedEvent
readonly activityStoppedEvent: string;property backgrounded
readonly backgrounded: boolean;Deprecated
Use
Application.inBackgroundinstead.
property context
readonly context: android.content.Context;Deprecated
Use
Utils.android.getApplicationContext()instead.
property foregroundActivity
readonly foregroundActivity: androidx.appcompat.app.AppCompatActivity;The currently active (loaded) [android Activity](http://developer.android.com/reference/android/app/Activity.html).
This property is automatically updated upon Activity events.
property nativeApp
readonly nativeApp: android.app.Application;The [android Application](http://developer.android.com/reference/android/app/Application.html) object instance provided to the init of the module.
property on
on: AndroidApplicationOn;property packageName
readonly packageName: string;Deprecated
Use
Utils.android.getPackageName()instead.
property paused
readonly paused: boolean;Deprecated
Use
Application.suspendedinstead.
property saveActivityStateEvent
static readonly saveActivityStateEvent: string;property saveActivityStateEvent
readonly saveActivityStateEvent: string;property startActivity
readonly startActivity: androidx.appcompat.app.AppCompatActivity;The main (start) Activity for the application.
method getNativeApplication
getNativeApplication: () => android.app.Application;method getRegisteredBroadcastReceiver
getRegisteredBroadcastReceiver: ( intentFilter: string) => android.content.BroadcastReceiver | undefined;Get a registered BroadcastReceiver, then you can get the result code of BroadcastReceiver in onReceiveCallback method.
Parameter intentFilter
A string containing the intent filter.
Deprecated
Use
getRegisteredBroadcastReceiversinstead.
method getRegisteredBroadcastReceivers
getRegisteredBroadcastReceivers: ( intentFilter: string) => android.content.BroadcastReceiver[];Get all registered BroadcastReceivers for a specific intent filter.
Parameter intentFilter
a string containing the intent filter
method openWindow
openWindow: (options?: WindowOpenOptions) => void;Opens a new window by launching the start activity into its own task.
Parameter options
Options for the new window.
options.datais put on the launch intent as extras and surfaces as the window'sdata.The start activity's
launchModein AndroidManifest.xml decides whether a second instance can exist at all:singleTask(the app template default) andsingleInstanceroute the intent to the existing activity'sonNewIntentinstead of creating one. UsesingleInstancePerTask(API 31+) to keep single-task behavior for launcher and deep-link starts while allowing additional windows, orstandard. When the app is already in split-screen, the new window opens in the adjacent pane; otherwise it covers the current one and both show in recents.Modifiers
@experimental
method registerBroadcastReceiver
registerBroadcastReceiver: ( intentFilter: string, onReceiveCallback: ( context: android.content.Context, intent: android.content.Intent ) => void, flags?: number) => () => void;Register a BroadcastReceiver to be run in the main activity thread. The receiver will be called with any broadcast Intent that matches filter, in the main application thread. For more information, please visit 'http://developer.android.com/reference/android/content/Context.html#registerReceiver%28android.content.BroadcastReceiver,%20android.content.IntentFilter%29'
Parameter intentFilter
A string containing the intent filter.
Parameter onReceiveCallback
A callback function that will be called each time the receiver receives a broadcast.
Parameter flags
Any combination of
RECEIVER_VISIBLE_TO_INSTANT_APPS(1),RECEIVER_EXPORTED(2) andRECEIVER_NOT_EXPORTED(4). Defaults toRECEIVER_EXPORTED. Only honored from API 26 onwards. A function that can be called to unregister the receiver.
method unregisterBroadcastReceiver
unregisterBroadcastReceiver: (intentFilter: string) => void;Unregister a previously registered BroadcastReceiver. For more information, please visit 'http://developer.android.com/reference/android/content/Context.html#unregisterReceiver(android.content.BroadcastReceiver)'
Parameter intentFilter
A string containing the intent filter with which the receiver was originally registered.
class Animation
class Animation {}Defines a animation set.
constructor
constructor( animationDefinitions: AnimationDefinition[], playSequentially?: boolean);property cancel
cancel: () => void;property isPlaying
isPlaying: boolean;property play
play: (resetOnFinish?: boolean) => AnimationPromise;class ApplicationCommon
class ApplicationCommon {}property activeWindow
readonly activeWindow: NativeWindow;Get the NativeWindow the user is currently interacting with - the one that activated most recently and is still attached. Falls back to the primary window while no window holds activation, which is the case before the first window activates and on a platform that never raises
activate.
property android
readonly android: AndroidApplicationType;property AndroidApplication
readonly AndroidApplication: AndroidApplicationType;property autoSystemAppearanceChanged
autoSystemAppearanceChanged: boolean;Boolean to enable/disable systemAppearanceChanged
property backgroundEvent
readonly backgroundEvent: string;property cssChangedEvent
readonly cssChangedEvent: string;property discardedErrorEvent
readonly discardedErrorEvent: string;property displayedEvent
readonly displayedEvent: string;property exitEvent
readonly exitEvent: string;On Android, raised when the last window closes; the process may stay alive. On iOS, raised when the process itself terminates.
property fontScaleChangedEvent
readonly fontScaleChangedEvent: string;property foregroundEvent
readonly foregroundEvent: string;property hasListeners
static hasListeners: (eventName: string) => boolean;Deprecated
Use
Application.android.hasListeners()instead.
property hasListeners
hasListeners: (eventName: string) => boolean;property inBackground
readonly inBackground: boolean;property initRootViewEvent
readonly initRootViewEvent: string;property ios
readonly ios: iOSApplicationType;property iOSApplication
readonly iOSApplication: iOSApplicationType;property launchEvent
readonly launchEvent: string;Deprecated
Use the 'ready' event for application initialization and Application.setWindowContentResolver() to provide window UI. 'launch' continues to fire before the first window's content is created, and its 'root' property is still honored, for backwards compatibility. It never fires for additional windows. In a scene-based app it fires with the first window's content, so a background launch that connects no scene does not raise it.
property layoutDirectionChangedEvent
readonly layoutDirectionChangedEvent: string;property livesyncEvent
readonly livesyncEvent: string;property loadAppCssEvent
readonly loadAppCssEvent: string;property lowMemoryEvent
readonly lowMemoryEvent: string;property mainEntry
protected mainEntry: NavigationEntry;property notify
static notify: <T = ApplicationEventData>(eventData: T) => void;Deprecated
Use
Application.android.notify()instead.
property notify
notify: <T = ApplicationEventData>(eventData: T) => void;property off
static off: (eventNames: string, callback?: any, thisArg?: any) => void;Deprecated
Use
Application.android.off()instead.
property off
off: (eventNames: string, callback?: any, thisArg?: any) => void;property on
static on: { ( eventNames: string, callback: (args: ApplicationEventData) => void, thisArg?: any ): void; ( event: 'cssChanged', callback: (args: CssChangedEventData) => void, thisArg?: any ): void; ( event: 'livesync', callback: (args: ApplicationEventData) => void, thisArg?: any ): void; ( event: 'launch', callback: (args: LaunchEventData) => void, thisArg?: any ): void; ( event: 'ready', callback: (args: ApplicationEventData) => void, thisArg?: any ): void; ( event: 'displayed', callback: (args: ApplicationEventData) => void, thisArg?: any ): void; ( event: 'suspend', callback: (args: ApplicationEventData) => void, thisArg?: any ): void; ( event: 'resume', callback: (args: ApplicationEventData) => void, thisArg?: any ): void; ( event: 'exit', callback: (args: ApplicationEventData) => void, thisArg?: any ): void; ( event: 'lowMemory', callback: (args: ApplicationEventData) => void, thisArg?: any ): void; ( event: 'uncaughtError', callback: (args: UnhandledErrorEventData) => void, thisArg?: any ): void; ( event: 'discardedError', callback: (args: DiscardedErrorEventData) => void, thisArg?: any ): void; ( event: 'orientationChanged', callback: (args: OrientationChangedEventData) => void, thisArg?: any ): void; ( event: 'systemAppearanceChanged', callback: (args: SystemAppearanceChangedEventData) => void, thisArg?: any ): void; ( event: 'layoutDirectionChanged', callback: (args: LayoutDirectionChangedEventData) => void, thisArg?: any ): void; ( event: 'fontScaleChanged', callback: (args: FontScaleChangedEventData) => void, thisArg?: any ): void; ( event: 'windowOpen', callback: (args: WindowOpenEventData) => void, thisArg?: any ): void; ( event: 'windowClose', callback: (args: WindowCloseEventData) => void, thisArg?: any ): void; ( event: 'primaryWindowChanged', callback: (args: PrimaryWindowChangedEventData) => void, thisArg?: any ): void; ( event: 'sceneOpenURLContexts', callback: (args: SceneOpenURLContextsEventData) => void, thisArg?: any ): void; ( event: 'sceneContinueUserActivity', callback: (args: SceneContinueUserActivityEventData) => void, thisArg?: any ): void; ( event: 'scenePerformActionForShortcutItem', callback: (args: ScenePerformActionForShortcutItemEventData) => void, thisArg?: any ): void;};Deprecated
Use
Application.android.on()instead.
property on
on: { ( eventNames: string, callback: (args: ApplicationEventData) => void, thisArg?: any ): void; ( event: 'cssChanged', callback: (args: CssChangedEventData) => void, thisArg?: any ): void; ( event: 'livesync', callback: (args: ApplicationEventData) => void, thisArg?: any ): void; ( event: 'launch', callback: (args: LaunchEventData) => void, thisArg?: any ): void; ( event: 'ready', callback: (args: ApplicationEventData) => void, thisArg?: any ): void; ( event: 'displayed', callback: (args: ApplicationEventData) => void, thisArg?: any ): void; ( event: 'suspend', callback: (args: ApplicationEventData) => void, thisArg?: any ): void; ( event: 'resume', callback: (args: ApplicationEventData) => void, thisArg?: any ): void; ( event: 'exit', callback: (args: ApplicationEventData) => void, thisArg?: any ): void; ( event: 'lowMemory', callback: (args: ApplicationEventData) => void, thisArg?: any ): void; ( event: 'uncaughtError', callback: (args: UnhandledErrorEventData) => void, thisArg?: any ): void; ( event: 'discardedError', callback: (args: DiscardedErrorEventData) => void, thisArg?: any ): void; ( event: 'orientationChanged', callback: (args: OrientationChangedEventData) => void, thisArg?: any ): void; ( event: 'systemAppearanceChanged', callback: (args: SystemAppearanceChangedEventData) => void, thisArg?: any ): void; ( event: 'layoutDirectionChanged', callback: (args: LayoutDirectionChangedEventData) => void, thisArg?: any ): void; ( event: 'fontScaleChanged', callback: (args: FontScaleChangedEventData) => void, thisArg?: any ): void; ( event: 'windowOpen', callback: (args: WindowOpenEventData) => void, thisArg?: any ): void; ( event: 'windowClose', callback: (args: WindowCloseEventData) => void, thisArg?: any ): void; ( event: 'primaryWindowChanged', callback: (args: PrimaryWindowChangedEventData) => void, thisArg?: any ): void; ( event: 'sceneOpenURLContexts', callback: (args: SceneOpenURLContextsEventData) => void, thisArg?: any ): void; ( event: 'sceneContinueUserActivity', callback: (args: SceneContinueUserActivityEventData) => void, thisArg?: any ): void; ( event: 'scenePerformActionForShortcutItem', callback: (args: ScenePerformActionForShortcutItemEventData) => void, thisArg?: any ): void;};property once
static once: { ( eventNames: string, callback: (args: ApplicationEventData) => void, thisArg?: any ): void; ( event: 'cssChanged', callback: (args: CssChangedEventData) => void, thisArg?: any ): void; ( event: 'livesync', callback: (args: ApplicationEventData) => void, thisArg?: any ): void; ( event: 'launch', callback: (args: LaunchEventData) => void, thisArg?: any ): void; ( event: 'ready', callback: (args: ApplicationEventData) => void, thisArg?: any ): void; ( event: 'displayed', callback: (args: ApplicationEventData) => void, thisArg?: any ): void; ( event: 'suspend', callback: (args: ApplicationEventData) => void, thisArg?: any ): void; ( event: 'resume', callback: (args: ApplicationEventData) => void, thisArg?: any ): void; ( event: 'exit', callback: (args: ApplicationEventData) => void, thisArg?: any ): void; ( event: 'lowMemory', callback: (args: ApplicationEventData) => void, thisArg?: any ): void; ( event: 'uncaughtError', callback: (args: UnhandledErrorEventData) => void, thisArg?: any ): void; ( event: 'discardedError', callback: (args: DiscardedErrorEventData) => void, thisArg?: any ): void; ( event: 'orientationChanged', callback: (args: OrientationChangedEventData) => void, thisArg?: any ): void; ( event: 'systemAppearanceChanged', callback: (args: SystemAppearanceChangedEventData) => void, thisArg?: any ): void; ( event: 'layoutDirectionChanged', callback: (args: LayoutDirectionChangedEventData) => void, thisArg?: any ): void; ( event: 'fontScaleChanged', callback: (args: FontScaleChangedEventData) => void, thisArg?: any ): void; ( event: 'windowOpen', callback: (args: WindowOpenEventData) => void, thisArg?: any ): void; ( event: 'windowClose', callback: (args: WindowCloseEventData) => void, thisArg?: any ): void; ( event: 'primaryWindowChanged', callback: (args: PrimaryWindowChangedEventData) => void, thisArg?: any ): void; ( event: 'sceneOpenURLContexts', callback: (args: SceneOpenURLContextsEventData) => void, thisArg?: any ): void; ( event: 'sceneContinueUserActivity', callback: (args: SceneContinueUserActivityEventData) => void, thisArg?: any ): void; ( event: 'scenePerformActionForShortcutItem', callback: (args: ScenePerformActionForShortcutItemEventData) => void, thisArg?: any ): void;};Deprecated
Use
Application.android.once()instead.
property once
once: { ( eventNames: string, callback: (args: ApplicationEventData) => void, thisArg?: any ): void; ( event: 'cssChanged', callback: (args: CssChangedEventData) => void, thisArg?: any ): void; ( event: 'livesync', callback: (args: ApplicationEventData) => void, thisArg?: any ): void; ( event: 'launch', callback: (args: LaunchEventData) => void, thisArg?: any ): void; ( event: 'ready', callback: (args: ApplicationEventData) => void, thisArg?: any ): void; ( event: 'displayed', callback: (args: ApplicationEventData) => void, thisArg?: any ): void; ( event: 'suspend', callback: (args: ApplicationEventData) => void, thisArg?: any ): void; ( event: 'resume', callback: (args: ApplicationEventData) => void, thisArg?: any ): void; ( event: 'exit', callback: (args: ApplicationEventData) => void, thisArg?: any ): void; ( event: 'lowMemory', callback: (args: ApplicationEventData) => void, thisArg?: any ): void; ( event: 'uncaughtError', callback: (args: UnhandledErrorEventData) => void, thisArg?: any ): void; ( event: 'discardedError', callback: (args: DiscardedErrorEventData) => void, thisArg?: any ): void; ( event: 'orientationChanged', callback: (args: OrientationChangedEventData) => void, thisArg?: any ): void; ( event: 'systemAppearanceChanged', callback: (args: SystemAppearanceChangedEventData) => void, thisArg?: any ): void; ( event: 'layoutDirectionChanged', callback: (args: LayoutDirectionChangedEventData) => void, thisArg?: any ): void; ( event: 'fontScaleChanged', callback: (args: FontScaleChangedEventData) => void, thisArg?: any ): void; ( event: 'windowOpen', callback: (args: WindowOpenEventData) => void, thisArg?: any ): void; ( event: 'windowClose', callback: (args: WindowCloseEventData) => void, thisArg?: any ): void; ( event: 'primaryWindowChanged', callback: (args: PrimaryWindowChangedEventData) => void, thisArg?: any ): void; ( event: 'sceneOpenURLContexts', callback: (args: SceneOpenURLContextsEventData) => void, thisArg?: any ): void; ( event: 'sceneContinueUserActivity', callback: (args: SceneContinueUserActivityEventData) => void, thisArg?: any ): void; ( event: 'scenePerformActionForShortcutItem', callback: (args: ScenePerformActionForShortcutItemEventData) => void, thisArg?: any ): void;};property orientationChangedEvent
readonly orientationChangedEvent: string;property primaryWindow
readonly primaryWindow: NativeWindow;Get the primary NativeWindow.
property primaryWindowChangedEvent
readonly primaryWindowChangedEvent: string;property readyEvent
readonly readyEvent: string;Raised once per JS context, as soon as the context is initialized. It is never deferred, so it also fires on a background launch where no window is created.
Guaranteed ordering:
ready->windowOpen-> raw connect/create events -> content resolution (the legacylaunchbridge runs here, for the first window only) ->contentLoaded->activate/displayed.
property resumeEvent
readonly resumeEvent: string;property started
started: boolean;property suspended
readonly suspended: boolean;property suspendEvent
readonly suspendEvent: string;Reflects whole-app state: with multiple windows it is raised once the app itself is no longer in the foreground, not when an individual window backgrounds. Listen on a NativeWindow for per-window state.
property systemAppearanceChangedEvent
readonly systemAppearanceChangedEvent: string;property uncaughtErrorEvent
readonly uncaughtErrorEvent: string;property windowCloseEvent
readonly windowCloseEvent: string;property windowOpenEvent
readonly windowOpenEvent: string;method addCss
addCss: (cssText: string, attributeScoped?: boolean) => void;method applyCssClass
applyCssClass: ( rootView: View, cssClasses: string[], newCssClass: string, skipCssUpdate?: boolean) => void;Applies the the
newCssClassto therootViewand removes all other css classes fromcssClassespreviously applied to therootView.Parameter rootView
Parameter cssClasses
Parameter newCssClass
Parameter skipCssUpdate
method createRootView
createRootView: ( view?: View, fireLaunchEvent?: boolean, additionalLanchEventData?: any) => View;method getCssFileName
getCssFileName: () => string;Gets css file name for the application.
method getLayoutDirection
protected getLayoutDirection: () => CoreTypes.LayoutDirectionType | null;method getMainEntry
getMainEntry: () => any;Returns
The main entry of the application
method getNativeApplication
getNativeApplication: () => any;method getOrientation
protected getOrientation: () => 'portrait' | 'landscape' | 'unknown';method getResources
getResources: () => any;Get application level static resources.
method getRootView
getRootView: () => View;method getSystemAppearance
protected getSystemAppearance: () => 'dark' | 'light' | null;method getWindowById
getWindowById: (id: string) => NativeWindow | undefined;Get a registered NativeWindow by its id.
method getWindowContentResolver
getWindowContentResolver: () => WindowContentResolver | null;Returns
The callback currently supplying window content, if any.
method getWindows
getWindows: { (role: 'all'): WindowBase[]; (role?: WindowRole | WindowRole[]): NativeWindow[]; (role?: 'all' | WindowRole | WindowRole[]): WindowBase[];};Get the active windows, filtered by role.
Defaults to the view-carrying app windows (
applicationandembedded). Pass'all'to include every registered surface, including ones that carry no view tree.
method hasLaunched
hasLaunched: () => boolean;method initRootView
initRootView: (rootView: View, window?: NativeWindow) => void;Parameter window
the window the root view belongs to. Supplies the window-scoped CSS classes; without it they come from the primary window.
method layoutDirection
layoutDirection: () => CoreTypes.LayoutDirectionType | null;Deprecated
Use Application.primaryWindow?.layoutDirection() - or the NativeWindow of the relevant view - instead. Continues to reflect the primary window.
method layoutDirectionChanged
layoutDirectionChanged: ( rootView: View, newLayoutDirection: CoreTypes.LayoutDirectionType) => void;Updates root view classes including those of modals
Parameter rootView
the root view
Parameter newLayoutDirection
the new layout direction change
method loadAppCss
loadAppCss: () => void;Loads immediately the app.css. By default the app.css file is loaded shortly after "loaded". For the Android snapshot the CSS can be parsed during the snapshot generation, as the CSS does not depend on runtime APIs, and loadAppCss will be called explicitly.
method notifyLaunch
protected notifyLaunch: (additionalLanchEventData?: any) => View | null;method openWindow
openWindow: (options?: WindowOpenOptions) => void;Opens a new window.
Parameter options
Options for the new window, including data to hand to it.
method orientation
orientation: () => 'portrait' | 'landscape' | 'unknown';Deprecated
Use Application.primaryWindow?.orientation() - or the NativeWindow of the relevant view - instead. Continues to reflect the primary window.
method orientationChanged
orientationChanged: ( rootView: View, newOrientation: 'portrait' | 'landscape' | 'unknown') => void;method resetRootView
resetRootView: (entry?: NavigationEntry | string) => void;method run
run: (entry?: string | NavigationEntry) => void;method setAutoSystemAppearanceChanged
setAutoSystemAppearanceChanged: (value: boolean) => void;enable/disable systemAppearanceChanged
method setCssFileName
setCssFileName: (cssFileName: string) => void;Sets css file name for the application.
method setInBackground
setInBackground: (value: boolean, additonalData?: any) => void;method setLayoutDirection
protected setLayoutDirection: (value: CoreTypes.LayoutDirectionType) => void;method setMaxRefreshRate
setMaxRefreshRate: (options?: { min?: number; max?: number; preferred?: number;}) => void;iOS Only Dynamically change the preferred frame rate For devices (iOS 15+) which support min/max/preferred frame rate you can specify ranges For devices (iOS < 15), you can specify the max frame rate see: https://developer.apple.com/documentation/quartzcore/optimizing_promotion_refresh_rates_for_iphone_13_pro_and_ipad_pro To use, ensure your Info.plist has:
<key>CADisableMinimumFrameDurationOnPhone</key><true/>Parameter options
method setOrientation
protected setOrientation: (value: 'portrait' | 'landscape' | 'unknown') => void;method setResources
setResources: (res: any) => void;Set application level static resources.
method setSuspended
setSuspended: (value: boolean, additonalData?: any) => void;method setSystemAppearance
protected setSystemAppearance: (value: 'dark' | 'light') => void;method setWindowContentResolver
setWindowContentResolver: (resolver: WindowContentResolver | null) => void;Sets the callback that supplies the UI for windows that need content. Pass
nullto remove a previously set resolver.
method systemAppearance
systemAppearance: () => 'dark' | 'light' | null;Deprecated
Use Application.primaryWindow?.systemAppearance() - or the NativeWindow of the relevant view - instead. Continues to reflect the primary window.
method systemAppearanceChanged
systemAppearanceChanged: ( rootView: View, newSystemAppearance: 'dark' | 'light') => void;Updates root view classes including those of modals
Parameter rootView
the root view
Parameter newSystemAppearance
the new appearance change
class Background
class Background {}property borderBottomColor
borderBottomColor: Color;property borderBottomLeftRadius
borderBottomLeftRadius: number;property borderBottomRightRadius
borderBottomRightRadius: number;property borderBottomWidth
borderBottomWidth: number;property borderLeftColor
borderLeftColor: Color;property borderLeftWidth
borderLeftWidth: number;property borderRightColor
borderRightColor: Color;property borderRightWidth
borderRightWidth: number;property borderTopColor
borderTopColor: Color;property borderTopLeftRadius
borderTopLeftRadius: number;property borderTopRightRadius
borderTopRightRadius: number;property borderTopWidth
borderTopWidth: number;property boxShadows
boxShadows: BoxShadow[];property clearFlags
clearFlags: number;property clipPath
clipPath: string | ClipPathFunction;property color
color: Color;property cornerShape
cornerShape: CoreTypes.CornerShapeType;property default
static default: Background;property image
image: string | LinearGradient;property position
position: string;property repeat
repeat: CoreTypes.BackgroundRepeatType;property size
size: string;method equals
static equals: (value1: Background, value2: Background) => boolean;method getBoxShadows
getBoxShadows: () => BoxShadow[];method getUniformBorderColor
getUniformBorderColor: () => Color;method getUniformBorderRadius
getUniformBorderRadius: () => number;method getUniformBorderWidth
getUniformBorderWidth: () => number;method hasBorder
hasBorder: () => boolean;method hasBorderColor
hasBorderColor: () => boolean;method hasBorderRadius
hasBorderRadius: () => boolean;method hasBorderWidth
hasBorderWidth: () => boolean;method hasBoxShadows
hasBoxShadows: () => boolean;method hasUniformBorder
hasUniformBorder: () => boolean;method hasUniformBorderColor
hasUniformBorderColor: () => boolean;method hasUniformBorderRadius
hasUniformBorderRadius: () => boolean;method hasUniformBorderWidth
hasUniformBorderWidth: () => boolean;method isEmpty
isEmpty: () => boolean;method toString
toString: () => string;method withBorderBottomColor
withBorderBottomColor: (value: Color) => Background;method withBorderBottomLeftRadius
withBorderBottomLeftRadius: (value: number) => Background;method withBorderBottomRightRadius
withBorderBottomRightRadius: (value: number) => Background;method withBorderBottomWidth
withBorderBottomWidth: (value: number) => Background;method withBorderLeftColor
withBorderLeftColor: (value: Color) => Background;method withBorderLeftWidth
withBorderLeftWidth: (value: number) => Background;method withBorderRightColor
withBorderRightColor: (value: Color) => Background;method withBorderRightWidth
withBorderRightWidth: (value: number) => Background;method withBorderTopColor
withBorderTopColor: (value: Color) => Background;method withBorderTopLeftRadius
withBorderTopLeftRadius: (value: number) => Background;method withBorderTopRightRadius
withBorderTopRightRadius: (value: number) => Background;method withBorderTopWidth
withBorderTopWidth: (value: number) => Background;method withBoxShadows
withBoxShadows: (value: BoxShadow[]) => Background;method withClipPath
withClipPath: (value: string | ClipPathFunction) => Background;method withColor
withColor: (value: Color) => Background;method withCornerShape
withCornerShape: (value: CoreTypes.CornerShapeType) => Background;method withImage
withImage: (value: string | LinearGradient) => Background;method withPosition
withPosition: (value: string) => Background;method withRepeat
withRepeat: (value: CoreTypes.BackgroundRepeatType) => Background;method withSize
withSize: (value: string) => Background;class Binding
class Binding {}constructor
constructor(target: ViewBase, options: BindingOptions);property options
options: BindingOptions;property sourceIsBindingContext
sourceIsBindingContext: boolean;property target
target: WeakRef<ViewBase>;property updating
updating: boolean;method bind
bind: (source: any) => void;method clearBinding
clearBinding: () => void;method clearSource
clearSource: () => void;method loadedHandlerVisualTreeBinding
loadedHandlerVisualTreeBinding: (args: any) => void;method onSourcePropertyChanged
onSourcePropertyChanged: (data: PropertyChangeData) => void;method unbind
unbind: () => void;class Builder
class Builder {}property knownCollections
static knownCollections: Set<string>;property knownMultiTemplates
static knownMultiTemplates: Set<string>;property knownTemplates
static knownTemplates: Set<string>;UI plugin developers can add to these to define their own custom types if needed
method createViewFromEntry
static createViewFromEntry: (entry: ViewEntry) => View;Creates view from navigation entry
Parameter entry
NavigationEntry
method load
static load: (pathOrOptions: string | LoadOptions, context?: any) => View;Loads component from module with context
Parameter moduleName
the module name
Parameter exports
the context of the component to be loaded
method parse
static parse: (value: string | Template, context?: any) => View;method parseMultipleTemplates
static parseMultipleTemplates: ( value: string, context: any) => Array<KeyedTemplate>;Creates an array of KeyedTemplates from string
Parameter value
The xml of the template to be parsed
Parameter exports
Current context of the template
class Button
class Button extends TextBase {}Represents a standard Button widget.
Button
property android
android: any;Gets the native [android widget](http://developer.android.com/reference/android/widget/Button.html) that represents the user interface for this component. Valid only when running on Android OS.
property ios
ios: any;Gets the native [UIButton](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIButton_Class/) that represents the user interface for this component. Valid only when running on iOS.
property tapEvent
static tapEvent: string;String value used when hooking to tap event.
{EventData} tap
property textWrap
textWrap: boolean;Gets or sets whether the Button wraps text or not.
method on
on: { ( eventName: string, callback: (data: EventData) => void, thisArg?: any ): void; (event: 'tap', callback: (args: EventData) => void, thisArg?: any): void;};Adds a listener for the specified event name.
Parameter eventName
The name of the event.
Parameter callback
The event listener to add. Will be called when an event of the given name is raised.
Parameter thisArg
An optional parameter which, when set, will be bound as the
thiscontext when the callback is called. Falsy values will be not be bound.Raised when a tap event occurs.
class ChangeType
class ChangeType {}class CoercibleProperty
class CoercibleProperty<T extends ViewBase, U> extends Property<T, U> implements CoercibleProperty<T, U> {}constructor
constructor(options: CoerciblePropertyOptions<T, U>);property coerce
readonly coerce: (target: T) => void;class Color
class Color {}Represents a color object. Stores all color components (alpha (opacity), red, green, blue) in a [0..255] range.
constructor
constructor(knownColor: string);constructor
constructor(hex: string);constructor
constructor(argb: number);constructor
constructor( alpha: number, red: number, green: number, blue: number, type?: 'rgb' | 'hsl' | 'hsv');property a
a: number;Gets the Alpha component (in the [0, 255] range) of this color. This is a read-only property.
property android
android: number;Gets the android-specific integer value representation. Same as the Argb one. This is a read-only property.
property argb
argb: number;Gets the Argb Number representation of this color where each 8 bits represent a single color component. This is a read-only property.
property b
b: number;Gets the Blue component (in the [0, 255] range) of this color. This is a read-only property.
property g
g: number;Gets the Green component (in the [0, 255] range) of this color. This is a read-only property.
property hex
hex: string;Gets the Hexadecimal string representation of this color. This is a read-only property.
property ios
ios: any;Gets the iOS-specific UIColor value representation. This is a read-only property.
property name
name: string;Gets the known name of this instance. Defined only if it has been constructed from a known color name - e.g. "red". This is a read-only property.
property r
r: number;Gets the Red component (in the [0, 255] range) of this color. This is a read-only property.
method brighten
brighten: (amount: number) => Color;Brighten the color a given amount, from 0 to 100.
Parameter amount
(between 0 and 100)
method complement
complement: () => Color;returns the color complement
method darken
darken: (amount: number) => Color;Darken the color a given amount, from 0 to 100. Providing 100 will always return black.
Parameter amount
(between 0 and 100)
method desaturate
desaturate: (amount: number) => Color;Desaturate the color a given amount, from 0 to 100. Providing 100 will is the same as calling greyscale.
Parameter amount
(between 0 and 100)
method equals
static equals: (value1: Color, value2: Color) => boolean;Specifies whether this Color is equal to the Color parameter.
Parameter value
The Color to test.
Compares two Color instances.
Parameter value1
A Color to compare.
Parameter value2
A Color to compare.
method fromHSL
static fromHSL: (a: any, h: any, s: any, l: any) => Color;returns a new Color from HSL
method fromHSV
static fromHSV: (a: any, h: any, s: any, l: any) => Color;method fromIosColor
static fromIosColor: (value: any) => Color;Creates color from iOS-specific UIColor value representation.
method getBrightness
getBrightness: () => number;return the [brightness](http://www.w3.org/TR/AERT#color-contrast)
method getLuminance
getLuminance: () => number;return the [luminance](http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef)
method greyscale
greyscale: () => Color;Completely desaturates a color into greyscale. Same as calling desaturate(100).
Returns
method isDark
isDark: () => boolean;return true if brightenss < 128
method isLight
isLight: () => boolean;return true if brightenss >= 128
method isValid
static isValid: (value: any) => boolean;Validates if a value can be converted to color.
Parameter value
Input string.
method lighten
lighten: (amount: number) => Color;Lighten the color a given amount, from 0 to 100. Providing 100 will always return white.
Parameter amount
(between 0 and 100)
Returns
olor : Color
method mix
static mix: (color1: Color, color2: Color, amount: number) => Color;returns the color complement
method saturate
saturate: (amount: number) => Color;Saturate the color a given amount, from 0 to 100.
Parameter amount
(between 0 and 100)
method setAlpha
setAlpha: (a: number) => Color;Return this color (as a new Color instance) with the provided alpha
Parameter alpha
(between 0 and 255)
method spin
spin: (amount: number) => Color;Spin the hue a given amount, from -360 to 360. Calling with 0, 360, or -360 will do nothing (since it sets the hue back to what it was before).
Parameter amount
(between 0 and 100)
method toHsl
toHsl: () => { h: number; s: number; l: number; a: number };return the hsl representation of the color
method toHslString
toHslString: () => string;return the [CSS hsv](https://www.w3schools.com/Css/css_colors_hsl.asp) representation of the color
method toHsv
toHsv: () => { h: number; s: number; v: number; a: number };return the hsv representation of the color
method toHsvString
toHsvString: () => string;return the [CSS hsv](https://www.w3schools.com/Css/css_colors_rgb.asp) representation of the color
method toRgbString
toRgbString: () => string;return the [CSS rgb](https://www.w3schools.com/Css/css_colors_rgb.asp) representation of the color
class ContainerView
class ContainerView extends View {}Base class for all UI components that are containers.
property iosOverflowSafeArea
iosOverflowSafeArea: boolean;Instruct container view to expand beyond the safe area. This property is iOS specific. Default value: true
class ContentView
class ContentView extends CustomLayoutView implements AddChildFromBuilder {}ContentView
property content
content: View;Gets or sets the single child of the view.
method layoutView
layoutView: () => View;class ControlStateChangeListener
class ControlStateChangeListener {}An utility class used for supporting styling infrastructure. WARNING: This class is intended for IOS only.
constructor
constructor( control: any, states: string[], callback: ControlStateChangeListenerCallback);Initializes an instance of ControlStateChangeListener class.
Parameter control
An instance of the UIControl which state will be watched.
Parameter callback
A callback called when a visual state of the UIControl is changed.
method start
start: () => any;method stop
stop: () => any;class CssAnimationParser
class CssAnimationParser {}method keyframeAnimationsFromCSSDeclarations
static keyframeAnimationsFromCSSDeclarations: ( declarations: KeyframeDeclaration[]) => KeyframeAnimationInfo[];method keyframesArrayFromCSS
static keyframesArrayFromCSS: (keyframes: UnparsedKeyframe[]) => KeyframeInfo[];class CssAnimationProperty
class CssAnimationProperty<T extends Style, U> implements CssAnimationProperty<T, U> {}constructor
constructor(options: CssAnimationPropertyOptions<T, U>);property cssLocalName
readonly cssLocalName: string;property cssName
readonly cssName: string;property defaultValue
readonly defaultValue: {};property defaultValueKey
readonly defaultValueKey: Symbol;property getDefault
readonly getDefault: Symbol;property isStyleProperty
isStyleProperty: boolean;property key
readonly key: Symbol;property keyframe
readonly keyframe: string;property name
readonly name: string;property register
readonly register: (cls: { prototype: any }) => void;property setNative
readonly setNative: Symbol;method isSet
isSet: (instance: T) => boolean;class CssProperty
class CssProperty<T extends Style, U> {}constructor
constructor(options: CssPropertyOptions<T, U>);property cssLocalName
readonly cssLocalName: string;property cssName
readonly cssName: string;property cssValueDescriptor
protected readonly cssValueDescriptor: PropertyDescriptor;property defaultValue
readonly defaultValue: {};property defaultValueKey
readonly defaultValueKey: Symbol;property getDefault
readonly getDefault: Symbol;property isStyleProperty
isStyleProperty: boolean;property key
readonly key: Symbol;property localValueDescriptor
protected readonly localValueDescriptor: PropertyDescriptor;property name
readonly name: string;property overrideHandlers
overrideHandlers: (options: CssPropertyOptions<T, U>) => void;property setNative
readonly setNative: Symbol;property sourceKey
readonly sourceKey: Symbol;method isSet
isSet: (instance: T) => boolean;method register
register: (cls: { prototype: T }) => void;class CustomLayoutView
class CustomLayoutView extends ContainerView {}Base class for all UI components that implement custom layouts.
class DatePicker
class DatePicker extends View {}Represents an date picker.
DatePicker
property android
android: any;Gets the native [android.widget.DatePicker](http://developer.android.com/reference/android/widget/DatePicker.html) that represents the user interface for this component. Valid only when running on Android OS.
property date
date: Date;Gets or sets the entire date.
property dateChangeEvent
static dateChangeEvent: string;String value used when hooking to dateChange event.
{PropertyChangeData} dateChange
property day
day: number;Gets or sets the day. The days start from 1.
property ios
ios: any;Gets the native iOS [UIDatePicker](http://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UIDatePicker_Class/index.html) that represents the user interface for this component. Valid only when running on iOS.
property iosPreferredDatePickerStyle
iosPreferredDatePickerStyle: number;Gets or set the UIDatePickerStyle of the date picker in iOS 13.4+. Defaults to 0. Valid values are numbers: - 0: automatic (system picks the concrete style based on the current platform and date picker mode) - 1: wheels (the date picker displays as a wheel picker) - 2: compact (the date picker displays as a label that when tapped displays a calendar-style editor) - 3: inline (the date pickers displays as an inline, editable field)
property maxDate
maxDate: Date;Gets or sets the max date.
property minDate
minDate: Date;Gets or sets the min date.
property month
month: number;Gets or sets the month. The months start from 1.
property showTime
showTime: boolean;Gets or sets whether the time should be shown.
property year
year: number;Gets or sets the year.
class DockLayout
class DockLayout extends LayoutBase {}A Layout that arranges its children at its outer edges, and allows its last child to take up the remaining space.
DockLayout
property stretchLastChild
stretchLastChild: boolean;Gets or sets a value that indicates whether the last child element within a DockLayout stretches to fill the remaining available space. The default value is true.
method getDock
static getDock: (view: View) => CoreTypes.DockType;Gets the value of the Dock property from a given View.
method setDock
static setDock: (view: View, value: CoreTypes.DockType) => void;Sets the value of the Dock property from a given View.
class EditableTextBase
class EditableTextBase extends TextBase {}Represents the base class for all editable text views.
EditableTextBase
property autocapitalizationType
autocapitalizationType: CoreTypes.AutocapitalizationInputType;Gets or sets the autocapitalization type.
property autocorrect
autocorrect: boolean;Enables or disables autocorrection.
property autofillType
autofillType: string;Gets or sets the autofill type.
property blurEvent
static blurEvent: string;String value used when hooking to the blur event.
blurEvent
property editable
editable: boolean;Gets or sets whether the instance is editable.
property focusEvent
static focusEvent: string;String value used when hooking to the focus event.
focusEvent
property hint
hint: string;Gets or sets the placeholder text.
property keyboardType
keyboardType: CoreTypes.KeyboardInputType;Gets or sets the soft keyboard type.
property maxLength
maxLength: number;Limits input to a certain number of characters.
property placeholderColor
placeholderColor: Color;Gets or sets the color of the placeholder text
property returnKeyType
returnKeyType: CoreTypes.ReturnKeyButtonType;Gets or sets the soft keyboard return key flavor.
property textChangeEvent
static textChangeEvent: string;String value used when hooking to the textChange event.
{PropertyChangeData} textChangeEvent
property updateTextTrigger
updateTextTrigger: CoreTypes.UpdateTextTriggerType;Gets or sets a value indicating when the text property will be updated.
property valueFormatter
valueFormatter: (value: string) => string;Format input values Note: useful for input masking/formatting
method dismissSoftInput
dismissSoftInput: () => void;Hides the soft input method, ususally a soft keyboard.
method setSelection
setSelection: (start: number, stop?: number) => any;Set the selection anchor to start and the selection edge to stop
class FadeTransition
class FadeTransition extends Transition {}class File
class File extends FileSystemEntity {}Represents a File entity on the file system.
property android
static readonly android: Android;property extension
extension: string;Gets the extension of the file.
property ios
static readonly ios: iOS;property isLocked
isLocked: boolean;Gets a value indicating whether the file is currently locked, meaning a background operation associated with this file is running.
property size
size: number;Gets the size in bytes of the file.
method append
append: (content: any) => Promise<void>;Appends the provided binary content to the file.
Parameter content
The binary content to be saved to the file.
method appendSync
appendSync: (content: any, onError?: (error: any) => any) => void;Appends the provided binary content to the file synchronously.
Parameter content
The binary content to be saved to the file.
Parameter onError
An optional function to be called if some IO-error occurs.
method appendText
appendText: (content: string, encoding?: string) => Promise<any>;Appends the provided string to the file, using the specified encoding (defaults to UTF-8).
Parameter content
The content to be saved to the file.
Parameter encoding
An optional value specifying the preferred encoding (defaults to UTF-8).
method appendTextSync
appendTextSync: ( content: string, onError?: (error: any) => any, encoding?: string) => void;Appends the provided string to the file synchronously, using the specified encoding (defaults to UTF-8).
Parameter content
The content to be saved to the file.
Parameter onError
An optional function to be called if some IO-error occurs.
Parameter encoding
An optional value specifying the preferred encoding (defaults to UTF-8).
method copy
copy: (dest: string) => Promise<boolean>;Copies a file to a given path.
Parameter dest
The path to the destination file. Returns a Promise with a boolean.
method copySync
copySync: (dest: string, onError?: (error: any) => any) => any;Copies a file to a given path.
Parameter dest
The path to the destination file.
Parameter onError
(optional) A callback function to use if any error occurs. Returns a Promise with a boolean.
method exists
static exists: (path: string) => boolean;Checks whether a File with the specified path already exists.
Parameter path
The path to check for.
method fromPath
static fromPath: (path: string, copy?: boolean) => File;Gets or creates a File entity at the specified path.
Parameter path
The path to get/create the file at.
Parameter copy
An optional value when set, copies the content-uri to a temp file enabling the legacy behaviour
method read
read: () => Promise<any>;Reads the binary content of the file asynchronously.
method readSync
readSync: (onError?: (error: any) => any) => any;Reads the binary content of the file synchronously.
Parameter onError
An optional function to be called if some IO-error occurs.
method readText
readText: (encoding?: string) => Promise<string>;Reads the content of the file as a string using the specified encoding (defaults to UTF-8).
Parameter encoding
An optional value specifying the preferred encoding (defaults to UTF-8).
method readTextSync
readTextSync: (onError?: (error: any) => any, encoding?: string) => string;Reads the content of the file as a string synchronously, using the specified encoding (defaults to UTF-8).
Parameter onError
An optional function to be called if some IO-error occurs.
Parameter encoding
An optional value specifying the preferred encoding (defaults to UTF-8).
method write
write: (content: any) => Promise<void>;Writes the provided binary content to the file.
Parameter content
The binary content to be saved to the file.
method writeSync
writeSync: (content: any, onError?: (error: any) => any) => void;Writes the provided binary content to the file synchronously.
Parameter content
The binary content to be saved to the file.
Parameter onError
An optional function to be called if some IO-error occurs.
method writeText
writeText: (content: string, encoding?: string) => Promise<any>;Writes the provided string to the file, using the specified encoding (defaults to UTF-8).
Parameter content
The content to be saved to the file.
Parameter encoding
An optional value specifying the preferred encoding (defaults to UTF-8).
method writeTextSync
writeTextSync: ( content: string, onError?: (error: any) => any, encoding?: string) => void;Writes the provided string to the file synchronously, using the specified encoding (defaults to UTF-8).
Parameter content
The content to be saved to the file.
Parameter onError
An optional function to be called if some IO-error occurs.
Parameter encoding
An optional value specifying the preferred encoding (defaults to UTF-8).
class FileSystemEntity
class FileSystemEntity {}Represents a single entity on the file system.
property lastModified
lastModified: Date;Gets the Date object specifying the last time this entity was modified.
property name
name: string;Gets the name of the entity.
property parent
parent: Folder;Gets the Folder object representing the parent of this entity. Will be null for a root folder like Documents or Temporary. This property is readonly.
property path
path: string;Gets the fully-qualified path (including the extension for a File) of the entity.
method remove
remove: () => Promise<any>;Removes (deletes) the current Entity from the file system.
method removeSync
removeSync: (onError?: (error: any) => any) => void;Removes (deletes) the current Entity from the file system synchronously.
method rename
rename: (newName: string) => Promise<any>;Renames the current entity using the specified name.
Parameter newName
The new name to be applied to the entity.
method renameSync
renameSync: (newName: string, onError?: (error: any) => any) => void;Renames the current entity synchronously, using the specified name.
Parameter newName
The new name to be applied to the entity.
class FlexboxLayout
class FlexboxLayout extends LayoutBase {}FlexboxLayout
property alignContent
alignContent: AlignContent;Gets or sets alignment of items along the cross axis
property alignItems
alignItems: AlignItems;Gets or sets alignment of the childern on cross axis
property columnGap
columnGap: CoreTypes.LengthType;Gets or sets the gap between columns
property flexDirection
flexDirection: FlexDirection;Gets or set the direction of childern on the main axis.
property flexWrap
flexWrap: FlexWrap;Gets or sets whether children can wrap into multiple lines
property gap
gap: string | number | CoreTypes.LengthDipUnit | CoreTypes.LengthPxUnit;Gets or sets the gaps between rows and columns
property justifyContent
justifyContent: JustifyContent;Gets or sets alignment of childern on the main axis
property rowGap
rowGap: CoreTypes.LengthType;Gets or sets the gap between rows
method getAlignSelf
static getAlignSelf: (view: View) => AlignSelf;method getFlexGrow
static getFlexGrow: (view: View) => any;method getFlexShrink
static getFlexShrink: (view: View) => number;method getFlexWrapBefore
static getFlexWrapBefore: (view: View) => boolean;method getOrder
static getOrder: (view: View) => number;method setAlignSelf
static setAlignSelf: (view: View, align: AlignSelf) => any;method setFlexGrow
static setFlexGrow: (view: View, grow: number) => any;method setFlexShrink
static setFlexShrink: (view: View, shrink: number) => any;method setFlexWrapBefore
static setFlexWrapBefore: (view: View, wrap: boolean) => any;method setOrder
static setOrder: (view: View, order: number) => any;class Folder
class Folder extends FileSystemEntity {}Represents a Folder (directory) entity on the file system.
property isKnown
isKnown: boolean;Determines whether this instance is a KnownFolder (accessed through the KnownFolders object).
method clear
clear: () => Promise<any>;Deletes all the files and folders (recursively), contained within this Folder.
method clearSync
clearSync: (onError?: (error: any) => void) => void;Deletes all the files and folders (recursively), contained within this Folder synchronously.
Parameter onError
An optional function to be called if some error occurs.
method contains
contains: (name: string) => boolean;Checks whether this Folder contains an Entity with the specified name. The path of the folder is added to the name to resolve the complete path to check for.
Parameter name
The name of the entity to check for.
method eachEntity
eachEntity: (onEntity: (entity: FileSystemEntity) => boolean) => any;Enumerates all the top-level FileSystem entities residing within this folder.
Parameter onEntity
A callback that receives the current entity. If the callback returns false this will mean for the iteration to stop.
method exists
static exists: (path: string) => boolean;Checks whether a Folder with the specified path already exists.
Parameter path
The path to check for.
method fromPath
static fromPath: (path: string) => Folder;Gets or creates a Folder entity at the specified path.
Parameter path
The path to get/create the folder at.
method getEntities
getEntities: () => Promise<Array<FileSystemEntity>>;Gets all the top-level entities residing within this folder.
method getEntitiesSync
getEntitiesSync: (onError?: (error: any) => any) => Array<FileSystemEntity>;Gets all the top-level entities residing within this folder synchronously.
Parameter onError
An optional function to be called if some error occurs.
method getFile
getFile: (name: string) => File;Gets or creates a File entity with the specified name within this Folder.
Parameter name
The name of the file to get/create.
method getFolder
getFolder: (name: string) => Folder;Gets or creates a Folder entity with the specified name within this Folder.
Parameter name
The name of the folder to get/create.
class Font
class Font extends FontBase {}constructor
constructor( family: string, size: number, style?: FontStyleType, weight?: FontWeightType, scale?: number, fontVariationSettings?: FontVariationSettings[]);property default
static default: Font;property fontFamily
fontFamily: string;property fontScale
fontScale: number;property fontSize
fontSize: number;property fontStyle
fontStyle: FontStyleType;property fontVariationSettings
fontVariationSettings?: FontVariationSettingsType[];property fontWeight
fontWeight: FontWeightType;property isBold
isBold: boolean;property isItalic
isItalic: boolean;method equals
static equals: (value1: Font, value2: Font) => boolean;method getAndroidTypeface
getAndroidTypeface: () => any;method getUIFont
getUIFont: (defaultFont: any) => any;method withFontFamily
withFontFamily: (family: string) => Font;method withFontScale
withFontScale: (scale: number) => Font;method withFontSize
withFontSize: (size: number) => Font;method withFontStyle
withFontStyle: (style: FontStyleType) => Font;method withFontVariationSettings
withFontVariationSettings: (variationSettings: FontVariationSettings[]) => Font;method withFontWeight
withFontWeight: (weight: FontWeightType) => Font;class FormattedString
class FormattedString extends ViewBase {}A class used to create a formatted (rich text) string.
FormattedString
property backgroundColor
backgroundColor: Color;Gets or sets the font background color which will be used for all spans that doesn't have a specific value.
property color
color: Color;Gets or sets the font foreground color which will be used for all spans that doesn't have a specific value.
property fontFamily
fontFamily: string;Gets or sets the font family which will be used for all spans that doesn't have a specific value.
property fontSize
fontSize: number;Gets or sets the font size which will be used for all spans that doesn't have a specific value.
property fontStyle
fontStyle: FontStyleType;Gets or sets the font style which will be used for all spans that doesn't have a specific value.
property fontVariationSettings
fontVariationSettings: FontVariationSettingsType[];Gets or sets the font variation settings which will be used for all spans that doesn't have a specific value.
property fontWeight
fontWeight: FontWeightType;Gets or sets the font weight which will be used for all spans that doesn't have a specific value.
property iosAccessibilityAdjustsFontSize
iosAccessibilityAdjustsFontSize: boolean;Defines whether accessibility font scale should affect font size.
property iosAccessibilityMaxFontScale
iosAccessibilityMaxFontScale: number;Gets or sets the maximum accessibility font scale.
property iosAccessibilityMinFontScale
iosAccessibilityMinFontScale: number;Gets or sets the minimum accessibility font scale.
property spans
spans: ObservableArray<Span>;An observable collection of Span objects used to define common text properties.
property textDecoration
textDecoration: CoreTypes.TextDecorationType;Gets or sets text decorations which will be used for all spans that doesn't have a specific value.
method toString
toString: () => string;A human readable representation of the formatted string.
class Frame
class Frame extends FrameBase {}Represents the logical View unit that is responsible for navigation within an application. Nested frames are supported, enabling hierarchical navigation scenarios.
Frame
property actionBarVisibility
actionBarVisibility: 'auto' | 'always' | 'never';Used to control the visibility the Navigation Bar in iOS and the Action Bar in Android.
property android
android: AndroidFrame;Gets the AndroidFrame object that represents the Android-specific APIs for this Frame. Valid when running on Android OS.
property androidOptionSelectedEvent
static androidOptionSelectedEvent: string;String value used when hooking to OptionSelected event.
optionSelected
property animated
animated: boolean;Gets or sets if navigation transitions should be animated.
property backStack
backStack: BackstackEntry[];Gets the back stack of this instance.
property currentEntry
currentEntry: NavigationEntry;Gets the NavigationEntry instance the Frame is currently navigated to.
property currentPage
currentPage: Page;Gets the Page instance the Frame is currently navigated to.
property defaultAnimatedNavigation
static defaultAnimatedNavigation: boolean;Gets or sets if navigation transitions should be animated globally.
property defaultPage
defaultPage?: string;property defaultTransition
static defaultTransition: NavigationTransition;Gets or sets the default NavigationTransition for all frames across the app.
property ios
ios: iOSFrame;Gets the iOSFrame object that represents the iOS-specific APIs for this Frame. Valid when running on iOS.
property iosNavigationBarClass
iosNavigationBarClass?: any;Specify a custom UINavigationBar class (iOS only)
property iosToolbarClass
iosToolbarClass?: any;Specify a custom UIToolbar class (iOS only)
property navigatedToEvent
static navigatedToEvent: string;String value used when hooking to navigatedTo event.
{NavigationData} navigatedTo
property navigatingToEvent
static navigatingToEvent: string;String value used when hooking to navigatingTo event.
{NavigationData} navigatingTo
property navigationBarHeight
navigationBarHeight: number;property transition
transition: NavigationTransition;Gets or sets the default navigation transition for this frame.
method canGoBack
canGoBack: () => boolean;Checks whether the goBack operation is available.
method getFrameById
static getFrameById: (id: string) => Frame;Gets a frame by id.
method getNavigationQueueContextByEntry
getNavigationQueueContextByEntry: (entry: BackstackEntry) => NavigationContext;method goBack
static goBack: (frame?: Frame) => any;Navigates back using the navigation hierarchy (if any). Updates the Frame stack as needed. This method will start from the given Frame and will recursively search its ancestors for an instance that has the canGoBack operation available.
Parameter frame
The Frame to navigate back. Defaults to the topmost Frame; pass one to scope the back navigation to that Frame's hierarchy.
Navigates to the previous entry (if any) in the back stack.
Parameter to
The backstack entry to navigate back to.
method isCurrent
isCurrent: (entry: BackstackEntry) => boolean;Parameter entry
to check
method navigate
navigate: { (pageModuleName: string): any; (create: () => Page): any; (entry: NavigationEntry): any;};Navigates to a Page instance as described by the module name. This method will require the module and will check for a Page property in the exports of the module.
Parameter pageModuleName
The name of the module to require starting from the application root. For example if you want to navigate to page called "myPage.js" in a folder called "subFolder" and your root folder is "app" you can call navigate method like this: const frames = require("@nativescript/core/ui/frame"); frames.topmost().navigate("app/subFolder/myPage");
Creates a new Page instance using the provided callback and navigates to that Page.
Parameter create
The function to be used to create the new Page instance.
Navigates to a Page resolved by the provided NavigationEntry object. Since there are a couple of ways to specify a Page instance through an entry, there is a resolution priority: 1. entry.moduleName 2. entry.create()
Parameter entry
The NavigationEntry instance.
method navigationQueueIsEmpty
navigationQueueIsEmpty: () => boolean;method on
on: { ( eventName: string, callback: (args: EventData) => void, thisArg?: any ): void; ( event: 'navigatingTo', callback: (args: NavigationData) => void, thisArg?: any ): void; ( event: 'navigatedTo', callback: (args: NavigationData) => void, thisArg?: any ): void;};Adds a listener for the specified event name.
Parameter eventName
The name of the event.
Parameter callback
The event listener to add. Will be called when an event of the given name is raised.
Parameter thisArg
An optional parameter which, when set, will be bound as the
thiscontext when the callback is called. Falsy values will be not be bound.Raised when navigation to the page has started.
Raised when navigation to the page has finished.
method performNavigation
performNavigation: (navigationContext: NavigationContext) => void;Parameter navigationContext
method reloadPage
static reloadPage: (context?: ModuleContext) => void;method setCurrent
setCurrent: (entry: BackstackEntry, navigationType: NavigationType) => void;Parameter entry
to set as current
Parameter navigationType
method topmost
static topmost: (window?: WindowBase) => Frame;Gets the topmost frame of a window. An application will typically has one frame instance. Multiple frames handle nested (hierarchical) navigation scenarios.
The frame highest in the navigation stack wins outright while it belongs to no window -
navigate()puts a frame in the stack before it is attached to one, and scoping cannot place such a frame. Otherwise the frame highest in the stack that belongs to the resolved window is returned, falling back to the frame highest in the stack regardless of window when that window hosts none.Parameter window
The window to scope the lookup to. Defaults to
Application.activeWindow.
class GesturesObserver
class GesturesObserver {}Provides options for the GesturesObserver.
constructor
constructor( target: View, callback: (args: GestureEventData) => void, context: any);Creates an instance of GesturesObserver class.
Parameter target
The view for which the observer is created.
Parameter callback
A function that will be executed when a gesture is received.
Parameter context
default this argument for the callbacks.
property androidOnTouchEvent
androidOnTouchEvent: (motionEvent: any) => void;An internal Android specific method used to pass the motion event to the correct gesture observer.
property callback
callback: (args: GestureEventData) => void;A function that will be executed when a gesture is received.
property context
context: any;A context which will be used as
thisin callback execution.
property type
type: GestureTypes;Singular gesture type (e.g. GestureTypes.tap) attached to the observer. Does not support plural gesture types (e.g. GestureTypes.tap & GestureTypes.doubleTap).
method disconnect
disconnect: () => any;Disconnects the gesture observer.
method observe
observe: (type: GestureTypes) => any;Registers a gesture observer to a view and gesture.
Parameter type
Type of the gesture.
class GridLayout
class GridLayout extends LayoutBase {}Defines a rectangular layout area that consists of columns and rows.
GridLayout
property columns
columns: string;A string value representing column widths delimited with commas.
Valid values: an absolute number, auto, or *:
property rows
rows: string;A string value representing row heights delimited with commas.
Valid values: an absolute number, auto, or *:
method addChildAtCell
addChildAtCell: ( view: View, row: number, column: number, rowSpan?: number, columnSpan?: number) => void;Adds a child at specific cell in GridLayout. Optional rowSpan and columnSpan attributes
method addColumn
addColumn: (itemSpec: ItemSpec) => void;Adds a column specification to a GridLayout.
method addRow
addRow: (itemSpec: ItemSpec) => void;Adds a row specification to a GridLayout.
method getColumn
static getColumn: (view: View) => number;Gets the value of the Column attached property from a given View.
method getColumns
getColumns: () => Array<ItemSpec>;Gets array of column specifications defined on this instance of GridLayout.
method getColumnSpan
static getColumnSpan: (view: View) => number;Gets the value of the ColumnSpan attached property from a given View.
method getRow
static getRow: (view: View) => number;Gets the value of the Row attached property from a given View.
method getRows
getRows: () => Array<ItemSpec>;Gets array of row specifications defined on this instance of GridLayout.
method getRowSpan
static getRowSpan: (view: View) => number;Gets the value of the RowSpan attached property from a given View.
method removeColumn
removeColumn: (itemSpec: ItemSpec) => void;Removes a column specification from a GridLayout.
method removeColumns
removeColumns: () => void;Removes all column specifications from a GridLayout.
method removeRow
removeRow: (itemSpec: ItemSpec) => void;Removes a row specification from a GridLayout.
method removeRows
removeRows: () => void;Removes all row specifications from a GridLayout.
method setColumn
static setColumn: (view: View, value: number) => void;Sets the value of the Column attached property to a given View.
method setColumnSpan
static setColumnSpan: (view: View, value: number) => void;Sets the value of the ColumnSpan attached property to a given View.
method setRow
static setRow: (view: View, value: number) => void;Sets the value of the Row attached property to a given View.
method setRowSpan
static setRowSpan: (view: View, value: number) => void;Sets the value of the RowSpan attached property to a given View.
class HtmlView
class HtmlView extends View {}Represents a view with html content. Use this component instead WebView when you want to show just static HTML content. [iOS support](https://developer.apple.com/documentation/foundation/nsattributedstring/1524613-initwithdata) [android support](http://developer.android.com/reference/android/text/Html.html)
HtmlView
property android
android: any;Gets the native [android widget](http://developer.android.com/reference/android/widget/TextView.html) that represents the user interface for this component. Valid only when running on Android OS.
property html
html: string;Gets or sets html string for the HtmlView.
property ios
ios: any;Gets the native [UITextView](https://developer.apple.com/documentation/uikit/uitextview) that represents the user interface for this component. Valid only when running on iOS.
property linkColor
linkColor: Color;Gets of sets color of links in the rendered HTML.
property selectable
selectable: boolean;Gets or sets a value indicating whether HtmlView is selectable.
class Image
class Image extends View {}Represents a class that provides functionality for loading and streching image(s).
Image
property android
android: any;Gets the native [android widget](http://developer.android.com/reference/android/widget/ImageView.html) that represents the user interface for this component. Valid only when running on Android OS.
property decodeHeight
decodeHeight: CoreTypes.LengthType;Gets or sets the desired decode height of the image. This property is Android specific.
property decodeWidth
decodeWidth: CoreTypes.LengthType;Gets or sets the desired decode width of the image. This property is Android specific.
property imageSource
imageSource: ImageSource;Gets or sets the image source of the image.
property ios
ios: any;Gets the native iOS [UIImageView](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIImageView_Class/) that represents the user interface for this component. Valid only when running on iOS.
property iosSymbolEffect
iosSymbolEffect: ImageSymbolEffect | ImageSymbolEffects;Get or set the symbol effect used to animate the SF symbol image Symbol effects: https://developer.apple.com/documentation/symbols?language=objc
property iosSymbolScale
iosSymbolScale: iosSymbolScaleType;Get or set the SF Symbol scale to use.
property isLoading
readonly isLoading: boolean;Gets a value indicating if the image is currently loading.
property isLoadingChangeEvent
static isLoadingChangeEvent: string;String value used when hooking to the isLoadingChange event.
{PropertyChangeData} isLoading
property loadMode
loadMode: 'sync' | 'async';Gets or sets the loading strategy for images on the local file system: - **sync** - blocks the UI if necessary to display immediately, good for small icons. - **async** *(default)* - will load in the background, may appear with short delay, good for large images. When loading images from web they are always loaded **async** no matter of loadMode value.
property src
src: string | ImageSource | ImageAsset;Gets or sets the source of the Image. This can be either an URL string or a native image instance.
property stretch
stretch: CoreTypes.ImageStretchType;Gets or sets the image stretch mode.
property tintColor
tintColor: Color;A color used to tint template images.
class ImageAsset
class ImageAsset extends Observable {}constructor
constructor(asset: any);property android
android: any;property ios
ios: any;property nativeImage
nativeImage: any;property options
options: ImageAssetOptions;method getImageAsync
getImageAsync: (callback: (image: any, error: any) => void) => any;class ImageCache
class Cache extends Observable {}Represents a class that stores handles image download requests and caches the already downloaded images.
property downloadedEvent
static downloadedEvent: string;String value used when hooking to downloaded event.
property downloadErrorEvent
static downloadErrorEvent: string;String value used when hooking to download error event.
property maxRequests
maxRequests: number;The maximum number of simultaneous download requests. Defaults to 5.
property placeholder
placeholder: ImageSource;The image to be used to notify for a pending download request - e.g. loading indicator.
method clear
clear: () => void;Removes all the previously cached images.
method disableDownload
disableDownload: () => void;Temporary disables download requests.
method enableDownload
enableDownload: () => void;Enables previously suspended download requests.
method enqueue
enqueue: (request: DownloadRequest) => any;Adds a new download request at the end of the download queue. This will be the last download to start.
method get
get: (key: string) => any;Gets the image for the specified key. May be undefined if the key is not present in the cache.
method on
on: { ( eventName: string, callback: (args: EventData) => void, thisArg?: any ): void; ( event: 'downloaded', callback: (args: DownloadedData) => void, thisArg?: any ): void; ( event: 'downloadError', callback: (args: DownloadError) => void, thisArg?: any ): void;};Adds a listener for the specified event name.
Parameter eventName
The name of the event.
Parameter callback
The event listener to add. Will be called when an event of the given name is raised.
Parameter thisArg
An optional parameter which, when set, will be bound as the
thiscontext when the callback is called. Falsy values will be not be bound.Raised when the image has been downloaded.
Raised if the image download errors.
method push
push: (request: DownloadRequest) => any;Adds a new download request at the top of the download queue. This will be the next immediate download to start.
method remove
remove: (key: string) => void;Removes the cache for the specified key.
method set
set: (key: string, image: any) => void;Sets the image for the specified key.
class ImageSource
class ImageSource {}Encapsulates the common abstraction behind a platform specific object (typically a Bitmap) that is used as a source for images.
constructor
constructor(nativeSource?: any);Creates a new ImageSource instance and sets the provided native source object (typically a Bitmap). The native source object will update either the android or ios properties, depending on the target os.
Parameter nativeSource
The native image object. Will be either a Bitmap for Android or a UIImage for iOS.
property android
android: any;The Android-specific [image](http://developer.android.com/reference/android/graphics/Bitmap.html) instance. Will be undefined when running on iOS.
property height
height: number;Gets the height of this instance. This is a read-only property.
property ios
ios: any;The iOS-specific [UIImage](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIImage_Class/) instance. Will be undefined when running on Android.
property rotationAngle
rotationAngle: number;Gets or sets the rotation angle that should be applied to the image. (Used in android)
property width
width: number;Gets the width of this instance. This is a read-only property.
method fromAsset
static fromAsset: (asset: ImageAsset) => Promise<ImageSource>;Loads this instance from the specified asset asynchronously.
Parameter asset
The ImageAsset instance used to create ImageSource.
Parameter asset
The ImageAsset instance used to create ImageSource.
Deprecated
Use ImageSource.fromAsset() instead. Loads this instance from the specified asset asynchronously.
method fromBase64
static fromBase64: (source: string) => Promise<ImageSource>;Loads this instance from the specified base64 encoded string asynchronously.
Parameter source
The Base64 string to load the image from.
Parameter source
The Base64 string to load the image from.
Deprecated
Use ImageSource.fromBase64() instead. Loads this instance from the specified base64 encoded string asynchronously.
method fromBase64Sync
static fromBase64Sync: (source: string) => ImageSource;Loads this instance from the specified base64 encoded string.
Parameter source
The Base64 string to load the image from.
method fromData
static fromData: (data: any) => Promise<ImageSource>;Loads this instance from the specified native image data asynchronously.
Parameter data
The native data (byte array) to load the image from. This will be either Stream for Android or NSData for iOS.
Parameter data
The native data (byte array) to load the image from. This will be either Stream for Android or NSData for iOS.
Deprecated
Use ImageSource.fromData() instead. Loads this instance from the specified native image data asynchronously.
method fromDataSync
static fromDataSync: (data: any) => ImageSource;Loads this instance from the specified native image data.
Parameter data
The native data (byte array) to load the image from. This will be either Stream for Android or NSData for iOS.
method fromFile
static fromFile: (path: string) => Promise<ImageSource>;Loads this instance from the specified file asynchronously.
Parameter path
The location of the file on the file system.
Parameter path
The location of the file on the file system.
Deprecated
Use ImageSource.fromFile() instead. Loads this instance from the specified file asynchronously.
method fromFileOrResourceSync
static fromFileOrResourceSync: (path: string) => ImageSource;Creates a new ImageSource instance and loads it from the specified local file or resource (if specified with the "res://" prefix).
Parameter path
The location of the file on the file system.
method fromFileSync
static fromFileSync: (path: string) => ImageSource;Loads this instance from the specified file.
Parameter path
The location of the file on the file system.
method fromFontIconCodeSync
static fromFontIconCodeSync: ( source: string, font: Font, color: Color) => ImageSource;Creates a new ImageSource instance and loads it from the specified font icon code.
Parameter source
The hex font icon code string
Parameter font
The font for the corresponding font icon code
Parameter color
The color of the generated icon image
method fromResource
static fromResource: (name: string) => Promise<ImageSource>;Loads this instance from the specified resource name asynchronously.
Parameter name
The name of the resource (without its extension).
Parameter name
The name of the resource (without its extension).
Deprecated
Use ImageSource.fromResource() instead. Loads this instance from the specified resource name asynchronously.
method fromResourceSync
static fromResourceSync: (name: string) => ImageSource;Loads this instance from the specified resource name.
Parameter name
The name of the resource (without its extension).
method fromSystemImage
static fromSystemImage: ( name: string, instance?: ImageBase) => Promise<ImageSource>;Loads this instance from the specified system image name asynchronously.
Parameter name
the name of the system image
method fromSystemImageSync
static fromSystemImageSync: (name: string, instance?: ImageBase) => ImageSource;Loads this instance from the specified system image name.
Parameter name
the name of the system image
method fromUrl
static fromUrl: (url: string) => Promise<ImageSource>;Downloads the image from the provided Url and creates a new ImageSource instance from it.
Parameter url
The link to the remote image object. This operation will download and decode the image.
method getNativeSource
getNativeSource: () => any;Gets the native source object (typically a Bitmap or a UIImage).
method iosSymbolScaleFor
static iosSymbolScaleFor: (scale: iosSymbolScaleType) => number;(iOS only) Get system symbol scale
Parameter scale
symbol scale type
method loadFromBase64
loadFromBase64: (source: string) => boolean;Parameter source
The Base64 string to load the image from.
Deprecated
Use ImageSource.fromBase64Sync() instead. Loads this instance from the specified base64 encoded string.
method loadFromData
loadFromData: (data: any) => boolean;Parameter data
The native data (byte array) to load the image from. This will be either Stream for Android or NSData for iOS.
Deprecated
Use ImageSource.fromDataSync() instead. Loads this instance from the specified native image data.
method loadFromFile
loadFromFile: (path: string) => boolean;Parameter path
The location of the file on the file system.
Deprecated
Use ImageSource.fromFileSync() instead. Loads this instance from the specified file.
method loadFromFontIconCode
loadFromFontIconCode: (source: string, font: Font, color: Color) => boolean;Parameter source
The hex font icon code string
Parameter font
The font for the corresponding font icon code
Parameter color
The color of the generated icon image
Deprecated
Use ImageSource.fromFontIconCode() instead. Loads this instance from the specified font icon code.
method loadFromResource
loadFromResource: (name: string) => boolean;Parameter name
The name of the resource (without its extension).
Deprecated
Use ImageSource.fromResourceSync() instead. Loads this instance from the specified resource name.
method resize
resize: (maxSize: number, options?: any) => ImageSource;Returns a new ImageSource that is a resized version of this image with the same aspect ratio, but the max dimension set to the provided maxSize.
Parameter maxSize
The maximum pixel dimension of the resulting image.
Parameter options
Optional parameter, Only used for android, options.filter is a boolean which determines whether or not bilinear filtering should be used when scaling the bitmap. If this is true then bilinear filtering will be used when scaling which has better image quality at the cost of worse performance. If this is false then nearest-neighbor scaling is used instead which will have worse image quality but is faster. Recommended default is to set filter to 'true' as the cost of bilinear filtering is typically minimal and the improved image quality is significant.
method resizeAsync
resizeAsync: (maxSize: number, options?: any) => Promise<ImageSource>;Returns a new ImageSource that is a resized version of this image with the same aspect ratio, but the max dimension set to the provided maxSize asynchronously.
Parameter maxSize
The maximum pixel dimension of the resulting image.
Parameter options
Optional parameter, Only used for android, options.filter is a boolean which determines whether or not bilinear filtering should be used when scaling the bitmap. If this is true then bilinear filtering will be used when scaling which has better image quality at the cost of worse performance. If this is false then nearest-neighbor scaling is used instead which will have worse image quality but is faster. Recommended default is to set filter to 'true' as the cost of bilinear filtering is typically minimal and the improved image quality is significant.
method saveToFile
saveToFile: ( path: string, format: 'png' | 'jpeg' | 'jpg', quality?: number) => boolean;Saves this instance to the specified file, using the provided image format and quality.
Parameter path
The path of the file on the file system to save to.
Parameter format
The format (encoding) of the image.
Parameter quality
Optional parameter, specifying the quality of the encoding. Defaults to the maximum available quality. Quality varies on a scale of 0 to 100.
method saveToFileAsync
saveToFileAsync: ( path: string, format: 'png' | 'jpeg' | 'jpg', quality?: number) => Promise<boolean>;Saves this instance to the specified file, using the provided image format and quality asynchronously.
Parameter path
The path of the file on the file system to save to.
Parameter format
The format (encoding) of the image.
Parameter quality
Optional parameter, specifying the quality of the encoding. Defaults to the maximum available quality. Quality varies on a scale of 0 to 100.
method setNativeSource
setNativeSource: (nativeSource: any) => void;Sets the provided native source object (typically a Bitmap or a UIImage). This will update either the android or ios properties, depending on the target os.
Parameter nativeSource
The native image object. Will be either a Bitmap for Android or a UIImage for iOS.
method toBase64String
toBase64String: (format: 'png' | 'jpeg' | 'jpg', quality?: number) => string;Converts the image to base64 encoded string, using the provided image format and quality.
Parameter format
The format (encoding) of the image.
Parameter quality
Optional parameter, specifying the quality of the encoding. Defaults to the maximum available quality. Quality varies on a scale of 0 to 100.
method toBase64StringAsync
toBase64StringAsync: ( format: 'png' | 'jpeg' | 'jpg', quality?: number) => Promise<string>;Converts the image to base64 encoded string, using the provided image format and quality asynchronously.
Parameter format
The format (encoding) of the image.
Parameter quality
Optional parameter, specifying the quality of the encoding. Defaults to the maximum available quality. Quality varies on a scale of 0 to 100.
class ImageSymbolEffect
class ImageSymbolEffect {}iOS only Symbol effects: https://developer.apple.com/documentation/symbols?language=objc
constructor
constructor(symbol: NSSymbolEffect);property completion
completion?: (context: UISymbolEffectCompletionContext) => void;property effect
effect?: NSSymbolEffect;property options
options?: NSSymbolEffectOptions;method fromSymbol
static fromSymbol: (symbol: string) => ImageSymbolEffect | null;class InheritedCssProperty
class InheritedCssProperty<T extends Style, U> extends CssProperty<T, U> implements InheritedCssProperty<T, U> {}constructor
constructor(options: CssPropertyOptions<T, U>);property setInheritedValue
setInheritedValue: (value: U) => void;class InheritedProperty
class InheritedProperty<T extends ViewBase, U> extends Property<T, U> implements InheritedProperty<T, U> {}constructor
constructor(options: PropertyOptions<T, U>);property setInheritedValue
readonly setInheritedValue: (value: U) => void;property sourceKey
readonly sourceKey: Symbol;class iOSApplication
class iOSApplication extends ApplicationCommon {}property delegate
delegate: any;The [UIApplicationDelegate](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIApplicationDelegate_Protocol/index.html) class.
property nativeApp
readonly nativeApp: UIApplication;The [UIApplication](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIApplication_Class/index.html).
property on
on: IOSApplicationOn;property onSceneConfiguration
onSceneConfiguration: ( application: UIApplication, connectingSceneSession: UISceneSession, options: UISceneConnectionOptions) => UISceneConfiguration | null | undefined;Register a callback to intercept scene configuration.
Called for every new scene session. Return a
UISceneConfigurationto handle the scene yourself (e.g. CarPlay, external display), or returnnull/undefinedto let NativeScript handle it with the default SceneDelegate.NativeScript only auto-manages
UIWindowSceneSessionRoleApplicationscenes. All other scene roles are ignored unless you provide a configuration here.Example 1
Application.ios.onSceneConfiguration = (app, session, options) => {if (session.role === CPTemplateApplicationSceneSessionRoleApplication) {const config = UISceneConfiguration.configurationWithNameSessionRole('CarPlay', session.role);config.delegateClass = MyCarPlaySceneDelegate;return config;}return null;};
property rootController
readonly rootController: UIViewController;The root view controller for the application.
property sceneDelegate
sceneDelegate: UIWindowSceneDelegate;The scene delegate for the application. Get the current one or set a custom one.
property shouldDelayLaunchEvent
shouldDelayLaunchEvent: boolean;Delays the 'launch' event, and with it the creation of the first window's content, until the app first becomes active, instead of raising it while the app finishes launching.
Applies to non-scene apps only. It has no effect in a scene-based app, where each window's content is resolved as its scene connects.
Deprecated
Use the 'ready' event for application initialization, and Application.setWindowContentResolver() to provide window UI.
property window
readonly window: UIWindow;The key window.
method addDelegateHandler
addDelegateHandler: <T extends string | number | symbol>( methodName: T, handler: any) => void;Adds a delegate handler for the specified delegate method name. This method does not replace an existing handler, but rather adds the new handler to the existing chain of handlers.
Parameter methodName
The name of the delegate method to add a handler for.
Parameter handler
A function that will be called when the specified delegate method is called.
method addNotificationObserver
addNotificationObserver: ( notificationName: string, onReceiveCallback: (notification: NSNotification) => void) => NotificationObserver;Adds an observer to the default notification center for the specified notification. For more information, please visit 'https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSNotificationCenter_Class/#//apple_ref/occ/instm/NSNotificationCenter/addObserver:selector:name:object:'
Parameter notificationName
A string containing the name of the notification.
Parameter onReceiveCallback
A callback function that will be called each time the observer receives a notification.
method closeWindow
closeWindow: ( target?: NativeWindow | View | UIWindow | UIWindowScene | string) => void;Closes a secondary window/scene. If no target is provided, attempts to close a non-primary active scene.
Parameter target
Optional target to resolve the window to close. Can be a NativeWindow, a View, a UIWindow, a UIWindowScene, or a string scene identifier.
method defaultDiscardSceneSessions
defaultDiscardSceneSessions: ( application: UIApplication, sceneSessions: NSSet<UISceneSession>) => void;NativeScript's default implementation of the
UIApplicationDelegateapplicationDidDiscardSceneSessionsmethod, which retires the windows belonging to the discarded sessions.It is installed automatically on the application delegate class unless that class already implements the method, in which case forward to it from there so window bookkeeping stays correct.
method defaultSceneConfiguration
defaultSceneConfiguration: ( application: UIApplication, connectingSceneSession: UISceneSession, options: UISceneConnectionOptions) => UISceneConfiguration;NativeScript's default implementation of the
UIApplicationDelegateapplicationConfigurationForConnectingSceneSessionOptionsmethod.It is installed automatically on the application delegate class unless that class already implements the method. A delegate that does implement it can handle the scenes it cares about and forward the rest here:
applicationConfigurationForConnectingSceneSessionOptions(app, session, options) {if (session.role === myCustomRole) {return myConfig;}return Application.ios.defaultSceneConfiguration(app, session, options);}onSceneConfigurationis consulted first. Scenes with theUIWindowSceneSessionRoleApplicationrole then get a configuration backed by NativeScript's SceneDelegate; every other role gets a bare configuration that NativeScript does not manage.
method getAllScenes
getAllScenes: () => UIScene[];Gets all scenes for the application.
Deprecated
Use
getWindows()instead.
method getAllWindows
getAllWindows: () => UIWindow[];Gets all windows for the application.
Deprecated
Use
getWindows()instead.
method getPrimaryScene
getPrimaryScene: () => UIWindowScene | null;Gets the primary scene for the application.
Deprecated
Use
primaryWindow?.ios?.sceneinstead.
method getPrimaryWindow
getPrimaryWindow: () => UIWindow;Gets the primary window for the application.
Deprecated
Use
primaryWindow?.ios?.uiWindowinstead.
method getWindowScenes
getWindowScenes: () => UIWindowScene[];Gets all window scenes for the application.
Deprecated
Use
getWindows()instead.
method isUsingSceneLifecycle
isUsingSceneLifecycle: () => boolean;Checks if the application is using the scene lifecycle.
method openWindow
openWindow: (options?: WindowOpenOptions) => void;Opens a new window (scene).
Parameter options
Options for the new window.
options.datais serialized into the activating scene'sNSUserActivity.userInfo.
method removeNotificationObserver
removeNotificationObserver: (observer: any, notificationName: string) => any;Removes the observer for the specified notification from the default notification center. For more information, please visit 'https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSNotificationCenter_Class/#//apple_ref/occ/instm/NSNotificationCenter/addObserver:selector:name:object:'
Parameter observer
The observer that was returned from the addNotificationObserver method.
Parameter notificationName
A string containing the name of the notification.
Parameter onReceiveCallback
A callback function that will be called each time the observer receives a notification.
method setWindowRootView
setWindowRootView: (window: UIWindow, view: View) => void;Sets the root view for a specific window.
Parameter window
The window to set the root view for.
Parameter view
The view to set as the root view.
method supportsMultipleScenes
supportsMultipleScenes: () => boolean;Checks if the application supports multiple scenes.
method supportsScenes
supportsScenes: () => boolean;Checks if the application supports scenes.
class ItemSpec
class ItemSpec {}Defines row/column specific properties that apply to GridLayout elements.
constructor
constructor();constructor
constructor(value: number, type: GridUnitType);property actualLength
actualLength: number;Gets the actual length of an ItemSpec.
property gridUnitType
gridUnitType: GridUnitType;Returns unit type of this ItemSpec instance.
property isAbsolute
isAbsolute: boolean;Returns true if this ItemSpec instance holds an absolute (pixel) value.
property isAuto
isAuto: boolean;Returns true if this GridLength instance is automatic (not specified).
property isStar
isStar: boolean;Returns true if this ItemSpec instance holds weighted proportion of available space.
property value
value: number;Returns value part of this ItemSpec instance.
class KeyframeAnimation
class KeyframeAnimation {}property animations
animations: Keyframe[];property delay
delay: number;property isPlaying
readonly isPlaying: boolean;property iterations
iterations: number;method cancel
cancel: () => void;method keyframeAnimationFromInfo
static keyframeAnimationFromInfo: ( info: KeyframeAnimationInfo) => KeyframeAnimation;method play
play: (view: View) => Promise<void>;class KeyframeAnimationInfo
class KeyframeAnimationInfo {}property curve
curve?: any;property delay
delay?: number;property duration
duration?: number;property isForwards
isForwards?: boolean;property isReverse
isReverse?: boolean;property iterations
iterations?: number;property keyframes
keyframes: KeyframeInfo[];property name
name?: string;class KeyframeDeclaration
class KeyframeDeclaration {}class KeyframeInfo
class KeyframeInfo {}property curve
curve?: any;property declarations
declarations: KeyframeDeclaration[];property duration
duration: number;class Label
class Label extends TextBase {}Represents a text label.
Label
property android
android: any;Gets the native [android widget](http://developer.android.com/reference/android/widget/TextView.html) that represents the user interface for this component. Valid only when running on Android OS.
property ios
ios: any;Gets the native [UILabel](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UILabel_Class/) that represents the user interface for this component. Valid only when running on iOS.
property textWrap
textWrap: boolean;Gets or sets whether the Label wraps text or not.
class LayoutBase
class LayoutBase extends CustomLayoutView {}Base class for all views that supports children positioning.
property clipToBounds
clipToBounds: boolean;Gets or sets a value indicating whether to clip the content of this layout.
property isPassThroughParentEnabled
isPassThroughParentEnabled: boolean;Gets or sets a value indicating whether touch event should pass through to a parent view of the layout container in case an interactive child view did not handle it. Default value of this property is false. This does not affect the appearance of the view.
property padding
padding: string | number | CoreTypes.LengthDipUnit | CoreTypes.LengthPxUnit;Gets or sets padding style property.
property paddingBottom
paddingBottom: CoreTypes.LengthType;Specify the bottom padding of this layout.
property paddingLeft
paddingLeft: CoreTypes.LengthType;Specify the left padding of this layout.
property paddingRight
paddingRight: CoreTypes.LengthType;Specify the right padding of this layout.
property paddingTop
paddingTop: CoreTypes.LengthType;Specify the top padding of this layout.
method addChild
addChild: (view: View) => void;Adds the view to children array.
Parameter view
The view to be added to the end of the children array.
method eachLayoutChild
eachLayoutChild: (callback: (child: View, isLast: boolean) => void) => void;Calls the callback for each child that should be laid out.
Parameter callback
The callback
method getChildAt
getChildAt: (index: number) => View;Returns the view at the specified position.
Parameter index
The position at which to get the child from.
method getChildIndex
getChildIndex: (child: View) => number;Returns the position of the child view
Parameter child
The child view that we are looking for.
method getChildrenCount
getChildrenCount: () => number;Returns the number of children in this Layout.
method insertChild
insertChild: (child: View, atIndex: number) => boolean;Inserts the view to children array at the specified index.
Parameter view
The view to be added to the end of the children array.
Parameter atIndex
The insertion index.
method removeChild
removeChild: (view: View) => void;Removes the specified view from the children array.
Parameter view
The view to remove from the children array.
method removeChildren
removeChildren: () => void;Removes all views in this layout.
class LinearGradient
class LinearGradient {}property angle
angle: number;property colorStops
colorStops: ColorStop[];method equals
static equals: (first: LinearGradient, second: LinearGradient) => boolean;method parse
static parse: (value: CSSLinearGradient) => LinearGradient;class LiquidGlass
class LiquidGlass extends LiquidGlassCommon {}class LiquidGlassContainer
class LiquidGlassContainer extends LiquidGlassContainerCommon {}class ListPicker
class ListPicker extends View {}Represents an list picker.
ListPicker
property android
android: any;Gets the native [android.widget.NumberPicker](http://developer.android.com/reference/android/widget/NumberPicker.html) that represents the user interface for this component. Valid only when running on Android OS.
property ios
ios: any;Gets the native iOS [UIPickerView](http://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UIDatePicker_Class/index.html) that represents the user interface for this component. Valid only when running on iOS.
property items
items: any[] | ItemsSource;Gets or set the items collection of the ListPicker. The items property can be set to an array or an object defining length and getItem(index) method.
property selectedIndex
selectedIndex: number;Gets or sets the selected index.
property selectedIndexChangeEvent
static selectedIndexChangeEvent: string;{PropertyChangeData} selectedIndexChange
class ListView
class ListView extends View {}Represents a view that shows items in a vertically scrolling list.
ListView
property android
android: any;Gets the native [android widget](http://developer.android.com/reference/android/widget/ListView.html) that represents the user interface for this component. Valid only when running on Android OS.
property ios
ios: any;Gets the native [iOS view](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UITableView_Class/) that represents the user interface for this component. Valid only when running on iOS.
property iosEstimatedRowHeight
iosEstimatedRowHeight: CoreTypes.LengthType;Gets or set the estimated height of rows in the ListView. The default value is 44px.
property iosSearchInsetBehavior
iosSearchInsetBehavior: 'automatic' | 'always' | 'never' | 'scrollableAxes';iOS-only. Controls the underlying UIScrollView's
contentInsetAdjustmentBehaviorwhenshowSearchis enabled. Defaults to'automatic'when the search controller is hosted onnavigationItem.searchController(UINavigationController context), and'never'otherwise (when the search bar is thetableHeaderView).
property itemIdGenerator
itemIdGenerator: (item: any, index: number, items: any) => number;Item id generator
property itemLoadingEvent
static itemLoadingEvent: string;String value used when hooking to itemLoading event.
{ItemEventData} itemLoading
property items
items: any[] | ItemsSource;Gets or set the items collection of the ListView. The items property can be set to an array or an object defining length and getItem(index) method.
property itemTapEvent
static itemTapEvent: string;String value used when hooking to itemTap event.
{ItemEventData} itemTap
property itemTemplate
itemTemplate: string | Template;Gets or set the item template of the ListView.
property itemTemplates
itemTemplates: string | KeyedTemplate[];Gets or set the list of item templates for the item template selector
property itemTemplateSelector
itemTemplateSelector: | string | ((item: any, index: number, items: any) => string);A function that returns the appropriate ket template based on the data item.
property loadMoreItemsEvent
static loadMoreItemsEvent: string;String value used when hooking to loadMoreItems event.
itemLoading
property rowHeight
rowHeight: CoreTypes.LengthType;Gets or set row height of the ListView.
property searchAutoHide
searchAutoHide: boolean;Gets or sets whether the search bar should auto-hide when scrolling (iOS only). When true, the search bar will automatically hide when the user scrolls down and reappear when scrolling up, using iOS native behavior. Only applies when showSearch is true and running on iOS with navigation controller.
property searchChangeEvent
static searchChangeEvent: string;String value used when hooking to searchChange event.
{SearchEventData} searchChange
property sectioned
sectioned: boolean;Gets or sets a value indicating whether the ListView should treat items as sectioned data. When enabled, items array should contain objects with 'items' property for section content. Each section will have its own sticky header.
property separatorColor
separatorColor: Color;Gets or set the items separator line color of the ListView.
property showSearch
showSearch: boolean;Gets or sets whether search functionality is enabled. When enabled on iOS, uses native UISearchController for optimal performance.
property stickyHeader
stickyHeader: boolean;Gets or sets a value indicating whether the ListView should display sticky headers. When enabled, headers will remain visible at the top while scrolling through sections.
property stickyHeaderHeight
stickyHeaderHeight: CoreTypes.LengthType;Gets or sets the height of sticky headers.
property stickyHeaderTemplate
stickyHeaderTemplate: string | Template;Gets or sets the template for sticky headers.
property stickyHeaderTopPadding
stickyHeaderTopPadding: boolean;Gets or sets a value indicating whether the ListView should show default top padding above section headers. When set to false (default), removes iOS default spacing for a tighter layout. When set to true, preserves iOS default ~4-5px spacing above section headers.
method isItemAtIndexVisible
isItemAtIndexVisible: (index: number) => boolean;Checks if Specified item with index is visible.
Parameter index
Item index.
method on
on: { ( eventName: string, callback: (data: EventData) => void, thisArg?: any ): void; ( event: 'itemLoading', callback: (args: ItemEventData) => void, thisArg?: any ): void; ( event: 'itemTap', callback: (args: ItemEventData) => void, thisArg?: any ): void; ( event: 'loadMoreItems', callback: (args: EventData) => void, thisArg?: any ): void; ( event: 'searchChange', callback: (args: SearchEventData) => void, thisArg?: any ): void;};Adds a listener for the specified event name.
Parameter eventName
The name of the event.
Parameter callback
The event listener to add. Will be called when an event of the given name is raised.
Parameter thisArg
An optional parameter which, when set, will be bound as the
thiscontext when the callback is called. Falsy values will be not be bound.Raised when a View for the data at the specified index should be created. The result should be returned trough the view property of the event data. Note, that the view property of the event data can be pre-initialized with an old instance of a view, so that it can be reused.
Raised when an item inside the ListView is tapped.
Raised when the ListView is scrolled so that its last item is visible.
Raised when the search text in the search bar changes.
method refresh
refresh: () => any;Forces the ListView to reload all its items.
method scrollToIndex
scrollToIndex: (index: number) => any;Scrolls the specified item with index into view. [iOS](https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UITableView_Class/#//apple_ref/occ/instm/UITableView/scrollToRowAtIndexPath:atScrollPosition:animated:) [Android](http://developer.android.com/reference/android/widget/ListView.html#setSelection(int))
Parameter index
Item index.
method scrollToIndexAnimated
scrollToIndexAnimated: (index: number) => any;Scrolls the specified item with index into view with animation. [iOS](https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UITableView_Class/#//apple_ref/occ/instm/UITableView/scrollToRowAtIndexPath:atScrollPosition:animated:) [Android](https://developer.android.com/reference/android/widget/ListView.html#smoothScrollToPosition(int))
Parameter index
Item index.
class ModalTransition
class ModalTransition extends Transition {}class ModuleNameResolver
class ModuleNameResolver implements ModuleNameResolverType {}constructor
constructor(context: PlatformContext, moduleListProvider?: ModuleListProvider);method clearCache
clearCache: () => void;method resolveModuleName
resolveModuleName: (path: string, ext: string) => string;class NativeWindow
abstract class NativeWindow extends WindowBase {}A window surface that hosts a NativeScript view tree.
Wraps a platform window (iOS UIWindowScene + UIWindow, Android Activity) and owns the per-window root view, its CSS classes and its lifecycle events. Instances are created by the framework as the platform connects surfaces; reach them through
Application.activeWindow,Application.primaryWindow,Application.getWindows()orApplication.getWindowById(), and useios/androidto get at the native objects.
property rootView
readonly rootView: View;The root view currently hosted by this window, if any.
method layoutDirection
layoutDirection: () => CoreTypes.LayoutDirectionType | null;The current layout direction of this window.
Read from the native surface while the window is attached; a detached window reports the last value it saw. A read that catches a change the platform has not reported yet also raises
layoutDirectionChanged, so a change is never swallowed by the reading.
method off
off: { ( event: 'contentLoaded', callback?: (data: NativeWindowEventData) => void, thisArg?: any ): void; ( event: 'activate', callback?: (data: NativeWindowEventData) => void, thisArg?: any ): void; ( event: 'deactivate', callback?: (data: NativeWindowEventData) => void, thisArg?: any ): void; ( event: 'background', callback?: (data: NativeWindowEventData) => void, thisArg?: any ): void; ( event: 'foreground', callback?: (data: NativeWindowEventData) => void, thisArg?: any ): void; ( event: 'attached', callback?: (data: NativeWindowEventData) => void, thisArg?: any ): void; ( event: 'detached', callback?: (data: NativeWindowEventData) => void, thisArg?: any ): void; ( event: 'close', callback?: (data: NativeWindowEventData) => void, thisArg?: any ): void; ( event: 'displayed', callback?: (data: NativeWindowEventData) => void, thisArg?: any ): void; ( event: 'orientationChanged', callback?: (data: WindowOrientationChangedEventData) => void, thisArg?: any ): void; ( event: 'systemAppearanceChanged', callback?: (data: WindowSystemAppearanceChangedEventData) => void, thisArg?: any ): void; ( event: 'layoutDirectionChanged', callback?: (data: WindowLayoutDirectionChangedEventData) => void, thisArg?: any ): void; ( event: 'activityCreated', callback?: (args: AndroidActivityBundleEventData) => void, thisArg?: any ): void; ( event: 'activityDestroyed', callback?: (args: AndroidActivityEventData) => void, thisArg?: any ): void; ( event: 'activityStarted', callback?: (args: AndroidActivityEventData) => void, thisArg?: any ): void; ( event: 'activityPaused', callback?: (args: AndroidActivityEventData) => void, thisArg?: any ): void; ( event: 'activityResumed', callback?: (args: AndroidActivityEventData) => void, thisArg?: any ): void; ( event: 'activityStopped', callback?: (args: AndroidActivityEventData) => void, thisArg?: any ): void; ( event: 'saveActivityState', callback?: (args: AndroidActivityBundleEventData) => void, thisArg?: any ): void; ( event: 'activityResult', callback?: (args: AndroidActivityResultEventData) => void, thisArg?: any ): void; ( event: 'activityBackPressed', callback?: (args: AndroidActivityBackPressedEventData) => void, thisArg?: any ): void; ( event: 'activityNewIntent', callback?: (args: AndroidActivityNewIntentEventData) => void, thisArg?: any ): void; ( event: 'activityRequestPermissions', callback?: (args: AndroidActivityRequestPermissionsEventData) => void, thisArg?: any ): void; ( event: 'sceneWillConnect', callback?: (args: SceneEventData) => void, thisArg?: any ): void; ( event: 'sceneDidActivate', callback?: (args: SceneEventData) => void, thisArg?: any ): void; ( event: 'sceneWillResignActive', callback?: (args: SceneEventData) => void, thisArg?: any ): void; ( event: 'sceneWillEnterForeground', callback?: (args: SceneEventData) => void, thisArg?: any ): void; ( event: 'sceneDidEnterBackground', callback?: (args: SceneEventData) => void, thisArg?: any ): void; ( event: 'sceneDidDisconnect', callback?: (args: SceneEventData) => void, thisArg?: any ): void; ( event: 'sceneOpenURLContexts', callback?: (args: SceneOpenURLContextsEventData) => void, thisArg?: any ): void; ( event: 'sceneContinueUserActivity', callback?: (args: SceneContinueUserActivityEventData) => void, thisArg?: any ): void; ( event: 'scenePerformActionForShortcutItem', callback?: (args: ScenePerformActionForShortcutItemEventData) => void, thisArg?: any ): void; ( eventName: string, callback?: (data: NativeWindowEventData) => void, thisArg?: any ): void;};method on
on: { ( event: 'contentLoaded', callback: (data: NativeWindowEventData) => void, thisArg?: any ): void; ( event: 'activate', callback: (data: NativeWindowEventData) => void, thisArg?: any ): void; ( event: 'deactivate', callback: (data: NativeWindowEventData) => void, thisArg?: any ): void; ( event: 'background', callback: (data: NativeWindowEventData) => void, thisArg?: any ): void; ( event: 'foreground', callback: (data: NativeWindowEventData) => void, thisArg?: any ): void; ( event: 'attached', callback: (data: NativeWindowEventData) => void, thisArg?: any ): void; ( event: 'detached', callback: (data: NativeWindowEventData) => void, thisArg?: any ): void; ( event: 'close', callback: (data: NativeWindowEventData) => void, thisArg?: any ): void; ( event: 'displayed', callback: (data: NativeWindowEventData) => void, thisArg?: any ): void; ( event: 'orientationChanged', callback: (data: WindowOrientationChangedEventData) => void, thisArg?: any ): void; ( event: 'systemAppearanceChanged', callback: (data: WindowSystemAppearanceChangedEventData) => void, thisArg?: any ): void; ( event: 'layoutDirectionChanged', callback: (data: WindowLayoutDirectionChangedEventData) => void, thisArg?: any ): void; ( event: 'activityCreated', callback: (args: AndroidActivityBundleEventData) => void, thisArg?: any ): void; ( event: 'activityDestroyed', callback: (args: AndroidActivityEventData) => void, thisArg?: any ): void; ( event: 'activityStarted', callback: (args: AndroidActivityEventData) => void, thisArg?: any ): void; ( event: 'activityPaused', callback: (args: AndroidActivityEventData) => void, thisArg?: any ): void; ( event: 'activityResumed', callback: (args: AndroidActivityEventData) => void, thisArg?: any ): void; ( event: 'activityStopped', callback: (args: AndroidActivityEventData) => void, thisArg?: any ): void; ( event: 'saveActivityState', callback: (args: AndroidActivityBundleEventData) => void, thisArg?: any ): void; ( event: 'activityResult', callback: (args: AndroidActivityResultEventData) => void, thisArg?: any ): void; ( event: 'activityBackPressed', callback: (args: AndroidActivityBackPressedEventData) => void, thisArg?: any ): void; ( event: 'activityNewIntent', callback: (args: AndroidActivityNewIntentEventData) => void, thisArg?: any ): void; ( event: 'activityRequestPermissions', callback: (args: AndroidActivityRequestPermissionsEventData) => void, thisArg?: any ): void; ( event: 'sceneWillConnect', callback: (args: SceneEventData) => void, thisArg?: any ): void; ( event: 'sceneDidActivate', callback: (args: SceneEventData) => void, thisArg?: any ): void; ( event: 'sceneWillResignActive', callback: (args: SceneEventData) => void, thisArg?: any ): void; ( event: 'sceneWillEnterForeground', callback: (args: SceneEventData) => void, thisArg?: any ): void; ( event: 'sceneDidEnterBackground', callback: (args: SceneEventData) => void, thisArg?: any ): void; ( event: 'sceneDidDisconnect', callback: (args: SceneEventData) => void, thisArg?: any ): void; ( event: 'sceneOpenURLContexts', callback: (args: SceneOpenURLContextsEventData) => void, thisArg?: any ): void; ( event: 'sceneContinueUserActivity', callback: (args: SceneContinueUserActivityEventData) => void, thisArg?: any ): void; ( event: 'scenePerformActionForShortcutItem', callback: (args: ScenePerformActionForShortcutItemEventData) => void, thisArg?: any ): void; ( eventName: string, callback: (data: NativeWindowEventData) => void, thisArg?: any ): void;};Raised when the root view content of this window is set or changed.
Bringing a window up follows a fixed order that app code can rely on: Application
ready-> ApplicationwindowOpen-> the raw platform connect/create event (sceneWillConnect/activityCreated) -> content resolution (the window content resolver, or the legacylaunchbridge for the first window) ->contentLoaded->activateanddisplayed.
method once
once: { ( event: 'contentLoaded', callback: (data: NativeWindowEventData) => void, thisArg?: any ): void; ( event: 'activate', callback: (data: NativeWindowEventData) => void, thisArg?: any ): void; ( event: 'deactivate', callback: (data: NativeWindowEventData) => void, thisArg?: any ): void; ( event: 'background', callback: (data: NativeWindowEventData) => void, thisArg?: any ): void; ( event: 'foreground', callback: (data: NativeWindowEventData) => void, thisArg?: any ): void; ( event: 'attached', callback: (data: NativeWindowEventData) => void, thisArg?: any ): void; ( event: 'detached', callback: (data: NativeWindowEventData) => void, thisArg?: any ): void; ( event: 'close', callback: (data: NativeWindowEventData) => void, thisArg?: any ): void; ( event: 'displayed', callback: (data: NativeWindowEventData) => void, thisArg?: any ): void; ( event: 'orientationChanged', callback: (data: WindowOrientationChangedEventData) => void, thisArg?: any ): void; ( event: 'systemAppearanceChanged', callback: (data: WindowSystemAppearanceChangedEventData) => void, thisArg?: any ): void; ( event: 'layoutDirectionChanged', callback: (data: WindowLayoutDirectionChangedEventData) => void, thisArg?: any ): void; ( event: 'activityCreated', callback: (args: AndroidActivityBundleEventData) => void, thisArg?: any ): void; ( event: 'activityDestroyed', callback: (args: AndroidActivityEventData) => void, thisArg?: any ): void; ( event: 'activityStarted', callback: (args: AndroidActivityEventData) => void, thisArg?: any ): void; ( event: 'activityPaused', callback: (args: AndroidActivityEventData) => void, thisArg?: any ): void; ( event: 'activityResumed', callback: (args: AndroidActivityEventData) => void, thisArg?: any ): void; ( event: 'activityStopped', callback: (args: AndroidActivityEventData) => void, thisArg?: any ): void; ( event: 'saveActivityState', callback: (args: AndroidActivityBundleEventData) => void, thisArg?: any ): void; ( event: 'activityResult', callback: (args: AndroidActivityResultEventData) => void, thisArg?: any ): void; ( event: 'activityBackPressed', callback: (args: AndroidActivityBackPressedEventData) => void, thisArg?: any ): void; ( event: 'activityNewIntent', callback: (args: AndroidActivityNewIntentEventData) => void, thisArg?: any ): void; ( event: 'activityRequestPermissions', callback: (args: AndroidActivityRequestPermissionsEventData) => void, thisArg?: any ): void; ( event: 'sceneWillConnect', callback: (args: SceneEventData) => void, thisArg?: any ): void; ( event: 'sceneDidActivate', callback: (args: SceneEventData) => void, thisArg?: any ): void; ( event: 'sceneWillResignActive', callback: (args: SceneEventData) => void, thisArg?: any ): void; ( event: 'sceneWillEnterForeground', callback: (args: SceneEventData) => void, thisArg?: any ): void; ( event: 'sceneDidEnterBackground', callback: (args: SceneEventData) => void, thisArg?: any ): void; ( event: 'sceneDidDisconnect', callback: (args: SceneEventData) => void, thisArg?: any ): void; ( event: 'sceneOpenURLContexts', callback: (args: SceneOpenURLContextsEventData) => void, thisArg?: any ): void; ( event: 'sceneContinueUserActivity', callback: (args: SceneContinueUserActivityEventData) => void, thisArg?: any ): void; ( event: 'scenePerformActionForShortcutItem', callback: (args: ScenePerformActionForShortcutItemEventData) => void, thisArg?: any ): void; ( eventName: string, callback: (data: NativeWindowEventData) => void, thisArg?: any ): void;};method orientation
orientation: () => 'portrait' | 'landscape' | 'unknown';The current orientation of this window.
Read from the native surface while the window is attached; a detached window reports the last value it saw. A read that catches a change the platform has not reported yet also raises
orientationChanged, so a change is never swallowed by the reading.
method setContent
setContent: (content: View | NavigationEntry | string) => void;Sets the content of this window.
Replaces any content set earlier, tears the previous root view down and raises
contentLoaded.A view that is already the root of another window is released from it first — that window's
rootViewbecomes null — while the view itself is left intact.Parameter content
A View, a NavigationEntry, or the name of a module to load.
method systemAppearance
systemAppearance: () => 'light' | 'dark' | null;The current system appearance of this window.
Read from the native surface while the window is attached; a detached window reports the last value it saw. A read that catches a change the platform has not reported yet also raises
systemAppearanceChanged, so a change is never swallowed by the reading.
class NavigationButton
class NavigationButton extends ActionItem {}Represents the navigation (a.k.a. "back") button.
class Observable
class Observable {}Observable is used when you want to be notified when a change occurs. Use on/off methods to add/remove listener. Please note that should you be using the
new Observable({})constructor, it is **obsolete** since v3.0, and you have to migrate to the "data/observable"fromObject({})or thefromObjectRecursive({})functions.
property propertyChangeEvent
static propertyChangeEvent: string;String value used when hooking to propertyChange event. {PropertyChangeData} propertyChange
method addEventListener
static addEventListener: ( eventName: string, callback: (data: EventData) => void, thisArg?: any, once?: boolean) => void;Adds a listener for the specified event name.
Parameter eventName
Name of the event to attach to.
Parameter callback
A function to be called when some of the specified event(s) is raised.
Parameter thisArg
An optional parameter which when set will be used as "this" in callback method call.
Parameter once
An optional parameter which when set will cause the event listener to fire once.
Please avoid using the static event-handling APIs as they will be removed in future.
Deprecated
method get
get: (name: string) => any;Gets the value of the specified property.
method hasListeners
hasListeners: (eventName: string) => boolean;Checks whether a listener is registered for the specified event name.
Parameter eventName
The name of the event to check for.
method notify
notify: <T extends Optional<EventData, 'object'>>(data: T) => void;Notify this Observable instance with some data. This causes all event handlers on the Observable instance to be called, as well as any 'global' event handlers set on the instance's class.
Parameter data
an object that satisfies the EventData interface, though with an optional 'object' property. If left undefined, the 'object' property will implicitly be set as this Observable instance.
method notifyPropertyChange
notifyPropertyChange: (name: string, value: any, oldValue?: any) => void;Notifies all the registered listeners for the property change event.
method off
static off: ( eventName: string, callback?: (data: EventData) => void, thisArg?: any) => void;Removes the listener(s) for the specified event name.
Parameter eventName
The name of the event.
Parameter callback
An optional specific event listener to remove (if omitted, all event listeners by this name will be removed).
Parameter thisArg
An optional parameter which, when set, will be used to refine search of the correct event listener to be removed.
Please avoid using the static event-handling APIs as they will be removed in future.
Deprecated
method on
static on: ( eventName: string, callback: (data: EventData) => void, thisArg?: any, once?: boolean) => void;Adds a listener for the specified event name.
Parameter eventName
The name of the event.
Parameter callback
The event listener to add. Will be called when an event of the given name is raised.
Parameter thisArg
An optional parameter which, when set, will be bound as the
thiscontext when the callback is called. Falsy values will be not be bound.Please avoid using the static event-handling APIs as they will be removed in future.
Deprecated
method once
static once: ( eventName: string, callback: (data: EventData) => void, thisArg?: any) => void;Adds a listener for the specified event name, which, once fired, will remove itself.
Parameter eventName
The name of the event.
Parameter callback
The event listener to add. Will be called when an event of the given name is raised.
Parameter thisArg
An optional parameter which, when set, will be bound as the
thiscontext when the callback is called. Falsy values will be not be bound.Please avoid using the static event-handling APIs as they will be removed in future.
Deprecated
method removeEventListener
static removeEventListener: ( eventName: string, callback?: (data: EventData) => void, thisArg?: any) => void;Removes listener(s) for the specified event name.
Parameter eventName
Name of the event to attach to.
Parameter callback
An optional parameter pointing to a specific listener. If not defined, all listeners for the event names will be removed.
Parameter thisArg
An optional parameter which when set will be used to refine search of the correct callback which will be removed as event listener.
Please avoid using the static event-handling APIs as they will be removed in future.
Deprecated
method set
set: (name: string, value: any) => void;Updates the specified property with the provided value.
method setProperty
setProperty: (name: string, value: any) => void;Updates the specified property with the provided value and raises a property change event and a specific change event based on the property name.
class ObservableArray
class ObservableArray<T> extends Observable {}Advanced array like class used when you want to be notified when a change occurs.
constructor
constructor(arrayLength?: number);Create ObservableArray with specified length.
constructor
constructor(items: T[]);Create ObservableArray from source Array.
constructor
constructor(...items: T[]);Create ObservableArray from T items.
property changeEvent
static changeEvent: string;String value used when hooking to change event.
property length
length: number;Gets or sets the length of the array. This is a number one higher than the highest element defined in an array.
method [Symbol.iterator]
[Symbol.iterator]: () => Generator<T, void, unknown>;method concat
concat: (...args: any[]) => ObservableArray<T>;Combines two or more arrays.
Parameter items
Additional items to add to the end of array1.
method every
every: ( callbackfn: (value: T, index: number, array: ObservableArray<T>) => boolean, thisArg?: any) => boolean;Determines whether all the members of an array satisfy the specified test.
Parameter callbackfn
A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array.
Parameter thisArg
An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
method filter
filter: ( callbackfn: (value: T, index: number, array: ObservableArray<T>) => boolean, thisArg?: any) => ObservableArray<T>;Returns the elements of an array that meet the condition specified in a callback function.
Parameter callbackfn
A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array.
Parameter thisArg
An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
method find
find: ( callbackfn: (value: T, index: number, array: ObservableArray<T>) => any, thisArg?: any) => T;Returns the first element in the array where predicate is true, and null otherwise.
Parameter callbackfn
Parameter thisArg
If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.
method findIndex
findIndex: ( callbackfn: (value: T, index: number, array: ObservableArray<T>) => any, thisArg?: any) => number;Returns the index of the first element in the array where predicate is true, and -1 otherwise.
Parameter callbackfn
Parameter thisArg
If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.
method forEach
forEach: ( callbackfn: (value: T, index: number, array: ObservableArray<T>) => void, thisArg?: any) => void;Performs the specified action for each element in an array.
Parameter callbackfn
A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.
Parameter thisArg
An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
method getItem
getItem: (pos: number) => T;Returns item at specified position. Supports relative indexing from the end of the array when passed a negative index.
method includes
includes: (searchElement: T, fromIndex?: number) => boolean;Determines whether the specified element exists inside the array.
Parameter searchElement
The value to locate in the array.
Parameter fromIndex
The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.
method indexOf
indexOf: (searchElement: T, fromIndex?: number) => number;Returns the index of the first occurrence of a value in an array.
Parameter searchElement
The value to locate in the array.
Parameter fromIndex
The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.
method join
join: (separator?: string) => string;Adds all the elements of an array separated by the specified separator string.
Parameter separator
A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.
method lastIndexOf
lastIndexOf: (searchElement: T, fromIndex?: number) => number;Returns the index of the last occurrence of a specified value in an array.
Parameter searchElement
The value to locate in the array.
Parameter fromIndex
The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array.
method map
map: <U>( callbackfn: (value: T, index: number, array: ObservableArray<T>) => U, thisArg?: any) => ObservableArray<U>;Calls a defined callback function on each element of an array, and returns an array that contains the results.
Parameter callbackfn
A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.
Parameter thisArg
An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
method pop
pop: () => T;Removes the last element from an array and returns it.
method push
push: (...args: T[]) => number;Appends new elements to an array, and returns the new length of the array.
Parameter item
New element of the Array.
method reduce
reduce: ( callbackfn: ( previousValue: T, currentValue: T, currentIndex: number, array: ObservableArray<T> ) => T, initialValue?: T) => T;Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
Parameter callbackfn
A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
Parameter initialValue
If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
method reduceRight
reduceRight: ( callbackfn: ( previousValue: T, currentValue: T, currentIndex: number, array: ObservableArray<T> ) => T, initialValue?: T) => T;Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
Parameter callbackfn
A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
Parameter initialValue
If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
method reverse
reverse: () => ObservableArray<T>;Reverses the elements in an Array. This method uses 'in place' algorithm.
method setItem
setItem: (pos: number, value: T) => void;Sets item at specified position. Supports relative indexing from the end of the array when passed a negative index.
method shift
shift: () => T;Removes the first element from an array and returns it.
method slice
slice: (start?: number, end?: number) => ObservableArray<T>;Returns a section of an array.
Parameter start
The beginning of the specified portion of the array.
Parameter end
The end of the specified portion of the array.
method some
some: ( callbackfn: (value: T, index: number, array: ObservableArray<T>) => boolean, thisArg?: any) => boolean;Determines whether the specified callback function returns true for any element of an array.
Parameter callbackfn
A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array.
Parameter thisArg
An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
method sort
sort: (compareFn?: (a: T, b: T) => number) => ObservableArray<T>;Sorts an array. This method uses 'in place' algorithm.
Parameter compareFn
The name of the function used to determine the order of the elements. If omitted, the elements are sorted in ascending, ASCII character order.
method splice
splice: ( start: number, deleteCount?: number, ...items: T[]) => ObservableArray<T>;Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. This method uses 'in place' algorithm.
Parameter start
The zero-based location in the array from which to start removing elements.
Parameter deleteCount
The number of elements to remove.
Parameter items
Elements to insert into the array in place of the deleted elements.
method toJSON
toJSON: () => Array<any>;method toLocaleString
toLocaleString: () => string;method toString
toString: () => string;Returns a string representation of an array.
method unshift
unshift: (...args: T[]) => number;Inserts new elements at the start of an array.
Parameter items
Elements to insert at the start of the Array.
class Page
class Page extends PageBase {}Represents a logical unit for navigation (inside Frame).
Page
property accessibilityAnnouncePageEnabled
accessibilityAnnouncePageEnabled: boolean;Should page changed be announced to the screen reader.
property actionBar
actionBar: ActionBar;Gets the ActionBar for this page.
property actionBarHidden
actionBarHidden: boolean;Used to hide the Navigation Bar in iOS and the Action Bar in Android.
property androidStatusBarBackground
androidStatusBarBackground: Color;Gets or sets the color of the status bar in Android.
property backgroundSpanUnderStatusBar
backgroundSpanUnderStatusBar: boolean;Gets or sets whether page background spans under status bar.
property enableSwipeBackNavigation
enableSwipeBackNavigation: boolean;Used to control if swipe back navigation in iOS is enabled.
This property is iOS specific. Default value: true
property frame
frame: Frame;Gets the Frame object controlling this instance.
property hasActionBar
hasActionBar: boolean;property navigatedFromEvent
static readonly navigatedFromEvent: string;String value used when hooking to navigatedFrom event.
{NavigatedData} navigatedFrom
property navigatedToEvent
static readonly navigatedToEvent: string;String value used when hooking to navigatedTo event.
{NavigatedData} navigatedTo
property navigatingFromEvent
static readonly navigatingFromEvent: string;String value used when hooking to navigatingFrom event.
{NavigatedData} navigatingFrom
property navigatingToEvent
static readonly navigatingToEvent: string;String value used when hooking to navigatingTo event.
{NavigatedData} navigatingTo
property navigationContext
navigationContext: any;A property that is used to pass a data from another page (while navigate to).
property onAccessibilityPerformEscape
onAccessibilityPerformEscape?: () => boolean;iOS Only Perform an action when user performs the "escape" gesture
method accessibilityScreenChanged
accessibilityScreenChanged: (refocus?: boolean) => void;Announce screen changed
method getKeyframeAnimationWithName
getKeyframeAnimationWithName: (animationName: string) => KeyframeAnimationInfo;Returns a CSS keyframe animation with the specified name, if it exists.
method on
on: { ( eventName: string, callback: (data: EventData) => void, thisArg?: any ): void; ( event: 'navigatingTo', callback: (args: NavigatedData) => void, thisArg?: any ): void; ( event: 'navigatedTo', callback: (args: NavigatedData) => void, thisArg?: any ): void; ( event: 'navigatingFrom', callback: (args: NavigatedData) => void, thisArg?: any ): void; ( event: 'navigatedFrom', callback: (args: NavigatedData) => void, thisArg?: any ): void;};Adds a listener for the specified event name.
Parameter eventName
The name of the event.
Parameter callback
The event listener to add. Will be called when an event of the given name is raised.
Parameter thisArg
An optional parameter which, when set, will be bound as the
thiscontext when the callback is called. Falsy values will be not be bound.Raised when navigation to the page has started.
Raised when navigation to the page has finished.
Raised when navigation from the page has started.
Raised when navigation from the page has finished.
method onNavigatedFrom
onNavigatedFrom: (isBackNavigation: boolean) => void;A method called after navigated from the page.
Parameter isBackNavigation
True if the Page is being navigated from using the Frame.goBack() method, false otherwise.
method onNavigatedTo
onNavigatedTo: (isBackNavigation: boolean) => void;A method called after navigated to the page.
Parameter isBackNavigation
True if the Page is being navigated from using the Frame.goBack() method, false otherwise.
method onNavigatingFrom
onNavigatingFrom: (isBackNavigation: boolean) => void;A method called before navigating from the page.
Parameter isBackNavigation
True if the Page is being navigated from using the Frame.goBack() method, false otherwise.
method onNavigatingTo
onNavigatingTo: ( context: any, isBackNavigation: boolean, bindingContext?: any) => void;A method called before navigating to the page.
Parameter context
The data passed to the page through the NavigationEntry.context property.
Parameter isBackNavigation
True if the Page is being navigated from using the Frame.goBack() method, false otherwise.
Parameter bindingContext
An object to become the binding context of the page navigating to. Optional.
class PageBase
class PageBase extends ContentView {}property accessibilityAnnouncePageEnabled
accessibilityAnnouncePageEnabled: boolean;property actionBar
actionBar: ActionBar;property actionBarHidden
actionBarHidden: boolean;property androidStatusBarBackground
androidStatusBarBackground: Color;property backgroundSpanUnderStatusBar
backgroundSpanUnderStatusBar: boolean;property enableSwipeBackNavigation
enableSwipeBackNavigation: boolean;property frame
readonly frame: Frame;property hasActionBar
hasActionBar: boolean;property navigatedFromEvent
static navigatedFromEvent: string;property navigatedToEvent
static navigatedToEvent: string;property navigatingFromEvent
static navigatingFromEvent: string;property navigatingToEvent
static navigatingToEvent: string;property navigationContext
readonly navigationContext: any;property page
readonly page: PageDefinition;method accessibilityScreenChanged
accessibilityScreenChanged: (refocus?: boolean) => void;method eachChildView
eachChildView: (callback: (child: View) => boolean) => void;method getKeyframeAnimationWithName
getKeyframeAnimationWithName: (animationName: string) => KeyframeAnimationInfo;method onNavigatedFrom
onNavigatedFrom: (isBackNavigation: boolean) => void;method onNavigatedTo
onNavigatedTo: (isBackNavigation: boolean) => void;method onNavigatingFrom
onNavigatingFrom: (isBackNavigation: boolean) => void;method onNavigatingTo
onNavigatingTo: ( context: any, isBackNavigation: boolean, bindingContext?: any) => void;class PageTransition
class PageTransition extends Transition {}constructor
constructor(duration?: number, nativeCurve?: any, pageLoadedTimeout?: number);class ParserEvent
class ParserEvent {}Provides information for a parser event.
constructor
constructor( eventType: string, position: Position, prefix?: string, namespace?: string, elementName?: string, attributes?: Object, data?: string);property attributes
readonly attributes: Object;Returns a JSON object with the attributes of an element in case the eventType is ParserEventType.StartElement.
property data
readonly data: string;Returns the relevant data in case the eventType is ParserEventType.Text, ParserEventType.CDATA or ParserEventType.Comment.
property elementName
readonly elementName: string;Returns the name of the element in case the eventType is ParserEventType.StartElement or ParserEventType.EndElement.
property eventType
readonly eventType: string;Returns the type of the parser event. This is one of the ParserEventType static members.
property namespace
readonly namespace: string;If namespace processing is enabled, returns the namespace of the element in case the eventType is ParserEventType.StartElement or ParserEventType.EndElement.
property position
readonly position: Position;Get the position in the xml string where the event was generated.
property prefix
readonly prefix: string;If namespace processing is enabled, returns the prefix of the element in case the eventType is ParserEventType.StartElement or ParserEventType.EndElement.
method toString
toString: () => string;Returns a JSON string representation of this instance.
class ParserEventType
class ParserEventType {}Specifies the type of parser event.
property CDATA
static CDATA: string;Specifies the CDATA event type.
property Comment
static Comment: string;Specifies the Comment event type.
property EndElement
static EndElement: string;Specifies the EndElement event type.
property StartElement
static StartElement: string;Specifies the StartElement event type.
property Text
static Text: string;Specifies the Text event type.
class Placeholder
class Placeholder extends View {}Represents a Placeholder, which is used to add a native view to the visual tree.
Placeholder
property creatingViewEvent
static creatingViewEvent: string;String value used when hooking to creatingView event.
{CreateViewEventData} creatingView
method on
on: { ( eventName: string, callback: (args: EventData) => void, thisArg?: any ): void; ( event: 'creatingView', callback: (args: CreateViewEventData) => void, thisArg?: any ): void;};Adds a listener for the specified event name.
Parameter eventName
The name of the event.
Parameter callback
The event listener to add. Will be called when an event of the given name is raised.
Parameter thisArg
An optional parameter which, when set, will be bound as the
thiscontext when the callback is called. Falsy values will be not be bound.Raised when a creatingView event occurs.
class Progress
class Progress extends View {}Represents a progress component.
Progress
property android
android: any;Gets the native [android widget](http://developer.android.com/reference/android/widget/ProgressBar.html) that represents the user interface for this component. Valid only when running on Android OS.
property ios
ios: any;Gets the native iOS [UIProgressView](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIProgressView_Class/) that represents the user interface for this component. Valid only when running on iOS.
property maxValue
maxValue: number;Gets or sets a progress max value.
property value
value: number;Gets or sets a progress current value.
property valueChangeEvent
static readonly valueChangeEvent: string;String value used when hooking to valueChange event.
{PropertyChangeData} valueChange
class Property
class Property<T extends ViewBase, U> implements TypedPropertyDescriptor<U>, Property<T, U> {}constructor
constructor(options: PropertyOptions<T, U>);property configurable
configurable: boolean;property defaultValue
readonly defaultValue: {};property defaultValueKey
readonly defaultValueKey: Symbol;property enumerable
enumerable: boolean;property get
get: () => U;property getDefault
readonly getDefault: Symbol;property isStyleProperty
isStyleProperty: boolean;property key
readonly key: Symbol;property name
readonly name: string;property nativeValueChange
readonly nativeValueChange: (owner: T, value: U) => void;property overrideHandlers
overrideHandlers: (options: PropertyOptions<T, U>) => void;property set
set: (value: U) => void;property setNative
readonly setNative: Symbol;method isSet
isSet: (instance: T) => boolean;method register
register: (cls: { prototype: T }) => void;class ProxyViewContainer
class ProxyViewContainer extends LayoutBase {}Proxy view container that adds all its native children directly to the parent. To be used as a logical grouping container of views.
ProxyViewContainer
constructor
constructor();property android
readonly android: any;property ios
readonly ios: any;property isLayoutRequested
readonly isLayoutRequested: boolean;method createNativeView
createNativeView: () => any;class Repeater
class Repeater extends CustomLayoutView {}Represents a UI Repeater component.
Repeater
constructor
constructor();property android
android: any;property ios
ios: any;property items
items: any[] | ItemsSource;Gets or set the items collection of the Repeater. The items property can be set to an array or an object defining length and getItem(index) method.
property itemsLayout
itemsLayout: LayoutBase;Gets or set the items layout of the Repeater. Default value is StackLayout with orientation="vertical".
property itemTemplate
itemTemplate: string | Template;Gets or set the item template of the Repeater.
property itemTemplates
itemTemplates: string | KeyedTemplate[];Gets or set the item templates of the Repeater.
property itemTemplateSelector
itemTemplateSelector: | string | ((item: any, index: number, items: any) => string);property knownFunctions
static knownFunctions: string[];method eachChildView
eachChildView: (callback: (child: View) => boolean) => void;method onLayout
onLayout: (left: number, top: number, right: number, bottom: number) => void;method onLoaded
onLoaded: () => void;method onMeasure
onMeasure: (widthMeasureSpec: number, heightMeasureSpec: number) => void;method refresh
refresh: () => void;Forces the Repeater to reload all its items.
class RootLayout
class RootLayout extends GridLayout {}RootLayout
method bringToFront
bringToFront: (view: View, animated?: boolean) => Promise<void>;method close
close: (view: View, exitTo?: TransitionAnimation) => Promise<void>;method closeAll
closeAll: () => Promise<void[]>;method closeShadeCover
closeShadeCover: (shadeCoverOptions?: ShadeCoverOptions) => Promise<void>;method getShadeCover
getShadeCover: () => View;method open
open: (view: View, options?: RootLayoutOptions) => Promise<void>;method openShadeCover
openShadeCover: (options?: ShadeCoverOptions) => Promise<void>;method topmost
topmost: () => View;class Screen
class Screen {}An object describing general information about a display.
property mainScreen
static mainScreen: ScreenMetrics;Gets information about the main screen of the current device.
class ScrollView
class ScrollView extends ContentView {}Represents a scrollable area that can have content that is larger than its bounds.
ScrollView
property horizontalOffset
horizontalOffset: number;Gets a value that contains the horizontal offset of the scrolled content.
property iosContentInsetAdjustmentBehavior
iosContentInsetAdjustmentBehavior: | 'automatic' | 'always' | 'never' | 'scrollableAxes';iOS-only. Maps to
UIScrollView.contentInsetAdjustmentBehavior.-
never(default): NativeScript subtracts safe-area insets manually. -automatic/scrollableAxes/always: iOS manages insets — recommended with large titles to avoid scroll drift.
property isScrollEnabled
isScrollEnabled: boolean;Gets or sets a value indicating whether scroll is enabled.
property orientation
orientation: CoreTypes.OrientationType;Gets or sets direction in which the content can be scrolled.
property scrollableHeight
scrollableHeight: number;Gets the maximum value for the verticalOffset.
property scrollableWidth
scrollableWidth: number;Gets the maximum value for the horizontalOffset.
property scrollBarIndicatorVisible
scrollBarIndicatorVisible: boolean;Toggles scrollbar indicator visibility
property scrollEvent
static scrollEvent: string;String value used when hooking to scroll event.
{ScrollEventData} scroll
property verticalOffset
verticalOffset: number;Gets a value that contains the vertical offset of the scrolled content.
method on
on: { ( eventName: string, callback: (data: EventData) => void, thisArg?: any ): void; ( eventName: 'scroll', callback: (data: ScrollEventData) => void, thisArg?: any ): void;};Adds a listener for the specified event name.
Parameter eventName
The name of the event.
Parameter callback
The event listener to add. Will be called when an event of the given name is raised.
Parameter thisArg
An optional parameter which, when set, will be bound as the
thiscontext when the callback is called. Falsy values will be not be bound.Raised when a scroll event occurs.
method scrollToHorizontalOffset
scrollToHorizontalOffset: (value: number, animated: boolean) => any;Scrolls the content the specified horizontal offset position.
Parameter value
The offset value
Parameter animated
true for animated scroll, false for immediate scroll.
method scrollToVerticalOffset
scrollToVerticalOffset: (value: number, animated: boolean) => any;Scrolls the content the specified vertical offset position.
Parameter value
The offset value
Parameter animated
true for animated scroll, false for immediate scroll.
class SearchBar
class SearchBar extends View {}Represents a search bar component.
SearchBar
property android
android: any;Gets the native [android widget](http://developer.android.com/reference/android/widget/SearchView.html) that represents the user interface for this component. Valid only when running on Android OS.
property clearButtonColor
clearButtonColor: string | Color;Gets or sets the Clear Button color of the SearchBar component.
property clearEvent
static clearEvent: string;String value used when hooking to clear event.
{EventData} submit
property hint
hint: string;Gets or sets the text of the search bar text field hint/placeholder.
property ios
ios: any;Gets the native iOS [UISearchBar](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UISearchBar_Class/) that represents the user interface for this component. Valid only when running on iOS.
property submitEvent
static submitEvent: string;String value used when hooking to submit event.
{EventData} submit
property text
text: string;Gets or sets a search bar text.
property textFieldBackgroundColor
textFieldBackgroundColor: Color;Gets or sets the TextField background color of the SearchBar component.
property textFieldHintColor
textFieldHintColor: Color;Gets or sets the TextField Hint color of the SearchBar component.
method dismissSoftInput
dismissSoftInput: () => void;Hides the soft input method, usually a soft keyboard.
method on
on: { ( eventName: string, callback: (data: EventData) => void, thisArg?: any ): void; (event: 'submit', callback: (args: EventData) => void, thisArg?: any): void; (event: 'close', callback: (args: EventData) => void, thisArg?: any): void;};Adds a listener for the specified event name.
Parameter eventName
The name of the event.
Parameter callback
The event listener to add. Will be called when an event of the given name is raised.
Parameter thisArg
An optional parameter which, when set, will be bound as the
thiscontext when the callback is called. Falsy values will be not be bound.Raised when a search bar search is submitted.
Raised when a search bar search is closed.
class SegmentedBar
class SegmentedBar extends View implements AddChildFromBuilder, AddArrayFromBuilder {}Represents a UI SegmentedBar component.
SegmentedBar
property items
items: SegmentedBarItem[];Gets or sets the items of the SegmentedBar.
property selectedBackgroundColor
selectedBackgroundColor: Color;Gets or sets the selected background color of the SegmentedBar component.
property selectedIndex
selectedIndex: number;Gets or sets the selected index of the SegmentedBar component.
property selectedIndexChangedEvent
static selectedIndexChangedEvent: any;String value used when hooking to the selectedIndexChanged event.
{SelectedIndexChangedEventData} selectedIndexChanged
property selectedTextColor
selectedTextColor: Color;Gets or sets the selected text color of the SegmentedBar component.
method on
on: { ( eventName: string, callback: (data: EventData) => void, thisArg?: any ): void; ( event: 'selectedIndexChanged', callback: (args: SelectedIndexChangedEventData) => void, thisArg?: any ): void;};Adds a listener for the specified event name.
Parameter eventName
The name of the event.
Parameter callback
The event listener to add. Will be called when an event of the given name is raised.
Parameter thisArg
An optional parameter which, when set, will be bound as the
thiscontext when the callback is called. Falsy values will be not be bound.Raised when the selected index changes.
class SegmentedBarItem
class SegmentedBarItem extends ViewBase {}Represents a SegmentedBar item.
SegmentedBarItem
property title
title: string;Gets or sets the title of the SegmentedBarItem.
class SharedTransition
class SharedTransition {}Shared Element Transitions (preview) Allows you to auto animate between shared elements on two different screesn to create smooth navigational experiences. View components can define sharedTransitionTag="name" alone with a transition through this API.
property DEBUG
static DEBUG: boolean;Enable to see various console logging output of Shared Element Transition behavior.
property finishedEvent
static finishedEvent: string;When the transition finishes.
property inProgress
static inProgress: boolean;Whether a transition is in progress or not. Note: used internally however exposed in case custom state ordering is needed. Updated when transitions start/end/cancel.
property interactiveCancelledEvent
static interactiveCancelledEvent: string;When the interactive transition cancels.
property interactiveUpdateEvent
static interactiveUpdateEvent: string;When the interactive transition updates with the percent value.
property startedEvent
static startedEvent: string;When the transition starts.
method custom
static custom: ( transition: Transition, options?: SharedTransitionConfig) => { instance: Transition };Configure a custom transition with presentation/dismissal options.
Parameter transition
The custom Transition instance.
Parameter options
Returns
a configured SharedTransition instance for use with navigational APIs.
method events
static events: () => SharedTransitionObservable;Listen to various shared element transition events.
Returns
Observable
method finishState
static finishState: (id: number) => void;Finish transition state.
Parameter id
Transition instance id
method getSharedElements
static getSharedElements: ( fromPage: ViewBase, toPage: ViewBase) => { sharedElements: Array<View>; presented: Array<View>; presenting: Array<View>;};Gather view collections based on sharedTransitionTag details.
Parameter fromPage
Page moving away from
Parameter toPage
Page moving to
Returns
Collections of views pertaining to shared elements or particular pages
method getState
static getState: (id: number) => SharedTransitionState;Get current state for any transition.
Parameter id
Transition instance id
method notifyEvent
static notifyEvent: ( eventName: string, data: SharedTransitionEventDataPayload) => void;Notify a Shared Transition event.
Parameter id
transition instance id
Parameter eventName
Shared Transition event name
Parameter type
TransitionNavigationType
Parameter action
SharedTransitionEventAction
method registerExternalRoot
static registerExternalRoot: (root: ViewBase) => void;Register an NS view subtree that should be searched for sharedTransitionTag elements in addition to the source page. Use this for views that are attached to the native UI but aren't reachable from the page via the NS view tree — for example, a TabView's
iosBottomAccessory. The root and any of its descendants with asharedTransitionTagwill then participate in transitions originating from any page.Registration is idempotent. Pair with
unregisterExternalRooton teardown to avoid leaking detached views into future transitions.
method unregisterExternalRoot
static unregisterExternalRoot: (root: ViewBase) => void;Remove a previously registered external root. No-op if the root wasn't registered.
method updateState
static updateState: (id: number, state: SharedTransitionState) => void;Update transition state.
Parameter id
Transition instance id
Parameter state
SharedTransitionState
class SharedTransitionHelper
class SharedTransitionHelper {}Platform helper to aid in creating your own custom Shared Element Transition classes. (iOS Only)
method animate
static animate: ( state: SharedTransitionState, transitionContext: any, type: TransitionNavigationType) => void;method interactiveCancel
static interactiveCancel: ( state: SharedTransitionState, interactiveState: TransitionInteractiveState, type: TransitionNavigationType) => void;method interactiveFinish
static interactiveFinish: ( state: SharedTransitionState, interactiveState: TransitionInteractiveState, type: TransitionNavigationType) => void;method interactiveStart
static interactiveStart: ( state: SharedTransitionState, interactiveState: TransitionInteractiveState, type: TransitionNavigationType) => void;method interactiveUpdate
static interactiveUpdate: ( state: SharedTransitionState, interactiveState: TransitionInteractiveState, type: TransitionNavigationType, percent: number) => void;class ShorthandProperty
class ShorthandProperty<T extends Style, P> implements ShorthandProperty<T, P> {}constructor
constructor(options: ShorthandPropertyOptions<P>);property cssLocalName
readonly cssLocalName: string;property cssName
readonly cssName: string;property cssValueDescriptor
protected readonly cssValueDescriptor: PropertyDescriptor;property key
readonly key: Symbol;property localValueDescriptor
protected readonly localValueDescriptor: PropertyDescriptor;property name
readonly name: string;property sourceKey
readonly sourceKey: Symbol;method register
register: (cls: typeof Style) => void;class Slider
class Slider extends View {}Represents a slider component.
Slider
property accessibilityDecrementEvent
static readonly accessibilityDecrementEvent: string;String value used when hooking to accessibilityDecrement event.
{AccessibilityDecrementEventData} accessibilityDecrement
property accessibilityIncrementEvent
static readonly accessibilityIncrementEvent: string;String value used when hooking to accessibilityIncrement event.
{AccessibilityIncrementEventData} accessibilityIncrement
property accessibilityStep
accessibilityStep: number;Increase/Decrease step size for iOS Increment-/Decrement events
property android
android: any;Gets the native [android widget](http://developer.android.com/reference/android/widget/SeekBar.html) that represents the user interface for this component. Valid only when running on Android OS.
property ios
ios: any;Gets the native iOS [UISlider](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UISlider_Class/) that represents the user interface for this component. Valid only when running on iOS.
property maxValue
maxValue: number;Gets or sets a slider max value. The default value is 100.
property minValue
minValue: number;Gets or sets a slider min value. The default value is 0.
property value
value: number;Gets or sets a slider current value. The default value is 0.
property valueChangeEvent
static readonly valueChangeEvent: string;String value used when hooking to valueChange event.
{PropertyChangeData} valueChange
class SlideTransition
class SlideTransition extends Transition {}constructor
constructor(direction: string, duration?: number, nativeCurve?: any);class Span
class Span extends ViewBase {}A class used to create a single part of formatted string with a common text properties.
Span
property backgroundColor
backgroundColor: Color;Gets or sets the font background color of the span.
property color
color: Color;Gets or sets the font foreground color of the span.
property fontFamily
fontFamily: string;Gets or sets the font family of the span.
property fontSize
fontSize: number;Gets or sets the font size of the span.
property fontStyle
fontStyle: FontStyleType;Gets or sets the font style of the span.
property fontVariationSettings
fontVariationSettings: FontVariationSettingsType[];Gets or sets the font variation settings of the span.
property fontWeight
fontWeight: FontWeightType;Gets or sets the font weight of the span.
property iosAccessibilityAdjustsFontSize
iosAccessibilityAdjustsFontSize: boolean;Defines whether accessibility font scale should affect font size.
property iosAccessibilityMaxFontScale
iosAccessibilityMaxFontScale: number;Gets or sets the maximum accessibility font scale.
property iosAccessibilityMinFontScale
iosAccessibilityMinFontScale: number;Gets or sets the minimum accessibility font scale.
property linkTapEvent
static linkTapEvent: string;String value used when hooking to linkTap event.
linkTap
property parent
declare parent: FormattedString;property tappable
readonly tappable: boolean;Gets if the span is tappable or not.
property text
text: string;Gets or sets the text for the span.
property textDecoration
textDecoration: CoreTypes.TextDecorationType;Gets or sets text decorations for the span.
class SplitView
class SplitView extends SplitViewBase {}iOS UISplitViewController-backed container. On Android, acts as a simple container.
SplitView
class StackLayout
class StackLayout extends LayoutBase {}A Layout that arranges its children horizontally or vertically. The direction can be set by orientation property.
StackLayout
property orientation
orientation: CoreTypes.OrientationType;Gets or sets if layout should be horizontal or vertical. The default value is vertical.
class Style
class Style extends Observable {}constructor
constructor(ownerView: ViewBase | WeakRef<ViewBase>);property accessibilityHidden
accessibilityHidden: boolean;property accessibilityLanguage
accessibilityLanguage: string;property accessibilityLiveRegion
accessibilityLiveRegion: AccessibilityLiveRegion;property accessibilityMediaSession
accessibilityMediaSession: boolean;property accessibilityRole
accessibilityRole: AccessibilityRole;property accessibilityState
accessibilityState: AccessibilityState;property accessibilityStep
accessibilityStep: number;property accessible
accessible: boolean;property alignContent
alignContent: AlignContent;property alignItems
alignItems: AlignItems;property alignSelf
alignSelf: AlignSelf;property androidContentInset
androidContentInset: | string | number | CoreTypes.LengthDipUnit | CoreTypes.LengthPxUnit;property androidContentInsetLeft
androidContentInsetLeft: CoreTypes.LengthType;property androidContentInsetRight
androidContentInsetRight: CoreTypes.LengthType;property androidDynamicElevationOffset
androidDynamicElevationOffset: number;property androidElevation
androidElevation: number;property androidSelectedTabHighlightColor
androidSelectedTabHighlightColor: Color;property androidStatusBarBackground
androidStatusBarBackground: Color;property background
background: string;property backgroundColor
backgroundColor: Color;property backgroundImage
backgroundImage: string | LinearGradient;property backgroundInternal
backgroundInternal: Background;property backgroundPosition
backgroundPosition: string;property backgroundRepeat
backgroundRepeat: CoreTypes.BackgroundRepeatType;property backgroundSize
backgroundSize: string;property borderBottomColor
borderBottomColor: Color;property borderBottomLeftRadius
borderBottomLeftRadius: CoreTypes.LengthType;property borderBottomRightRadius
borderBottomRightRadius: CoreTypes.LengthType;property borderBottomWidth
borderBottomWidth: CoreTypes.LengthType;property borderColor
borderColor: string | Color;property borderLeftColor
borderLeftColor: Color;property borderLeftWidth
borderLeftWidth: CoreTypes.LengthType;property borderRadius
borderRadius: string | number | CoreTypes.LengthDipUnit | CoreTypes.LengthPxUnit;property borderRightColor
borderRightColor: Color;property borderRightWidth
borderRightWidth: CoreTypes.LengthType;property borderTopColor
borderTopColor: Color;property borderTopLeftRadius
borderTopLeftRadius: CoreTypes.LengthType;property borderTopRightRadius
borderTopRightRadius: CoreTypes.LengthType;property borderTopWidth
borderTopWidth: CoreTypes.LengthType;property borderWidth
borderWidth: string | number | CoreTypes.LengthDipUnit | CoreTypes.LengthPxUnit;property boxShadow
boxShadow: string | ShadowCSSValues[];property clipPath
clipPath: string | ClipPathFunction;property color
color: Color;property columnGap
columnGap: CoreTypes.LengthType;property cornerShape
cornerShape: CoreTypes.CornerShapeType;The curve used to round the corners: 'round' (circular arcs, the default) or 'squircle' (Apple's continuous corner curve). iOS only; Android always renders circular corners.
property direction
direction: CoreTypes.LayoutDirectionType;property flex
flex: Flex;property flexDirection
flexDirection: FlexDirection;property flexFlow
flexFlow: | 'row nowrap' | 'row wrap' | 'row wrap-reverse' | 'row-reverse nowrap' | 'row-reverse wrap' | 'row-reverse wrap-reverse' | 'column nowrap' | 'column wrap' | 'column wrap-reverse' | 'column-reverse nowrap' | 'column-reverse wrap' | 'column-reverse wrap-reverse';property flexGrow
flexGrow: number;property flexShrink
flexShrink: number;property flexWrap
flexWrap: FlexWrap;property flexWrapBefore
flexWrapBefore: boolean;property font
font: string;property fontFamily
fontFamily: string;property fontInternal
fontInternal: Font;property fontScaleInternal
fontScaleInternal: number;This property ensures inheritance of a11y scale among views.
property fontSize
fontSize: number;property fontStyle
fontStyle: FontStyleType;property fontVariationSettings
fontVariationSettings: FontVariationSettingsType[];property fontWeight
fontWeight: FontWeightType;property gap
gap: string | number | CoreTypes.LengthDipUnit | CoreTypes.LengthPxUnit;property height
height: CoreTypes.PercentLengthType;property horizontalAlignment
horizontalAlignment: CoreTypes.HorizontalAlignmentType;property iconFontFamily
iconFontFamily: string;property iosAccessibilityAdjustsFontSize
iosAccessibilityAdjustsFontSize: boolean;property iosAccessibilityMaxFontScale
iosAccessibilityMaxFontScale: number;property iosAccessibilityMinFontScale
iosAccessibilityMinFontScale: number;property justifyContent
justifyContent: JustifyContent;property letterSpacing
letterSpacing: number;property lineHeight
lineHeight: number;property margin
margin: | string | number | CoreTypes.LengthDipUnit | CoreTypes.LengthPxUnit | CoreTypes.LengthPercentUnit;property marginBottom
marginBottom: CoreTypes.PercentLengthType;property marginLeft
marginLeft: CoreTypes.PercentLengthType;property marginRight
marginRight: CoreTypes.PercentLengthType;property marginTop
marginTop: CoreTypes.PercentLengthType;property maxHeight
maxHeight: CoreTypes.PercentLengthType;property maxLines
maxLines: number;property maxWidth
maxWidth: CoreTypes.PercentLengthType;property minHeight
minHeight: CoreTypes.LengthType;property minWidth
minWidth: CoreTypes.LengthType;property opacity
opacity: number;property order
order: number;property padding
padding: string | number | CoreTypes.LengthDipUnit | CoreTypes.LengthPxUnit;property paddingBottom
paddingBottom: CoreTypes.LengthType;property paddingInternal
paddingInternal: string;property paddingLeft
paddingLeft: CoreTypes.LengthType;property paddingRight
paddingRight: CoreTypes.LengthType;property paddingTop
paddingTop: CoreTypes.LengthType;property perspective
perspective: number;property placeholderColor
placeholderColor: Color;property PropertyBag
PropertyBag: { new (): { [property: string]: string }; prototype: { [property: string]: string };};property rotate
rotate: number;property rotateX
rotateX: number;property rotateY
rotateY: number;property rowGap
rowGap: CoreTypes.LengthType;property scaleX
scaleX: number;property scaleY
scaleY: number;property selectedBackgroundColor
selectedBackgroundColor: Color;property selectedTabTextColor
selectedTabTextColor: Color;property selectedTextColor
selectedTextColor: Color;property separatorColor
separatorColor: Color;property statusBarStyle
statusBarStyle: 'dark' | 'light';property tabBackgroundColor
tabBackgroundColor: Color;property tabTextColor
tabTextColor: Color;property tabTextFontSize
tabTextFontSize: number;property textAlignment
textAlignment: CoreTypes.TextAlignmentType;property textDecoration
textDecoration: CoreTypes.TextDecorationType;property textOverflow
textOverflow: CoreTypes.TextOverflowType;property textShadow
textShadow: ShadowCSSValues;property textStroke
textStroke: StrokeCSSValues;property textTransform
textTransform: CoreTypes.TextTransformType;property tintColor
tintColor: Color;property translateX
translateX: number;property translateY
translateY: number;property verticalAlignment
verticalAlignment: CoreTypes.VerticalAlignmentType;property view
readonly view: ViewBase;property viewRef
viewRef: WeakRef<ViewBase>;property visibility
visibility: CoreTypes.VisibilityType;property whiteSpace
whiteSpace: CoreTypes.WhiteSpaceType;property width
width: CoreTypes.PercentLengthType;property zIndex
zIndex: number;method getCssVariable
getCssVariable: (varName: string) => string | null;method removeScopedCssVariable
removeScopedCssVariable: (varName: string) => void;method removeUnscopedCssVariable
removeUnscopedCssVariable: (varName: string) => void;method resetScopedCssVariables
resetScopedCssVariables: () => void;method resetUnscopedCssVariables
resetUnscopedCssVariables: () => void;method setScopedCssVariable
setScopedCssVariable: (varName: string, value: string) => void;method setUnscopedCssVariable
setUnscopedCssVariable: (varName: string, value: string) => void;method toString
toString: () => string;class Switch
class Switch extends View {}Represents a switch component.
Switch
property android
android: any;Gets the native [android widget](http://developer.android.com/reference/android/widget/Switch.html) that represents the user interface for this component. Valid only when running on Android OS.
property checked
checked: boolean;Gets or sets if a switch is checked or not.
property checkedChangeEvent
static checkedChangeEvent: string;String value used when hooking to checkedChange event.
{PropertyChangeData} checkedChange
property ios
ios: any;Gets the native iOS [UISwitch](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UISwitch_Class/) that represents the user interface for this component. Valid only when running on iOS.
property offBackgroundColor
offBackgroundColor: Color;Gets or sets the background color of the Switch when it is turned off.
class TabView
class TabView extends View {}Represents a tab view.
TabView
property android
android: any;Gets the native [android widget](http://developer.android.com/reference/android/support/v4/view/ViewPager.html) that represents the user interface for this component. Valid only when running on Android OS.
property androidIconRenderingMode
androidIconRenderingMode: 'alwaysOriginal' | 'alwaysTemplate';Gets or sets the rendering mode of tab icons on Android. Defaults to "original" Valid values are: - alwaysOriginal - alwaysTemplate
property androidOffscreenTabLimit
androidOffscreenTabLimit: number;Gets or sets the number of tabs that should be retained to either side of the current tab in the view hierarchy in an idle state. Tabs beyond this limit will be recreated from the TabView when needed.
property androidSelectedTabHighlightColor
androidSelectedTabHighlightColor: Color;Gets or sets the color of the horizontal line drawn below the currently selected tab on Android.
property androidSwipeEnabled
androidSwipeEnabled: boolean;Gets or sets a value indicating whether swipe gesture is enabled for Android.
property androidTabsPosition
androidTabsPosition: 'top' | 'bottom';Gets or set the tabs vertical position. Valid values are: - top - bottom
property ios
ios: any;Gets the native iOS [UITabBarController](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UITabBarController_Class/) that represents the user interface for this component. Valid only when running on iOS.
property iosBottomAccessory
iosBottomAccessory: View;iOS 26+: Optional bottom accessory view that appears above the tab bar. Provide a NativeScript View instance. On platforms < iOS 26 this is ignored.
property iosIconRenderingMode
iosIconRenderingMode: 'automatic' | 'alwaysOriginal' | 'alwaysTemplate';Gets or set the UIImageRenderingMode of the tab icons in iOS. Defaults to "automatic" Valid values are: - automatic - alwaysOriginal - alwaysTemplate
property iosTabBarMinimizeBehavior
iosTabBarMinimizeBehavior: TabBarMinimizeType;Gets or sets the iOS tab bar minimize behavior (iOS 26+).
property items
items: TabViewItem[];Gets or sets the items of the TabView.
property selectedIndex
selectedIndex: number;Gets or sets the selectedIndex of the TabView.
property selectedIndexChangedEvent
static selectedIndexChangedEvent: string;String value used when hooking to the selectedIndexChanged event.
{SelectedIndexChangedEventData} selectedIndexChanged
property selectedTabTextColor
selectedTabTextColor: Color;Gets or sets the text color of the selected tab title.
property tabBackgroundColor
tabBackgroundColor: Color;Gets or sets the background color of the tabs.
property tabTextColor
tabTextColor: Color;Gets or sets the text color of the tabs titles.
property tabTextFontSize
tabTextFontSize: number;Gets or sets the font size of the tabs titles.
method on
on: { ( eventName: string, callback: (data: EventData) => void, thisArg?: any ): void; ( event: 'selectedIndexChanged', callback: (args: SelectedIndexChangedEventData) => void, thisArg?: any ): void;};Adds a listener for the specified event name.
Parameter eventName
The name of the event.
Parameter callback
The event listener to add. Will be called when an event of the given name is raised.
Parameter thisArg
An optional parameter which, when set, will be bound as the
thiscontext when the callback is called. Falsy values will be not be bound.Raised when the selected index changes.
class TabViewItem
class TabViewItem extends ViewBase {}Represents a tab view entry.
TabViewItem
property canBeLoaded
canBeLoaded?: boolean;property iconSource
iconSource: string;Gets or sets the icon source of the TabViewItem. This could either be a a file name or resource id.
property role
role: string;Gets or sets the role of the TabViewItem.
property textTransform
textTransform: CoreTypes.TextTransformType;Gets or sets the text transform of the tab titles.
property title
title: string;Gets or sets the title of the TabViewItem.
property view
view: View;Gets or sets the view of the TabViewItem.
class TextBase
class TextBase extends View implements AddChildFromBuilder {}TextBase
property fontFamily
fontFamily: string;Gets or sets font-family style property.
property fontSize
fontSize: number;Gets or sets font-size style property.
property fontStyle
fontStyle: FontStyleType;Gets or sets font-style style property.
property fontWeight
fontWeight: FontWeightType;Gets or sets font-weight style property.
property formattedText
formattedText: FormattedString;Gets or sets a formatted string.
property iosTextAnimation
iosTextAnimation: boolean | 'inherit';Specify wether the native text should be applied with or without animations
property iosTextAnimationFallback
static iosTextAnimationFallback: boolean;The value used when the iosTextAnimation is set to 'inherit'
property letterSpacing
letterSpacing: number;Gets or sets letterSpace style property.
property lineHeight
lineHeight: number;Gets or sets lineHeight style property.
property maxLines
maxLines: number;Gets or sets white space style property.
property nativeTextViewProtected
readonly nativeTextViewProtected: any;Gets of the text widget. In some cases(android TextInputLayout) the TextView is made of 2 views: the layout and the text view So we need a different getter for the layout and text functions
property padding
padding: string | number | CoreTypes.LengthDipUnit | CoreTypes.LengthPxUnit;Gets or sets padding style property.
property paddingBottom
paddingBottom: CoreTypes.LengthType;Specify the bottom padding of this layout.
property paddingLeft
paddingLeft: CoreTypes.LengthType;Specify the left padding of this layout.
property paddingRight
paddingRight: CoreTypes.LengthType;Specify the right padding of this layout.
property paddingTop
paddingTop: CoreTypes.LengthType;Specify the top padding of this layout.
property text
text: string;Gets or sets the text.
property textAlignment
textAlignment: CoreTypes.TextAlignmentType;Gets or sets text-alignment style property.
property textDecoration
textDecoration: CoreTypes.TextDecorationType;Gets or sets text decorations style property.
property textOverflow
textOverflow: CoreTypes.TextOverflowType;Gets or sets text-overflow style property.
property textShadow
textShadow: ShadowCSSValues;Gets or sets text shadow style property.
property textStroke
textStroke: StrokeCSSValues;Gets or sets text stroke style property.
property textTransform
textTransform: CoreTypes.TextTransformType;Gets or sets text transform style property.
property whiteSpace
whiteSpace: CoreTypes.WhiteSpaceType;Gets or sets white space style property.
class TextField
class TextField extends EditableTextBase {}Represents an editable text field.
TextField
property android
android: any;Gets the native [android widget](http://developer.android.com/reference/android/widget/EditText.html) that represents the user interface for this component. Valid only when running on Android OS.
property closeOnReturn
closeOnReturn: boolean;Gets or sets if a text field should dismiss on return.
property ios
ios: any;Gets the native iOS [UITextField](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UITextField_Class/) that represents the user interface for this component. Valid only when running on iOS.
property returnPressEvent
static returnPressEvent: string;String value used when hooking to the returnPress event.
returnPress
property secure
secure: boolean;Gets or sets if a text field is for password entry.
property secureWithoutAutofill
secureWithoutAutofill: boolean;iOS only (to avoid 12+ auto suggested strong password handling)
class TextView
class TextView extends EditableTextBase {}Represents an editable multiline text view.
TextView
property android
android: any;Gets the native [android widget](http://developer.android.com/reference/android/widget/EditText.html) that represents the user interface for this component. Valid only when running on Android OS.
property enableWritingToolsEvents
enableWritingToolsEvents: boolean;(iOS Only) Allow Apple Intelligence writing tools to emit text changes on each alteration instead of after the final change (default).
property ios
ios: any;Gets the native iOS [UITextView](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UITextView_Class/) that represents the user interface for this component. Valid only when running on iOS.
property isWritingToolsActive
isWritingToolsActive: boolean;(iOS Only) Are Apple Intelligence writing tools active
property maxLines
maxLines: number;Limits input to a certain number of lines.
property returnPressEvent
static returnPressEvent: string;String value used when hooking to the returnPress event.
returnPress
class TimePicker
class TimePicker extends View {}Represents an time picker.
TimePicker
property android
android: any;Gets the native [android.widget.TimePicker](http://developer.android.com/reference/android/widget/TimePicker.html) that represents the user interface for this component. Valid only when running on Android OS.
property hour
hour: number;Gets or sets the time hour.
property ios
ios: any;Gets the native iOS [UIDatePicker](http://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UIDatePicker_Class/index.html) that represents the user interface for this component. Valid only when running on iOS.
property iosPreferredDatePickerStyle
iosPreferredDatePickerStyle: number;Gets or set the UIDatePickerStyle of the date picker in iOS 13.4+. Defaults to 0. Valid values are numbers: - 0: automatic (system picks the concrete style based on the current platform and date picker mode) - 1: wheels (the date picker displays as a wheel picker) - 2: compact (the date picker displays as a label that when tapped displays a calendar-style editor) - 3: inline (the date pickers displays as an inline, editable field)
property maxHour
maxHour: number;Gets or sets the max time hour.
property maxMinute
maxMinute: number;Gets or sets the max time minute.
property minHour
minHour: number;Gets or sets the min time hour.
property minMinute
minMinute: number;Gets or sets the min time minute.
property minute
minute: number;Gets or sets the time minute.
property minuteInterval
minuteInterval: number;Gets or sets the minute interval.
property time
time: Date;Gets or sets the time.
property timeChangeEvent
static timeChangeEvent: string;String value used when hooking to the timeChange event.
timeChange
class TouchGestureEventData
class TouchGestureEventData {}property action
action: string;property android
android: android.view.MotionEvent;property eventName
eventName: string;property ios
ios: any;property object
object: any;property type
type: GestureTypes;property view
view: View;method getActivePointers
getActivePointers: () => Array<Pointer>;method getAllPointers
getAllPointers: () => Array<Pointer>;method getPointerCount
getPointerCount: () => number;method getX
getX: () => number;method getY
getY: () => number;method prepare
prepare: (view: View, e: any) => void;class TouchManager
class TouchManager {}Manage interactivity in your apps easily with TouchManager. Store reusable down/up animation settings for touches as well as optionally enable automatic tap (down/up) animations for your app.
property animations
static animations: TouchAnimationOptions;Define reusable touch animations to use on views with touchAnimation defined or with enableGlobalTapAnimations on.
property enableGlobalHoverWhereTap
static enableGlobalHoverWhereTap: boolean;(visionOS Only) Enable hoverStyle for all tap bindings in the UI.
property enableGlobalTapAnimations
static enableGlobalTapAnimations: boolean;Enable animations for all tap bindings in the UI.
property touchAnimationDefinitions
static touchAnimationDefinitions: { view: View; animation: Animation; type: TouchAnimationTypes;}[];When using NativeScript AnimationDefinition's for touch animations this will contain any instances for finer grain control of starting/stopping under various circumstances. The TouchManager uses this internally but makes public for other versatility if needed.
property touchHandlers
static touchHandlers: { view: View; handler: any }[];Native Touch handlers (iOS only) registered with the view through the TouchManager. The TouchManager uses this internally but makes public for other versatility if needed.
property visionHoverOptions
static visionHoverOptions: { [key: string]: VisionHoverOptions };Define reusable hover styles keyed by name to use throughout your UI.
property visionHoverStyleCache
static visionHoverStyleCache: { [key: string]: UIHoverStyle };Used internally - defines reusable UIHoverStyle's
method addAnimations
static addAnimations: (view: View) => void;The TouchManager uses this internally. Adds touch animations to view based upon it's touchAnimation property or TouchManager.animations.
Parameter view
NativeScript view instance
method addHoverStyle
static addHoverStyle: (view: View) => void;The TouchManager uses this internally. Adds visionOS hover styles to views based upon it's visionHoverStyle property
Parameter view
NativeScript view instance
method startAnimationForType
static startAnimationForType: (view: View, type: TouchAnimationTypes) => void;class Transition
class Transition {}constructor
constructor(duration?: number, nativeCurve?: any);property AndroidTransitionType
static AndroidTransitionType?: { enter?: string; exit?: string; popEnter?: string; popExit?: string;};property id
id: number;property interactiveController
interactiveController?: any;property name
name?: string;(Optional) Provide a unique name to identify this transition
property presented
presented?: any;property presenting
presenting?: any;property sharedElements
sharedElements?: { presented?: Array<SharedElementSettings>; presenting?: Array<SharedElementSettings>; independent?: Array<SharedElementSettings & { isPresented?: boolean }>; _allPresentingViews?: Array<View>;};property transitionController
transitionController?: any;method androidFragmentTransactionCallback
androidFragmentTransactionCallback: ( fragmentTransaction: any, currentEntry: BackstackEntry, newEntry: BackstackEntry) => void;method animateIOSTransition
animateIOSTransition: ( transitionContext: any, fromViewCtrl: any, toViewCtrl: any, operation: any) => void;method createAndroidAnimator
createAndroidAnimator: (transitionType: string) => any;method getCurve
getCurve: () => any;method getDuration
getDuration: () => number;method iosDismissedController
iosDismissedController: (dismissed: any) => any;method iosInteractionDismiss
iosInteractionDismiss: (animator: any) => any;method iosInteractionPresented
iosInteractionPresented: (animator: any) => any;method iosNavigatedController
iosNavigatedController: ( navigationController: any, operation: number, fromVC: any, toVC: any) => any;method iosPresentedController
iosPresentedController: (presented: any, presenting: any, source: any) => any;method setDuration
setDuration: (value: number) => void;method setupInteractiveGesture
setupInteractiveGesture: (startCallback: () => void, view: View) => void;class View
abstract class View extends ViewCommon {}This class is the base class for all UI components. A View occupies a rectangular area on the screen and is responsible for drawing and layouting of all UI components within.
View
property accessibilityBlurEvent
static accessibilityBlurEvent: string;String value used when hooking to accessibilityBlur event.
accessibilityBlur
property accessibilityFocusChangedEvent
static accessibilityFocusChangedEvent: string;String value used when hooking to accessibilityFocusChanged event.
{EventDataValue} accessibilityFocusChanged
property accessibilityFocusEvent
static accessibilityFocusEvent: string;String value used when hooking to accessibilityFocus event.
accessibilityFocus
property accessibilityHidden
accessibilityHidden: boolean;Hide the view and its children from the a11y service
property accessibilityHint
accessibilityHint: string;A hint describes the elements behavior. Example: 'Tap change playback speed'
property accessibilityIdentifier
accessibilityIdentifier: string;The view's unique accessibilityIdentifier.
This is used for automated testing.
property accessibilityIgnoresInvertColors
accessibilityIgnoresInvertColors: boolean;property accessibilityLabel
accessibilityLabel: string;Short description of the element, ideally one word.
property accessibilityLanguage
accessibilityLanguage: string;Sets the language in which to speak the element's label and value. Accepts language ID tags that follows the "BCP 47" specification.
property accessibilityLiveRegion
accessibilityLiveRegion: AccessibilityLiveRegion;When components dynamically change, we want TalkBack to alert the end user. This is made possible by the accessibilityLiveRegion property.
property accessibilityMediaSession
accessibilityMediaSession: boolean;This view starts a media session. Equivalent to trait = startsMedia
property accessibilityRole
accessibilityRole: AccessibilityRole;Which role should this view be treated by the a11y service?
property accessibilityState
accessibilityState: AccessibilityState;Which state should this view be treated as by the a11y service?
property accessibilityValue
accessibilityValue: string;Current value of the element in a localized string.
property accessible
accessible: boolean;If
truethe element is an accessibility element and all the children will be treated as a single selectable component.
property android
android: any;Gets the android-specific native instance that lies behind this proxy. Will be available if running on an Android platform.
property androidDynamicElevationOffset
androidDynamicElevationOffset: number;Gets or sets the dynamic elevation offset of the android view.
property androidElevation
androidElevation: number;Gets or sets the elevation of the android view.
property androidOverflowInsetEvent
static androidOverflowInsetEvent: string;String value used when hooking to androidOverflowInset event.
{EventDataValue} androidOverflowInset
property automationText
automationText: string;property background
background: string;Gets or sets the background style property.
property backgroundColor
backgroundColor: string | Color;Gets or sets the background color of the view.
property backgroundImage
backgroundImage: string | LinearGradient;Gets or sets the background image of the view.
property bindingContext
bindingContext: any;Gets or sets the binding context of this instance. This object is used as a source for each Binding that does not have a source object specified.
property borderBottomColor
borderBottomColor: Color;Gets or sets the bottom border color of the view.
property borderBottomLeftRadius
borderBottomLeftRadius: CoreTypes.LengthType;Gets or sets the bottom left border radius of the view.
property borderBottomRightRadius
borderBottomRightRadius: CoreTypes.LengthType;Gets or sets the bottom right border radius of the view.
property borderBottomWidth
borderBottomWidth: CoreTypes.LengthType;Gets or sets the bottom border width of the view.
property borderColor
borderColor: string | Color;Gets or sets the border color of the view.
property borderLeftColor
borderLeftColor: Color;Gets or sets the left border color of the view.
property borderLeftWidth
borderLeftWidth: CoreTypes.LengthType;Gets or sets the left border width of the view.
property borderRadius
borderRadius: string | number | CoreTypes.LengthDipUnit | CoreTypes.LengthPxUnit;Gets or sets the border radius of the view.
property borderRightColor
borderRightColor: Color;Gets or sets the right border color of the view.
property borderRightWidth
borderRightWidth: CoreTypes.LengthType;Gets or sets the right border width of the view.
property borderTopColor
borderTopColor: Color;Gets or sets the top border color of the view.
property borderTopLeftRadius
borderTopLeftRadius: CoreTypes.LengthType;Gets or sets the top left border radius of the view.
property borderTopRightRadius
borderTopRightRadius: CoreTypes.LengthType;Gets or sets the top right border radius of the view.
property borderTopWidth
borderTopWidth: CoreTypes.LengthType;Gets or sets the top border width of the view.
property borderWidth
borderWidth: string | number | CoreTypes.LengthDipUnit | CoreTypes.LengthPxUnit;Gets or sets the border width of the view.
property boxShadow
boxShadow: string | ShadowCSSValues[];Gets or sets the box shadow of the view.
property closedModallyEvent
static closedModallyEvent: string;String value used when hooking to closedModally event. Fired on the modal view once its native dismissal has fully completed (after the close callback and UI teardown).
{EventData} closedModally
property color
color: Color;Gets or sets the color of the view.
property css
css: string;A valid css string which will be applied for all nested UI components (based on css rules).
property cssClasses
cssClasses: Set<string>;property cssPseudoClasses
cssPseudoClasses: Set<string>;property cssType
cssType: string;Gets the CSS fully qualified type name. Using this as element type should allow for PascalCase and kebap-case selectors, when fully qualified, to match the element.
property direction
direction: CoreTypes.LayoutDirectionType;Gets or sets the layout direction of the view.
property flex
flex: Flex;The flex shorthand property sets how a flex item will grow or shrink to fit the space available in its flex container.
property flexFlow
flexFlow: FlexFlow;The flex-flow Shorthand property specifies the direction of a flex container, as well as its wrapping behavior.
property height
height: CoreTypes.PercentLengthType;Gets or sets the desired height of the view.
property horizontalAlignment
horizontalAlignment: CoreTypes.HorizontalAlignmentType;Gets or sets the alignment of this view within its parent along the Horizontal axis.
property ignoreTouchAnimation
ignoreTouchAnimation: boolean;property ios
ios: any;Gets the ios-specific native instance that lies behind this proxy. Will be available if running on an iOS platform.
property iosAccessibilityAdjustsFontSize
iosAccessibilityAdjustsFontSize: boolean;Defines whether accessibility font scale should affect font size.
property iosAccessibilityMaxFontScale
iosAccessibilityMaxFontScale: number;Gets or sets the maximum accessibility font scale.
property iosAccessibilityMinFontScale
iosAccessibilityMinFontScale: number;Gets or sets the minimum accessibility font scale.
property iosGlassEffect
iosGlassEffect: GlassEffectType;Set the iOS liquid glass effect style on the view.
property iosIgnoreSafeArea
iosIgnoreSafeArea: boolean;Gets or sets a value indicating whether the the view should totally ignore safe areas computation. This property is iOS specific. Default value: false
property iosOverflowSafeArea
iosOverflowSafeArea: boolean;Instruct container view to expand beyond the safe area. This property is iOS specific. Default value: false
property iosOverflowSafeAreaEnabled
iosOverflowSafeAreaEnabled: boolean;Enables or disables the iosOverflowSafeArea property for all children. This property is iOS specific. Default value: true
property isEnabled
isEnabled: boolean;Gets or sets a value indicating whether the the view is enabled. This affects the appearance of the view.
property isLayoutRequired
isLayoutRequired: boolean;property isLayoutValid
isLayoutValid: boolean;Gets if layout is valid. This is a read-only property.
property isUserInteractionEnabled
isUserInteractionEnabled: boolean;Gets or sets a value indicating whether the user can interact with the view. This does not affect the appearance of the view.
property layoutChangedEvent
static layoutChangedEvent: string;String value used when hooking to layoutChanged event.
layoutChanged
property margin
margin: | string | number | CoreTypes.LengthDipUnit | CoreTypes.LengthPxUnit | CoreTypes.LengthPercentUnit;Gets or sets margin style property.
property marginBottom
marginBottom: CoreTypes.PercentLengthType;Specifies extra space on the bottom side of this view.
property marginLeft
marginLeft: CoreTypes.PercentLengthType;Specifies extra space on the left side of this view.
property marginRight
marginRight: CoreTypes.PercentLengthType;Specifies extra space on the right side of this view.
property marginTop
marginTop: CoreTypes.PercentLengthType;Specifies extra space on the top side of this view.
property maxHeight
maxHeight: CoreTypes.PercentLengthType;Gets or sets the maximum height the view may grow to. Accepts a fixed length or a percentage of the available height. Defaults to 'auto' (no maximum).
property maxWidth
maxWidth: CoreTypes.PercentLengthType;Gets or sets the maximum width the view may grow to. Accepts a fixed length or a percentage of the available width. Defaults to 'auto' (no maximum).
property minHeight
minHeight: CoreTypes.LengthType;Gets or sets the minimum height the view may grow to.
property minWidth
minWidth: CoreTypes.LengthType;Gets or sets the minimum width the view may grow to.
property modal
modal: View;Returns the current modal view that this page is showing (is parent of), if any.
property nativeBackgroundState
nativeBackgroundState?: 'unset' | 'invalid' | 'drawn';Native background states. This is a read-only property.
property needsNativeDrawableFill
readonly needsNativeDrawableFill: boolean;property opacity
opacity: number;Gets or sets the opacity style property.
property originX
originX: number;Gets or sets the X component of the origin point around which the view will be transformed. The default value is 0.5 representing the center of the view.
property originY
originY: number;Gets or sets the Y component of the origin point around which the view will be transformed. The default value is 0.5 representing the center of the view.
property perspective
perspective: number;Gets or sets the distance of the camera form the view perspective. Usually needed when rotating the view over the X or Y axis.
property rotate
rotate: number;Gets or sets the rotate affine transform of the view along the Z axis.
property rotateX
rotateX: number;Gets or sets the rotate affine transform of the view along the X axis.
property rotateY
rotateY: number;Gets or sets the rotate affine transform of the view along the Y axis.
property scaleX
scaleX: number;Gets or sets the scaleX affine transform of the view.
property scaleY
scaleY: number;Gets or sets the scaleY affine transform of the view.
property showingModallyEvent
static showingModallyEvent: string;String value used when hooking to showingModally event.
{ShownModallyData} showingModally
property shownModallyEvent
static shownModallyEvent: string;String value used when hooking to shownModally event.
{ShownModallyData} shownModally
property statusBarStyle
statusBarStyle: 'dark' | 'light';Gets or sets the status bar style for this view. Platform Notes: - Android: When using this property throughout navigations, ensure starting views have it set as well. Ensures it will reset on back navigation. - iOS: You must remove Info.plist key
UIViewControllerBasedStatusBarAppearanceIt defaults to true when not present: https://developer.apple.com/documentation/bundleresources/information-property-list/uiviewcontrollerbasedstatusbarappearance Or you can explicitly set it to true: UIViewControllerBasedStatusBarAppearanceFalse value will make this property have no effect.
property testID
testID: string;property touchAnimation
touchAnimation: boolean | TouchAnimationOptions;property touchDelay
touchDelay: number;property translateX
translateX: number;Gets or sets the translateX affine transform of the view in device independent pixels.
property translateY
translateY: number;Gets or sets the translateY affine transform of the view in device independent pixels.
property verticalAlignment
verticalAlignment: CoreTypes.VerticalAlignmentType;Gets or sets the alignment of this view within its parent along the Vertical axis.
property visibility
visibility: CoreTypes.VisibilityType;Gets or sets the visibility of the view.
property visionHoverStyle
visionHoverStyle: string | VisionHoverOptions;visionOS only
property visionIgnoreHoverStyle
visionIgnoreHoverStyle: boolean;visionOS only
property width
width: CoreTypes.PercentLengthType;Gets or sets the desired width of the view.
method accessibilityAnnouncement
accessibilityAnnouncement: (msg?: string) => void;Make an announcement to the screen reader.
method accessibilityScreenChanged
accessibilityScreenChanged: () => void;Announce screen changed
method addCss
addCss: (cssString: string) => void;Adds a new values to current css.
Parameter cssString
A valid css which will be added to current css.
method addCssFile
addCssFile: (cssFileName: string) => void;Adds the content of the file to the current css.
Parameter cssFileName
A valid file name (from the application root) which contains a valid css.
method animate
animate: (options: AnimationDefinition) => AnimationPromise;Animates one or more properties of the view based on the supplied options.
method changeCssFile
changeCssFile: (cssFileName: string) => void;Changes the current css to the content of the file.
Parameter cssFileName
A valid file name (from the application root) which contains a valid css.
method combineMeasuredStates
static combineMeasuredStates: (curState: number, newState: any) => number;method createAnimation
createAnimation: (options: AnimationDefinition) => Animation;Creates an Animation object based on the supplied options.
method eachChildView
eachChildView: (callback: (view: View) => boolean) => void;Iterates over children of type View.
Parameter callback
Called for each child of type View. Iteration stops if this method returns falsy value.
method focus
focus: () => boolean;Tries to focus the view. Returns a value indicating whether this view or one of its descendants actually took focus.
method getActualSize
getActualSize: () => Size;Returns the actual size of the view in device-independent pixels.
method getGestureObservers
getGestureObservers: (type: GestureTypes) => Array<GesturesObserver> | undefined;method getLocationInWindow
getLocationInWindow: () => Point;Returns the location of this view in the window coordinate system.
method getLocationOnScreen
getLocationOnScreen: () => Point;Returns the location of this view in the screen coordinate system.
method getLocationRelativeTo
getLocationRelativeTo: (otherView: View) => Point;Returns the location of this view in the otherView's coordinate system.
method getMeasuredHeight
getMeasuredHeight: () => number;Returns the raw height component.
method getMeasuredState
getMeasuredState: () => number;method getMeasuredWidth
getMeasuredWidth: () => number;Returns the raw width component.
method getNativeWindow
getNativeWindow: () => NativeWindow | undefined;The window currently hosting this view, or
undefinedwhen the view is not part of any window's view tree — including a view whose window has been closed.Resolved on every call by walking up to the root view — through the presenting view of any modal on the way — so a view re-parented into another window's tree reports the window it moved to.
method getSafeAreaInsets
getSafeAreaInsets: () => Position;Returns the iOS safe area insets of this view.
method hasGestureObservers
hasGestureObservers: () => boolean;Android only check if gesture observers are attached
method layout
layout: ( left: number, top: number, right: number, bottom: number, setFrame?: boolean) => void;Assign a size and position to a view and all of its descendants This is the second phase of the layout mechanism. (The first is measuring). In this phase, each parent calls layout on all of its children to position them. This is typically done using the child measurements that were stored in the measure pass(). Derived classes should not override this method. Derived classes with children should override onLayout. In that method, they should call layout on each of their children.
Parameter l
Left position, relative to parent
Parameter t
Top position, relative to parent
Parameter r
Right position, relative to parent
Parameter b
Bottom position, relative to parent
method layoutChild
static layoutChild: ( parent: View, child: View, left: number, top: number, right: number, bottom: number) => void;Layout a child by taking into account its margins, horizontal and vertical alignments and a given bounds.
Parameter parent
This parameter is not used. You can pass null.
Parameter left
Left position, relative to parent
Parameter top
Top position, relative to parent
Parameter right
Right position, relative to parent
Parameter bottom
Bottom position, relative to parent
method layoutNativeView
layoutNativeView: ( left: number, top: number, right: number, bottom: number) => void;Called from onLayout when native view position is about to be changed.
Parameter left
Left position, relative to parent
Parameter top
Top position, relative to parent
Parameter right
Right position, relative to parent
Parameter bottom
Bottom position, relative to parent
method measure
measure: (widthMeasureSpec: number, heightMeasureSpec: number) => void;This is called to find out how big a view should be. The parent supplies constraint information in the width and height parameters. The actual measurement work of a view is performed in onMeasure(int, int), called by this method. Therefore, only onMeasure(int, int) can and must be overridden by subclasses.
Parameter widthMeasureSpec
Horizontal space requirements as imposed by the parent
Parameter heightMeasureSpec
Vertical space requirements as imposed by the parent
method measureChild
static measureChild: ( parent: View, child: View, widthMeasureSpec: number, heightMeasureSpec: number) => { measuredWidth: number; measuredHeight: number };Measure a child by taking into account its margins and a given measureSpecs.
Parameter parent
This parameter is not used. You can pass null.
Parameter child
The view to be measured.
Parameter measuredWidth
The measured width that the parent layout specifies for this view.
Parameter measuredHeight
The measured height that the parent layout specifies for this view.
method off
off: ( eventName: string, callback?: (args: EventData) => void, thisArg?: any) => any;Removes the listener(s) for the specified event name.
Parameter eventName
The name of the event.
Parameter callback
An optional specific event listener to remove (if omitted, all event listeners by this name will be removed).
Parameter thisArg
An optional parameter which, when set, will be used to refine search of the correct event listener to be removed.
method on
on: { (eventName: string, callback: (args: EventData) => void, thisArg?: any): any; (event: 'loaded', callback: (args: EventData) => void, thisArg?: any): any; (event: 'unloaded', callback: (args: EventData) => void, thisArg?: any): any; ( event: 'androidBackPressed', callback: (args: EventData) => void, thisArg?: any ): any; ( event: 'showingModally', callback: (args: ShownModallyData) => void, thisArg?: any ): void; ( event: 'shownModally', callback: (args: ShownModallyData) => void, thisArg?: any ): any; ( event: 'androidOverflowInset', callback: (args: ShownModallyData) => void, thisArg?: any ): any;};Adds a listener for the specified event name.
Parameter eventName
The name of the event.
Parameter callback
The event listener to add. Will be called when an event of the given name is raised.
Parameter thisArg
An optional parameter which, when set, will be bound as the
thiscontext when the callback is called. Falsy values will be not be bound.Raised when a loaded event occurs.
Raised when an unloaded event occurs.
Raised when a back button is pressed. This event is raised only for android.
Raised before the view is shown as a modal dialog.
Raised after the view is shown as a modal dialog.
method onBackPressed
onBackPressed: () => boolean;Derived classes can override this method to handle Android back button press.
method onLayout
onLayout: (left: number, top: number, right: number, bottom: number) => void;Called from layout when this view should assign a size and position to each of its children. Derived classes with children should override this method and call layout on each of their children.
Parameter left
Left position, relative to parent
Parameter top
Top position, relative to parent
Parameter right
Right position, relative to parent
Parameter bottom
Bottom position, relative to parent
method onMeasure
onMeasure: (widthMeasureSpec: number, heightMeasureSpec: number) => void;Measure the view and its content to determine the measured width and the measured height. This method is invoked by measure(int, int) and should be overriden by subclasses to provide accurate and efficient measurement of their contents. When overriding this method, you must call setMeasuredDimension(int, int) to store the measured width and height of this view. Failure to do so will trigger an exception, thrown by measure(int, int).
Parameter widthMeasureSpec
horizontal space requirements as imposed by the parent. The requirements are encoded with View.MeasureSpec.
Parameter heightMeasureSpec
vertical space requirements as imposed by the parent. The requirements are encoded with View.MeasureSpec.
method resolveSizeAndState
static resolveSizeAndState: ( size: number, specSize: number, specMode: number, childMeasuredState: number) => number;Utility to reconcile a desired size and state, with constraints imposed by a MeasureSpec. Will take the desired size, unless a different size is imposed by the constraints. The returned value is a compound integer, with the resolved size in the MEASURED_SIZE_MASK bits and optionally the bit MEASURED_STATE_TOO_SMALL set if the resulting size is smaller than the size the view wants to be.
method sendAccessibilityEvent
sendAccessibilityEvent: (options: AccessibilityEventOptions) => void;Send accessibility event options AccessibilityEventOptions androidAccessibilityEvent: AndroidAccessibilityEvent; iosNotificationType: IOSPostAccessibilityNotificationType; message: string;
iOS Notes: type = 'announcement' will announce
argsvia VoiceOver. If no args element will be announced instead. type = 'layout' used when the layout of a screen changes. type = 'screen' large change made to the screen.
method setMeasuredDimension
setMeasuredDimension: (measuredWidth: number, measuredHeight: number) => void;This method must be called by onMeasure(int, int) to store the measured width and measured height. Failing to do so will trigger an exception at measurement time.
Parameter measuredWidth
The measured width of this view. May be a complex bit mask as defined by MEASURED_SIZE_MASK and MEASURED_STATE_TOO_SMALL.
Parameter measuredHeight
The measured height of this view. May be a complex bit mask as defined by MEASURED_SIZE_MASK and MEASURED_STATE_TOO_SMALL.
method setOnTouchListener
setOnTouchListener: () => void;Android only to set the touch listener
class ViewBase
abstract class ViewBase extends Observable {}ViewBase
constructor
constructor();property ['class']
['class']: string;property alignSelf
alignSelf: AlignSelf;(Android-only) Overrides the alignItems value for the child.
property android
readonly android: any;property bindingContext
bindingContext: any;property className
className: string;Gets or sets the CSS class name for this view.
property col
col: number;The column for the element. The columns are 0-indexed, so the first column is indicated by 0.
property colSpan
colSpan: number;The number of columns for the element to span across.
property column
column: number;The column for the element. The columns are 0-indexed, so the first column is indicated by 0.
property columnSpan
columnSpan: number;property createdEvent
static createdEvent: string;String value used when hooking to creation event
created
property cssClasses
readonly cssClasses: Set<string>;property cssPseudoClasses
readonly cssPseudoClasses: Set<string>;property cssType
cssType: string;Gets the CSS fully qualified type name used for selector matching.
property defaultVisualState
defaultVisualState: string;Default visual state, defaults to 'normal'
property disposeNativeViewEvent
static disposeNativeViewEvent: string;String value used when hooking to disposeNativeView event
disposeNativeView
property dock
dock: 'left' | 'right' | 'top' | 'bottom';Dock position of the view within its parent.
property domNode
domNode: DOMNode;property effectiveBorderBottomWidth
effectiveBorderBottomWidth: number;property effectiveBorderLeftWidth
effectiveBorderLeftWidth: number;property effectiveBorderRightWidth
effectiveBorderRightWidth: number;property effectiveBorderTopWidth
effectiveBorderTopWidth: number;property effectiveColumnGap
effectiveColumnGap: number;property effectiveHeight
effectiveHeight: number;property effectiveLeft
effectiveLeft: number;property effectiveMarginBottom
effectiveMarginBottom: number;property effectiveMarginLeft
effectiveMarginLeft: number;property effectiveMarginRight
effectiveMarginRight: number;property effectiveMarginTop
effectiveMarginTop: number;property effectiveMaxHeight
effectiveMaxHeight: number;property effectiveMaxWidth
effectiveMaxWidth: number;property effectiveMinHeight
effectiveMinHeight: number;property effectiveMinWidth
effectiveMinWidth: number;property effectivePaddingBottom
effectivePaddingBottom: number;property effectivePaddingLeft
effectivePaddingLeft: number;property effectivePaddingRight
effectivePaddingRight: number;property effectivePaddingTop
effectivePaddingTop: number;property effectiveRowGap
effectiveRowGap: number;property effectiveTop
effectiveTop: number;property effectiveWidth
effectiveWidth: number;property flexGrow
flexGrow: number;Indicates that the child should grow in size, if necessary. Sets how much the child will grow in proportion to the rest of the child elements in the flex container.
property flexShrink
flexShrink: number;Indicates that the child should shrink when the row runs out of space. Sets how much the flex item will shrink in proportion to the rest of the child elements in the flex container. When not specified, its value is set to 1.
property flexWrapBefore
flexWrapBefore: boolean;When true, forces the item to wrap onto a new line.
property hidden
hidden: boolean;Gets or sets the visual state of the view.
property id
id: string;Gets or sets the id for this view.
property ios
readonly ios: any;property isCollapsed
isCollapsed: any;Returns true if visibility is set to 'collapse'. Default(false) set in prototype Readonly property
property isLoaded
readonly isLoaded: boolean;property left
left: CoreTypes.LengthType;Gets or sets the distance, in pixels, between the left edge of the child and the left edge of its parent.
property loadedEvent
static loadedEvent: string;String value used when hooking to loaded event.
loaded
property nativeView
nativeView: any;property nativeViewProtected
nativeViewProtected: any;read-only. If you want to set out-of-band the nativeView use the setNativeView method.
property order
order: number;Sets the order in which child elements inside a Flex appear in relation to one another.
property page
readonly page: Page;Gets owner page. This is a read-only property.
property parent
parent: ViewBase;Gets the parent view. This property is read-only.
property parentNode
parentNode: ViewBase;Gets the template parent or the native parent. Sets the template parent.
property recycleNativeView
recycleNativeView: 'auto' | 'always' | 'never';property reusable
reusable: boolean;Gets or sets if the view is reusable. Reusable views are not automatically destroyed when removed from the View tree.
property row
row: number;The row for the element. The rows are 0-indexed, so the first row is indicated by 0.
property rowSpan
rowSpan: number;The number of rows for the element to span across.
property sharedTransitionIgnore
sharedTransitionIgnore: boolean;Opt out of shared transition under different binding conditions
property sharedTransitionTag
sharedTransitionTag: string;Gets or sets the shared transition tag for animated view transitions
property style
style: Style;Gets the style object associated to this view.
property top
top: CoreTypes.LengthType;Gets or sets the distance, in pixels, between the top edge of the child and the top edge of its parent.
property typeName
readonly typeName: string;Gets the name of the constructor function for this instance. E.g. for a Button class this will return "Button".
property unloadedEvent
static unloadedEvent: string;String value used when hooking to unloaded event.
unloaded
property viewController
viewController: any;returns the native UIViewController.
property visualState
readonly visualState: string;Deprecated
method addPseudoClass
addPseudoClass: (name: string) => void;A widget can call this method to add a matching css pseudo class.
method bind
bind: (options: BindingOptions, source?: Object) => void;method callLoaded
callLoaded: () => void;method callUnloaded
callUnloaded: () => void;method closeModal
closeModal: (...args: any[]) => void;Closes the current modal view that this page is showing.
Parameter context
Any context you want to pass back to the host when closing the modal view.
method createNativeView
createNativeView: () => Object;Creates a native view. Returns either android.view.View or UIView.
method deletePseudoClass
deletePseudoClass: (name: string) => void;A widget can call this method to discard matching css pseudo class.
method destroyNode
destroyNode: (forceDestroyChildren?: boolean) => void;Tears down the UI of a reusable node by making it no longer reusable.
Parameter forceDestroyChildren
Force destroy the children (even if they are reusable)
See Also
_tearDownUI
method disposeNativeView
disposeNativeView: () => void;Clean up references to the native view.
method eachChild
eachChild: (callback: (child: ViewBase) => boolean) => void;Iterates over children of type ViewBase.
Parameter callback
Called for each child of type ViewBase. Iteration stops if this method returns falsy value.
method ensureDomNode
ensureDomNode: () => void;Ensures a dom-node for this view.
method getEffectivePaddingShorthand
getEffectivePaddingShorthand: () => string;method getViewByDomId
getViewByDomId: <T extends ViewBase>(domId: number) => T;Returns the child view with the specified domId.
method getViewById
getViewById: <T extends ViewBase>(id: string) => T;Returns the child view with the specified id.
method initNativeView
initNativeView: () => void;Initializes properties/listeners of the native view.
method loadView
loadView: (view: ViewBase) => void;Load view.
Parameter view
to load.
method onLoaded
onLoaded: () => void;method onResumeNativeUpdates
onResumeNativeUpdates: () => void;method onUnloaded
onUnloaded: () => void;method requestLayout
requestLayout: () => void;Invalidates the layout of the view and triggers a new layout pass.
method resetNativeView
resetNativeView: () => void;Resets properties/listeners set to the native view.
method set
set: (name: string, value: any) => void;method setInlineStyle
setInlineStyle: (style: string) => void;method setNativeView
setNativeView: (value: any) => void;Set the nativeView field performing extra checks and updates to the native properties on the new view. Use in cases where the createNativeView is not suitable. As an example use in item controls where the native parent view will create the native views for child items.
method showModal
showModal: { (view: ViewBase, modalOptions?: ShowModalOptions): ViewBase; (moduleName: string, modalOptions?: ShowModalOptions): ViewBase;};Shows the view passed as parameter as a modal view.
Parameter view
View instance to be shown modally.
Parameter modalOptions
A ShowModalOptions instance
Shows the View contained in moduleName as a modal view.
Parameter moduleName
The name of the module to load starting from the application root.
Parameter modalOptions
A ShowModalOptions instance
method toString
toString: () => string;method unbind
unbind: (property: string) => void;method unloadView
unloadView: (view: ViewBase) => void;Unload view.
Parameter view
to unload.
class ViewHelper
class ViewHelper {}method combineMeasuredStates
static combineMeasuredStates: (curState: number, newState: any) => number;method layoutChild
static layoutChild: ( parent: View, child: View, left: number, top: number, right: number, bottom: number) => void;Layout a child by taking into account its margins, horizontal and vertical alignments and a given bounds.
Parameter parent
This parameter is not used. You can pass null.
Parameter left
Left position, relative to parent
Parameter top
Top position, relative to parent
Parameter right
Right position, relative to parent
Parameter bottom
Bottom position, relative to parent
method measureChild
static measureChild: ( parent: View, child: View, widthMeasureSpec: number, heightMeasureSpec: number) => { measuredWidth: number; measuredHeight: number };Measure a child by taking into account its margins and a given measureSpecs.
Parameter parent
This parameter is not used. You can pass null.
Parameter child
The view to be measured.
Parameter measuredWidth
The measured width that the parent layout specifies for this view.
Parameter measuredHeight
The measured height that the parent layout specifies for this view.
method resolveSizeAndState
static resolveSizeAndState: ( size: number, specSize: number, specMode: number, childMeasuredState: number) => number;Utility to reconcile a desired size and state, with constraints imposed by a MeasureSpec. Will take the desired size, unless a different size is imposed by the constraints. The returned value is a compound integer, with the resolved size in the MEASURED_SIZE_MASK bits and optionally the bit MEASURED_STATE_TOO_SMALL set if the resulting size is smaller than the size the view wants to be.
class VirtualArray
class VirtualArray<T> extends Observable {}Advanced array like class that helps loading items on demand.
constructor
constructor(length?: number);property changeEvent
static changeEvent: string;String value used when hooking to change event.
property itemsLoadingEvent
static itemsLoadingEvent: string;String value used when hooking to itemsLoading event.
property length
length: number;Gets or sets length for the virtual array.
property loadSize
loadSize: number;method getItem
getItem: (index: number) => T;method load
load: (index: number, items: T[]) => void;Loads items from an array starting at index.
method setItem
setItem: (index: number, value: T) => void;class WebView
class WebView extends View {}Represents a standard WebView widget.
property android
android: any;Gets the native [android widget](http://developer.android.com/reference/android/webkit/WebView.html) that represents the user interface for this component. Valid only when running on Android OS.
property canGoBack
canGoBack: boolean;Gets a value indicating whether the WebView can navigate back.
property canGoForward
canGoForward: boolean;Gets a value indicating whether the WebView can navigate forward.
property disableZoom
disableZoom: boolean;Disable scrolling in the WebView
property ios
ios: any;Gets the native [WKWebView](https://developer.apple.com/documentation/webkit/wkwebview/) that represents the user interface for this component. Valid only when running on iOS.
property iosAllowInlineMediaPlayback
iosAllowInlineMediaPlayback: boolean;Enables inline media playback on iOS. By default, webview forces iPhone into fullscreen media playback.
property loadFinishedEvent
static loadFinishedEvent: string;String value used when hooking to loadFinished event.
{LoadEventData} loadFinished
property loadStartedEvent
static loadStartedEvent: string;String value used when hooking to loadStarted event.
{LoadEventData} loadStarted
property src
src: string;Gets or sets the url, local file path or HTML string.
method goBack
goBack: () => any;Navigates back.
method goForward
goForward: () => any;Navigates forward.
method on
on: { ( eventName: string, callback: (data: EventData) => void, thisArg?: any ): void; ( event: 'loadFinished', callback: (args: LoadEventData) => void, thisArg?: any ): void; ( event: 'loadStarted', callback: (args: LoadEventData) => void, thisArg?: any ): void;};Adds a listener for the specified event name.
Parameter eventName
The name of the event.
Parameter callback
The event listener to add. Will be called when an event of the given name is raised.
Parameter thisArg
An optional parameter which, when set, will be bound as the
thiscontext when the callback is called. Falsy values will be not be bound.Raised when a loadFinished event occurs.
Raised when a loadStarted event occurs.
method reload
reload: () => any;Reloads the current url.
method stopLoading
stopLoading: () => void;Stops loading the current content (if any).
class WindowBase
abstract class WindowBase extends Observable {}Cross-platform base for any window surface.
Carries identity, role, state, lifecycle events and the native accessors. Surfaces that host a NativeScript view tree are NativeWindow instances.
property android
readonly android?: { readonly activity: androidx.appcompat.app.AppCompatActivity;};The Android surface backing this window, or
undefinedwhen not running on Android or when the activity is already gone.
property id
readonly id: string;Stable identifier of this window, unique for the lifetime of the JS context. Survives a detach/re-attach, so it can be used to correlate a window across an iOS scene reconnect or an Android activity recreation.
property ios
readonly ios?: { readonly scene?: UIWindowScene; readonly uiWindow: UIWindow };The iOS surface backing this window, or
undefinedwhen not running on iOS.sceneis absent for apps still on the pre-scene (window-only) lifecycle.
property isPrimary
readonly isPrimary: boolean;Whether this is the application's primary window.
At most one window is primary at a time. When the primary window closes another attached window is promoted and
primaryWindowChangedis raised on the Application.
property role
readonly role: WindowRole;The purpose this window surface serves.
property state
readonly state: WindowState;Where this window currently sits in its lifecycle.
method close
abstract close: () => void;Closes this window.
Ends the window session: the native surface is dismissed,
closeis raised and the window is dropped from the Application registry.
method off
off: { ( event: 'activate', callback?: (data: WindowBaseEventData) => void, thisArg?: any ): void; ( event: 'deactivate', callback?: (data: WindowBaseEventData) => void, thisArg?: any ): void; ( event: 'background', callback?: (data: WindowBaseEventData) => void, thisArg?: any ): void; ( event: 'foreground', callback?: (data: WindowBaseEventData) => void, thisArg?: any ): void; ( event: 'attached', callback?: (data: WindowBaseEventData) => void, thisArg?: any ): void; ( event: 'detached', callback?: (data: WindowBaseEventData) => void, thisArg?: any ): void; ( event: 'close', callback?: (data: WindowBaseEventData) => void, thisArg?: any ): void; ( event: 'displayed', callback?: (data: WindowBaseEventData) => void, thisArg?: any ): void; ( event: 'orientationChanged', callback?: (data: WindowOrientationChangedEventData) => void, thisArg?: any ): void; ( event: 'systemAppearanceChanged', callback?: (data: WindowSystemAppearanceChangedEventData) => void, thisArg?: any ): void; ( event: 'layoutDirectionChanged', callback?: (data: WindowLayoutDirectionChangedEventData) => void, thisArg?: any ): void; ( event: 'activityCreated', callback?: (args: AndroidActivityBundleEventData) => void, thisArg?: any ): void; ( event: 'activityDestroyed', callback?: (args: AndroidActivityEventData) => void, thisArg?: any ): void; ( event: 'activityStarted', callback?: (args: AndroidActivityEventData) => void, thisArg?: any ): void; ( event: 'activityPaused', callback?: (args: AndroidActivityEventData) => void, thisArg?: any ): void; ( event: 'activityResumed', callback?: (args: AndroidActivityEventData) => void, thisArg?: any ): void; ( event: 'activityStopped', callback?: (args: AndroidActivityEventData) => void, thisArg?: any ): void; ( event: 'saveActivityState', callback?: (args: AndroidActivityBundleEventData) => void, thisArg?: any ): void; ( event: 'activityResult', callback?: (args: AndroidActivityResultEventData) => void, thisArg?: any ): void; ( event: 'activityBackPressed', callback?: (args: AndroidActivityBackPressedEventData) => void, thisArg?: any ): void; ( event: 'activityNewIntent', callback?: (args: AndroidActivityNewIntentEventData) => void, thisArg?: any ): void; ( event: 'activityRequestPermissions', callback?: (args: AndroidActivityRequestPermissionsEventData) => void, thisArg?: any ): void; ( event: 'sceneWillConnect', callback?: (args: SceneEventData) => void, thisArg?: any ): void; ( event: 'sceneDidActivate', callback?: (args: SceneEventData) => void, thisArg?: any ): void; ( event: 'sceneWillResignActive', callback?: (args: SceneEventData) => void, thisArg?: any ): void; ( event: 'sceneWillEnterForeground', callback?: (args: SceneEventData) => void, thisArg?: any ): void; ( event: 'sceneDidEnterBackground', callback?: (args: SceneEventData) => void, thisArg?: any ): void; ( event: 'sceneDidDisconnect', callback?: (args: SceneEventData) => void, thisArg?: any ): void; ( event: 'sceneOpenURLContexts', callback?: (args: SceneOpenURLContextsEventData) => void, thisArg?: any ): void; ( event: 'sceneContinueUserActivity', callback?: (args: SceneContinueUserActivityEventData) => void, thisArg?: any ): void; ( event: 'scenePerformActionForShortcutItem', callback?: (args: ScenePerformActionForShortcutItemEventData) => void, thisArg?: any ): void; ( eventName: string, callback?: (data: WindowBaseEventData) => void, thisArg?: any ): void;};Removes a listener for the specified event name. Omitting the callback removes every listener registered for that event on this window.
method on
on: { ( event: 'activate', callback: (data: WindowBaseEventData) => void, thisArg?: any ): void; ( event: 'deactivate', callback: (data: WindowBaseEventData) => void, thisArg?: any ): void; ( event: 'background', callback: (data: WindowBaseEventData) => void, thisArg?: any ): void; ( event: 'foreground', callback: (data: WindowBaseEventData) => void, thisArg?: any ): void; ( event: 'attached', callback: (data: WindowBaseEventData) => void, thisArg?: any ): void; ( event: 'detached', callback: (data: WindowBaseEventData) => void, thisArg?: any ): void; ( event: 'close', callback: (data: WindowBaseEventData) => void, thisArg?: any ): void; ( event: 'displayed', callback: (data: WindowBaseEventData) => void, thisArg?: any ): void; ( event: 'orientationChanged', callback: (data: WindowOrientationChangedEventData) => void, thisArg?: any ): void; ( event: 'systemAppearanceChanged', callback: (data: WindowSystemAppearanceChangedEventData) => void, thisArg?: any ): void; ( event: 'layoutDirectionChanged', callback: (data: WindowLayoutDirectionChangedEventData) => void, thisArg?: any ): void; ( event: 'activityCreated', callback: (args: AndroidActivityBundleEventData) => void, thisArg?: any ): void; ( event: 'activityDestroyed', callback: (args: AndroidActivityEventData) => void, thisArg?: any ): void; ( event: 'activityStarted', callback: (args: AndroidActivityEventData) => void, thisArg?: any ): void; ( event: 'activityPaused', callback: (args: AndroidActivityEventData) => void, thisArg?: any ): void; ( event: 'activityResumed', callback: (args: AndroidActivityEventData) => void, thisArg?: any ): void; ( event: 'activityStopped', callback: (args: AndroidActivityEventData) => void, thisArg?: any ): void; ( event: 'saveActivityState', callback: (args: AndroidActivityBundleEventData) => void, thisArg?: any ): void; ( event: 'activityResult', callback: (args: AndroidActivityResultEventData) => void, thisArg?: any ): void; ( event: 'activityBackPressed', callback: (args: AndroidActivityBackPressedEventData) => void, thisArg?: any ): void; ( event: 'activityNewIntent', callback: (args: AndroidActivityNewIntentEventData) => void, thisArg?: any ): void; ( event: 'activityRequestPermissions', callback: (args: AndroidActivityRequestPermissionsEventData) => void, thisArg?: any ): void; ( event: 'sceneWillConnect', callback: (args: SceneEventData) => void, thisArg?: any ): void; ( event: 'sceneDidActivate', callback: (args: SceneEventData) => void, thisArg?: any ): void; ( event: 'sceneWillResignActive', callback: (args: SceneEventData) => void, thisArg?: any ): void; ( event: 'sceneWillEnterForeground', callback: (args: SceneEventData) => void, thisArg?: any ): void; ( event: 'sceneDidEnterBackground', callback: (args: SceneEventData) => void, thisArg?: any ): void; ( event: 'sceneDidDisconnect', callback: (args: SceneEventData) => void, thisArg?: any ): void; ( event: 'sceneOpenURLContexts', callback: (args: SceneOpenURLContextsEventData) => void, thisArg?: any ): void; ( event: 'sceneContinueUserActivity', callback: (args: SceneContinueUserActivityEventData) => void, thisArg?: any ): void; ( event: 'scenePerformActionForShortcutItem', callback: (args: ScenePerformActionForShortcutItemEventData) => void, thisArg?: any ): void; ( eventName: string, callback: (data: WindowBaseEventData) => void, thisArg?: any ): void;};Raised when the window becomes the active/focused window.
Raised when the window loses focus.
Raised when the window enters the background.
Raised when the window enters the foreground.
Raised when a native surface is bound to the window - both on the first connect and on every re-attach after a
detached.Raised when the native surface goes away while the window session stays alive (iOS scene disconnect, Android activity recreation).
The window stays registered on the Application and keeps its listeners, so the same instance is handed back when a surface re-attaches and handlers registered before the detach keep working afterwards.
Raised when the window session ends for good.
Fires exactly once per window. Listeners stay registered for the whole teardown, so a handler added at any earlier point still observes it; immediately after it is dispatched the framework drops every listener on the instance, so nothing registered on a window outlives the window.
Raised after the window content has been displayed for the first time.
Raised when the orientation of this window changes.
Raised when the system appearance of this window changes between light and dark.
Raised when the layout direction of this window changes between ltr and rtl.
Adds a listener for the specified event name.
Parameter eventName
The name of the event.
Parameter callback
The event listener to add. Will be called when an event of the given name is raised.
Parameter thisArg
An optional parameter which, when set, will be bound as the
thiscontext when the callback is called. Falsy values will be not be bound.
method once
once: { ( event: 'activate', callback: (data: WindowBaseEventData) => void, thisArg?: any ): void; ( event: 'deactivate', callback: (data: WindowBaseEventData) => void, thisArg?: any ): void; ( event: 'background', callback: (data: WindowBaseEventData) => void, thisArg?: any ): void; ( event: 'foreground', callback: (data: WindowBaseEventData) => void, thisArg?: any ): void; ( event: 'attached', callback: (data: WindowBaseEventData) => void, thisArg?: any ): void; ( event: 'detached', callback: (data: WindowBaseEventData) => void, thisArg?: any ): void; ( event: 'close', callback: (data: WindowBaseEventData) => void, thisArg?: any ): void; ( event: 'displayed', callback: (data: WindowBaseEventData) => void, thisArg?: any ): void; ( event: 'orientationChanged', callback: (data: WindowOrientationChangedEventData) => void, thisArg?: any ): void; ( event: 'systemAppearanceChanged', callback: (data: WindowSystemAppearanceChangedEventData) => void, thisArg?: any ): void; ( event: 'layoutDirectionChanged', callback: (data: WindowLayoutDirectionChangedEventData) => void, thisArg?: any ): void; ( event: 'activityCreated', callback: (args: AndroidActivityBundleEventData) => void, thisArg?: any ): void; ( event: 'activityDestroyed', callback: (args: AndroidActivityEventData) => void, thisArg?: any ): void; ( event: 'activityStarted', callback: (args: AndroidActivityEventData) => void, thisArg?: any ): void; ( event: 'activityPaused', callback: (args: AndroidActivityEventData) => void, thisArg?: any ): void; ( event: 'activityResumed', callback: (args: AndroidActivityEventData) => void, thisArg?: any ): void; ( event: 'activityStopped', callback: (args: AndroidActivityEventData) => void, thisArg?: any ): void; ( event: 'saveActivityState', callback: (args: AndroidActivityBundleEventData) => void, thisArg?: any ): void; ( event: 'activityResult', callback: (args: AndroidActivityResultEventData) => void, thisArg?: any ): void; ( event: 'activityBackPressed', callback: (args: AndroidActivityBackPressedEventData) => void, thisArg?: any ): void; ( event: 'activityNewIntent', callback: (args: AndroidActivityNewIntentEventData) => void, thisArg?: any ): void; ( event: 'activityRequestPermissions', callback: (args: AndroidActivityRequestPermissionsEventData) => void, thisArg?: any ): void; ( event: 'sceneWillConnect', callback: (args: SceneEventData) => void, thisArg?: any ): void; ( event: 'sceneDidActivate', callback: (args: SceneEventData) => void, thisArg?: any ): void; ( event: 'sceneWillResignActive', callback: (args: SceneEventData) => void, thisArg?: any ): void; ( event: 'sceneWillEnterForeground', callback: (args: SceneEventData) => void, thisArg?: any ): void; ( event: 'sceneDidEnterBackground', callback: (args: SceneEventData) => void, thisArg?: any ): void; ( event: 'sceneDidDisconnect', callback: (args: SceneEventData) => void, thisArg?: any ): void; ( event: 'sceneOpenURLContexts', callback: (args: SceneOpenURLContextsEventData) => void, thisArg?: any ): void; ( event: 'sceneContinueUserActivity', callback: (args: SceneContinueUserActivityEventData) => void, thisArg?: any ): void; ( event: 'scenePerformActionForShortcutItem', callback: (args: ScenePerformActionForShortcutItemEventData) => void, thisArg?: any ): void; ( eventName: string, callback: (data: WindowBaseEventData) => void, thisArg?: any ): void;};Adds a listener for the specified event name that is removed as soon as it is raised once.
class WrapLayout
class WrapLayout extends LayoutBase {}WrapLayout position children in rows or columns depending on orientation property until space is filled and then wraps them on new row or column.
WrapLayout
property itemHeight
itemHeight: CoreTypes.LengthType;Gets or sets the height used to measure and layout each child. Default value is Number.NaN which does not restrict children.
property itemWidth
itemWidth: CoreTypes.LengthType;Gets or sets the width used to measure and layout each child. Default value is Number.NaN which does not restrict children.
property orientation
orientation: CoreTypes.OrientationType;Gets or sets the flow direction. Default value is horizontal. If orientation is horizontal items are arranged in rows, else items are arranged in columns.
class WrappedValue
class WrappedValue {}Helper class that is used to fire property change even when real object is the same. By default property change will not be fired for a same object. By wrapping object into a WrappedValue instance
same object restrictionwill be passed.
constructor
constructor(wrapped: any);Creates an instance of WrappedValue object.
Parameter wrapped
the real value which should be wrapped.
property wrapped
wrapped: any;Property which holds the real value.
method unwrap
static unwrap: (value: any) => any;Gets the real value of previously wrappedValue.
Parameter value
Value that should be unwraped. If there is no wrappedValue property of the value object then value will be returned.
method wrap
static wrap: (value: any) => any;Returns an instance of WrappedValue. The actual instance is get from a WrappedValues pool.
Parameter value
Value that should be wrapped.
class XmlParser
class XmlParser {}A simple non-validating SAX parser based on https://github.com/vflash/easysax version 0.1.14
constructor
constructor( onEvent: (event: ParserEvent) => void, onError?: (error: Error, position: Position) => void, processNamespaces?: boolean);Creates a new instance of the XmlParser class.
Parameter onEvent
The callback to execute when a parser event occurs. The 'event' parameter contains information about the event.
Parameter onError
The callback to execute when a parser error occurs. The 'error' parameter contains the error.
Parameter processNamespaces
Specifies whether namespaces should be processed.
property angularSyntax
angularSyntax: boolean;method parse
parse: (xmlString: string) => void;Parses the supplied xml string.
Parameter xmlString
The string containing the xml to parse.
Interfaces
interface AccessibilityDecrementEventData
interface AccessibilityDecrementEventData extends EventData {}interface AccessibilityIncrementEventData
interface AccessibilityIncrementEventData extends EventData {}interface ActionOptions
interface ActionOptions extends CancelableOptions {}Provides options for the dialog.
property actions
actions?: Array<string>;Gets or sets the list of available actions.
property cancelButtonText
cancelButtonText?: string;Gets or sets the Cancel button text.
property destructiveActionsIndexes
destructiveActionsIndexes?: Array<number>;[iOS only] Gets or sets the indexes of destructive actions.
property message
message?: string;Gets or sets the dialog message.
property title
title?: string;Gets or sets the dialog title.
interface AddArrayFromBuilder
interface AddArrayFromBuilder {}Defines an interface for adding arrays declared in xml.
interface AddChildFromBuilder
interface AddChildFromBuilder {}Defines an interface for adding a child element declared in xml.
interface AlertOptions
interface AlertOptions extends DialogOptions {}Provides options for the alert.
property okButtonText
okButtonText?: string;Gets or sets the OK button text.
interface AndroidActivityBackPressedEventData
interface AndroidActivityBackPressedEventData extends AndroidActivityEventData {}Data for the Android activity back pressed event.
property cancel
cancel: boolean;In the event handler, set this value to true if you want to cancel the back navigation and do something else instead.
interface AndroidActivityBundleEventData
interface AndroidActivityBundleEventData extends AndroidActivityEventData {}Data for the Android activity events with bundle.
property bundle
bundle: android.os.Bundle;The bundle.
interface AndroidActivityCallbacks
interface AndroidActivityCallbacks {}method getRootView
getRootView: () => View;method onActivityResult
onActivityResult: ( activity: any, requestCode: number, resultCode: number, data: any, superFunc: Function) => any;method onBackPressed
onBackPressed: (activity: any, superFunc: Function) => void;method onCreate
onCreate: ( activity: any, savedInstanceState: any, intent: any, superFunc: Function) => void;method onDestroy
onDestroy: (activity: any, superFunc: Function) => void;method onNewIntent
onNewIntent: ( activity: any, intent: any, superSetIntentFunc: Function, superFunc: Function) => void;method onPostResume
onPostResume: (activity: any, superFunc: Function) => void;method onRequestPermissionsResult
onRequestPermissionsResult: ( activity: any, requestCode: number, permissions: Array<string>, grantResults: Array<number>, superFunc: Function) => void;method onSaveInstanceState
onSaveInstanceState: (activity: any, outState: any, superFunc: Function) => void;method onStart
onStart: (activity: any, superFunc: Function) => void;method onStop
onStop: (activity: any, superFunc: Function) => void;method resetActivityContent
resetActivityContent: (activity: any, view?: View) => void;interface AndroidActivityEventData
interface AndroidActivityEventData {}Data for the Android activity events.
property activity
activity: androidx.appcompat.app.AppCompatActivity;The activity.
property eventName
eventName: string;The name of the event.
property object
object: any;The instance that has raised the event.
property window
window?: NativeWindow;The NativeWindow the activity belongs to, when one is registered for it.
interface AndroidActivityNewIntentEventData
interface AndroidActivityNewIntentEventData extends AndroidActivityEventData {}Data for the Android activity newIntent event.
property intent
intent: any;The intent.
interface AndroidActivityRequestPermissionsEventData
interface AndroidActivityRequestPermissionsEventData extends AndroidActivityEventData {}Data for the Android activity onRequestPermissions callback
property grantResults
grantResults: Array<number>;The Granted.
property permissions
permissions: Array<string>;The Permissions.
property requestCode
requestCode: number;The request code.
interface AndroidActivityResultEventData
interface AndroidActivityResultEventData extends AndroidActivityEventData {}Data for the Android activity result event.
property intent
intent: android.content.Intent;The intent.
property requestCode
requestCode: number;The request code.
property resultCode
resultCode: number;The result code.
interface AndroidOverflowInsetData
interface AndroidOverflowInsetData extends EventData {}Defines the data for the androidOverflowInset event.
property inset
inset?: Inset;The inset values passed to the view to consume or update.
interface AnimationDefinition
interface AnimationDefinition {}property backgroundColor
backgroundColor?: Color | any;property curve
curve?: any;property delay
delay?: number;property duration
duration?: number;property height
height?: CoreTypes.PercentLengthType | string | any;property iterations
iterations?: number;property opacity
opacity?: number;property rotate
rotate?: | number | Point3D | { x: number; y: number; z: number; };property scale
scale?: | Pair | { x: number; y: number; };property target
target?: View;property translate
translate?: | Pair | { x: number; y: number; };property width
width?: CoreTypes.PercentLengthType | string | any;interface AnimationDefinitionInternal
interface AnimationDefinitionInternal extends AnimationDefinition {}property valueSource
valueSource?: 'animation' | 'keyframe';interface ApplicationEventData
interface ApplicationEventData {}Event data containing information for the application events.
property android
android?: any;Gets the native Android event arguments. Valid only when running on Android.
property eventName
eventName: string;The name of the event.
property ios
ios?: any;Gets the native iOS event arguments. Valid only when running on iOS.
property object
object: any;The instance that has raised the event.
interface BackstackEntry
interface BackstackEntry {}property entry
entry: NavigationEntry;property fragment
fragment?: any;property fragmentTag
fragmentTag: string;property frameId
frameId?: number;property navDepth
navDepth: number;property recreated
recreated?: boolean;property resolvedPage
resolvedPage: Page;property viewSavedState
viewSavedState?: any;interface BackstackEntry
interface BackstackEntry {}Represents an entry in the back stack of a Frame object.
property entry
entry: NavigationEntry;property fragment
fragment?: any;property fragmentTag
fragmentTag: string;property frameId
frameId?: number;property navDepth
navDepth: number;property recreated
recreated?: boolean;property resolvedPage
resolvedPage: Page;property viewSavedState
viewSavedState?: any;interface BindingOptions
interface BindingOptions {}The options object used in the Bindable.bind method.
property expression
expression?: string;An expression used for calculations (convertions) based on the value of the property.
property sourceProperty
sourceProperty: string;The property name of the source object (typically the ViewModel) to bind to.
property targetProperty
targetProperty: string;The property name of the target object (that is the Bindable instance) to bind the source property to.
property twoWay
twoWay?: boolean;True to establish a two-way binding, false otherwise. A two-way binding will synchronize both the source and the target property values regardless of which one initiated the change.
interface Cancelable
interface Cancelable {}method cancel
cancel: { (): void; (): void };interface Cancelable
interface Cancelable {}method cancel
cancel: { (): void; (): void };interface CancelableOptions
interface CancelableOptions {}Provides options for the dialog.
property cancelable
cancelable?: boolean;[Android only] Gets or sets if the dialog can be canceled by taping outside of the dialog.
property theme
theme?: number;[Android only] Sets the theme of the Dialog. Usable themes can be found: https://developer.android.com/reference/android/R.style
interface ChangedData
interface ChangedData<T> extends EventData {}Event args for "changed" event.
property action
action: string;Change type.
property addedCount
addedCount: number;Number of added items.
property index
index: number;Start index.
property removed
removed: Array<T>;Removed items.
interface CommonLayoutParams
interface CommonLayoutParams {}property bottomMargin
bottomMargin: number;property bottomMarginPercent
bottomMarginPercent: number;property height
height: number;property heightPercent
heightPercent: number;property horizontalAlignment
horizontalAlignment: CoreTypes.HorizontalAlignmentType;property leftMargin
leftMargin: number;property leftMarginPercent
leftMarginPercent: number;property rightMargin
rightMargin: number;property rightMarginPercent
rightMarginPercent: number;property topMargin
topMargin: number;property topMarginPercent
topMarginPercent: number;property verticalAlignment
verticalAlignment: CoreTypes.VerticalAlignmentType;property width
width: number;property widthPercent
widthPercent: number;interface ComponentModule
interface ComponentModule {}interface ConfirmOptions
interface ConfirmOptions extends AlertOptions {}Provides options for the confirm dialog.
property cancelButtonText
cancelButtonText?: string;Gets or sets the Cancel button text.
property neutralButtonText
neutralButtonText?: string;Gets or sets the neutral button text.
interface CreateViewEventData
interface CreateViewEventData extends EventData {}Event data containing information for creating a native view that will be added to the visual tree.
interface CssChangedEventData
interface CssChangedEventData extends ApplicationEventData {}Event data containing information about application css change.
interface DialogOptions
interface DialogOptions extends CancelableOptions {}Provides options for the dialog.
interface DiscardedErrorEventData
interface DiscardedErrorEventData extends ApplicationEventData {}Event data containing information about discarded application errors.
property error
error: NativeScriptError;interface DownloadedData
interface DownloadedData extends EventData {}Provides data for downloaded event.
interface DownloadError
interface DownloadError extends EventData {}Provides data for download error.
interface DownloadRequest
interface DownloadRequest {}Represents a single download request.
property completed
completed?: (image: any, key: string) => void;An optional function to be called when the download is complete.
property error
error?: (key: string) => void;An optional function to be called if the download errors.
property key
key: string;The key used to cache the image.
property url
url: string;The url of the image.
interface EventData
interface EventData {}Base event data.
interface EventDataValue
interface EventDataValue extends EventData {}property value
value?: boolean;interface FontScaleChangedEventData
interface FontScaleChangedEventData extends ApplicationEventData {}Event data containing information for font scale changed event.
property newValue
newValue: number;New font scale value.
interface GestureEventData
interface GestureEventData extends EventData {}interface GestureEventDataWithState
interface GestureEventDataWithState extends GestureEventData {}property state
state: number;interface HttpContent
interface HttpContent extends HttpContentHandler, BaseHttpContent {}Encapsulates the content of an HttpResponse.
interface HttpRequestOptions
interface HttpRequestOptions {}Provides options for the http requests.
property content
content?: string | FormData | ArrayBuffer | Uint8Array<ArrayBufferLike>;Gets or sets the request body.
property dontFollowRedirects
dontFollowRedirects?: boolean;Gets or sets whether to *not* follow server's redirection responses.
property headers
headers?: any;Gets or sets the request headers in JSON format.
property method
method: string;Gets or sets the request method.
property timeout
timeout?: number;Gets or sets the request timeout in milliseconds.
property url
url: string;Gets or sets the request url.
interface HttpResponse
interface HttpResponse<T = HttpContent> {}Encapsulates HTTP-response information from an HTTP-request.
property content
content?: T;Gets the response content.
property headers
headers: Headers;Gets the response headers.
property statusCode
statusCode: number;Gets the response status code.
interface IDevice
interface IDevice {}property deviceType
deviceType: 'Phone' | 'Tablet';Gets the type of the current device. Available values: "Phone", "Tablet".
property language
language: string;Gets the preferred language. For example "en" or "en-US".
property manufacturer
manufacturer: string;Gets the manufacturer of the device. For example: "Apple" or "HTC" or "Samsung".
property model
model: string;Gets the model of the device. For example: "Nexus 5" or "iPhone".
property os
os: string;Gets the OS of the device. For example: "Android" or "iOS".
property osVersion
osVersion: string;Gets the OS version. For example: 4.4.4(android), 8.1(ios)
property region
region: string;Gets the preferred region. For example "US".
property sdkVersion
sdkVersion: string;Gets the SDK version. For example: 19(android), 8.1(ios).
property uuid
uuid: string;Gets the uuid. On iOS this will return a new uuid if the application is re-installed on the device. If you need to receive the same uuid even after the application has been re-installed on the device, use this plugin: https://www.npmjs.com/package/nativescript-ios-uuid
interface ImageAssetOptions
interface ImageAssetOptions {}property autoScaleFactor
autoScaleFactor?: boolean;property height
height?: number;property keepAspectRatio
keepAspectRatio?: boolean;property width
width?: number;interface InitRootViewEventData
interface InitRootViewEventData extends ApplicationEventData {}Event data containing information about root view application.
property rootView
rootView: View;interface IOSView
interface IOSView extends View {}interface ItemEventData
interface ItemEventData extends EventData {}Event data containing information for the index and the view associated to a list view item.
property android
android: any /* android.view.ViewGroup */;Gets the native [android widget](http://developer.android.com/reference/android/view/ViewGroup.html) that represents the user interface where the view is hosted. Valid only when running on Android OS.
property index
index: number;The index of the item, for which the event is raised.
property ios
ios: any /* UITableViewCell */;Gets the native [iOS view](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UITableViewCell_Class/) that represents the user interface where the view is hosted. Valid only when running on iOS.
property section
section?: number;When data is sectioned (any platform that supports sections), this is the section index for the item.
property view
view: View;The view that is associated to the item, for which the event is raised.
interface ItemsLoading
interface ItemsLoading extends EventData {}Event args for "itemsLoading" event.
interface ItemsSource
interface ItemsSource {}interface KeyedTemplate
interface KeyedTemplate {}Defines an interface for Template with a key.
property createView
createView: Template;The function that creates the view.
property key
key: string;The unique key of the template.
interface LaunchEventData
interface LaunchEventData extends EventData {}Event data containing information for launch event.
property android
android?: android.content.Intent;property ios
ios?: any;property root
root?: View | null;The root view for this Window on iOS or Activity for Android. If not set a new Frame will be created as a root view in order to maintain backwards compatibility. If explicitly set to null, there will be no root view.
property savedInstanceState
savedInstanceState?: any;interface LayoutDirectionChangedEventData
interface LayoutDirectionChangedEventData extends ApplicationEventData {}Event data containing information for system layout direction changed event.
property newValue
newValue: CoreTypes.LayoutDirectionType;New layout direction value.
interface LoadAppCSSEventData
interface LoadAppCSSEventData extends ApplicationEventData {}property cssFile
cssFile: string;interface LoadEventData
interface LoadEventData extends EventData {}Event data containing information for the loading events of a WebView.
property error
error: string;Gets the error (if any).
property navigationType
navigationType: NavigationType;Gets the navigation type of the web-view.
property url
url: string;Gets the url of the web-view.
interface LoadOptions
interface LoadOptions {}property attributes
attributes?: any;property exports
exports?: any;property name
name: string;property page
page?: Page;property path
path: string;interface LoginOptions
interface LoginOptions extends ConfirmOptions {}Provides options for the login dialog.
property password
password?: string;Gets or sets the default text to display in the password input box.
property passwordHint
passwordHint?: string;Gets or sets the default text to display as hint in the password input box.
property userName
userName?: string;Gets or sets the default text to display in the user name input box.
property userNameHint
userNameHint?: string;Gets or sets the default text to display as hint in the user name input box.
interface LoginResult
interface LoginResult {}Provides result data from the login dialog.
interface NativeScriptConfig
interface NativeScriptConfig {}property android
android?: IConfigAndroid;Android specific configurations Various Android specific configurations including Android runtime flags.
property appPath
appPath?: string;Path to the app source directory This is often the
srcorappdirectory however can be changed.
property appResourcesPath
appResourcesPath?: string;App_Resources path This is often at the root or inside
srcorappdirectory however can be anywhere.
property bundler
bundler?: BundlerType;Bundler to use for this project. Default is 'webpack'.
property bundlerConfigPath
bundlerConfigPath?: string;Custom bundler config path For example,
vite.config.ts,webpack.config.js, etc. The default iswebpack.config.jshowever you can use a custom name and place elsewhere.
property cli
cli?: IConfigCLI;Set cli options
property cssParser
cssParser?: 'rework' | 'nativescript' | 'css-tree';Set the default CSS parser that NativeScript will use. Default: css-tree
property discardUncaughtJsExceptions
discardUncaughtJsExceptions?: boolean;Deprecated
Since runtime 9.1 uncaught JS errors no longer crash the app by default, so this flag is no longer needed. Remove it, or use
uncaughtErrorPolicy.Still honored while deprecated, with a one-time runtime warning:
trueroutes uncaught errors toApplication.discardedErrorEvent(instead ofuncaughtErrorEvent), skips the fatal log and suppressesuncaughtErrorPolicy: 'throw'.falseis ignored - it does NOT restore the old crash-on-uncaught behavior; setuncaughtErrorPolicy: 'throw'for that.
property embed
embed?: IConfigEmbed;For embedding into existing platform host projects.
property hooks
hooks?: IConfigHook[];Set project persistent hooks to run
property id
id?: string;App's bundle id Used for both iOS and Android if they use the same bundle id. You can override per platform in the respective platform specific configurations.
property ignoredNativeDependencies
ignoredNativeDependencies?: string[];Optionally specify a list of npm package names for which you would like the NativeScript CLI to ignore when attaching native dependencies to the build
property ios
ios?: IConfigIOS;iOS specific configurations Various iOS specific configurations including iOS runtime flags.
property logScriptLoading
logScriptLoading?: boolean;Enable runtime logging of script loading.
property main
main?: string;App's main entry file - this setting overrides the value set in package.json
property overridePods
overridePods?: string;property previewAppSchema
previewAppSchema?: string;property profiling
profiling?: InstrumentationMode;Enable profiling for the application. Default: no profiling In most cases when profiling, you will want to use "timeline"
property projectName
projectName?: string;Custom platform project name. By default, the platforms/{platform}/{name} is based on the basename of the project directory. You can override that to use a name of your choice by setting this.
property security
security?: ISecurityConfig;Security configurations
property shared
shared?: boolean;property showErrorDisplay
showErrorDisplay?: boolean;Show visual error display when an uncaught JS exception occurs.
property uncaughtErrorPolicy
uncaughtErrorPolicy?: UncaughtErrorPolicy;Policy for uncaught JS errors and unhandled promise rejections that no listener handled. Default:
'report'- the app keeps running.Requires runtime 9.1+ (iOS and Android); older runtimes ignore the key and crash on uncaught errors as before. Read only from the top level of the config - a value nested under
ios/androidhas no effect.To handle individual errors instead, add a
globalThislistener and cancel the event:globalThis.addEventListener('unhandledrejection', (e) => e.preventDefault()).
property visionos
visionos?: IConfigVisionOS;Vision Pro specific configurations Various VisionOS specific configurations including iOS runtime flags.
property webpackConfigPath
webpackConfigPath?: string;Deprecated
Use
bundlerConfigPathinstead. Custom webpack config path The default iswebpack.config.jsin the root however you can use a custom name and place elsewhere.
interface NativeScriptError
interface NativeScriptError extends Error {}An extended JavaScript Error which will have the nativeError property initialized in case the error is caused by executing platform-specific code.
property nativeException
nativeException?: any;Represents the native error object.
property stack
stack?: string;Javascript portion of stack trace.
property stackTrace
stackTrace?: string;The native stack trace.
interface NativeWindowEventData
interface NativeWindowEventData extends WindowBaseEventData {}Base event data for NativeWindow events.
property window
window: NativeWindow;The NativeWindow that emitted the event.
interface NavigatedData
interface NavigatedData extends EventData {}Defines the data for the page navigation events.
property context
context: any;The navigation context (optional, may be undefined) passed to the page navigation events method.
property isBackNavigation
isBackNavigation: boolean;Represents if a navigation is forward or backward.
interface NavigationContext
interface NavigationContext {}Represents a context passed to navigation methods.
property entry
entry?: BackstackEntry;property isBackNavigation
isBackNavigation: boolean;Deprecated
Use navigationType instead.
property navigationType
navigationType: NavigationType;interface NavigationData
interface NavigationData extends EventData {}interface NavigationEntry
interface NavigationEntry extends ViewEntry {}Represents an entry in passed to navigate method.
property animated
animated?: boolean;True to navigate to the new Page using animated transitions, false otherwise.
property backstackVisible
backstackVisible?: boolean;True to record the navigation in the backstack, false otherwise. If the parameter is set to false then the Page will be displayed but once navigated from it will not be able to be navigated back to.
property bindingContext
bindingContext?: any;An object to become the binding context of the page navigating to. Optional.
property clearHistory
clearHistory?: boolean;True to clear the navigation history, false otherwise. Very useful when navigating away from login pages.
property context
context?: any;An object passed to the onNavigatedTo callback of the Page. Typically this is used to pass some data among pages. Optional.
property transition
transition?: NavigationTransition;Specifies an optional navigation transition for all platforms. If not specified, the default platform transition will be used.
property transitionAndroid
transitionAndroid?: NavigationTransition;Specifies an optional navigation transition for Android. If not specified, the default platform transition will be used.
property transitioniOS
transitioniOS?: NavigationTransition;Specifies an optional navigation transition for iOS. If not specified, the default platform transition will be used.
interface NavigationTransition
interface NavigationTransition {}Represents an object specifying a page navigation transition.
property curve
curve?: any;An optional transition animation curve. Possible values are contained in the [AnimationCurve enumeration](https://docs.nativescript.org/api-reference/modules/_ui_enums_.animationcurve.html). Alternatively, you can pass an instance of type UIViewAnimationCurve for iOS or android.animation.TimeInterpolator for Android.
property duration
duration?: number;The length of the transition in milliseconds. If you do not specify this, the default platform transition duration will be used.
property instance
instance?: Transition;An user-defined instance of the "ui/transition".Transition class.
property name
name?: string;Can be one of the built-in transitions: - curl (same as curlUp) (iOS only) - curlUp (iOS only) - curlDown (iOS only) - explode (Android Lollipop(21) and up only) - fade - flip (same as flipRight) - flipRight - flipLeft - slide (same as slideLeft) - slideLeft - slideRight - slideTop - slideBottom
interface ObservableArray
interface ObservableArray<T> {}method on
on: { ( eventName: string, callback: (data: EventData) => void, thisArg?: any ): void; ( event: 'change', callback: (args: ChangedData<T>) => void, thisArg?: any ): void;};Adds a listener for the specified event name.
Parameter eventName
The name of the event.
Parameter callback
The event listener to add. Will be called when an event of the given name is raised.
Parameter thisArg
An optional parameter which, when set, will be bound as the
thiscontext when the callback is called. Falsy values will be not be bound.
interface OrientationChangedEventData
interface OrientationChangedEventData extends ApplicationEventData {}Event data containing information for orientation changed event.
property newValue
newValue: 'portrait' | 'landscape' | 'unknown';New orientation value.
interface PageBase
interface PageBase {}property onAccessibilityPerformEscape
onAccessibilityPerformEscape?: () => boolean;iOS only. Perform an action when the user performs the "escape" gesture.
method on
on: { ( eventNames: string, callback: (data: EventData) => void, thisArg?: any ): void; ( event: 'navigatingTo', callback: (args: NavigatedData) => void, thisArg?: any ): void; ( event: 'navigatedTo', callback: (args: NavigatedData) => void, thisArg?: any ): void; ( event: 'navigatingFrom', callback: (args: NavigatedData) => void, thisArg?: any ): void; ( event: 'navigatedFrom', callback: (args: NavigatedData) => void, thisArg?: any ): void; ( event: 'showingModally', callback: (args: ShownModallyData) => void, thisArg?: any ): void; ( event: 'shownModally', callback: (args: ShownModallyData) => void, thisArg?: any ): void;};interface PanGestureEventData
interface PanGestureEventData extends GestureEventDataWithState {}interface PinchGestureEventData
interface PinchGestureEventData extends GestureEventDataWithState {}interface PlatformContext
interface PlatformContext {}Used with qualifier matchers and module resolution
property deviceType
deviceType: string;property height
height: number;property os
os: string;property width
width: number;interface PrimaryWindowChangedEventData
interface PrimaryWindowChangedEventData extends EventData {}Event data fired on Application when the primary window changes.
property window
window: NativeWindow;The NativeWindow that is now primary.
interface PromptOptions
interface PromptOptions extends ConfirmOptions {}Provides options for the prompt dialog.
property capitalizationType
capitalizationType?: string;Gets or sets the prompt capitalizationType (none, all, sentences, or words).
property defaultText
defaultText?: string;Gets or sets the default text to display in the input box.
property inputType
inputType?: string;Gets or sets the prompt input type (plain text, password, or email).
interface PromptResult
interface PromptResult {}Provides result data from the prompt dialog.
interface PropertyAnimation
interface PropertyAnimation {}interface PropertyAnimationInfo
interface PropertyAnimationInfo extends PropertyAnimation {}interface PropertyChangeData
interface PropertyChangeData extends EventData {}Data for the "propertyChange" event.
property oldValue
oldValue?: any;The previous value of the property.
property propertyName
propertyName: string;The name of the property that has changed.
property value
value: any;The new value of the property.
interface RootLayoutOptions
interface RootLayoutOptions {}property animation
animation?: { enterFrom?: TransitionAnimation; exitTo?: TransitionAnimation;};property shadeCover
shadeCover?: ShadeCoverOptions;interface RotationGestureEventData
interface RotationGestureEventData extends GestureEventDataWithState {}property rotation
rotation: number;interface SceneContinueUserActivityEventData
interface SceneContinueUserActivityEventData extends SceneEventData {}iOS event data for the
sceneContinueUserActivityevent, raised for Handoff and universal links directed at a scene.Replaces the
applicationContinueUserActivityRestorationHandlerapp delegate callback, which UIKit no longer calls once the app adopts scenes.
property userActivity
userActivity: NSUserActivity;The activity to continue.
interface SceneEventData
interface SceneEventData extends ApplicationEventData {}iOS Event data containing information for scene lifecycle events (iOS 13+).
property connectionOptions
connectionOptions?: UISceneConnectionOptions;Scene connection options (for sceneWillConnect event).
property scene
scene?: UIWindowScene;The UIWindowScene instance associated with this event.
property uiWindow
uiWindow?: UIWindow;The UIWindow associated with this scene (if applicable).
property userInfo
userInfo?: NSDictionary<any, any>;Additional user info from the notification.
property window
window?: NativeWindow;The NativeWindow the scene belongs to, when one is registered for it.
interface SceneOpenURLContextsEventData
interface SceneOpenURLContextsEventData extends SceneEventData {}iOS event data for the
sceneOpenURLContextsevent, raised when a scene is asked to open URLs.Replaces the
applicationOpenURLOptionsapp delegate callback, which UIKit no longer calls once the app adopts scenes. Handlers registered throughApplication.ios.addDelegateHandler('applicationOpenURLOptions', ...)still run, once per context.
property urlContexts
urlContexts: NSSet<UIOpenURLContext>;The URL contexts to open. A single delivery may carry more than one URL.
interface ScenePerformActionForShortcutItemEventData
interface ScenePerformActionForShortcutItemEventData extends SceneEventData {}iOS event data for the
scenePerformActionForShortcutItemevent, raised when a home screen quick action targets a scene.Replaces the
applicationPerformActionForShortcutItemCompletionHandlerapp delegate callback, which UIKit no longer calls once the app adopts scenes.
property completionHandler
completionHandler: (handled: boolean) => void;Reports back to iOS whether the action was handled. Only the first call is delivered; later ones are ignored.
Unless a legacy
applicationPerformActionForShortcutItemCompletionHandlerhandler is registered — in which case that handler owns the result — the action is reported as unhandled as soon as the listeners return, so a listener that wants to report otherwise must call this before returning.
property shortcutItem
shortcutItem: UIApplicationShortcutItem;The quick action the user selected.
interface ScrollEventData
interface ScrollEventData extends EventData {}interface SearchEventData
interface SearchEventData extends EventData {}Event data containing information for the search text change event.
property android
android?: any;Gets the native Android search view. Valid only when running on Android OS.
property ios
ios?: any /* UISearchController */;Gets the native [iOS UISearchController](https://developer.apple.com/documentation/uikit/uisearchcontroller) that represents the search controller. Valid only when running on iOS.
property text
text: string;The current search text value.
interface SelectedIndexChangedEventData
interface SelectedIndexChangedEventData extends EventData {}Defines the data for the SegmentedBar.selectedIndexChanged event.
interface ShadeCoverOptions
interface ShadeCoverOptions {}property animation
animation?: { enterFrom?: TransitionAnimation; // only applied if first one to be opened exitTo?: TransitionAnimation; // only applied if last one to be closed};property color
color?: string;property ignoreShadeRestore
ignoreShadeRestore?: boolean;property opacity
opacity?: number;property tapToClose
tapToClose?: boolean;interface ShadowCSSValues
interface ShadowCSSValues {}property blurRadius
blurRadius?: CoreTypes.LengthType;property color
color: Color;property inset
inset: boolean;property offsetX
offsetX: CoreTypes.LengthType;property offsetY
offsetY: CoreTypes.LengthType;property spreadRadius
spreadRadius?: CoreTypes.LengthType;interface SharedTransitionConfig
interface SharedTransitionConfig {}property interactive
interactive?: { /** * Whether you want to allow interactive dismissal. * Defaults to using 'pan' gesture for dismissal however you can customize your own. */ dismiss?: SharedTransitionInteractiveOptions;};Interactive transition settings. (iOS only at the moment)
property pageEnd
pageEnd?: SharedTransitionPageWithDurationProperties;View settings applied to the incoming page to end your transition with.
property pageOut
pageOut?: SharedTransitionPageWithDurationProperties;View settings applied to the outgoing page in your transition.
property pageReturn
pageReturn?: SharedTransitionPageWithDurationProperties & { /** * In some cases you may want the returning animation to start with the original opacity, * instead of beginning where it ended up on pageEnd. * Note: you can try enabling this property in cases where your return animation doesn't appear correct. */ useStartOpacity?: boolean;};View settings to return to the original page with.
property pageStart
pageStart?: SharedTransitionPageProperties;View settings applied to the incoming page to start your transition with.
interface ShowModalOptions
interface ShowModalOptions {}property android
android?: { /** * @deprecated Use ShowModalOptions.cancelable instead. * An optional parameter specifying whether the modal view can be dismissed when not in full-screen mode. */ cancelable?: boolean; /** * An optional parameter specifying the windowSoftInputMode of the dialog window. * For possible values see https://developer.android.com/reference/android/view/WindowManager.LayoutParams#softInputMode */ windowSoftInputMode?: number;};property animated
animated?: boolean;An optional parameter specifying whether to show the modal view with animation.
property cancelable
cancelable?: boolean;An optional parameter specifying whether the modal view can be dismissed when not in full-screen mode.
property closeCallback
closeCallback: (...args: any[]) => void;A function that will be called when the view is closed. Any arguments provided when calling ShownModallyData.closeCallback will be available here.
property context
context: any;Any context you want to pass to the modally shown view. This same context will be available in the arguments of the shownModally event handler.
property fullscreen
fullscreen?: boolean;An optional parameter specifying whether to show the modal view in full-screen mode.
property ios
ios?: { /** * The UIModalPresentationStyle to be used when showing the dialog in iOS . */ presentationStyle?: any; /** * width of the popup dialog */ width?: number; /** * height of the popup dialog */ height?: number; /** * The preferred status bar style for the modal view */ statusBarStyle?: 'light' | 'dark';};An optional parameter that specify options specific to iOS as an object.
property stretched
stretched?: boolean;An optional parameter specifying whether to stretch the modal view when not in full-screen mode.
property transition
transition?: ModalTransitionType;An optional custom transition effect
interface ShownModallyData
interface ShownModallyData extends EventData {}Defines the data for the shownModally event.
property closeCallback
closeCallback?: Function;A callback to call when you want to close the modally shown view. Pass in any kind of arguments and you will receive when the callback parameter of View.showModal is executed.
property context
context?: any;The context (optional, may be undefined) passed to the view when shown modally.
interface Size
interface Size {}The Size interface describes abstract dimensions in two dimensional space. It has two properties width and height, representing the width and height values of the size.
interface StrokeCSSValues
interface StrokeCSSValues {}interface SwipeGestureEventData
interface SwipeGestureEventData extends GestureEventData {}property direction
direction: SwipeDirection;interface SystemAppearanceChangedEventData
interface SystemAppearanceChangedEventData extends ApplicationEventData {}Event data containing information for system appearance changed event.
property newValue
newValue: 'light' | 'dark';New system appearance value.
interface TapGestureEventData
interface TapGestureEventData extends GestureEventData {}method getPointerCount
getPointerCount: () => number;method getX
getX: () => number;method getY
getY: () => number;interface Template
interface Template {}Defines an interface for a View factory function. Commonly used to specify the visualization of data objects.
call signature
(): View;Call signature of the factory function. Returns a new View instance.
interface TemplatedItemsView
interface TemplatedItemsView {}property items
items: any[] | ItemsSource;property itemTemplate
itemTemplate: string | Template;property itemTemplates
itemTemplates?: string | Array<KeyedTemplate>;method off
off: ( event: 'itemLoading', callback: (args: EventData) => void, thisArg?: any) => void;method on
on: ( event: 'itemLoading', callback: (args: ItemEventData) => void, thisArg?: any) => void;method refresh
refresh: () => void;interface TimerInfo
interface TimerInfo {}Contains contains utility methods for profiling. All methods in this module are experimental and may be changed in a non-major version.
interface TraceErrorHandler
interface TraceErrorHandler {}An interface used to for handling trace error
method handlerError
handlerError: (error: Error) => any;interface TraceEventListener
interface TraceEventListener {}An interface used to trace information about specific event.
interface TraceWriter
interface TraceWriter {}An interface used to define a writer used by trace to print (log).
method write
write: (message: any, category: string, type?: number) => void;interface UnhandledErrorEventData
interface UnhandledErrorEventData extends ApplicationEventData {}Event data containing information about unhandled application errors.
interface ViewEntry
interface ViewEntry {}Represents an entry to be used to create a view or load it form file
property create
create?: () => View;A function used to create the View instance. Optional.
property moduleName
moduleName?: string;The name of the module containing the View instance to load. Optional.
interface VirtualArray
interface VirtualArray<T> {}method on
on: { ( eventName: string, callback: (data: EventData) => void, thisArg?: any ): void; ( event: 'itemsLoading', callback: (args: ItemsLoading) => void, thisArg?: any ): void; ( event: 'change', callback: (args: ChangedData<T>) => void, thisArg?: any ): void;};Adds a listener for the specified event name.
Parameter eventName
The name of the event.
Parameter callback
The event listener to add. Will be called when an event of the given name is raised.
Parameter thisArg
An optional parameter which, when set, will be bound as the
thiscontext when the callback is called. Falsy values will be not be bound.Raised when still not loaded items are requested.
Raised when a change occurs.
interface WindowBaseEventData
interface WindowBaseEventData extends EventData {}Base event data for window surface events.
property window
window: WindowBase;The window that emitted the event.
interface WindowCloseEventData
interface WindowCloseEventData extends EventData {}Event data fired on Application when a window closes.
property window
window: NativeWindow;The NativeWindow that was closed.
interface WindowContentRequest
interface WindowContentRequest {}Describes the window asking for content.
property android
android?: { intent?: android.content.Intent; savedInstanceState?: android.os.Bundle;};property data
data?: Record<string, any>;NSUserActivity.userInfo on iOS, intent extras on Android.
property ios
ios?: { connectionOptions?: UISceneConnectionOptions;};property isPrimary
isPrimary: boolean;Whether the window is the application's primary window.
property window
window: NativeWindow;The window that needs content.
interface WindowLayoutDirectionChangedEventData
interface WindowLayoutDirectionChangedEventData extends NativeWindowEventData {}Event data for the
layoutDirectionChangedevent of a NativeWindow.
property newValue
newValue: CoreTypes.LayoutDirectionType;The layout direction the window is now using.
interface WindowOpenEventData
interface WindowOpenEventData extends EventData {}Event data fired on Application when a window opens.
property window
window: NativeWindow;The NativeWindow that was opened.
interface WindowOpenOptions
interface WindowOpenOptions {}Options for opening a new window.
property data
data?: Record<string, any>;Data to pass to the new window. On iOS: serialized into NSUserActivity.userInfo. On Android: added as intent extras.
interface WindowOrientationChangedEventData
interface WindowOrientationChangedEventData extends NativeWindowEventData {}Event data for the
orientationChangedevent of a NativeWindow.
property newValue
newValue: 'portrait' | 'landscape' | 'unknown';The orientation the window is now in.
interface WindowSystemAppearanceChangedEventData
interface WindowSystemAppearanceChangedEventData extends NativeWindowEventData {}Event data for the
systemAppearanceChangedevent of a NativeWindow.
property newValue
newValue: 'light' | 'dark';The system appearance the window is now showing.
Enums
enum AccessibilityLiveRegion
enum AccessibilityLiveRegion { None = 'none', Polite = 'polite', Assertive = 'assertive',}enum AccessibilityRole
enum AccessibilityRole { Adjustable = 'adjustable', Button = 'button', Checkbox = 'checkbox', Header = 'header', Image = 'image', ImageButton = 'imageButton', KeyboardKey = 'keyboardKey', Link = 'link', None = 'none', PlaysSound = 'plays', ProgressBar = 'progressBar', RadioButton = 'radioButton', Search = 'search', SpinButton = 'spinButton', StartsMediaSession = 'startsMedia', StaticText = 'text', Summary = 'summary', Switch = 'switch',}member Adjustable
Adjustable = 'adjustable'The element allows continuous adjustment through a range of values.
member Button
Button = 'button'The element should be treated as a button.
member Checkbox
Checkbox = 'checkbox'The element behaves like a Checkbox
member Header
Header = 'header'The element is a header that divides content into sections, such as the title of a navigation bar.
member Image
Image = 'image'The element should be treated as an image.
member ImageButton
ImageButton = 'imageButton'The element should be treated as a image button.
member KeyboardKey
KeyboardKey = 'keyboardKey'The element behaves as a keyboard key.
member Link
Link = 'link'The element should be treated as a link.
member None
None = 'none'The element has no traits.
member PlaysSound
PlaysSound = 'plays'The element plays its own sound when activated.
member ProgressBar
ProgressBar = 'progressBar'The element behaves like a ProgressBar
member RadioButton
RadioButton = 'radioButton'The element behaves like a RadioButton
member Search
Search = 'search'The element should be treated as a search field.
member SpinButton
SpinButton = 'spinButton'The element behaves like a SpinButton
member StartsMediaSession
StartsMediaSession = 'startsMedia'The element starts a media session when it is activated.
member StaticText
StaticText = 'text'The element should be treated as static text that cannot change.
member Summary
Summary = 'summary'The element provides summary information when the application starts.
member Switch
Switch = 'switch'The element behaves like a switch
enum AccessibilityState
enum AccessibilityState { Selected = 'selected', Checked = 'checked', Unchecked = 'unchecked', Disabled = 'disabled',}enum AccessibilityTrait
enum AccessibilityTrait { AllowsDirectInteraction = 'allowsDirectInteraction', CausesPageTurn = 'pageTurn', NotEnabled = 'disabled', Selected = 'selected', UpdatesFrequently = 'frequentUpdates',}member AllowsDirectInteraction
AllowsDirectInteraction = 'allowsDirectInteraction'The element allows direct touch interaction for VoiceOver users.
member CausesPageTurn
CausesPageTurn = 'pageTurn'The element should cause an automatic page turn when VoiceOver finishes reading the text within it. Note: Requires custom view with accessibilityScroll(...)
member NotEnabled
NotEnabled = 'disabled'The element is not enabled and does not respond to user interaction.
member Selected
Selected = 'selected'The element is currently selected.
member UpdatesFrequently
UpdatesFrequently = 'frequentUpdates'The element frequently updates its label or value.
enum AndroidDirectory
enum AndroidDirectory { ALARMS, AUDIOBOOKS, DCIM, DOCUMENTS, DOWNLOADS, MOVIES, MUSIC, NOTIFICATIONS, PICTURES, PODCASTS, RINGTONES, SCREENSHOTS,}member ALARMS
ALARMSmember AUDIOBOOKS
AUDIOBOOKSmember DCIM
DCIMmember DOCUMENTS
DOCUMENTSmember DOWNLOADS
DOWNLOADSmember MOVIES
MOVIESmember MUSIC
MUSICmember NOTIFICATIONS
NOTIFICATIONSmember PICTURES
PICTURESmember PODCASTS
PODCASTSmember RINGTONES
RINGTONESmember SCREENSHOTS
SCREENSHOTSenum CacheMode
enum CacheMode { none, memory, diskAndMemory,}enum FontScaleCategory
enum FontScaleCategory { ExtraSmall = 'extra-small', Medium = 'medium', ExtraLarge = 'extra-large',}member ExtraLarge
ExtraLarge = 'extra-large'member ExtraSmall
ExtraSmall = 'extra-small'member Medium
Medium = 'medium'enum GestureEvents
enum GestureEvents { gestureAttached = 'gestureAttached', touchDown = 'touchDown', touchUp = 'touchUp',}member gestureAttached
gestureAttached = 'gestureAttached'member touchDown
touchDown = 'touchDown'member touchUp
touchUp = 'touchUp'enum GestureStateTypes
enum GestureStateTypes { cancelled = 0, began = 1, changed = 2, ended = 3,}enum GestureTypes
enum GestureTypes { tap = 1, doubleTap = 2, pinch = 4, pan = 8, swipe = 16, rotation = 32, longPress = 64, touch = 128,}enum HttpResponseEncoding
enum HttpResponseEncoding { UTF8 = 0, GBK = 1,}enum ImageSymbolEffects
enum ImageSymbolEffects { Appear = 'appear', AppearUp = 'appearUp', AppearDown = 'appearDown', Bounce = 'bounce', BounceUp = 'bounceUp', BounceDown = 'bounceDown', Disappear = 'disappear', DisappearDown = 'disappearDown', DisappearUp = 'disappearUp', Pulse = 'pulse', Scale = 'scale', ScaleDown = 'scaleDown', ScaleUp = 'scaleUp', VariableColor = 'variableColor', Breathe = 'breathe', BreathePlain = 'breathePlain', BreathePulse = 'breathePulse', Rotate = 'rotate', RotateClockwise = 'rotateClockwise', RotateCounterClockwise = 'rotateCounterClockwise', Wiggle = 'wiggle', WiggleBackward = 'wiggleBackward', WiggleClockwise = 'wiggleClockwise', WiggleCounterClockwise = 'wiggleCounterClockwise', WiggleDown = 'wiggleDown', WiggleForward = 'wiggleForward', WiggleUp = 'wiggleUp', WiggleLeft = 'wiggleLeft', WiggleRight = 'wiggleRight',}member Appear
Appear = 'appear'member AppearDown
AppearDown = 'appearDown'member AppearUp
AppearUp = 'appearUp'member Bounce
Bounce = 'bounce'member BounceDown
BounceDown = 'bounceDown'member BounceUp
BounceUp = 'bounceUp'member Breathe
Breathe = 'breathe'member BreathePlain
BreathePlain = 'breathePlain'member BreathePulse
BreathePulse = 'breathePulse'member Disappear
Disappear = 'disappear'member DisappearDown
DisappearDown = 'disappearDown'member DisappearUp
DisappearUp = 'disappearUp'member Pulse
Pulse = 'pulse'member Rotate
Rotate = 'rotate'member RotateClockwise
RotateClockwise = 'rotateClockwise'member RotateCounterClockwise
RotateCounterClockwise = 'rotateCounterClockwise'member Scale
Scale = 'scale'member ScaleDown
ScaleDown = 'scaleDown'member ScaleUp
ScaleUp = 'scaleUp'member VariableColor
VariableColor = 'variableColor'member Wiggle
Wiggle = 'wiggle'member WiggleBackward
WiggleBackward = 'wiggleBackward'member WiggleClockwise
WiggleClockwise = 'wiggleClockwise'member WiggleCounterClockwise
WiggleCounterClockwise = 'wiggleCounterClockwise'member WiggleDown
WiggleDown = 'wiggleDown'member WiggleForward
WiggleForward = 'wiggleForward'member WiggleLeft
WiggleLeft = 'wiggleLeft'member WiggleRight
WiggleRight = 'wiggleRight'member WiggleUp
WiggleUp = 'wiggleUp'enum NavigationType
enum NavigationType { back = 0, forward = 1, replace = 2,}enum SharedTransitionAnimationType
enum SharedTransitionAnimationType { present = 0, dismiss = 1,}enum SwipeDirection
enum SwipeDirection { right = 1, left = 2, up = 4, down = 8,}enum TouchAction
enum TouchAction { down = 'down', up = 'up', move = 'move', cancel = 'cancel',}enum WritingToolsAllowedInput
enum WritingToolsAllowedInput { Default = 0, List = 1, PlainText = 2, RichText = 3, Table = 4,}(iOS Only) Allowed input for Apple Intelligence Writing Tools 8.9
enum WritingToolsBehavior
enum WritingToolsBehavior { Complete = 0, Default = 1, Limited = 2, None = 3,}(iOS Only) Behavior for Apple Intelligence Writing Tools 8.9
Type Aliases
type AlignContent
type AlignContent = | 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'stretch';type AlignItems
type AlignItems = 'flex-start' | 'flex-end' | 'center' | 'baseline' | 'stretch';type AlignSelf
type AlignSelf = 'auto' | AlignItems;type AnimationPromise
type AnimationPromise = Promise<void> & Cancelable;type dip
type dip = number;Deprecated
Use
CoreTypes.dipinstead.
type Flex
type Flex = | number | 'auto' | 'none' | `${FlexGrow} ${FlexShrink}` | CoreTypes.CSSWideKeywords;type FlexDirection
type FlexDirection = 'row' | 'row-reverse' | 'column' | 'column-reverse';type FlexFlow
type FlexFlow = `${FlexDirection} ${FlexWrap}`;type FlexWrap
type FlexWrap = 'nowrap' | 'wrap' | 'wrap-reverse';type FontStyleType
type FontStyleType = 'normal' | 'italic' | CoreTypes.CSSWideKeywords;type FontVariationSettingsType
type FontVariationSettingsType = { axis: string; value: number;};type FontWeightType
type FontWeightType = | '100' | '200' | '300' | 'normal' | '400' | '500' | '600' | 'bold' | '700' | '800' | '900' | number | CoreTypes.CSSWideKeywords;type GlassEffectConfig
type GlassEffectConfig = { variant?: GlassEffectVariant; interactive?: boolean; tint?: string | Color; /** * (LiquidGlassContainer only) spacing between child elements (default is 8) */ spacing?: number; /** * Duration in milliseconds to animate effect changes (default is 300ms) */ animateChangeDuration?: number;};type GlassEffectType
type GlassEffectType = GlassEffectVariant | GlassEffectConfig;type GlassEffectVariant
type GlassEffectVariant = 'regular' | 'clear' | 'identity' | 'none';Glass effects
type GridUnitType
type GridUnitType = 'pixel' | 'star' | 'auto';type Headers
type Headers = { [key: string]: string | string[];};type HorizontalAlignment
type HorizontalAlignment = CoreTypes.HorizontalAlignmentType;Deprecated
Use
CoreTypes.HorizontalAlignmentTypeinstead.
type InstrumentationMode
type InstrumentationMode = 'counters' | 'timeline' | 'lifecycle';Profiling mode to use. -
countersAccumulates method call counts and times until dumpProfiles is called and then prints aggregated statistic in the console. This is the default. -timelineOutputs method names along start/end timestamps in the console on the go. -lifecycleOutputs basic non-verbose times for startup, navigation, etc.
type iosSymbolScaleType
type iosSymbolScaleType = 'default' | 'small' | 'medium' | 'large';iOS only SF Symbol scale
type JustifyContent
type JustifyContent = | 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around';type LengthDipUnit
type LengthDipUnit = CoreTypes.LengthDipUnit;Deprecated
Use
CoreTypes.LengthDipUnitinstead.
type LengthPercentUnit
type LengthPercentUnit = CoreTypes.LengthPercentUnit;Deprecated
Use
CoreTypes.LengthPercentUnitinstead.
type LengthPxUnit
type LengthPxUnit = CoreTypes.LengthPxUnit;Deprecated
Use
CoreTypes.LengthPxUnitinstead.
type LengthType
type LengthType = CoreTypes.LengthType;Deprecated
Use
CoreTypes.LengthTypeinstead.
type ModuleListProvider
type ModuleListProvider = () => string[];type NativeWindowEventName
type NativeWindowEventName = (typeof NativeWindowEvents)[keyof typeof NativeWindowEvents];type percent
type percent = number;Deprecated
Use
CoreTypes.percentinstead.
type PercentLengthType
type PercentLengthType = CoreTypes.PercentLengthType;Deprecated
Use
CoreTypes.PercentLengthTypeinstead.
type px
type px = number;Deprecated
Use
CoreTypes.pxinstead.
type SceneEventName
type SceneEventName = (typeof SceneEvents)[keyof typeof SceneEvents];type SharedTransitionTagProperties
type SharedTransitionTagProperties = SharedProperties & { /** * The visual stacking order where 0 is at the bottom. * Shared elements are stacked one on top of the other during each transition. * By default they are not ordered in any particular fashion. */ zIndex?: number; /** * Collection of properties to match and animate on each shared element. * * Defaults to: 'backgroundColor', 'cornerRadius', 'borderWidth', 'borderColor' * * Tip: Using an empty array, [], for view or layer will avoid copying any properties if desired. */ propertiesToMatch?: SharedTransitionTagPropertiesToMatch; /** * */ callback?: (view: View, action: SharedTransitionEventAction) => Promise<void>;};Properties which can be set on individual Shared Elements
type SplitBehavior
type SplitBehavior = 'automatic' | 'tile' | 'overlay' | 'displace';type SplitDisplayMode
type SplitDisplayMode = | 'automatic' | 'secondaryOnly' | 'oneBesideSecondary' | 'oneOverSecondary' | 'twoBesideSecondary' | 'twoOverSecondary' | 'twoDisplaceSecondary';type SplitRole
type SplitRole = 'primary' | 'secondary' | 'supplementary' | 'inspector';type SplitStyle
type SplitStyle = 'automatic' | 'double' | 'triple';type TouchAnimationOptions
type TouchAnimationOptions = { up?: TouchAnimationFn | AnimationDefinition; down?: TouchAnimationFn | AnimationDefinition;};type Transformation
type Transformation = { property: TransformationType; value: TransformationValue;};type TransformationType
type TransformationType = | 'rotate' | 'rotate3d' | 'rotateX' | 'rotateY' | 'translate' | 'translate3d' | 'translateX' | 'translateY' | 'scale' | 'scale3d' | 'scaleX' | 'scaleY';type TransformationValue
type TransformationValue = Point3D | Pair | number;type TransformFunctionsInfo
type TransformFunctionsInfo = { translate: Pair; rotate: Point3D; scale: Pair;};type VerticalAlignment
type VerticalAlignment = CoreTypes.VerticalAlignmentType;Deprecated
Use
CoreTypes.VerticalAlignmentTypeinstead.
type VisionHoverOptions
type VisionHoverOptions = { effect: VisionHoverEffect; shape?: VisionHoverShape; shapeCornerRadius?: number;};type WebViewNavigationType
type WebViewNavigationType = | 'linkClicked' | 'formSubmitted' | 'backForward' | 'reload' | 'formResubmitted' | 'other' | undefined;Represents navigation type
type WindowContentResolver
type WindowContentResolver = ( request: WindowContentRequest) => View | NavigationEntry | string | null | undefined;Supplies the UI for a window that needs content. Called once per window that needs it.
Return a
View, aNavigationEntryor a module name to set the window content,nullto take ownership and set the content asynchronously later, orundefinedto fall back to the application main entry.
type WindowRole
type WindowRole = 'application' | 'embedded' | 'carplay' | 'externalDisplay';The purpose a window surface serves.
-
application– a regular app window (iOS application scene, Android activity). -embedded– a window hosted inside another app or container. -carplay– a CarPlay template scene. -externalDisplay– an external/secondary display scene.
type WindowState
type WindowState = 'attached' | 'detached' | 'closed';The lifecycle state of a window surface.
-
attached– connected to a live native surface. -detached– the native surface went away but the window may be reconnected. -closed– permanently torn down.
Namespaces
namespace AccessibilityEvents
namespace AccessibilityEvents {}variable accessibilityBlurEvent
const accessibilityBlurEvent: string;variable accessibilityFocusChangedEvent
const accessibilityFocusChangedEvent: string;variable accessibilityFocusEvent
const accessibilityFocusEvent: string;variable accessibilityPerformEscapeEvent
const accessibilityPerformEscapeEvent: string;namespace AndroidHelper
namespace AndroidHelper {}Various Android view helper methods
function clearDrawableColor
clearDrawableColor: (drawable: any) => void;function getCopyOrDrawable
getCopyOrDrawable: (drawable: any, resources?: any) => any;function getDrawableColor
getDrawableColor: (drawable: any) => Color;function setDrawableColor
setDrawableColor: (color: number, drawable: any, blendMode?: any) => void;namespace ApplicationSettings
module 'application-settings/index.d.ts' {}Checks whether such a key exists.
Parameter key
The key to check for.
function clear
clear: () => void;Removes all values.
function flush
flush: () => boolean;Flush all changes to disk synchronously. boolean flag indicating if changes were saved successfully to disk.
function getAllKeys
getAllKeys: () => Array<string>;Get all stored keys Array containing all stored keys
function getBoolean
getBoolean: (key: string, defaultValue?: boolean) => boolean;Gets a value (if existing) for a key as a Boolean Object. A default value can be provided in case there is no existing value.
Parameter key
The key to check for.
Parameter defaultValue
An optional value to be returned in case there is no existing value.
function getNumber
getNumber: (key: string, defaultValue?: number) => number;Gets a value (if existing) for a key as a Number Object. A default value can be provided in case there is no existing value.
Parameter key
The key to check for.
Parameter defaultValue
An optional value to be returned in case there is no existing value.
function getString
getString: (key: string, defaultValue?: string) => string;Gets a value (if existing) for a key as a String Object. A default value can be provided in case there is no existing value.
Parameter key
The key to check for.
Parameter defaultValue
An optional value to be returned in case there is no existing value.
function hasKey
hasKey: (key: string) => boolean;Checks whether such a key exists.
Parameter key
The key to check for.
function remove
remove: (key: string) => void;Removes a value (if existing) for a key.
Parameter key
The key to check for.
function setBoolean
setBoolean: (key: string, value: boolean) => void;Sets a Boolean Object for a key.
Parameter key
The key.
Parameter value
The value.
function setNumber
setNumber: (key: string, value: number) => void;Sets a Number Object for a key.
Parameter key
The key.
Parameter value
The value.
function setString
setString: (key: string, value: string) => void;Sets a String Object for a key.
Parameter key
The key.
Parameter value
The value.
namespace capitalizationType
namespace capitalizationType {}Defines the capitalization type for prompt dialog.
namespace Connectivity
module 'connectivity/index.d.ts' {}Gets the type of connection. Returns a value from the connectivity.connectionType enumeration. To use this method on Android you need to have the android.permission.ACCESS_NETWORK_STATE permission added to the AndroidManifest.xml file.
function getConnectionType
getConnectionType: () => number;Gets the type of connection. Returns a value from the connectivity.connectionType enumeration. To use this method on Android you need to have the android.permission.ACCESS_NETWORK_STATE permission added to the AndroidManifest.xml file.
function startMonitoring
startMonitoring: ( connectionTypeChangedCallback: (newConnectionType: number) => void) => void;Starts monitoring the connection type.
Parameter connectionTypeChangedCallback
A function that will be called when the connection type changes.
function stopMonitoring
stopMonitoring: () => void;Stops monitoring the connection type.
enum connectionType
enum connectionType { none = 0, wifi = 1, mobile = 2, ethernet = 3, bluetooth = 4, vpn = 5,}Defines the different connection types.
member bluetooth
bluetooth = 4Denotes a bluetooth connection
member ethernet
ethernet = 3Denotes an ethernet connection
member mobile
mobile = 2Denotes a mobile connection, i.e. cellular network or WAN.
member none
none = 0Denotes no connection.
member vpn
vpn = 5Denotes a vpn connection
member wifi
wifi = 1Denotes a WiFi connection.
namespace CoreTypes
namespace CoreTypes {}variable zeroLength
const zeroLength: LengthType;type AndroidOverflow
type AndroidOverflow = | AndroidOverflowSingle | AndroidOverflowMultiple | AndroidOverflowStacked;type AutocapitalizationInputType
type AutocapitalizationInputType = 'none' | 'words' | 'sentences' | 'allcharacters';type AutofillType
type AutofillType = 'username' | 'password' | 'none' | string;type BackgroundRepeatType
type BackgroundRepeatType = | 'repeat' | 'repeat-x' | 'repeat-y' | 'no-repeat' | CSSWideKeywords;type CornerShapeType
type CornerShapeType = 'round' | 'squircle';type CSSWideKeywords
type CSSWideKeywords = 'initial' | 'inherit' | 'unset' | 'revert';type DeviceOrientationType
type DeviceOrientationType = 'portrait' | 'landscape' | 'unknown';type dip
type dip = number;Denotes a length number that is in device independent pixel units.
type DockType
type DockType = 'left' | 'top' | 'right' | 'bottom';type FixedLengthType
type FixedLengthType = | dip | LengthDipUnit | LengthPxUnit | `${number}dip` | `${number}px` | CSSWideKeywords;type HorizontalAlignmentType
type HorizontalAlignmentType = | 'start' | 'left' | 'center' | 'right' | 'end' | 'stretch' | CSSWideKeywords;type ImageStretchType
type ImageStretchType = 'none' | 'aspectFill' | 'aspectFit' | 'fill';type KeyboardInputType
type KeyboardInputType = | 'datetime' | 'phone' | 'number' | 'decimal' | 'url' | 'email' | 'integer';type LayoutDirectionType
type LayoutDirectionType = 'ltr' | 'rtl';type LengthDipUnit
type LengthDipUnit = { readonly unit: 'dip'; readonly value: dip;};type LengthPercentUnit
type LengthPercentUnit = { readonly unit: '%'; readonly value: percent;};type LengthPxUnit
type LengthPxUnit = { readonly unit: 'px'; readonly value: px;};type LengthType
type LengthType = 'auto' | FixedLengthType;type MaxLinesType
type MaxLinesType = number;type OrientationType
type OrientationType = 'horizontal' | 'vertical';type percent
type percent = number;Denotes a normalized percent number. 0% is represented as 0 50% is represented as 0.5 100% is represented as 1
type PercentLengthType
type PercentLengthType = 'auto' | FixedLengthType | LengthPercentUnit | `${number}%`;type px
type px = number;Denotes a length number that is in physical device pixels.
type ReturnKeyButtonType
type ReturnKeyButtonType = 'done' | 'next' | 'go' | 'search' | 'send';type TextAlignmentType
type TextAlignmentType = 'left' | 'center' | 'right' | 'justify' | CSSWideKeywords;type TextDecorationType
type TextDecorationType = | 'none' | 'underline' | 'line-through' | 'underline line-through' | CSSWideKeywords;type TextOverflowType
type TextOverflowType = 'clip' | 'ellipsis' | CSSWideKeywords;type TextTransformType
type TextTransformType = | 'none' | 'capitalize' | 'uppercase' | 'lowercase' | CSSWideKeywords;type UpdateTextTriggerType
type UpdateTextTriggerType = 'focusLost' | 'textChanged';type VerticalAlignmentTextType
type VerticalAlignmentTextType = | VerticalAlignmentType | 'text-top' | 'text-bottom' | 'sup' | 'sub' | 'baseline';type VerticalAlignmentType
type VerticalAlignmentType = | 'top' | 'middle' | 'bottom' | 'stretch' | CSSWideKeywords;type VisibilityType
type VisibilityType = | 'visible' | 'hidden' | 'collapse' | 'collapsed' | CSSWideKeywords;type WhiteSpaceType
type WhiteSpaceType = 'normal' | 'nowrap' | 'wrap' | CSSWideKeywords;namespace CoreTypes.Accuracy
namespace CoreTypes.Accuracy {}namespace CoreTypes.AndroidActionBarIconVisibility
namespace CoreTypes.AndroidActionBarIconVisibility {}namespace CoreTypes.AndroidActionItemPosition
namespace CoreTypes.AndroidActionItemPosition {}variable actionBar
const actionBar: string;variable actionBarIfRoom
const actionBarIfRoom: string;variable popup
const popup: string;namespace CoreTypes.AnimationCurve
namespace CoreTypes.AnimationCurve {}variable ease
const ease: string;variable easeIn
const easeIn: string;variable easeInOut
const easeInOut: string;variable easeOut
const easeOut: string;variable linear
const linear: string;variable spring
const spring: string;function cubicBezier
cubicBezier: ( x1: number, y1: number, x2: number, y2: number) => CubicBezierAnimationCurve;namespace CoreTypes.AutocapitalizationType
namespace CoreTypes.AutocapitalizationType {}variable allCharacters
const allCharacters: AutocapitalizationInputType;variable none
const none: AutocapitalizationInputType;variable sentences
const sentences: AutocapitalizationInputType;variable words
const words: AutocapitalizationInputType;namespace CoreTypes.AutofillType
namespace CoreTypes.AutofillType {}variable newPassword
const newPassword: string;variable newUsername
const newUsername: string;variable none
const none: string;variable oneTimeCode
const oneTimeCode: string;variable password
const password: string;variable username
const username: string;namespace CoreTypes.BackgroundRepeat
namespace CoreTypes.BackgroundRepeat {}variable noRepeat
const noRepeat: BackgroundRepeatType;variable repeat
const repeat: BackgroundRepeatType;variable repeatX
const repeatX: BackgroundRepeatType;variable repeatY
const repeatY: BackgroundRepeatType;function isValid
isValid: (value: any) => value is BackgroundRepeatType;function parse
parse: (value: any) => BackgroundRepeatType;namespace CoreTypes.CornerShape
namespace CoreTypes.CornerShape {}namespace CoreTypes.DeviceOrientation
namespace CoreTypes.DeviceOrientation {}namespace CoreTypes.DeviceType
namespace CoreTypes.DeviceType {}namespace CoreTypes.Dock
namespace CoreTypes.Dock {}namespace CoreTypes.FontAttributes
namespace CoreTypes.FontAttributes {}namespace CoreTypes.FontStyle
namespace CoreTypes.FontStyle {}namespace CoreTypes.FontWeight
namespace CoreTypes.FontWeight {}variable black
const black: string;variable bold
const bold: string;variable extraBold
const extraBold: string;variable extraLight
const extraLight: string;variable light
const light: string;variable medium
const medium: string;variable normal
const normal: string;variable semiBold
const semiBold: string;variable thin
const thin: string;namespace CoreTypes.HorizontalAlignment
namespace CoreTypes.HorizontalAlignment {}variable center
const center: string;variable end
const end: string;variable left
const left: string;variable right
const right: string;variable start
const start: string;variable stretch
const stretch: string;function isValid
isValid: (value: any) => value is HorizontalAlignmentType;function parse
parse: (value: any) => HorizontalAlignmentType;namespace CoreTypes.ImageFormat
namespace CoreTypes.ImageFormat {}namespace CoreTypes.ImageStretch
namespace CoreTypes.ImageStretch {}variable aspectFill
const aspectFill: ImageStretchType;variable aspectFit
const aspectFit: ImageStretchType;variable fill
const fill: ImageStretchType;variable none
const none: ImageStretchType;namespace CoreTypes.IOSActionItemPosition
namespace CoreTypes.IOSActionItemPosition {}namespace CoreTypes.KeyboardType
namespace CoreTypes.KeyboardType {}namespace CoreTypes.LayoutDirection
namespace CoreTypes.LayoutDirection {}namespace CoreTypes.NavigationBarVisibility
namespace CoreTypes.NavigationBarVisibility {}namespace CoreTypes.Orientation
namespace CoreTypes.Orientation {}variable horizontal
const horizontal: string;variable vertical
const vertical: string;namespace CoreTypes.ReturnKeyType
namespace CoreTypes.ReturnKeyType {}namespace CoreTypes.StatusBarStyle
namespace CoreTypes.StatusBarStyle {}namespace CoreTypes.SystemAppearance
namespace CoreTypes.SystemAppearance {}namespace CoreTypes.TextAlignment
namespace CoreTypes.TextAlignment {}namespace CoreTypes.TextDecoration
namespace CoreTypes.TextDecoration {}variable lineThrough
const lineThrough: string;variable none
const none: string;variable underline
const underline: string;namespace CoreTypes.TextOverflow
namespace CoreTypes.TextOverflow {}namespace CoreTypes.TextTransform
namespace CoreTypes.TextTransform {}variable capitalize
const capitalize: string;variable lowercase
