@arborium/arborium 2.13.0 → 2.14.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/dist/arborium.d.ts +1 -1
- package/dist/arborium.iife.js +2 -2
- package/dist/arborium.iife.js.map +1 -1
- package/dist/arborium.js +96 -94
- package/dist/arborium.js.map +1 -1
- package/dist/arborium_host.d.ts +94 -0
- package/dist/arborium_host.js +300 -295
- package/dist/arborium_host_bg.wasm +0 -0
- package/dist/plugins-manifest.d.ts +1 -1
- package/dist/types.d.ts +10 -4
- package/package.json +9 -2
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Configuration for highlighting.
|
|
6
|
+
*/
|
|
7
|
+
export class HighlightConfig {
|
|
8
|
+
free(): void;
|
|
9
|
+
[Symbol.dispose](): void;
|
|
10
|
+
constructor();
|
|
11
|
+
/**
|
|
12
|
+
* Set HTML format to class names: `<span class="keyword">`, etc.
|
|
13
|
+
*/
|
|
14
|
+
setHtmlFormatClassNames(): void;
|
|
15
|
+
/**
|
|
16
|
+
* Set HTML format to class names with custom prefix.
|
|
17
|
+
*/
|
|
18
|
+
setHtmlFormatClassNamesWithPrefix(prefix: string): void;
|
|
19
|
+
/**
|
|
20
|
+
* Set HTML format to custom elements (default): `<a-k>`, `<a-f>`, etc.
|
|
21
|
+
*/
|
|
22
|
+
setHtmlFormatCustomElements(): void;
|
|
23
|
+
/**
|
|
24
|
+
* Set HTML format to custom elements with custom prefix.
|
|
25
|
+
*/
|
|
26
|
+
setHtmlFormatCustomElementsWithPrefix(prefix: string): void;
|
|
27
|
+
setMaxInjectionDepth(depth: number): void;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Highlight source code, resolving injections recursively.
|
|
32
|
+
*
|
|
33
|
+
* This uses the shared `AsyncHighlighter` from `arborium_highlight`,
|
|
34
|
+
* ensuring the same injection handling logic as Rust native.
|
|
35
|
+
*/
|
|
36
|
+
export function highlight(language: string, source: string): Promise<string>;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Highlight with custom configuration.
|
|
40
|
+
*/
|
|
41
|
+
export function highlightWithConfig(language: string, source: string, config: HighlightConfig): Promise<string>;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Check if a language is available for highlighting.
|
|
45
|
+
*/
|
|
46
|
+
export function isLanguageAvailable(language: string): boolean;
|
|
47
|
+
|
|
48
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
49
|
+
|
|
50
|
+
export interface InitOutput {
|
|
51
|
+
readonly memory: WebAssembly.Memory;
|
|
52
|
+
readonly __wbg_highlightconfig_free: (a: number, b: number) => void;
|
|
53
|
+
readonly highlight: (a: number, b: number, c: number, d: number) => any;
|
|
54
|
+
readonly highlightWithConfig: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
55
|
+
readonly highlightconfig_new: () => number;
|
|
56
|
+
readonly highlightconfig_setHtmlFormatClassNames: (a: number) => void;
|
|
57
|
+
readonly highlightconfig_setHtmlFormatClassNamesWithPrefix: (a: number, b: number, c: number) => void;
|
|
58
|
+
readonly highlightconfig_setHtmlFormatCustomElements: (a: number) => void;
|
|
59
|
+
readonly highlightconfig_setHtmlFormatCustomElementsWithPrefix: (a: number, b: number, c: number) => void;
|
|
60
|
+
readonly highlightconfig_setMaxInjectionDepth: (a: number, b: number) => void;
|
|
61
|
+
readonly isLanguageAvailable: (a: number, b: number) => number;
|
|
62
|
+
readonly wasm_bindgen__closure__destroy__ha32b65f709bd3468: (a: number, b: number) => void;
|
|
63
|
+
readonly wasm_bindgen__convert__closures_____invoke__h761d9f00c5fa0b61: (a: number, b: number, c: any) => [number, number];
|
|
64
|
+
readonly wasm_bindgen__convert__closures_____invoke__h07e4561434c6d5f9: (a: number, b: number, c: any, d: any) => void;
|
|
65
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
66
|
+
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
67
|
+
readonly __wbindgen_exn_store: (a: number) => void;
|
|
68
|
+
readonly __externref_table_alloc: () => number;
|
|
69
|
+
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
70
|
+
readonly __externref_table_dealloc: (a: number) => void;
|
|
71
|
+
readonly __wbindgen_start: () => void;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
78
|
+
* a precompiled `WebAssembly.Module`.
|
|
79
|
+
*
|
|
80
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
81
|
+
*
|
|
82
|
+
* @returns {InitOutput}
|
|
83
|
+
*/
|
|
84
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
88
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
89
|
+
*
|
|
90
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
91
|
+
*
|
|
92
|
+
* @returns {Promise<InitOutput>}
|
|
93
|
+
*/
|
|
94
|
+
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|