@gmb/bitmark-parser 6.11.1 → 7.1.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.
- package/README.md +361 -57
- package/dist/browser/bitmark-parser.min.js +4 -4
- package/dist/browser/bitmark-parser.min.js.map +1 -1
- package/dist/browser/cjs/index.cjs +966 -372
- package/dist/browser/cjs/index.cjs.map +1 -1
- package/dist/browser/cjs/index.d.cts +642 -70
- package/dist/browser/esm/index.d.ts +642 -70
- package/dist/browser/esm/index.js +958 -371
- package/dist/browser/esm/index.js.map +1 -1
- package/dist/browser/esm/worker-entry.js +790 -247
- package/dist/browser/esm/worker-entry.js.map +1 -1
- package/dist/browser/wasm/bitmark_browser_full_wasm_bg.wasm +0 -0
- package/dist/browser/wasm/bitmark_json_wasm_bg.wasm +0 -0
- package/dist/browser/wasm/bitmark_wasm_bg.wasm +0 -0
- package/dist/index.cjs +163 -124
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +637 -70
- package/dist/index.d.ts +637 -70
- package/dist/index.js +155 -123
- package/dist/index.js.map +1 -1
- package/dist/legacy.cjs +8 -30
- package/dist/legacy.cjs.map +1 -1
- package/dist/legacy.d.cts +0 -2
- package/dist/legacy.d.ts +0 -2
- package/dist/legacy.js +8 -30
- package/dist/legacy.js.map +1 -1
- package/dist/worker-entry.cjs +1 -5
- package/dist/worker-entry.cjs.map +1 -1
- package/package.json +7 -7
- package/schema/bitmark.schema.json +507 -141
- package/wasm/bitmark_wasm.d.ts +65 -26
- package/wasm/bitmark_wasm.js +348 -116
- package/wasm/bitmark_wasm_bg.wasm +0 -0
- package/wasm/bitmark_wasm_bg.wasm.d.ts +6 -3
- package/wasm/package.json +1 -1
- package/wasm-bitmark-json/bitmark_json_wasm.d.ts +56 -15
- package/wasm-bitmark-json/bitmark_json_wasm.js +321 -77
- package/wasm-bitmark-json/bitmark_json_wasm_bg.wasm +0 -0
- package/wasm-bitmark-json/bitmark_json_wasm_bg.wasm.d.ts +5 -2
- package/wasm-bitmark-json/package.json +1 -1
- package/wasm-browser-full/bitmark_browser_full_wasm.d.ts +65 -26
- package/wasm-browser-full/bitmark_browser_full_wasm.js +348 -116
- package/wasm-browser-full/bitmark_browser_full_wasm_bg.wasm +0 -0
- package/wasm-browser-full/bitmark_browser_full_wasm_bg.wasm.d.ts +6 -3
- package/wasm-browser-full/package.json +1 -1
|
Binary file
|
|
@@ -3,16 +3,19 @@
|
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
4
|
export const breakscape_text: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
5
5
|
export const canonicalize: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
|
|
6
|
-
export const
|
|
6
|
+
export const complete: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
|
|
7
|
+
export const convert: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number) => void;
|
|
7
8
|
export const convert_text: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
8
9
|
export const count_bits: (a: number, b: number, c: number) => void;
|
|
9
10
|
export const diff: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number) => void;
|
|
11
|
+
export const hover: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
10
12
|
export const info: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number) => void;
|
|
13
|
+
export const info_text_supported: () => number;
|
|
11
14
|
export const is_bitmark: (a: number, b: number) => number;
|
|
12
|
-
export const lex: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
13
15
|
export const prettify: (a: number, b: number, c: number, d: number) => void;
|
|
14
16
|
export const register: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
15
|
-
export const
|
|
17
|
+
export const resolve: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => void;
|
|
18
|
+
export const resolve_patch_document: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
16
19
|
export const split_bits: (a: number, b: number, c: number) => void;
|
|
17
20
|
export const split_json_bits: (a: number, b: number, c: number) => void;
|
|
18
21
|
export const transform: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number) => void;
|
package/wasm/package.json
CHANGED
|
@@ -40,43 +40,84 @@ export function info(info_type: string, format: string, bit: string, pretty: boo
|
|
|
40
40
|
*
|
|
41
41
|
* `data` is the file's own text. Semantics are REPLACE: a second call
|
|
42
42
|
* supersedes the first entirely, and the built-in table (where the variant
|
|
43
|
-
* bakes one) stays underneath.
|
|
44
|
-
*
|
|
43
|
+
* bakes one) stays underneath. Throws on bad data — like every other
|
|
44
|
+
* fallible export (PLAN-192 D1).
|
|
45
45
|
*
|
|
46
46
|
* Available in EVERY variant, including those that bake nothing: that is
|
|
47
47
|
* exactly where a consumer must supply the file themselves.
|
|
48
48
|
*/
|
|
49
|
-
export function register(data_type: string, data: string):
|
|
49
|
+
export function register(data_type: string, data: string): void;
|
|
50
50
|
/**
|
|
51
51
|
* Apply a patch (a JSON array of patch entries) to every bit and re-emit.
|
|
52
52
|
*
|
|
53
53
|
* `input_format_sel`: `"auto"` | `"bitmark"` | `"json"`.
|
|
54
|
-
* `output_format_sel`: `
|
|
54
|
+
* `output_format_sel`: the same vocabulary as `convert` — `"bitmark"` |
|
|
55
|
+
* `"json"` | `"text"` | a mapping id (`"html"`, …), `"auto"` (or empty) being
|
|
56
|
+
* the opposite of the resolved input format. The whole-document outputs
|
|
57
|
+
* (`lex`, `semantic-tokens`, `diagnostics`) are not per-bit formats; the
|
|
58
|
+
* pipeline refuses them and that refusal is what throws.
|
|
55
59
|
* `patch_json`: the patch entry array (empty string = no patches, i.e. a
|
|
56
60
|
* canonicalizing pass). Parallelism is a JS-side concern (web workers); this
|
|
57
|
-
* runs sequentially. Returns the document text/JSON
|
|
61
|
+
* runs sequentially. Returns the document text/JSON; throws on failure.
|
|
58
62
|
*/
|
|
59
63
|
export function transform(input: string, input_format_sel: string, output_format_sel: string, mode: string, patch_json: string, pretty: boolean, indent: number, spaces_around_values: number): string;
|
|
60
64
|
/**
|
|
61
65
|
* Resolve a patch document against `input` (bitmark or JSON) into the
|
|
62
66
|
* ordered output items, so a JS per-bit planner (hooks, worker pool) can
|
|
63
67
|
* reorder, drop and insert jobs from the one Rust implementation
|
|
64
|
-
* (PLAN-179).
|
|
68
|
+
* (PLAN-179). `input_format_sel` is the caller's input-format selector
|
|
69
|
+
* (`"auto"` | `"bitmark"` | `"json"`): the document is split under the SAME
|
|
70
|
+
* selection the planner already resolved, never re-sniffed (PLAN-187 D1).
|
|
71
|
+
* Returns a JSON array of
|
|
65
72
|
* `{ "source": <original index> | null, "bit": <inner bit> | null,
|
|
66
|
-
* "patch": [ … ] }
|
|
73
|
+
* "patch": [ … ] }`; throws on failure.
|
|
67
74
|
*/
|
|
68
|
-
export function resolve_patch_document(input: string, patch_json: string): string;
|
|
75
|
+
export function resolve_patch_document(input: string, input_format_sel: string, patch_json: string): string;
|
|
76
|
+
/**
|
|
77
|
+
* The constructs valid at a position, as an LSP `CompletionList` (PLAN-196
|
|
78
|
+
* D7; contract `API-EDT-editor-services.tsp`). `line` / `character` are
|
|
79
|
+
* 0-based, `character` in `position_encoding` units (`"utf-16"`, the
|
|
80
|
+
* default, or `"utf-8"`); `include_deprecated` offers deprecated bits too;
|
|
81
|
+
* `trigger_character` is the character the editor sent as the trigger (LSP
|
|
82
|
+
* `CompletionContext.triggerCharacter`; empty when invoked explicitly) — a
|
|
83
|
+
* trigger that opens nothing where the cursor is answers the empty list
|
|
84
|
+
* (PLAN-203 D1). ABSENT on a variant built without `editor` — the same
|
|
85
|
+
* "presence is the capability" signal `diff` uses. Throws when the line is
|
|
86
|
+
* past the text.
|
|
87
|
+
*/
|
|
88
|
+
export function complete(input: string, line: number, character: number, position_encoding: string, include_deprecated: boolean, trigger_character: string): string;
|
|
89
|
+
/**
|
|
90
|
+
* One item of the list `complete` returns at this position, its Markdown
|
|
91
|
+
* `documentation` filled in — LSP `completionItem/resolve` (PLAN-202):
|
|
92
|
+
* `complete` ships no documentation, an editor asks for the one item it is
|
|
93
|
+
* about to show. `label` and `kind` (the LSP `CompletionItemKind` number)
|
|
94
|
+
* name the item; the JSON `null` when the list has no such item. Arguments
|
|
95
|
+
* otherwise as `complete`.
|
|
96
|
+
*/
|
|
97
|
+
export function resolve(input: string, line: number, character: number, position_encoding: string, include_deprecated: boolean, label: string, kind: number): string;
|
|
98
|
+
/**
|
|
99
|
+
* The construct at a position, as an LSP `Hover` — or the JSON `null` when
|
|
100
|
+
* there is nothing to show (PLAN-196 D8). Arguments as `complete`.
|
|
101
|
+
*/
|
|
102
|
+
export function hover(input: string, line: number, character: number, position_encoding: string): string;
|
|
69
103
|
/**
|
|
70
104
|
* Convert between bitmark and JSON with explicit input/output formats + mode.
|
|
71
105
|
*
|
|
72
|
-
* `input_format`: `"auto"` (default) | `"bitmark"` | `"json"
|
|
73
|
-
* `output_format`: `"auto"` (opposite of input) | `"bitmark"` | `"json"
|
|
106
|
+
* `input_format`: `"auto"` (default) | `"bitmark"` | `"json"` | a mapping id.
|
|
107
|
+
* `output_format`: `"auto"` (opposite of input) | `"bitmark"` | `"json"` |
|
|
108
|
+
* `"text"` | `"lex"` (the token stream as JSON) | `"semantic-tokens"` |
|
|
109
|
+
* `"diagnostics"` (the last three bitmark input only) | a mapping id.
|
|
74
110
|
* `mode`: `"optimized"` (default) | `"full"`.
|
|
75
111
|
* `mapping_report`: replace the output with a human-readable report of the
|
|
76
112
|
* input→output mappings, including inputs that are NOT mapped (PLAN-147).
|
|
77
|
-
*
|
|
113
|
+
* `position_encoding`: `"utf-16"` (default) | `"utf-8"` — the
|
|
114
|
+
* `semantic-tokens` and `diagnostics` outputs' encoding (PLAN-193 /
|
|
115
|
+
* PLAN-196) — and `tokens_layout`: `"lsp"` (default) | `"absolute"` — the
|
|
116
|
+
* `semantic-tokens` layout; `""` means the default, and every other output
|
|
117
|
+
* format ignores them.
|
|
118
|
+
* Returns the converted text/JSON; throws on failure.
|
|
78
119
|
*/
|
|
79
|
-
export function convert(input: string, input_format_sel: string, output_format_sel: string, mode: string, pretty: boolean, indent: number, spaces_around_values: number, include_unknown_properties: boolean, mapping_report: boolean): string;
|
|
120
|
+
export function convert(input: string, input_format_sel: string, output_format_sel: string, mode: string, pretty: boolean, indent: number, spaces_around_values: number, include_unknown_properties: boolean, mapping_report: boolean, position_encoding: string, tokens_layout: string): string;
|
|
80
121
|
/**
|
|
81
122
|
* Re-emit input in its own format in canonical form at `mode`.
|
|
82
123
|
*
|
|
@@ -86,7 +127,7 @@ export function convert(input: string, input_format_sel: string, output_format_s
|
|
|
86
127
|
export function canonicalize(input: string, input_format_sel: string, mode: string, pretty: boolean, indent: number, spaces_around_values: number): string;
|
|
87
128
|
/**
|
|
88
129
|
* Count the bits in `input` (auto-detecting bitmark vs JSON).
|
|
89
|
-
* Returns the count as a decimal string
|
|
130
|
+
* Returns the count as a decimal string; throws on failure.
|
|
90
131
|
*/
|
|
91
132
|
export function count_bits(input: string): string;
|
|
92
133
|
/**
|
|
@@ -105,7 +146,7 @@ export function is_bitmark(input: string): boolean;
|
|
|
105
146
|
* Split a JSON document (a top-level array of bit envelopes) into its per-bit
|
|
106
147
|
* envelope objects, returned as a JSON array string. Lets a JS caller iterate
|
|
107
148
|
* JSON-input bits for per-bit hooks (the JSON counterpart of [`split_bits`]).
|
|
108
|
-
*
|
|
149
|
+
* Throws if the input is not a JSON array of bits.
|
|
109
150
|
*/
|
|
110
151
|
export function split_json_bits(input: string): string;
|
|
111
152
|
/**
|
|
@@ -121,6 +162,6 @@ export function prettify(json: string, indent: number): string;
|
|
|
121
162
|
* `format`: a bitmark text format (`"bitmark++"`, `"bitmark+"`) parses
|
|
122
163
|
* inline marks; anything else is treated as plain text (textToAst only).
|
|
123
164
|
* `location`: `"body"` (default) or `"tag"`.
|
|
124
|
-
* Returns the converted fragment
|
|
165
|
+
* Returns the converted fragment; throws on failure.
|
|
125
166
|
*/
|
|
126
167
|
export function convert_text(input: string, direction: string, format: string, location: string): string;
|