<commit_before>// /// <reference path="./node_modules/fs-git/fs-git.d.ts" />

// /// <reference path="./typings/node/node.d.ts" />
// /// <reference path="./typings/es6-promise/es6-promise.d.ts" />

declare module "packagemanager-backend" {
    import fsgit = require("fs-git");
    import _url = require("url");

    export class PackageManagerBackend {
        public opts:PackageManagerBackend.IOptions;

        constructor(opts:PackageManagerBackend.IOptions);

        public fetch(url:string, opts?:PackageManagerBackend.IOptions):Promise<Repo>;

        public search(opts:PackageManagerBackend.ISearchOptions):Promise<fsgit.IFileInfo[]>;

        public getByRecipe(recipe:PackageManagerBackend.IRecipe):Promise<PackageManagerBackend.IResult>;

        public resolveDependencies(recipe:PackageManagerBackend.IRecipe, repos:{
            [targetDir: string]: Repo;
        }, result:PackageManagerBackend.IResult):any;

        public pushAdditionalDependency(recipe:PackageManagerBackend.IRecipe, baseDep:PackageManagerBackend.IDependency, relativePath:string):void;

        public saveConfig(data: any): void;

        public loadConfig(): any;
    }

    export module PackageManagerBackend {
        interface IOptions {
            rootDir: string;
            offlineFirst?: boolean;
            repos?: IRepository[];
        }
        interface ISSHInfo {
            user: string;
            hostname: string;
            path: string;
        }
        interface ISearchOptions {
            repos?: IRepository[];
            offlineFirst?: boolean;
            globPattern?: string;
            globPatterns?: string[];
            regexpPattern?: RegExp;
            filter?: (fileInfo:fsgit.IFileInfo) => boolean;
        }
        interface IRecipe {
            baseRepo?: string;
            baseRef?: string;
            path: string;
            dependencies: {
                [name: string]: IDependency;
            };
            postProcessForDependency? (recipe:IRecipe, dep:IDependency, content:any): void;
        }
        interface IResult {
            recipe: IRecipe;
            dependencies: {
                [depName: string]: IDepResult;
            };
        }
        interface IDepResult {
            repo: Repo;
            error?: any;
            content?: Buffer;
        }
        interface IRepository {
            url: string;
            ref?: string;
        }
        interface IDependency {
            repo?: string;
            ref?: string;
            name?: string;
            path?: string;
        }
    }

    export class Repo {
        public opts:PackageManagerBackend.IOptions;
        public url:string;
        public targetDir:string;
        public networkConnectivity:boolean;
        public fetchError:string;
        public alreadyTryFetchAll:boolean;
        public urlInfo:_url.Url;
        public sshInfo:PackageManagerBackend.ISSHInfo;

        constructor(opts:PackageManagerBackend.IOptions, url:string);

        public getHomeDir():string;

        public resolveTargetDir():void;

        public resolve():Promise<void>;

        public gitFetchAll():Promise<void>;

        public buildCommand(...args:string[]):string;

        public open(ref:string):Promise<fsgit.FSGit>;
    }

    export module utils {
        function debug(...args:any[]):void;

        function extend(dest:any, ...sources:any[]):any;

        function deepClone(obj:any):any;
    }
}
<commit_msg>update packagemanager-backend.d.ts<commit_after>// /// <reference path="./node_modules/fs-git/fs-git.d.ts" />

// /// <reference path="./typings/node/node.d.ts" />
// /// <reference path="./typings/es6-promise/es6-promise.d.ts" />

declare module "packagemanager-backend" {
    import fsgit = require("fs-git");
    import _url = require("url");

    export class PackageManagerBackend {
        public opts:PackageManagerBackend.IOptions;

        public baseDir: string;

        constructor(opts:PackageManagerBackend.IOptions);

        public fetch(url:string, opts?:PackageManagerBackend.IOptions):Promise<Repo>;

        public search(opts:PackageManagerBackend.ISearchOptions):Promise<fsgit.IFileInfo[]>;

        public getByRecipe(recipe:PackageManagerBackend.IRecipe):Promise<PackageManagerBackend.IResult>;

        public resolveDependencies(recipe:PackageManagerBackend.IRecipe, repos:{
            [targetDir: string]: Repo;
        }, result:PackageManagerBackend.IResult):any;

        public pushAdditionalDependency(recipe:PackageManagerBackend.IRecipe, baseDep:PackageManagerBackend.IDependency, relativePath:string):void;

        public saveConfig(data: any): void;

        public loadConfig(): any;
    }

    export module PackageManagerBackend {
        interface IOptions {
            rootDir: string;
            offlineFirst?: boolean;
            repos?: IRepository[];
        }
        interface ISSHInfo {
            user: string;
            hostname: string;
            path: string;
        }
        interface ISearchOptions {
            repos?: IRepository[];
            offlineFirst?: boolean;
            globPattern?: string;
            globPatterns?: string[];
            regexpPattern?: RegExp;
            filter?: (fileInfo:fsgit.IFileInfo) => boolean;
        }
        interface IRecipe {
            baseRepo?: string;
            baseRef?: string;
            path: string;
            dependencies: {
                [name: string]: IDependency;
            };
            postProcessForDependency? (recipe:IRecipe, dep:IDependency, content:any): void;
        }
        interface IResult {
            recipe: IRecipe;
            dependencies: {
                [depName: string]: IDepResult;
            };
        }
        interface IDepResult {
            repo: Repo;
            error?: any;
            content?: Buffer;
        }
        interface IRepository {
            url: string;
            ref?: string;
        }
        interface IDependency {
            repo?: string;
            ref?: string;
            name?: string;
            path?: string;
        }
    }

    export class Repo {
        public opts:PackageManagerBackend.IOptions;
        public url:string;
        public targetDir:string;
        public networkConnectivity:boolean;
        public fetchError:string;
        public alreadyTryFetchAll:boolean;
        public urlInfo:_url.Url;
        public sshInfo:PackageManagerBackend.ISSHInfo;

        constructor(opts:PackageManagerBackend.IOptions, url:string);

        public getHomeDir():string;

        public resolveTargetDir():void;

        public resolve():Promise<void>;

        public gitFetchAll():Promise<void>;

        public buildCommand(...args:string[]):string;

        public open(ref:string):Promise<fsgit.FSGit>;
    }

    export module utils {
        function debug(...args:any[]):void;

        function extend(dest:any, ...sources:any[]):any;

        function deepClone(obj:any):any;
    }
}

{'fraction_non_alphanumeric': 0.10804235832856325, 'fraction_numerical': 0.0005724098454493417, 'mean_word_length': 2.1467807294011707, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 23, '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': '7528691', 'n_tokens_mistral': 1876, 'n_tokens_neox': 1846, 'n_words': 350}