9.0 Released! → Native ESM runtimes 🚀, Vite support ⚡️, multi-window apps and more...
Read Announcement

Namespaces

NamespaceDescription
AccessibilityEvents-
AndroidHelperVarious Android view helper methods
ApplicationSettings-
capitalizationTypeDefines the capitalization type for prompt dialog.
Connectivity-
CoreTypes-
CSSUtils-
DialogStrings-
encodingDefines the supported character encodings.
FixedLength-
FontStyle-
FontVariationSettings-
FontWeight-
GridUnitType-
Http-
inputTypeDefines the input type for prompt dialog.
IOSHelperVarious iOS view helper methods
knownFoldersProvides access to the top-level Folders instances that are accessible from the application. Use these as entry points to access the FileSystem.
Length-
pathEnables path-specific operations like join, extension, etc.
PercentLength-
Trace-
Utils-

Enumerations

EnumerationDescription
AccessibilityLiveRegion-
AccessibilityRole-
AccessibilityState-
AccessibilityTrait-
AndroidDirectory-
CacheMode-
FontScaleCategory-
GestureEvents-
GestureStateTypes-
GestureTypes-
HttpResponseEncoding-
ImageSymbolEffects-
NavigationType-
SharedTransitionAnimationType-
SwipeDirection-
TouchAction-
WritingToolsAllowedInput(iOS Only) Allowed input for Apple Intelligence Writing Tools
WritingToolsBehavior(iOS Only) Behavior for Apple Intelligence Writing Tools

Classes

ClassDescription
AbsoluteLayoutA layout that lets you specify exact locations (left/top coordinates) of its children.
ActionBarProvides an abstraction over the ActionBar (android) and NavigationBar (iOS).
ActionItemRepresents an action item in the action bar.
ActionItemsRepresents a collection of ActionItems.
ActivityIndicatorRepresents a UI widget which displays a progress indicator hinting the user for some background operation running.
AndroidApplication-
AnimationDefines a animation set.
ApplicationCommon-
Background-
Binding-
Builder-
ButtonRepresents a standard Button widget.
ChangeType-
CoercibleProperty-
ColorRepresents a color object. Stores all color components (alpha (opacity), red, green, blue) in a [0..255] range.
ContainerViewBase class for all UI components that are containers.
ContentView-
ControlStateChangeListenerAn utility class used for supporting styling infrastructure. WARNING: This class is intended for IOS only.
CssAnimationParser-
CssAnimationProperty-
CssProperty-
CustomLayoutViewBase class for all UI components that implement custom layouts.
DatePickerRepresents an date picker.
DockLayoutA Layout that arranges its children at its outer edges, and allows its last child to take up the remaining space.
EditableTextBaseRepresents the base class for all editable text views.
FadeTransition-
FileRepresents a File entity on the file system.
FileSystemEntityRepresents a single entity on the file system.
FlexboxLayout-
FolderRepresents a Folder (directory) entity on the file system.
Font-
FormattedStringA class used to create a formatted (rich text) string.
FrameRepresents the logical View unit that is responsible for navigation within an application. Nested frames are supported, enabling hierarchical navigation scenarios.
GesturesObserverProvides options for the GesturesObserver.
GridLayoutDefines a rectangular layout area that consists of columns and rows.
HtmlViewRepresents a view with html content. Use this component instead WebView when you want to show just static HTML content. iOS support android support
ImageRepresents a class that provides functionality for loading and streching image(s).
ImageAssetObservable 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 the fromObjectRecursive({}) functions.
ImageCacheRepresents a class that stores handles image download requests and caches the already downloaded images.
ImageSourceEncapsulates the common abstraction behind a platform specific object (typically a Bitmap) that is used as a source for images.
ImageSymbolEffectiOS only Symbol effects: https://developer.apple.com/documentation/symbols?language=objc
InheritedCssProperty-
InheritedProperty-
iOSApplication-
ItemSpecDefines row/column specific properties that apply to GridLayout elements.
KeyframeAnimation-
KeyframeAnimationInfo-
KeyframeDeclaration-
KeyframeInfo-
LabelRepresents a text label.
LayoutBaseBase class for all views that supports children positioning.
LinearGradient-
LiquidGlass-
LiquidGlassContainer-
ListPickerRepresents an list picker.
ListViewRepresents a view that shows items in a vertically scrolling list.
ModalTransition-
ModuleNameResolver-
NavigationButtonRepresents the navigation (a.k.a. "back") button.
ObservableObservable 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 the fromObjectRecursive({}) functions.
ObservableArrayAdvanced array like class used when you want to be notified when a change occurs.
PageRepresents a logical unit for navigation (inside Frame).
PageBase-
PageTransition-
ParserEventProvides information for a parser event.
ParserEventTypeSpecifies the type of parser event.
PlaceholderRepresents a Placeholder, which is used to add a native view to the visual tree.
ProgressRepresents a progress component.
Property-
ProxyViewContainerProxy view container that adds all its native children directly to the parent. To be used as a logical grouping container of views.
RepeaterRepresents a UI Repeater component.
RootLayout-
ScreenAn object describing general information about a display.
ScrollViewRepresents a scrollable area that can have content that is larger than its bounds.
SearchBarRepresents a search bar component.
SegmentedBarRepresents a UI SegmentedBar component.
SegmentedBarItemRepresents a SegmentedBar item.
SharedTransitionShared 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.
SharedTransitionHelperPlatform helper to aid in creating your own custom Shared Element Transition classes. (iOS Only)
ShorthandProperty-
SliderRepresents a slider component.
SlideTransition-
SpanA class used to create a single part of formatted string with a common text properties.
SplitViewiOS UISplitViewController-backed container. On Android, acts as a simple container.
StackLayoutA Layout that arranges its children horizontally or vertically. The direction can be set by orientation property.
StyleObservable 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 the fromObjectRecursive({}) functions.
SwitchRepresents a switch component.
TabViewRepresents a tab view.
TabViewItemRepresents a tab view entry.
TextBase-
TextFieldRepresents an editable text field.
TextViewRepresents an editable multiline text view.
TimePickerRepresents an time picker.
TouchManagerManage 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.
Transition-
ViewThis 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.
ViewBase-
ViewHelper-
VirtualArrayAdvanced array like class that helps loading items on demand.
WebViewRepresents a standard WebView widget.
WrapLayoutWrapLayout position children in rows or columns depending on orientation property until space is filled and then wraps them on new row or column.
WrappedValueHelper 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.
XmlParserA simple non-validating SAX parser based on https://github.com/vflash/easysax version 0.1.14

Interfaces

InterfaceDescription
AccessibilityDecrementEventDataBase event data.
AccessibilityIncrementEventDataBase event data.
ActionOptionsProvides options for the dialog.
AddArrayFromBuilderDefines an interface for adding arrays declared in xml.
AddChildFromBuilderDefines an interface for adding a child element declared in xml.
AlertOptionsProvides options for the alert.
AndroidActivityBackPressedEventDataData for the Android activity back pressed event.
AndroidActivityBundleEventDataData for the Android activity events with bundle.
AndroidActivityCallbacks-
AndroidActivityEventDataData for the Android activity events.
AndroidActivityNewIntentEventDataData for the Android activity newIntent event.
AndroidActivityRequestPermissionsEventDataData for the Android activity onRequestPermissions callback
AndroidActivityResultEventDataData for the Android activity result event.
AndroidOverflowInsetDataDefines the data for the androidOverflowInset event.
AnimationDefinition-
AnimationDefinitionInternal-
ApplicationEventDataEvent data containing information for the application events.
BackstackEntryRepresents an entry in the back stack of a Frame object.
BindingOptionsThe options object used in the Bindable.bind method.
Cancelable-
CancelableOptionsProvides options for the dialog.
ChangedDataEvent args for "changed" event.
CommonLayoutParams-
ComponentModule-
ConfirmOptionsProvides options for the confirm dialog.
CreateViewEventDataEvent data containing information for creating a native view that will be added to the visual tree.
CssChangedEventDataEvent data containing information about application css change.
DialogOptionsProvides options for the dialog.
DiscardedErrorEventDataEvent data containing information about discarded application errors.
DownloadedDataProvides data for downloaded event.
DownloadErrorProvides data for download error.
DownloadRequestRepresents a single download request.
EventDataBase event data.
EventDataValueBase event data.
FontScaleChangedEventDataEvent data containing information for font scale changed event.
GestureEventDataBase event data.
GestureEventDataWithStateBase event data.
HttpContentEncapsulates the content of an HttpResponse.
HttpRequestOptionsProvides options for the http requests.
HttpResponseEncapsulates HTTP-response information from an HTTP-request.
IDevice-
ImageAssetOptions-
InitRootViewEventDataEvent data containing information about root view application.
IOSViewThis 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.
ItemEventDataEvent data containing information for the index and the view associated to a list view item.
ItemsLoadingEvent args for "itemsLoading" event.
ItemsSource-
KeyedTemplateDefines an interface for Template with a key.
LaunchEventDataEvent data containing information for launch event.
LayoutDirectionChangedEventDataEvent data containing information for system layout direction changed event.
LoadAppCSSEventDataEvent data containing information for the application events.
LoadEventDataEvent data containing information for the loading events of a WebView.
LoadOptions-
LoginOptionsProvides options for the login dialog.
LoginResultProvides result data from the login dialog.
NativeScriptConfigIMPORTANT: this is not generated automatically due to this issue: https://github.com/microsoft/TypeScript/issues/36763 the reference path above will get rewritten and break on compilation unless kept here Once issue is resolve we can remove this index.d.ts from repo and go back to auto generation on tsc
NativeScriptErrorAn extended JavaScript Error which will have the nativeError property initialized in case the error is caused by executing platform-specific code.
NavigatedDataDefines the data for the page navigation events.
NavigationContextRepresents a context passed to navigation methods.
NavigationDataBase event data.
NavigationEntryRepresents an entry in passed to navigate method.
NavigationTransitionRepresents an object specifying a page navigation transition.
OrientationChangedEventDataEvent data containing information for orientation changed event.
Pair-
PanGestureEventDataBase event data.
PinchGestureEventDataBase event data.
PlatformContextUsed with qualifier matchers and module resolution
Point3D-
PromptOptionsProvides options for the prompt dialog.
PromptResultProvides result data from the prompt dialog.
PropertyAnimation-
PropertyAnimationInfo-
PropertyChangeDataData for the "propertyChange" event.
RootLayoutOptions-
RotationGestureEventDataBase event data.
SceneEventDataiOS Event data containing information for scene lifecycle events (iOS 13+).
ScrollEventDataBase event data.
SearchEventDataEvent data containing information for the search text change event.
SelectedIndexChangedEventDataDefines the data for the SegmentedBar.selectedIndexChanged event.
ShadeCoverOptions-
ShadowCSSValues-
SharedTransitionConfig-
ShowModalOptions-
ShownModallyDataDefines the data for the shownModally event.
SizeThe 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.
StrokeCSSValues-
SwipeGestureEventDataBase event data.
SystemAppearanceChangedEventDataEvent data containing information for system appearance changed event.
TapGestureEventDataBase event data.
TemplateDefines an interface for a View factory function. Commonly used to specify the visualization of data objects.
TemplatedItemsView-
TimerInfoContains contains utility methods for profiling. All methods in this module are experimental and may be changed in a non-major version.
TouchGestureEventData-
TraceErrorHandlerAn interface used to for handling trace error
TraceEventListenerAn interface used to trace information about specific event.
TraceWriterAn interface used to define a writer used by trace to print (log).
UnhandledErrorEventDataEvent data containing information about unhandled application errors.
ViewEntryRepresents an entry to be used to create a view or load it form file

Type Aliases

Type AliasDescription
AlignContent-
AlignItems-
AlignSelf-
AnimationPromise-
dip-
Flex-
FlexDirection-
FlexFlow-
FlexWrap-
FontStyleType-
FontVariationSettingsType-
FontWeightType-
GlassEffectConfig-
GlassEffectType-
GlassEffectVariantGlass effects
GridUnitType-
Headers-
HorizontalAlignment-
InstrumentationModeProfiling 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.
iosSymbolScaleTypeiOS only SF Symbol scale
JustifyContent-
LengthDipUnit-
LengthPercentUnit-
LengthPxUnit-
LengthType-
ModuleListProvider-
percent-
PercentLengthType-
px-
SceneEventName-
SharedTransitionTagPropertiesProperties which can be set on individual Shared Elements
SplitBehavior-
SplitDisplayMode-
SplitRole-
SplitStyle-
TouchAnimationOptions-
Transformation-
TransformationType-
TransformationValue-
TransformFunctionsInfo-
VerticalAlignment-
VisionHoverOptions-
WebViewNavigationTypeRepresents navigation type

Variables

VariableDescription
_resetRootView-
addCss-
android-
androidDynamicElevationOffsetProperty-
androidElevationProperty-
androidRegisterBroadcastReceiver-
AnimationCurve-
Application-
autocapitalizationTypeProperty-
autocorrectProperty-
backgroundColorProperty-
backgroundEvent-
backgroundImageProperty-
backgroundInternalProperty-
backgroundPositionProperty-
backgroundRepeatProperty-
backgroundSizeProperty-
borderBottomColorProperty-
borderBottomLeftRadiusProperty-
borderBottomRightRadiusProperty-
borderBottomWidthProperty-
borderLeftColorProperty-
borderLeftWidthProperty-
borderRightColorProperty-
borderRightWidthProperty-
borderTopColorProperty-
borderTopLeftRadiusProperty-
borderTopRightRadiusProperty-
borderTopWidthProperty-
clipPathProperty-
colorProperty-
CSSHelper-
DeviceGets the current device information.
DialogsSingular rollup for convenience of all dialog methods
directionProperty-
discardedErrorEvent-
displayedEvent-
editableProperty-
Enums-
exitEvent-
fontFamilyProperty-
fontInternalProperty-
fontScaleChangedEvent-
fontScaleInternalProperty-
fontSizeProperty-
fontStyleProperty-
fontVariationSettingsProperty-
fontWeightProperty-
foregroundEvent-
getCssFileName-
getMainEntry-
getNativeApplication-
getResources-
getRootView-
hasLaunched-
hasListeners-
heightProperty-
hintProperty-
horizontalAlignmentProperty-
inBackground-
ios-
isAndroidGets a value indicating if the app is running on the Android platform.
isAppleGets a value indicating if the app is running on an Apple platform.
isIOSGets a value indicating if the app is running on the iOS platform.
isUserInteractionEnabledProperty-
isVisionOSGets a value indicating if the app is running on the iOS platform.
keyboardTypeProperty-
launchEvent-
layoutDirection-
layoutDirectionChanged-
layoutDirectionChangedEvent-
letterSpacingProperty-
lineHeightProperty-
loadAppCss-
lowMemoryEvent-
marginBottomProperty-
marginLeftProperty-
marginRightProperty-
marginTopProperty-
maxLengthProperty-
minHeightProperty-
minWidthProperty-
notify-
off-
on-
opacityProperty-
orientation-
orientationChangedEvent-
paddingBottomProperty-
paddingInternalProperty-
paddingLeftProperty-
paddingRightProperty-
paddingTopProperty-
perspectiveProperty-
placeholderColorProperty-
platformNames-
resetRootView-
resumeEvent-
returnKeyTypeProperty-
rotateProperty-
rotateXProperty-
rotateYProperty-
run-
scaleXProperty-
scaleYProperty-
SceneEvents-
setAutoSystemAppearanceChanged-
setCssFileName-
setMaxRefreshRate-
setResources-
suspended-
suspendEvent-
systemAppearance-
systemAppearanceChanged-
systemAppearanceChangedEvent-
textAlignmentProperty-
textDecorationProperty-
textOverflowProperty-
textShadowProperty-
textStrokeProperty-
textTransformProperty-
translateXProperty-
translateYProperty-
uncaughtErrorEvent-
unsetValueValue specifying that Property should be set to its initial value.
updateTextTriggerProperty-
VALID_FONT_SCALES-
verticalAlignmentProperty-
visibilityProperty-
whiteSpaceProperty-
widthProperty-
zIndexProperty-

Functions

FunctionDescription
_resolveAnimationCurve-
_setResolverUsed to set a global singular instance of ModuleNameResolver
actionThe action() method displays a action box that prompts the visitor to choose some action.
addTaggedAdditionalCSS-
addWeakEventListenerAttaches a WeakEventListener.
alertThe alert() method displays an alert box with a specified message.
animationTimingFunctionConverter-
booleanConverter-
confirmThe confirm() method displays a dialog box with a specified message.
CSSTypeSpecifies the type name for the instances of this View class, that is used when matching CSS type selectors.
eachDescendantIterates through all child views (via visual tree) and executes a function.
fromObjectCreates an Observable instance and sets its properties according to the supplied JavaScript object. param obj - A JavaScript object used to initialize nativescript Observable instance.
fromObjectRecursiveCreates 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.
getAncestorGets an ancestor from a given type.
getAndroidAccessibilityManager-
getCurrentFontScale-
getCurrentPage-
getFileAccessReturns 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.
getLastFocusedViewOnPageFind the last view focused on a page.
getNativeAppGet the current application instance.
getRootLayout-
getRootLayoutById-
getTransformedText-
getViewByIdGets a child view by id.
initializeSdkVersionClass-
isAccessibilityServiceEnabledIs Android TalkBack or iOS VoiceOver enabled?
isEmbeddedWhether the app is embedded into a host project or standalone project
loginThe login() method displays a login dialog box that prompts the visitor for user name and password.
makeParser-
makeValidator-
parseCSSShadowParse a string into ShadowCSSValues Supports any valid css box/text shadow combination.
parseCSSStrokeParse a string into StrokeCSSValues https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-text-stroke
parseKeyframeDeclarations-
profileMethod 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.
profilingDisableDisables profiling.
profilingDumpProfilesPrints the timer for all methods instrumented with profile decorator.
profilingEnableEnables profiling.
profilingIsRunningReturns true if a timer is currently running.
profilingResetProfilesResets the timers for all methods instrumented with profile decorator.
profilingStartStarts a timer with a specific name. Works only if profiling is enabled.
profilingStartCPUStarts android cpu profiling.
profilingStopPauses a timer with a specific name. This will increase call count and accumulate time. Works only if profiling is enabled.
profilingStopCPUStops android cpu profiling.
profilingTimeGets accurate system timestamp in ms.
profilingUptimeGets the uptime of the current process in milliseconds.
promptThe prompt() method displays a dialog box that prompts the visitor for input.
PseudoClassHandler-
querySelectorAllGets a child view by selector.
removeTaggedAdditionalCSS-
removeWeakEventListenerRemoves a WeakEventListener.
resolveFileNameFromUrl-
sendAccessibilityEventAndroid: helper function for triggering accessibility events
setActivityCallbacks-
setNativeAppThis is called internally to set the native application instance. You typically do not need to call this directly. However, it's exposed for special case purposes, such as custom application initialization.
timeConverter-
updateAccessibilityPropertiesUpdate accessibility properties on nativeView

References

androidRegisteredReceivers

Renames and re-exports androidRegisterBroadcastReceiver


androidUnregisterBroadcastReceiver

Renames and re-exports androidRegisterBroadcastReceiver


iosAddNotificationObserver

Renames and re-exports androidRegisterBroadcastReceiver


iosNotificationObservers

Renames and re-exports androidRegisterBroadcastReceiver


iosRemoveNotificationObserver

Renames and re-exports androidRegisterBroadcastReceiver


sanitizeModuleName

Re-exports sanitizeModuleName