<commit_before>﻿ko.bindingHandlers["numericValue"] = {
    init: (element: HTMLElement, valueAccessor: () => KnockoutObservable<number>, allBindingsAccessor: KnockoutAllBindingsAccessor) => {
        var observable = valueAccessor();
        var interceptor = ko.computed({
            read: () => observable().toString(),
            write: value => {
                observable(parseFloat(value) || 0);
            }
        });
        ko.bindingHandlers.value.init(element, () => { return interceptor; }, allBindingsAccessor);
    },
    update: ko.bindingHandlers.value.update
};

ko.bindingHandlers["editableText"] = {
    init: (element: HTMLElement, valueAccessor: () => KnockoutObservable<string>) => {
        element.addEventListener("blur", () => {
            var observable = valueAccessor();
            observable(this.innerHTML);
        });
    },
    update: (element, valueAccessor) => {
        var value = ko.utils.unwrapObservable(valueAccessor());
        element.innerHTML = value;
    }
};

interface ObservableSliderOptions {
    min: number
    max: number
    scale: string
    step: number
    lower: KnockoutObservable<number>
    upper: KnockoutObservable<number>
}

ko.bindingHandlers["slider"] = {
    init: (element: HTMLElement, valueAccessor: () => ObservableSliderOptions) => {
        var value = valueAccessor();<commit_msg>Use correct function signature<commit_after>﻿ko.bindingHandlers["numericValue"] = {
    init: (element: HTMLElement, valueAccessor: () => KnockoutObservable<number>, allBindingsAccessor: KnockoutAllBindingsAccessor) => {
        var observable = valueAccessor();
        var interceptor = ko.computed({
            read: () => observable().toString(),
            write: value => {
                observable(parseFloat(value) || 0);
            }
        });
        ko.bindingHandlers.value.init(element, () => { return interceptor; }, allBindingsAccessor);
    },
    update: ko.bindingHandlers.value.update
};

ko.bindingHandlers["editableText"] = {
    init: (element: HTMLElement, valueAccessor: () => KnockoutObservable<string>) => {
        element.addEventListener("blur", _ => {
            var observable = valueAccessor();
            observable(this.innerHTML);
        });
    },
    update: (element, valueAccessor) => {
        var value = ko.utils.unwrapObservable(valueAccessor());
        element.innerHTML = value;
    }
};

interface ObservableSliderOptions {
    min: number
    max: number
    scale: string
    step: number
    lower: KnockoutObservable<number>
    upper: KnockoutObservable<number>
}

ko.bindingHandlers["slider"] = {
    init: (element: HTMLElement, valueAccessor: () => ObservableSliderOptions) => {
        var value = valueAccessor();
{'fraction_non_alphanumeric': 0.13556851311953352, 'fraction_numerical': 0.0007288629737609329, 'mean_word_length': 3.036764705882353, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 33, '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': '404519', 'n_tokens_mistral': 754, 'n_tokens_neox': 743, 'n_words': 138}