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,63 +1,61 @@
|
||||
/**
|
||||
* Allows you to save and restore any kind of information related to your application.
|
||||
*/
|
||||
declare module "application-settings" {
|
||||
/**
|
||||
* Checks whether such a key exists.
|
||||
* @param key The key to check for.
|
||||
*/
|
||||
export function hasKey(key: string): boolean;
|
||||
/**
|
||||
* Checks whether such a key exists.
|
||||
* @param key The key to check for.
|
||||
*/
|
||||
export function hasKey(key: string): boolean;
|
||||
|
||||
/**
|
||||
* Gets a value (if existing) for a key as a Boolean Object. A default value can be provided in case there is no existing value.
|
||||
* @param key The key to check for.
|
||||
* @param defaultValue An optional value to be returned in case there is no existing value.
|
||||
*/
|
||||
export function getBoolean(key: string, defaultValue?: boolean): boolean;
|
||||
/**
|
||||
* Gets a value (if existing) for a key as a Boolean Object. A default value can be provided in case there is no existing value.
|
||||
* @param key The key to check for.
|
||||
* @param defaultValue An optional value to be returned in case there is no existing value.
|
||||
*/
|
||||
export function getBoolean(key: string, defaultValue?: boolean): boolean;
|
||||
|
||||
/**
|
||||
* Gets a value (if existing) for a key as a String Object. A default value can be provided in case there is no existing value.
|
||||
* @param key The key to check for.
|
||||
* @param defaultValue An optional value to be returned in case there is no existing value.
|
||||
*/
|
||||
export function getString(key: string, defaultValue?: string): string;
|
||||
/**
|
||||
* Gets a value (if existing) for a key as a String Object. A default value can be provided in case there is no existing value.
|
||||
* @param key The key to check for.
|
||||
* @param defaultValue An optional value to be returned in case there is no existing value.
|
||||
*/
|
||||
export function getString(key: string, defaultValue?: string): string;
|
||||
|
||||
/**
|
||||
* Gets a value (if existing) for a key as a Number Object. A default value can be provided in case there is no existing value.
|
||||
* @param key The key to check for.
|
||||
* @param defaultValue An optional value to be returned in case there is no existing value.
|
||||
*/
|
||||
export function getNumber(key: string, defaultValue?: number): number;
|
||||
/**
|
||||
* Gets a value (if existing) for a key as a Number Object. A default value can be provided in case there is no existing value.
|
||||
* @param key The key to check for.
|
||||
* @param defaultValue An optional value to be returned in case there is no existing value.
|
||||
*/
|
||||
export function getNumber(key: string, defaultValue?: number): number;
|
||||
|
||||
/**
|
||||
* Sets a Boolean Object for a key.
|
||||
* @param key The key.
|
||||
* @param value The value.
|
||||
*/
|
||||
export function setBoolean(key: string, value: boolean): void;
|
||||
/**
|
||||
* Sets a Boolean Object for a key.
|
||||
* @param key The key.
|
||||
* @param value The value.
|
||||
*/
|
||||
export function setBoolean(key: string, value: boolean): void;
|
||||
|
||||
/**
|
||||
* Sets a String Object for a key.
|
||||
* @param key The key.
|
||||
* @param value The value.
|
||||
*/
|
||||
export function setString(key: string, value: string): void;
|
||||
/**
|
||||
* Sets a String Object for a key.
|
||||
* @param key The key.
|
||||
* @param value The value.
|
||||
*/
|
||||
export function setString(key: string, value: string): void;
|
||||
|
||||
/**
|
||||
* Sets a Number Object for a key.
|
||||
* @param key The key.
|
||||
* @param value The value.
|
||||
*/
|
||||
export function setNumber(key: string, value: number): void;
|
||||
/**
|
||||
* Sets a Number Object for a key.
|
||||
* @param key The key.
|
||||
* @param value The value.
|
||||
*/
|
||||
export function setNumber(key: string, value: number): void;
|
||||
|
||||
/**
|
||||
* Removes a value (if existing) for a key.
|
||||
* @param key The key to check for.
|
||||
*/
|
||||
export function remove(key: string): void;
|
||||
/**
|
||||
* Removes a value (if existing) for a key.
|
||||
* @param key The key to check for.
|
||||
*/
|
||||
export function remove(key: string): void;
|
||||
|
||||
/**
|
||||
* Removes all values.
|
||||
*/
|
||||
export function clear(): void;
|
||||
}
|
||||
/**
|
||||
* Removes all values.
|
||||
*/
|
||||
export function clear(): void;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"name" : "application-settings",
|
||||
"main" : "application-settings",
|
||||
"nativescript": {}
|
||||
"name" : "application-settings",
|
||||
"main" : "application-settings",
|
||||
"types": "application-settings.d.ts",
|
||||
"nativescript": {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user