chore: update deprecations (#7046)

This commit is contained in:
Manol Donev
2019-03-21 14:25:36 +02:00
committed by GitHub
parent 4d3ecb9229
commit cf07b2719f
12 changed files with 38 additions and 18 deletions

View File

@@ -49,6 +49,7 @@ export class AndroidApplication extends Observable implements AndroidApplication
private callbacks: any = {};
public get currentContext(): android.content.Context {
console.log("application.currentContext is deprecated; use startActivity, foregroundActivity, or context instead");
return this.foregroundActivity;
}
@@ -131,6 +132,8 @@ let started = false;
// NOTE: for backwards compatibility. Remove for 4.0.0.
const createRootFrame = { value: true };
export function start(entry?: NavigationEntry | string) {
console.log("application.start() is deprecated; use application.run() instead");
if (started) {
throw new Error("Application is already started.");
}

View File

@@ -186,7 +186,8 @@ export function on(event: "livesync", callback: (args: EventData) => void);
export function off(eventNames: string, callback?: any, thisArg?: any);
/**
* Deprecated. Use application run.
* @deprecated use application.run() instead.
*
* Call this method to start the application. Important: All code after this method call will not be executed!
*/
export function start(entry?: NavigationEntry | string);
@@ -400,7 +401,7 @@ export class AndroidApplication extends Observable {
foregroundActivity: any /* android.support.v7.app.AppCompatActivity */;
/**
* Deprecated. Please use startActivity, foregroundActivity or context property.
* @deprecated use startActivity, foregroundActivity or context instead
*/
currentContext: any /* android.content.Context */;

View File

@@ -301,6 +301,8 @@ export function getRootView() {
const createRootFrame = { value: true };
let started: boolean = false;
export function start(entry?: string | NavigationEntry) {
console.log("application.start() is deprecated; use application.run() instead");
mainEntry = typeof entry === "string" ? { moduleName: entry } : entry;
started = true;

View File

@@ -246,6 +246,8 @@ export function fromNativeSource(source: any): ImageSource {
}
export function fromUrl(url: string): Promise<ImageSourceDefinition> {
console.log("imageSource.fromUrl(url) is deprecated; use http.getImage(url) instead");
ensureHttp();
return http.getImage(url);
}

View File

@@ -148,10 +148,11 @@ export function fromBase64(source: string): ImageSource;
export function fromNativeSource(source: any): ImageSource;
/**
* Deprecated. Use http.getImage(url: string) instead.
* Downloads the image from the provided Url and creates a new ImageSource instance from it.
* @param url The link to the remote image object. This operation will download and decode the image.
*/
* @deprecated use http.getImage(url: string) instead
*
* Downloads the image from the provided Url and creates a new ImageSource instance from it.
* @param url The link to the remote image object. This operation will download and decode the image.
*/
export function fromUrl(url: string): Promise<ImageSource>;
/**

View File

@@ -236,6 +236,8 @@ export function fromNativeSource(source: any): ImageSource {
}
export function fromUrl(url: string): Promise<ImageSource> {
console.log("imageSource.fromUrl(url) is deprecated; use http.getImage(url) instead");
ensureHttp();
return http.getImage(url);
}

View File

@@ -7,7 +7,8 @@ import { Page } from "../page";
import { NavigationEntry } from "../frame";
/**
* Deprecated. Use createViewFromEntry instead.
* @deprecated use createViewFromEntry instead
*
* @param moduleNamePath
* @param fileName
* @param moduleExports

View File

@@ -159,7 +159,8 @@ export abstract class ViewBase extends Observable {
//@endprivate
/**
* @deprecated Use showModal with ShowModalOptions instead.
* @deprecated use showModal with ShowModalOptions instead
*
* Shows the View contained in moduleName as a modal view.
* @param moduleName - The name of the module to load starting from the application root.
* @param context - Any context you want to pass to the modally shown view.
@@ -173,7 +174,8 @@ export abstract class ViewBase extends Observable {
showModal(moduleName: string, context: any, closeCallback: Function, fullscreen?: boolean, animated?: boolean, stretched?: boolean): ViewBase;
/**
* @deprecated Use showModal with ShowModalOptions instead.
* @deprecated use showModal with ShowModalOptions instead
*
* Shows the view passed as parameter as a modal view.
* @param view - View instance to be shown modally.
* @param context - Any context you want to pass to the modally shown view. This same context will be available in the arguments of the shownModally event handler.
@@ -199,8 +201,7 @@ export abstract class ViewBase extends Observable {
showModal(view: ViewBase, modalOptions: ShowModalOptions): ViewBase;
/**
* Deprecated. Showing view as modal is deprecated.
* Use showModal method with arguments.
* @deprecated use showModal method with arguments
*/
showModal(): ViewBase;
@@ -365,9 +366,10 @@ export abstract class ViewBase extends Observable {
public _goToVisualState(state: string): void;
/**
* @deprecated
*
* This used to be the way to set attribute values in early {N} versions.
* Now attributes are expected to be set as plain properties on the view instances.
* @deprecated
*/
public _applyXmlAttribute(attribute, value): boolean;
public setInlineStyle(style: string): void;

View File

@@ -866,9 +866,10 @@ export abstract class ViewBase extends Observable implements ViewBaseDefinition
}
/**
* @deprecated
*
* This used to be the way to set attribute values in early {N} versions.
* Now attributes are expected to be set as plain properties on the view instances.
* @deprecated
*/
public _applyXmlAttribute(attribute: string, value: string): boolean {
if (attribute === "style" || attribute === "rows" || attribute === "columns" || attribute === "fontAttributes") {

View File

@@ -473,7 +473,8 @@ export abstract class View extends ViewBase {
public getGestureObservers(type: GestureTypes): Array<GesturesObserver>;
/**
* [Deprecated. Please use the on() instead.] Adds a gesture observer.
* @deprecated use on() instead
*
* @param type - Type of the gesture.
* @param callback - A function that will be executed when gesture is received.
* @param thisArg - An optional parameter which will be used as `this` context for callback execution.

View File

@@ -15,7 +15,8 @@ export * from "../page";
*/
export class Frame extends View {
/**
* Deprecated.
* @deprecated
*
* String value used when hooking to androidOptionSelected event (prefix `android` states that this event is available only in Android).
*/
public static androidOptionSelectedEvent: string;
@@ -208,7 +209,8 @@ export function topmost(): Frame;
export function goBack();
/**
* Deprecated. Use getFrameById() if you want to retrieve a frame different than the topmost one.
* @deprecated use getFrameById() if you want to retrieve a frame different than the topmost one
*
* Gets the frames stack.
*/
export function stack(): Array<Frame>;
@@ -395,8 +397,9 @@ export interface AndroidFrame extends Observable {
showActionBar: boolean;
/**
* @deprecated this property is not used internally
*
* Gets or sets whether the page UI will be cached when navigating away from the page.
* Deprecated. This property is not used internally.
*/
cachePagesOnNavigate: boolean;

View File

@@ -11,7 +11,8 @@ export module ios {
export function getActualHeight(uiView: any /* UIView */): number;
/**
* Deprecated.
* @deprecated
*
* @param rootView
* @param parentBounds
*/