diff --git a/packages/core/application/application-common.ts b/packages/core/application/application-common.ts index 282a3f858..292fca32a 100644 --- a/packages/core/application/application-common.ts +++ b/packages/core/application/application-common.ts @@ -126,6 +126,28 @@ export class ApplicationCommon { readonly loadAppCssEvent = 'loadAppCss'; readonly cssChangedEvent = 'cssChanged'; + // Expose statically for backwards compat on AndroidApplication.on etc. + /** + * @deprecated Use `Application.android.on()` instead. + */ + static on: ApplicationEvents['on'] = globalEvents.on.bind(globalEvents); + /** + * @deprecated Use `Application.android.once()` instead. + */ + static once: ApplicationEvents['on'] = globalEvents.once.bind(globalEvents); + /** + * @deprecated Use `Application.android.off()` instead. + */ + static off: ApplicationEvents['off'] = globalEvents.off.bind(globalEvents); + /** + * @deprecated Use `Application.android.notify()` instead. + */ + static notify: ApplicationEvents['notify'] = globalEvents.notify.bind(globalEvents); + /** + * @deprecated Use `Application.android.hasListeners()` instead. + */ + static hasListeners: ApplicationEvents['hasListeners'] = globalEvents.hasListeners.bind(globalEvents); + // Application events go through the global events. on: ApplicationEvents['on'] = globalEvents.on.bind(globalEvents); once: ApplicationEvents['on'] = globalEvents.once.bind(globalEvents);