Skip to content

fix(typescript): type private methods as private #105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions source/event_hub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ export class EventHub {
return response;
}

_removeReplyCallback(eventId: string) {
private _removeReplyCallback(eventId: string) {
if (this._replyCallbacks[eventId]) {
delete this._replyCallbacks[eventId];
}
Expand All @@ -359,7 +359,7 @@ export class EventHub {
* Run *callback* if event hub is connected to server.
* @param {Function} callback
*/
_runWhenConnected(callback: ConnectionCallback) {
private _runWhenConnected(callback: ConnectionCallback) {
if (!this.isConnected()) {
this.logger.debug("Event hub is not connected, event is delayed.");
this._unsentEvents.push(callback);
Expand Down Expand Up @@ -425,7 +425,7 @@ export class EventHub {
* @param {String} subscription expression
* @return {String} topic
*/
_getExpressionTopic(subscription: string) {
private _getExpressionTopic(subscription: string) {
// retreive the value of a topic on the format "topic=value"
const regex = new RegExp("^topic[ ]?=[ '\"]?([\\w-,./*@+]+)['\"]?$");
const matches = subscription.trim().match(regex);
Expand All @@ -448,7 +448,7 @@ export class EventHub {
* @param {Object} metadata Optional information about subscriber.
* @return {Object} subscriber information.
*/
_addSubscriber(
private _addSubscriber(
subscription: string,
callback: EventCallback,
metadata: SubscriberMetadata = {
Expand Down Expand Up @@ -485,15 +485,15 @@ export class EventHub {
* Notify server of new *subscriber*.
* @param {Object} subscriber subscriber information
*/
_notifyServerAboutSubscriber(subscriber: Subscriber) {
private _notifyServerAboutSubscriber(subscriber: Subscriber) {
const subscribeEvent = new Event("ftrack.meta.subscribe", {
subscriber: subscriber.metadata,
subscription: subscriber.subscription,
});
this.publish(subscribeEvent);
}

_notifyServerAboutUnsubscribe(subscriber: SubscriberMetadata) {
private _notifyServerAboutUnsubscribe(subscriber: SubscriberMetadata) {
const unsubscribeEvent = new Event("ftrack.meta.unsubscribe", {
subscriber,
});
Expand Down Expand Up @@ -528,7 +528,7 @@ export class EventHub {
* @param {Object} eventPayload
* @return {Boolean}
*/
_IsSubscriberInterestedIn(
private _IsSubscriberInterestedIn(
subscriber: Subscriber,
eventPayload: EventPayload
) {
Expand All @@ -543,7 +543,7 @@ export class EventHub {
* Handle Events.
* @param {Object} eventPayload Event payload
*/
_handle(eventPayload: EventPayload) {
private _handle(eventPayload: EventPayload) {
this.logger.debug("Event received", eventPayload);

for (const subscriber of this._subscribers) {
Expand Down Expand Up @@ -577,7 +577,7 @@ export class EventHub {
* Handle reply event.
* @param {Object} eventPayload Event payload
*/
_handleReply(eventPayload: EventPayload) {
private _handleReply(eventPayload: EventPayload) {
this.logger.debug("Reply received", eventPayload);
const onReplyCallback = !eventPayload.inReplyToEvent
? null
Expand Down