• Public
  • Public/Protected
  • All

Project NativeScript






Type aliases



Type aliases


AutocapitalizationType: "none" | "words" | "sentences" | "allcharacters"


BackgroundRepeat: "repeat" | "repeat-x" | "repeat-y" | "no-repeat"


GridUnitType: "pixel" | "star" | "auto"


Headers: object

Type declaration

  • [key: string]: string | string[]


HorizontalAlignment: "left" | "center" | "right" | "stretch"


InstrumentationMode: "counters" | "timeline" | "lifecycle"


Length: "auto" | dip | LengthDipUnit | LengthPxUnit


LengthDipUnit: object

Type declaration

  • Readonly unit: "dip"
  • Readonly value: dip


LengthPercentUnit: object

Type declaration

  • Readonly unit: "%"
  • Readonly value: percent


LengthPxUnit: object

Type declaration

  • Readonly unit: "px"
  • Readonly value: px


ModuleListProvider: function

Type declaration

    • (): string[]
    • Returns string[]


PercentLength: "auto" | dip | LengthDipUnit | LengthPxUnit | LengthPercentUnit


ReturnKeyType: "done" | "next" | "go" | "search" | "send"


TextTransform: "initial" | "none" | "capitalize" | "uppercase" | "lowercase"


UpdateTextTrigger: "focusLost" | "textChanged"


VerticalAlignment: "top" | "middle" | "bottom" | "stretch" | "text-top" | "text-bottom" | "super" | "sub" | "baseline"


Visibility: "visible" | "hidden" | "collapse"


WebViewNavigationType: "linkClicked" | "formSubmitted" | "backForward" | "reload" | "formResubmitted" | "other" | undefined

Represents navigation type


Const Application

Application: object

Type declaration

  • addCss: typeof addCss
  • android: typeof AndroidApplication
  • discardedErrorEvent: string
  • displayedEvent: string
  • exitEvent: string
  • getCssFileName: typeof getCssFileName
  • getMainEntry: typeof getMainEntry
  • getNativeApplication: typeof getNativeApplication
  • getResources: typeof getResources
  • getRootView: typeof getRootView
  • hasLaunched: typeof hasLaunched
  • hasListeners: typeof hasListeners
  • ios: typeof iOSApplication
  • launchEvent: string
  • loadAppCss: typeof loadAppCss
  • lowMemoryEvent: string
  • notify: typeof notify
  • off: typeof off
  • on: typeof on
  • orientation: typeof orientation
  • orientationChangedEvent: string
  • resetRootView: typeof _resetRootView
  • resumeEvent: string
  • run: typeof run
  • setCssFileName: typeof setCssFileName
  • setResources: typeof setResources
  • suspendEvent: string
  • systemAppearance: typeof systemAppearance
  • systemAppearanceChanged: typeof systemAppearanceChanged
  • systemAppearanceChangedEvent: string
  • uncaughtErrorEvent: string

Const ApplicationSettings

ApplicationSettings: object

Type declaration

  • clear: typeof clear
  • flush: typeof flush
  • getAllKeys: typeof getAllKeys
  • getBoolean: typeof getBoolean
  • getNumber: typeof getNumber
  • getString: typeof getString
  • hasKey: typeof hasKey
  • remove: typeof remove
  • setBoolean: typeof setBoolean
  • setNumber: typeof setNumber
  • setString: typeof setString

Const CSSHelper

CSSHelper: object

Type declaration

  • AttributeSelector: typeof AttributeSelector
  • ClassSelector: typeof ClassSelector
  • InvalidSelector: typeof InvalidSelector
  • PseudoClassSelector: typeof PseudoClassSelector
  • RuleSet: typeof RuleSet
  • Selector: typeof Selector
  • SelectorCore: typeof SelectorCore
  • SelectorsMap: typeof SelectorsMap
  • SelectorsMatch: typeof SelectorsMatch
  • SimpleSelector: typeof SimpleSelector
  • SimpleSelectorSequence: typeof SimpleSelectorSequence
  • TypeSelector: typeof TypeSelector
  • UniversalSelector: typeof UniversalSelector
  • createSelector: function
      • (sel: string): SimpleSelector | SimpleSelectorSequence | Selector
      • Parameters

        • sel: string

        Returns SimpleSelector | SimpleSelectorSequence | Selector

  • fromAstNodes: function
      • (astRules: cssParser.Node[]): RuleSet[]
      • Parameters

        • astRules: cssParser.Node[]

        Returns RuleSet[]

Const Connectivity

Connectivity: object

Type declaration

  • connectionType: typeof connectionType
  • getConnectionType: typeof getConnectionType
  • startMonitoring: typeof startMonitoring
  • stopMonitoring: typeof stopMonitoring

Const Device

Device: IDevice

Gets the current device information.

Const Dialogs

Dialogs: object

Singular rollup for convenience of all dialog methods

Type declaration

  • action: typeof action
  • alert: typeof alert
  • confirm: typeof confirm
  • login: typeof login
  • prompt: typeof prompt

Const Enums

Enums: object

Type declaration

  • Accuracy: typeof Accuracy
  • AndroidActionBarIconVisibility: typeof AndroidActionBarIconVisibility
  • AndroidActionItemPosition: typeof AndroidActionItemPosition
  • AnimationCurve: typeof AnimationCurve
  • AutocapitalizationType: typeof AutocapitalizationType
  • BackgroundRepeat: typeof BackgroundRepeat
  • DeviceOrientation: typeof DeviceOrientation
  • DeviceType: typeof DeviceType
  • Dock: typeof Dock
  • FontAttributes: typeof FontAttributes
  • FontStyle: typeof FontStyle
  • FontWeight: typeof FontWeight
  • HorizontalAlignment: typeof HorizontalAlignment
  • IOSActionItemPosition: typeof IOSActionItemPosition
  • ImageFormat: typeof ImageFormat
  • KeyboardType: typeof KeyboardType
  • NavigationBarVisibility: typeof NavigationBarVisibility
  • Orientation: typeof Orientation
  • ReturnKeyType: typeof ReturnKeyType
  • StatusBarStyle: typeof StatusBarStyle
  • Stretch: typeof Stretch
  • SystemAppearance: typeof SystemAppearance
  • TextAlignment: typeof TextAlignment
  • TextDecoration: typeof TextDecoration
  • TextTransform: typeof TextTransform
  • UpdateTextTrigger: typeof UpdateTextTrigger
  • VerticalAlignment: typeof VerticalAlignment
  • Visibility: typeof Visibility
  • WhiteSpace: typeof WhiteSpace

Const Http

Http: object

Type declaration

Const Utils

Utils: object

Type declaration

  • ClassInfo: typeof ClassInfo
  • FILE_PREFIX: string
  • GC: typeof GC
  • Source: typeof Source
  • ad: typeof androidUtils
  • android: typeof androidUtils
  • clearInterval: typeof clearInterval
  • clearTimeout: typeof clearTimeout
  • convertString: typeof convertString
  • dispatchToMainThread: typeof dispatchToMainThread
  • escapeRegexSymbols: typeof escapeRegexSymbols
  • executeOnMainThread: typeof executeOnMainThread
  • getBaseClasses: typeof getBaseClasses
  • getClass: typeof getClass
  • getClassInfo: typeof getClassInfo
  • getModuleName: typeof getModuleName
  • ios: typeof iosUtils
  • isBoolean: typeof isBoolean
  • isDataURI: typeof isDataURI
  • isDefined: typeof isDefined
  • isFileOrResourcePath: typeof isFileOrResourcePath
  • isFontIconURI: typeof isFontIconURI
  • isFunction: typeof isFunction
  • isMainThread: typeof isMainThread
  • isNullOrUndefined: typeof isNullOrUndefined
  • isNumber: typeof isNumber
  • isObject: typeof isObject
  • isRealDevice: typeof isRealDevice
  • isString: typeof isString
  • isUndefined: typeof isUndefined
  • layout: typeof layout
  • mainThreadify: typeof mainThreadify
  • openFile: typeof openFile
  • openUrl: typeof openUrl
  • releaseNativeObject: typeof releaseNativeObject
  • setInterval: typeof setInterval
  • setTimeout: typeof setTimeout
  • toUIString: typeof toUIString
  • verifyCallback: typeof verifyCallback

Const androidDynamicElevationOffsetProperty

androidDynamicElevationOffsetProperty: CssProperty<Style, number>

Const androidElevationProperty

androidElevationProperty: CssProperty<Style, number>

Const autocapitalizationTypeProperty

autocapitalizationTypeProperty: Property<EditableTextBase, AutocapitalizationType>

Const autocorrectProperty

autocorrectProperty: Property<EditableTextBase, boolean>

Const backgroundColorProperty

backgroundColorProperty: CssAnimationProperty<Style, Color>

Const backgroundImageProperty

backgroundImageProperty: CssProperty<Style, string | LinearGradient>

Const backgroundInternalProperty

backgroundInternalProperty: CssProperty<Style, Background>

Const backgroundPositionProperty

backgroundPositionProperty: CssProperty<Style, string>

Const backgroundRepeatProperty

backgroundRepeatProperty: CssProperty<Style, BackgroundRepeat>

Const backgroundSizeProperty

backgroundSizeProperty: CssProperty<Style, string>

Const borderBottomColorProperty

borderBottomColorProperty: CssProperty<Style, Color>

Const borderBottomLeftRadiusProperty

borderBottomLeftRadiusProperty: CssProperty<Style, Length>

Const borderBottomRightRadiusProperty

borderBottomRightRadiusProperty: CssProperty<Style, Length>

Const borderBottomWidthProperty

borderBottomWidthProperty: CssProperty<Style, Length>

Const borderLeftColorProperty

borderLeftColorProperty: CssProperty<Style, Color>

Const borderLeftWidthProperty

borderLeftWidthProperty: CssProperty<Style, Length>

Const borderRightColorProperty

borderRightColorProperty: CssProperty<Style, Color>

Const borderRightWidthProperty

borderRightWidthProperty: CssProperty<Style, Length>

Const borderTopColorProperty

borderTopColorProperty: CssProperty<Style, Color>

Const borderTopLeftRadiusProperty

borderTopLeftRadiusProperty: CssProperty<Style, Length>

Const borderTopRightRadiusProperty

borderTopRightRadiusProperty: CssProperty<Style, Length>

Const borderTopWidthProperty

borderTopWidthProperty: CssProperty<Style, Length>

Const clipPathProperty

clipPathProperty: CssProperty<Style, string>

Const colorProperty

Const editableProperty

editableProperty: Property<EditableTextBase, boolean>

Const fontFamilyProperty

fontFamilyProperty: InheritedCssProperty<Style, string>

Const fontInternalProperty

fontInternalProperty: CssProperty<Style, Font>

Const fontSizeProperty

fontSizeProperty: InheritedCssProperty<Style, number>

Const fontStyleProperty

fontStyleProperty: InheritedCssProperty<Style, FontStyle>

Const fontWeightProperty

fontWeightProperty: InheritedCssProperty<Style, FontWeight>

Const heightProperty

Const hintProperty

hintProperty: Property<EditableTextBase, string>

Const horizontalAlignmentProperty

horizontalAlignmentProperty: CssProperty<Style, HorizontalAlignment>

Const isAndroid

isAndroid: boolean

Gets a value indicating if the app is running on the Android platform.

Const isIOS

isIOS: boolean

Gets a value indicating if the app is running on the iOS platform.

Const isUserInteractionEnabledProperty

isUserInteractionEnabledProperty: Property<View, boolean>

Const keyboardTypeProperty

keyboardTypeProperty: Property<EditableTextBase, KeyboardType>

Const letterSpacingProperty

letterSpacingProperty: CssProperty<Style, number>

Const lineHeightProperty

lineHeightProperty: CssProperty<Style, number>

Const marginBottomProperty

marginBottomProperty: CssProperty<Style, PercentLength>

Const marginLeftProperty

marginLeftProperty: CssProperty<Style, PercentLength>

Const marginRightProperty

marginRightProperty: CssProperty<Style, PercentLength>

Const marginTopProperty

marginTopProperty: CssProperty<Style, PercentLength>

Const maxLengthProperty

maxLengthProperty: Property<EditableTextBase, number>

Const minHeightProperty

minHeightProperty: CssProperty<Style, Length>

Const minWidthProperty

minWidthProperty: CssProperty<Style, Length>

Const opacityProperty

opacityProperty: CssAnimationProperty<Style, number>

Const paddingBottomProperty

paddingBottomProperty: CssProperty<Style, Length>

Const paddingLeftProperty

paddingLeftProperty: CssProperty<Style, Length>

Const paddingRightProperty

paddingRightProperty: CssProperty<Style, Length>

Const paddingTopProperty

paddingTopProperty: CssProperty<Style, Length>

Const perspectiveProperty

perspectiveProperty: CssAnimationProperty<Style, number>

Const placeholderColorProperty

placeholderColorProperty: CssProperty<Style, Color>

Const platformNames

platformNames: object

Type declaration

  • android: string
  • ios: string

Const profilingTime

profilingTime: any

Const returnKeyTypeProperty

returnKeyTypeProperty: Property<EditableTextBase, ReturnKeyType>

Const rotateProperty

rotateProperty: CssAnimationProperty<Style, number>

Const rotateXProperty

rotateXProperty: CssAnimationProperty<Style, number>

Const rotateYProperty

rotateYProperty: CssAnimationProperty<Style, number>

Const scaleXProperty

scaleXProperty: CssAnimationProperty<Style, number>

Const scaleYProperty

scaleYProperty: CssAnimationProperty<Style, number>

Const tabStripProperty

tabStripProperty: Property<TabNavigationBase, TabStrip>

Const textAlignmentProperty

textAlignmentProperty: InheritedCssProperty<Style, TextAlignment>

Const textDecorationProperty

textDecorationProperty: CssProperty<Style, TextDecoration>

Const textTransformProperty

textTransformProperty: CssProperty<Style, TextTransform>

Const translateXProperty

translateXProperty: CssAnimationProperty<Style, number>

Const translateYProperty

translateYProperty: CssAnimationProperty<Style, number>

Const unsetValue

unsetValue: any

Value specifing that Property should be set to its initial value.

Const updateTextTriggerProperty

updateTextTriggerProperty: Property<EditableTextBase, UpdateTextTrigger>

Const verticalAlignmentProperty

verticalAlignmentProperty: CssProperty<Style, VerticalAlignment>

Const visibilityProperty

visibilityProperty: CssProperty<Style, Visibility>

Const whiteSpaceProperty

whiteSpaceProperty: CssProperty<Style, WhiteSpace>

Const widthProperty

Const zIndexProperty

zIndexProperty: CssProperty<Style, number>

Const zeroLength

zeroLength: Length



  • CSSType(type: string): ClassDecorator
  • Specifies the type name for the instances of this View class, that is used when matching CSS type selectors.


    class Button extends View {

    Internally the decorator set Button.prototype.cssType = "Button".


    • type: string

      The type name, e. g. "Button", "Label", etc.

    Returns ClassDecorator


  • PseudoClassHandler(...pseudoClasses: string[]): MethodDecorator


Private _updateCharactersInRangeReplacementString

  • _updateCharactersInRangeReplacementString(formattedText: FormattedString, rangeLocation: number, rangeLength: number, replacementString: string): void


  • action(message: string, cancelButtonText: string, actions: string[]): Promise<string>
  • action(options: ActionOptions): Promise<string>
  • The action() method displays a action box that prompts the visitor to choose some action.


    • message: string

      The text to display in the dialog box.

    • cancelButtonText: string

      The text to display in the cancel button.

    • actions: string[]

      List of available actions.

    Returns Promise<string>

  • The action() method displays a action box that prompts the visitor to choose some action.


    Returns Promise<string>


  • addTaggedAdditionalCSS(cssText: string, tag?: string | number): boolean


  • addWeakEventListener(source: Observable, eventName: string, handler: function, target: any): void


  • alert(message: string | number | boolean): Promise<void>
  • alert(options: AlertOptions): Promise<void>
  • The alert() method displays an alert box with a specified message.


    • message: string | number | boolean

      Specifies the text to display in the alert box.

    Returns Promise<void>

  • The alert() method displays an alert box with a specified message.


    • options: AlertOptions

      Specifies the options for the alert box.

    Returns Promise<void>


  • animationTimingFunctionConverter(value: string): any


  • booleanConverter(v: string): boolean


  • confirm(message: string): Promise<boolean>
  • confirm(options: ConfirmOptions): Promise<boolean>
  • The confirm() method displays a dialog box with a specified message.


    • message: string

      Specifies the text to display in the confirm box.

    Returns Promise<boolean>

  • The confirm() method displays a dialog box with a specified message.


    Returns Promise<boolean>


  • eachDescendant(view: ViewBase, callback: function): void





  • getCurrentPage(): Page


  • 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



  • getIconSpecSize(size: object): object


  • getTransformedText(text: string, textTransform: TextTransform): string



  • login(message: string, userNameHint?: string, passwordHint?: string, userName?: string, password?: string): Promise<LoginResult>
  • login(message: string, userNameHint?: string, passwordHint?: string): Promise<LoginResult>
  • login(options: LoginOptions): Promise<LoginResult>
  • The login() method displays a login dialog box that prompts the visitor for user name and password.


    • message: string

      The text to display in the dialog box.

    • Optional userNameHint: string

      The default text to display as a hint in the username input. Optional.

    • Optional passwordHint: string

      The default text to display as a hint in the password input. Optional.

    • Optional userName: string

      The default text to display in the user name input box. Optional.

    • Optional password: string

      The default text to display in the password input box. Optional.

    Returns Promise<LoginResult>

  • The login() method displays a login dialog box that prompts the visitor for user name and password.


    • message: string

      The text to display in the dialog box.

    • Optional userNameHint: string

      The default text to display as a hint in the username input. Optional.

    • Optional passwordHint: string

      The default text to display as a hint in the password input. Optional.

    Returns Promise<LoginResult>

  • The login() method displays a login dialog box that prompts the visitor for user name and password.


    Returns Promise<LoginResult>


  • makeParser<T>(isValid: function): function
  • Type parameters

    • T


    • isValid: function
        • (value: any): boolean
        • Parameters

          • value: any

          Returns boolean

    Returns function

      • (value: any): T
      • Parameters

        • value: any

        Returns T


  • makeValidator<T>(...values: T[]): function
  • Type parameters

    • T


    • Rest ...values: T[]

    Returns function

      • (value: any): value
      • Parameters

        • value: any

        Returns value


  • parseKeyframeDeclarations(unparsedKeyframeDeclarations: KeyframeDeclaration[]): KeyframeDeclaration[]


  • profile(nameFnOrTarget?: string | Function | Object, fnOrKey?: Function | string | symbol, descriptor?: PropertyDescriptor, attrs?: any): any
  • Parameters

    • Optional nameFnOrTarget: string | Function | Object
    • Optional fnOrKey: Function | string | symbol
    • Optional descriptor: PropertyDescriptor
    • Optional attrs: any

    Returns any


  • profilingDisable(): void


  • profilingDumpProfiles(): void



  • profilingIsRunning(name: string): boolean


  • profilingResetProfiles(): void


  • profilingStart(name: string): void


  • profilingStartCPU(name: string): void



  • profilingStopCPU(name: string): void


  • profilingUptime(): any


  • The prompt() method displays a dialog box that prompts the visitor for input.


    • message: string

      The text to display in the dialog box.

    • Optional defaultText: string

      The default text to display in the input box. Optional.

    Returns Promise<PromptResult>

  • The prompt() method displays a dialog box that prompts the visitor for input.


    Returns Promise<PromptResult>


  • removeTaggedAdditionalCSS(tag: string | number): boolean


  • removeWeakEventListener(source: Observable, eventName: string, handler: function, target: any): void


  • resolveFileNameFromUrl(url: string, appDirectory: string, fileExists: function, importSource?: string): string
  • Parameters

    • url: string
    • appDirectory: string
    • fileExists: function
        • (name: string): boolean
        • Parameters

          • name: string

          Returns boolean

    • Optional importSource: string

    Returns string


  • sanitizeModuleName(moduleName: string, removeExtension?: boolean): string
  • Helps sanitize a module name if it is prefixed with '/', '' or '/'


    • moduleName: string

      the name

    • removeExtension: boolean = true

      whether to remove extension

    Returns string


  • setActivityCallbacks(activity: any): void


  • timeConverter(value: string): number


  • transformConverter(text: string): TransformFunctionsInfo


  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method