@done-coding/output-node 0.1.0-alpha.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/types/index.d.ts CHANGED
@@ -6,7 +6,6 @@ import { OutputConsoleTypeEnum } from '@done-coding/output-core';
6
6
  import { OutputLogFile } from '@done-coding/output-core';
7
7
  import { OutputLogFileRaw } from '@done-coding/output-core';
8
8
  import { OutputLogFileTypeEnum } from '@done-coding/output-core';
9
- import { OutputTargetModeEnum } from '@done-coding/output-core';
10
9
 
11
10
  /**
12
11
  * 缓冲区大小配置常量
@@ -33,12 +32,9 @@ export declare function createOutputConsole(options?: CreateOutputConsoleOptions
33
32
 
34
33
  /**
35
34
  * Node.js 环境下的控制台输出选项
36
- * 继承核心包选项,但不需要手动传入 outputImpl,并且 silent 是可选的
35
+ * 继承核心包选项,但不需要手动传入 outputImpl
37
36
  */
38
- export declare interface CreateOutputConsoleOptions extends Omit<CreateOutputConsoleOptions_2, "outputFileFn"> {
39
- /** 日志文件输出函数 */
40
- outputFileFn?: OutputConsoleRaw;
41
- }
37
+ export declare type CreateOutputConsoleOptions = Omit<CreateOutputConsoleOptions_2, "outputImpl">;
42
38
 
43
39
  /**
44
40
  * 创建日志文件输出实例 (Node.js 适配版本)
@@ -51,31 +47,18 @@ export declare function createOutputLogFile(options: CreateOutputLogFileOptions)
51
47
 
52
48
  /**
53
49
  * Node.js 环境下的日志文件输出选项
54
- * 继承核心包选项,但不需要手动传入 outputImpl,并且 silent 是可选的
50
+ * 继承核心包选项,但不需要手动传入 outputImpl,并且增加 Node.js 特定参数
55
51
  * logFilePath 为必传参数,必须提供绝对路径
56
52
  */
57
- export declare interface CreateOutputLogFileOptions extends Omit<CreateOutputLogFileOptions_2, "logFilePath" | "outputConsoleFn">, Pick<LogFileOutputImplOptions, "sync" | "bufferSize"> {
53
+ export declare interface CreateOutputLogFileOptions extends Omit<CreateOutputLogFileOptions_2, "outputImpl" | "logFilePath" | "outputConsoleFn"> {
54
+ /** 日志文件是否同步写入 (默认: false,异步写入) */
55
+ sync?: boolean;
56
+ /** 异步写入是的缓冲区大小 (字节,默认: 4096) */
57
+ bufferSize?: number;
58
58
  /** 日志文件绝对路径 (必传) */
59
59
  logFilePath: string;
60
- /** 输出到控制台对应的方法 */
61
- outputConsoleFn?: OutputLogFileRaw;
62
60
  }
63
61
 
64
- /**
65
- * 创建基于 pino 的控制台输出实现
66
- * 用于 outputLogFile 切换到控制台输出时使用
67
- *
68
- * @param options 配置选项
69
- * @returns 控制台输出函数(保持日志级别类型)
70
- */
71
- export declare function createPinoConsoleOutput(): OutputLogFileRaw;
72
-
73
- /**
74
- * 创建控制台输出实现(基于 pino)
75
- * @returns 日志文件输出函数(输出到控制台)
76
- */
77
- export declare function createPinoConsoleOutputImpl(): OutputLogFileRaw;
78
-
79
62
  /**
80
63
  * 默认控制台输出颜色映射
81
64
  * 根据需求 4.2 定义的颜色方案
@@ -86,8 +69,6 @@ export declare const DEFAULT_CONSOLE_COLOR_MAP: Record<OutputConsoleTypeEnum, st
86
69
  * 控制台输出实现默认配置
87
70
  */
88
71
  export declare const DEFAULT_CONSOLE_OUTPUT_IMPL_OPTIONS: {
89
- /** 默认静默模式:关闭 */
90
- readonly silent: false;
91
72
  /** 默认启用颜色输出:是 */
92
73
  readonly enableColor: true;
93
74
  };
@@ -108,8 +89,6 @@ export declare const DEFAULT_ERROR_HANDLING_CONFIG: {
108
89
  * 日志文件输出实现默认配置
109
90
  */
110
91
  export declare const DEFAULT_LOG_FILE_OUTPUT_IMPL_OPTIONS: {
111
- /** 默认静默模式:关闭 */
112
- readonly silent: false;
113
92
  /** 默认同步写入:关闭(异步写入) */
114
93
  readonly sync: false;
115
94
  /** 默认缓冲区大小:4KB */
@@ -120,8 +99,6 @@ export declare const DEFAULT_LOG_FILE_OUTPUT_IMPL_OPTIONS: {
120
99
  * Node.js 控制台输出创建函数默认配置
121
100
  */
122
101
  export declare const DEFAULT_NODE_CREATE_OUTPUT_CONSOLE_OPTIONS: {
123
- /** 默认静默模式:关闭 */
124
- readonly silent: false;
125
102
  /** 默认启用颜色输出:是 */
126
103
  readonly enableColor: true;
127
104
  };
@@ -130,8 +107,6 @@ export declare const DEFAULT_NODE_CREATE_OUTPUT_CONSOLE_OPTIONS: {
130
107
  * Node.js 日志文件输出创建函数默认配置
131
108
  */
132
109
  export declare const DEFAULT_NODE_CREATE_OUTPUT_LOG_FILE_OPTIONS: {
133
- /** 默认静默模式:关闭 */
134
- readonly silent: false;
135
110
  /** 默认同步写入:关闭(异步写入) */
136
111
  readonly sync: false;
137
112
  /** 默认缓冲区大小:4KB */
@@ -195,20 +170,6 @@ export declare class InvalidOutputTypeError extends Error {
195
170
  constructor(type: unknown, validTypes: string[]);
196
171
  }
197
172
 
198
- /**
199
- * 日志文件输出实现配置选项
200
- */
201
- declare interface LogFileOutputImplOptions {
202
- /** 是否静默模式 */
203
- silent?: boolean;
204
- /** 日志文件路径 (可选,相对路径) */
205
- logFilePath?: string;
206
- /** 是否同步写入 (默认: false,异步写入) */
207
- sync?: boolean;
208
- /** 缓冲区大小 (字节,默认: 4096) */
209
- bufferSize?: number;
210
- }
211
-
212
173
  export { OutputConsole }
213
174
 
214
175
  export { OutputConsoleRaw }
@@ -221,6 +182,4 @@ export { OutputLogFileRaw }
221
182
 
222
183
  export { OutputLogFileTypeEnum }
223
184
 
224
- export { OutputTargetModeEnum }
225
-
226
185
  export { }