@gmb/bitmark-parser 3.0.1-alpha.2 → 3.0.1-alpha.4
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 +92 -11
- package/dist/browser/bitmark-parser.min.js +1 -1
- package/dist/browser/bitmark-parser.min.js.map +1 -1
- package/dist/browser/bitmark_wasm_bg.wasm +0 -0
- package/dist/browser/cjs/bitmark_wasm_bg.wasm +0 -0
- package/dist/browser/cjs/index.cjs +47 -16
- package/dist/browser/cjs/index.cjs.map +1 -1
- package/dist/browser/cjs/index.d.cts +121 -63
- package/dist/browser/esm/bitmark_wasm_bg.wasm +0 -0
- package/dist/browser/esm/index.d.ts +121 -63
- package/dist/browser/esm/index.js +47 -16
- package/dist/browser/esm/index.js.map +1 -1
- package/dist/cli.js +38 -16
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +19 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +83 -18
- package/dist/index.d.ts +83 -18
- package/dist/index.js +19 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/wasm/bitmark_wasm.d.ts +16 -15
- package/wasm/bitmark_wasm.js +32 -24
- package/wasm/bitmark_wasm_bg.wasm +0 -0
- package/wasm/bitmark_wasm_bg.wasm.d.ts +2 -2
|
@@ -1,72 +1,12 @@
|
|
|
1
|
-
/* tslint:disable */
|
|
2
|
-
/* eslint-disable */
|
|
3
|
-
/**
|
|
4
|
-
* Breakscape text (escape bitmark special characters).
|
|
5
|
-
*
|
|
6
|
-
* `format`: `"bitmark++"` (default) or `"plainText"`
|
|
7
|
-
* `location`: `"body"` (default) or `"tag"`
|
|
8
|
-
*/
|
|
9
|
-
declare function breakscape_text(input: string, format: string, location: string): string;
|
|
10
|
-
/**
|
|
11
|
-
* Unbreakscape text (unescape bitmark special characters).
|
|
12
|
-
*
|
|
13
|
-
* `format`: `"bitmark++"` (default) or `"plainText"`
|
|
14
|
-
* `location`: `"body"` (default) or `"tag"`
|
|
15
|
-
*/
|
|
16
|
-
declare function unbreakscape_text(input: string, format: string, location: string): string;
|
|
17
|
-
/**
|
|
18
|
-
* Parse bitmark input text and return the reference JSON format.
|
|
19
|
-
*
|
|
20
|
-
* Uses the full pipeline: parse → validate → serialize with optimized mode.
|
|
21
|
-
*/
|
|
22
|
-
declare function parse(input: string): string;
|
|
23
|
-
/**
|
|
24
|
-
* Auto-detect input format and convert between bitmark and JSON.
|
|
25
|
-
*
|
|
26
|
-
* `options_json` is a JSON string with optional fields:
|
|
27
|
-
* - `"mode"`: `"optimized"` (default) or `"full"`
|
|
28
|
-
* - `"warnings"`: `true` or `false` (default)
|
|
29
|
-
* - `"plainText"`: `true` or `false` (default)
|
|
30
|
-
* - `"pretty"`: `true` or `false` (default)
|
|
31
|
-
* - `"indent"`: number (default: 2)
|
|
32
|
-
*
|
|
33
|
-
* Returns JSON if input is bitmark, or an error message if input is JSON
|
|
34
|
-
* (generator not yet implemented).
|
|
35
|
-
*/
|
|
36
|
-
declare function convert(input: string, options_json: string): string;
|
|
37
|
-
/**
|
|
38
|
-
* Query information about supported bit types.
|
|
39
|
-
*
|
|
40
|
-
* `info_type`: `"list"`, `"bit"`, `"all"`, or `"deprecated"`
|
|
41
|
-
* `format`: `"text"` or `"json"`
|
|
42
|
-
* `bit`: bit name (required when `info_type` is `"bit"`)
|
|
43
|
-
* `pretty`: whether to pretty-print JSON output
|
|
44
|
-
* `indent`: indent size for pretty-printing (default: 2)
|
|
45
|
-
*/
|
|
46
|
-
declare function info(info_type: string, format: string, bit: string, pretty: boolean, indent: number): string;
|
|
47
|
-
/**
|
|
48
|
-
* Lex bitmark input text, returning one line per token in the same format as
|
|
49
|
-
* the Rust CLI: `{kind:?} {span:?} "{text}"`.
|
|
50
|
-
*
|
|
51
|
-
* `stage` selects the lexer pipeline:
|
|
52
|
-
* - `"lex"` — combined (default)
|
|
53
|
-
* - `"lex-bitmark"` — bitmark-level only
|
|
54
|
-
* - `"lex-text"` — text-level only
|
|
55
|
-
* - `"lex-json"` — combined, JSON array output
|
|
56
|
-
* - `"lex-bitmark-json"` — bitmark-level, JSON array output
|
|
57
|
-
* - `"lex-text-json"` — text-level, JSON array output
|
|
58
|
-
*/
|
|
59
|
-
declare function lex(input: string, stage: string): string;
|
|
60
|
-
|
|
61
1
|
type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
62
2
|
|
|
63
3
|
interface InitOutput {
|
|
64
4
|
readonly memory: WebAssembly.Memory;
|
|
65
5
|
readonly breakscape_text: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
66
|
-
readonly convert: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
6
|
+
readonly convert: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
67
7
|
readonly info: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
68
8
|
readonly lex: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
69
|
-
readonly parse: (a: number, b: number, c: number) => void;
|
|
9
|
+
readonly parse: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
70
10
|
readonly unbreakscape_text: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
71
11
|
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
72
12
|
readonly __wbindgen_export_0: (a: number, b: number) => number;
|
|
@@ -95,4 +35,122 @@ declare function initSync(module: { module: SyncInitInput } | SyncInitInput): In
|
|
|
95
35
|
*/
|
|
96
36
|
declare function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|
|
97
37
|
|
|
98
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Output mode for JSON serialization.
|
|
40
|
+
*
|
|
41
|
+
* - `"optimized"` — omit keys whose values match their natural defaults.
|
|
42
|
+
* - `"full"` — include all keys enumerated from the bitmark configuration.
|
|
43
|
+
*/
|
|
44
|
+
type OutputMode = "optimized" | "full";
|
|
45
|
+
/**
|
|
46
|
+
* Lexer stage selector.
|
|
47
|
+
*
|
|
48
|
+
* - `"lex"` — combined lexer, text output (default).
|
|
49
|
+
* - `"lex-bitmark"` — bitmark-level only, text output.
|
|
50
|
+
* - `"lex-text"` — text-level only, text output.
|
|
51
|
+
* - `"lex-json"` — combined lexer, JSON array output.
|
|
52
|
+
* - `"lex-bitmark-json"` — bitmark-level only, JSON array output.
|
|
53
|
+
* - `"lex-text-json"` — text-level only, JSON array output.
|
|
54
|
+
*/
|
|
55
|
+
type LexStage = "lex" | "lex-bitmark" | "lex-text" | "lex-json" | "lex-bitmark-json" | "lex-text-json";
|
|
56
|
+
/** Options for the {@link lex} function. */
|
|
57
|
+
interface LexOptions {
|
|
58
|
+
/** Selects the lexer pipeline stage (default: `"lex"`). */
|
|
59
|
+
stage?: LexStage;
|
|
60
|
+
}
|
|
61
|
+
/** Options for the {@link parse} function. */
|
|
62
|
+
interface ParseOptions {
|
|
63
|
+
/** JSON output mode (default: `"optimized"`). */
|
|
64
|
+
mode?: OutputMode;
|
|
65
|
+
}
|
|
66
|
+
/** Options for the {@link convert} function. */
|
|
67
|
+
interface ConvertOptions {
|
|
68
|
+
/** JSON output mode (default: `"optimized"`). */
|
|
69
|
+
mode?: OutputMode;
|
|
70
|
+
/** Include validation warnings in output (default: `false`). */
|
|
71
|
+
warnings?: boolean;
|
|
72
|
+
/** Output text as plain text — debug mode (default: `false`). */
|
|
73
|
+
plainText?: boolean;
|
|
74
|
+
/** Prettify JSON output (default: `false`). */
|
|
75
|
+
pretty?: boolean;
|
|
76
|
+
/** Indent size for pretty-printing (default: `2`). */
|
|
77
|
+
indent?: number;
|
|
78
|
+
}
|
|
79
|
+
/** Text format for breakscape / unbreakscape operations. */
|
|
80
|
+
type TextFormat = "bitmark++" | "plainText";
|
|
81
|
+
/** Text location for breakscape / unbreakscape operations. */
|
|
82
|
+
type TextLocation = "body" | "tag";
|
|
83
|
+
/** Options for the {@link breakscapeText} and {@link unbreakscapeText} functions. */
|
|
84
|
+
interface BreakscapeOptions {
|
|
85
|
+
/** Text format (default: `"bitmark++"`). */
|
|
86
|
+
format?: TextFormat;
|
|
87
|
+
/** Text location (default: `"body"`). */
|
|
88
|
+
location?: TextLocation;
|
|
89
|
+
}
|
|
90
|
+
/** Info query type for the {@link info} function. */
|
|
91
|
+
type InfoType = "list" | "bit" | "all" | "deprecated";
|
|
92
|
+
/** Output format for the {@link info} function. */
|
|
93
|
+
type InfoFormat = "text" | "json";
|
|
94
|
+
/** Options for the {@link info} function. */
|
|
95
|
+
interface InfoOptions {
|
|
96
|
+
/** Info query type (default: `"list"`). */
|
|
97
|
+
infoType?: InfoType;
|
|
98
|
+
/** Output format (default: `"text"`). */
|
|
99
|
+
format?: InfoFormat;
|
|
100
|
+
/** Bit name — required when `infoType` is `"bit"`. */
|
|
101
|
+
bit?: string;
|
|
102
|
+
/** Whether to pretty-print JSON output (default: `false`). */
|
|
103
|
+
pretty?: boolean;
|
|
104
|
+
/** Indent size for pretty-printing (default: `2`). */
|
|
105
|
+
indent?: number;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Lex bitmark input text, returning one line per token.
|
|
110
|
+
*
|
|
111
|
+
* @param input - The bitmark source text.
|
|
112
|
+
* @param options - Lex options (e.g. `{ stage: "lex-bitmark" }`).
|
|
113
|
+
* @returns Token dump string (one token per line).
|
|
114
|
+
*/
|
|
115
|
+
declare function lex(input: string, options?: LexOptions): string;
|
|
116
|
+
/**
|
|
117
|
+
* Parse bitmark input text and return the reference JSON format.
|
|
118
|
+
*
|
|
119
|
+
* @param input - The bitmark source text.
|
|
120
|
+
* @param options - Parse options (e.g. `{ mode: "full" }`).
|
|
121
|
+
* @returns JSON string of the parsed bitmark document.
|
|
122
|
+
*/
|
|
123
|
+
declare function parse(input: string, options?: ParseOptions): string;
|
|
124
|
+
/**
|
|
125
|
+
* Auto-detect input format and convert between bitmark and JSON.
|
|
126
|
+
*
|
|
127
|
+
* @param input - Bitmark or JSON input text.
|
|
128
|
+
* @param options - Convert options (e.g. `{ mode: "full", warnings: true }`).
|
|
129
|
+
* @returns Converted output string.
|
|
130
|
+
*/
|
|
131
|
+
declare function convert(input: string, options?: ConvertOptions): string;
|
|
132
|
+
/**
|
|
133
|
+
* Breakscape text (escape bitmark special characters).
|
|
134
|
+
*
|
|
135
|
+
* @param input - The text to breakscape.
|
|
136
|
+
* @param options - Breakscape options (e.g. `{ format: "plainText", location: "tag" }`).
|
|
137
|
+
* @returns Breakscaped text.
|
|
138
|
+
*/
|
|
139
|
+
declare function breakscapeText(input: string, options?: BreakscapeOptions): string;
|
|
140
|
+
/**
|
|
141
|
+
* Unbreakscape text (unescape bitmark special characters).
|
|
142
|
+
*
|
|
143
|
+
* @param input - The text to unbreakscape.
|
|
144
|
+
* @param options - Unbreakscape options (e.g. `{ format: "plainText", location: "tag" }`).
|
|
145
|
+
* @returns Unbreakscaped text.
|
|
146
|
+
*/
|
|
147
|
+
declare function unbreakscapeText(input: string, options?: BreakscapeOptions): string;
|
|
148
|
+
/**
|
|
149
|
+
* Query information about supported bit types.
|
|
150
|
+
*
|
|
151
|
+
* @param options - Info options (e.g. `{ infoType: "bit", format: "json", bit: "cloze" }`).
|
|
152
|
+
* @returns Information string.
|
|
153
|
+
*/
|
|
154
|
+
declare function info(options?: InfoOptions): string;
|
|
155
|
+
|
|
156
|
+
export { type BreakscapeOptions, type ConvertOptions, type InfoFormat, type InfoOptions, type InfoType, type LexOptions, type LexStage, type OutputMode, type ParseOptions, type TextFormat, type TextLocation, breakscapeText, convert, info, __wbg_init as init, initSync, lex, parse, unbreakscapeText };
|
|
Binary file
|
|
@@ -1,72 +1,12 @@
|
|
|
1
|
-
/* tslint:disable */
|
|
2
|
-
/* eslint-disable */
|
|
3
|
-
/**
|
|
4
|
-
* Breakscape text (escape bitmark special characters).
|
|
5
|
-
*
|
|
6
|
-
* `format`: `"bitmark++"` (default) or `"plainText"`
|
|
7
|
-
* `location`: `"body"` (default) or `"tag"`
|
|
8
|
-
*/
|
|
9
|
-
declare function breakscape_text(input: string, format: string, location: string): string;
|
|
10
|
-
/**
|
|
11
|
-
* Unbreakscape text (unescape bitmark special characters).
|
|
12
|
-
*
|
|
13
|
-
* `format`: `"bitmark++"` (default) or `"plainText"`
|
|
14
|
-
* `location`: `"body"` (default) or `"tag"`
|
|
15
|
-
*/
|
|
16
|
-
declare function unbreakscape_text(input: string, format: string, location: string): string;
|
|
17
|
-
/**
|
|
18
|
-
* Parse bitmark input text and return the reference JSON format.
|
|
19
|
-
*
|
|
20
|
-
* Uses the full pipeline: parse → validate → serialize with optimized mode.
|
|
21
|
-
*/
|
|
22
|
-
declare function parse(input: string): string;
|
|
23
|
-
/**
|
|
24
|
-
* Auto-detect input format and convert between bitmark and JSON.
|
|
25
|
-
*
|
|
26
|
-
* `options_json` is a JSON string with optional fields:
|
|
27
|
-
* - `"mode"`: `"optimized"` (default) or `"full"`
|
|
28
|
-
* - `"warnings"`: `true` or `false` (default)
|
|
29
|
-
* - `"plainText"`: `true` or `false` (default)
|
|
30
|
-
* - `"pretty"`: `true` or `false` (default)
|
|
31
|
-
* - `"indent"`: number (default: 2)
|
|
32
|
-
*
|
|
33
|
-
* Returns JSON if input is bitmark, or an error message if input is JSON
|
|
34
|
-
* (generator not yet implemented).
|
|
35
|
-
*/
|
|
36
|
-
declare function convert(input: string, options_json: string): string;
|
|
37
|
-
/**
|
|
38
|
-
* Query information about supported bit types.
|
|
39
|
-
*
|
|
40
|
-
* `info_type`: `"list"`, `"bit"`, `"all"`, or `"deprecated"`
|
|
41
|
-
* `format`: `"text"` or `"json"`
|
|
42
|
-
* `bit`: bit name (required when `info_type` is `"bit"`)
|
|
43
|
-
* `pretty`: whether to pretty-print JSON output
|
|
44
|
-
* `indent`: indent size for pretty-printing (default: 2)
|
|
45
|
-
*/
|
|
46
|
-
declare function info(info_type: string, format: string, bit: string, pretty: boolean, indent: number): string;
|
|
47
|
-
/**
|
|
48
|
-
* Lex bitmark input text, returning one line per token in the same format as
|
|
49
|
-
* the Rust CLI: `{kind:?} {span:?} "{text}"`.
|
|
50
|
-
*
|
|
51
|
-
* `stage` selects the lexer pipeline:
|
|
52
|
-
* - `"lex"` — combined (default)
|
|
53
|
-
* - `"lex-bitmark"` — bitmark-level only
|
|
54
|
-
* - `"lex-text"` — text-level only
|
|
55
|
-
* - `"lex-json"` — combined, JSON array output
|
|
56
|
-
* - `"lex-bitmark-json"` — bitmark-level, JSON array output
|
|
57
|
-
* - `"lex-text-json"` — text-level, JSON array output
|
|
58
|
-
*/
|
|
59
|
-
declare function lex(input: string, stage: string): string;
|
|
60
|
-
|
|
61
1
|
type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
62
2
|
|
|
63
3
|
interface InitOutput {
|
|
64
4
|
readonly memory: WebAssembly.Memory;
|
|
65
5
|
readonly breakscape_text: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
66
|
-
readonly convert: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
6
|
+
readonly convert: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
67
7
|
readonly info: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
68
8
|
readonly lex: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
69
|
-
readonly parse: (a: number, b: number, c: number) => void;
|
|
9
|
+
readonly parse: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
70
10
|
readonly unbreakscape_text: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
71
11
|
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
72
12
|
readonly __wbindgen_export_0: (a: number, b: number) => number;
|
|
@@ -95,4 +35,122 @@ declare function initSync(module: { module: SyncInitInput } | SyncInitInput): In
|
|
|
95
35
|
*/
|
|
96
36
|
declare function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|
|
97
37
|
|
|
98
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Output mode for JSON serialization.
|
|
40
|
+
*
|
|
41
|
+
* - `"optimized"` — omit keys whose values match their natural defaults.
|
|
42
|
+
* - `"full"` — include all keys enumerated from the bitmark configuration.
|
|
43
|
+
*/
|
|
44
|
+
type OutputMode = "optimized" | "full";
|
|
45
|
+
/**
|
|
46
|
+
* Lexer stage selector.
|
|
47
|
+
*
|
|
48
|
+
* - `"lex"` — combined lexer, text output (default).
|
|
49
|
+
* - `"lex-bitmark"` — bitmark-level only, text output.
|
|
50
|
+
* - `"lex-text"` — text-level only, text output.
|
|
51
|
+
* - `"lex-json"` — combined lexer, JSON array output.
|
|
52
|
+
* - `"lex-bitmark-json"` — bitmark-level only, JSON array output.
|
|
53
|
+
* - `"lex-text-json"` — text-level only, JSON array output.
|
|
54
|
+
*/
|
|
55
|
+
type LexStage = "lex" | "lex-bitmark" | "lex-text" | "lex-json" | "lex-bitmark-json" | "lex-text-json";
|
|
56
|
+
/** Options for the {@link lex} function. */
|
|
57
|
+
interface LexOptions {
|
|
58
|
+
/** Selects the lexer pipeline stage (default: `"lex"`). */
|
|
59
|
+
stage?: LexStage;
|
|
60
|
+
}
|
|
61
|
+
/** Options for the {@link parse} function. */
|
|
62
|
+
interface ParseOptions {
|
|
63
|
+
/** JSON output mode (default: `"optimized"`). */
|
|
64
|
+
mode?: OutputMode;
|
|
65
|
+
}
|
|
66
|
+
/** Options for the {@link convert} function. */
|
|
67
|
+
interface ConvertOptions {
|
|
68
|
+
/** JSON output mode (default: `"optimized"`). */
|
|
69
|
+
mode?: OutputMode;
|
|
70
|
+
/** Include validation warnings in output (default: `false`). */
|
|
71
|
+
warnings?: boolean;
|
|
72
|
+
/** Output text as plain text — debug mode (default: `false`). */
|
|
73
|
+
plainText?: boolean;
|
|
74
|
+
/** Prettify JSON output (default: `false`). */
|
|
75
|
+
pretty?: boolean;
|
|
76
|
+
/** Indent size for pretty-printing (default: `2`). */
|
|
77
|
+
indent?: number;
|
|
78
|
+
}
|
|
79
|
+
/** Text format for breakscape / unbreakscape operations. */
|
|
80
|
+
type TextFormat = "bitmark++" | "plainText";
|
|
81
|
+
/** Text location for breakscape / unbreakscape operations. */
|
|
82
|
+
type TextLocation = "body" | "tag";
|
|
83
|
+
/** Options for the {@link breakscapeText} and {@link unbreakscapeText} functions. */
|
|
84
|
+
interface BreakscapeOptions {
|
|
85
|
+
/** Text format (default: `"bitmark++"`). */
|
|
86
|
+
format?: TextFormat;
|
|
87
|
+
/** Text location (default: `"body"`). */
|
|
88
|
+
location?: TextLocation;
|
|
89
|
+
}
|
|
90
|
+
/** Info query type for the {@link info} function. */
|
|
91
|
+
type InfoType = "list" | "bit" | "all" | "deprecated";
|
|
92
|
+
/** Output format for the {@link info} function. */
|
|
93
|
+
type InfoFormat = "text" | "json";
|
|
94
|
+
/** Options for the {@link info} function. */
|
|
95
|
+
interface InfoOptions {
|
|
96
|
+
/** Info query type (default: `"list"`). */
|
|
97
|
+
infoType?: InfoType;
|
|
98
|
+
/** Output format (default: `"text"`). */
|
|
99
|
+
format?: InfoFormat;
|
|
100
|
+
/** Bit name — required when `infoType` is `"bit"`. */
|
|
101
|
+
bit?: string;
|
|
102
|
+
/** Whether to pretty-print JSON output (default: `false`). */
|
|
103
|
+
pretty?: boolean;
|
|
104
|
+
/** Indent size for pretty-printing (default: `2`). */
|
|
105
|
+
indent?: number;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Lex bitmark input text, returning one line per token.
|
|
110
|
+
*
|
|
111
|
+
* @param input - The bitmark source text.
|
|
112
|
+
* @param options - Lex options (e.g. `{ stage: "lex-bitmark" }`).
|
|
113
|
+
* @returns Token dump string (one token per line).
|
|
114
|
+
*/
|
|
115
|
+
declare function lex(input: string, options?: LexOptions): string;
|
|
116
|
+
/**
|
|
117
|
+
* Parse bitmark input text and return the reference JSON format.
|
|
118
|
+
*
|
|
119
|
+
* @param input - The bitmark source text.
|
|
120
|
+
* @param options - Parse options (e.g. `{ mode: "full" }`).
|
|
121
|
+
* @returns JSON string of the parsed bitmark document.
|
|
122
|
+
*/
|
|
123
|
+
declare function parse(input: string, options?: ParseOptions): string;
|
|
124
|
+
/**
|
|
125
|
+
* Auto-detect input format and convert between bitmark and JSON.
|
|
126
|
+
*
|
|
127
|
+
* @param input - Bitmark or JSON input text.
|
|
128
|
+
* @param options - Convert options (e.g. `{ mode: "full", warnings: true }`).
|
|
129
|
+
* @returns Converted output string.
|
|
130
|
+
*/
|
|
131
|
+
declare function convert(input: string, options?: ConvertOptions): string;
|
|
132
|
+
/**
|
|
133
|
+
* Breakscape text (escape bitmark special characters).
|
|
134
|
+
*
|
|
135
|
+
* @param input - The text to breakscape.
|
|
136
|
+
* @param options - Breakscape options (e.g. `{ format: "plainText", location: "tag" }`).
|
|
137
|
+
* @returns Breakscaped text.
|
|
138
|
+
*/
|
|
139
|
+
declare function breakscapeText(input: string, options?: BreakscapeOptions): string;
|
|
140
|
+
/**
|
|
141
|
+
* Unbreakscape text (unescape bitmark special characters).
|
|
142
|
+
*
|
|
143
|
+
* @param input - The text to unbreakscape.
|
|
144
|
+
* @param options - Unbreakscape options (e.g. `{ format: "plainText", location: "tag" }`).
|
|
145
|
+
* @returns Unbreakscaped text.
|
|
146
|
+
*/
|
|
147
|
+
declare function unbreakscapeText(input: string, options?: BreakscapeOptions): string;
|
|
148
|
+
/**
|
|
149
|
+
* Query information about supported bit types.
|
|
150
|
+
*
|
|
151
|
+
* @param options - Info options (e.g. `{ infoType: "bit", format: "json", bit: "cloze" }`).
|
|
152
|
+
* @returns Information string.
|
|
153
|
+
*/
|
|
154
|
+
declare function info(options?: InfoOptions): string;
|
|
155
|
+
|
|
156
|
+
export { type BreakscapeOptions, type ConvertOptions, type InfoFormat, type InfoOptions, type InfoType, type LexOptions, type LexStage, type OutputMode, type ParseOptions, type TextFormat, type TextLocation, breakscapeText, convert, info, __wbg_init as init, initSync, lex, parse, unbreakscapeText };
|
|
@@ -112,34 +112,36 @@ function unbreakscape_text(input, format, location) {
|
|
|
112
112
|
wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
function parse(input) {
|
|
116
|
-
let
|
|
117
|
-
let
|
|
115
|
+
function parse(input, mode) {
|
|
116
|
+
let deferred3_0;
|
|
117
|
+
let deferred3_1;
|
|
118
118
|
try {
|
|
119
119
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
120
120
|
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
121
121
|
const len0 = WASM_VECTOR_LEN;
|
|
122
|
-
|
|
122
|
+
const ptr1 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
123
|
+
const len1 = WASM_VECTOR_LEN;
|
|
124
|
+
wasm.parse(retptr, ptr0, len0, ptr1, len1);
|
|
123
125
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
124
126
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
125
|
-
|
|
126
|
-
|
|
127
|
+
deferred3_0 = r0;
|
|
128
|
+
deferred3_1 = r1;
|
|
127
129
|
return getStringFromWasm0(r0, r1);
|
|
128
130
|
} finally {
|
|
129
131
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
130
|
-
wasm.__wbindgen_export_2(
|
|
132
|
+
wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
131
133
|
}
|
|
132
134
|
}
|
|
133
|
-
function convert(input,
|
|
135
|
+
function convert(input, mode, warnings, plain_text, pretty, indent) {
|
|
134
136
|
let deferred3_0;
|
|
135
137
|
let deferred3_1;
|
|
136
138
|
try {
|
|
137
139
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
138
140
|
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
139
141
|
const len0 = WASM_VECTOR_LEN;
|
|
140
|
-
const ptr1 = passStringToWasm0(
|
|
142
|
+
const ptr1 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
141
143
|
const len1 = WASM_VECTOR_LEN;
|
|
142
|
-
wasm.convert(retptr, ptr0, len0, ptr1, len1);
|
|
144
|
+
wasm.convert(retptr, ptr0, len0, ptr1, len1, warnings, plain_text, pretty, indent);
|
|
143
145
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
144
146
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
145
147
|
deferred3_0 = r0;
|
|
@@ -268,14 +270,43 @@ async function __wbg_init(module_or_path) {
|
|
|
268
270
|
return __wbg_finalize_init(instance, module);
|
|
269
271
|
}
|
|
270
272
|
var bitmark_wasm_default = __wbg_init;
|
|
273
|
+
|
|
274
|
+
// src/browser/index.ts
|
|
275
|
+
function lex2(input, options = {}) {
|
|
276
|
+
return lex(input, options.stage ?? "lex");
|
|
277
|
+
}
|
|
278
|
+
function parse2(input, options = {}) {
|
|
279
|
+
return parse(input, options.mode ?? "optimized");
|
|
280
|
+
}
|
|
281
|
+
function convert2(input, options = {}) {
|
|
282
|
+
return convert(input, options.mode ?? "optimized", options.warnings ?? false, options.plainText ?? false, options.pretty ?? false, options.indent ?? 2);
|
|
283
|
+
}
|
|
284
|
+
function breakscapeText(input, options = {}) {
|
|
285
|
+
const format = options.format ?? "bitmark++";
|
|
286
|
+
const location = options.location ?? "body";
|
|
287
|
+
return breakscape_text(input, format, location);
|
|
288
|
+
}
|
|
289
|
+
function unbreakscapeText(input, options = {}) {
|
|
290
|
+
const format = options.format ?? "bitmark++";
|
|
291
|
+
const location = options.location ?? "body";
|
|
292
|
+
return unbreakscape_text(input, format, location);
|
|
293
|
+
}
|
|
294
|
+
function info2(options = {}) {
|
|
295
|
+
const infoType = options.infoType ?? "list";
|
|
296
|
+
const format = options.format ?? "text";
|
|
297
|
+
const bit = options.bit ?? "";
|
|
298
|
+
const pretty = options.pretty ?? false;
|
|
299
|
+
const indent = options.indent ?? 2;
|
|
300
|
+
return info(infoType, format, bit, pretty, indent);
|
|
301
|
+
}
|
|
271
302
|
export {
|
|
272
|
-
|
|
273
|
-
convert,
|
|
274
|
-
info,
|
|
303
|
+
breakscapeText,
|
|
304
|
+
convert2 as convert,
|
|
305
|
+
info2 as info,
|
|
275
306
|
bitmark_wasm_default as init,
|
|
276
307
|
initSync,
|
|
277
|
-
lex,
|
|
278
|
-
parse,
|
|
279
|
-
|
|
308
|
+
lex2 as lex,
|
|
309
|
+
parse2 as parse,
|
|
310
|
+
unbreakscapeText
|
|
280
311
|
};
|
|
281
312
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../wasm-web/bitmark_wasm.js"],"sourcesContent":["let wasm;\n\nlet WASM_VECTOR_LEN = 0;\n\nlet cachedUint8ArrayMemory0 = null;\n\nfunction getUint8ArrayMemory0() {\n if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {\n cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachedUint8ArrayMemory0;\n}\n\nconst cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );\n\nconst encodeString = (typeof cachedTextEncoder.encodeInto === 'function'\n ? function (arg, view) {\n return cachedTextEncoder.encodeInto(arg, view);\n}\n : function (arg, view) {\n const buf = cachedTextEncoder.encode(arg);\n view.set(buf);\n return {\n read: arg.length,\n written: buf.length\n };\n});\n\nfunction passStringToWasm0(arg, malloc, realloc) {\n\n if (realloc === undefined) {\n const buf = cachedTextEncoder.encode(arg);\n const ptr = malloc(buf.length, 1) >>> 0;\n getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);\n WASM_VECTOR_LEN = buf.length;\n return ptr;\n }\n\n let len = arg.length;\n let ptr = malloc(len, 1) >>> 0;\n\n const mem = getUint8ArrayMemory0();\n\n let offset = 0;\n\n for (; offset < len; offset++) {\n const code = arg.charCodeAt(offset);\n if (code > 0x7F) break;\n mem[ptr + offset] = code;\n }\n\n if (offset !== len) {\n if (offset !== 0) {\n arg = arg.slice(offset);\n }\n ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;\n const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);\n const ret = encodeString(arg, view);\n\n offset += ret.written;\n ptr = realloc(ptr, len, offset, 1) >>> 0;\n }\n\n WASM_VECTOR_LEN = offset;\n return ptr;\n}\n\nlet cachedDataViewMemory0 = null;\n\nfunction getDataViewMemory0() {\n if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {\n cachedDataViewMemory0 = new DataView(wasm.memory.buffer);\n }\n return cachedDataViewMemory0;\n}\n\nconst cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );\n\nif (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };\n\nfunction getStringFromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));\n}\n/**\n * Breakscape text (escape bitmark special characters).\n *\n * `format`: `\"bitmark++\"` (default) or `\"plainText\"`\n * `location`: `\"body\"` (default) or `\"tag\"`\n * @param {string} input\n * @param {string} format\n * @param {string} location\n * @returns {string}\n */\nexport function breakscape_text(input, format, location) {\n let deferred4_0;\n let deferred4_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n wasm.breakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred4_0 = r0;\n deferred4_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);\n }\n}\n\n/**\n * Unbreakscape text (unescape bitmark special characters).\n *\n * `format`: `\"bitmark++\"` (default) or `\"plainText\"`\n * `location`: `\"body\"` (default) or `\"tag\"`\n * @param {string} input\n * @param {string} format\n * @param {string} location\n * @returns {string}\n */\nexport function unbreakscape_text(input, format, location) {\n let deferred4_0;\n let deferred4_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n wasm.unbreakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred4_0 = r0;\n deferred4_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);\n }\n}\n\n/**\n * Parse bitmark input text and return the reference JSON format.\n *\n * Uses the full pipeline: parse → validate → serialize with optimized mode.\n * @param {string} input\n * @returns {string}\n */\nexport function parse(input) {\n let deferred2_0;\n let deferred2_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.parse(retptr, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred2_0 = r0;\n deferred2_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred2_0, deferred2_1, 1);\n }\n}\n\n/**\n * Auto-detect input format and convert between bitmark and JSON.\n *\n * `options_json` is a JSON string with optional fields:\n * - `\"mode\"`: `\"optimized\"` (default) or `\"full\"`\n * - `\"warnings\"`: `true` or `false` (default)\n * - `\"plainText\"`: `true` or `false` (default)\n * - `\"pretty\"`: `true` or `false` (default)\n * - `\"indent\"`: number (default: 2)\n *\n * Returns JSON if input is bitmark, or an error message if input is JSON\n * (generator not yet implemented).\n * @param {string} input\n * @param {string} options_json\n * @returns {string}\n */\nexport function convert(input, options_json) {\n let deferred3_0;\n let deferred3_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(options_json, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n wasm.convert(retptr, ptr0, len0, ptr1, len1);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred3_0 = r0;\n deferred3_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);\n }\n}\n\n/**\n * Query information about supported bit types.\n *\n * `info_type`: `\"list\"`, `\"bit\"`, `\"all\"`, or `\"deprecated\"`\n * `format`: `\"text\"` or `\"json\"`\n * `bit`: bit name (required when `info_type` is `\"bit\"`)\n * `pretty`: whether to pretty-print JSON output\n * `indent`: indent size for pretty-printing (default: 2)\n * @param {string} info_type\n * @param {string} format\n * @param {string} bit\n * @param {boolean} pretty\n * @param {number} indent\n * @returns {string}\n */\nexport function info(info_type, format, bit, pretty, indent) {\n let deferred4_0;\n let deferred4_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(info_type, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(bit, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n wasm.info(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred4_0 = r0;\n deferred4_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);\n }\n}\n\n/**\n * Lex bitmark input text, returning one line per token in the same format as\n * the Rust CLI: `{kind:?} {span:?} \"{text}\"`.\n *\n * `stage` selects the lexer pipeline:\n * - `\"lex\"` — combined (default)\n * - `\"lex-bitmark\"` — bitmark-level only\n * - `\"lex-text\"` — text-level only\n * - `\"lex-json\"` — combined, JSON array output\n * - `\"lex-bitmark-json\"` — bitmark-level, JSON array output\n * - `\"lex-text-json\"` — text-level, JSON array output\n * @param {string} input\n * @param {string} stage\n * @returns {string}\n */\nexport function lex(input, stage) {\n let deferred3_0;\n let deferred3_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(stage, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n wasm.lex(retptr, ptr0, len0, ptr1, len1);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred3_0 = r0;\n deferred3_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);\n }\n}\n\nasync function __wbg_load(module, imports) {\n if (typeof Response === 'function' && module instanceof Response) {\n if (typeof WebAssembly.instantiateStreaming === 'function') {\n try {\n return await WebAssembly.instantiateStreaming(module, imports);\n\n } catch (e) {\n if (module.headers.get('Content-Type') != 'application/wasm') {\n console.warn(\"`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n\", e);\n\n } else {\n throw e;\n }\n }\n }\n\n const bytes = await module.arrayBuffer();\n return await WebAssembly.instantiate(bytes, imports);\n\n } else {\n const instance = await WebAssembly.instantiate(module, imports);\n\n if (instance instanceof WebAssembly.Instance) {\n return { instance, module };\n\n } else {\n return instance;\n }\n }\n}\n\nfunction __wbg_get_imports() {\n const imports = {};\n imports.wbg = {};\n\n return imports;\n}\n\nfunction __wbg_init_memory(imports, memory) {\n\n}\n\nfunction __wbg_finalize_init(instance, module) {\n wasm = instance.exports;\n __wbg_init.__wbindgen_wasm_module = module;\n cachedDataViewMemory0 = null;\n cachedUint8ArrayMemory0 = null;\n\n\n\n return wasm;\n}\n\nfunction initSync(module) {\n if (wasm !== undefined) return wasm;\n\n\n if (typeof module !== 'undefined') {\n if (Object.getPrototypeOf(module) === Object.prototype) {\n ({module} = module)\n } else {\n console.warn('using deprecated parameters for `initSync()`; pass a single object instead')\n }\n }\n\n const imports = __wbg_get_imports();\n\n __wbg_init_memory(imports);\n\n if (!(module instanceof WebAssembly.Module)) {\n module = new WebAssembly.Module(module);\n }\n\n const instance = new WebAssembly.Instance(module, imports);\n\n return __wbg_finalize_init(instance, module);\n}\n\nasync function __wbg_init(module_or_path) {\n if (wasm !== undefined) return wasm;\n\n\n if (typeof module_or_path !== 'undefined') {\n if (Object.getPrototypeOf(module_or_path) === Object.prototype) {\n ({module_or_path} = module_or_path)\n } else {\n console.warn('using deprecated parameters for the initialization function; pass a single object instead')\n }\n }\n\n if (typeof module_or_path === 'undefined') {\n module_or_path = new URL('bitmark_wasm_bg.wasm', import.meta.url);\n }\n const imports = __wbg_get_imports();\n\n if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {\n module_or_path = fetch(module_or_path);\n }\n\n __wbg_init_memory(imports);\n\n const { instance, module } = await __wbg_load(await module_or_path, imports);\n\n return __wbg_finalize_init(instance, module);\n}\n\nexport { initSync };\nexport default __wbg_init;\n"],"mappings":";AAAA,IAAI;AAEJ,IAAI,kBAAkB;AAEtB,IAAI,0BAA0B;AAE9B,SAAS,uBAAuB;AAC5B,MAAI,4BAA4B,QAAQ,wBAAwB,eAAe,GAAG;AAC9E,8BAA0B,IAAI,WAAW,KAAK,OAAO,MAAM;AAAA,EAC/D;AACA,SAAO;AACX;AAEA,IAAM,oBAAqB,OAAO,gBAAgB,cAAc,IAAI,YAAY,OAAO,IAAI,EAAE,QAAQ,MAAM;AAAE,QAAM,MAAM,2BAA2B;AAAE,EAAE;AAExJ,IAAM,eAAgB,OAAO,kBAAkB,eAAe,aACx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,WAAW,MAAM,gBAAgB,OAAO;AAE3E,SAAO,oBAAoB,UAAU,MAAM;AAC/C;AAGA,IAAO,uBAAQ;","names":["ptr"]}
|
|
1
|
+
{"version":3,"sources":["../../../wasm-web/bitmark_wasm.js","../../../src/browser/index.ts"],"sourcesContent":["let wasm;\n\nlet WASM_VECTOR_LEN = 0;\n\nlet cachedUint8ArrayMemory0 = null;\n\nfunction getUint8ArrayMemory0() {\n if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {\n cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachedUint8ArrayMemory0;\n}\n\nconst cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );\n\nconst encodeString = (typeof cachedTextEncoder.encodeInto === 'function'\n ? function (arg, view) {\n return cachedTextEncoder.encodeInto(arg, view);\n}\n : function (arg, view) {\n const buf = cachedTextEncoder.encode(arg);\n view.set(buf);\n return {\n read: arg.length,\n written: buf.length\n };\n});\n\nfunction passStringToWasm0(arg, malloc, realloc) {\n\n if (realloc === undefined) {\n const buf = cachedTextEncoder.encode(arg);\n const ptr = malloc(buf.length, 1) >>> 0;\n getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);\n WASM_VECTOR_LEN = buf.length;\n return ptr;\n }\n\n let len = arg.length;\n let ptr = malloc(len, 1) >>> 0;\n\n const mem = getUint8ArrayMemory0();\n\n let offset = 0;\n\n for (; offset < len; offset++) {\n const code = arg.charCodeAt(offset);\n if (code > 0x7F) break;\n mem[ptr + offset] = code;\n }\n\n if (offset !== len) {\n if (offset !== 0) {\n arg = arg.slice(offset);\n }\n ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;\n const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);\n const ret = encodeString(arg, view);\n\n offset += ret.written;\n ptr = realloc(ptr, len, offset, 1) >>> 0;\n }\n\n WASM_VECTOR_LEN = offset;\n return ptr;\n}\n\nlet cachedDataViewMemory0 = null;\n\nfunction getDataViewMemory0() {\n if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {\n cachedDataViewMemory0 = new DataView(wasm.memory.buffer);\n }\n return cachedDataViewMemory0;\n}\n\nconst cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );\n\nif (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };\n\nfunction getStringFromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));\n}\n/**\n * Breakscape text (escape bitmark special characters).\n *\n * `format`: `\"bitmark++\"` (default) or `\"plainText\"`\n * `location`: `\"body\"` (default) or `\"tag\"`\n * @param {string} input\n * @param {string} format\n * @param {string} location\n * @returns {string}\n */\nexport function breakscape_text(input, format, location) {\n let deferred4_0;\n let deferred4_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n wasm.breakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred4_0 = r0;\n deferred4_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);\n }\n}\n\n/**\n * Unbreakscape text (unescape bitmark special characters).\n *\n * `format`: `\"bitmark++\"` (default) or `\"plainText\"`\n * `location`: `\"body\"` (default) or `\"tag\"`\n * @param {string} input\n * @param {string} format\n * @param {string} location\n * @returns {string}\n */\nexport function unbreakscape_text(input, format, location) {\n let deferred4_0;\n let deferred4_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n wasm.unbreakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred4_0 = r0;\n deferred4_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);\n }\n}\n\n/**\n * Parse bitmark input text and return the reference JSON format.\n *\n * Uses the full pipeline: parse → validate → serialize.\n *\n * `mode`: `\"optimized\"` (default) or `\"full\"`\n * @param {string} input\n * @param {string} mode\n * @returns {string}\n */\nexport function parse(input, mode) {\n let deferred3_0;\n let deferred3_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n wasm.parse(retptr, ptr0, len0, ptr1, len1);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred3_0 = r0;\n deferred3_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);\n }\n}\n\n/**\n * Auto-detect input format and convert between bitmark and JSON.\n *\n * `mode`: `\"optimized\"` (default) or `\"full\"`\n * `warnings`: whether to include validation warnings (default: false)\n * `plain_text`: output text as plain text — debug mode (default: false)\n * `pretty`: prettify JSON output (default: false)\n * `indent`: indent size for pretty-printing (default: 2)\n *\n * Returns JSON if input is bitmark, or an error message if input is JSON\n * (generator not yet implemented).\n * @param {string} input\n * @param {string} mode\n * @param {boolean} warnings\n * @param {boolean} plain_text\n * @param {boolean} pretty\n * @param {number} indent\n * @returns {string}\n */\nexport function convert(input, mode, warnings, plain_text, pretty, indent) {\n let deferred3_0;\n let deferred3_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n wasm.convert(retptr, ptr0, len0, ptr1, len1, warnings, plain_text, pretty, indent);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred3_0 = r0;\n deferred3_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);\n }\n}\n\n/**\n * Query information about supported bit types.\n *\n * `info_type`: `\"list\"`, `\"bit\"`, `\"all\"`, or `\"deprecated\"`\n * `format`: `\"text\"` or `\"json\"`\n * `bit`: bit name (required when `info_type` is `\"bit\"`)\n * `pretty`: whether to pretty-print JSON output\n * `indent`: indent size for pretty-printing (default: 2)\n * @param {string} info_type\n * @param {string} format\n * @param {string} bit\n * @param {boolean} pretty\n * @param {number} indent\n * @returns {string}\n */\nexport function info(info_type, format, bit, pretty, indent) {\n let deferred4_0;\n let deferred4_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(info_type, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(bit, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n wasm.info(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred4_0 = r0;\n deferred4_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);\n }\n}\n\n/**\n * Lex bitmark input text, returning one line per token in the same format as\n * the Rust CLI: `{kind:?} {span:?} \"{text}\"`.\n *\n * `stage` selects the lexer pipeline:\n * - `\"lex\"` — combined (default)\n * - `\"lex-bitmark\"` — bitmark-level only\n * - `\"lex-text\"` — text-level only\n * - `\"lex-json\"` — combined, JSON array output\n * - `\"lex-bitmark-json\"` — bitmark-level, JSON array output\n * - `\"lex-text-json\"` — text-level, JSON array output\n * @param {string} input\n * @param {string} stage\n * @returns {string}\n */\nexport function lex(input, stage) {\n let deferred3_0;\n let deferred3_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(stage, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n wasm.lex(retptr, ptr0, len0, ptr1, len1);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred3_0 = r0;\n deferred3_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);\n }\n}\n\nasync function __wbg_load(module, imports) {\n if (typeof Response === 'function' && module instanceof Response) {\n if (typeof WebAssembly.instantiateStreaming === 'function') {\n try {\n return await WebAssembly.instantiateStreaming(module, imports);\n\n } catch (e) {\n if (module.headers.get('Content-Type') != 'application/wasm') {\n console.warn(\"`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n\", e);\n\n } else {\n throw e;\n }\n }\n }\n\n const bytes = await module.arrayBuffer();\n return await WebAssembly.instantiate(bytes, imports);\n\n } else {\n const instance = await WebAssembly.instantiate(module, imports);\n\n if (instance instanceof WebAssembly.Instance) {\n return { instance, module };\n\n } else {\n return instance;\n }\n }\n}\n\nfunction __wbg_get_imports() {\n const imports = {};\n imports.wbg = {};\n\n return imports;\n}\n\nfunction __wbg_init_memory(imports, memory) {\n\n}\n\nfunction __wbg_finalize_init(instance, module) {\n wasm = instance.exports;\n __wbg_init.__wbindgen_wasm_module = module;\n cachedDataViewMemory0 = null;\n cachedUint8ArrayMemory0 = null;\n\n\n\n return wasm;\n}\n\nfunction initSync(module) {\n if (wasm !== undefined) return wasm;\n\n\n if (typeof module !== 'undefined') {\n if (Object.getPrototypeOf(module) === Object.prototype) {\n ({module} = module)\n } else {\n console.warn('using deprecated parameters for `initSync()`; pass a single object instead')\n }\n }\n\n const imports = __wbg_get_imports();\n\n __wbg_init_memory(imports);\n\n if (!(module instanceof WebAssembly.Module)) {\n module = new WebAssembly.Module(module);\n }\n\n const instance = new WebAssembly.Instance(module, imports);\n\n return __wbg_finalize_init(instance, module);\n}\n\nasync function __wbg_init(module_or_path) {\n if (wasm !== undefined) return wasm;\n\n\n if (typeof module_or_path !== 'undefined') {\n if (Object.getPrototypeOf(module_or_path) === Object.prototype) {\n ({module_or_path} = module_or_path)\n } else {\n console.warn('using deprecated parameters for the initialization function; pass a single object instead')\n }\n }\n\n if (typeof module_or_path === 'undefined') {\n module_or_path = new URL('bitmark_wasm_bg.wasm', import.meta.url);\n }\n const imports = __wbg_get_imports();\n\n if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {\n module_or_path = fetch(module_or_path);\n }\n\n __wbg_init_memory(imports);\n\n const { instance, module } = await __wbg_load(await module_or_path, imports);\n\n return __wbg_finalize_init(instance, module);\n}\n\nexport { initSync };\nexport default __wbg_init;\n","// This is a browser entry point that wraps the wasm-web bindings.\n// It re-exports all WASM functions so browser consumers can use:\n// import { parse, convert, ... } from '@gmb/bitmark-parser/browser'\n\nimport * as wasm from \"../../wasm-web/bitmark_wasm.js\";\n\nexport { default as init, initSync } from \"../../wasm-web/bitmark_wasm.js\";\n\nexport type { LexOptions, LexStage, ParseOptions, ConvertOptions, OutputMode, BreakscapeOptions, TextFormat, TextLocation, InfoOptions, InfoType, InfoFormat } from \"../types.js\";\nimport type { LexOptions, ParseOptions, ConvertOptions, BreakscapeOptions, InfoOptions } from \"../types.js\";\n\n/**\n * Lex bitmark input text, returning one line per token.\n *\n * @param input - The bitmark source text.\n * @param options - Lex options (e.g. `{ stage: \"lex-bitmark\" }`).\n * @returns Token dump string (one token per line).\n */\nexport function lex(input: string, options: LexOptions = {}): string {\n return wasm.lex(input, options.stage ?? \"lex\");\n}\n\n/**\n * Parse bitmark input text and return the reference JSON format.\n *\n * @param input - The bitmark source text.\n * @param options - Parse options (e.g. `{ mode: \"full\" }`).\n * @returns JSON string of the parsed bitmark document.\n */\nexport function parse(input: string, options: ParseOptions = {}): string {\n return wasm.parse(input, options.mode ?? \"optimized\");\n}\n\n/**\n * Auto-detect input format and convert between bitmark and JSON.\n *\n * @param input - Bitmark or JSON input text.\n * @param options - Convert options (e.g. `{ mode: \"full\", warnings: true }`).\n * @returns Converted output string.\n */\nexport function convert(input: string, options: ConvertOptions = {}): string {\n return wasm.convert(input, options.mode ?? \"optimized\", options.warnings ?? false, options.plainText ?? false, options.pretty ?? false, options.indent ?? 2);\n}\n\n/**\n * Breakscape text (escape bitmark special characters).\n *\n * @param input - The text to breakscape.\n * @param options - Breakscape options (e.g. `{ format: \"plainText\", location: \"tag\" }`).\n * @returns Breakscaped text.\n */\nexport function breakscapeText(input: string, options: BreakscapeOptions = {}): string {\n const format = options.format ?? \"bitmark++\";\n const location = options.location ?? \"body\";\n return wasm.breakscape_text(input, format, location);\n}\n\n/**\n * Unbreakscape text (unescape bitmark special characters).\n *\n * @param input - The text to unbreakscape.\n * @param options - Unbreakscape options (e.g. `{ format: \"plainText\", location: \"tag\" }`).\n * @returns Unbreakscaped text.\n */\nexport function unbreakscapeText(input: string, options: BreakscapeOptions = {}): string {\n const format = options.format ?? \"bitmark++\";\n const location = options.location ?? \"body\";\n return wasm.unbreakscape_text(input, format, location);\n}\n\n/**\n * Query information about supported bit types.\n *\n * @param options - Info options (e.g. `{ infoType: \"bit\", format: \"json\", bit: \"cloze\" }`).\n * @returns Information string.\n */\nexport function info(options: InfoOptions = {}): string {\n const infoType = options.infoType ?? \"list\";\n const format = options.format ?? \"text\";\n const bit = options.bit ?? \"\";\n const pretty = options.pretty ?? false;\n const indent = options.indent ?? 2;\n return wasm.info(infoType, format, bit, pretty, indent);\n}\n"],"mappings":";AAAA,IAAI;AAEJ,IAAI,kBAAkB;AAEtB,IAAI,0BAA0B;AAE9B,SAAS,uBAAuB;A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