mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
Merge pull request #24505 from janvennemann/titanium
Update Titanium Mobile types to 7.1.0
This commit is contained in:
Vendored
+64676
-6910
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,5 @@
|
||||
|
||||
|
||||
function test_window() {
|
||||
var window: Ti.UI.Window = Ti.UI.createWindow({
|
||||
const window: Titanium.UI.Window = Ti.UI.createWindow({
|
||||
title: 'Test',
|
||||
backgroundColor: 'white',
|
||||
borderRadius: 10
|
||||
@@ -10,10 +8,10 @@ function test_window() {
|
||||
window.setBackgroundColor('blue');
|
||||
window.opacity = 0.92;
|
||||
|
||||
var matrix = Ti.UI.create2DMatrix().scale(1.1, 1);
|
||||
const matrix = Ti.UI.create2DMatrix().scale(1.1, 1);
|
||||
window.transform = matrix;
|
||||
|
||||
var label: Ti.UI.Label;
|
||||
let label: Titanium.UI.Label;
|
||||
label = Ti.UI.createLabel({
|
||||
color: '#900',
|
||||
text: 'Simple label'
|
||||
@@ -26,17 +24,17 @@ function test_window() {
|
||||
}
|
||||
|
||||
function test_tableview() {
|
||||
var data : Ti.UI.View[] = [];
|
||||
for (var i = 0; i < 10; i++) {
|
||||
var row = Ti.UI.createTableViewRow();
|
||||
var label = Ti.UI.createLabel({
|
||||
const data: Titanium.UI.TableViewRow[] = [];
|
||||
for (let i = 0; i < 10; i++) {
|
||||
const row = Ti.UI.createTableViewRow();
|
||||
const label = Ti.UI.createLabel({
|
||||
left: 10,
|
||||
text: 'Row ' + (i + 1)
|
||||
});
|
||||
var image = Ti.UI.createImageView({
|
||||
const image = Ti.UI.createImageView({
|
||||
url: 'KS_nav_ui.png'
|
||||
});
|
||||
var button = Ti.UI.createButton({
|
||||
const button = Ti.UI.createButton({
|
||||
right: 10,
|
||||
height: 30,
|
||||
width: 80,
|
||||
@@ -47,19 +45,19 @@ function test_tableview() {
|
||||
row.add(button);
|
||||
data.push(row);
|
||||
}
|
||||
var table = Ti.UI.createTableView({
|
||||
data: data,
|
||||
style: Ti.UI.iPhone.TableViewStyle.PLAIN
|
||||
const table = Ti.UI.createTableView({
|
||||
data,
|
||||
style: Ti.UI.iOS.TableViewStyle.PLAIN
|
||||
});
|
||||
}
|
||||
|
||||
function test_fs() {
|
||||
var imageDir = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory + 'downloaded_images');
|
||||
let imageDir = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory + 'downloaded_images');
|
||||
if (!imageDir.exists()) {
|
||||
imageDir.createDirectory();
|
||||
}
|
||||
var data: Ti.Blob;
|
||||
var imageFile = Ti.Filesystem.getFile(imageDir.resolve() + 'image.jpg');
|
||||
let data: Titanium.Blob; // tslint:disable-line:prefer-const
|
||||
let imageFile = Ti.Filesystem.getFile(imageDir.resolve() + 'image.jpg');
|
||||
if (!imageFile.write(data)) {
|
||||
Ti.UI.createAlertDialog({
|
||||
message: 'IO Error'
|
||||
@@ -70,17 +68,17 @@ function test_fs() {
|
||||
}
|
||||
|
||||
function test_network() {
|
||||
var url = "http://www.appcelerator.com";
|
||||
var client = Ti.Network.createHTTPClient({
|
||||
const url = "http://www.appcelerator.com";
|
||||
const client = Ti.Network.createHTTPClient({
|
||||
// function called when the response data is available
|
||||
onload : function(e: SuccessResponse) {
|
||||
onload: (e: SuccessResponse) => {
|
||||
alert(this.responseText);
|
||||
},
|
||||
// function called when an error occurs, including a timeout
|
||||
onerror : function(e: FailureResponse) {
|
||||
onerror: (e: FailureResponse) => {
|
||||
alert(e.error);
|
||||
},
|
||||
timeout : 5000 // in milliseconds
|
||||
timeout: 5000 // in milliseconds
|
||||
});
|
||||
// Prepare the connection.
|
||||
client.open('GET', url);
|
||||
@@ -89,8 +87,8 @@ function test_network() {
|
||||
}
|
||||
|
||||
function test_map() {
|
||||
var win = Ti.UI.createWindow();
|
||||
var mountainView = Ti.Map.createAnnotation({
|
||||
const win = Ti.UI.createWindow();
|
||||
const mountainView = Ti.Map.createAnnotation({
|
||||
animate: true,
|
||||
leftButton: '../images/appcelerator_small.png',
|
||||
myid: 1
|
||||
@@ -101,19 +99,20 @@ function test_map() {
|
||||
mountainView.setSubtitle('Mountain View, CA');
|
||||
mountainView.setPincolor(Ti.Map.ANNOTATION_RED);
|
||||
|
||||
var mapview = Ti.Map.createView({
|
||||
const mapview = Ti.Map.createView({
|
||||
mapType: Ti.Map.STANDARD_TYPE,
|
||||
region: {
|
||||
latitude:37.390749, longitude:-122.081651,
|
||||
latitudeDelta:0.01, longitudeDelta:0.01},
|
||||
animate:true,
|
||||
latitude: 37.390749, longitude: -122.081651,
|
||||
latitudeDelta: 0.01, longitudeDelta: 0.01
|
||||
},
|
||||
animate: true,
|
||||
});
|
||||
mapview.regionFit = true;
|
||||
mapview.userLocation = true;
|
||||
mapview.annotations = [mountainView];
|
||||
mapview.addEventListener('click', function(evt?) {
|
||||
if (evt.clicksource === 'leftButton' || evt.clicksource === 'leftPane') {
|
||||
alert(evt.title + ' left button clicked');
|
||||
mapview.addEventListener('click', event => {
|
||||
if (event.clicksource === 'leftButton' || event.clicksource === 'leftPane') {
|
||||
alert(event.title + ' left button clicked');
|
||||
}
|
||||
});
|
||||
win.add(mapview);
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
"dom",
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": false,
|
||||
|
||||
@@ -2,78 +2,12 @@
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"adjacent-overload-signatures": false,
|
||||
"array-type": false,
|
||||
"arrow-return-shorthand": false,
|
||||
"ban-types": false,
|
||||
"callable-types": false,
|
||||
"comment-format": false,
|
||||
"dt-header": false,
|
||||
"eofline": false,
|
||||
"export-just-namespace": false,
|
||||
"import-spacing": false,
|
||||
"interface-name": false,
|
||||
"interface-over-type-literal": false,
|
||||
"jsdoc-format": false,
|
||||
"max-line-length": false,
|
||||
"member-access": false,
|
||||
"new-parens": false,
|
||||
"no-any-union": false,
|
||||
"no-boolean-literal-compare": false,
|
||||
"no-conditional-assignment": false,
|
||||
"no-consecutive-blank-lines": false,
|
||||
"no-construct": false,
|
||||
"no-declare-current-package": false,
|
||||
"no-duplicate-imports": false,
|
||||
"no-duplicate-variable": false,
|
||||
"no-empty-interface": false,
|
||||
"no-for-in-array": false,
|
||||
"no-inferrable-types": false,
|
||||
"no-internal-module": false,
|
||||
"no-irregular-whitespace": false,
|
||||
"no-mergeable-namespace": false,
|
||||
"no-misused-new": false,
|
||||
"no-namespace": false,
|
||||
"no-object-literal-type-assertion": false,
|
||||
"no-padding": false,
|
||||
"no-redundant-jsdoc": false,
|
||||
"no-redundant-jsdoc-2": false,
|
||||
"no-redundant-undefined": false,
|
||||
"no-reference-import": false,
|
||||
"no-relative-import-in-test": false,
|
||||
"no-self-import": false,
|
||||
"no-single-declare-module": false,
|
||||
"no-string-throw": false,
|
||||
"no-unnecessary-callback-wrapper": false,
|
||||
"no-unnecessary-class": false,
|
||||
"no-unnecessary-generics": false,
|
||||
"no-unnecessary-qualifier": false,
|
||||
"no-unnecessary-type-assertion": false,
|
||||
"no-useless-files": false,
|
||||
"no-var-keyword": false,
|
||||
"no-var-requires": false,
|
||||
"no-void-expression": false,
|
||||
"no-trailing-whitespace": false,
|
||||
"object-literal-key-quotes": false,
|
||||
"object-literal-shorthand": false,
|
||||
"one-line": false,
|
||||
"one-variable-per-declaration": false,
|
||||
"only-arrow-functions": false,
|
||||
"prefer-conditional-expression": false,
|
||||
"prefer-const": false,
|
||||
"prefer-declare-function": false,
|
||||
"prefer-for-of": false,
|
||||
"prefer-method-signature": false,
|
||||
"prefer-template": false,
|
||||
"radix": false,
|
||||
"semicolon": false,
|
||||
"space-before-function-paren": false,
|
||||
"space-within-parens": false,
|
||||
"strict-export-declare-modifiers": false,
|
||||
"trim-file": false,
|
||||
"triple-equals": false,
|
||||
"typedef-whitespace": false,
|
||||
"unified-signatures": false,
|
||||
"void-return": false,
|
||||
"whitespace": false
|
||||
"max-line-length": false,
|
||||
"unified-signatures": false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user