<commit_before>// Type definitions for src/dslEngine.js
// Project: DSLEngine
// Definitions by: <NAME> <<EMAIL>>
// Definitions: https://github.com/borisyankov/DefinitelyTyped

declare module "dslengine" {

    import * as mongoose from "mongoose";
    import {Promise} from "es6-promise";

    export interface DSLEngine {
	cell() : CellEngine;
	collection() : CollectionEngine;
	// dashboard() : DashboardEngine;
	document() : DocumentEngine;
	ejectSafelyToken() : Token;
	generateToken(db : mongoose.Connection) : Token;
	loadDSL(dsl : string) : Promise<void>;
	pushToken(token : Token) : void;
    }

    export interface Token {}

    interface ModelEngine {}

    export interface CellEngine extends ModelEngine {
	getValue(id : string) : Promise<CellContent>;

	list() : Cell[];
    }

    export interface CollectionEngine extends ModelEngine {
        getIndexPage(
	    id : string, 
	    option : OptionDisplayIndexPage
	) : Promise<IndexPage>;

        getShowPage(
	    collectionId : string, 
	    documentId : string
	) : Promise<Document[]>;
        
	list() : Collection[];
    }
        
    export interface DocumentEngine extends ModelEngine {
	getShowPage(id : string, documentId : string) : Promise<Document[]>;
	list() : Doc[];
    }

    export interface Doc {
	id: string;
	name: string;
	label: string;
    }

    export interface Collection {
    	id : string;
        name : string;
        label : string;
    }

    export interface Cell {
	id: string;
	label: string;
    }

    export interface CellContent {
	id: string;
	label: string;
	type: string;
	result: Object;
    }

    export interface Document {
	id: string;
	name: string;
	label: string;
    }

    export interface HeaderIndexPage {
        label : string;
        name : string;
        selectable : boolean;
        sortable : boolean;
    }

    export interface IndexPage {
    	id : string;
        name : string;
        label : string;
        numdocs : number;
        perpage : number;
        header : HeaderIndexPage[];
        documents : IndexDoc[];
    }

    export interface IndexDoc {
    	id : string;
	data : InteractiveDocument[];
    }

    export interface Document {
        label : string;
        name : string;
        // Qua dipende dalla query
        raw : Object;
        // Il risultato di una funzione JavaScript.
        // Un malefico retaggio dal passato.
        data : any;
    }

    export interface InteractiveDocument extends Document {
	selectable : boolean;
	sortable : boolean;
    }

    export interface OptionDisplayIndexPage {
        page : number;
    	sort : string;
	order : string;
    }

    export interface NoConnectionEstabilished {}

    interface Error {
	message() : string;
    }

    export interface CollectionNotFoundException extends Error {}
    export interface DSLSyntaxException extends Error {}
    export interface NoConnectionEstabilished extends Error {}
    export interface NoTokenConnectedException extends Error {}
    export interface RequiredParamException extends Error {}
    export interface TokenAlreadyInsertException extends Error {}
    export interface UnexpectedParamException extends Error {}
    export interface WrongTypeException extends Error {}
}

<commit_msg>Fix definition<commit_after>// Type definitions for src/dslEngine.js
// Project: DSLEngine
// Definitions by: <NAME> <<EMAIL>>
// Definitions: https://github.com/borisyankov/DefinitelyTyped

declare module "dslengine" {

    import * as mongoose from "mongoose";
    import {Promise} from "es6-promise";

    export interface DSLEngine {
	cell() : CellEngine;
	collection() : CollectionEngine;
	// dashboard() : DashboardEngine;
	document() : DocumentEngine;
	ejectSafelyToken() : Token;
	generateToken(db : mongoose.Connection) : Token;
	loadDSL(dsl : string) : Promise<void>;
	pushToken(token : Token) : void;
    }

    export interface Token {}

    interface ModelEngine {}

    export interface CellEngine extends ModelEngine {
	getValue(id : string) : Promise<CellContent>;

	list() : Cell[];
    }

    export interface CollectionEngine extends ModelEngine {
        getIndexPage(
	    id : string, 
	    option : OptionDisplayIndexPage
	) : Promise<IndexPage>;

        getShowPage(
	    collectionId : string, 
	    documentId : string
	) : Promise<Document[]>;
        
	list() : Collection[];
    }
        
    export interface DocumentEngine extends ModelEngine {
	getShowPage(id : string, documentId : string) : Promise<Document[]>;
	list() : Doc[];
    }

    export interface Doc {
	id: string;
	name: string;
	label: string;
    }

    export interface Collection {
    	id : string;
        name : string;
        label : string;
    }

    export interface Cell {
	id: string;
	label: string;
    }

    export interface CellContent {
	id: string;
	label: string;
	type: string;
	result: Object;
    }

    export interface HeaderIndexPage {
        label : string;
        name : string;
        selectable : boolean;
        sortable : boolean;
    }

    export interface IndexPage {
    	id : string;
        name : string;
        label : string;
        numdocs : number;
        perpage : number;
        header : HeaderIndexPage[];
        documents : IndexDoc[];
    }

    export interface IndexDoc {
    	id : string;
	data : InteractiveDocument[];
    }

    export interface Document {
        label : string;
        name : string;
        // Qua dipende dalla query
        raw : Object;
        // Il risultato di una funzione JavaScript.
        // Un malefico retaggio dal passato.
        data : any;
    }

    export interface InteractiveDocument extends Document {
	selectable : boolean;
	sortable : boolean;
    }

    export interface OptionDisplayIndexPage {
        page : number;
    	sort : string;
	order : string;
    }

    export interface NoConnectionEstabilished {}

    interface Error {
	message() : string;
    }

    export interface CollectionNotFoundException extends Error {}
    export interface DSLSyntaxException extends Error {}
    export interface NoConnectionEstabilished extends Error {}
    export interface NoTokenConnectedException extends Error {}
    export interface RequiredParamException extends Error {}
    export interface TokenAlreadyInsertException extends Error {}
    export interface UnexpectedParamException extends Error {}
    export interface WrongTypeException extends Error {}
}


{'fraction_non_alphanumeric': 0.08717310087173101, 'fraction_numerical': 0.00031133250311332503, 'mean_word_length': 2.741991846243448, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 2, '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': '2926678', 'n_tokens_mistral': 1764, 'n_tokens_neox': 1713, 'n_words': 520}