likec4 1.48.0 → 1.49.0

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.
Files changed (113) hide show
  1. package/README.md +11 -1
  2. package/__app__/src/likec4.js +5595 -4127
  3. package/__app__/src/routes/index.js +3 -153
  4. package/__app__/src/routes/projects.js +21 -1087
  5. package/__app__/src/routes/single.js +1221 -16
  6. package/__app__/src/style.css +1 -1
  7. package/__app__/src/vendors.js +3507 -894
  8. package/__app__/src/webcomponent.js +1 -1
  9. package/config/schema.json +155 -143
  10. package/dist/THIRD-PARTY-LICENSES.md +1739 -0
  11. package/dist/_chunks/GraphvizBinaryAdapter.mjs +72 -0
  12. package/dist/_chunks/filenames.mjs +14 -0
  13. package/dist/_chunks/index.d.mts +224 -129
  14. package/dist/_chunks/index2.d.mts +2033 -1908
  15. package/dist/_chunks/libs/@chevrotain/gast.mjs +1 -3969
  16. package/dist/_chunks/libs/@chevrotain/regexp-to-ast.mjs +9 -785
  17. package/dist/_chunks/libs/@chevrotain/utils.mjs +1 -37
  18. package/dist/_chunks/libs/@hono/mcp.mjs +34 -0
  19. package/dist/_chunks/libs/@hono/node-server.mjs +1 -436
  20. package/dist/_chunks/libs/@logtape/logtape.d.mts +741 -0
  21. package/dist/_chunks/libs/@logtape/logtape.mjs +6 -1354
  22. package/dist/_chunks/libs/@lume/kiwi.mjs +1 -1355
  23. package/dist/_chunks/libs/@modelcontextprotocol/sdk.d.mts +14 -14
  24. package/dist/_chunks/libs/@modelcontextprotocol/sdk.mjs +12 -25105
  25. package/dist/_chunks/libs/@msgpack/msgpack.mjs +1 -1503
  26. package/dist/_chunks/libs/@nanostores/react.mjs +1 -30
  27. package/dist/_chunks/libs/@smithy/util-base64.mjs +1 -100
  28. package/dist/_chunks/libs/ajv.mjs +1 -777
  29. package/dist/_chunks/libs/atomically.mjs +1 -362
  30. package/dist/_chunks/libs/birpc.mjs +1 -201
  31. package/dist/_chunks/libs/chevrotain-allstar.mjs +2 -850
  32. package/dist/_chunks/libs/chevrotain.mjs +55 -6229
  33. package/dist/_chunks/libs/conf.mjs +1 -2258
  34. package/dist/_chunks/libs/defu.mjs +1 -42
  35. package/dist/_chunks/libs/esm-env.mjs +1 -5
  36. package/dist/_chunks/libs/eventemitter3.mjs +1 -243
  37. package/dist/_chunks/libs/fast-equals.mjs +1 -446
  38. package/dist/_chunks/libs/find-up-simple.mjs +1 -24
  39. package/dist/_chunks/libs/get-port.mjs +1 -107
  40. package/dist/_chunks/libs/is-docker.mjs +1 -26
  41. package/dist/_chunks/libs/is-error-instance.mjs +1 -26
  42. package/dist/_chunks/libs/is-inside-container.mjs +1 -20
  43. package/dist/_chunks/libs/is-plain-obj.mjs +1 -9
  44. package/dist/_chunks/libs/isexe.mjs +1 -127
  45. package/dist/_chunks/libs/json5.mjs +14 -959
  46. package/dist/_chunks/libs/khroma.mjs +1 -605
  47. package/dist/_chunks/libs/ky.mjs +2 -807
  48. package/dist/_chunks/libs/langium.d.mts +2880 -2844
  49. package/dist/_chunks/libs/langium.mjs +32 -20351
  50. package/dist/_chunks/libs/merge-error-cause.mjs +2 -746
  51. package/dist/_chunks/libs/nanostores.mjs +1 -198
  52. package/dist/_chunks/libs/p-limit.mjs +1 -120
  53. package/dist/_chunks/libs/p-queue.mjs +1 -449
  54. package/dist/_chunks/libs/package-manager-detector.mjs +1 -559
  55. package/dist/_chunks/libs/package-up.mjs +1 -10
  56. package/dist/_chunks/libs/parse-ms.mjs +1 -36
  57. package/dist/_chunks/libs/pathe.mjs +1 -0
  58. package/dist/_chunks/libs/picomatch.mjs +1 -1673
  59. package/dist/_chunks/libs/pretty-ms.mjs +1 -80
  60. package/dist/_chunks/libs/remeda.mjs +1 -690
  61. package/dist/_chunks/libs/safe-stringify.mjs +1 -21
  62. package/dist/_chunks/libs/strip-indent.mjs +1 -15
  63. package/dist/_chunks/libs/tinyrainbow.mjs +1 -88
  64. package/dist/_chunks/libs/ts-graphviz.mjs +4 -725
  65. package/dist/_chunks/libs/ufo.mjs +1 -240
  66. package/dist/_chunks/libs/which.mjs +1 -84
  67. package/dist/_chunks/libs/word-wrap.mjs +12 -43
  68. package/dist/_chunks/node.mjs +481 -0
  69. package/dist/_chunks/plugin.mjs +98 -772
  70. package/dist/_chunks/rolldown-runtime.mjs +1 -48
  71. package/dist/_chunks/sequence-view.mjs +1 -575
  72. package/dist/cli/index.mjs +127 -1846
  73. package/dist/config/index.d.mts +2 -2
  74. package/dist/config/index.mjs +1 -6
  75. package/dist/index.d.mts +148 -7
  76. package/dist/index.mjs +1 -21
  77. package/dist/model/builder.mjs +1 -3
  78. package/dist/model/index.d.mts +57 -3
  79. package/dist/model/index.mjs +1 -5
  80. package/dist/vite-plugin/index.d.mts +4 -3
  81. package/dist/vite-plugin/index.mjs +1 -22
  82. package/dist/vite-plugin/internal.d.mts +5 -5
  83. package/dist/vite-plugin/internal.mjs +1 -68
  84. package/package.json +60 -41
  85. package/react/{index.d.ts → index.d.mts} +112 -70
  86. package/react/{index.js → index.mjs} +21361 -22064
  87. package/react/package.json +2 -5
  88. package/vite-plugin-modules.d.ts +5 -5
  89. package/dist/_chunks/LikeC4.d.mts +0 -121
  90. package/dist/_chunks/LikeC4.mjs +0 -202
  91. package/dist/_chunks/config-app.prod.d.mts +0 -18
  92. package/dist/_chunks/config-app.prod.mjs +0 -188
  93. package/dist/_chunks/config-webcomponent.prod.mjs +0 -71
  94. package/dist/_chunks/define-config.mjs +0 -409
  95. package/dist/_chunks/index3.d.mts +0 -60
  96. package/dist/_chunks/index4.d.mts +0 -1
  97. package/dist/_chunks/libs/@smithy/is-array-buffer.mjs +0 -10
  98. package/dist/_chunks/libs/hono.mjs +0 -1829
  99. package/dist/_chunks/libs/nanoid.mjs +0 -29
  100. package/dist/_chunks/model.mjs +0 -12
  101. package/dist/_chunks/module.d.mts +0 -71
  102. package/dist/_chunks/module.mjs +0 -18657
  103. package/dist/_chunks/vite-build.mjs +0 -69
  104. package/dist/_chunks/vite-dev.mjs +0 -79
  105. package/dist/_chunks/vite-preview.mjs +0 -27
  106. package/dist/language/module.d.mts +0 -5
  107. package/dist/language/module.mjs +0 -20
  108. package/dist/vite/vite-build.d.mts +0 -26
  109. package/dist/vite/vite-build.mjs +0 -27
  110. package/dist/vite/vite-dev.d.mts +0 -34
  111. package/dist/vite/vite-dev.mjs +0 -29
  112. package/dist/vite/vite-preview.d.mts +0 -20
  113. package/dist/vite/vite-preview.mjs +0 -26
@@ -0,0 +1,741 @@
1
+ //#region ../../node_modules/.pnpm/@logtape+logtape@1.3.7/node_modules/@logtape/logtape/dist/level.d.ts
2
+ //#region src/level.d.ts
3
+ declare const logLevels: readonly ["trace", "debug", "info", "warning", "error", "fatal"];
4
+ /**
5
+ * The severity level of a {@link LogRecord}.
6
+ */
7
+ type LogLevel = typeof logLevels[number];
8
+ /**
9
+ * Lists all available log levels with the order of their severity.
10
+ * The `"trace"` level goes first, and the `"fatal"` level goes last.
11
+ * @returns A new copy of the array of log levels.
12
+ * @since 1.0.0
13
+ */
14
+ //#endregion
15
+ //#region ../../node_modules/.pnpm/@logtape+logtape@1.3.7/node_modules/@logtape/logtape/dist/record.d.ts
16
+ //#region src/record.d.ts
17
+ /**
18
+ * A log record.
19
+ */
20
+ interface LogRecord {
21
+ /**
22
+ * The category of the logger that produced the log record.
23
+ */
24
+ readonly category: readonly string[];
25
+ /**
26
+ * The log level.
27
+ */
28
+ readonly level: LogLevel;
29
+ /**
30
+ * The log message. This is the result of substituting the message template
31
+ * with the values. The number of elements in this array is always odd,
32
+ * with the message template values interleaved between the substitution
33
+ * values.
34
+ */
35
+ readonly message: readonly unknown[];
36
+ /**
37
+ * The raw log message. This is the original message template without any
38
+ * further processing. It can be either:
39
+ *
40
+ * - A string without any substitutions if the log record was created with
41
+ * a method call syntax, e.g., "Hello, {name}!" for
42
+ * `logger.info("Hello, {name}!", { name })`.
43
+ * - A template string array if the log record was created with a tagged
44
+ * template literal syntax, e.g., `["Hello, ", "!"]` for
45
+ * ``logger.info`Hello, ${name}!```.
46
+ *
47
+ * @since 0.6.0
48
+ */
49
+ readonly rawMessage: string | TemplateStringsArray;
50
+ /**
51
+ * The timestamp of the log record in milliseconds since the Unix epoch.
52
+ */
53
+ readonly timestamp: number;
54
+ /**
55
+ * The extra properties of the log record.
56
+ */
57
+ readonly properties: Record<string, unknown>;
58
+ } //# sourceMappingURL=record.d.ts.map
59
+ //#endregion
60
+ //#endregion
61
+ //#region ../../node_modules/.pnpm/@logtape+logtape@1.3.7/node_modules/@logtape/logtape/dist/logger.d.ts
62
+ //#region src/logger.d.ts
63
+ /**
64
+ * A logger interface. It provides methods to log messages at different
65
+ * severity levels.
66
+ *
67
+ * ```typescript
68
+ * const logger = getLogger("category");
69
+ * logger.trace `A trace message with ${value}`
70
+ * logger.debug `A debug message with ${value}.`;
71
+ * logger.info `An info message with ${value}.`;
72
+ * logger.warn `A warning message with ${value}.`;
73
+ * logger.error `An error message with ${value}.`;
74
+ * logger.fatal `A fatal error message with ${value}.`;
75
+ * ```
76
+ */
77
+ interface Logger {
78
+ /**
79
+ * The category of the logger. It is an array of strings.
80
+ */
81
+ readonly category: readonly string[];
82
+ /**
83
+ * The logger with the supercategory of the current logger. If the current
84
+ * logger is the root logger, this is `null`.
85
+ */
86
+ readonly parent: Logger | null;
87
+ /**
88
+ * Get a child logger with the given subcategory.
89
+ *
90
+ * ```typescript
91
+ * const logger = getLogger("category");
92
+ * const subLogger = logger.getChild("sub-category");
93
+ * ```
94
+ *
95
+ * The above code is equivalent to:
96
+ *
97
+ * ```typescript
98
+ * const logger = getLogger("category");
99
+ * const subLogger = getLogger(["category", "sub-category"]);
100
+ * ```
101
+ *
102
+ * @param subcategory The subcategory.
103
+ * @returns The child logger.
104
+ */
105
+ getChild(subcategory: string | readonly [string] | readonly [string, ...string[]]): Logger;
106
+ /**
107
+ * Get a logger with contextual properties. This is useful for
108
+ * log multiple messages with the shared set of properties.
109
+ *
110
+ * ```typescript
111
+ * const logger = getLogger("category");
112
+ * const ctx = logger.with({ foo: 123, bar: "abc" });
113
+ * ctx.info("A message with {foo} and {bar}.");
114
+ * ctx.warn("Another message with {foo}, {bar}, and {baz}.", { baz: true });
115
+ * ```
116
+ *
117
+ * The above code is equivalent to:
118
+ *
119
+ * ```typescript
120
+ * const logger = getLogger("category");
121
+ * logger.info("A message with {foo} and {bar}.", { foo: 123, bar: "abc" });
122
+ * logger.warn(
123
+ * "Another message with {foo}, {bar}, and {baz}.",
124
+ * { foo: 123, bar: "abc", baz: true },
125
+ * );
126
+ * ```
127
+ *
128
+ * @param properties
129
+ * @returns
130
+ * @since 0.5.0
131
+ */
132
+ with(properties: Record<string, unknown>): Logger;
133
+ /**
134
+ * Log a trace message. Use this as a template string prefix.
135
+ *
136
+ * ```typescript
137
+ * logger.trace `A trace message with ${value}.`;
138
+ * ```
139
+ *
140
+ * @param message The message template strings array.
141
+ * @param values The message template values.
142
+ * @since 0.12.0
143
+ */
144
+ trace(message: TemplateStringsArray, ...values: readonly unknown[]): void;
145
+ /**
146
+ * Log a trace message with properties.
147
+ *
148
+ * ```typescript
149
+ * logger.trace('A trace message with {value}.', { value });
150
+ * ```
151
+ *
152
+ * If the properties are expensive to compute, you can pass a callback that
153
+ * returns the properties:
154
+ *
155
+ * ```typescript
156
+ * logger.trace(
157
+ * 'A trace message with {value}.',
158
+ * () => ({ value: expensiveComputation() })
159
+ * );
160
+ * ```
161
+ *
162
+ * @param message The message template. Placeholders to be replaced with
163
+ * `values` are indicated by keys in curly braces (e.g.,
164
+ * `{value}`).
165
+ * @param properties The values to replace placeholders with. For lazy
166
+ * evaluation, this can be a callback that returns the
167
+ * properties.
168
+ * @since 0.12.0
169
+ */
170
+ trace(message: string, properties?: Record<string, unknown> | (() => Record<string, unknown>)): void;
171
+ /**
172
+ * Log a trace values with no message. This is useful when you
173
+ * want to log properties without a message, e.g., when you want to log
174
+ * the context of a request or an operation.
175
+ *
176
+ * ```typescript
177
+ * logger.trace({ method: 'GET', url: '/api/v1/resource' });
178
+ * ```
179
+ *
180
+ * Note that this is a shorthand for:
181
+ *
182
+ * ```typescript
183
+ * logger.trace('{*}', { method: 'GET', url: '/api/v1/resource' });
184
+ * ```
185
+ *
186
+ * If the properties are expensive to compute, you cannot use this shorthand
187
+ * and should use the following syntax instead:
188
+ *
189
+ * ```typescript
190
+ * logger.trace('{*}', () => ({
191
+ * method: expensiveMethod(),
192
+ * url: expensiveUrl(),
193
+ * }));
194
+ * ```
195
+ *
196
+ * @param properties The values to log. Note that this does not take
197
+ * a callback.
198
+ * @since 0.12.0
199
+ */
200
+ trace(properties: Record<string, unknown>): void;
201
+ /**
202
+ * Lazily log a trace message. Use this when the message values are expensive
203
+ * to compute and should only be computed if the message is actually logged.
204
+ *
205
+ * ```typescript
206
+ * logger.trace(l => l`A trace message with ${expensiveValue()}.`);
207
+ * ```
208
+ *
209
+ * @param callback A callback that returns the message template prefix.
210
+ * @throws {TypeError} If no log record was made inside the callback.
211
+ * @since 0.12.0
212
+ */
213
+ trace(callback: LogCallback): void;
214
+ /**
215
+ * Log a debug message. Use this as a template string prefix.
216
+ *
217
+ * ```typescript
218
+ * logger.debug `A debug message with ${value}.`;
219
+ * ```
220
+ *
221
+ * @param message The message template strings array.
222
+ * @param values The message template values.
223
+ */
224
+ debug(message: TemplateStringsArray, ...values: readonly unknown[]): void;
225
+ /**
226
+ * Log a debug message with properties.
227
+ *
228
+ * ```typescript
229
+ * logger.debug('A debug message with {value}.', { value });
230
+ * ```
231
+ *
232
+ * If the properties are expensive to compute, you can pass a callback that
233
+ * returns the properties:
234
+ *
235
+ * ```typescript
236
+ * logger.debug(
237
+ * 'A debug message with {value}.',
238
+ * () => ({ value: expensiveComputation() })
239
+ * );
240
+ * ```
241
+ *
242
+ * @param message The message template. Placeholders to be replaced with
243
+ * `values` are indicated by keys in curly braces (e.g.,
244
+ * `{value}`).
245
+ * @param properties The values to replace placeholders with. For lazy
246
+ * evaluation, this can be a callback that returns the
247
+ * properties.
248
+ */
249
+ debug(message: string, properties?: Record<string, unknown> | (() => Record<string, unknown>)): void;
250
+ /**
251
+ * Log a debug values with no message. This is useful when you
252
+ * want to log properties without a message, e.g., when you want to log
253
+ * the context of a request or an operation.
254
+ *
255
+ * ```typescript
256
+ * logger.debug({ method: 'GET', url: '/api/v1/resource' });
257
+ * ```
258
+ *
259
+ * Note that this is a shorthand for:
260
+ *
261
+ * ```typescript
262
+ * logger.debug('{*}', { method: 'GET', url: '/api/v1/resource' });
263
+ * ```
264
+ *
265
+ * If the properties are expensive to compute, you cannot use this shorthand
266
+ * and should use the following syntax instead:
267
+ *
268
+ * ```typescript
269
+ * logger.debug('{*}', () => ({
270
+ * method: expensiveMethod(),
271
+ * url: expensiveUrl(),
272
+ * }));
273
+ * ```
274
+ *
275
+ * @param properties The values to log. Note that this does not take
276
+ * a callback.
277
+ * @since 0.11.0
278
+ */
279
+ debug(properties: Record<string, unknown>): void;
280
+ /**
281
+ * Lazily log a debug message. Use this when the message values are expensive
282
+ * to compute and should only be computed if the message is actually logged.
283
+ *
284
+ * ```typescript
285
+ * logger.debug(l => l`A debug message with ${expensiveValue()}.`);
286
+ * ```
287
+ *
288
+ * @param callback A callback that returns the message template prefix.
289
+ * @throws {TypeError} If no log record was made inside the callback.
290
+ */
291
+ debug(callback: LogCallback): void;
292
+ /**
293
+ * Log an informational message. Use this as a template string prefix.
294
+ *
295
+ * ```typescript
296
+ * logger.info `An info message with ${value}.`;
297
+ * ```
298
+ *
299
+ * @param message The message template strings array.
300
+ * @param values The message template values.
301
+ */
302
+ info(message: TemplateStringsArray, ...values: readonly unknown[]): void;
303
+ /**
304
+ * Log an informational message with properties.
305
+ *
306
+ * ```typescript
307
+ * logger.info('An info message with {value}.', { value });
308
+ * ```
309
+ *
310
+ * If the properties are expensive to compute, you can pass a callback that
311
+ * returns the properties:
312
+ *
313
+ * ```typescript
314
+ * logger.info(
315
+ * 'An info message with {value}.',
316
+ * () => ({ value: expensiveComputation() })
317
+ * );
318
+ * ```
319
+ *
320
+ * @param message The message template. Placeholders to be replaced with
321
+ * `values` are indicated by keys in curly braces (e.g.,
322
+ * `{value}`).
323
+ * @param properties The values to replace placeholders with. For lazy
324
+ * evaluation, this can be a callback that returns the
325
+ * properties.
326
+ */
327
+ info(message: string, properties?: Record<string, unknown> | (() => Record<string, unknown>)): void;
328
+ /**
329
+ * Log an informational values with no message. This is useful when you
330
+ * want to log properties without a message, e.g., when you want to log
331
+ * the context of a request or an operation.
332
+ *
333
+ * ```typescript
334
+ * logger.info({ method: 'GET', url: '/api/v1/resource' });
335
+ * ```
336
+ *
337
+ * Note that this is a shorthand for:
338
+ *
339
+ * ```typescript
340
+ * logger.info('{*}', { method: 'GET', url: '/api/v1/resource' });
341
+ * ```
342
+ *
343
+ * If the properties are expensive to compute, you cannot use this shorthand
344
+ * and should use the following syntax instead:
345
+ *
346
+ * ```typescript
347
+ * logger.info('{*}', () => ({
348
+ * method: expensiveMethod(),
349
+ * url: expensiveUrl(),
350
+ * }));
351
+ * ```
352
+ *
353
+ * @param properties The values to log. Note that this does not take
354
+ * a callback.
355
+ * @since 0.11.0
356
+ */
357
+ info(properties: Record<string, unknown>): void;
358
+ /**
359
+ * Lazily log an informational message. Use this when the message values are
360
+ * expensive to compute and should only be computed if the message is actually
361
+ * logged.
362
+ *
363
+ * ```typescript
364
+ * logger.info(l => l`An info message with ${expensiveValue()}.`);
365
+ * ```
366
+ *
367
+ * @param callback A callback that returns the message template prefix.
368
+ * @throws {TypeError} If no log record was made inside the callback.
369
+ */
370
+ info(callback: LogCallback): void;
371
+ /**
372
+ * Log a warning message. Use this as a template string prefix.
373
+ *
374
+ * ```typescript
375
+ * logger.warn `A warning message with ${value}.`;
376
+ * ```
377
+ *
378
+ * @param message The message template strings array.
379
+ * @param values The message template values.
380
+ */
381
+ warn(message: TemplateStringsArray, ...values: readonly unknown[]): void;
382
+ /**
383
+ * Log a warning message with properties.
384
+ *
385
+ * ```typescript
386
+ * logger.warn('A warning message with {value}.', { value });
387
+ * ```
388
+ *
389
+ * If the properties are expensive to compute, you can pass a callback that
390
+ * returns the properties:
391
+ *
392
+ * ```typescript
393
+ * logger.warn(
394
+ * 'A warning message with {value}.',
395
+ * () => ({ value: expensiveComputation() })
396
+ * );
397
+ * ```
398
+ *
399
+ * @param message The message template. Placeholders to be replaced with
400
+ * `values` are indicated by keys in curly braces (e.g.,
401
+ * `{value}`).
402
+ * @param properties The values to replace placeholders with. For lazy
403
+ * evaluation, this can be a callback that returns the
404
+ * properties.
405
+ */
406
+ warn(message: string, properties?: Record<string, unknown> | (() => Record<string, unknown>)): void;
407
+ /**
408
+ * Log a warning values with no message. This is useful when you
409
+ * want to log properties without a message, e.g., when you want to log
410
+ * the context of a request or an operation.
411
+ *
412
+ * ```typescript
413
+ * logger.warn({ method: 'GET', url: '/api/v1/resource' });
414
+ * ```
415
+ *
416
+ * Note that this is a shorthand for:
417
+ *
418
+ * ```typescript
419
+ * logger.warn('{*}', { method: 'GET', url: '/api/v1/resource' });
420
+ * ```
421
+ *
422
+ * If the properties are expensive to compute, you cannot use this shorthand
423
+ * and should use the following syntax instead:
424
+ *
425
+ * ```typescript
426
+ * logger.warn('{*}', () => ({
427
+ * method: expensiveMethod(),
428
+ * url: expensiveUrl(),
429
+ * }));
430
+ * ```
431
+ *
432
+ * @param properties The values to log. Note that this does not take
433
+ * a callback.
434
+ * @since 0.11.0
435
+ */
436
+ warn(properties: Record<string, unknown>): void;
437
+ /**
438
+ * Lazily log a warning message. Use this when the message values are
439
+ * expensive to compute and should only be computed if the message is actually
440
+ * logged.
441
+ *
442
+ * ```typescript
443
+ * logger.warn(l => l`A warning message with ${expensiveValue()}.`);
444
+ * ```
445
+ *
446
+ * @param callback A callback that returns the message template prefix.
447
+ * @throws {TypeError} If no log record was made inside the callback.
448
+ */
449
+ warn(callback: LogCallback): void;
450
+ /**
451
+ * Log a warning message. Use this as a template string prefix.
452
+ *
453
+ * ```typescript
454
+ * logger.warning `A warning message with ${value}.`;
455
+ * ```
456
+ *
457
+ * @param message The message template strings array.
458
+ * @param values The message template values.
459
+ * @since 0.12.0
460
+ */
461
+ warning(message: TemplateStringsArray, ...values: readonly unknown[]): void;
462
+ /**
463
+ * Log a warning message with properties.
464
+ *
465
+ * ```typescript
466
+ * logger.warning('A warning message with {value}.', { value });
467
+ * ```
468
+ *
469
+ * If the properties are expensive to compute, you can pass a callback that
470
+ * returns the properties:
471
+ *
472
+ * ```typescript
473
+ * logger.warning(
474
+ * 'A warning message with {value}.',
475
+ * () => ({ value: expensiveComputation() })
476
+ * );
477
+ * ```
478
+ *
479
+ * @param message The message template. Placeholders to be replaced with
480
+ * `values` are indicated by keys in curly braces (e.g.,
481
+ * `{value}`).
482
+ * @param properties The values to replace placeholders with. For lazy
483
+ * evaluation, this can be a callback that returns the
484
+ * properties.
485
+ * @since 0.12.0
486
+ */
487
+ warning(message: string, properties?: Record<string, unknown> | (() => Record<string, unknown>)): void;
488
+ /**
489
+ * Log a warning values with no message. This is useful when you
490
+ * want to log properties without a message, e.g., when you want to log
491
+ * the context of a request or an operation.
492
+ *
493
+ * ```typescript
494
+ * logger.warning({ method: 'GET', url: '/api/v1/resource' });
495
+ * ```
496
+ *
497
+ * Note that this is a shorthand for:
498
+ *
499
+ * ```typescript
500
+ * logger.warning('{*}', { method: 'GET', url: '/api/v1/resource' });
501
+ * ```
502
+ *
503
+ * If the properties are expensive to compute, you cannot use this shorthand
504
+ * and should use the following syntax instead:
505
+ *
506
+ * ```typescript
507
+ * logger.warning('{*}', () => ({
508
+ * method: expensiveMethod(),
509
+ * url: expensiveUrl(),
510
+ * }));
511
+ * ```
512
+ *
513
+ * @param properties The values to log. Note that this does not take
514
+ * a callback.
515
+ * @since 0.12.0
516
+ */
517
+ warning(properties: Record<string, unknown>): void;
518
+ /**
519
+ * Lazily log a warning message. Use this when the message values are
520
+ * expensive to compute and should only be computed if the message is actually
521
+ * logged.
522
+ *
523
+ * ```typescript
524
+ * logger.warning(l => l`A warning message with ${expensiveValue()}.`);
525
+ * ```
526
+ *
527
+ * @param callback A callback that returns the message template prefix.
528
+ * @throws {TypeError} If no log record was made inside the callback.
529
+ * @since 0.12.0
530
+ */
531
+ warning(callback: LogCallback): void;
532
+ /**
533
+ * Log an error message. Use this as a template string prefix.
534
+ *
535
+ * ```typescript
536
+ * logger.error `An error message with ${value}.`;
537
+ * ```
538
+ *
539
+ * @param message The message template strings array.
540
+ * @param values The message template values.
541
+ */
542
+ error(message: TemplateStringsArray, ...values: readonly unknown[]): void;
543
+ /**
544
+ * Log an error message with properties.
545
+ *
546
+ * ```typescript
547
+ * logger.warn('An error message with {value}.', { value });
548
+ * ```
549
+ *
550
+ * If the properties are expensive to compute, you can pass a callback that
551
+ * returns the properties:
552
+ *
553
+ * ```typescript
554
+ * logger.error(
555
+ * 'An error message with {value}.',
556
+ * () => ({ value: expensiveComputation() })
557
+ * );
558
+ * ```
559
+ *
560
+ * @param message The message template. Placeholders to be replaced with
561
+ * `values` are indicated by keys in curly braces (e.g.,
562
+ * `{value}`).
563
+ * @param properties The values to replace placeholders with. For lazy
564
+ * evaluation, this can be a callback that returns the
565
+ * properties.
566
+ */
567
+ error(message: string, properties?: Record<string, unknown> | (() => Record<string, unknown>)): void;
568
+ /**
569
+ * Log an error values with no message. This is useful when you
570
+ * want to log properties without a message, e.g., when you want to log
571
+ * the context of a request or an operation.
572
+ *
573
+ * ```typescript
574
+ * logger.error({ method: 'GET', url: '/api/v1/resource' });
575
+ * ```
576
+ *
577
+ * Note that this is a shorthand for:
578
+ *
579
+ * ```typescript
580
+ * logger.error('{*}', { method: 'GET', url: '/api/v1/resource' });
581
+ * ```
582
+ *
583
+ * If the properties are expensive to compute, you cannot use this shorthand
584
+ * and should use the following syntax instead:
585
+ *
586
+ * ```typescript
587
+ * logger.error('{*}', () => ({
588
+ * method: expensiveMethod(),
589
+ * url: expensiveUrl(),
590
+ * }));
591
+ * ```
592
+ *
593
+ * @param properties The values to log. Note that this does not take
594
+ * a callback.
595
+ * @since 0.11.0
596
+ */
597
+ error(properties: Record<string, unknown>): void;
598
+ /**
599
+ * Lazily log an error message. Use this when the message values are
600
+ * expensive to compute and should only be computed if the message is actually
601
+ * logged.
602
+ *
603
+ * ```typescript
604
+ * logger.error(l => l`An error message with ${expensiveValue()}.`);
605
+ * ```
606
+ *
607
+ * @param callback A callback that returns the message template prefix.
608
+ * @throws {TypeError} If no log record was made inside the callback.
609
+ */
610
+ error(callback: LogCallback): void;
611
+ /**
612
+ * Log a fatal error message. Use this as a template string prefix.
613
+ *
614
+ * ```typescript
615
+ * logger.fatal `A fatal error message with ${value}.`;
616
+ * ```
617
+ *
618
+ * @param message The message template strings array.
619
+ * @param values The message template values.
620
+ */
621
+ fatal(message: TemplateStringsArray, ...values: readonly unknown[]): void;
622
+ /**
623
+ * Log a fatal error message with properties.
624
+ *
625
+ * ```typescript
626
+ * logger.warn('A fatal error message with {value}.', { value });
627
+ * ```
628
+ *
629
+ * If the properties are expensive to compute, you can pass a callback that
630
+ * returns the properties:
631
+ *
632
+ * ```typescript
633
+ * logger.fatal(
634
+ * 'A fatal error message with {value}.',
635
+ * () => ({ value: expensiveComputation() })
636
+ * );
637
+ * ```
638
+ *
639
+ * @param message The message template. Placeholders to be replaced with
640
+ * `values` are indicated by keys in curly braces (e.g.,
641
+ * `{value}`).
642
+ * @param properties The values to replace placeholders with. For lazy
643
+ * evaluation, this can be a callback that returns the
644
+ * properties.
645
+ */
646
+ fatal(message: string, properties?: Record<string, unknown> | (() => Record<string, unknown>)): void;
647
+ /**
648
+ * Log a fatal error values with no message. This is useful when you
649
+ * want to log properties without a message, e.g., when you want to log
650
+ * the context of a request or an operation.
651
+ *
652
+ * ```typescript
653
+ * logger.fatal({ method: 'GET', url: '/api/v1/resource' });
654
+ * ```
655
+ *
656
+ * Note that this is a shorthand for:
657
+ *
658
+ * ```typescript
659
+ * logger.fatal('{*}', { method: 'GET', url: '/api/v1/resource' });
660
+ * ```
661
+ *
662
+ * If the properties are expensive to compute, you cannot use this shorthand
663
+ * and should use the following syntax instead:
664
+ *
665
+ * ```typescript
666
+ * logger.fatal('{*}', () => ({
667
+ * method: expensiveMethod(),
668
+ * url: expensiveUrl(),
669
+ * }));
670
+ * ```
671
+ *
672
+ * @param properties The values to log. Note that this does not take
673
+ * a callback.
674
+ * @since 0.11.0
675
+ */
676
+ fatal(properties: Record<string, unknown>): void;
677
+ /**
678
+ * Lazily log a fatal error message. Use this when the message values are
679
+ * expensive to compute and should only be computed if the message is actually
680
+ * logged.
681
+ *
682
+ * ```typescript
683
+ * logger.fatal(l => l`A fatal error message with ${expensiveValue()}.`);
684
+ * ```
685
+ *
686
+ * @param callback A callback that returns the message template prefix.
687
+ * @throws {TypeError} If no log record was made inside the callback.
688
+ */
689
+ fatal(callback: LogCallback): void;
690
+ /**
691
+ * Emits a log record with custom fields while using this logger's
692
+ * category.
693
+ *
694
+ * This is a low-level API for integration scenarios where you need full
695
+ * control over the log record, particularly for preserving timestamps
696
+ * from external systems.
697
+ *
698
+ * ```typescript
699
+ * const logger = getLogger(["my-app", "integration"]);
700
+ *
701
+ * // Emit a log with a custom timestamp
702
+ * logger.emit({
703
+ * timestamp: kafkaLog.originalTimestamp,
704
+ * level: "info",
705
+ * message: [kafkaLog.message],
706
+ * rawMessage: kafkaLog.message,
707
+ * properties: {
708
+ * source: "kafka",
709
+ * partition: kafkaLog.partition,
710
+ * offset: kafkaLog.offset,
711
+ * },
712
+ * });
713
+ * ```
714
+ *
715
+ * @param record Log record without category field (category comes from
716
+ * the logger instance)
717
+ * @since 1.1.0
718
+ */
719
+ emit(record: Omit<LogRecord, "category">): void;
720
+ }
721
+ /**
722
+ * A logging callback function. It is used to defer the computation of a
723
+ * message template until it is actually logged.
724
+ * @param prefix The message template prefix.
725
+ * @returns The rendered message array.
726
+ */
727
+ type LogCallback = (prefix: LogTemplatePrefix) => unknown[];
728
+ /**
729
+ * A logging template prefix function. It is used to log a message in
730
+ * a {@link LogCallback} function.
731
+ * @param message The message template strings array.
732
+ * @param values The message template values.
733
+ * @returns The rendered message array.
734
+ */
735
+ type LogTemplatePrefix = (message: TemplateStringsArray, ...values: unknown[]) => unknown[];
736
+ /**
737
+ * A function type for logging methods in the {@link Logger} interface.
738
+ * @since 1.0.0
739
+ */
740
+ //#endregion
741
+ export { Logger as t };