mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Fixed issue 597.
This commit is contained in:
28
text/formatted-string.d.ts
vendored
28
text/formatted-string.d.ts
vendored
@@ -8,10 +8,17 @@ declare module "text/formatted-string" {
|
||||
import colorModule = require("color");
|
||||
import view = require("ui/core/view");
|
||||
|
||||
/**
|
||||
* Interface that specifies View that have formattedText property (like TextBase and Button).
|
||||
*/
|
||||
export interface FormattedStringView {
|
||||
formattedText: FormattedString;
|
||||
}
|
||||
|
||||
/**
|
||||
* A class used to create a formatted (rich text) string.
|
||||
*/
|
||||
class FormattedString extends observable.Observable {
|
||||
class FormattedString extends observable.Observable implements view.AddArrayFromBuilder, view.AddChildFromBuilder {
|
||||
/**
|
||||
* An observable collection of Span objects used to define common text properties.
|
||||
*/
|
||||
@@ -72,5 +79,24 @@ declare module "text/formatted-string" {
|
||||
* Gets the parent view of the formatted string.
|
||||
*/
|
||||
public parent: view.View;
|
||||
|
||||
/**
|
||||
* A function that is called when an array declaration is found in xml.
|
||||
* @param name - Name of the array.
|
||||
* @param value - The actual value of the array.
|
||||
*/
|
||||
public _addArrayFromBuilder(name: string, value: Array<any>): void;
|
||||
|
||||
/**
|
||||
* Called for every child element declared in xml.
|
||||
* @param name - Name of the element.
|
||||
* @param value - Value of the element.
|
||||
*/
|
||||
public _addChildFromBuilder(name: string, value: any): void;
|
||||
|
||||
/**
|
||||
* A static method used to add child elements of the FormattedString class to a View declared in xml.
|
||||
*/
|
||||
public static addFormattedStringToView(view: FormattedStringView, name: string, value: any): void;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user