declare module "ui/core/view-base" { import { Observable } from "data/observable"; import { BindingOptions } from "ui/core/bindable"; import { Style } from "ui/styling/style"; /** * Gets an ancestor from a given type. * @param view - Starting view (child view). * @param 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. */ export function getAncestor(view: ViewBase, criterion: string | Function): ViewBase; export function isEventOrGesture(name: string, view: ViewBase): boolean; export class ViewBase extends Observable { /** * String value used when hooking to loaded event. */ public static loadedEvent: string; /** * String value used when hooking to unloaded event. */ public static unloadedEvent: string; public ios: any; public android: any; public nativeView: any; public bindingContext: any; /** * Gets the parent view. This property is read-only. */ public parent: ViewBase; /** * Gets the style object associated to this view. */ public readonly style: Style; /** * Returns true if visibility is set to 'collapse'. */ public isCollapsed: boolean; public bind(options: BindingOptions, source: Object): void; public unbind(property: string): void; public requestLayout(): void; public eachChild(callback: (child: ViewBase) => boolean): void; } } declare module "ui/core/properties" { import { ViewBase } from "ui/core/view-base"; import { Style } from "ui/styling/style"; interface PropertyOptions { readonly name: string, readonly defaultValue?: U, readonly affectsLayout?: boolean, readonly equalityComparer?: (x: U, y: U) => boolean, readonly valueChanged?: (target: T, oldValue: U, newValue: U) => void, readonly valueConverter?: (value: any) => U } interface CssPropertyOptions extends PropertyOptions { readonly cssName: string; } class Property implements TypedPropertyDescriptor { constructor(options: PropertyOptions); public readonly native: symbol; public register(cls: { prototype: T }): void; } class InheritedProperty extends Property { constructor(options: PropertyOptions); } class CssProperty { constructor(options: CssPropertyOptions); public readonly native: symbol; public readonly name: string; public readonly cssName: string; public register(cls: { prototype: T }): void; } class InheritedCssProperty extends CssProperty { constructor(options: CssPropertyOptions); } export interface ShorthandPropertyOptions { readonly name: string, readonly cssName: string; readonly converter: (value: string) => [CssProperty, any][], readonly getter: (this: Style) => string } export class ShorthandProperty { constructor(options: ShorthandPropertyOptions); public readonly native: symbol; public readonly name: string; public readonly cssName: string; public register(cls: { prototype: T }): void; } }