<commit_before>/// <reference path="./IController" />
/// <reference path="./IDirective" />

module ClassRegistry {

    interface IInjectableFunction {
        (...arguments: any[]): any;
        $inject?: string[];
    }

    interface IWrappableClass extends Function {
        __registration: IRegistration;
    }

    interface IRegistration {
        staticClass:  IWrappableClass;
        namespace:    string;
        dependencies: string[];

    }

    interface IServiceRegistration extends IRegistration {
        name:         string;
    }

    interface IDirectiveRegistration extends IRegistration {
        name:         string;
        registration: any;
    }

    interface IControllerRegistration extends IRegistration {

    }

    export class Collector {

        private static instance: Collector;

        private serviceRegistrations: IServiceRegistration[] = [];
        private directiveRegistrations: IDirectiveRegistration[] = [];
        private controllerRegistrations: IControllerRegistration[] = [];

        static getInstance(): Collector {
            if (!Collector.instance) {
                Collector.instance = new Collector();
            }
            return Collector.instance;
        }

        static registerService(staticClass: IWrappableClass, serviceName: string, namespace: string, dependencies: string[]): IServiceRegistration {
            var registration = {
                staticClass:  staticClass,
                name:         serviceName,
                namespace:    namespace,
                dependencies: dependencies
            };
            Collector.checkRegistration(registration);
            this.getInstance().serviceRegistrations.push(registration);
            return registration;
        }

        static registerDirective(staticClass: IWrappableClass, directiveName: string, namespace: string, registration: any, dependencies: string[]): IDirectiveRegistration {
            var registration = {
                staticClass:  staticClass,
                name:         directiveName,
                namespace:    namespace,
                registration: registration,
                dependencies: dependencies
            };
            Collector.checkRegistration(registration);
            this.getInstance().directiveRegistrations.push(registration);
            return registration;
        }

        static registerController(staticClass: IWrappableClass, namespace: string, dependencies: string[]): IControllerRegistration {

            var registration = {
                staticClass:  staticClass,<commit_msg>minor fix<commit_after>/// <reference path="./IController" />
/// <reference path="./IDirective" />

module ClassRegistry {

    interface IInjectableFunction {
        (...arguments: any[]): any;
        $inject?: string[];
    }

    interface IWrappableClass extends Function {
        __registration: IRegistration;
    }

    interface IRegistration {
        staticClass:  IWrappableClass;
        namespace:    string;
        dependencies: string[];

    }

    interface IServiceRegistration extends IRegistration {
        name:         string;
    }

    interface IDirectiveRegistration extends IRegistration {
        name:         string;
        registration: any;
    }

    interface IControllerRegistration extends IRegistration {

    }

    export class Collector {

        private static instance: Collector;

        private serviceRegistrations: IServiceRegistration[] = [];
        private directiveRegistrations: IDirectiveRegistration[] = [];
        private controllerRegistrations: IControllerRegistration[] = [];

        static getInstance(): Collector {
            if (!Collector.instance) {
                Collector.instance = new Collector();
            }
            return Collector.instance;
        }

        static registerService(staticClass: Function, serviceName: string, namespace: string, dependencies: string[]): IServiceRegistration {
            var registration = {
                staticClass:  <IWrappableClass>staticClass,
                name:         serviceName,
                namespace:    namespace,
                dependencies: dependencies
            };
            Collector.checkRegistration(registration);
            this.getInstance().serviceRegistrations.push(registration);
            return registration;
        }

        static registerDirective(staticClass: Function, directiveName: string, namespace: string, registration: any, dependencies: string[]): IDirectiveRegistration {
            var registration = {
                staticClass:  <IWrappableClass>staticClass,
                name:         directiveName,
                namespace:    namespace,
                registration: registration,
                dependencies: dependencies
            };
            Collector.checkRegistration(registration);
            this.getInstance().directiveRegistrations.push(registration);
            return registration;
        }

        static registerController(staticClass: Function, namespace: string, dependencies: string[]): IControllerRegistration {

            var registration = {
                staticClass:  <IWrappableClass>staticClass,
{'fraction_non_alphanumeric': 0.08018327605956473, 'fraction_numerical': 0.0, 'mean_word_length': 2.1906211936662605, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, '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': '5859590', 'n_tokens_mistral': 1178, 'n_tokens_neox': 1126, 'n_words': 272}