chore: fix types

This commit is contained in:
Nathan Walker
2021-03-26 16:32:24 -07:00
parent eb7c1c450a
commit 266ae2a71d
14 changed files with 42 additions and 38 deletions

View File

@ -6,7 +6,7 @@ import { Animation, AnimationDefinition, AnimationPromise } from '../../animatio
import { GestureTypes, GesturesObserver } from '../../gestures';
import { LinearGradient } from '../../styling/gradient';
import { AccessibilityLiveRegion, AccessibilityRole, AccessibilityState, AccessibilityTrait, AccessibilityEventOptions } from '../../../accessibility/accessibility-types';
import { CoreTypes } from '../../core-types';
import { CoreTypes } from '../../../core-types';
import { CSSShadow } from '../../styling/css-shadow';
// helpers (these are okay re-exported here)

View File

@ -31,7 +31,7 @@ export class EditableTextBase extends TextBase {
/**
* Gets or sets the autocapitalization type.
*/
autocapitalizationType: CoreTypes.AutocapitalizationType;
autocapitalizationType: CoreTypes.AutocapitalizationInputType;
/**
* Gets or sets whether the instance is editable.

View File

@ -37,7 +37,7 @@ export class Image extends View {
/**
* Gets or sets the image stretch mode.
*/
stretch: Stretch;
stretch: CoreTypes.ImageStretchType;
/**
* Gets or sets the loading strategy for images on the local file system:
@ -56,13 +56,13 @@ export class Image extends View {
* Gets or sets the desired decode height of the image.
* This property is Android specific.
*/
decodeHeight: Length;
decodeHeight: CoreTypes.LengthType;
/**
* Gets or sets the desired decode width of the image.
* This property is Android specific.
*/
decodeWidth: Length;
decodeWidth: CoreTypes.LengthType;
}
export const imageSourceProperty: Property<Image, ImageSource>;
@ -71,5 +71,5 @@ export const isLoadingProperty: Property<Image, string>;
export const loadMode: Property<Image, 'sync' | 'async'>;
export const stretchProperty: Property<Image, CoreTypes.ImageStretchType>;
export const tintColorProperty: InheritedCssProperty<Style, Color>;
export const decodeHeightProperty: Property<Image, Length>;
export const decodeWidthProperty: Property<Image, Length>;
export const decodeHeightProperty: Property<Image, CoreTypes.LengthType>;
export const decodeWidthProperty: Property<Image, CoreTypes.LengthType>;

View File

@ -2,6 +2,7 @@
import { Property } from '../../core/properties';
import { View } from '../../core/view';
import { Length } from '../../styling/style-properties';
import { CoreTypes } from '../../../core-types';
/**
* A layout that lets you specify exact locations (left/top coordinates) of its children.
@ -10,7 +11,7 @@ export class AbsoluteLayout extends LayoutBase {
/**
* Gets the value of the Left property from a given View.
*/
static getLeft(view: View): Length;
static getLeft(view: View): CoreTypes.LengthType;
/**
* Sets the value of the Left property from a given View.
@ -20,20 +21,20 @@ export class AbsoluteLayout extends LayoutBase {
/**
* Gets the value of the Top property from a given View.
*/
static getTop(view: View): Length;
static getTop(view: View): CoreTypes.LengthType;
/**
* Sets the value of the Top property from a given View.
*/
static setTop(view: View, value: Length): void;
static setTop(view: View, value: CoreTypes.LengthType): void;
}
/**
* Represents the observable property backing the left property.
*/
export const leftProperty: Property<View, Length>;
export const leftProperty: Property<View, CoreTypes.LengthType>;
/**
* Represents the observable property backing the top property.
*/
export const topProperty: Property<View, Length>;
export const topProperty: Property<View, CoreTypes.LengthType>;

View File

@ -10,12 +10,12 @@ export class DockLayout extends LayoutBase {
/**
* Gets the value of the Dock property from a given View.
*/
static getDock(view: View): Dock;
static getDock(view: View): CoreTypes.DockType;
/**
* Sets the value of the Dock property from a given View.
*/
static setDock(view: View, value: Dock): void;
static setDock(view: View, value: CoreTypes.DockType): void;
/**
* Gets or sets a value that indicates whether the last child element within a DockLayout stretches to fill the remaining available space.

View File

@ -1,6 +1,5 @@
import { GridLayout } from '../grid-layout';
import { View } from '../../core/view';
import { AnimationCurve } from '../../../core-types';
export class RootLayout extends GridLayout {
open(view: View, options?: RootLayoutOptions): Promise<void>;

View File

@ -1,6 +1,6 @@
import { LayoutBase } from '../layout-base';
import { Property } from '../../core/properties';
import { CoreTypes } from '../../core-types';
import { CoreTypes } from '../../../core-types';
/**
* A Layout that arranges its children horizontally or vertically. The direction can be set by orientation property.

View File

@ -1,6 +1,7 @@
import { LayoutBase } from '../layout-base';
import { Length } from '../../styling/style-properties';
import { Property } from '../../core/properties';
import { CoreTypes } from '../../../core-types';
/**
* WrapLayout position children in rows or columns depending on orientation property
@ -11,32 +12,32 @@ export class WrapLayout extends LayoutBase {
* Gets or sets the flow direction. Default value is horizontal.
* If orientation is horizontal items are arranged in rows, else items are arranged in columns.
*/
orientation: Orientation;
orientation: CoreTypes.OrientationType;
/**
* Gets or sets the width used to measure and layout each child.
* Default value is Number.NaN which does not restrict children.
*/
itemWidth: Length;
itemWidth: CoreTypes.LengthType;
/**
* Gets or sets the height used to measure and layout each child.
* Default value is Number.NaN which does not restrict children.
*/
itemHeight: Length;
itemHeight: CoreTypes.LengthType;
}
/**
* Represents the observable property backing the orientation property of each WrapLayout instance.
*/
export const orientationProperty: Property<WrapLayout, Orientation>;
export const orientationProperty: Property<WrapLayout, CoreTypes.OrientationType>;
/**
* Represents the observable property backing the itemWidth property of each WrapLayout instance.
*/
export const itemWidthProperty: Property<WrapLayout, Length>;
export const itemWidthProperty: Property<WrapLayout, CoreTypes.LengthType>;
/**
* Represents the observable property backing the itemHeight property of each WrapLayout instance.
*/
export const itemHeightProperty: Property<WrapLayout, Length>;
export const itemHeightProperty: Property<WrapLayout, CoreTypes.LengthType>;

View File

@ -1,5 +1,6 @@
import { View, Template, KeyedTemplate } from '../core/view';
import { Color } from '../../color';
import { CoreTypes } from '../../core-types';
import { EventData } from '../../data/observable';
import { Length } from '../styling/style-properties';
import { Style } from '../styling/style';
@ -66,13 +67,13 @@ export class ListView extends View {
/**
* Gets or set row height of the ListView.
*/
rowHeight: Length;
rowHeight: CoreTypes.LengthType;
/**
* Gets or set the estimated height of rows in the ListView.
* The default value is 44px.
*/
iosEstimatedRowHeight: Length;
iosEstimatedRowHeight: CoreTypes.LengthType;
/**
* Forces the ListView to reload all its items.

View File

@ -1,6 +1,7 @@
import { ContentView } from '../content-view';
import { Property } from '../core/properties';
import { EventData } from '../../data/observable';
import { CoreTypes } from '../../core-types';
/**
* Represents a scrollable area that can have content that is larger than its bounds.
@ -58,7 +59,7 @@ export class ScrollView extends ContentView {
/**
* Gets or sets direction in which the content can be scrolled.
*/
orientation: Orientation;
orientation: CoreTypes.OrientationType;
/**
* A basic method signature to hook an event listener (shortcut alias to the addEventListener method).
@ -81,4 +82,4 @@ export interface ScrollEventData extends EventData {
scrollY: number;
}
export const orientationProperty: Property<ScrollView, Orientation>;
export const orientationProperty: Property<ScrollView, CoreTypes.OrientationType>;

View File

@ -1,4 +1,4 @@
import { LengthPercentUnit } from './style-properties';
import { CoreTypes } from '../../core-types';
import { Color } from '../../color';
import { LinearGradient as LinearGradientDefinition } from '../../css/parser';
@ -13,5 +13,5 @@ export class LinearGradient {
export interface ColorStop {
color: Color;
offset?: LengthPercentUnit;
offset?: CoreTypes.LengthPercentUnit;
}

View File

@ -7,6 +7,7 @@ import { ViewBase } from '../core/view-base';
import { Property, CssProperty } from '../core/properties';
import { EventData } from '../../data/observable';
import { Color } from '../../color';
import { CoreTypes } from '../../core-types';
import { Style } from '../styling/style';
import { TextTransform } from '../text-base';
/**
@ -31,7 +32,7 @@ export class TabViewItem extends ViewBase {
/**
* Gets or sets the text transform of the tab titles.
*/
textTransform: TextTransform;
textTransform: CoreTypes.TextTransformType;
/**
* @private

View File

@ -66,27 +66,27 @@ export class TextBase extends View implements AddChildFromBuilder {
/**
* Gets or sets padding style property.
*/
padding: string | Length;
padding: string | CoreTypes.LengthType;
/**
* Specify the bottom padding of this layout.
*/
paddingBottom: Length;
paddingBottom: CoreTypes.LengthType;
/**
* Specify the left padding of this layout.
*/
paddingLeft: Length;
paddingLeft: CoreTypes.LengthType;
/**
* Specify the right padding of this layout.
*/
paddingRight: Length;
paddingRight: CoreTypes.LengthType;
/**
* Specify the top padding of this layout.
*/
paddingTop: Length;
paddingTop: CoreTypes.LengthType;
/**
* Called for every child element declared in xml.

View File

@ -1,4 +1,4 @@
import { dip, px } from '../ui/core/view';
import { CoreTypes } from '../core-types';
export * from './mainthread-helper';
export * from './macrotask-scheduler';
@ -68,19 +68,19 @@ export namespace layout {
* Convert device independent pixels to device pixels - dip to px.
* @param value - The pixel to convert.
*/
export function toDevicePixels(value: dip): px;
export function toDevicePixels(value: CoreTypes.dip): CoreTypes.px;
/**
* Convert device pixels to device independent pixels - px to dip.
* @param value - The pixel to convert.
*/
export function toDeviceIndependentPixels(value: px): dip;
export function toDeviceIndependentPixels(value: CoreTypes.px): CoreTypes.dip;
/**
* Rounds value used in layout.
* @param px to round.
*/
export function round(px: px): px;
export function round(px: CoreTypes.px): CoreTypes.px;
/**
* Converts device pixels to device independent pixes and measure the nativeView.