mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
No more ambient modules for tns-core-modules/* subpackages.
- Use path mappings in tsconfig.json to resolve module typings - Only use ambient mobules for global API's - Move single-file modules to a subdir with the same name so that we can provide a hand-written typing next to it (via package.json) - Delete all mentions of tns-core-modules.d.ts - Delete reference d.ts assembly build steps. Not needed anymore. - HACK! Use a <reference> for global typings in application.d.ts to avoid publishing a separate @types/tns-core-modules package. - Rename declarations.d.ts to tns-core-modules.d.ts to preserve JS project mappings in references.d.ts (the only place we use those)
This commit is contained in:
committed by
Hristo Deshev
parent
1af8c6ca8e
commit
b45cbe929b
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"name" : "platform",
|
||||
"main" : "platform",
|
||||
"nativescript": {}
|
||||
"name" : "platform",
|
||||
"main" : "platform",
|
||||
"types" : "platform.d.ts",
|
||||
"nativescript": {}
|
||||
}
|
||||
|
||||
238
tns-core-modules/platform/platform.d.ts
vendored
238
tns-core-modules/platform/platform.d.ts
vendored
@@ -2,127 +2,125 @@
|
||||
/**
|
||||
* Contains all kinds of information about the device, its operating system and software.
|
||||
*/
|
||||
declare module "platform" {
|
||||
|
||||
/**
|
||||
* Gets a value indicating if the app is running on the Android platform.
|
||||
*/
|
||||
export var isAndroid: boolean;
|
||||
|
||||
/**
|
||||
* Gets a value indicating if the app is running on the iOS platform.
|
||||
*/
|
||||
export var isIOS: boolean;
|
||||
|
||||
/*
|
||||
* Enum holding platform names.
|
||||
*/
|
||||
export module platformNames {
|
||||
export var android: string;
|
||||
export var ios: string;
|
||||
}
|
||||
/**
|
||||
* Gets a value indicating if the app is running on the Android platform.
|
||||
*/
|
||||
export var isAndroid: boolean;
|
||||
|
||||
/*
|
||||
* An object containing device specific information.
|
||||
*/
|
||||
export interface Device {
|
||||
/**
|
||||
* Gets the manufacturer of the device.
|
||||
* For example: "Apple" or "HTC" or "Samsung".
|
||||
*/
|
||||
manufacturer: string;
|
||||
/**
|
||||
* Gets a value indicating if the app is running on the iOS platform.
|
||||
*/
|
||||
export var isIOS: boolean;
|
||||
|
||||
/**
|
||||
* Gets the model of the device.
|
||||
* For example: "Nexus 5" or "iPhone".
|
||||
*/
|
||||
model: string;
|
||||
|
||||
/**
|
||||
* Gets the model of the device.
|
||||
* For example: "Android" or "iOS".
|
||||
*/
|
||||
os: string;
|
||||
|
||||
/**
|
||||
* Gets the OS version.
|
||||
* For example: 4.4.4(android), 8.1(ios)
|
||||
*/
|
||||
osVersion: string;
|
||||
|
||||
/**
|
||||
* Gets the OS version.
|
||||
* For example: 19(android), 8.1(ios).
|
||||
*/
|
||||
sdkVersion: string;
|
||||
|
||||
/**
|
||||
* Gets the type current device.
|
||||
* Available values: "phone", "tablet".
|
||||
*/
|
||||
deviceType: "Phone" | "Tablet";
|
||||
|
||||
/**
|
||||
* Gets the uuid.
|
||||
* On iOS this will return a new uuid if the application re-installed on the device.
|
||||
* If you need to receive the same uuid even after the application has been re-installed on the device,
|
||||
* use this plugin: https://www.npmjs.com/package/nativescript-ios-uuid
|
||||
*/
|
||||
uuid: string;
|
||||
|
||||
/**
|
||||
* Gets the preferred language. For example "en"
|
||||
*/
|
||||
language: string;
|
||||
|
||||
/**
|
||||
* Gets the preferred region. For example "US"
|
||||
*/
|
||||
region: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* An object containing screen information.
|
||||
*/
|
||||
export interface ScreenMetrics {
|
||||
/**
|
||||
* Gets the absolute width of the screen in pixels.
|
||||
*/
|
||||
widthPixels: number;
|
||||
|
||||
/**
|
||||
* Gets the absolute height of the screen in pixels.
|
||||
*/
|
||||
heightPixels: number;
|
||||
|
||||
/**
|
||||
* Gets the absolute width of the screen in density independent pixels.
|
||||
*/
|
||||
widthDIPs: number;
|
||||
|
||||
/**
|
||||
* Gets the absolute height of the screen in density independent pixels.
|
||||
*/
|
||||
heightDIPs: number;
|
||||
|
||||
/**
|
||||
* The logical density of the display. This is a scaling factor for the Density Independent Pixel unit.
|
||||
*/
|
||||
scale: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* An object describing general information about a display.
|
||||
*/
|
||||
export module screen {
|
||||
/**
|
||||
* Gets information about the main screen of the current device.
|
||||
*/
|
||||
export var mainScreen: ScreenMetrics;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the current device information
|
||||
*/
|
||||
export var device: Device;
|
||||
/*
|
||||
* Enum holding platform names.
|
||||
*/
|
||||
export module platformNames {
|
||||
export var android: string;
|
||||
export var ios: string;
|
||||
}
|
||||
|
||||
/*
|
||||
* An object containing device specific information.
|
||||
*/
|
||||
export interface Device {
|
||||
/**
|
||||
* Gets the manufacturer of the device.
|
||||
* For example: "Apple" or "HTC" or "Samsung".
|
||||
*/
|
||||
manufacturer: string;
|
||||
|
||||
/**
|
||||
* Gets the model of the device.
|
||||
* For example: "Nexus 5" or "iPhone".
|
||||
*/
|
||||
model: string;
|
||||
|
||||
/**
|
||||
* Gets the model of the device.
|
||||
* For example: "Android" or "iOS".
|
||||
*/
|
||||
os: string;
|
||||
|
||||
/**
|
||||
* Gets the OS version.
|
||||
* For example: 4.4.4(android), 8.1(ios)
|
||||
*/
|
||||
osVersion: string;
|
||||
|
||||
/**
|
||||
* Gets the OS version.
|
||||
* For example: 19(android), 8.1(ios).
|
||||
*/
|
||||
sdkVersion: string;
|
||||
|
||||
/**
|
||||
* Gets the type current device.
|
||||
* Available values: "phone", "tablet".
|
||||
*/
|
||||
deviceType: "Phone" | "Tablet";
|
||||
|
||||
/**
|
||||
* Gets the uuid.
|
||||
* On iOS this will return a new uuid if the application re-installed on the device.
|
||||
* If you need to receive the same uuid even after the application has been re-installed on the device,
|
||||
* use this plugin: https://www.npmjs.com/package/nativescript-ios-uuid
|
||||
*/
|
||||
uuid: string;
|
||||
|
||||
/**
|
||||
* Gets the preferred language. For example "en"
|
||||
*/
|
||||
language: string;
|
||||
|
||||
/**
|
||||
* Gets the preferred region. For example "US"
|
||||
*/
|
||||
region: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* An object containing screen information.
|
||||
*/
|
||||
export interface ScreenMetrics {
|
||||
/**
|
||||
* Gets the absolute width of the screen in pixels.
|
||||
*/
|
||||
widthPixels: number;
|
||||
|
||||
/**
|
||||
* Gets the absolute height of the screen in pixels.
|
||||
*/
|
||||
heightPixels: number;
|
||||
|
||||
/**
|
||||
* Gets the absolute width of the screen in density independent pixels.
|
||||
*/
|
||||
widthDIPs: number;
|
||||
|
||||
/**
|
||||
* Gets the absolute height of the screen in density independent pixels.
|
||||
*/
|
||||
heightDIPs: number;
|
||||
|
||||
/**
|
||||
* The logical density of the display. This is a scaling factor for the Density Independent Pixel unit.
|
||||
*/
|
||||
scale: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* An object describing general information about a display.
|
||||
*/
|
||||
export module screen {
|
||||
/**
|
||||
* Gets information about the main screen of the current device.
|
||||
*/
|
||||
export var mainScreen: ScreenMetrics;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the current device information
|
||||
*/
|
||||
export var device: Device;
|
||||
|
||||
Reference in New Issue
Block a user