fix(core): typings for Utils.queueMacrotask and static methods on Observable (#9425)

This commit is contained in:
Nathan Walker
2021-05-28 14:06:12 -07:00
committed by GitHub
parent c0a07707f3
commit d589ac6000
2 changed files with 13 additions and 2 deletions

View File

@ -78,7 +78,7 @@ export class Observable {
/**
* String value used when hooking to propertyChange event.
*/
public static propertyChangeEvent: string;
static propertyChangeEvent: string;
/**
* A basic method signature to hook an event listener (shortcut alias to the addEventListener method).
@ -88,6 +88,8 @@ export class Observable {
*/
on(eventNames: string, callback: (data: EventData) => void, thisArg?: any);
static on(eventName: string, callback: any, thisArg?: any): void;
/**
* Raised when a propertyChange occurs.
*/
@ -101,11 +103,15 @@ export class Observable {
*/
once(event: string, callback: (data: EventData) => void, thisArg?: any);
static once(eventName: string, callback: any, thisArg?: any): void;
/**
* Shortcut alias to the removeEventListener method.
*/
off(eventNames: string, callback?: any, thisArg?: any);
static off(eventName: string, callback?: any, thisArg?: any): void;
/**
* Adds a listener for the specified event name.
* @param eventNames Comma delimited names of the events to attach the listener to.
@ -114,6 +120,8 @@ export class Observable {
*/
addEventListener(eventNames: string, callback: (data: EventData) => void, thisArg?: any);
static addEventListener(eventName: string, callback: any, thisArg?: any): void;
/**
* Removes listener(s) for the specified event name.
* @param eventNames Comma delimited names of the events the specified listener is associated with.
@ -122,6 +130,8 @@ export class Observable {
*/
removeEventListener(eventNames: string, callback?: any, thisArg?: any);
static removeEventListener(eventName: string, callback?: any, thisArg?: any): void;
/**
* Updates the specified property with the provided value.
*/

View File

@ -101,12 +101,13 @@ export type { InstrumentationMode, TimerInfo } from './profiling';
export { encoding } from './text';
export * from './trace';
export * from './ui';
import { GC, isFontIconURI, isDataURI, isFileOrResourcePath, executeOnMainThread, mainThreadify, isMainThread, dispatchToMainThread, releaseNativeObject, getModuleName, openFile, openUrl, isRealDevice, layout, ad as androidUtils, iOSNativeHelper as iosUtils, Source, escapeRegexSymbols, convertString, dismissSoftInput } from './utils';
import { GC, isFontIconURI, isDataURI, isFileOrResourcePath, executeOnMainThread, mainThreadify, isMainThread, dispatchToMainThread, releaseNativeObject, getModuleName, openFile, openUrl, isRealDevice, layout, ad as androidUtils, iOSNativeHelper as iosUtils, Source, escapeRegexSymbols, convertString, dismissSoftInput, queueMacrotask } from './utils';
import { ClassInfo, getClass, getBaseClasses, getClassInfo, isBoolean, isDefined, isFunction, isNullOrUndefined, isNumber, isObject, isString, isUndefined, toUIString, verifyCallback } from './utils/types';
export declare const Utils: {
GC: typeof GC;
RESOURCE_PREFIX: string;
FILE_PREFIX: string;
queueMacrotask: typeof queueMacrotask;
isFontIconURI: typeof isFontIconURI;
isDataURI: typeof isDataURI;
isFileOrResourcePath: typeof isFileOrResourcePath;