import { LogStyle } from '../shared/log-style.define'; import { LogConfigure, LabelTemplate } from '../shared/log.configure'; export interface TimeHeapItem { time: number; this: any; thisname: string; desc?: string; } export declare class LogService { /**保存要输出的 */ private dataStr; /**保存要输出的对象 */ private dataArray; /**保存样式 */ private outStyle; /**是否将对象和数字显示为表格类型 */ flag: { Array: boolean; Object: boolean; }; private _label; timeHeap: TimeHeapItem[]; constructor(logConfigure: LogConfigure); /** * 将数据初始化 * * */ private setDataInit; /** * @description 设置开始,计算,结束的输出格式 * @author cyia * @date 2018-09-06 * @param label 传入模版 * @memberof LogService */ label: LabelTemplate; /** * @description 设置输出的样式, * @author cyia * @date 2018-09-06 * @param [str=''] 字符串传参,和标签中style=""的格式一致 * @param [styleObj=null] 驼峰对象 * @memberof LogService */ setDataStyle(str?: string, styleObj?: LogStyle | null): void; /** * * todo 运行时间,记录this,开始时间,当结束时返回现在时间记录 * * * */ /** * @description ngOnInit或constructor使用 * @author cyia * @date 2018-09-06 * @param [component=null] angular组件this * @param [desc=''] group的描述 * @memberof LogService */ start(component?: any, desc?: string): void; /** * @description 计算从组件开始运行到此的时间 * @author cyia * @date 2018-09-06 * @param component angular组件this * @memberof LogService */ compute(component: any): void; /** * @description 调用this可以使用 * @author cyia * @date 2018-09-06 * @param component angular组件this * @memberof LogService */ end(component: any): void; /** * @description 与普通log一样使用 * @author cyia * @date 2018-09-06 * @param param * @memberof LogService */ log(...param: any[]): void; warn(...param: any[]): void; error(...param: any[]): void; info(...param: any[]): void; /** * log,warn,error,info调用 * * * * * */ /** * @description 打印使用 * @author cyia * @date 2018-09-06 * * @param method 输出方法 * @param param 参数 * @memberof LogService */ private _printOut; /**两种方式, * 1.普通输出 * 2.表格输出 */ private logprint; /** * @description 从堆栈里获得行数 * @author cyia * @date 2018-09-06 * * @returns * @memberof LogService */ private getLine; /** * @description 计算是否有函数,判断数组或对象是否包含函数,如果包含那么就仍然普通导出 * @author cyia * @date 2018-09-06 * * @param type * @param param * @returns * @memberof LogService */ private containFunction; /** * @description 在对象中搜索类型 * @author cyia * @date 2018-09-06 * * @param param * @returns * @memberof LogService */ private _searchObject; /** * @description 在数组中搜索类型 * @author cyia * @date 2018-09-06 * * @param param * @returns * @memberof LogService */ private _searchArray; /** * @description 驼峰法命名转化 * @author cyia * @date 2018-09-06 * * @param name * @returns * @memberof LogService */ private coverName; /** * @description 往模版添加值 * @author cyia * @date 2018-09-06 * * @param label * @param obj * @returns * @memberof LogService */ private printOutLabelStr; }