Description

The base for all event data objects emitted by wrappers.

Implements

IGoogleMapsEventData

Index

core/abstraction/events/google-maps-event-data.ts

Properties

Constructor

constructor(eventName: string, emitter: EmittingWrapper, args: any, nativeArgs: any, associatedEmitter: EmittingWrapper)
Parameters:
Name Type Optional
eventName string No
emitter EmittingWrapper No
args any No
nativeArgs any No
associatedEmitter EmittingWrapper No

Properties

Public args
Type: any

A transformed version of the native arguments provided in the native event. Cleaner, easier to use.

Public associatedEmitter
Type: EmittingWrapper

The wrapper this event is related to. This is always the inner wrapper of the hooked component.

Public emitter
Type: EmittingWrapper

The wrapper which actually emitted the event. If the component was hooked to its own inner wrapper's events, this will be the inner wrapper. If a component was hooked to events of another wrapper, this will be the other wrapper. In case you need access only to the component's inner wrapper, use associatedEmitter instead.

Public eventName
Type: string

The name of the triggered event.

Public nativeArgs
Type: any

The native arguments provided in the native event.

Public nativeEmitter
Type: IGoogleMapsNativeObject

The native object which actually emitted the event.

import { IGoogleMapsNativeObject } from '../native/i-google-maps-native-object';
import { EmittingWrapper         } from '../types/abstraction';
import { IGoogleMapsEventData    } from './i-google-maps-event-data';

/**
 * The base for all event data objects emitted by wrappers.
 *
 * @export
 * @class GoogleMapsEventData
 * @implements {IGoogleMapsEventData}
 */
export class GoogleMapsEventData implements IGoogleMapsEventData
{
    /** The native object which actually emitted the event. */
    public nativeEmitter: IGoogleMapsNativeObject;

    constructor(
        /** The name of the triggered event. */
        public eventName: string,
        /**
         * The wrapper which actually emitted the event. If the component was hooked to its own inner wrapper's events, this will be the inner wrapper.
         * If a component was hooked to events of another wrapper, this will be the other wrapper. In case you need access only to the component's inner wrapper,
         * use `associatedEmitter` instead.
         */
        public emitter: EmittingWrapper,
        /** A transformed version of the native arguments provided in the native event. Cleaner, easier to use. */
        public args: any,
        /** The native arguments provided in the native event. */
        public nativeArgs: any,
        /** The wrapper this event is related to. This is always the inner wrapper of the hooked component. */
        public associatedEmitter: EmittingWrapper
    )
    {
        this.nativeEmitter = this.emitter.native;
    }
}

results matching ""

    No results matching ""