Skip to content

Commit

Permalink
fix(core): typings for Utils.queueMacrotask and static methods on Obs…
Browse files Browse the repository at this point in the history
…ervable (#9425)
  • Loading branch information
NathanWalker committed May 28, 2021
1 parent c0a0770 commit d589ac6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
12 changes: 11 additions & 1 deletion packages/core/data/observable/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand All @@ -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.
*/
Expand All @@ -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.
Expand All @@ -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.
Expand All @@ -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.
*/
Expand Down
3 changes: 2 additions & 1 deletion packages/core/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d589ac6

Please sign in to comment.