<commit_before>import { WidgetBase } from './WidgetBase';
import { Constructor, DNode, WidgetBaseInterface, RegistryLabel } from './interfaces';
import { w } from './d';
import { defaultMappers, BaseInjector, Mappers } from './Injector';

export function Container<W extends WidgetBaseInterface>(
	component: Constructor<W> | RegistryLabel,
	name: RegistryLabel,
	{
		getProperties = defaultMappers.getProperties,
		getChildren = defaultMappers.getChildren
	}: Partial<Mappers> = defaultMappers
): Constructor<WidgetBase<W['properties']>> {

	return class extends WidgetBase<any> {
		protected render(): DNode {
			const { properties, children } = this;

			return w<BaseInjector<any>>(name, {
				bind: this,
				render: () => w(component, properties, children),
				getProperties,
				properties,<commit_msg>jig the typings round to play nicely with ts-loader (#526)<commit_after>import { WidgetBase } from './WidgetBase';
import { Constructor, DNode, WidgetBaseInterface, RegistryLabel } from './interfaces';
import { w } from './d';
import { defaultMappers, BaseInjector, Mappers } from './Injector';

export function Container<W extends WidgetBaseInterface>(
	component: Constructor<W> | RegistryLabel,
	name: RegistryLabel,
	mappers: Partial<Mappers> = defaultMappers
): Constructor<WidgetBase<W['properties']>> {
	const {
		getProperties = defaultMappers.getProperties,
		getChildren = defaultMappers.getChildren
	} = mappers;

	return class extends WidgetBase<any> {
		protected render(): DNode {
			const { properties, children } = this;

			return w<BaseInjector<any>>(name, {
				bind: this,
				render: () => w(component, properties, children),
				getProperties,
				properties,
{'fraction_non_alphanumeric': 0.12300413956238912, 'fraction_numerical': 0.0017740981667652277, 'mean_word_length': 5.220588235294118, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7102509', 'n_tokens_mistral': 527, 'n_tokens_neox': 501, 'n_words': 129}