rumdl-wasm 0.1.36 → 0.1.38

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/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "Ruben J. Jongejan <ruben.jongejan@gmail.com>"
6
6
  ],
7
7
  "description": "Fast markdown linter with 60+ rules - WebAssembly build",
8
- "version": "0.1.36",
8
+ "version": "0.1.38",
9
9
  "license": "MIT",
10
10
  "repository": {
11
11
  "type": "git",
package/rumdl_lib.d.ts CHANGED
@@ -1,9 +1,69 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
+
3
4
  /**
4
- * Initialize the WASM module with better panic messages
5
+ * A markdown linter with configuration
6
+ *
7
+ * Create a new `Linter` with a configuration object, then use
8
+ * `check()` to lint content and `fix()` to auto-fix issues.
5
9
  */
6
- export function init(): void;
10
+ export class Linter {
11
+ free(): void;
12
+ [Symbol.dispose](): void;
13
+ /**
14
+ * Lint markdown content and return warnings as JSON
15
+ *
16
+ * Returns a JSON array of warnings, each with:
17
+ * - `rule_name`: Rule name (e.g., "MD001")
18
+ * - `message`: Warning message
19
+ * - `line`: 1-indexed line number
20
+ * - `column`: 1-indexed column number
21
+ * - `fix`: Optional fix object with `range.start`, `range.end`, `replacement`
22
+ *
23
+ * Note: Fix ranges use character offsets (not byte offsets) for JavaScript compatibility.
24
+ * This is important for multi-byte UTF-8 characters like `æ` or emoji.
25
+ */
26
+ check(content: string): string;
27
+ /**
28
+ * Apply all auto-fixes to the content and return the fixed content
29
+ *
30
+ * Uses the same fix coordinator as the CLI for consistent behavior.
31
+ */
32
+ fix(content: string): string;
33
+ /**
34
+ * Get the current configuration as JSON
35
+ *
36
+ * Returns an object with global settings and rule-specific configurations.
37
+ */
38
+ get_config(): string;
39
+ /**
40
+ * Get any warnings generated during configuration parsing
41
+ *
42
+ * Returns a JSON array of warning strings. Each warning is prefixed
43
+ * with the rule name (e.g., "[MD060] Invalid severity: critical").
44
+ *
45
+ * Useful for debugging configuration issues or providing user feedback.
46
+ */
47
+ get_config_warnings(): string;
48
+ /**
49
+ * Create a new Linter with the given configuration
50
+ *
51
+ * # Arguments
52
+ *
53
+ * * `options` - Configuration object (see LinterConfig)
54
+ *
55
+ * # Example
56
+ *
57
+ * ```javascript
58
+ * const linter = new Linter({
59
+ * disable: ["MD041"],
60
+ * "line-length": 120
61
+ * });
62
+ * ```
63
+ */
64
+ constructor(options: any);
65
+ }
66
+
7
67
  /**
8
68
  * Get list of available rules as JSON
9
69
  *
@@ -12,111 +72,56 @@ export function init(): void;
12
72
  * - `description`: Rule description
13
73
  */
14
74
  export function get_available_rules(): string;
75
+
15
76
  /**
16
77
  * Get the rumdl version
17
78
  */
18
79
  export function get_version(): string;
80
+
19
81
  /**
20
- * A markdown linter with configuration
21
- *
22
- * Create a new `Linter` with a configuration object, then use
23
- * `check()` to lint content and `fix()` to auto-fix issues.
82
+ * Initialize the WASM module with better panic messages
24
83
  */
25
- export class Linter {
26
- free(): void;
27
- [Symbol.dispose](): void;
28
- /**
29
- * Get the current configuration as JSON
30
- *
31
- * Returns an object with global settings and rule-specific configurations.
32
- */
33
- get_config(): string;
34
- /**
35
- * Get any warnings generated during configuration parsing
36
- *
37
- * Returns a JSON array of warning strings. Each warning is prefixed
38
- * with the rule name (e.g., "[MD060] Invalid severity: critical").
39
- *
40
- * Useful for debugging configuration issues or providing user feedback.
41
- */
42
- get_config_warnings(): string;
43
- /**
44
- * Apply all auto-fixes to the content and return the fixed content
45
- *
46
- * Uses the same fix coordinator as the CLI for consistent behavior.
47
- */
48
- fix(content: string): string;
49
- /**
50
- * Create a new Linter with the given configuration
51
- *
52
- * # Arguments
53
- *
54
- * * `options` - Configuration object (see LinterConfig)
55
- *
56
- * # Example
57
- *
58
- * ```javascript
59
- * const linter = new Linter({
60
- * disable: ["MD041"],
61
- * "line-length": 120
62
- * });
63
- * ```
64
- */
65
- constructor(options: any);
66
- /**
67
- * Lint markdown content and return warnings as JSON
68
- *
69
- * Returns a JSON array of warnings, each with:
70
- * - `rule_name`: Rule name (e.g., "MD001")
71
- * - `message`: Warning message
72
- * - `line`: 1-indexed line number
73
- * - `column`: 1-indexed column number
74
- * - `fix`: Optional fix object with `range.start`, `range.end`, `replacement`
75
- *
76
- * Note: Fix ranges use character offsets (not byte offsets) for JavaScript compatibility.
77
- * This is important for multi-byte UTF-8 characters like `æ` or emoji.
78
- */
79
- check(content: string): string;
80
- }
84
+ export function init(): void;
81
85
 
82
86
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
83
87
 
84
88
  export interface InitOutput {
85
- readonly memory: WebAssembly.Memory;
86
- readonly __wbg_linter_free: (a: number, b: number) => void;
87
- readonly get_available_rules: (a: number) => void;
88
- readonly get_version: (a: number) => void;
89
- readonly linter_check: (a: number, b: number, c: number, d: number) => void;
90
- readonly linter_fix: (a: number, b: number, c: number, d: number) => void;
91
- readonly linter_get_config: (a: number, b: number) => void;
92
- readonly linter_get_config_warnings: (a: number, b: number) => void;
93
- readonly linter_new: (a: number, b: number) => void;
94
- readonly init: () => void;
95
- readonly __wbindgen_export: (a: number, b: number) => number;
96
- readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
97
- readonly __wbindgen_export3: (a: number) => void;
98
- readonly __wbindgen_export4: (a: number, b: number, c: number) => void;
99
- readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
100
- readonly __wbindgen_start: () => void;
89
+ readonly memory: WebAssembly.Memory;
90
+ readonly __wbg_linter_free: (a: number, b: number) => void;
91
+ readonly get_available_rules: (a: number) => void;
92
+ readonly get_version: (a: number) => void;
93
+ readonly linter_check: (a: number, b: number, c: number, d: number) => void;
94
+ readonly linter_fix: (a: number, b: number, c: number, d: number) => void;
95
+ readonly linter_get_config: (a: number, b: number) => void;
96
+ readonly linter_get_config_warnings: (a: number, b: number) => void;
97
+ readonly linter_new: (a: number, b: number) => void;
98
+ readonly init: () => void;
99
+ readonly __wbindgen_export: (a: number, b: number) => number;
100
+ readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
101
+ readonly __wbindgen_export3: (a: number) => void;
102
+ readonly __wbindgen_export4: (a: number, b: number, c: number) => void;
103
+ readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
104
+ readonly __wbindgen_start: () => void;
101
105
  }
102
106
 
103
107
  export type SyncInitInput = BufferSource | WebAssembly.Module;
108
+
104
109
  /**
105
- * Instantiates the given `module`, which can either be bytes or
106
- * a precompiled `WebAssembly.Module`.
107
- *
108
- * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
109
- *
110
- * @returns {InitOutput}
111
- */
110
+ * Instantiates the given `module`, which can either be bytes or
111
+ * a precompiled `WebAssembly.Module`.
112
+ *
113
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
114
+ *
115
+ * @returns {InitOutput}
116
+ */
112
117
  export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
113
118
 
114
119
  /**
115
- * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
116
- * for everything else, calls `WebAssembly.instantiate` directly.
117
- *
118
- * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
119
- *
120
- * @returns {Promise<InitOutput>}
121
- */
120
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
121
+ * for everything else, calls `WebAssembly.instantiate` directly.
122
+ *
123
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
124
+ *
125
+ * @returns {Promise<InitOutput>}
126
+ */
122
127
  export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;