chore: update tslint rules (#7391)

This commit is contained in:
Manol Donev
2019-06-26 15:13:48 +03:00
committed by GitHub
parent 92370279d8
commit 4f39fb728b
399 changed files with 3101 additions and 2210 deletions

View File

@@ -1,4 +1,4 @@
import {
import {
write as traceWrite, categories as traceCategories, messageType as traceMessageType
} from "../trace";
@@ -40,6 +40,7 @@ export module layout {
nativeSize.width = layoutCommon.round(toDevicePixels(nativeSize.width));
nativeSize.height = layoutCommon.round(toDevicePixels(nativeSize.height));
return nativeSize;
}
}
@@ -81,6 +82,7 @@ export module ios {
const device = UIDevice.currentDevice;
const statusBarOrientation = UIApplication.sharedApplication.statusBarOrientation;
const isStatusBarOrientationLandscape = isOrientationLandscape(statusBarOrientation);
return isOrientationLandscape(device.orientation) || isStatusBarOrientationLandscape;
}
@@ -89,15 +91,17 @@ export module ios {
export function openFile(filePath: string): boolean {
try {
const appPath = getCurrentAppPath();
const path = filePath.replace("~", appPath)
const path = filePath.replace("~", appPath);
const controller = UIDocumentInteractionController.interactionControllerWithURL(NSURL.fileURLWithPath(path));
controller.delegate = new UIDocumentInteractionControllerDelegateImpl();
return controller.presentPreviewAnimated(true);
}
catch (e) {
traceWrite("Error in openFile", traceCategories.Error, traceMessageType.error);
}
return false;
}
@@ -161,6 +165,7 @@ export function openUrl(location: string): boolean {
// We Don't do anything with an error. We just output it
traceWrite("Error in OpenURL", traceCategories.Error, traceMessageType.error);
}
return false;
}
@@ -169,6 +174,7 @@ class UIDocumentInteractionControllerDelegateImpl extends NSObject implements UI
public getViewController(): UIViewController {
const app = UIApplication.sharedApplication;
return app.keyWindow.rootViewController;
}