Skip to content

Commit

Permalink
fix: revert event handler mixed return value
Browse files Browse the repository at this point in the history
Mixed is not compatible with returning void explicitly.
  • Loading branch information
oscarlorentzon committed Jan 30, 2022
1 parent 2707d0b commit c53eadb
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions declarations/mapillary.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ declare function readMeshPbf(buffer: ArrayBuffer): MeshContract;
*/
export interface IEventEmitter {
fire<T>(type: string, event: T): void;
off<T>(type: string, handler: (event: T) => mixed): void;
on<T>(type: string, handler: (event: T) => mixed): void;
off<T>(type: string, handler: (event: T) => void): void;
on<T>(type: string, handler: (event: T) => void): void;
}

declare class EventEmitter implements IEventEmitter {
Expand All @@ -184,19 +184,19 @@ declare class EventEmitter implements IEventEmitter {
* Subscribe to an event by its name.
* @param {string} type - The name of the event
* to subscribe to.
* @param {(event: T) => mixed} handler - The
* @param {(event: T) => void} handler - The
* handler called when the event occurs.
*/
on<T>(type: string, handler: (event: T) => mixed): void;
on<T>(type: string, handler: (event: T) => void): void;

/**
* Unsubscribe from an event by its name.
* @param {string} type - The name of the event
* to unsubscribe from.
* @param {(event: T) => mixed} handler - The
* @param {(event: T) => void} handler - The
* handler to remove.
*/
off<T>(type: string, handler: (event: T) => mixed): void;
off<T>(type: string, handler: (event: T) => void): void;

/**
* @ignore
Expand Down Expand Up @@ -884,9 +884,9 @@ declare class DataProviderBase implements IDataProvider, IEventEmitter {
*/
getSequence(sequenceId: string): Promise<SequenceContract>;

off<T>(type: string, handler: (event: T) => mixed): void;
off<T>(type: string, handler: (event: T) => void): void;

on<T>(type: string, handler: (event: T) => mixed): void;
on<T>(type: string, handler: (event: T) => void): void;

/**
* Set an access token for authenticated API requests of
Expand Down Expand Up @@ -3203,8 +3203,8 @@ export interface IViewer {
hasCustomRenderer(rendererId: string): boolean;
moveDir(direction: $Values<typeof NavigationDirection>): Promise<Image>;
moveTo(imageId: string): Promise<Image>;
off<T>(type: ViewerEventType, handler: (event: T) => mixed): void;
on<T>(type: ViewerEventType, handler: (event: T) => mixed): void;
off<T>(type: ViewerEventType, handler: (event: T) => void): void;
on<T>(type: ViewerEventType, handler: (event: T) => void): void;
project(lngLat: LngLat): Promise<number[]>;
projectFromBasic(basicPoint: number[]): Promise<number[]>;
remove(): void;
Expand Down Expand Up @@ -4099,8 +4099,8 @@ declare class Viewer implements IEventEmitter, IViewer {
unprojectToBasic(pixelPoint: number[]): Promise<number[]>;

fire<T>(type: string, event: T): void;
off<T>(type: string, handler: (event: T) => mixed): void;
on<T>(type: string, handler: (event: T) => mixed): void;
off<T>(type: string, handler: (event: T) => void): void;
on<T>(type: string, handler: (event: T) => void): void;
}
/**
* @class MapillaryError
Expand Down Expand Up @@ -5280,12 +5280,12 @@ declare class Component<TConfiguration: ComponentConfiguration>
/**
* @inheritdoc
*/
off<T>(type: string, handler: (event: T) => mixed): void;
off<T>(type: string, handler: (event: T) => void): void;

/**
* @inheritdoc
*/
on<T>(type: string, handler: (event: T) => mixed): void;
on<T>(type: string, handler: (event: T) => void): void;

/**
* Detect the viewer's new width and height and resize the component's
Expand Down

0 comments on commit c53eadb

Please sign in to comment.