Draft: Improve template overrides
Proposed API Additions
namespace Gtk {
export class Widget {
static set_template_from_uri(uri: string): void;
// Potential override to simplify usage with static fields
get_template_child<T extends GObject.Object>(constructorOrName: string | Function, name?: string): T;
get_template_child<T extends GObject.Object>(constructor: Function, name: string): T;
get_template_child<T extends GObject.Object>(name: string): T;
/**
* @example
* class Example {
* _children = this.get_template_children();
* }
*/
get_template_children<T extends Record<string, GObject.Object>>(): T;
}
}
Edited by Evan Welsh