@oh-my-pi/pi-natives 9.3.1 → 9.6.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 +10 -13
- package/native/pi_natives.darwin-arm64.node +0 -0
- package/native/pi_natives.darwin-x64.node +0 -0
- package/native/pi_natives.linux-arm64.node +0 -0
- package/native/pi_natives.linux-x64.node +0 -0
- package/native/pi_natives.win32-x64.node +0 -0
- package/package.json +6 -6
- package/src/find/types.ts +31 -0
- package/src/grep/index.ts +37 -295
- package/src/grep/types.ts +59 -19
- package/src/highlight/index.ts +5 -13
- package/src/html/index.ts +5 -35
- package/src/html/types.ts +1 -16
- package/src/image/index.ts +52 -73
- package/src/index.ts +20 -93
- package/src/native.ts +159 -0
- package/src/request-options.ts +94 -0
- package/src/text/index.ts +16 -24
- package/src/grep/file-reader.ts +0 -51
- package/src/grep/filters.ts +0 -77
- package/src/grep/worker.ts +0 -212
- package/src/html/worker.ts +0 -40
- package/src/image/types.ts +0 -52
- package/src/image/worker.ts +0 -152
- package/src/pool.ts +0 -362
- package/src/wasix.ts +0 -1745
- package/src/worker-resolver.ts +0 -9
- package/wasm/pi_natives.d.ts +0 -148
- package/wasm/pi_natives.js +0 -891
- package/wasm/pi_natives_bg.wasm +0 -0
- package/wasm/pi_natives_bg.wasm.d.ts +0 -32
package/src/worker-resolver.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
declare const OMP_COMPILED: boolean | undefined;
|
|
2
|
-
|
|
3
|
-
export function resolveWorkerSpecifier(options: { compiled: string; dev: URL }): string | URL {
|
|
4
|
-
if (typeof OMP_COMPILED !== "undefined" && OMP_COMPILED) {
|
|
5
|
-
return options.compiled;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
return options.dev;
|
|
9
|
-
}
|
package/wasm/pi_natives.d.ts
DELETED
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
/* tslint:disable */
|
|
2
|
-
/* eslint-disable */
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* A compiled regex matcher that can be reused across multiple searches.
|
|
6
|
-
*/
|
|
7
|
-
export class CompiledPattern {
|
|
8
|
-
free(): void;
|
|
9
|
-
[Symbol.dispose](): void;
|
|
10
|
-
/**
|
|
11
|
-
* Check if content has any matches (faster than full search).
|
|
12
|
-
*/
|
|
13
|
-
has_match(content: string): boolean;
|
|
14
|
-
/**
|
|
15
|
-
* Check if bytes have any matches (faster than full search).
|
|
16
|
-
*/
|
|
17
|
-
has_match_bytes(content: Uint8Array): boolean;
|
|
18
|
-
/**
|
|
19
|
-
* Compile a regex pattern for reuse.
|
|
20
|
-
*/
|
|
21
|
-
constructor(options: any);
|
|
22
|
-
/**
|
|
23
|
-
* Search content using this compiled pattern.
|
|
24
|
-
* Returns matches as a JS object.
|
|
25
|
-
*/
|
|
26
|
-
search(content: string, max_count?: number | null, offset?: number | null): any;
|
|
27
|
-
/**
|
|
28
|
-
* Search bytes directly (avoids UTF-16 to UTF-8 conversion).
|
|
29
|
-
* Use with `Bun.mmap()` for best performance.
|
|
30
|
-
*/
|
|
31
|
-
search_bytes(content: Uint8Array, max_count?: number | null, offset?: number | null): any;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Image container for WASM interop.
|
|
36
|
-
*/
|
|
37
|
-
export class PhotonImage {
|
|
38
|
-
private constructor();
|
|
39
|
-
free(): void;
|
|
40
|
-
[Symbol.dispose](): void;
|
|
41
|
-
/**
|
|
42
|
-
* Export image as PNG bytes.
|
|
43
|
-
*/
|
|
44
|
-
get_bytes(): Uint8Array;
|
|
45
|
-
/**
|
|
46
|
-
* Export image as GIF bytes.
|
|
47
|
-
*/
|
|
48
|
-
get_bytes_gif(): Uint8Array;
|
|
49
|
-
/**
|
|
50
|
-
* Export image as JPEG bytes with specified quality (0-100).
|
|
51
|
-
*/
|
|
52
|
-
get_bytes_jpeg(quality: number): Uint8Array;
|
|
53
|
-
/**
|
|
54
|
-
* Export image as lossless WebP bytes.
|
|
55
|
-
*/
|
|
56
|
-
get_bytes_webp(): Uint8Array;
|
|
57
|
-
/**
|
|
58
|
-
* Get the height of the image.
|
|
59
|
-
*/
|
|
60
|
-
get_height(): number;
|
|
61
|
-
/**
|
|
62
|
-
* Get the width of the image.
|
|
63
|
-
*/
|
|
64
|
-
get_width(): number;
|
|
65
|
-
/**
|
|
66
|
-
* Create a new `PhotonImage` from encoded image bytes (PNG, JPEG, WebP,
|
|
67
|
-
* GIF).
|
|
68
|
-
*/
|
|
69
|
-
static new_from_byteslice(bytes: Uint8Array): PhotonImage;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Sampling filter for resize operations.
|
|
74
|
-
*/
|
|
75
|
-
export enum SamplingFilter {
|
|
76
|
-
Nearest = 1,
|
|
77
|
-
Triangle = 2,
|
|
78
|
-
CatmullRom = 3,
|
|
79
|
-
Gaussian = 4,
|
|
80
|
-
Lanczos3 = 5,
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Extract the before/after slices around an overlay region.
|
|
85
|
-
*/
|
|
86
|
-
export function extract_segments(line: string, before_end: number, after_start: number, after_len: number, strict_after: boolean): any;
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Get list of supported languages.
|
|
90
|
-
*/
|
|
91
|
-
export function get_supported_languages(): string[];
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Quick check if content matches a pattern.
|
|
95
|
-
*/
|
|
96
|
-
export function has_match(content: string, pattern: string, ignore_case: boolean, multiline: boolean): boolean;
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Highlight code and return ANSI-colored lines.
|
|
100
|
-
*
|
|
101
|
-
* # Arguments
|
|
102
|
-
* * `code` - The source code to highlight
|
|
103
|
-
* * `lang` - Language identifier (e.g., "rust", "typescript", "python")
|
|
104
|
-
* * `colors` - Theme colors as ANSI escape sequences
|
|
105
|
-
*
|
|
106
|
-
* # Returns
|
|
107
|
-
* Highlighted code with ANSI color codes, or the original code if highlighting
|
|
108
|
-
* fails.
|
|
109
|
-
*/
|
|
110
|
-
export function highlight_code(code: string, lang: string | null | undefined, colors: any): string;
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Convert HTML to Markdown.
|
|
114
|
-
*/
|
|
115
|
-
export function html_to_markdown(html: string, options: any): string;
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* Resize an image to the specified dimensions.
|
|
119
|
-
*/
|
|
120
|
-
export function resize(image: PhotonImage, width: number, height: number, filter: SamplingFilter): PhotonImage;
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Search content for a pattern (one-shot, compiles pattern each time).
|
|
124
|
-
* For repeated searches with the same pattern, use [`CompiledPattern`].
|
|
125
|
-
*/
|
|
126
|
-
export function search(content: string, options: any): any;
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* Slice a range of visible columns from a line.
|
|
130
|
-
*/
|
|
131
|
-
export function slice_with_width(line: string, start_col: number, length: number, strict: boolean): any;
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* Check if a language is supported for highlighting.
|
|
135
|
-
* Returns true if the language has either direct support or a fallback
|
|
136
|
-
* mapping.
|
|
137
|
-
*/
|
|
138
|
-
export function supports_language(lang: string): boolean;
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* Truncate text to a visible width, preserving ANSI codes.
|
|
142
|
-
*/
|
|
143
|
-
export function truncate_to_width(text: string, max_width: number, ellipsis: string, pad: boolean): string;
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* Compute the visible width of a string, ignoring ANSI codes.
|
|
147
|
-
*/
|
|
148
|
-
export function visible_width(text: string): number;
|