Interface SubscribedEventSavedData<EventTypeID>

The data for an event subscription.

interface SubscribedEventSavedData<EventTypeID extends SubscribedEventTypeID> {
    code: string;
    enabled?: boolean;
    eventType: EventTypeID;
    metadata?: {
        displayIcon?: string;
        displayName?: string;
        lastModified?: number;
        [key: string]: string | number | boolean;
    };
    saveID: string;
}

Type Parameters

Properties

code: string

The JavaScript code of the event subscription's callback function.

enabled?: boolean

Whether or not the event subscription is enabled.

true
eventType: EventTypeID

The type ID of the event this subscription is for.

metadata?: {
    displayIcon?: string;
    displayName?: string;
    lastModified?: number;
    [key: string]: string | number | boolean;
}

Optional metadata for the event subscription.

Type declaration

  • [key: string]: string | number | boolean

    Additional metadata for the event subscription.

  • OptionaldisplayIcon?: string

    The display icon of the event subscription.

    Should be a texture path.

  • OptionaldisplayName?: string

    The display name of the event subscription.

  • OptionallastModified?: number

    The last time the event subscription was modified.

saveID: string

The unique ID of the event subscription.

Should be in the following format:

const creationTime: number = Date.now(); // The time the event subscription was created.
const number1: number = Math.round(Math.random() * 100000); // Random integer between 0 and 100,000.
const number2: number = Math.round(Math.random() * 100000); // Random integer between 0 and 100,000.
const saveID: string = `EventSubscription:${creationTime}_${number1}_${number2}`
`EventSubscription:${Date.now()}_${Math.round(Math.random() * 100000)}_${Math.round(Math.random() * 100000)}`