@nativescript/core
Version:
A JavaScript library providing an easy to use api for interacting with iOS and Android platform APIs.
54 lines (53 loc) • 3.39 kB
TypeScript
import { ShadowCSSValues } from '../styling/css-shadow';
import { Font } from '../styling/font';
import { iosAccessibilityAdjustsFontSizeProperty, iosAccessibilityMaxFontScaleProperty, iosAccessibilityMinFontScaleProperty } from '../../accessibility/accessibility-properties';
import { TextBaseCommon, textProperty, formattedTextProperty, textAlignmentProperty, textDecorationProperty, textTransformProperty, textShadowProperty, textStrokeProperty, letterSpacingProperty, lineHeightProperty, maxLinesProperty } from './text-base-common';
import { Color } from '../../color';
import { FormattedString } from './formatted-string';
import { Span } from './span';
import { colorProperty, fontInternalProperty, fontScaleInternalProperty } from '../styling/style-properties';
import { StrokeCSSValues } from '../styling/css-stroke';
import { CoreTypes } from '../../core-types';
export * from './text-base-common';
export declare class TextBase extends TextBaseCommon {
[textProperty.getDefault]: () => number | symbol;
[textProperty.setNative]: (value: string | number | symbol) => void;
[formattedTextProperty.setNative]: (value: FormattedString) => void;
[colorProperty.getDefault]: () => UIColor;
[colorProperty.setNative]: (value: Color | UIColor) => void;
[fontInternalProperty.getDefault]: () => UIFont;
[fontInternalProperty.setNative]: (value: Font | UIFont) => void;
[fontScaleInternalProperty.setNative]: (value: number) => void;
[iosAccessibilityAdjustsFontSizeProperty.setNative]: (value: boolean) => void;
[iosAccessibilityMinFontScaleProperty.setNative]: (value: number) => void;
[iosAccessibilityMaxFontScaleProperty.setNative]: (value: number) => void;
[textAlignmentProperty.setNative]: (value: CoreTypes.TextAlignmentType) => void;
[textDecorationProperty.setNative]: (value: CoreTypes.TextDecorationType) => void;
[textTransformProperty.setNative]: (value: CoreTypes.TextTransformType) => void;
[textStrokeProperty.setNative]: (value: StrokeCSSValues) => void;
[letterSpacingProperty.setNative]: (value: number) => void;
[lineHeightProperty.setNative]: (value: number) => void;
[textShadowProperty.setNative]: (value: ShadowCSSValues) => void;
[maxLinesProperty.setNative]: (value: CoreTypes.MaxLinesType) => void;
nativeViewProtected: UITextField | UITextView | UILabel | UIButton;
_spanRanges: NSRange[];
private _tappable;
private _linkTapHandler;
private _tapGestureRecognizer;
get nativeTextViewProtected(): UITextField | UITextView | UILabel | UIButton;
initNativeView(): void;
disposeNativeView(): void;
_setTappableState(tappable: boolean): void;
_setColor(color: UIColor): void;
_animationWrap(fn: () => void): void;
_setNativeText(reset?: boolean): void;
createFormattedTextNative(value: FormattedString): NSMutableAttributedString;
getFormattedStringDetails(formattedString: FormattedString): {
spans: any[];
};
createMutableStringDetails(span: Span, text: string, index?: number): any;
createMutableStringForSpan(span: Span, text: string): NSMutableAttributedString;
getBaselineOffset(font: UIFont, align?: CoreTypes.VerticalAlignmentTextType): number;
_setShadow(value: ShadowCSSValues): void;
}
export declare function getTransformedText(text: string, textTransform: CoreTypes.TextTransformType): string;