mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 21:01:34 +08:00
renamed folders with lower cases and renamed user preferences to local settings
This commit is contained in:
@ -1,2 +0,0 @@
|
||||
declare var module, require;
|
||||
module.exports = require("Application/application");
|
102
BCL.csproj
102
BCL.csproj
@ -77,66 +77,67 @@
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
<ItemGroup>
|
||||
<TypeScriptCompile Include="Application\application.android.ts">
|
||||
<TypeScriptCompile Include="application\application.android.ts">
|
||||
<DependentUpon>application.d.ts</DependentUpon>
|
||||
</TypeScriptCompile>
|
||||
<TypeScriptCompile Include="Application\application_common.ts">
|
||||
<TypeScriptCompile Include="application\application_common.ts">
|
||||
<DependentUpon>application.d.ts</DependentUpon>
|
||||
</TypeScriptCompile>
|
||||
<TypeScriptCompile Include="Application\application.d.ts" />
|
||||
<TypeScriptCompile Include="Application\application.ios.ts">
|
||||
<TypeScriptCompile Include="application\application.d.ts" />
|
||||
<TypeScriptCompile Include="application\application.ios.ts">
|
||||
<DependentUpon>application.d.ts</DependentUpon>
|
||||
</TypeScriptCompile>
|
||||
<TypeScriptCompile Include="Console\console.ts">
|
||||
<TypeScriptCompile Include="console\console.ts">
|
||||
<DependentUpon>console.d.ts</DependentUpon>
|
||||
</TypeScriptCompile>
|
||||
<TypeScriptCompile Include="Console\console_helper.android.ts">
|
||||
<TypeScriptCompile Include="console\console_helper.android.ts">
|
||||
<DependentUpon>console_helper.d.ts</DependentUpon>
|
||||
</TypeScriptCompile>
|
||||
<TypeScriptCompile Include="Console\console_helper.d.ts" />
|
||||
<TypeScriptCompile Include="Console\console_helper.ios.ts">
|
||||
<TypeScriptCompile Include="console\console_helper.d.ts" />
|
||||
<TypeScriptCompile Include="console\console_helper.ios.ts">
|
||||
<DependentUpon>console_helper.d.ts</DependentUpon>
|
||||
</TypeScriptCompile>
|
||||
<TypeScriptCompile Include="declarations.d.ts" />
|
||||
<TypeScriptCompile Include="declarations.android.d.ts">
|
||||
<DependentUpon>declarations.d.ts</DependentUpon>
|
||||
</TypeScriptCompile>
|
||||
<TypeScriptCompile Include="Camera\camera.android.ts">
|
||||
<TypeScriptCompile Include="camera\camera.android.ts">
|
||||
<DependentUpon>camera.d.ts</DependentUpon>
|
||||
</TypeScriptCompile>
|
||||
<TypeScriptCompile Include="Camera\camera.d.ts" />
|
||||
<TypeScriptCompile Include="Camera\camera.ios.ts">
|
||||
<TypeScriptCompile Include="camera\camera.d.ts" />
|
||||
<TypeScriptCompile Include="camera\camera.ios.ts">
|
||||
<DependentUpon>camera.d.ts</DependentUpon>
|
||||
</TypeScriptCompile>
|
||||
<TypeScriptCompile Include="declarations.ios.d.ts">
|
||||
<DependentUpon>declarations.d.ts</DependentUpon>
|
||||
</TypeScriptCompile>
|
||||
<TypeScriptCompile Include="FileSystem\file_system.d.ts" />
|
||||
<TypeScriptCompile Include="FileSystem\file_system.ts">
|
||||
<TypeScriptCompile Include="filesystem\file_system.d.ts" />
|
||||
<TypeScriptCompile Include="filesystem\file_system.ts">
|
||||
<DependentUpon>file_system.d.ts</DependentUpon>
|
||||
</TypeScriptCompile>
|
||||
<TypeScriptCompile Include="FileSystem\file_system_access.android.ts">
|
||||
<TypeScriptCompile Include="filesystem\file_system_access.android.ts">
|
||||
<DependentUpon>file_system_access.d.ts</DependentUpon>
|
||||
</TypeScriptCompile>
|
||||
<TypeScriptCompile Include="FileSystem\file_system_access.d.ts" />
|
||||
<TypeScriptCompile Include="FileSystem\file_system_access.ios.ts">
|
||||
<TypeScriptCompile Include="filesystem\file_system_access.d.ts" />
|
||||
<TypeScriptCompile Include="filesystem\file_system_access.ios.ts">
|
||||
<DependentUpon>file_system_access.d.ts</DependentUpon>
|
||||
</TypeScriptCompile>
|
||||
<TypeScriptCompile Include="Image\image.ios.ts">
|
||||
<TypeScriptCompile Include="image\image.android.ts">
|
||||
<DependentUpon>image.d.ts</DependentUpon>
|
||||
</TypeScriptCompile>
|
||||
<TypeScriptCompile Include="Image\image.android.ts">
|
||||
<TypeScriptCompile Include="image\image.d.ts" />
|
||||
<TypeScriptCompile Include="image\image.ios.ts">
|
||||
<DependentUpon>image.d.ts</DependentUpon>
|
||||
</TypeScriptCompile>
|
||||
<TypeScriptCompile Include="Image\image.d.ts" />
|
||||
<TypeScriptCompile Include="Location\location.android.ts">
|
||||
<TypeScriptCompile Include="image\index.ts" />
|
||||
<TypeScriptCompile Include="location\location.android.ts">
|
||||
<DependentUpon>location.d.ts</DependentUpon>
|
||||
</TypeScriptCompile>
|
||||
<TypeScriptCompile Include="Location\location.d.ts" />
|
||||
<TypeScriptCompile Include="Location\location.ios.ts">
|
||||
<TypeScriptCompile Include="location\location.d.ts" />
|
||||
<TypeScriptCompile Include="location\location.ios.ts">
|
||||
<DependentUpon>location.d.ts</DependentUpon>
|
||||
</TypeScriptCompile>
|
||||
<TypeScriptCompile Include="Location\location_types.ts">
|
||||
<TypeScriptCompile Include="location\location_types.ts">
|
||||
<DependentUpon>location.d.ts</DependentUpon>
|
||||
</TypeScriptCompile>
|
||||
<TypeScriptCompile Include="Tests\file_system_tests.ts" />
|
||||
@ -153,16 +154,9 @@
|
||||
<TypeScriptCompile Include="text\text.ios.ts">
|
||||
<DependentUpon>text.d.ts</DependentUpon>
|
||||
</TypeScriptCompile>
|
||||
<TypeScriptCompile Include="UserPreferences\user_preferences.android.ts">
|
||||
<DependentUpon>user_preferences.d.ts</DependentUpon>
|
||||
</TypeScriptCompile>
|
||||
<TypeScriptCompile Include="UserPreferences\user_preferences.d.ts" />
|
||||
<TypeScriptCompile Include="UserPreferences\user_preferences.ios.ts">
|
||||
<DependentUpon>user_preferences.d.ts</DependentUpon>
|
||||
</TypeScriptCompile>
|
||||
<TypeScriptCompile Include="Utils\module_merge.ts" />
|
||||
<TypeScriptCompile Include="Utils\utils_android.ts" />
|
||||
<TypeScriptCompile Include="Utils\utils_ios.ts" />
|
||||
<TypeScriptCompile Include="utils\module_merge.ts" />
|
||||
<TypeScriptCompile Include="utils\utils_android.ts" />
|
||||
<TypeScriptCompile Include="utils\utils_ios.ts" />
|
||||
<TypeScriptCompile Include="http\http_request.android.ts">
|
||||
<DependentUpon>http_request.d.ts</DependentUpon>
|
||||
</TypeScriptCompile>
|
||||
@ -173,13 +167,11 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<TypeScriptCompile Include="http\index.ts" />
|
||||
<TypeScriptCompile Include="UserPreferences\index.ts" />
|
||||
<TypeScriptCompile Include="Location\index.ts" />
|
||||
<TypeScriptCompile Include="Image\index.ts" />
|
||||
<TypeScriptCompile Include="FileSystem\index.ts" />
|
||||
<TypeScriptCompile Include="Console\index.ts" />
|
||||
<TypeScriptCompile Include="Camera\index.ts" />
|
||||
<TypeScriptCompile Include="Application\index.ts" />
|
||||
<TypeScriptCompile Include="location\index.ts" />
|
||||
<TypeScriptCompile Include="filesystem\index.ts" />
|
||||
<TypeScriptCompile Include="console\index.ts" />
|
||||
<TypeScriptCompile Include="camera\index.ts" />
|
||||
<TypeScriptCompile Include="application\index.ts" />
|
||||
<TypeScriptCompile Include="android17.d.ts" />
|
||||
<TypeScriptCompile Include="promises\promises.ts" />
|
||||
<TypeScriptCompile Include="promises\index.ts" />
|
||||
@ -190,21 +182,28 @@
|
||||
<TypeScriptCompile Include="timer\timer.android.ts">
|
||||
<DependentUpon>timer.d.ts</DependentUpon>
|
||||
</TypeScriptCompile>
|
||||
<TypeScriptCompile Include="UserPreferences\user_preferences_common.ts">
|
||||
<DependentUpon>user_preferences.d.ts</DependentUpon>
|
||||
</TypeScriptCompile>
|
||||
<TypeScriptCompile Include="Console\console.d.ts" />
|
||||
<TypeScriptCompile Include="console\console.d.ts" />
|
||||
<TypeScriptCompile Include="timer\timer.d.ts" />
|
||||
<TypeScriptCompile Include="timer\timer.ios.ts">
|
||||
<DependentUpon>timer.d.ts</DependentUpon>
|
||||
</TypeScriptCompile>
|
||||
<TypeScriptCompile Include="Tests\user_preferences_tests.ts" />
|
||||
<TypeScriptCompile Include="Tests\local_settings_tests.ts" />
|
||||
<Content Include="image\Readme.md" />
|
||||
<Content Include="localsettings\index.ts" />
|
||||
<Content Include="localsettings\local_settings.android.ts">
|
||||
<DependentUpon>local_settings.d.ts</DependentUpon>
|
||||
</Content>
|
||||
<Content Include="localsettings\local_settings.d.ts" />
|
||||
<Content Include="localsettings\local_settings.ios.ts">
|
||||
<DependentUpon>local_settings.d.ts</DependentUpon>
|
||||
</Content>
|
||||
<Content Include="localsettings\local_settings_common.ts">
|
||||
<DependentUpon>local_settings.d.ts</DependentUpon>
|
||||
</Content>
|
||||
<Content Include="_references.ts" />
|
||||
<Content Include="Image\Readme.md" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<TypeScriptCompile Include="libjs.d.ts" />
|
||||
<Content Include="UserPreferences\Readme.md" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="http\Readme.md" />
|
||||
@ -213,17 +212,17 @@
|
||||
<Content Include="Readme.md" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Console\Readme.md" />
|
||||
<Content Include="console\Readme.md" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Deploy\Eclipse\" />
|
||||
<Folder Include="Deploy\xCode\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Location\Readme.md" />
|
||||
<Content Include="location\Readme.md" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Application\Readme.md" />
|
||||
<Content Include="application\Readme.md" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="globals\Readme.md" />
|
||||
@ -237,6 +236,9 @@
|
||||
<ItemGroup>
|
||||
<Content Include="Tests\Readme.md" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="localsettings\Readme.md" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)' == 'iOS'">
|
||||
<TypeScriptModuleKind>commonjs</TypeScriptModuleKind>
|
||||
<TypeScriptRemoveComments>True</TypeScriptRemoveComments>
|
||||
|
@ -1,2 +0,0 @@
|
||||
declare var module, require;
|
||||
module.exports = require("Console/console");
|
@ -1,2 +0,0 @@
|
||||
declare var module, require;
|
||||
module.exports = require("FileSystem/file_system");
|
@ -1,2 +0,0 @@
|
||||
declare var module, require;
|
||||
module.exports = require("Image/image");
|
@ -1,2 +0,0 @@
|
||||
declare var module, require;
|
||||
module.exports = require("Location/location");
|
@ -3,7 +3,7 @@
|
||||
// # File System
|
||||
// Using the file system requires the FileSystem module.
|
||||
// ``` JavaScript
|
||||
var fs = require("FileSystem");
|
||||
var fs = require("filesystem");
|
||||
// ```
|
||||
// The pre-required `fs` module is used throughout the following code snippets.
|
||||
// </snippet>
|
||||
|
137
Tests/local_settings_tests.ts
Normal file
137
Tests/local_settings_tests.ts
Normal file
@ -0,0 +1,137 @@
|
||||
|
||||
var TKUnit = require("Tests/TKUnit");
|
||||
var LocalSettings = require("localsettings");
|
||||
|
||||
var stringKey:string = "stringKey";
|
||||
var boolKey: string = "boolKey";
|
||||
var numberKey: string = "numberKey";
|
||||
var noStringKey: string = "noStringKey";
|
||||
var noBoolKey: string = "noBoolKey";
|
||||
var noNumberKey: string = "noNumberKey";
|
||||
|
||||
export var testBoolean = function () {
|
||||
LocalSettings.setBoolean(boolKey, false);
|
||||
TKUnit.assert(false == LocalSettings.getBoolean(boolKey), "Cannot set boolean to false, currently it is: " + LocalSettings.getBoolean(boolKey));
|
||||
|
||||
LocalSettings.setBoolean(boolKey, true);
|
||||
TKUnit.assert(true == LocalSettings.getBoolean(boolKey, false), "Cannot set boolean to true");
|
||||
|
||||
TKUnit.assert(true == LocalSettings.getBoolean(boolKey), "Cannot set boolean to true (no default)");
|
||||
};
|
||||
|
||||
export var testString = function () {
|
||||
LocalSettings.setString(stringKey, "String value");
|
||||
TKUnit.assert("String value" === LocalSettings.getString(stringKey), "Cannot set string value");
|
||||
};
|
||||
|
||||
export var testNumber = function () {
|
||||
LocalSettings.setNumber(numberKey, 54.321);
|
||||
var value = LocalSettings.getNumber(numberKey).toFixed(3);
|
||||
TKUnit.assert(54.321 == value, "Cannot set number value 54.321 != " + value);
|
||||
};
|
||||
|
||||
export var testDefaults = function () {
|
||||
TKUnit.assert("No string value" === LocalSettings.getString(noStringKey, "No string value"), "Bad default string value");
|
||||
TKUnit.assert(true === LocalSettings.getBoolean(noBoolKey, true), "Bad default boolean value");
|
||||
TKUnit.assert(123.45 === LocalSettings.getNumber(noNumberKey, 123.45), "Bad default number value");
|
||||
};
|
||||
|
||||
export var testHasKey = function () {
|
||||
TKUnit.assert(!LocalSettings.hasKey(noBoolKey), "There is a key: " + noBoolKey);
|
||||
TKUnit.assert(!LocalSettings.hasKey(noStringKey), "There is a key: " + noStringKey);
|
||||
TKUnit.assert(!LocalSettings.hasKey(noNumberKey), "There is a key: " + noNumberKey);
|
||||
|
||||
TKUnit.assert(LocalSettings.hasKey(boolKey), "There is no key: " + boolKey);
|
||||
TKUnit.assert(LocalSettings.hasKey(stringKey), "There is no key: " + stringKey);
|
||||
TKUnit.assert(LocalSettings.hasKey(numberKey), "There is no key: " + numberKey);
|
||||
};
|
||||
|
||||
export var testRemove = function () {
|
||||
LocalSettings.remove(boolKey);
|
||||
TKUnit.assert(!LocalSettings.hasKey(boolKey), "Failed to remove key: " + boolKey);
|
||||
|
||||
LocalSettings.remove(stringKey);
|
||||
TKUnit.assert(!LocalSettings.hasKey(stringKey), "Failed to remove key: " + stringKey);
|
||||
|
||||
LocalSettings.remove(numberKey);
|
||||
TKUnit.assert(!LocalSettings.hasKey(numberKey), "Failed to remove key: " + numberKey);
|
||||
};
|
||||
|
||||
export var testInvalidKey = function () {
|
||||
try {
|
||||
LocalSettings.hasKey(undefined);
|
||||
TKUnit.assert(false, "There is a key undefined");
|
||||
}
|
||||
catch (e) {
|
||||
// we should receive an exception here
|
||||
}
|
||||
|
||||
try {
|
||||
LocalSettings.hasKey(null);
|
||||
TKUnit.assert(false, "There is a key null");
|
||||
}
|
||||
catch (e) {
|
||||
// we should receive an exception here
|
||||
}
|
||||
|
||||
try {
|
||||
LocalSettings.hasKey(123);
|
||||
TKUnit.assert(false, "There is a key number");
|
||||
}
|
||||
catch (e) {
|
||||
// we should receive an exception here
|
||||
}
|
||||
|
||||
LocalSettings.hasKey("string");
|
||||
};
|
||||
|
||||
export var testInvalidValue = function () {
|
||||
try {
|
||||
LocalSettings.setBoolean(boolKey, "str");
|
||||
TKUnit.assert(false, "There is a key undefined");
|
||||
}
|
||||
catch (e) {
|
||||
// we should receive an exception here
|
||||
}
|
||||
|
||||
try {
|
||||
LocalSettings.setBoolean(boolKey, 123);
|
||||
TKUnit.assert(false, "There is a key undefined");
|
||||
}
|
||||
catch (e) {
|
||||
// we should receive an exception here
|
||||
}
|
||||
|
||||
try {
|
||||
LocalSettings.setString(boolKey, true);
|
||||
TKUnit.assert(false, "There is a key undefined");
|
||||
}
|
||||
catch (e) {
|
||||
// we should receive an exception here
|
||||
}
|
||||
|
||||
try {
|
||||
LocalSettings.setString(boolKey, 123);
|
||||
TKUnit.assert(false, "There is a key undefined");
|
||||
}
|
||||
catch (e) {
|
||||
// we should receive an exception here
|
||||
}
|
||||
|
||||
try {
|
||||
LocalSettings.setNumber(boolKey, true);
|
||||
TKUnit.assert(false, "There is a key undefined");
|
||||
}
|
||||
catch (e) {
|
||||
// we should receive an exception here
|
||||
}
|
||||
|
||||
try {
|
||||
LocalSettings.setNumber(boolKey, "123");
|
||||
TKUnit.assert(false, "There is a key undefined");
|
||||
}
|
||||
catch (e) {
|
||||
// we should receive an exception here
|
||||
}
|
||||
|
||||
};
|
@ -1,5 +1,5 @@
|
||||
import TKUnit = require("Tests/TKUnit");
|
||||
import locationModule = require("Location/location");
|
||||
import locationModule = require("location/location");
|
||||
|
||||
var LocationManager = locationModule.LocationManager;
|
||||
var Location = locationModule.Location;
|
||||
|
@ -2,11 +2,11 @@
|
||||
var fsTests = require("Tests/file_system_tests");
|
||||
var httpTests = require("Tests/http_tests");
|
||||
var locationTests = require("Tests/location_tests");
|
||||
var userPreferencesTests = require("Tests/user_preferences_tests");
|
||||
var localSettingsTests = require("Tests/local_settings_tests");
|
||||
|
||||
export var runAll = function () {
|
||||
TKUnit.runTestModule(fsTests, "FILE SYSTEM");
|
||||
TKUnit.runTestModule(httpTests, "HTTP");
|
||||
TKUnit.runTestModule(locationTests, "LOCATION");
|
||||
TKUnit.runTestModule(userPreferencesTests, "USER PREFERENCES");
|
||||
TKUnit.runTestModule(localSettingsTests, "LOCAL SETTINGS");
|
||||
}
|
||||
|
@ -1,137 +0,0 @@
|
||||
|
||||
var TKUnit = require("Tests/TKUnit");
|
||||
var UserPreferences = require("UserPreferences");
|
||||
|
||||
var stringKey:string = "stringKey";
|
||||
var boolKey: string = "boolKey";
|
||||
var numberKey: string = "numberKey";
|
||||
var noStringKey: string = "noStringKey";
|
||||
var noBoolKey: string = "noBoolKey";
|
||||
var noNumberKey: string = "noNumberKey";
|
||||
|
||||
export var testBoolean = function () {
|
||||
UserPreferences.setBoolean(boolKey, false);
|
||||
TKUnit.assert(false == UserPreferences.getBoolean(boolKey), "Cannot set boolean to false, currently it is: " + UserPreferences.getBoolean(boolKey));
|
||||
|
||||
UserPreferences.setBoolean(boolKey, true);
|
||||
TKUnit.assert(true == UserPreferences.getBoolean(boolKey, false), "Cannot set boolean to true");
|
||||
|
||||
TKUnit.assert(true == UserPreferences.getBoolean(boolKey), "Cannot set boolean to true (no default)");
|
||||
};
|
||||
|
||||
export var testString = function () {
|
||||
UserPreferences.setString(stringKey, "String value");
|
||||
TKUnit.assert("String value" === UserPreferences.getString(stringKey), "Cannot set string value");
|
||||
};
|
||||
|
||||
export var testNumber = function () {
|
||||
UserPreferences.setNumber(numberKey, 54.321);
|
||||
var value = UserPreferences.getNumber(numberKey).toFixed(3);
|
||||
TKUnit.assert(54.321 == value, "Cannot set number value 54.321 != " + value);
|
||||
};
|
||||
|
||||
export var testDefaults = function () {
|
||||
TKUnit.assert("No string value" === UserPreferences.getString(noStringKey, "No string value"), "Bad default string value");
|
||||
TKUnit.assert(true === UserPreferences.getBoolean(noBoolKey, true), "Bad default boolean value");
|
||||
TKUnit.assert(123.45 === UserPreferences.getNumber(noNumberKey, 123.45), "Bad default number value");
|
||||
};
|
||||
|
||||
export var testHasKey = function () {
|
||||
TKUnit.assert(!UserPreferences.hasKey(noBoolKey), "There is a key: " + noBoolKey);
|
||||
TKUnit.assert(!UserPreferences.hasKey(noStringKey), "There is a key: " + noStringKey);
|
||||
TKUnit.assert(!UserPreferences.hasKey(noNumberKey), "There is a key: " + noNumberKey);
|
||||
|
||||
TKUnit.assert(UserPreferences.hasKey(boolKey), "There is no key: " + boolKey);
|
||||
TKUnit.assert(UserPreferences.hasKey(stringKey), "There is no key: " + stringKey);
|
||||
TKUnit.assert(UserPreferences.hasKey(numberKey), "There is no key: " + numberKey);
|
||||
};
|
||||
|
||||
export var testRemove = function () {
|
||||
UserPreferences.remove(boolKey);
|
||||
TKUnit.assert(!UserPreferences.hasKey(boolKey), "Failed to remove key: " + boolKey);
|
||||
|
||||
UserPreferences.remove(stringKey);
|
||||
TKUnit.assert(!UserPreferences.hasKey(stringKey), "Failed to remove key: " + stringKey);
|
||||
|
||||
UserPreferences.remove(numberKey);
|
||||
TKUnit.assert(!UserPreferences.hasKey(numberKey), "Failed to remove key: " + numberKey);
|
||||
};
|
||||
|
||||
export var testInvalidKey = function () {
|
||||
try {
|
||||
UserPreferences.hasKey(undefined);
|
||||
TKUnit.assert(false, "There is a key undefined");
|
||||
}
|
||||
catch (e) {
|
||||
// we should receive an exception here
|
||||
}
|
||||
|
||||
try {
|
||||
UserPreferences.hasKey(null);
|
||||
TKUnit.assert(false, "There is a key null");
|
||||
}
|
||||
catch (e) {
|
||||
// we should receive an exception here
|
||||
}
|
||||
|
||||
try {
|
||||
UserPreferences.hasKey(123);
|
||||
TKUnit.assert(false, "There is a key number");
|
||||
}
|
||||
catch (e) {
|
||||
// we should receive an exception here
|
||||
}
|
||||
|
||||
UserPreferences.hasKey("string");
|
||||
};
|
||||
|
||||
export var testInvalidValue = function () {
|
||||
try {
|
||||
UserPreferences.setBoolean(boolKey, "str");
|
||||
TKUnit.assert(false, "There is a key undefined");
|
||||
}
|
||||
catch (e) {
|
||||
// we should receive an exception here
|
||||
}
|
||||
|
||||
try {
|
||||
UserPreferences.setBoolean(boolKey, 123);
|
||||
TKUnit.assert(false, "There is a key undefined");
|
||||
}
|
||||
catch (e) {
|
||||
// we should receive an exception here
|
||||
}
|
||||
|
||||
try {
|
||||
UserPreferences.setString(boolKey, true);
|
||||
TKUnit.assert(false, "There is a key undefined");
|
||||
}
|
||||
catch (e) {
|
||||
// we should receive an exception here
|
||||
}
|
||||
|
||||
try {
|
||||
UserPreferences.setString(boolKey, 123);
|
||||
TKUnit.assert(false, "There is a key undefined");
|
||||
}
|
||||
catch (e) {
|
||||
// we should receive an exception here
|
||||
}
|
||||
|
||||
try {
|
||||
UserPreferences.setNumber(boolKey, true);
|
||||
TKUnit.assert(false, "There is a key undefined");
|
||||
}
|
||||
catch (e) {
|
||||
// we should receive an exception here
|
||||
}
|
||||
|
||||
try {
|
||||
UserPreferences.setNumber(boolKey, "123");
|
||||
TKUnit.assert(false, "There is a key undefined");
|
||||
}
|
||||
catch (e) {
|
||||
// we should receive an exception here
|
||||
}
|
||||
|
||||
};
|
@ -1,2 +0,0 @@
|
||||
declare var module, require;
|
||||
module.exports = require("UserPreferences/user_preferences");
|
@ -1,8 +1,8 @@
|
||||
import appModule = require("Application/application_common");
|
||||
import appModule = require("application/application_common");
|
||||
|
||||
// merge the exports of the application_common file with the exports of this file
|
||||
declare var exports;
|
||||
require("Utils/module_merge").merge(appModule, exports);
|
||||
require("utils/module_merge").merge(appModule, exports);
|
||||
|
||||
var callbacks = android.app.Application.ActivityLifecycleCallbacks;
|
||||
|
@ -20,11 +20,11 @@ log("JavaScript loading ended.");
|
||||
|
||||
*/
|
||||
|
||||
import appModule = require("Application/application_common");
|
||||
import appModule = require("application/application_common");
|
||||
|
||||
// merge the exports of the application_common file with the exports of this file
|
||||
declare var exports;
|
||||
require("Utils/module_merge").merge(appModule, exports);
|
||||
require("utils/module_merge").merge(appModule, exports);
|
||||
|
||||
// TODO: Declarations
|
||||
export var init = function (nativeApp: any) {
|
2
application/index.ts
Normal file
2
application/index.ts
Normal file
@ -0,0 +1,2 @@
|
||||
declare var module, require;
|
||||
module.exports = require("application/application");
|
@ -1,4 +1,4 @@
|
||||
import appModule = require("Application/application");
|
||||
import appModule = require("application/application");
|
||||
|
||||
var REQUEST_IMAGE_CAPTURE: number = 1;
|
||||
var REQUEST_SELECT_PICTURE: number = 2;
|
0
Camera/camera.d.ts → camera/camera.d.ts
vendored
0
Camera/camera.d.ts → camera/camera.d.ts
vendored
@ -1,4 +1,4 @@
|
||||
import helperModule = require("Console/console_helper");
|
||||
import helperModule = require("console/console_helper");
|
||||
|
||||
export class Console {
|
||||
private _timers: any;
|
2
console/index.ts
Normal file
2
console/index.ts
Normal file
@ -0,0 +1,2 @@
|
||||
declare var module, require;
|
||||
module.exports = require("console/console");
|
@ -1,4 +1,4 @@
|
||||
import file_access_module = require("FileSystem/file_system_access");
|
||||
import file_access_module = require("filesystem/file_system_access");
|
||||
import promises = require("promises/promises");
|
||||
|
||||
// The FileSystemAccess implementation, used through all the APIs.
|
@ -1,4 +1,4 @@
|
||||
import appModule = require("Application/application");
|
||||
import appModule = require("application/application");
|
||||
import textModule = require("text/text");
|
||||
|
||||
export class FileSystemAccess {
|
@ -1,5 +1,5 @@
|
||||
import app_module = require("Application/application");
|
||||
import utilsModule = require("Utils/utils_ios");
|
||||
import app_module = require("application/application");
|
||||
import utilsModule = require("utils/utils_ios");
|
||||
import textModule = require("text/text");
|
||||
|
||||
// TODO: Implement all the APIs receiving callback using async blocks
|
2
filesystem/index.ts
Normal file
2
filesystem/index.ts
Normal file
@ -0,0 +1,2 @@
|
||||
declare var module, require;
|
||||
module.exports = require("fileSystem/file_system");
|
@ -1,6 +1,6 @@
|
||||
declare var setTimeout, clearTimeout, setInterval, clearInterval;
|
||||
import timer = require("timer/timer");
|
||||
import consoleModule = require("Console/console");
|
||||
import consoleModule = require("console/console");
|
||||
|
||||
setTimeout = timer.setTimeout;
|
||||
clearTimeout = timer.clearTimeout;
|
||||
|
@ -1,4 +1,4 @@
|
||||
import image_module = require("Image/image");
|
||||
import image_module = require("image/image");
|
||||
import promises = require("promises/promises");
|
||||
import http = require("http/http_request");
|
||||
|
||||
|
2
http/http_request.d.ts
vendored
2
http/http_request.d.ts
vendored
@ -1,7 +1,7 @@
|
||||
/**
|
||||
* The http client interface.
|
||||
*/
|
||||
import image_module = require("Image/image");
|
||||
import image_module = require("image/image");
|
||||
import promises = require("promises/promises");
|
||||
|
||||
export declare function request(options: HttpRequestOptions): promises.Promise<HttpResponse>;
|
||||
|
@ -1,4 +1,4 @@
|
||||
import appModule = require("Application/application");
|
||||
import appModule = require("application/application");
|
||||
|
||||
export enum ImageFormat {
|
||||
PNG,
|
0
Image/image.d.ts → image/image.d.ts
vendored
0
Image/image.d.ts → image/image.d.ts
vendored
2
image/index.ts
Normal file
2
image/index.ts
Normal file
@ -0,0 +1,2 @@
|
||||
declare var module, require;
|
||||
module.exports = require("image/image");
|
2
localsettings/index.ts
Normal file
2
localsettings/index.ts
Normal file
@ -0,0 +1,2 @@
|
||||
declare var module, require;
|
||||
module.exports = require("localsettings/local_settings");
|
@ -1,5 +1,5 @@
|
||||
import appModule = require("Application/application");
|
||||
import Common = require("UserPreferences/user_preferences_common");
|
||||
import appModule = require("application/application");
|
||||
import Common = require("localsettings/local_settings_common");
|
||||
|
||||
var sharedPreferences = appModule.android.context.getSharedPreferences("prefs.db", 0);
|
||||
|
@ -1,4 +1,4 @@
|
||||
import Common = require("UserPreferences/user_preferences_common");
|
||||
import Common = require("localsettings/local_settings_common");
|
||||
|
||||
var userDefaults = Foundation.NSUserDefaults.standardUserDefaults();
|
||||
|
2
location/index.ts
Normal file
2
location/index.ts
Normal file
@ -0,0 +1,2 @@
|
||||
declare var module, require;
|
||||
module.exports = require("location/location");
|
@ -1,9 +1,9 @@
|
||||
import types = require("Location/location_types");
|
||||
import appModule = require("Application/application");
|
||||
import types = require("location/location_types");
|
||||
import appModule = require("application/application");
|
||||
|
||||
// merge the exports of the types module with the exports of this file
|
||||
declare var exports;
|
||||
require("Utils/module_merge").merge(types, exports);
|
||||
require("utils/module_merge").merge(types, exports);
|
||||
|
||||
export class LocationManager {
|
||||
// in meters
|
@ -1,8 +1,8 @@
|
||||
import types = require("Location/location_types");
|
||||
import types = require("location/location_types");
|
||||
|
||||
// merge the exports of the types module with the exports of this file
|
||||
declare var exports;
|
||||
require("Utils/module_merge").merge(types, exports);
|
||||
require("utils/module_merge").merge(types, exports);
|
||||
|
||||
export class LocationManager {
|
||||
|
Reference in New Issue
Block a user