Class ghost_events_queryer_t

ghost event finder

let ghost_events_queryer = jsstp.new_event_queryer();
if(!ghost_events_queryer.available)
console.log("Current ghost does not support event queries");
if(ghost_events_queryer.has_event("OnBoom"))
jsstp.OnBoom();

jsstp.ghost_events_queryer_t

jsstp_t.new_event_queryer

Hierarchy

  • ExtensibleFunction<[string, security_level_t], Promise<Boolean>>
    • ghost_events_queryer_t
  • Call declarations Check for the existence of events, ghost requires at least Has_Event event support and can be made more efficient by providing Get_Supported_Events events

    Parameters

    • event_name: String
    • Optionalsecurity_level: security_level_t

    Returns Promise<Boolean>

    let result = await ghost_events_queryer("On_connect");
    

    based on ghost_events_queryer_t.check_event

  • The function's signature

    Parameters

    • Rest...args: [string, security_level_t]

    Returns Promise<Boolean>

Constructors

  • Constructing an Event Querier

    Parameters

    Returns ghost_events_queryer_t

  • Initializing from a function instance

    Parameters

    • func: ((...args: [string, security_level_t]) => Promise<Boolean>)
        • (...args): Promise<Boolean>
        • Parameters

          • Rest...args: [string, security_level_t]

          Returns Promise<Boolean>

    Returns ExtensibleFunction<[string, security_level_t], Promise<Boolean>>

Properties

default_security_level: security_level_t

Queries the default security level, which is "local" in nodejs and "external" in browsers.

length: number

The number of arguments expected by the function.
MDN Reference

name: string

Function's name.
MDN Reference

Accessors

  • get available(): Boolean
  • Check if the event can be checked

    Returns Boolean

    if(!ghost_events_queryer.available)
    console.error("Unable to check events");
  • get fast_query_available(): Boolean
  • Check if you can use Get_Supported_Events to quickly get a list of supported events

    Returns Boolean

    if(!ghost_events_queryer.fast_query_available)
    console.info("Unable to quickly fetch list of supported events");
    else
    console.info("Hell yeah");

    If it's not supported it will just be slower, check_event will still work

Methods

  • Calls a function and replaces the function's this value with the specified object and the function's arguments with the specified array.
    MDN Reference

    Parameters

    • thisArg: ((...args: [string, security_level_t]) => Promise<Boolean>)

      The object that will be used as the this object.

        • (...args): Promise<Boolean>
        • Parameters

          • Rest...args: [string, security_level_t]

          Returns Promise<Boolean>

    • OptionalargArray: [string, security_level_t]

      A set of arguments to be passed to the function.

    Returns Promise<Boolean>

  • For a given function, creates a bound function with the same body as the original function.
    The this object of the bound function is associated with the specified object and has the specified initial argument.
    MDN Reference

    Parameters

    • thisArg: ((...args: [string, security_level_t]) => Promise<Boolean>)

      An object that the this keyword can refer to in the new function.

        • (...args): Promise<Boolean>
        • Parameters

          • Rest...args: [string, security_level_t]

          Returns Promise<Boolean>

    • Rest...argArray: any

      A list of arguments to be passed to the new function.

    Returns ((...args: [string, security_level_t]) => Promise<Boolean>)

      • (...args): Promise<Boolean>
      • Parameters

        • Rest...args: [string, security_level_t]

        Returns Promise<Boolean>

  • Calls a method on an object that replaces the current object with another object.
    MDN Reference

    Parameters

    • thisArg: ((...args: [string, security_level_t]) => Promise<Boolean>)

      The object that will be used as the current object.

        • (...args): Promise<Boolean>
        • Parameters

          • Rest...args: [string, security_level_t]

          Returns Promise<Boolean>

    • Rest...argArray: [string, security_level_t]

      The list of arguments to be passed to the method.

    Returns Promise<Boolean>

  • To check for the existence of events, ghost requires at least Has_Event event support and can be made more efficient by providing Get_Supported_Events events

    Parameters

    • event_name: String
    • Optionalsecurity_level: security_level_t

    Returns Promise<Boolean>

    let result = await ghost_events_queryer.check_event("On_connect");
    

    base on jsstp_t.has_event and jsstp_t.get_supported_events