@asciidoctor/core 4.0.0-alpha.1 → 4.0.0-alpha.3
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/build/browser/index.js +423 -45
- package/build/node/index.cjs +424 -46
- package/package.json +11 -5
- package/src/abstract_block.js +11 -3
- package/src/attribute_entry.js +17 -1
- package/src/browser/reader.js +2 -2
- package/src/converter/html5.js +2 -8
- package/src/converter/template.js +1 -1
- package/src/document.js +15 -4
- package/src/extensions.js +266 -8
- package/src/helpers.js +20 -2
- package/src/index.js +12 -0
- package/src/load.js +30 -13
- package/src/logging.js +65 -5
- package/src/parser.js +1 -1
- package/src/reader.js +1 -1
- package/types/abstract_block.d.ts +5 -2
- package/types/attribute_entry.d.ts +8 -0
- package/types/browser/reader.d.ts +1 -1
- package/types/extensions.d.ts +203 -9
- package/types/index.d.cts +83 -0
- package/types/index.d.ts +8 -0
- package/types/logging.d.ts +15 -4
package/types/logging.d.ts
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* Run fn() within an async-local logger context so that all log calls via
|
|
4
|
+
* `this.logger` (from applyLogging) automatically route to the provided logger
|
|
5
|
+
* for the duration of the async execution chain.
|
|
6
|
+
*
|
|
7
|
+
* Falls back to global mutation in environments without node:async_hooks (e.g. browsers).
|
|
8
|
+
*
|
|
9
|
+
* @param {Logger|MemoryLogger|NullLogger} logger - The logger to activate.
|
|
10
|
+
* @param {() => any} fn - The function to execute within the logger context.
|
|
11
|
+
* @returns {Promise<any>}
|
|
12
|
+
*/
|
|
13
|
+
export function withLogger(logger: Logger | MemoryLogger | NullLogger, fn: () => any): Promise<any>;
|
|
1
14
|
/**
|
|
2
15
|
* Apply the Logging mixin to a class prototype.
|
|
3
16
|
*
|
|
@@ -120,12 +133,10 @@ export class MemoryLogger {
|
|
|
120
133
|
empty(): boolean;
|
|
121
134
|
}
|
|
122
135
|
/** Logger that discards all messages but still tracks the maximum severity. */
|
|
123
|
-
export class NullLogger {
|
|
136
|
+
export class NullLogger extends Logger {
|
|
124
137
|
static create(): NullLogger;
|
|
138
|
+
constructor();
|
|
125
139
|
level: number;
|
|
126
|
-
_maxSeverity: number;
|
|
127
|
-
get maxSeverity(): number;
|
|
128
|
-
getMaxSeverity(): number;
|
|
129
140
|
add(severity: any): boolean;
|
|
130
141
|
log(severity: any): boolean;
|
|
131
142
|
debug(): boolean;
|