Skip to content

Commit 70041bd

Browse files
committed
Don't expose platform types in public d.ts files.
Use any. Add a comment with the real type.
1 parent c84227d commit 70041bd

File tree

33 files changed

+141
-147
lines changed

33 files changed

+141
-147
lines changed

application/application.d.ts

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ declare module "application" {
243243
/**
244244
* The activity.
245245
*/
246-
activity: android.app.Activity;
246+
activity: any /* android.app.Activity */;
247247

248248
/**
249249
* The name of the event.
@@ -263,7 +263,7 @@ declare module "application" {
263263
/**
264264
* The bundle.
265265
*/
266-
bundle: android.os.Bundle;
266+
bundle: any /* android.os.Bundle */;
267267
}
268268

269269
/**
@@ -283,7 +283,7 @@ declare module "application" {
283283
/**
284284
* The intent.
285285
*/
286-
intent: android.content.Intent;
286+
intent: any /* android.content.Intent */;
287287
}
288288

289289
/**
@@ -303,27 +303,27 @@ declare module "application" {
303303
/**
304304
* The [android Application](http://developer.android.com/reference/android/app/Application.html) object instance provided to the init of the module.
305305
*/
306-
nativeApp: android.app.Application;
306+
nativeApp: any /* android.app.Application */;
307307

308308
/**
309309
* The application's [android Context](http://developer.android.com/reference/android/content/Context.html) object instance.
310310
*/
311-
context: android.content.Context;
311+
context: any /* android.content.Context */;
312312

313313
/**
314314
* The currently active (loaded) [android Activity](http://developer.android.com/reference/android/app/Activity.html). This property is automatically updated upon Activity events.
315315
*/
316-
foregroundActivity: android.app.Activity;
316+
foregroundActivity: any /* android.app.Activity */;
317317

318318
/**
319319
* The currently active (loaded) Context. This is typically the top-level Activity that is just created.
320320
*/
321-
currentContext: android.content.Context;
321+
currentContext: any /* android.content.Context */;
322322

323323
/**
324324
* The main (start) Activity for the application.
325325
*/
326-
startActivity: android.app.Activity;
326+
startActivity: any /* android.app.Activity */;
327327

328328
/**
329329
* The name of the application package.
@@ -335,47 +335,47 @@ declare module "application" {
335335
* @param intent - Native (android) intent used to create the activity.
336336
* Returns com.tns.NativeScriptActivity.extend implementation.
337337
*/
338-
getActivity(intent: android.content.Intent): any;
338+
getActivity(intent: any /* android.content.Intent */): any;
339339

340340
/**
341341
* [Deprecated. Please use the respective event instead.] Direct handler of the [onActivityCreated method](http://developer.android.com/reference/android/app/Application.ActivityLifecycleCallbacks.html).
342342
*/
343-
onActivityCreated: (activity: android.app.Activity, bundle: android.os.Bundle) => void;
343+
onActivityCreated: (activity: any /* android.app.Activity */, bundle: any /* android.os.Bundle */) => void;
344344

345345
/**
346346
* [Deprecated. Please use the respective event instead.] Direct handler of the [onActivityDestroyed method](http://developer.android.com/reference/android/app/Application.ActivityLifecycleCallbacks.html).
347347
*/
348-
onActivityDestroyed: (activity: android.app.Activity) => void;
348+
onActivityDestroyed: (activity: any /* android.app.Activity */) => void;
349349

350350
/**
351351
* [Deprecated. Please use the respective event instead.] Direct handler of the [onActivityDestroyed method](http://developer.android.com/reference/android/app/Application.ActivityLifecycleCallbacks.html).
352352
*/
353-
onActivityStarted: (activity: android.app.Activity) => void;
353+
onActivityStarted: (activity: any /* android.app.Activity */) => void;
354354

355355
/**
356356
* [Deprecated. Please use the respective event instead.] Direct handler of the [onActivityPaused method](http://developer.android.com/reference/android/app/Application.ActivityLifecycleCallbacks.html).
357357
*/
358-
onActivityPaused: (activity: android.app.Activity) => void;
358+
onActivityPaused: (activity: any /* android.app.Activity */) => void;
359359

360360
/**
361361
* [Deprecated. Please use the respective event instead.] Direct handler of the [onActivityResumed method](http://developer.android.com/reference/android/app/Application.ActivityLifecycleCallbacks.html).
362362
*/
363-
onActivityResumed: (activity: android.app.Activity) => void;
363+
onActivityResumed: (activity: any /* android.app.Activity */) => void;
364364

365365
/**
366366
* [Deprecated. Please use the respective event instead.] Direct handler of the [onActivityStopped method](http://developer.android.com/reference/android/app/Application.ActivityLifecycleCallbacks.html).
367367
*/
368-
onActivityStopped: (activity: android.app.Activity) => void;
368+
onActivityStopped: (activity: any /* android.app.Activity */) => void;
369369

370370
/**
371371
* [Deprecated. Please use the respective event instead.] Direct handler of the [onActivitySaveInstanceState method](http://developer.android.com/reference/android/app/Application.ActivityLifecycleCallbacks.html).
372372
*/
373-
onSaveActivityState: (activity: android.app.Activity, bundle: android.os.Bundle) => void;
373+
onSaveActivityState: (activity: any /* android.app.Activity */, bundle: any /* android.os.Bundle */) => void;
374374

375375
/**
376376
* [Deprecated. Please use the respective event instead.] Direct handler of the onActivityResult method.
377377
*/
378-
onActivityResult: (requestCode: number, resultCode: number, data: android.content.Intent) => void;
378+
onActivityResult: (requestCode: number, resultCode: number, data: any /* android.content.Intent */) => void;
379379

380380
/**
381381
* A basic method signature to hook an event listener (shortcut alias to the addEventListener method).
@@ -481,7 +481,7 @@ declare module "application" {
481481
* @param intentFilter A string containing the intent filter.
482482
* @param onReceiveCallback A callback function that will be called each time the receiver receives a broadcast.
483483
*/
484-
registerBroadcastReceiver(intentFilter: string, onReceiveCallback: (context: android.content.Context, intent: android.content.Intent) => void): void;
484+
registerBroadcastReceiver(intentFilter: string, onReceiveCallback: (context: any /* android.content.Context */, intent: any /* android.content.Intent */) => void): void;
485485

486486
/**
487487
* Unregister a previously registered BroadcastReceiver.
@@ -500,25 +500,25 @@ declare module "application" {
500500
/**
501501
* The root view controller for the application.
502502
*/
503-
rootController: UIViewController;
503+
rootController: any /* UIViewController */;
504504

505505
/**
506506
* The [UIApplication](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIApplication_Class/index.html).
507507
*/
508-
nativeApp: UIApplication;
508+
nativeApp: any /* UIApplication */;
509509

510510
/**
511511
* The [UIApplicationDelegate](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIApplicationDelegate_Protocol/index.html) class.
512512
*/
513-
delegate: typeof UIApplicationDelegate;
513+
delegate: any /* typeof UIApplicationDelegate */;
514514

515515
/**
516516
* Adds an observer to the default notification center for the specified notification.
517517
* For more information, please visit 'https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSNotificationCenter_Class/#//apple_ref/occ/instm/NSNotificationCenter/addObserver:selector:name:object:'
518518
* @param notificationName A string containing the name of the notification.
519519
* @param onReceiveCallback A callback function that will be called each time the observer receives a notification.
520520
*/
521-
addNotificationObserver(notificationName: string, onReceiveCallback: (notification: NSNotification) => void): any;
521+
addNotificationObserver(notificationName: string, onReceiveCallback: (notification: any /* NSNotification */) => void): any;
522522

523523
/**
524524
* Removes the observer for the specified notification from the default notification center.
@@ -529,4 +529,4 @@ declare module "application" {
529529
*/
530530
removeNotificationObserver(observer: any, notificationName: string): void;
531531
}
532-
}
532+
}

color/color.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ declare module "color" {
5454
/**
5555
* Gets the iOS-specific UIColor value representation. This is a read-only property.
5656
*/
57-
ios: UIColor;
57+
ios: any /* UIColor */;
5858

5959
/**
6060
* Specifies whether this Color is equal to the Color parameter.
@@ -75,4 +75,4 @@ declare module "color" {
7575
*/
7676
public static isValid(value: any): boolean;
7777
}
78-
}
78+
}

image-source/image-source.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ declare module "image-source" {
2020
/**
2121
* The iOS-specific [UIImage](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIImage_Class/) instance. Will be undefined when running on Android.
2222
*/
23-
ios: UIImage;
23+
ios: any /* UIImage */;
2424

2525
/**
2626
* The Android-specific [image](http://developer.android.com/reference/android/graphics/Bitmap.html) instance. Will be undefined when running on iOS.
2727
*/
28-
android: android.graphics.Bitmap;
28+
android: any /* android.graphics.Bitmap */;
2929

3030
/**
3131
* Loads this instance from the specified resource name.
@@ -122,4 +122,4 @@ declare module "image-source" {
122122
* @param path The path.
123123
*/
124124
export function isFileOrResourcePath(path: string): boolean
125-
}
125+
}

location/location.d.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ declare module "location" {
5757
/**
5858
* The android-specific [location](http://developer.android.com/reference/android/location/Location.html) object.
5959
*/
60-
android: android.location.Location;
60+
android: any /* android.location.Location */;
6161

6262
/**
6363
* The ios-specific [CLLocation](https://developer.apple.com/library/ios/documentation/CoreLocation/Reference/CLLocation_Class/) object.
6464
*/
65-
ios: CLLocation;
65+
ios: any /* CLLocation */;
6666
}
6767

6868
/**
@@ -162,7 +162,7 @@ declare module "location" {
162162
/**
163163
* The android-specific location manager [LocationManager](http://developer.android.com/reference/android/location/LocationManager.html)
164164
*/
165-
manager: android.location.LocationManager;
165+
manager: any /* android.location.LocationManager */;
166166

167167
/**
168168
* The minimum time interval between subsequent location updates, in milliseconds.
@@ -186,6 +186,6 @@ declare module "location" {
186186
/**
187187
* The ios-specific location manager [CLLocationManager](https://developer.apple.com/library/ios/documentation/CoreLocation/Reference/CLLocationManager_Class/)
188188
*/
189-
manager: CLLocationManager;
189+
manager: any /* CLLocationManager */;
190190
}
191-
}
191+
}

ui/action-bar/action-bar.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ declare module "ui/action-bar" {
205205
}
206206

207207
//@private
208-
export function _setNavBarColor(navBar: UINavigationBar, color: UIColor);
209-
export function _setNavBarBackgroundColor(navBar: UINavigationBar, color: UIColor);
208+
export function _setNavBarColor(navBar: any /* UINavigationBar */, color: any /* UIColor */);
209+
export function _setNavBarBackgroundColor(navBar: any /* UINavigationBar */, color: any /* UIColor */);
210210
//@endprivate
211-
}
211+
}

ui/activity-indicator/activity-indicator.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ declare module "ui/activity-indicator" {
1717
/**
1818
* Gets the native [android widget](http://developer.android.com/reference/android/widget/ProgressBar.html) that represents the user interface for this component. Valid only when running on Android OS.
1919
*/
20-
android: android.widget.ProgressBar;
20+
android: any /* android.widget.ProgressBar */;
2121

2222
/**
2323
* Gets the native iOS [UIActivityIndicatorView](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIActivityIndicatorView_Class/index.html) that represents the user interface for this component. Valid only when running on iOS.
2424
*/
25-
ios: UIActivityIndicatorView;
25+
ios: any /* UIActivityIndicatorView */;
2626

2727
/**
2828
* Gets or sets a value indicating whether the widget is currently displaying progress.
2929
*/
3030
busy: boolean;
3131
}
32-
}
32+
}

ui/button/button.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ declare module "ui/button" {
2424
/**
2525
* Gets the native [android widget](http://developer.android.com/reference/android/widget/Button.html) that represents the user interface for this component. Valid only when running on Android OS.
2626
*/
27-
android: android.widget.Button;
27+
android: any /* android.widget.Button */;
2828

2929
/**
3030
* Gets the native [UIButton](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIButton_Class/) that represents the user interface for this component. Valid only when running on iOS.
3131
*/
32-
ios: UIButton;
32+
ios: any /* UIButton */;
3333

3434
/**
3535
* Gets or sets the text (label) displayed by this instance.
@@ -62,4 +62,4 @@ declare module "ui/button" {
6262
*/
6363
_addChildFromBuilder(name: string, value: any): void;
6464
}
65-
}
65+
}

ui/core/control-state-change.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
* @param control An instance of the UIControl which state will be watched.
1010
* @param callback A callback called when a visual state of the UIControl is changed.
1111
*/
12-
constructor(control: UIControl, callback: (state: string) => void);
12+
constructor(control: any /* UIControl */, callback: (state: string) => void);
1313
}
14-
}
14+
}

ui/core/view.android.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,6 @@ function onIsUserInteractionEnabledPropertyChanged(data: dependencyObservable.Pr
6262
}
6363
(<proxy.PropertyMetadata>viewCommon.View.isUserInteractionEnabledProperty.metadata).onSetNativeValue = onIsUserInteractionEnabledPropertyChanged;
6464

65-
export var NativeViewGroup = (<any>android.view.ViewGroup).extend({
66-
onMeasure: function (widthMeasureSpec, heightMeasureSpec) {
67-
var owner: viewDefinition.View = this[OWNER];
68-
owner.onMeasure(widthMeasureSpec, heightMeasureSpec);
69-
this.setMeasuredDimension(owner.getMeasuredWidth(), owner.getMeasuredHeight());
70-
},
71-
onLayout: function (changed: boolean, left: number, top: number, right: number, bottom: number): void {
72-
var owner: viewDefinition.View = this[OWNER];
73-
owner.onLayout(left, top, right, bottom);
74-
}
75-
});
76-
7765
export class View extends viewCommon.View {
7866
private _disableUserInteractionListener: android.view.View.OnTouchListener = new android.view.View.OnTouchListener({
7967
onTouch: function (view: android.view.View, event: android.view.MotionEvent) {

ui/core/view.d.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ declare module "ui/core/view" {
452452
_propagateInheritableProperties(view: View)
453453
_inheritProperties(parentView: View)
454454
_removeView(view: View);
455-
_context: android.content.Context;
455+
_context: any /* android.content.Context */;
456456

457457
public _applyXmlAttribute(attribute: string, value: any): boolean;
458458

@@ -474,7 +474,7 @@ declare module "ui/core/view" {
474474
_eachChildView(callback: (child: View) => boolean);
475475
_childrenCount: number;
476476

477-
_onAttached(context: android.content.Context): void;
477+
_onAttached(context: any /* android.content.Context */): void;
478478
_onContextChanged(): void;
479479
_onDetached(force?: boolean): void;
480480
_createUI(): void;
@@ -511,13 +511,6 @@ declare module "ui/core/view" {
511511
export class CustomLayoutView extends View {
512512
}
513513

514-
//@private
515-
export class NativeViewGroup extends android.view.ViewGroup {
516-
constructor(context: android.content.Context);
517-
public setOwner(view: View);
518-
}
519-
//@endprivate
520-
521514
/**
522515
* Defines an interface for adding arrays declared in xml.
523516
*/

0 commit comments

Comments
 (0)