GObject.type_from_name

function type_from_name(name: String): GObject.Type {
    // Gjs wrapper for g_type_from_name()
}
  

Lookup the type ID from a given type name, returning 0 if no type has been registered under this name (this is the preferred method to find out by name whether a specific type has been registered yet).

name

type name to lookup

Returns

corresponding type ID or 0