diff --git a/src/label-common.ts b/src/label-common.ts index b26eff5..dc7b599 100644 --- a/src/label-common.ts +++ b/src/label-common.ts @@ -5,6 +5,28 @@ import { Label as TNLabel } from 'tns-core-modules/ui/label'; import { Style } from 'tns-core-modules/ui/styling/style'; import { layout } from 'tns-core-modules/utils/utils'; import { Label as LabelViewDefinition, TextShadow } from './label'; +import { FormattedString } from 'tns-core-modules/text/formatted-string'; +import { Span } from 'tns-core-modules/text/span'; + + +declare module 'tns-core-modules/text/formatted-string' { + interface FormattedString { + addPropertyChangeHandler(): void; + removePropertyChangeHandler(): void; + } +} +declare module 'tns-core-modules/text/span' { + interface Span { + addPropertyChangeHandler(): void; + removePropertyChangeHandler(): void; + } +} + +FormattedString.prototype.addPropertyChangeHandler = function() {} +FormattedString.prototype.removePropertyChangeHandler = function() {} +Span.prototype.addPropertyChangeHandler = function() {} +Span.prototype.removePropertyChangeHandler = function() {} + export const cssProperty = (target: Object, key: string | symbol) => { // property getter diff --git a/src/label.android.ts b/src/label.android.ts index c4d54a5..c74773e 100644 --- a/src/label.android.ts +++ b/src/label.android.ts @@ -59,23 +59,14 @@ Font.prototype.getAndroidTypeface = function() { declare module 'tns-core-modules/text/formatted-string' { interface FormattedString { toNativeString(): string; - addPropertyChangeHandler(): void; - removePropertyChangeHandler(): void; } } declare module 'tns-core-modules/text/span' { interface Span { toNativeString(): string; - addPropertyChangeHandler(): void; - removePropertyChangeHandler(): void; } } -FormattedString.prototype.addPropertyChangeHandler = function() {} -FormattedString.prototype.removePropertyChangeHandler = function() {} -Span.prototype.addPropertyChangeHandler = function() {} -Span.prototype.removePropertyChangeHandler = function() {} - FormattedString.prototype.toNativeString = function() { let result = ''; const length = this._spans.length;