Merge pull request #33270 from eclipsesource/tabris-plugin-firebase-not-needed

[tabris-plugin-firebase] Remove not needed package
This commit is contained in:
Nathan Shively-Sanders
2019-03-05 10:12:35 -08:00
committed by GitHub
5 changed files with 6 additions and 243 deletions
+6
View File
@@ -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",
-147
View File
@@ -1,147 +0,0 @@
// Type definitions for tabris-plugin-firebase 1.0
// Project: https://github.com/eclipsesource/tabris-plugin-firebase/
// Definitions by: EclipseSource <https://github.com/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<PropertyMixins.Analytics>;
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<Messaging, string>): void;
tokenChanged?(event: PropertyChangedEvent<Messaging, string>): void;
message?(event: MessageEvent): void;
}
interface MessageEvent extends EventObject<Messaging> {
data: any;
}
namespace PropertyMixins {
interface Analytics {
analyticsCollectionEnabled: boolean;
screenName: string;
userId: string;
}
}
}
}
// Tabris.js interfaces
interface EventObject<T> {
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>): this;
/**
* An application-wide unique identifier automatically assigned to all native objects on creation.
*/
static readonly cid: string;
}
interface PropertyChangedEvent<T, U> {
readonly target: T;
readonly timeStamp: number;
readonly type: string;
readonly value: U;
}
export {};
@@ -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<firebase.Messaging, string> = {target, timeStamp, type, value};
const tokenChangedEvent: PropertyChangedEvent<firebase.Messaging, string> = {target, timeStamp, type, value};
const messageEvent: firebase.MessageEvent = {target, timeStamp, type, data};
firebase.Messaging.on({
instanceIdChanged: (event: PropertyChangedEvent<firebase.Messaging, string>) => {},
tokenChanged: (event: PropertyChangedEvent<firebase.Messaging, string>) => {},
message: (event: firebase.MessageEvent) => {}
});
}
interface PropertyChangedEvent<T, U> {
readonly target: T;
readonly timeStamp: number;
readonly type: string;
readonly value: U;
}
@@ -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"
]
}
-6
View File
@@ -1,6 +0,0 @@
{
"extends": "dtslint/dt.json",
"rules": {
"strict-export-declare-modifiers": false
}
}