diff --git a/notNeededPackages.json b/notNeededPackages.json index 69c55cc962..acdb379b38 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -1717,6 +1717,12 @@ "sourceRepoURL": "http://tabrisjs.com", "asOfVersion": "1.8.0" }, + { + "libraryName": "tabris-plugin-firebase", + "typingsPackageName": "tabris-plugin-firebase", + "sourceRepoURL": "https://github.com/eclipsesource/tabris-plugin-firebase", + "asOfVersion": "2.1.0" + }, { "libraryName": "tcomb", "typingsPackageName": "tcomb", diff --git a/types/tabris-plugin-firebase/index.d.ts b/types/tabris-plugin-firebase/index.d.ts deleted file mode 100644 index 0ade0c9dcf..0000000000 --- a/types/tabris-plugin-firebase/index.d.ts +++ /dev/null @@ -1,147 +0,0 @@ -// Type definitions for tabris-plugin-firebase 1.0 -// Project: https://github.com/eclipsesource/tabris-plugin-firebase/ -// Definitions by: EclipseSource -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 - -declare global { - namespace firebase { - const Analytics: Analytics; - const Messaging: Messaging; - const MessagingEvents: MessagingEvents; - const MessageEvent: MessageEvent; - type AnalyticsProperties = Partial; - - interface Analytics extends NativeObject, PropertyMixins.Analytics { - logEvent(eventName: string, parameters?: {[key: string]: string}): void; - setUserProperty(propertyName: string, value: string): void; - set(properties: AnalyticsProperties): this; - set(property: string, value: any): this; - } - - interface Messaging extends NativeObject { - readonly instanceId: string; - readonly token: string; - readonly launchData: object; - resetInstanceId(): void; - on(type: string, listener: (event: any) => void, context?: object): this; - on(listeners: MessagingEvents): this; - off(type: string, listener: (event: any) => void, context?: object): this; - off(listeners: MessagingEvents): this; - once(type: string, listener: (event: any) => void, context?: object): this; - once(listeners: MessagingEvents): this; - } - - interface MessagingEvents { - instanceIdChanged?(event: PropertyChangedEvent): void; - tokenChanged?(event: PropertyChangedEvent): void; - message?(event: MessageEvent): void; - } - - interface MessageEvent extends EventObject { - data: any; - } - - namespace PropertyMixins { - interface Analytics { - analyticsCollectionEnabled: boolean; - screenName: string; - userId: string; - } - } - } -} - -// Tabris.js interfaces - -interface EventObject { - readonly target: T; - readonly timeStamp: number; - readonly type: string; -} - -/** - * Base class for all objects with a native implementation. - */ -declare class NativeObject { - protected constructor(properties?: object); - - /** - * Gets the current value of the given *property*. - */ - get(property: string): any; - - /** - * Removes all occurrences of *listener* that are bound to *type* and *context* from this widget. - * @param type The type of events to remove listeners for. - * @param listener The listener function to remove. - * @param context The context of the bound listener to remove. - */ - off(type: string, listener: (event: any) => void, context?: object): this; - - /** - * Removes all listeners in the given object from the event type indicated by their key. - * @param listeners A key-value map where the keys are event types and the values are the listeners to deregister from these events, e.g. `{tap: onTap, scroll: onScroll}`. - */ - off(listeners: object): this; - - /** - * Registers a *listener* function to be notified of events of the given *type*. - * @param type The type of events to listen for. - * @param listener The listener function to register. This function will be called with an event object. - * @param context In the listener function, `this` will point to this object. If not present, the listener will be called in the context of this object. - */ - on(type: string, listener: (event: any) => void, context?: object): this; - - /** - * Registers all listeners in the given object for the event type indicated by their key. - * @param listeners A key-value map where the keys are event types and the values are the listeners to register for these events, e.g. `{tap: onTap, scroll: onScroll}`. - */ - on(listeners: object): this; - - /** - * Same as `on`, but removes the listener after it has been invoked by an event. - * @param type The type of the event to listen for. - * @param listener The listener function to register. This function will be called with an event object. - * @param context In the listener function, `this` will point to this object. If not present, the listener will be called in the context of this object. - */ - once(type: string, listener: (event: any) => void, context?: object): this; - - /** - * Same as `on`, but removes the listener after it has been invoked by an event. - * @param listeners A key-value map where the keys are event types and the values are the listeners to register for these events, e.g. `{tap: onTap, scroll: onScroll}`. - */ - once(listeners: object): this; - - /** - * Sets the given property. - */ - set(property: string, value: any): this; - - /** - * Sets all key-value pairs in the properties object as widget properties. - */ - set(properties: object): this; - - /** - * Notifies all registered listeners for the given *type* and passes the *event* object to the - * listeners. - * @param type The type of event to trigger - * @param event The event object to pass to listener functions. - */ - trigger(type: string, event: EventObject): this; - - /** - * An application-wide unique identifier automatically assigned to all native objects on creation. - */ - static readonly cid: string; -} - -interface PropertyChangedEvent { - readonly target: T; - readonly timeStamp: number; - readonly type: string; - readonly value: U; -} - -export {}; diff --git a/types/tabris-plugin-firebase/tabris-plugin-firebase-tests.ts b/types/tabris-plugin-firebase/tabris-plugin-firebase-tests.ts deleted file mode 100644 index 8dff4f34a8..0000000000 --- a/types/tabris-plugin-firebase/tabris-plugin-firebase-tests.ts +++ /dev/null @@ -1,67 +0,0 @@ -function testAnalytics() { - // Properties - let analyticsCollectionEnabled: boolean; - let screenName: string; - let userId: string; - - analyticsCollectionEnabled = firebase.Analytics.analyticsCollectionEnabled; - screenName = firebase.Analytics.screenName; - userId = firebase.Analytics.userId; - - firebase.Analytics.analyticsCollectionEnabled = analyticsCollectionEnabled; - firebase.Analytics.screenName = screenName; - firebase.Analytics.userId = userId; - - const properties: firebase.AnalyticsProperties = {analyticsCollectionEnabled, screenName, userId}; - const partialProperties: firebase.AnalyticsProperties = {}; - firebase.Analytics.set(properties); - firebase.Analytics.set(partialProperties); - - // Methods - let thisReturnValue: firebase.Analytics; - const name = ''; - const property = ''; - - thisReturnValue = firebase.Analytics.set({analyticsCollectionEnabled, screenName, userId}); - firebase.Analytics.logEvent(name, {foo: property}); - firebase.Analytics.logEvent(name); - firebase.Analytics.setUserProperty(name, property); -} - -function testMessaging() { - // Properties - let instanceId: string; - let token: string; - let launchData: object; - - instanceId = firebase.Messaging.instanceId; - token = firebase.Messaging.token; - launchData = firebase.Messaging.launchData; - - // Methods - firebase.Messaging.resetInstanceId(); - - // Events - const target: firebase.Messaging = firebase.Messaging; - const timeStamp = 0; - const type = 'foo'; - const value = 'bar'; - const data: any = {}; - - const instanceIdChangedEvent: PropertyChangedEvent = {target, timeStamp, type, value}; - const tokenChangedEvent: PropertyChangedEvent = {target, timeStamp, type, value}; - const messageEvent: firebase.MessageEvent = {target, timeStamp, type, data}; - - firebase.Messaging.on({ - instanceIdChanged: (event: PropertyChangedEvent) => {}, - tokenChanged: (event: PropertyChangedEvent) => {}, - message: (event: firebase.MessageEvent) => {} - }); -} - -interface PropertyChangedEvent { - readonly target: T; - readonly timeStamp: number; - readonly type: string; - readonly value: U; -} diff --git a/types/tabris-plugin-firebase/tsconfig.json b/types/tabris-plugin-firebase/tsconfig.json deleted file mode 100644 index cac6477844..0000000000 --- a/types/tabris-plugin-firebase/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "tabris-plugin-firebase-tests.ts" - ] -} \ No newline at end of file diff --git a/types/tabris-plugin-firebase/tslint.json b/types/tabris-plugin-firebase/tslint.json deleted file mode 100644 index 4c4fc86ace..0000000000 --- a/types/tabris-plugin-firebase/tslint.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - "strict-export-declare-modifiers": false - } -}