UNPKG

@nativescript/core

Version:

A JavaScript library providing an easy to use api for interacting with iOS and Android platform APIs.

54 lines (53 loc) 1.96 kB
import type { ViewBase } from '../view-base'; import type { BindingOptions } from './bindable-types'; import { PropertyChangeData } from '../../../data/observable'; /** * Normalizes "ontap" to "tap", and "ondoubletap" to "ondoubletap". * * Removes the leading "on" from an event gesture name, for example: * - "ontap" -> "tap" * - "ondoubletap" -> "doubletap" * - "onTap" -> "Tap" * * Be warned that, as event/gesture names in NativeScript are case-sensitive, * this may produce an invalid event/gesture name (i.e. "doubletap" would fail * to match the "doubleTap" gesture name), and so it is up to the consumer to * handle the output properly. */ export declare function getEventOrGestureName(name: string): string; export declare function isGesture(eventOrGestureName: string): boolean; export declare function isEventOrGesture(name: string, view: ViewBase): boolean; export declare class Binding { private source; target: WeakRef<ViewBase>; private sourceOptions; private targetOptions; private sourceProperties; private propertyChangeListeners; updating: boolean; sourceIsBindingContext: boolean; options: BindingOptions; constructor(target: ViewBase, options: BindingOptions); private onTargetPropertyChanged; loadedHandlerVisualTreeBinding(args: any): void; clearSource(): void; private sourceAsObject; private bindingContextChanged; bind(source: any): void; private update; unbind(): void; private resolveObjectsAndProperties; private addPropertyChangeListeners; private prepareExpressionForUpdate; private updateTwoWay; private _getExpressionValue; onSourcePropertyChanged(data: PropertyChangeData): void; private prepareContextForExpression; private getSourcePropertyValue; clearBinding(): void; private updateTarget; private updateSource; private getParentView; private resolveOptions; private updateOptions; }