import { type } from "os";

declare class TopCamIkm6 {
    constructor(p?:{cam_type?:'genesis'|'incam'='genesis', error_handle?:0|1=1});
    /**
     * 获取料号id
     * @returns 返回料号名对应的id
     * @example 
     * var jobid = ikm.get_job_id("demo");
     */
    get_job_id(job_name:string):number;

    
    /**
     * 获取列表数据
     * @example 
     * ikm.select_fieldarray({ 
        table:'pdm_job',field:'jobname',order:'id DESC'
    })
     */
    select_fieldarray(p:{table:string, field: any, order: any}):any;
    
    /**
     * 获取数据,返回查找到的第一个
     * @example 
     * ikm.select_value({
        table: 'pdm_job', field: 'jobname', 'where': { id: 1 }  
    })
     */
    select_value(p:{table:string, field: any, where: any}):any;

    /**
     * 获取时间日期 
     * @example 
     * console.log('获取时间日期：' + ikm.get_now());
     */
    get_now():string;
    
    /**
     * 获取时间日期 
     * @example 
     * console.log('获取时间日期：' + ikm.get_today());
     */
    get_today():string;

     /**
     * 获取配置 
     * @example 
     * ikm.get_config("measure-report-config","excel_template")
     */
    get_config( path:string, name:string ):any;
    
    /**
     * 保存配置 
     * @example 
     * ikm.save_config({path:"test",name:"test",value:'test'})
     */
    save_config(p:{path: string , name:string, value: string }):void;

    /**
     * 插入数据 
     * @example 
     * ikm.insert({
        table:"pdm_job", data:{jobname:"test"}
    })
     */
    insert(p:{table: string , data:object }):void;

    /**
     * 删除数据 
     * @example 
     * ikm.dele({
        table:"pdm_job", where: { jobname:"test2" }
    })
     */
    dele(p:{table: string , where:Object }):void;

    /**
     * 更新数据 
     * @example 
     * ikm.update({
        table:"pdm_job", data:{jobname:"test2"}, where: { jobname:"test" }
    })
     */
    update(p:{table: string , data:Object, where:Object }):void;

    /**
     * 批量插入数据 
     * @example 
     * ikm.batch_insert({
        table:"pdm_job", 
        field: ["jobname"],
        data: [{jobname:"test7""}, {jobname:"test8""}]
    })
     */
    batch_insert(p:{table: string , field:array, data:array }):void;
    
    /**
     * 更新料号工作流程日志
     * @returns 
     * @example 
     * ikm.update_flow_report({job_id:1 , process_id: 1, report: '<html><head></head><body>test</body></html>'});
     */
    update_flow_report(p:{job_id: number, process_id:number, report:string }):void;
    
    /**
     * get_info_style
     * @returns 
     * @example 
     * var res = ikm.get_info_style({infoname:'pcb_type'});
     */
    get_info_style(p:{infoname: string }):[Object];

    /**
     * 获取流程状态
     * @returns 返回流程的状态
     * @example 
     * var res = ikm.get_process_status({jobid:1, process_id:16});
     */
    get_process_status(p:{jobid: number, process_id:number}):Object;

    /**
     * round_number
     * @returns number
     * @example 
     * var res = ikm.round_number(13.16221, 2);
     */
    round_number(number:number, precision:number):number;

    /**
     * 获取IKM的DB连接参数
     * 
     * @param 
     * @returns 返回IKM的DB连接参数
     */
    getIkmConnectParameter():JSON

    /**
     * 获取料号info
     * 
     * @param 
     * @returns 返回料号info
     */
    get_jobinfo(p:{jobid:number, jobinfo:string}):any;
}
    
export = TopCamIkm6;


