mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix: downstream types and arg-passing
This commit is contained in:
5
packages/core/ui/scroll-view/index.d.ts
vendored
5
packages/core/ui/scroll-view/index.d.ts
vendored
@@ -66,13 +66,14 @@ export class ScrollView extends ContentView {
|
||||
* @param eventNames - String corresponding to events (e.g. "propertyChange"). Optionally could be used more events separated by `,` (e.g. "propertyChange", "change").
|
||||
* @param callback - Callback function which will be executed when event is raised.
|
||||
* @param thisArg - An optional parameter which will be used as `this` context for callback execution.
|
||||
* @param options An optional parameter. If passed as a boolean, configures the useCapture value. Otherwise, specifies options.
|
||||
*/
|
||||
on(eventNames: string, callback: (data: EventData) => void, thisArg?: any): void;
|
||||
on(eventNames: string, callback: (data: EventData) => void, thisArg?: any, options?: AddEventListenerOptions | boolean): void;
|
||||
|
||||
/**
|
||||
* Raised when a scroll event occurs.
|
||||
*/
|
||||
on(event: 'scroll', callback: (args: ScrollEventData) => void, thisArg?: any): void;
|
||||
on(event: 'scroll', callback: (args: ScrollEventData) => void, thisArg?: any, options?: AddEventListenerOptions | boolean): void;
|
||||
|
||||
_onOrientationChanged(): void;
|
||||
}
|
||||
|
||||
@@ -16,8 +16,8 @@ export abstract class ScrollViewBase extends ContentView implements ScrollViewDe
|
||||
public scrollBarIndicatorVisible: boolean;
|
||||
public isScrollEnabled: boolean;
|
||||
|
||||
public addEventListener(arg: string, callback: any, thisArg?: any) {
|
||||
super.addEventListener(arg, callback, thisArg);
|
||||
public addEventListener(arg: string, callback: (data: EventData) => void, thisArg?: any, options?: AddEventListenerOptions | boolean): void {
|
||||
super.addEventListener(arg, callback, thisArg, options);
|
||||
|
||||
if (arg === ScrollViewBase.scrollEvent) {
|
||||
this._scrollChangeCount++;
|
||||
@@ -25,8 +25,8 @@ export abstract class ScrollViewBase extends ContentView implements ScrollViewDe
|
||||
}
|
||||
}
|
||||
|
||||
public removeEventListener(arg: string, callback: any, thisArg?: any) {
|
||||
super.removeEventListener(arg, callback, thisArg);
|
||||
public removeEventListener(arg: string, callback?: (data: EventData) => void, thisArg?: any, options?: EventListenerOptions | boolean): void {
|
||||
super.removeEventListener(arg, callback, thisArg, options);
|
||||
|
||||
if (arg === ScrollViewBase.scrollEvent) {
|
||||
this._scrollChangeCount--;
|
||||
@@ -87,8 +87,8 @@ export abstract class ScrollViewBase extends ContentView implements ScrollViewDe
|
||||
public abstract _onOrientationChanged();
|
||||
}
|
||||
export interface ScrollViewBase {
|
||||
on(eventNames: string, callback: (data: EventData) => void, thisArg?: any);
|
||||
on(event: 'scroll', callback: (args: ScrollEventData) => void, thisArg?: any);
|
||||
on(eventNames: string, callback: (data: EventData) => void, thisArg?: any, options?: AddEventListenerOptions | boolean): void;
|
||||
on(event: 'scroll', callback: (args: ScrollEventData) => void, thisArg?: any, options?: AddEventListenerOptions | boolean): void;
|
||||
}
|
||||
|
||||
const converter = makeParser<CoreTypes.OrientationType>(makeValidator(CoreTypes.Orientation.horizontal, CoreTypes.Orientation.vertical));
|
||||
|
||||
Reference in New Issue
Block a user