@nativescript/core
- Version 8.8.6
- Published
- 25.2 MB
- 7 dependencies
- Apache-2.0 license
Install
npm i @nativescript/core
yarn add @nativescript/core
pnpm add @nativescript/core
Overview
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
- backgroundProperty
- backgroundRepeatProperty
- backgroundSizeProperty
- borderBottomColorProperty
- borderBottomLeftRadiusProperty
- borderBottomRightRadiusProperty
- borderBottomWidthProperty
- borderColorProperty
- borderLeftColorProperty
- borderLeftWidthProperty
- borderRadiusProperty
- borderRightColorProperty
- borderRightWidthProperty
- borderTopColorProperty
- borderTopLeftRadiusProperty
- borderTopRightRadiusProperty
- borderTopWidthProperty
- borderWidthProperty
- clipPathProperty
- colorProperty
- CSSHelper
- Device
- Dialogs
- 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
- isIOS
- isUserInteractionEnabledProperty
- keyboardTypeProperty
- launchEvent
- letterSpacingProperty
- lineHeightProperty
- loadAppCss
- lowMemoryEvent
- marginBottomProperty
- marginLeftProperty
- marginProperty
- marginRightProperty
- marginTopProperty
- maxLengthProperty
- minHeightProperty
- minWidthProperty
- notify
- off
- on
- opacityProperty
- orientation
- orientationChangedEvent
- paddingBottomProperty
- paddingLeftProperty
- paddingProperty
- paddingRightProperty
- paddingTopProperty
- placeholderColorProperty
- platformNames
- resetRootView
- resumeEvent
- returnKeyTypeProperty
- rotateProperty
- run
- scaleXProperty
- scaleYProperty
- setAutoSystemAppearanceChanged
- setCssFileName
- setMaxRefreshRate
- setResources
- suspended
- suspendEvent
- systemAppearance
- systemAppearanceChanged
- systemAppearanceChangedEvent
- textAlignmentProperty
- textDecorationProperty
- textOverflowProperty
- textShadowProperty
- textStrokeProperty
- textTransformProperty
- translateXProperty
- translateYProperty
- uncaughtErrorEvent
- unsetValue
- updateTextTriggerProperty
- verticalAlignmentProperty
- visibilityProperty
- whiteSpaceProperty
- widthProperty
- zeroLength
- zIndexProperty
Functions
- action()
- addTaggedAdditionalCSS()
- addWeakEventListener()
- alert()
- animationTimingFunctionConverter()
- booleanConverter()
- confirm()
- CSSType()
- eachDescendant()
- fromObject()
- fromObjectRecursive()
- getAncestor()
- getCurrentPage()
- getFileAccess()
- getRootLayout()
- getTransformedText()
- getViewById()
- isEmbedded()
- login()
- makeParser()
- makeValidator()
- parseCSSShadow()
- parseKeyframeDeclarations()
- profile()
- profilingDisable()
- profilingDumpProfiles()
- profilingEnable()
- profilingIsRunning()
- profilingResetProfiles()
- profilingStart()
- profilingStartCPU()
- profilingStop()
- profilingStopCPU()
- profilingTime()
- profilingUptime()
- prompt()
- PseudoClassHandler()
- querySelectorAll()
- removeTaggedAdditionalCSS()
- removeWeakEventListener()
- resolveFileNameFromUrl()
- sanitizeModuleName()
- setActivityCallbacks()
- timeConverter()
- transformConverter()
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()
- nativeApp
- on()
- packageName
- paused
- registerBroadcastReceiver()
- saveActivityStateEvent
- saveActivityStateEvent
- startActivity
- unregisterBroadcastReceiver()
ApplicationCommon
- addCss()
- android
- AndroidApplication
- applyCssClass()
- autoSystemAppearanceChanged
- backgroundEvent
- createRootView()
- cssChangedEvent
- discardedErrorEvent
- displayedEvent
- exitEvent
- fontScaleChangedEvent
- foregroundEvent
- getCssFileName()
- getMainEntry()
- getNativeApplication()
- getOrientation()
- getResources()
- getRootView()
- getSystemAppearance()
- hasLaunched()
- hasListeners
- hasListeners
- inBackground
- initRootView()
- initRootViewEvent
- ios
- iOSApplication
- launchEvent
- livesyncEvent
- loadAppCss()
- loadAppCssEvent
- lowMemoryEvent
- mainEntry
- notify
- notify
- notifyLaunch()
- off
- off
- on
- on
- once
- once
- orientation()
- orientationChanged()
- orientationChangedEvent
- resetRootView()
- resumeEvent
- run()
- setAutoSystemAppearanceChanged()
- setCssFileName()
- setInBackground()
- setMaxRefreshRate()
- setOrientation()
- setResources()
- setSuspended()
- setSystemAppearance()
- started
- suspended
- suspendEvent
- systemAppearance()
- systemAppearanceChanged()
- systemAppearanceChangedEvent
- uncaughtErrorEvent
Background
- borderBottomColor
- borderBottomLeftRadius
- borderBottomRightRadius
- borderBottomWidth
- borderLeftColor
- borderLeftWidth
- borderRightColor
- borderRightWidth
- borderTopColor
- borderTopLeftRadius
- borderTopRightRadius
- borderTopWidth
- boxShadow
- clearFlags
- clipPath
- color
- default
- equals()
- getBoxShadow()
- getUniformBorderColor()
- getUniformBorderRadius()
- getUniformBorderWidth()
- hasBorder()
- hasBorderColor()
- hasBorderRadius()
- hasBorderWidth()
- hasBoxShadow()
- hasUniformBorder()
- hasUniformBorderColor()
- hasUniformBorderRadius()
- hasUniformBorderWidth()
- image
- isEmpty()
- position
- repeat
- size
- toString()
- withBorderBottomColor()
- withBorderBottomLeftRadius()
- withBorderBottomRightRadius()
- withBorderBottomWidth()
- withBorderLeftColor()
- withBorderLeftWidth()
- withBorderRightColor()
- withBorderRightWidth()
- withBorderTopColor()
- withBorderTopLeftRadius()
- withBorderTopRightRadius()
- withBorderTopWidth()
- withBoxShadow()
- withClipPath()
- withColor()
- withImage()
- withPosition()
- withRepeat()
- withSize()
Frame
- actionBarVisibility
- android
- animated
- backStack
- canGoBack()
- currentEntry
- currentPage
- defaultAnimatedNavigation
- defaultTransition
- getFrameById()
- 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()
- height
- ios
- iosSymbolScaleFor()
- loadFromBase64()
- loadFromData()
- loadFromFile()
- loadFromFontIconCode()
- loadFromResource()
- resize()
- resizeAsync()
- rotationAngle
- saveToFile()
- saveToFileAsync()
- setNativeSource()
- toBase64String()
- toBase64StringAsync()
- width
Page
- accessibilityAnnouncePageEnabled
- accessibilityScreenChanged()
- actionBar
- actionBarHidden
- androidStatusBarBackground
- backgroundSpanUnderStatusBar
- enableSwipeBackNavigation
- frame
- getKeyframeAnimationWithName()
- hasActionBar
- navigatedFromEvent
- navigatedToEvent
- navigatingFromEvent
- navigatingToEvent
- navigationContext
- on()
- onAccessibilityPerformEscape
- onNavigatedFrom()
- onNavigatedTo()
- onNavigatingFrom()
- onNavigatingTo()
- statusBarStyle
PageBase
- accessibilityAnnouncePageEnabled
- accessibilityScreenChanged()
- actionBar
- actionBarHidden
- androidStatusBarBackground
- backgroundSpanUnderStatusBar
- eachChildView()
- enableSwipeBackNavigation
- frame
- getKeyframeAnimationWithName()
- hasActionBar
- navigatedFromEvent
- navigatedToEvent
- navigatingFromEvent
- navigatingToEvent
- navigationContext
- onNavigatedFrom()
- onNavigatedTo()
- onNavigatingFrom()
- onNavigatingTo()
- page
- statusBarStyle
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
- flexDirection
- flexGrow
- flexShrink
- flexWrap
- flexWrapBefore
- font
- fontFamily
- fontInternal
- fontScaleInternal
- fontSize
- fontStyle
- fontVariationSettings
- fontWeight
- getCssVariable()
- height
- horizontalAlignment
- iosAccessibilityAdjustsFontSize
- iosAccessibilityMaxFontScale
- iosAccessibilityMinFontScale
- justifyContent
- letterSpacing
- lineHeight
- margin
- marginBottom
- marginLeft
- marginRight
- marginTop
- maxLines
- minHeight
- minWidth
- opacity
- order
- padding
- paddingBottom
- paddingLeft
- paddingRight
- paddingTop
- perspective
- placeholderColor
- PropertyBag
- removeScopedCssVariable()
- removeUnscopedCssVariable()
- resetScopedCssVariables()
- resetUnscopedCssVariables()
- rotate
- rotateX
- rotateY
- 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
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
- accessibilityLabel
- accessibilityLanguage
- accessibilityLiveRegion
- accessibilityMediaSession
- accessibilityRole
- accessibilityScreenChanged()
- accessibilityState
- accessibilityValue
- accessible
- addCss()
- addCssFile()
- android
- androidDynamicElevationOffset
- androidElevation
- animate()
- automationText
- background
- backgroundColor
- backgroundImage
- bindingContext
- borderBottomColor
- borderBottomLeftRadius
- borderBottomRightRadius
- borderBottomWidth
- borderColor
- borderLeftColor
- borderLeftWidth
- borderRadius
- borderRightColor
- borderRightWidth
- borderTopColor
- borderTopLeftRadius
- borderTopRightRadius
- borderTopWidth
- borderWidth
- boxShadow
- changeCssFile()
- color
- combineMeasuredStates()
- createAnimation()
- css
- cssClasses
- cssPseudoClasses
- cssType
- eachChildView()
- focus()
- getActualSize()
- getGestureObservers()
- getLocationInWindow()
- getLocationOnScreen()
- getLocationRelativeTo()
- getMeasuredHeight()
- getMeasuredState()
- getMeasuredWidth()
- getSafeAreaInsets()
- hasGestureObservers()
- height
- horizontalAlignment
- ios
- iosAccessibilityAdjustsFontSize
- iosAccessibilityMaxFontScale
- iosAccessibilityMinFontScale
- iosIgnoreSafeArea
- iosOverflowSafeArea
- iosOverflowSafeAreaEnabled
- isEnabled
- isLayoutRequired
- isLayoutValid
- isUserInteractionEnabled
- layout()
- layoutChangedEvent
- layoutChild()
- layoutNativeView()
- margin
- marginBottom
- marginLeft
- marginRight
- marginTop
- measure()
- measureChild()
- minHeight
- minWidth
- modal
- needsNativeDrawableFill
- off()
- on()
- onBackPressed()
- onLayout()
- onMeasure()
- opacity
- originX
- originY
- perspective
- resolveSizeAndState()
- rotate
- rotateX
- rotateY
- scaleX
- scaleY
- sendAccessibilityEvent()
- setMeasuredDimension()
- setOnTouchListener()
- showingModallyEvent
- shownModallyEvent
- translateX
- translateY
- verticalAlignment
- visibility
- width
ViewBase
- ['class']
- addPseudoClass()
- alignSelf
- android
- bind()
- bindingContext
- callLoaded()
- callUnloaded()
- className
- closeModal()
- col
- colSpan
- column
- columnSpan
- createdEvent
- createNativeView()
- cssClasses
- cssPseudoClasses
- defaultVisualState
- deletePseudoClass()
- destroyNode()
- disposeNativeView()
- disposeNativeViewEvent
- dock
- domNode
- eachChild()
- effectiveBorderBottomWidth
- effectiveBorderLeftWidth
- effectiveBorderRightWidth
- effectiveBorderTopWidth
- effectiveHeight
- effectiveLeft
- effectiveMarginBottom
- effectiveMarginLeft
- effectiveMarginRight
- effectiveMarginTop
- effectiveMinHeight
- effectiveMinWidth
- effectivePaddingBottom
- effectivePaddingLeft
- effectivePaddingRight
- effectivePaddingTop
- effectiveTop
- effectiveWidth
- ensureDomNode()
- flexGrow
- flexShrink
- flexWrapBefore
- getViewByDomId()
- getViewById()
- id
- initNativeView()
- ios
- isCollapsed
- isLoaded
- left
- loadedEvent
- loadView()
- mIsRootView
- 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
Namespaces
CoreTypes
- AutocapitalizationInputType
- AutofillType
- BackgroundRepeatType
- DeviceOrientationType
- dip
- DockType
- HorizontalAlignmentType
- ImageStretchType
- KeyboardInputType
- LengthDipUnit
- LengthPercentUnit
- LengthPxUnit
- LengthType
- MaxLinesType
- OrientationType
- percent
- PercentLengthType
- px
- ReturnKeyButtonType
- TextAlignmentType
- TextDecorationType
- TextOverflowType
- TextTransformType
- UpdateTextTriggerType
- VerticalAlignmentTextType
- VerticalAlignmentType
- VisibilityType
- WhiteSpaceType
- zeroLength
IOSHelper
- expandBeyondSafeArea()
- getFrameFromPosition()
- getParentWithViewController()
- getPositionFromFrame()
- layoutView()
- shrinkToSafeArea()
- traitCollectionColorAppearanceChangedEvent
- UIAdaptivePresentationControllerDelegateImp
- UILayoutViewController
- UIPopoverPresentationControllerDelegateImp
- updateAutoAdjustScrollInsets()
- updateConstraints()
Utils
- ClassInfo
- clearInterval()
- clearTimeout()
- convertString()
- copyToClipboard()
- CORE_ANIMATION_DEFAULTS
- dataDeserialize()
- dataSerialize()
- debounce()
- debug
- dismissKeyboard()
- dismissSoftInput()
- dispatchToMainThread()
- dispatchToUIThread()
- eliminateDuplicates()
- escapeRegexSymbols()
- executeOnMainThread()
- executeOnUIThread()
- FILE_PREFIX
- GC()
- getBaseClasses()
- getClass()
- getClassInfo()
- getDurationWithDampingFromSpring()
- getFileExtension()
- getModuleName()
- hasDuplicates()
- isBoolean()
- isDataURI()
- isDefined()
- isEmoji()
- isFileOrResourcePath()
- isFontIconURI()
- isFunction()
- isMainThread()
- isNullOrUndefined()
- isNumber()
- isObject()
- isRealDevice()
- isString()
- isUndefined()
- mainThreadify()
- merge()
- mergeSort()
- numberHasDecimals()
- numberIs64Bit()
- openFile()
- openUrl()
- queueGC()
- queueMacrotask()
- releaseNativeObject()
- RESOURCE_PREFIX
- sanitizeModuleName()
- ScopeError
- SDK_VERSION
- setInterval()
- setTimeout()
- Source
- SourceError
- SYSTEM_PREFIX
- throttle()
- toUIString()
- verifyCallback()
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
Application
class 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
Application
class 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.AnimationCurve
instead.
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
Application
class imported from "@nativescript/core" instead:import { Application } from "@nativescript/core";Application.backgroundEvent
variable backgroundImageProperty
const backgroundImageProperty: CssProperty<Style, string>;
variable backgroundInternalProperty
const backgroundInternalProperty: CssProperty<Style, Background>;
variable backgroundPositionProperty
const backgroundPositionProperty: CssProperty<Style, string>;
variable backgroundProperty
const backgroundProperty: ShorthandProperty<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 borderColorProperty
const borderColorProperty: ShorthandProperty<Style, string | Color>;
variable borderLeftColorProperty
const borderLeftColorProperty: CssProperty<Style, Color>;
variable borderLeftWidthProperty
const borderLeftWidthProperty: CssProperty<Style, CoreTypes.LengthType>;
variable borderRadiusProperty
const borderRadiusProperty: ShorthandProperty< Style, string | number | CoreTypes.LengthDipUnit | CoreTypes.LengthPxUnit>;
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 borderWidthProperty
const borderWidthProperty: ShorthandProperty< Style, string | number | CoreTypes.LengthDipUnit | CoreTypes.LengthPxUnit>;
variable clipPathProperty
const clipPathProperty: CssProperty<Style, string>;
variable colorProperty
const colorProperty: InheritedCssProperty<Style, Color>;
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;};
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 discardedErrorEvent
const discardedErrorEvent: string;
Deprecated
Deep imports into the Application module are deprecated and will be removed in a future release. Use the
Application
class 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
Application
class 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; 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
CoreTypes
instead. 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
Application
class imported from "@nativescript/core" instead:import { Application } from "@nativescript/core";Application.exitEvent
variable fontFamilyProperty
const fontFamilyProperty: InheritedCssProperty<Style, string>;
variable fontInternalProperty
const fontInternalProperty: InheritedCssProperty<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
Application
class 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
Application
class 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
Application
class 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
Application
class 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
Application
class 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
Application
class 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
Application
class 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
Application
class 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
Application
class 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
Application
class 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
Application
class 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 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 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
Application
class imported from "@nativescript/core" instead:import { Application } from "@nativescript/core";Application.launchEvent
variable letterSpacingProperty
const letterSpacingProperty: CssProperty<Style, number>;
variable lineHeightProperty
const lineHeightProperty: CssProperty<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
Application
class 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
Application
class 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 marginProperty
const marginProperty: ShorthandProperty< Style, | string | number | CoreTypes.LengthDipUnit | CoreTypes.LengthPxUnit | CoreTypes.LengthPercentUnit>;
variable marginRightProperty
const marginRightProperty: CssProperty<Style, CoreTypes.PercentLengthType>;
variable marginTopProperty
const marginTopProperty: CssProperty<Style, CoreTypes.PercentLengthType>;
variable maxLengthProperty
const maxLengthProperty: Property<EditableTextBase, number>;
variable minHeightProperty
const minHeightProperty: CssProperty< Style, number | CoreTypes.LengthDipUnit | CoreTypes.LengthPxUnit>;
variable minWidthProperty
const minWidthProperty: CssProperty< Style, number | CoreTypes.LengthDipUnit | CoreTypes.LengthPxUnit>;
variable notify
const notify: any;
Deprecated
Deep imports into the Application module are deprecated and will be removed in a future release. Use the
Application
class 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
Application
class 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
Application
class 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
Application
class 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
Application
class imported from "@nativescript/core" instead:import { Application } from "@nativescript/core";Application.orientationChangedEvent
variable paddingBottomProperty
const paddingBottomProperty: CssProperty<Style, CoreTypes.LengthType>;
variable paddingLeftProperty
const paddingLeftProperty: CssProperty<Style, CoreTypes.LengthType>;
variable paddingProperty
const paddingProperty: ShorthandProperty< Style, string | number | CoreTypes.LengthDipUnit | CoreTypes.LengthPxUnit>;
variable paddingRightProperty
const paddingRightProperty: CssProperty<Style, CoreTypes.LengthType>;
variable paddingTopProperty
const paddingTopProperty: CssProperty<Style, CoreTypes.LengthType>;
variable placeholderColorProperty
const placeholderColorProperty: CssProperty<Style, Color>;
variable platformNames
const platformNames: { android: string; ios: string; visionos: 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
Application
class 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
Application
class 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 run
const run: any;
Deprecated
Deep imports into the Application module are deprecated and will be removed in a future release. Use the
Application
class 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 setAutoSystemAppearanceChanged
const setAutoSystemAppearanceChanged: any;
Deprecated
Deep imports into the Application module are deprecated and will be removed in a future release. Use the
Application
class 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
Application
class 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
Application
class 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
Application
class 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
Application
class 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
Application
class 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
Application
class 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
Application
class 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
Application
class 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: CssProperty<Style, ShadowCSSValues>;
variable textStrokeProperty
const textStrokeProperty: CssProperty<Style, StrokeCSSValues>;
variable textTransformProperty
const textTransformProperty: CssProperty<Style, CoreTypes.TextTransformType>;
variable translateXProperty
const translateXProperty: CssAnimationProperty<Style, number>;
variable translateYProperty
const translateYProperty: CssAnimationProperty<Style, number>;
variable uncaughtErrorEvent
const uncaughtErrorEvent: string;
Deprecated
Deep imports into the Application module are deprecated and will be removed in a future release. Use the
Application
class 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 verticalAlignmentProperty
const verticalAlignmentProperty: CssProperty<Style, CoreTypes.VerticalAlignmentType>;
variable visibilityProperty
const visibilityProperty: CssProperty<Style, CoreTypes.VisibilityType>;
variable whiteSpaceProperty
const whiteSpaceProperty: CssProperty<Style, CoreTypes.WhiteSpaceType>;
variable widthProperty
const widthProperty: CssAnimationProperty<Style, CoreTypes.PercentLengthType>;
variable zeroLength
const zeroLength: CoreTypes.LengthType;
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: ViewBaseDefinition, callback: (child: ViewBaseDefinition) => 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: ( view: ViewBaseDefinition, criterion: string | { new (): any }) => ViewBaseDefinition;
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 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 getRootLayout
getRootLayout: () => RootLayout;
function getTransformedText
getTransformedText: ( text: string, textTransform: CoreTypes.TextTransformType) => string;
function getViewById
getViewById: (view: ViewBaseDefinition, id: string) => ViewBaseDefinition;
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 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 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.json
enabling 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: ViewBaseDefinition, selector: string) => Array<ViewBaseDefinition>;
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: (filepath: 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 setActivityCallbacks
setActivityCallbacks: (activity: any) => void;
function timeConverter
timeConverter: (value: string) => number;
function transformConverter
transformConverter: (text: string) => TransformFunctionsInfo;
Classes
class AbsoluteLayout
class AbsoluteLayout extends LayoutBase {}
A layout that lets you specify exact locations (left/top coordinates) of its children.
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).
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.
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 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
this
context 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.
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.
class AndroidApplication
class AndroidApplication extends ApplicationCommon {}
property activityBackPressedEvent
static readonly activityBackPressedEvent: string;
Deprecated
Use
Application.android.activityBackPressedEvent
instead.
property activityBackPressedEvent
readonly activityBackPressedEvent: string;
property activityCreatedEvent
static readonly activityCreatedEvent: string;
Deprecated
Use
Application.android.activityCreatedEvent
instead.
property activityCreatedEvent
readonly activityCreatedEvent: string;
property activityDestroyedEvent
static readonly activityDestroyedEvent: string;
Deprecated
Use
Application.android.activityDestroyedEvent
instead.
property activityDestroyedEvent
readonly activityDestroyedEvent: string;
property activityNewIntentEvent
static readonly activityNewIntentEvent: string;
Deprecated
Use
Application.android.activityNewIntentEvent
instead.
property activityNewIntentEvent
readonly activityNewIntentEvent: string;
property activityPausedEvent
static readonly activityPausedEvent: string;
Deprecated
Use
Application.android.activityPausedEvent
instead.
property activityPausedEvent
readonly activityPausedEvent: string;
property activityRequestPermissionsEvent
static readonly activityRequestPermissionsEvent: string;
Deprecated
Use
Application.android.activityRequestPermissionsEvent
instead.
property activityRequestPermissionsEvent
readonly activityRequestPermissionsEvent: string;
property activityResultEvent
static readonly activityResultEvent: string;
Deprecated
Use
Application.android.activityResultEvent
instead.
property activityResultEvent
readonly activityResultEvent: string;
property activityResumedEvent
static readonly activityResumedEvent: string;
Deprecated
Use
Application.android.activityResumedEvent
instead.
property activityResumedEvent
readonly activityResumedEvent: string;
property activityStartedEvent
static readonly activityStartedEvent: string;
Deprecated
Use
Application.android.activityStartedEvent
instead.
property activityStartedEvent
readonly activityStartedEvent: string;
property activityStoppedEvent
static readonly activityStoppedEvent: string;
Deprecated
Use
Application.android.activityStoppedEvent
instead.
property activityStoppedEvent
readonly activityStoppedEvent: string;
property backgrounded
readonly backgrounded: boolean;
Deprecated
Use
Application.inBackground
instead.
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 packageName
readonly packageName: string;
Deprecated
Use
Utils.android.getPackageName()
instead.
property paused
readonly paused: boolean;
Deprecated
Use
Application.suspended
instead.
property saveActivityStateEvent
static readonly saveActivityStateEvent: string;
Deprecated
Use
Application.android.saveActivityStateEvent
instead.
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;
Get a registered BroadcastReceiver, then you can get the result code of BroadcastReceiver in onReceiveCallback method.
Parameter intentFilter
A string containing the intent filter.
method on
on: { ( 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;};
method registerBroadcastReceiver
registerBroadcastReceiver: ( intentFilter: string, onReceiveCallback: ( context: android.content.Context, intent: android.content.Intent ) => void) => 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.
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 android
readonly android: IAndroidApplication;
property AndroidApplication
readonly AndroidApplication: IAndroidApplication;
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;
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: IiOSApplication;
property iOSApplication
readonly iOSApplication: IiOSApplication;
property launchEvent
readonly launchEvent: 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: 'cssChanged', callback: (args: CssChangedEventData) => void, thisArg?: any ): void; ( event: 'launch', callback: (args: LaunchEventData) => 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: 'fontScaleChanged', callback: (args: FontScaleChangedEventData) => 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: 'cssChanged', callback: (args: CssChangedEventData) => void, thisArg?: any ): void; ( event: 'launch', callback: (args: LaunchEventData) => 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: 'fontScaleChanged', callback: (args: FontScaleChangedEventData) => 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: 'cssChanged', callback: (args: CssChangedEventData) => void, thisArg?: any ): void; ( event: 'launch', callback: (args: LaunchEventData) => 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: 'fontScaleChanged', callback: (args: FontScaleChangedEventData) => 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: 'cssChanged', callback: (args: CssChangedEventData) => void, thisArg?: any ): void; ( event: 'launch', callback: (args: LaunchEventData) => 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: 'fontScaleChanged', callback: (args: FontScaleChangedEventData) => void, thisArg?: any ): void;};
property orientationChangedEvent
readonly orientationChangedEvent: string;
property resumeEvent
readonly resumeEvent: string;
property started
started: boolean;
property suspended
readonly suspended: boolean;
property suspendEvent
readonly suspendEvent: string;
property systemAppearanceChangedEvent
readonly systemAppearanceChangedEvent: string;
property uncaughtErrorEvent
readonly uncaughtErrorEvent: string;
method addCss
addCss: (cssText: string, attributeScoped?: boolean) => void;
method applyCssClass
applyCssClass: ( rootView: View, cssClasses: string[], newCssClass: string, skipCssUpdate?: boolean) => void;
Applies the the
newCssClass
to therootView
and removes all other css classes fromcssClasses
previously 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 getMainEntry
getMainEntry: () => NavigationEntry;
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 hasLaunched
hasLaunched: () => boolean;
method initRootView
initRootView: (rootView: View) => void;
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 orientation
orientation: () => 'portrait' | 'landscape' | 'unknown';
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 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 systemAppearance
systemAppearance: () => 'dark' | 'light' | null;
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 boxShadow
boxShadow: BoxShadow;
property clearFlags
clearFlags: number;
property clipPath
clipPath: string;
property color
color: Color;
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 getBoxShadow
getBoxShadow: () => 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 hasBoxShadow
hasBoxShadow: () => 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 withBoxShadow
withBoxShadow: (value: BoxShadow) => Background;
method withClipPath
withClipPath: (value: string) => Background;
method withColor
withColor: (value: Color) => 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: NavigationEntry) => View;
Creates view from navigation entry
Parameter entry
NavigationEntry
method load
static load: { (moduleName: string, exports?: any): View; (options: LoadOptions): View;};
Loads component from module with context
Parameter moduleName
the module name
Parameter exports
the context of the component to be loaded
Loads component from options
Parameter options
Load options
method parse
static parse: (value: string | Template, exports?: any) => View;
method parseMultipleTemplates
static parseMultipleTemplates: ( value: string, exports?: 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.
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.
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
this
context 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 {}
property content
content: 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, callback: (state: string) => void);
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> implements CssProperty<T, 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.
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 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 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.
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.
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;
property editable
editable: boolean;
Gets or sets whether the instance is editable.
property focusEvent
static focusEvent: string;
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 returnKeyType
returnKeyType: CoreTypes.ReturnKeyButtonType;
Gets or sets the soft keyboard return key flavor.
property textChangeEvent
static textChangeEvent: string;
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 {}
property alignContent
alignContent: AlignContent;
property alignItems
alignItems: AlignItems;
property flexDirection
flexDirection: FlexDirection;
property flexWrap
flexWrap: FlexWrap;
property justifyContent
justifyContent: JustifyContent;
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.
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.
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 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 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 readonly navigatedToEvent: string;
String value used when hooking to navigatedTo event.
property navigatingToEvent
static readonly navigatingToEvent: string;
String value used when hooking to navigatingTo event.
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 goBack
static goBack: () => any;
Navigates back using the navigation hierarchy (if any). Updates the Frame stack as needed. This method will start from the topmost Frame and will recursively search for an instance that has the canGoBack operation available.
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
this
context 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: () => Frame;
Gets the topmost frame in the frames stack. An application will typically has one frame instance. Multiple frames handle nested (hierarchical) navigation scenarios.
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
this
in 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.
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)
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 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).
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 isLoading
readonly isLoading: boolean;
Gets a value indicating if the image is currently loading.
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
this
context 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, scale?: iosSymbolScaleType) => 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, scale?: iosSymbolScaleType) => 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 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 rootController
readonly rootController: UIViewController;
The root view controller for the application.
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 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.
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 cancel
cancel: () => void;
Cancels a playing animation.
property delay
delay: number;
The amount of time, in milliseconds, to delay starting the animation.
property isPlaying
isPlaying: boolean;
Returns true if the application is currently running.
property iterations
iterations: number;
Specifies how many times the animation should be played. Default is 1. iOS animations support fractional iterations, i.e. 1.5. To repeat an animation infinitely, use Number.POSITIVE_INFINITY
property play
play: (view: View) => Promise<void>;
Plays the animation.
method keyframeAnimationFromInfo
static keyframeAnimationFromInfo: ( info: KeyframeAnimationInfo) => KeyframeAnimation;
Creates a keyframe animation from animation definition.
class KeyframeAnimationInfo
class KeyframeAnimationInfo {}
Defines animation options for the View.animate method.
property curve
curve?: any;
An optional animation curve. Possible values are contained in the [AnimationCurve enumeration](../modules/_ui_enums_.animationcurve.html). Alternatively, you can pass an instance of type UIViewAnimationCurve for iOS or android.animation.TimeInterpolator for Android.
property delay
delay?: number;
The amount of time, in milliseconds, to delay starting the animation.
property duration
duration?: number;
The length of the animation in milliseconds. The default duration is 300 milliseconds.
property isForwards
isForwards: boolean;
Determines whether the animation values will be applied on the animated object after the animation finishes.
property isReverse
isReverse?: boolean;
If true the animation will be played backwards.
property iterations
iterations?: number;
Specifies how many times the animation should be played. Default is 1. iOS animations support fractional iterations, i.e. 1.5. To repeat an animation infinitely, use Number.POSITIVE_INFINITY
property keyframes
keyframes: KeyframeInfo[];
Return animation keyframes.
property name
name?: string;
The animation name.
class Label
class Label extends TextBase {}
Represents a text 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) => void;
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 ListPicker
class ListPicker extends View {}
Represents an list picker.
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;
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.
class ListView
class ListView extends View {}
Represents a view that shows items in a vertically scrolling list.
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 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.
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.
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.
property rowHeight
rowHeight: CoreTypes.LengthType;
Gets or set row height of the ListView.
property separatorColor
separatorColor: Color;
Gets or set the items separator line color of the ListView.
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;};
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
this
context 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.
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 {}
constructor
constructor(context: PlatformContext, moduleListProvider?: ModuleListProvider);
method clearCache
clearCache: () => void;
method resolveModuleName
resolveModuleName: (path: string, ext: string) => string;
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.
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.
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
this
context 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
this
context 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).
property accessibilityAnnouncePageEnabled
accessibilityAnnouncePageEnabled: boolean;
Should page changed be annnounced 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.
property navigatedToEvent
static readonly navigatedToEvent: string;
String value used when hooking to navigatedTo event.
property navigatingFromEvent
static readonly navigatingFromEvent: string;
String value used when hooking to navigatingFrom event.
property navigatingToEvent
static readonly navigatingToEvent: string;
String value used when hooking to navigatingTo event.
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 performans the "escape" gesture
property statusBarStyle
statusBarStyle: 'dark' | 'light';
Gets or sets the style of the status bar.
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
this
context 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;
property statusBarStyle
statusBarStyle: 'dark' | 'light';
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 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.
property creatingViewEvent
static creatingViewEvent: string;
String value used when hooking to creatingView event.
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
this
context 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.
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.
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.
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.
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 {}
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.
property horizontalOffset
horizontalOffset: number;
Gets a value that contains the horizontal offset of the scrolled content.
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.
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; ( event: 'scroll', callback: (args: 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
this
context 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.
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 clearEvent
static clearEvent: string;
String value used when hooking to clear event.
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.
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
this
context 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.
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: string;
String value used when hooking to the selectedIndexChanged event.
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
this
context 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.
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 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 propertyBagDescriptor
protected readonly propertyBagDescriptor: PropertyDescriptor;
property sourceKey
readonly sourceKey: Symbol;
method register
register: (cls: typeof Style) => void;
class Slider
class Slider extends View {}
Represents a slider component.
property accessibilityDecrementEvent
static readonly accessibilityDecrementEvent: string;
property accessibilityIncrementEvent
static readonly accessibilityIncrementEvent: string;
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.
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.
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.
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 StackLayout
class StackLayout extends LayoutBase {}
A Layout that arranges its children horizontally or vertically. The direction can be set by orientation property.
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 implements StyleDefinition {}
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: ShadowCSSValues;
property clipPath
clipPath: string;
property color
color: Color;
property flexDirection
flexDirection: FlexDirection;
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 height
height: CoreTypes.PercentLengthType;
property horizontalAlignment
horizontalAlignment: CoreTypes.HorizontalAlignmentType;
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 maxLines
maxLines: number;
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 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 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.
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;
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.
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 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 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.
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
this
context 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.
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 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 {}
property fontSize
fontSize: number;
Gets or sets font-size 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 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.
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;
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.
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 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 maxLines
maxLines: number;
Limits input to a certain number of lines.
class TimePicker
class TimePicker extends View {}
Represents an time picker.
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.
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 }>;};
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.
property accessibilityBlurEvent
static accessibilityBlurEvent: string;
String value used when hooking to accessibilityBlur event.
property accessibilityFocusChangedEvent
static accessibilityFocusChangedEvent: string;
String value used when hooking to accessibilityFocusChanged event.
property accessibilityFocusEvent
static accessibilityFocusEvent: string;
String value used when hooking to accessibilityFocus event.
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 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;
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
true
the 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 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 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 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 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 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 is 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.
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 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 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.
property shownModallyEvent
static shownModallyEvent: string;
String value used when hooking to shownModally event.
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 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 getSafeAreaInsets
getSafeAreaInsets: () => { left; top; right; bottom };
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;};
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
this
context 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: Partial<AccessibilityEventOptions>) => void;
Send accessibility event options AccessibilityEventOptions androidAccessibilityEvent: AndroidAccessibilityEvent; iosNotificationType: IOSPostAccessibilityNotificationType; message: string;
iOS Notes: type = 'announcement' will announce
args
via 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 implements ViewBaseDefinition {}
constructor
constructor();
property ['class']
['class']: string;
property alignSelf
alignSelf: AlignSelf;
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;
property colSpan
colSpan: number;
property column
column: number;
property columnSpan
columnSpan: number;
property createdEvent
static createdEvent: string;
String value used when hooking to creation event
property cssClasses
cssClasses: Set<string>;
property cssPseudoClasses
cssPseudoClasses: Set<string>;
property defaultVisualState
defaultVisualState: string;
Default visual state, defaults to 'normal'
property disposeNativeViewEvent
static disposeNativeViewEvent: string;
String value used when hooking to disposeNativeView event
property dock
dock: 'left' | 'right' | 'top' | 'bottom';
property domNode
domNode: dnm.DOMNode;
property effectiveBorderBottomWidth
effectiveBorderBottomWidth: number;
property effectiveBorderLeftWidth
effectiveBorderLeftWidth: number;
property effectiveBorderRightWidth
effectiveBorderRightWidth: number;
property effectiveBorderTopWidth
effectiveBorderTopWidth: 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 effectiveMinHeight
effectiveMinHeight: number;
property effectiveMinWidth
effectiveMinWidth: number;
property effectivePaddingBottom
effectivePaddingBottom: number;
property effectivePaddingLeft
effectivePaddingLeft: number;
property effectivePaddingRight
effectivePaddingRight: number;
property effectivePaddingTop
effectivePaddingTop: number;
property effectiveTop
effectiveTop: number;
property effectiveWidth
effectiveWidth: number;
property flexGrow
flexGrow: number;
property flexShrink
flexShrink: number;
property flexWrapBefore
flexWrapBefore: boolean;
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;
property loadedEvent
static loadedEvent: string;
String value used when hooking to loaded event.
property mIsRootView
mIsRootView: boolean;
if _setupAsRootView is called it means it is not supposed to be added to a parent. However parent can be set before for the purpose of CSS variables/classes. That variable ensures that _addViewToNativeVisualTree is not called in _setupAsRootView
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;
property page
readonly page: Page;
Gets owner page. This is a read-only property.
property parent
parent: ViewBaseDefinition;
Gets the parent view. This property is read-only.
property parentNode
parentNode: ViewBaseDefinition;
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;
property rowSpan
rowSpan: number;
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;
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.
property viewController
viewController: any;
returns the native UIViewController.
property visualState
readonly visualState: string;
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 getViewByDomId
getViewByDomId: <T extends ViewBaseDefinition>(domId: number) => T;
Returns the child view with the specified domId.
method getViewById
getViewById: <T extends ViewBaseDefinition>(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): ViewBaseDefinition;};
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.
property loadStartedEvent
static loadStartedEvent: string;
String value used when hooking to loadStarted event.
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
this
context 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 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.
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 restriction
will 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, angularSyntax?: 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.
method parse
parse: (xmlString: string) => void;
Parses the supplied xml string.
Parameter xmlString
The string containing the xml to parse.
Interfaces
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) => void;
interface AndroidActivityEventData
interface AndroidActivityEventData {}
Data for the Android activity events.
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 AnimationDefinition
interface AnimationDefinition {}
Defines animation options for the View.animate method.
property backgroundColor
backgroundColor?: Color;
Animates the backgroundColor of the view.
property curve
curve?: any;
An optional animation curve. Possible values are contained in the [AnimationCurve enumeration](../modules/_ui_enums_.animationcurve.html). Alternatively, you can pass an instance of type UIViewAnimationCurve for iOS or android.animation.TimeInterpolator for Android.
property delay
delay?: number;
The amount of time, in milliseconds, to delay starting the animation.
property duration
duration?: number;
The length of the animation in milliseconds. The default duration is 300 milliseconds.
property height
height?: CoreTypes.PercentLengthType | string;
Animates the height of a view.
property iterations
iterations?: number;
Specifies how many times the animation should be played. Default is 1. iOS animations support fractional iterations, i.e. 1.5. To repeat an animation infinitely, use Number.POSITIVE_INFINITY
property opacity
opacity?: number;
Animates the opacity of the view. Value should be a number between 0.0 and 1.0
property rotate
rotate?: number | Point3D;
Animates the rotate affine transform of the view. Value should be a number specifying the rotation amount in degrees.
property scale
scale?: Pair;
Animates the scale affine transform of the view.
property target
target?: View;
The view whose property is to be animated.
property translate
translate?: Pair;
Animates the translate affine transform of the view.
property width
width?: CoreTypes.PercentLengthType | string;
Animates the width of a view.
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: ApplicationCommon | Observable;
The instance that has raised the event.
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 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 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 {}
Provides gesture event data.
property android
android: any;
Gets the underlying native android specific [gesture detector](http://developer.android.com/reference/android/view/GestureDetector.html).
property ios
ios: any;
Gets the underlying native iOS specific [UIGestureRecognizer](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIGestureRecognizer_Class/).
property type
type: GestureTypes;
Gets the type of the gesture.
property view
view: View;
Gets the view which originates the gesture.
interface GestureEventDataWithState
interface GestureEventDataWithState extends GestureEventData {}
Provides gesture event data.
property state
state: number;
interface HttpContent
interface HttpContent {}
Encapsulates the content of an HttpResponse.
property raw
raw: any;
Gets the response body as raw data.
property toArrayBuffer
toArrayBuffer: () => ArrayBuffer;
Gets the response body as ArrayBuffer
property toFile
toFile: (destinationFilePath?: string) => File;
Gets the response body as file.
property toImage
toImage: () => Promise<ImageSource>;
Gets the response body as ImageSource.
property toJSON
toJSON: (encoding?: HttpResponseEncoding) => any;
Gets the response body as JSON object.
property toString
toString: (encoding?: HttpResponseEncoding) => string;
Gets the response body as string.
interface HttpRequestOptions
interface HttpRequestOptions {}
Provides options for the http requests.
property content
content?: string | FormData | ArrayBuffer;
Gets or sets the request body.
property dontFollowRedirects
dontFollowRedirects?: boolean;
Gets or sets wether 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 {}
Encapsulates HTTP-response information from an HTTP-request.
property content
content?: HttpContent;
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 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 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 KeyframeDeclaration
interface KeyframeDeclaration {}
interface KeyframeInfo
interface KeyframeInfo {}
property curve
curve?: any;
property declarations
declarations: Array<KeyframeDeclaration>;
property duration
duration: number;
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 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
src
orapp
directory however can be changed.
property appResourcesPath
appResourcesPath?: string;
App_Resources path This is often at the root or inside
src
orapp
directory however can be anywhere.
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 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 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 shared
shared?: boolean;
property visionos
visionos?: IConfigVisionOS;
Vision Pro specific configurations Various VisionOS specific configurations including iOS runtime flags.
property webpackConfigPath
webpackConfigPath?: string;
Custom webpack config path The default is
webpack.config.js
in 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 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;
property navigationType
navigationType: NavigationType;
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
this
context 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 {}
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 {}
Provides gesture event data for pan gesture.
interface ParserEvent
interface ParserEvent {}
Provides information for a parser event.
property attributes
attributes?: Object;
Returns a JSON object with the attributes of an element in case the eventType is ParserEventType.StartElement.
property data
data?: string;
Returns the relevant data in case the eventType is ParserEventType.Text, ParserEventType.CDATA or ParserEventType.Comment.
property elementName
elementName?: string;
Returns the name of the element in case the eventType is ParserEventType.StartElement or ParserEventType.EndElement.
property eventType
eventType: string;
Returns the type of the parser event. This is one of the ParserEventType static members.
property namespace
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
position: Position;
Get the position in the xml string where the event was generated.
property prefix
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.
interface PinchGestureEventData
interface PinchGestureEventData extends GestureEventDataWithState {}
Provides gesture event data for pinch gesture.
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 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 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 {}
Provides gesture event data for rotation gesture.
property rotation
rotation: number;
interface ScrollEventData
interface ScrollEventData extends EventData {}
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 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;};
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 SwipeGestureEventData
interface SwipeGestureEventData extends GestureEventData {}
Provides gesture event data for swipe gesture.
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 {}
Provides gesture event data.
method getPointerCount
getPointerCount: () => number;
Gets the number of pointers in the event.
method getX
getX: () => number;
Gets the X coordinate of this event inside the view that triggered the event
method getY
getY: () => number;
Gets the Y coordinate of the event inside the view that triggered the event.
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 TouchGestureEventData
interface TouchGestureEventData extends TapGestureEventData {}
Provides gesture event data.
property action
action: 'up' | 'move' | 'down' | 'cancel';
Gets action of the touch. Possible values: 'up', 'move', 'down', 'cancel'
method getActivePointers
getActivePointers: () => Array<Pointer>;
Gets the pointers that triggered the event. Note: In Android there is aways only one active pointer.
method getAllPointers
getAllPointers: () => Array<Pointer>;
Gets all pointers.
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
this
context 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.
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
ALARMS
member AUDIOBOOKS
AUDIOBOOKS
member DCIM
DCIM
member DOCUMENTS
DOCUMENTS
member DOWNLOADS
DOWNLOADS
member MOVIES
MOVIES
member MUSIC
MUSIC
member NOTIFICATIONS
NOTIFICATIONS
member PICTURES
PICTURES
member PODCASTS
PODCASTS
member RINGTONES
RINGTONES
member SCREENSHOTS
SCREENSHOTS
enum 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',}
Events emitted during gesture lifecycle
member gestureAttached
gestureAttached = 'gestureAttached'
When the gesture is attached to the view Provides access to the native gesture recognizer for further customization
member touchDown
touchDown = 'touchDown'
When a touch down was detected
member touchUp
touchUp = 'touchUp'
When a touch up was detected
enum GestureStateTypes
enum GestureStateTypes { cancelled = 0, began = 1, changed = 2, ended = 3,}
Defines an enum with supported gesture states.
enum GestureTypes
enum GestureTypes { tap = 1, doubleTap = 2, pinch = 4, pan = 8, swipe = 16, rotation = 32, longPress = 64, touch = 128,}
Defines an enum with supported gesture types.
member doubleTap
doubleTap = 2
Denotes double tap gesture.
member longPress
longPress = 64
Denotes long press gesture.
member pan
pan = 8
Denotes pan gesture.
member pinch
pinch = 4
Denotes pinch gesture.
member rotation
rotation = 32
Denotes rotation gesture.
member swipe
swipe = 16
Denotes swipe gesture.
member tap
tap = 1
Denotes tap (click) gesture.
member touch
touch = 128
Denotes touch action.
enum HttpResponseEncoding
enum HttpResponseEncoding { UTF8, GBK,}
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 SharedTransitionAnimationType
enum SharedTransitionAnimationType { present = 0, dismiss = 1,}
enum SwipeDirection
enum SwipeDirection { right = 1, left = 2, up = 4, down = 8,}
Defines an enum for swipe gesture direction.
enum TouchAction
enum TouchAction { down = 'down', up = 'up', move = 'move', cancel = 'cancel',}
Defines a touch action
Type Aliases
type dip
type dip = number;
Deprecated
Use
CoreTypes.dip
instead.
type GridUnitType
type GridUnitType = 'pixel' | 'star' | 'auto';
type Headers
type Headers = { [key: string]: string | string[] };
type HorizontalAlignment
type HorizontalAlignment = CoreTypes.HorizontalAlignmentType;
Deprecated
Use
CoreTypes.HorizontalAlignmentType
instead.
type InstrumentationMode
type InstrumentationMode = 'counters' | 'timeline' | 'lifecycle';
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.
type LengthDipUnit
type LengthDipUnit = CoreTypes.LengthDipUnit;
Deprecated
Use
CoreTypes.LengthDipUnit
instead.
type LengthPercentUnit
type LengthPercentUnit = CoreTypes.LengthPercentUnit;
Deprecated
Use
CoreTypes.LengthPercentUnit
instead.
type LengthPxUnit
type LengthPxUnit = CoreTypes.LengthPxUnit;
Deprecated
Use
CoreTypes.LengthPxUnit
instead.
type LengthType
type LengthType = CoreTypes.LengthType;
Deprecated
Use
CoreTypes.LengthType
instead.
type ModuleListProvider
type ModuleListProvider = () => string[];
type percent
type percent = number;
Deprecated
Use
CoreTypes.percent
instead.
type PercentLengthType
type PercentLengthType = CoreTypes.PercentLengthType;
Deprecated
Use
CoreTypes.PercentLengthType
instead.
type px
type px = number;
Deprecated
Use
CoreTypes.px
instead.
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 TouchAnimationOptions
type TouchAnimationOptions = { up?: TouchAnimationFn | AnimationDefinition; down?: TouchAnimationFn | AnimationDefinition;};
type VerticalAlignment
type VerticalAlignment = CoreTypes.VerticalAlignmentType;
Deprecated
Use
CoreTypes.VerticalAlignmentType
instead.
type VisionHoverOptions
type VisionHoverOptions = { effect: VisionHoverEffect; shape?: VisionHoverShape; shapeCornerRadius?: number;};
type WebViewNavigationType
type WebViewNavigationType = | 'linkClicked' | 'formSubmitted' | 'backForward' | 'reload' | 'formResubmitted' | 'other' | undefined;
Represents navigation type
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 = 4
Denotes a bluetooth connection
member ethernet
ethernet = 3
Denotes an ethernet connection
member mobile
mobile = 2
Denotes a mobile connection, i.e. cellular network or WAN.
member none
none = 0
Denotes no connection.
member vpn
vpn = 5
Denotes a vpn connection
member wifi
wifi = 1
Denotes a WiFi connection.
namespace CoreTypes
namespace CoreTypes {}
variable zeroLength
const zeroLength: LengthType;
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';
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 HorizontalAlignmentType
type HorizontalAlignmentType = 'left' | 'center' | 'right' | 'stretch';
type ImageStretchType
type ImageStretchType = 'none' | 'aspectFill' | 'aspectFit' | 'fill';
type KeyboardInputType
type KeyboardInputType = | 'datetime' | 'phone' | 'number' | 'url' | 'email' | 'integer';
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' | dip | LengthDipUnit | LengthPxUnit;
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' | dip | LengthDipUnit | LengthPxUnit | LengthPercentUnit;
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 = 'initial' | 'left' | 'center' | 'right' | 'justify';
type TextDecorationType
type TextDecorationType = | 'none' | 'underline' | 'line-through' | 'underline line-through';
type TextOverflowType
type TextOverflowType = 'clip' | 'ellipsis' | 'initial' | 'unset';
type TextTransformType
type TextTransformType = | 'initial' | 'none' | 'capitalize' | 'uppercase' | 'lowercase';
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';
type VisibilityType
type VisibilityType = 'visible' | 'hidden' | 'collapse' | 'collapsed';
type WhiteSpaceType
type WhiteSpaceType = 'initial' | 'normal' | 'nowrap';
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) => animationModule.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.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 {}
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.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
const lowercase: string;
variable none
const none: string;
variable uppercase
const uppercase: string;
namespace CoreTypes.UpdateTextTrigger
namespace CoreTypes.UpdateTextTrigger {}
variable focusLost
const focusLost: UpdateTextTriggerType;
variable textChanged
const textChanged: UpdateTextTriggerType;
namespace CoreTypes.VerticalAlignment
namespace CoreTypes.VerticalAlignment {}
namespace CoreTypes.VerticalAlignmentText
namespace CoreTypes.VerticalAlignmentText {}
variable baseline
const baseline: string;
variable bottom
const bottom: string;
variable middle
const middle: string;
variable stretch
const stretch: string;
variable sub
const sub: string;
variable sup
const sup: string;
variable textbottom
const textbottom: string;
variable texttop
const texttop: string;
variable top
const top: string;
function isValid
isValid: (value: any) => value is VerticalAlignmentTextType;
function parse
parse: (value: string) => VerticalAlignmentTextType;
namespace CoreTypes.Visibility
namespace CoreTypes.Visibility {}
variable collapse
const collapse: VisibilityType;
variable collapsed
const collapsed: VisibilityType;
variable hidden
const hidden: VisibilityType;
variable visible
const visible: VisibilityType;
function isValid
isValid: (value: any) => value is VisibilityType;
function parse
parse: (value: string) => VisibilityType;
namespace CoreTypes.WhiteSpace
namespace CoreTypes.WhiteSpace {}
namespace CSSUtils
namespace CSSUtils {}
variable CLASS_PREFIX
const CLASS_PREFIX: string;
variable MODAL_ROOT_VIEW_CSS_CLASS
const MODAL_ROOT_VIEW_CSS_CLASS: string;
variable ROOT_VIEW_CSS_CLASS
const ROOT_VIEW_CSS_CLASS: string;
function getModalRootViewCssClass
getModalRootViewCssClass: () => string;
function getRootViewCssClasses
getRootViewCssClasses: () => string[];
function getSystemCssClasses
getSystemCssClasses: () => string[];
function pushToRootViewCssClasses
pushToRootViewCssClasses: (value: string) => number;
function pushToSystemCssClasses
pushToSystemCssClasses: (value: string) => number;
function removeFromRootViewCssClasses
removeFromRootViewCssClasses: (value: string) => string;
function removeSystemCssClass
removeSystemCssClass: (value: string) => string;
namespace DialogStrings
namespace DialogStrings {}
namespace encoding
namespace encoding {}
Defines the supported character encodings.
variable ISO_8859_1
const ISO_8859_1: any;
Denotes ISO-8859-1 character encoding.
variable US_ASCII
const US_ASCII: any;
Denotes US_ASCII character encoding.
variable UTF_16
const UTF_16: any;
Denotes UTF_16 character encoding.
variable UTF_16BE
const UTF_16BE: any;
Denotes UTF_16BE character encoding.
variable UTF_16LE
const UTF_16LE: any;
Denotes UTF_16LE character encoding.
variable UTF_8
const UTF_8: any;
Denotes UTF_8 character encoding.
namespace FontStyle
namespace FontStyle {}
namespace FontVariationSettings
namespace FontVariationSettings {}
namespace FontWeight
namespace FontWeight {}
variable BLACK
const BLACK: string;
variable BOLD
const BOLD: string;
variable EXTRA_BOLD
const EXTRA_BOLD: string;
variable EXTRA_LIGHT
const EXTRA_LIGHT: string;
variable LIGHT
const LIGHT: string;
variable MEDIUM
const MEDIUM: string;
variable NORMAL
const NORMAL: string;
variable SEMI_BOLD
const SEMI_BOLD: string;
variable THIN
const THIN: string;
function isValid
isValid: (value: any) => boolean;
function parse
parse: (value: string) => FontWeightType;
namespace GridUnitType
namespace GridUnitType {}
namespace Http
module 'http/index.d.ts' {}
Downloads the content from the specified URL as a string.
Parameter url
The URL to request from.
function getBinary
getBinary: { (url: string): Promise<ArrayBuffer>; (options: HttpRequestOptions): Promise<ArrayBuffer>;};
Downloads the content from the specified URL as binary and returns an ArrayBuffer.
Parameter url
The URL to request from.
Downloads the content from the specified URL as binary and returns an ArrayBuffer.
Parameter options
An object that specifies various request options.
function getFile
getFile: { (url: string, destinationFilePath?: string): Promise<File>; (options: HttpRequestOptions, destinationFilePath?: string): Promise<File>;};
Downloads the content from the specified URL and attempts to save it as file.
Parameter url
The URL to request from.
Parameter destinationFilePath
Optional. The downloaded file path.
Downloads the content from the specified URL and attempts to save it as file.
Parameter options
An object that specifies various request options.
Parameter destinationFilePath
Optional. The downloaded file path.
function getImage
getImage: { (url: string): Promise<ImageSource>; (options: HttpRequestOptions): Promise<ImageSource>;};
Downloads the content from the specified URL and attempts to decode it as an image.
Parameter url
The URL to request from.
Downloads the content from the specified URL and attempts to decode it as an image.
Parameter options
An object that specifies various request options.
function getJSON
getJSON: { <T>(url: string): Promise<T>; <T>(options: HttpRequestOptions): Promise<T>;};
Downloads the content from the specified URL as a string and returns its JSON.parse representation.
Parameter url
The URL to request from.
Downloads the content from the specified URL as a string and returns its JSON.parse representation.
Parameter options
An object that specifies various request options.
function getString
getString: { (url: string): Promise<string>; (options: HttpRequestOptions): Promise<string>;};
Downloads the content from the specified URL as a string.
Parameter url
The URL to request from.
Downloads the content from the specified URL as a string.
Parameter options
An object that specifies various request options.
function request
request: (options: HttpRequestOptions) => Promise<HttpResponse>;
Makes a generic http request using the provided options and returns a HttpResponse Object.
Parameter options
An object that specifies various request options.
interface HttpContent
interface HttpContent {}
Encapsulates the content of an HttpResponse.
property raw
raw: any;
Gets the response body as raw data.
property toArrayBuffer
toArrayBuffer: () => ArrayBuffer;
Gets the response body as ArrayBuffer
property toFile
toFile: (destinationFilePath?: string) => File;
Gets the response body as file.
property toImage
toImage: () => Promise<ImageSource>;
Gets the response body as ImageSource.
property toJSON
toJSON: (encoding?: HttpResponseEncoding) => any;
Gets the response body as JSON object.
property toString
toString: (encoding?: HttpResponseEncoding) => string;
Gets the response body as string.
interface HttpRequestOptions
interface HttpRequestOptions {}
Provides options for the http requests.
property content
content?: string | FormData | ArrayBuffer;
Gets or sets the request body.
property dontFollowRedirects
dontFollowRedirects?: boolean;
Gets or sets wether 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 {}
Encapsulates HTTP-response information from an HTTP-request.
property content
content?: HttpContent;
Gets the response content.
property headers
headers: Headers;
Gets the response headers.
property statusCode
statusCode: number;
Gets the response status code.
enum HttpResponseEncoding
enum HttpResponseEncoding { UTF8, GBK,}
type Headers
type Headers = { [key: string]: string | string[] };
namespace inputType
namespace inputType {}
Defines the input type for prompt dialog.
variable decimal
const decimal: string;
Decimal input type.
variable email
const email: string;
Email input type.
variable number
const number: string;
Number input type.
variable password
const password: string;
Password input type.
variable phone
const phone: string;
Phone input type.
variable text
const text: string;
Plain text input type.
namespace IOSHelper
namespace IOSHelper {}
Various iOS view helper methods
variable traitCollectionColorAppearanceChangedEvent
const traitCollectionColorAppearanceChangedEvent: string;
String value used when hooking to traitCollectionColorAppearanceChangedEvent event.
function expandBeyondSafeArea
expandBeyondSafeArea: (view: View, frame: any) => any;
function getFrameFromPosition
getFrameFromPosition: ( position: { left; top; right; bottom }, insets?: { left; top; right; bottom }) => any;
function getParentWithViewController
getParentWithViewController: (view: View) => View;
Returns a view with viewController or undefined if no such found along the view's parent chain.
Parameter view
The view form which to start the search.
function getPositionFromFrame
getPositionFromFrame: (frame: any) => { left; top; right; bottom };
function layoutView
layoutView: (controller: any, owner: View) => void;
function shrinkToSafeArea
shrinkToSafeArea: (view: View, frame: any) => any;
function updateAutoAdjustScrollInsets
updateAutoAdjustScrollInsets: (controller: any, owner: View) => void;
function updateConstraints
updateConstraints: (controller: any, owner: View) => void;
class UIAdaptivePresentationControllerDelegateImp
class UIAdaptivePresentationControllerDelegateImp {}
method initWithOwnerAndCallback
static initWithOwnerAndCallback: ( owner: WeakRef<View>, whenClosedCallback: Function) => UIAdaptivePresentationControllerDelegateImp;
class UILayoutViewController
class UILayoutViewController {}
method initWithOwner
static initWithOwner: (owner: WeakRef<View>) => UILayoutViewController;
class UIPopoverPresentationControllerDelegateImp
class UIPopoverPresentationControllerDelegateImp {}
method initWithOwnerAndCallback
static initWithOwnerAndCallback: ( owner: WeakRef<View>, whenClosedCallback: Function) => UIPopoverPresentationControllerDelegateImp;
namespace knownFolders
namespace knownFolders {}
Provides access to the top-level Folders instances that are accessible from the application. Use these as entry points to access the FileSystem.
function currentApp
currentApp: () => Folder;
Gets the root folder for the current application. This Folder is private for the application and not accessible from Users/External apps. iOS - this folder is read-only and contains the app and all its resources.
function documents
documents: () => Folder;
Gets the Documents folder available for the current application. This Folder is private for the application and not accessible from Users/External apps.
function externalDocuments
externalDocuments: () => Folder;
Gets the Documents folder available for the current application on an external storage. This Folder is private for the application and not accessible from Users/External apps. On android this requires READ_EXTERNAL_STORAGE/WRITE_EXTERNAL_STORAGE permissions There is no external storage on iOS os it is the same as
documents()
function temp
temp: () => Folder;
Gets the Temporary (Caches) folder available for the current application. This Folder is private for the application and not accessible from Users/External apps.
namespace knownFolders.ios
namespace knownFolders.ios {}
Contains iOS-specific known folders.
function desktop
desktop: () => Folder;
Gets the NSDesktopDirectory. Note that the folder will not be created if it did not exist.
function developer
developer: () => Folder;
Gets the NSDeveloperDirectory. Note that the folder will not be created if it did not exist.
function downloads
downloads: () => Folder;
Gets the NSDownloadsDirectory. Note that the folder will not be created if it did not exist.
function library
library: () => Folder;
Gets the NSLibraryDirectory. Note that the folder will not be created if it did not exist.
function movies
movies: () => Folder;
Gets the NSMoviesDirectory. Note that the folder will not be created if it did not exist.
function music
music: () => Folder;
Gets the NSMusicDirectory. Note that the folder will not be created if it did not exist.
function pictures
pictures: () => Folder;
Gets the NSPicturesDirectory. Note that the folder will not be created if it did not exist.
function sharedPublic
sharedPublic: () => Folder;
Gets the NSSharedPublicDirectory. Note that the folder will not be created if it did not exist.
namespace Length
namespace Length {}
function convertToString
convertToString: (length: CoreTypes.LengthType) => string;
function equals
equals: (a: CoreTypes.LengthType, b: CoreTypes.LengthType) => boolean;
function parse
parse: (text: string) => CoreTypes.LengthType;
function toDevicePixels
toDevicePixels: (length: CoreTypes.LengthType, auto?: number) => number;
Converts Length unit to device pixels.
Parameter length
The Length to convert.
Parameter auto
Value to use for conversion of "auto". By default is Math.NaN.
namespace path
namespace path {}
Enables path-specific operations like join, extension, etc.
variable separator
const separator: string;
Gets the string used to separate file paths.
function join
join: (...paths: string[]) => string;
Joins all the provided string components, forming a valid and normalized path.
Parameter paths
An array of string components to be joined.
function normalize
normalize: (path: string) => string;
Normalizes a path, taking care of occurrances like ".." and "//".
Parameter path
The path to be normalized.
namespace PercentLength
namespace PercentLength {}
function convertToString
convertToString: (length: CoreTypes.PercentLengthType) => string;
function equals
equals: ( a: CoreTypes.PercentLengthType, b: CoreTypes.PercentLengthType) => boolean;
function parse
parse: (text: string) => CoreTypes.PercentLengthType;
function toDevicePixels
toDevicePixels: ( length: CoreTypes.PercentLengthType, auto?: number, parentAvailableWidth?: CoreTypes.px) => number;
Converts PercentLengthType unit to device pixels.
Parameter length
The PercentLengthType to convert.
Parameter auto
Value to use for conversion of "auto". By default is Math.NaN.
Parameter parentAvailableWidth
Value to use as base when converting percent unit. By default is Math.NaN.
namespace Trace
namespace Trace {}
function addCategories
addCategories: (categories: string) => void;
Adds categories to existing categories the module will trace.
Parameter categories
The comma-separated list of categories. If not specified all messages from all categories will be traced.
function addEventListener
addEventListener: (listener: TraceEventListener) => void;
function addWriter
addWriter: (writer: TraceWriter) => void;
Adds a TraceWriter instance to the trace module.
Parameter writer
The TraceWriter instance to add.
function clearWriters
clearWriters: () => void;
Clears all the writers from the trace module.
function disable
disable: () => void;
Disables the trace module.
function enable
enable: () => void;
Enables the trace module.
function error
error: (error: string | Error) => void;
Passes an error to the registered ErrorHandler
Parameter error
The error to be handled.
function getErrorHandler
getErrorHandler: () => TraceErrorHandler;
function isCategorySet
isCategorySet: (category: string) => boolean;
Check if category is already set in trace module.
Parameter category
The category to check.
function isEnabled
isEnabled: () => boolean;
A function that returns whether the tracer is enabled and there is a point in writing messages. Check this to avoid writing complex string templates. Send error messages even if tracing is disabled.
function notifyEvent
notifyEvent: (object: Object, name: string, data?: any) => void;
Notifies all the attached listeners for an event that has occurred in the sender object.
Parameter object
The Object instance that raised the event.
Parameter name
The name of the raised event.
Parameter data
An optional parameter that passes the data associated with the event.
function removeEventListener
removeEventListener: (listener: TraceEventListener) => void;
function removeWriter
removeWriter: (writer: TraceWriter) => void;
Removes a TraceWriter instance from the trace module.
Parameter writer
The TraceWriter instance to remove.
function setCategories
setCategories: (categories: string) => void;
Sets the categories the module will trace.
Parameter categories
The comma-separated list of categories. If not specified all messages from all categories will be traced.
function setErrorHandler
setErrorHandler: (handler: TraceErrorHandler) => void;
function write
write: (message: any, category: string, type?: number) => void;
Writes a message using the available writers.
Parameter message
The message to be written.
Parameter category
The category of the message.
Parameter type
Optional, the type of the message - info, warning, error.
class ConsoleWriter
class ConsoleWriter implements TraceWriter {}
method write
write: (message: any, category: string, type?: number) => void;
class DefaultErrorHandler
class DefaultErrorHandler implements TraceErrorHandler {}
method handlerError
handlerError: (error: any) => void;
namespace Trace.categories
namespace Trace.categories {}
all predefined categories.
variable All
const All: string;
variable Animation
const Animation: string;
variable Binding
const Binding: string;
variable BindingError
const BindingError: string;
variable Debug
const Debug: string;
variable Error
const Error: string;
variable Layout
const Layout: string;
variable Livesync
const Livesync: string;
variable MediaQuery
const MediaQuery: string;
variable ModuleNameResolver
const ModuleNameResolver: string;
variable NativeLifecycle
const NativeLifecycle: string;
variable Navigation
const Navigation: string;
variable separator
const separator: string;
variable Style
const Style: string;
variable Test
const Test: string;
variable Transition
const Transition: string;
variable ViewHierarchy
const ViewHierarchy: string;
variable VisualTreeEvents
const VisualTreeEvents: string;
function concat
concat: (...args: any) => string;
namespace Trace.messageType
namespace Trace.messageType {}
namespace Utils
module 'utils/index.d.ts' {}
Used by various android event listener implementations.
variable CORE_ANIMATION_DEFAULTS
const CORE_ANIMATION_DEFAULTS: { duration: number; spring: { tension: number; friction: number; mass: number; velocity: number };};
Default animation values used throughout core
variable debug
let debug: boolean;
A runtime option indicating whether the build has debugging enabled.
variable FILE_PREFIX
const FILE_PREFIX: string;
variable RESOURCE_PREFIX
const RESOURCE_PREFIX: string;
variable SDK_VERSION
const SDK_VERSION: number;
variable SYSTEM_PREFIX
const SYSTEM_PREFIX: string;
function clearInterval
clearInterval: (id: number) => void;
Clears repeated function which was set up by calling setInterval().
Parameter id
The identifier returned by the setInterval() method.
function clearTimeout
clearTimeout: (id: number) => void;
Clears the delay set by a call to the setTimeout function.
Parameter id
The identifier returned by the previously called setTimeout() method.
function convertString
convertString: (value: any) => any;
Converts string value to number or boolean.
Parameter value
The original value.
function copyToClipboard
copyToClipboard: (value: string) => void;
Copy value to device clipboard.
function dataDeserialize
dataDeserialize: (nativeData?: any) => any;
Data deserialization from Native > JS
Parameter nativeData
Native platform data
function dataSerialize
dataSerialize: (data?: any, wrapPrimitives?: boolean) => any;
Data serialization from JS > Native
Parameter wrapPrimitives
Optionally wrap primitive types (Some APIs may require this)
function debounce
debounce: <T extends Function = any>( fn: T, delay?: number, options?: { leading?: boolean }) => T;
A simple debounce utility
Parameter fn
Function to debounce
Parameter delay
Customize the delay (default is 300ms)
function dismissKeyboard
dismissKeyboard: () => void;
Dismiss any keyboard visible on the screen.
function dismissSoftInput
dismissSoftInput: (nativeView?: any) => void;
Hides the soft input method, usually a soft keyboard.
function dispatchToMainThread
dispatchToMainThread: (func: Function) => any;
Dispatches the passed function for execution on the main thread
Parameter func
The function to execute on the main thread.
function dispatchToUIThread
dispatchToUIThread: (func: Function) => any;
Dispatches the passed function for execution on the UI thread
Parameter func
The function to execute on the UI thread.
function eliminateDuplicates
eliminateDuplicates: (arr: Array<any>) => Array<any>;
Removes duplicate elements from array.
Parameter arr
The array.
function escapeRegexSymbols
escapeRegexSymbols: (source: string) => string;
Escapes special regex symbols (., *, ^, $ and so on) in string in order to create a valid regex from it.
Parameter source
The original value.
function executeOnMainThread
executeOnMainThread: (func: Function) => any;
Checks if the current thread is the main thread. Directly calls the passed function if it is, or dispatches it to the main thread otherwise.
Parameter func
The function to execute on the main thread.
function executeOnUIThread
executeOnUIThread: (func: Function) => any;
Runs the passed function on the UI Thread.
Parameter func
The function to execute on the UI thread.
function GC
GC: () => any;
An utility function that invokes garbage collection on the JavaScript side.
function getBaseClasses
getBaseClasses: (object: any) => Array<string>;
A function that gets the entire class hierarchy of an object.
Parameter object
The object. Returns an array of strings with the name of all base classes.
function getClass
getClass: (object: any) => string;
A function that gets the class name of an object.
Parameter object
The object. Returns a string with the name of the class.
function getClassInfo
getClassInfo: (object: Object) => ClassInfo;
A function that gets the ClassInfo for an object.
Parameter object
The object. Returns a ClassInfo for the object.
function getDurationWithDampingFromSpring
getDurationWithDampingFromSpring: (springSettings?: { tension?: number; friction?: number; mass?: number; velocity?: number;}) => { duration: number; damping: number };
Get a duration with damping value from various spring related settings. Helpful when needing to convert spring settings to isolated duration value.
Parameter springSettings
various spring settings
Returns
calculated duration with damping from spring settings
function getFileExtension
getFileExtension: (path: string) => string;
Get file extension from file path
Parameter path
file path
Returns
file extension
function getModuleName
getModuleName: (path: string) => string;
Gets module name from path.
Parameter path
The module path.
function hasDuplicates
hasDuplicates: (arr: Array<any>) => boolean;
Checks if array has any duplicate elements.
Parameter arr
The array to be checked.
function isBoolean
isBoolean: (value: any) => boolean;
A function that checks if something is a valid boolean.
Parameter value
The value which will be checked. Returns true if value is a boolean.
function isDataURI
isDataURI: (uri: string) => boolean;
Returns true if the specified URI is data URI (http://en.wikipedia.org/wiki/Data_URI_scheme).
Parameter uri
The URI.
function isDefined
isDefined: (value: any) => boolean;
A function that checks if something is defined (not undefined).
Parameter value
The value which will be checked. Returns true if value is defined.
function isEmoji
isEmoji: (value: string) => boolean;
function isFileOrResourcePath
isFileOrResourcePath: (path: string) => boolean;
Returns true if the specified path points to a resource or local file.
Parameter path
The path.
function isFontIconURI
isFontIconURI: (uri: string) => boolean;
Returns true if the specified URI is a font icon URI like "fontIcon://".
Parameter uri
The URI.
function isFunction
isFunction: (value: any) => boolean;
A function that checks if something is a function.
Parameter value
The value which will be checked. Returns true if value is a function.
function isMainThread
isMainThread: () => boolean;
Returns
Boolean value indicating whether the current thread is the main thread
function isNullOrUndefined
isNullOrUndefined: (value: any) => boolean;
A function that checks if something is not defined (null or undefined).
Parameter value
The value which will be checked. Returns true if value is null or undefined.
function isNumber
isNumber: (value: any) => boolean;
A function that checks if something is a valid number.
Parameter value
The value which will be checked. Returns true if value is a number.
function isObject
isObject: (value: any) => boolean;
A function that checks if something is an object.
Parameter value
The value which will be checked. Returns true if value is an object.
function isRealDevice
isRealDevice: () => boolean;
Checks whether the application is running on real device and not on simulator/emulator.
function isString
isString: (value: any) => boolean;
A function that checks if something is a valid string.
Parameter value
The value which will be checked. Returns true if value is a string.
function isUndefined
isUndefined: (value: any) => boolean;
A function that checks if something is "undefined".
Parameter value
The value which will be checked. Returns true if value is "undefined".
function mainThreadify
mainThreadify: (func: Function) => (...args: any[]) => void;
Returns a function wrapper which executes the supplied function on the main thread. The wrapper behaves like the original function and passes all of its arguments BUT discards its return value.
Parameter func
The function to execute on the main thread
Returns
The wrapper function which schedules execution to the main thread
function merge
merge: (left: any, right: any, compareFunc: any) => any[];
function mergeSort
mergeSort: ( arr: Array<any>, compareFunc: (a: any, b: any) => number) => Array<any>;
Sorts an array by using merge sort algorithm (which ensures stable sort since the built-in Array.sort() does not promise a stable sort).
Parameter arr
array to be sorted
Parameter compareFunc
function that will be used to compare two elements of the array
function numberHasDecimals
numberHasDecimals: (value: number) => boolean;
Checks if the number has decimals
Parameter value
Number to check
function numberIs64Bit
numberIs64Bit: (value: number) => boolean;
Checks if the number is 64 bit
Parameter value
Number to check
function openFile
openFile: (filePath: string, title?: string) => boolean;
Opens file.
Parameter filePath
The file.
Parameter title
Optional title for Android. Default is: 'Open File...'
function openUrl
openUrl: (url: string) => boolean;
Opens url.
Parameter url
The url.
function queueGC
queueGC: (delay?: number, useThrottle?: boolean) => any;
An utility function that queues a garbage collection, multiple calls in quick succession are debounced by default and only one gc will be executed after 900ms.
Parameter delay
Customize the delay
Parameter useThrottle
Instead of default debounce strategy, use throttling
function queueMacrotask
queueMacrotask: (task: () => void) => void;
Queues the passed function to be ran in a macroTask
Parameter task
the function to execute as a macroTask
function releaseNativeObject
releaseNativeObject: (object: any) => any;
Releases the reference to the wrapped native object
Parameter object
The Java/Objective-C object to release.
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 setInterval
setInterval: ( callback: Function, milliseconds?: number, ...args: any[]) => number;
Calls a function repeatedly with a delay between each call.
Parameter callback
The function to be called.
Parameter milliseconds
The delay between each function call.
Parameter args
One or more parameter to use once the function is called. Defaults to no parameters.
function setTimeout
setTimeout: ( callback: Function, milliseconds?: number, ...args: any[]) => number;
Calls a function after a specified delay.
Parameter callback
The function to be called.
Parameter milliseconds
The time to wait before the function is called. Defaults to 0.
Parameter args
One or more parameter to use once the function is called. Defaults to no parameters.
function throttle
throttle: <T extends Function = any>(fn: T, delay?: number) => T;
A simple throttle utility
Parameter fn
Function to throttle
Parameter delay
Customize the delay (default is 300ms)
function toUIString
toUIString: (object: any) => string;
Returns a string representation of an object to be shown in UI.
Parameter object
The object.
function verifyCallback
verifyCallback: (value: any) => void;
A function that checks if something is a valid function.
Parameter value
The value which will be checked. Throws exception if passed value is not a valid function.
class ClassInfo
class ClassInfo {}
A Class holding information about a class
property baseClassInfo
baseClassInfo: ClassInfo;
Gets the ClassInfo for the base class of the current info.
property name
name: string;
Gets the name of the class.
class ScopeError
class ScopeError extends Error {}
An Error class that provides additional context to an error.
constructor
constructor(child: Error, message?: string);
Creates a new ScopeError providing addtional context to the child error.
Parameter child
The child error to extend.
Parameter message
Additional message to prepend to the child error.
class Source
class Source {}
A class encapsulating information for source code origin.
constructor
constructor(uri: string, line: number, column: number);
Creates a new Source instance by given uri, line and column.
property column
column: number;
Gets the position in the source document.
property line
line: number;
Gets the line in the source document.
property uri
uri: string;
Gets the URI of the source document;
method get
static get: (object: any) => Source;
Get the source of an object.
method set
static set: (object: any, src: Source) => any;
Set the source of an object.
class SourceError
class SourceError extends ScopeError {}
Represents a scope error providing addiot
constructor
constructor(child: Error, source: Source, message?: string);
Creates a new SourceError by child error, source and optional message.
Parameter child
The child error to extend.
Parameter source
The source where the error occured.
Parameter message
Additonal message to prepend along the source location and the child error's message.
namespace Utils.layout
namespace Utils.layout {}
Utility module related to layout.
variable AT_MOST
const AT_MOST: number;
variable EXACTLY
const EXACTLY: number;
variable MEASURED_HEIGHT_STATE_SHIFT
const MEASURED_HEIGHT_STATE_SHIFT: number;
Bits that provide the actual measured size.
variable MEASURED_SIZE_MASK
const MEASURED_SIZE_MASK: number;
variable MEASURED_STATE_MASK
const MEASURED_STATE_MASK: number;
variable MEASURED_STATE_TOO_SMALL
const MEASURED_STATE_TOO_SMALL: number;
variable UNSPECIFIED
const UNSPECIFIED: number;
function getDisplayDensity
getDisplayDensity: () => number;
Gets display density for the current device.
function getMeasureSpecMode
getMeasureSpecMode: (spec: number) => number;
Gets measure specification mode from a given specification.
Parameter spec
The measure specification.
function getMeasureSpecSize
getMeasureSpecSize: (spec: number) => number;
Gets measure specification size from a given specification.
Parameter spec
The measure specification.
function getMode
getMode: (mode: number) => string;
Gets layout mode from a given specification as string.
Parameter mode
The measure specification mode.
function makeMeasureSpec
makeMeasureSpec: (px: number, mode: number) => number;
Creates measure specification size from size and mode.
Parameter size
The size component of measure specification.
Parameter mode
The mode component of measure specification.
function measureNativeView
measureNativeView: ( nativeView: any, width: number, widthMode: number, height: number, heightMode: number) => { width: number; height: number };
Converts device pixels to device independent pixes and measure the nativeView. Returns the desired size of the nativeView in device pixels.
Parameter nativeView
the nativeView to measure (UIView or android.view.View)
Parameter width
the available width
Parameter widthMode
width mode - UNSPECIFIED, EXACTLY or AT_MOST
Parameter height
the available hegiht
Parameter heightMode
height mode - UNSPECIFIED, EXACTLY or AT_MOST
function measureSpecToString
measureSpecToString: (measureSpec: number) => string;
Prints user friendly version of the measureSpec.
Parameter measureSpec
the spec to print
function round
round: (px: CoreTypes.px) => CoreTypes.px;
Rounds value used in layout.
Parameter px
to round.
function toDeviceIndependentPixels
toDeviceIndependentPixels: (value: CoreTypes.px) => CoreTypes.dip;
Convert device pixels to device independent pixels - px to dip.
Parameter value
The pixel to convert.
function toDevicePixels
toDevicePixels: (value: CoreTypes.dip) => CoreTypes.px;
Convert device independent pixels to device pixels - dip to px.
Parameter value
The pixel to convert.
Package Files (115)
- accessibility/accessibility-types.d.ts
- accessibility/font-scale.d.ts
- application-settings/index.d.ts
- application/application-common.d.ts
- application/application-interfaces.d.ts
- application/application-shims.d.ts
- application/application.d.ts
- color/index.d.ts
- config/config.interface.d.ts
- connectivity/index.d.ts
- core-types/index.d.ts
- css/system-classes.d.ts
- data/observable-array/index.d.ts
- data/observable/index.d.ts
- data/virtual-array/index.d.ts
- file-system/index.d.ts
- http/index.d.ts
- image-asset/index.d.ts
- image-source/index.d.ts
- index.d.ts
- module-name-resolver/index.d.ts
- module-name-resolver/qualifier-matcher/index.d.ts
- platform/common.d.ts
- platform/device/index.d.ts
- platform/index.d.ts
- platform/screen/index.d.ts
- profiling/index.d.ts
- text/index.d.ts
- timer/index.d.ts
- trace/index.d.ts
- ui/action-bar/index.d.ts
- ui/activity-indicator/index.d.ts
- ui/animation/index.d.ts
- ui/animation/keyframe-animation.d.ts
- ui/builder/component-builder/index.d.ts
- ui/builder/index.d.ts
- ui/button/index.d.ts
- ui/content-view/index.d.ts
- ui/core/bindable/index.d.ts
- ui/core/control-state-change/index.d.ts
- ui/core/properties/index.d.ts
- ui/core/view-base/index.d.ts
- ui/core/view/index.d.ts
- ui/core/view/view-helper/index.d.ts
- ui/core/weak-event-listener/index.d.ts
- ui/date-picker/index.d.ts
- ui/dialogs/dialogs-common.d.ts
- ui/dialogs/index.d.ts
- ui/editable-text-base/index.d.ts
- ui/embedding/index.d.ts
- ui/frame/index.d.ts
- ui/gestures/gestures-common.d.ts
- ui/gestures/index.d.ts
- ui/gestures/touch-manager.d.ts
- ui/html-view/index.d.ts
- ui/image-cache/index.d.ts
- ui/image/index.d.ts
- ui/image/symbol-effects-common.d.ts
- ui/image/symbol-effects.d.ts
- ui/label/index.d.ts
- ui/layouts/absolute-layout/index.d.ts
- ui/layouts/dock-layout/index.d.ts
- ui/layouts/flexbox-layout/index.d.ts
- ui/layouts/grid-layout/index.d.ts
- ui/layouts/layout-base.d.ts
- ui/layouts/root-layout/index.d.ts
- ui/layouts/stack-layout/index.d.ts
- ui/layouts/wrap-layout/index.d.ts
- ui/list-picker/index.d.ts
- ui/list-view/index.d.ts
- ui/page/index.d.ts
- ui/page/page-common.d.ts
- ui/placeholder/index.d.ts
- ui/progress/index.d.ts
- ui/proxy-view-container/index.d.ts
- ui/repeater/index.d.ts
- ui/scroll-view/index.d.ts
- ui/search-bar/index.d.ts
- ui/segmented-bar/index.d.ts
- ui/slider/index.d.ts
- ui/styling/background-common.d.ts
- ui/styling/background.d.ts
- ui/styling/converters.d.ts
- ui/styling/css-animation-parser.d.ts
- ui/styling/css-selector.d.ts
- ui/styling/css-shadow.d.ts
- ui/styling/font.d.ts
- ui/styling/style-properties.d.ts
- ui/styling/style-scope.d.ts
- ui/styling/style/index.d.ts
- ui/switch/index.d.ts
- ui/tab-view/index.d.ts
- ui/text-base/formatted-string.d.ts
- ui/text-base/index.d.ts
- ui/text-base/span.d.ts
- ui/text-field/index.d.ts
- ui/text-view/index.d.ts
- ui/time-picker/index.d.ts
- ui/transition/fade-transition.d.ts
- ui/transition/index.d.ts
- ui/transition/modal-transition.d.ts
- ui/transition/page-transition.d.ts
- ui/transition/shared-transition-helper.d.ts
- ui/transition/shared-transition.d.ts
- ui/transition/slide-transition.d.ts
- ui/web-view/index.d.ts
- utils/common.d.ts
- utils/constants.d.ts
- utils/debug.d.ts
- utils/index.d.ts
- utils/layout-helper/index.d.ts
- utils/mainthread-helper.d.ts
- utils/native-helper.d.ts
- utils/types.d.ts
- xml/index.d.ts
Dependencies (7)
Dev Dependencies (0)
No dev dependencies.
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@nativescript/core
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@nativescript/core)
- HTML<a href="https://www.jsdocs.io/package/@nativescript/core"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 24795 ms. - Missing or incorrect documentation? Open an issue for this package.