@oh-my-pi/pi-natives 8.12.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.
@@ -0,0 +1,88 @@
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 JPEG bytes with specified quality (0-100).
47
+ */
48
+ get_bytes_jpeg(quality: number): Uint8Array;
49
+ /**
50
+ * Get the height of the image.
51
+ */
52
+ get_height(): number;
53
+ /**
54
+ * Get the width of the image.
55
+ */
56
+ get_width(): number;
57
+ /**
58
+ * Create a new PhotonImage from encoded image bytes (PNG, JPEG, WebP, GIF).
59
+ */
60
+ static new_from_byteslice(bytes: Uint8Array): PhotonImage;
61
+ }
62
+
63
+ /**
64
+ * Sampling filter for resize operations.
65
+ */
66
+ export enum SamplingFilter {
67
+ Nearest = 1,
68
+ Triangle = 2,
69
+ CatmullRom = 3,
70
+ Gaussian = 4,
71
+ Lanczos3 = 5,
72
+ }
73
+
74
+ /**
75
+ * Quick check if content matches a pattern.
76
+ */
77
+ export function has_match(content: string, pattern: string, ignore_case: boolean, multiline: boolean): boolean;
78
+
79
+ /**
80
+ * Resize an image to the specified dimensions.
81
+ */
82
+ export function resize(image: PhotonImage, width: number, height: number, filter: SamplingFilter): PhotonImage;
83
+
84
+ /**
85
+ * Search content for a pattern (one-shot, compiles pattern each time).
86
+ * For repeated searches with the same pattern, use [`CompiledPattern`].
87
+ */
88
+ export function search(content: string, options: any): any;