pythonlib 0.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.
Files changed (66) hide show
  1. package/README.md +183 -0
  2. package/dist/chunk-3CSEXTA7.js +376 -0
  3. package/dist/chunk-3CSEXTA7.js.map +1 -0
  4. package/dist/chunk-HA5Y7PKO.js +680 -0
  5. package/dist/chunk-HA5Y7PKO.js.map +1 -0
  6. package/dist/chunk-IVYYI2VR.js +261 -0
  7. package/dist/chunk-IVYYI2VR.js.map +1 -0
  8. package/dist/chunk-OMQNGE6T.js +245 -0
  9. package/dist/chunk-OMQNGE6T.js.map +1 -0
  10. package/dist/chunk-P3SGIF72.js +107 -0
  11. package/dist/chunk-P3SGIF72.js.map +1 -0
  12. package/dist/chunk-PZ5AY32C.js +10 -0
  13. package/dist/chunk-PZ5AY32C.js.map +1 -0
  14. package/dist/chunk-TJFGYXBJ.js +310 -0
  15. package/dist/chunk-TJFGYXBJ.js.map +1 -0
  16. package/dist/chunk-TOI6IG3T.js +337 -0
  17. package/dist/chunk-TOI6IG3T.js.map +1 -0
  18. package/dist/chunk-UFMTN4T4.js +215 -0
  19. package/dist/chunk-UFMTN4T4.js.map +1 -0
  20. package/dist/chunk-V63LKSA3.js +423 -0
  21. package/dist/chunk-V63LKSA3.js.map +1 -0
  22. package/dist/chunk-WAONBJE5.js +236 -0
  23. package/dist/chunk-WAONBJE5.js.map +1 -0
  24. package/dist/collections-xN9Gi0TA.d.ts +113 -0
  25. package/dist/collections.d.ts +1 -0
  26. package/dist/collections.js +12 -0
  27. package/dist/collections.js.map +1 -0
  28. package/dist/datetime-DRwFAiGV.d.ts +139 -0
  29. package/dist/datetime.d.ts +1 -0
  30. package/dist/datetime.js +22 -0
  31. package/dist/datetime.js.map +1 -0
  32. package/dist/functools-St5GqpKG.d.ts +125 -0
  33. package/dist/functools.d.ts +1 -0
  34. package/dist/functools.js +32 -0
  35. package/dist/functools.js.map +1 -0
  36. package/dist/index.d.ts +624 -0
  37. package/dist/index.js +1332 -0
  38. package/dist/index.js.map +1 -0
  39. package/dist/itertools-Bj8XivI6.d.ts +138 -0
  40. package/dist/itertools.d.ts +1 -0
  41. package/dist/itertools.js +44 -0
  42. package/dist/itertools.js.map +1 -0
  43. package/dist/json-Xpk0kwSd.d.ts +77 -0
  44. package/dist/json.d.ts +1 -0
  45. package/dist/json.js +14 -0
  46. package/dist/json.js.map +1 -0
  47. package/dist/math-BrT4Aw3E.d.ts +147 -0
  48. package/dist/math.d.ts +1 -0
  49. package/dist/math.js +96 -0
  50. package/dist/math.js.map +1 -0
  51. package/dist/os-FRSJbEUH.d.ts +143 -0
  52. package/dist/os.d.ts +1 -0
  53. package/dist/os.js +58 -0
  54. package/dist/os.js.map +1 -0
  55. package/dist/random-D5S5iSV3.d.ts +72 -0
  56. package/dist/random.d.ts +1 -0
  57. package/dist/random.js +42 -0
  58. package/dist/random.js.map +1 -0
  59. package/dist/re-DSxiURqN.d.ts +148 -0
  60. package/dist/re.d.ts +1 -0
  61. package/dist/re.js +52 -0
  62. package/dist/re.js.map +1 -0
  63. package/dist/string.d.ts +166 -0
  64. package/dist/string.js +30 -0
  65. package/dist/string.js.map +1 -0
  66. package/package.json +85 -0
package/dist/math.js ADDED
@@ -0,0 +1,96 @@
1
+ import {
2
+ acos,
3
+ acosh,
4
+ asin,
5
+ asinh,
6
+ atan,
7
+ atan2,
8
+ atanh,
9
+ cbrt,
10
+ ceil,
11
+ copysign,
12
+ cos,
13
+ cosh,
14
+ degrees,
15
+ e,
16
+ exp,
17
+ expm1,
18
+ fabs,
19
+ factorial,
20
+ floor,
21
+ fsum,
22
+ gcd,
23
+ hypot,
24
+ inf,
25
+ isclose,
26
+ isfinite,
27
+ isinf,
28
+ isnan,
29
+ lcm,
30
+ log,
31
+ log10,
32
+ log1p,
33
+ log2,
34
+ modf,
35
+ nan,
36
+ pi,
37
+ pow,
38
+ prod,
39
+ radians,
40
+ sin,
41
+ sinh,
42
+ sqrt,
43
+ tan,
44
+ tanh,
45
+ tau,
46
+ trunc
47
+ } from "./chunk-IVYYI2VR.js";
48
+ import "./chunk-PZ5AY32C.js";
49
+ export {
50
+ acos,
51
+ acosh,
52
+ asin,
53
+ asinh,
54
+ atan,
55
+ atan2,
56
+ atanh,
57
+ cbrt,
58
+ ceil,
59
+ copysign,
60
+ cos,
61
+ cosh,
62
+ degrees,
63
+ e,
64
+ exp,
65
+ expm1,
66
+ fabs,
67
+ factorial,
68
+ floor,
69
+ fsum,
70
+ gcd,
71
+ hypot,
72
+ inf,
73
+ isclose,
74
+ isfinite,
75
+ isinf,
76
+ isnan,
77
+ lcm,
78
+ log,
79
+ log10,
80
+ log1p,
81
+ log2,
82
+ modf,
83
+ nan,
84
+ pi,
85
+ pow,
86
+ prod,
87
+ radians,
88
+ sin,
89
+ sinh,
90
+ sqrt,
91
+ tan,
92
+ tanh,
93
+ tau,
94
+ trunc
95
+ };
96
+ //# sourceMappingURL=math.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,143 @@
1
+ /**
2
+ * Python os module for TypeScript
3
+ *
4
+ * Provides operating system interface functions matching Python's os module.
5
+ * Note: This is a browser-compatible subset. Some functions are stubs.
6
+ */
7
+ /** Environment variables (browser-safe empty object or Node's process.env) */
8
+ declare const environ: Record<string, string | undefined>;
9
+ /** Get an environment variable */
10
+ declare function getenv(key: string, defaultValue?: string): string | undefined;
11
+ /** Path separator for the current platform */
12
+ declare const sep: string;
13
+ /** Alternative path separator (Windows has both / and \) */
14
+ declare const altsep: string | null;
15
+ /** Path list separator (: on Unix, ; on Windows) */
16
+ declare const pathsep: string;
17
+ /** Line separator */
18
+ declare const linesep: string;
19
+ /** Current directory string */
20
+ declare const curdir = ".";
21
+ /** Parent directory string */
22
+ declare const pardir = "..";
23
+ /** Extension separator */
24
+ declare const extsep = ".";
25
+ declare const path: {
26
+ /** Join path components intelligently */
27
+ join(...paths: string[]): string;
28
+ /** Return the base name of pathname */
29
+ basename(p: string, suffix?: string): string;
30
+ /** Return the directory name of pathname */
31
+ dirname(p: string): string;
32
+ /** Split pathname into (head, tail) */
33
+ split(p: string): [string, string];
34
+ /** Split pathname into root and extension */
35
+ splitext(p: string): [string, string];
36
+ /** Return the extension of pathname */
37
+ extname(p: string): string;
38
+ /** Test whether a path is absolute */
39
+ isabs(p: string): boolean;
40
+ /** Normalize a pathname */
41
+ normpath(p: string): string;
42
+ /** Return normalized absolutized version of pathname */
43
+ abspath(p: string): string;
44
+ /** Return canonical path, eliminating symlinks (stub - just normalizes) */
45
+ realpath(p: string): string;
46
+ /** Return relative path from start to path */
47
+ relpath(p: string, start?: string): string;
48
+ /** Return common path prefix */
49
+ commonpath(paths: string[]): string;
50
+ /** Expand ~ and ~user (stub - returns unchanged in browser) */
51
+ expanduser(p: string): string;
52
+ /** Expand shell variables (stub - returns unchanged) */
53
+ expandvars(p: string): string;
54
+ /** Test if path exists (stub - always returns false in browser) */
55
+ exists(_p: string): boolean;
56
+ /** Test if path is a file (stub - always returns false in browser) */
57
+ isfile(_p: string): boolean;
58
+ /** Test if path is a directory (stub - always returns false in browser) */
59
+ isdir(_p: string): boolean;
60
+ /** Test if path is a symbolic link (stub - always returns false in browser) */
61
+ islink(_p: string): boolean;
62
+ /** Return size of file (stub - returns 0 in browser) */
63
+ getsize(_p: string): number;
64
+ /** Return modification time (stub - returns 0 in browser) */
65
+ getmtime(_p: string): number;
66
+ /** Return access time (stub - returns 0 in browser) */
67
+ getatime(_p: string): number;
68
+ /** Return creation time (stub - returns 0 in browser) */
69
+ getctime(_p: string): number;
70
+ };
71
+ /** Get current working directory */
72
+ declare function getcwd(): string;
73
+ /** Get current working directory as bytes (same as getcwd in TS) */
74
+ declare function getcwdb(): string;
75
+ /** Change current working directory (stub in browser) */
76
+ declare function chdir(p: string): void;
77
+ /** List directory contents (stub - returns empty array in browser) */
78
+ declare function listdir(_p?: string): string[];
79
+ /** Create a directory (stub in browser) */
80
+ declare function mkdir(_p: string, _mode?: number): void;
81
+ /** Create a directory and parents (stub in browser) */
82
+ declare function makedirs(_p: string, _mode?: number, _existOk?: boolean): void;
83
+ /** Remove a file (stub in browser) */
84
+ declare function remove(_p: string): void;
85
+ /** Remove a file (alias for remove) */
86
+ declare const unlink: typeof remove;
87
+ /** Remove a directory (stub in browser) */
88
+ declare function rmdir(_p: string): void;
89
+ /** Remove directory tree (stub in browser) */
90
+ declare function removedirs(_p: string): void;
91
+ /** Rename a file or directory (stub in browser) */
92
+ declare function rename(_src: string, _dst: string): void;
93
+ /** Rename with automatic directory creation (stub in browser) */
94
+ declare function renames(_src: string, _dst: string): void;
95
+ /** Replace file (stub in browser) */
96
+ declare function replace(_src: string, _dst: string): void;
97
+ /** Walk directory tree (stub - yields nothing in browser) */
98
+ declare function walk(_top: string, _options?: {
99
+ topdown?: boolean;
100
+ followlinks?: boolean;
101
+ }): Generator<[string, string[], string[]]>;
102
+ /** Get file stat (stub in browser) */
103
+ declare function stat(_p: string): {
104
+ st_mode: number;
105
+ st_size: number;
106
+ st_mtime: number;
107
+ st_atime: number;
108
+ st_ctime: number;
109
+ };
110
+ /** Operating system name */
111
+ declare const name: string;
112
+
113
+ declare const osModule_altsep: typeof altsep;
114
+ declare const osModule_chdir: typeof chdir;
115
+ declare const osModule_curdir: typeof curdir;
116
+ declare const osModule_environ: typeof environ;
117
+ declare const osModule_extsep: typeof extsep;
118
+ declare const osModule_getcwd: typeof getcwd;
119
+ declare const osModule_getcwdb: typeof getcwdb;
120
+ declare const osModule_getenv: typeof getenv;
121
+ declare const osModule_linesep: typeof linesep;
122
+ declare const osModule_listdir: typeof listdir;
123
+ declare const osModule_makedirs: typeof makedirs;
124
+ declare const osModule_mkdir: typeof mkdir;
125
+ declare const osModule_name: typeof name;
126
+ declare const osModule_pardir: typeof pardir;
127
+ declare const osModule_path: typeof path;
128
+ declare const osModule_pathsep: typeof pathsep;
129
+ declare const osModule_remove: typeof remove;
130
+ declare const osModule_removedirs: typeof removedirs;
131
+ declare const osModule_rename: typeof rename;
132
+ declare const osModule_renames: typeof renames;
133
+ declare const osModule_replace: typeof replace;
134
+ declare const osModule_rmdir: typeof rmdir;
135
+ declare const osModule_sep: typeof sep;
136
+ declare const osModule_stat: typeof stat;
137
+ declare const osModule_unlink: typeof unlink;
138
+ declare const osModule_walk: typeof walk;
139
+ declare namespace osModule {
140
+ export { osModule_altsep as altsep, osModule_chdir as chdir, osModule_curdir as curdir, osModule_environ as environ, osModule_extsep as extsep, osModule_getcwd as getcwd, osModule_getcwdb as getcwdb, osModule_getenv as getenv, osModule_linesep as linesep, osModule_listdir as listdir, osModule_makedirs as makedirs, osModule_mkdir as mkdir, osModule_name as name, osModule_pardir as pardir, osModule_path as path, osModule_pathsep as pathsep, osModule_remove as remove, osModule_removedirs as removedirs, osModule_rename as rename, osModule_renames as renames, osModule_replace as replace, osModule_rmdir as rmdir, osModule_sep as sep, osModule_stat as stat, osModule_unlink as unlink, osModule_walk as walk };
141
+ }
142
+
143
+ export { name as A, altsep as a, pardir as b, curdir as c, extsep as d, environ as e, path as f, getenv as g, getcwd as h, getcwdb as i, chdir as j, listdir as k, linesep as l, mkdir as m, makedirs as n, osModule as o, pathsep as p, rmdir as q, remove as r, sep as s, removedirs as t, unlink as u, rename as v, renames as w, replace as x, walk as y, stat as z };
package/dist/os.d.ts ADDED
@@ -0,0 +1 @@
1
+ export { a as altsep, j as chdir, c as curdir, e as environ, d as extsep, h as getcwd, i as getcwdb, g as getenv, l as linesep, k as listdir, n as makedirs, m as mkdir, A as name, b as pardir, f as path, p as pathsep, r as remove, t as removedirs, v as rename, w as renames, x as replace, q as rmdir, s as sep, z as stat, u as unlink, y as walk } from './os-FRSJbEUH.js';
package/dist/os.js ADDED
@@ -0,0 +1,58 @@
1
+ import {
2
+ altsep,
3
+ chdir,
4
+ curdir,
5
+ environ,
6
+ extsep,
7
+ getcwd,
8
+ getcwdb,
9
+ getenv,
10
+ linesep,
11
+ listdir,
12
+ makedirs,
13
+ mkdir,
14
+ name,
15
+ pardir,
16
+ path,
17
+ pathsep,
18
+ remove,
19
+ removedirs,
20
+ rename,
21
+ renames,
22
+ replace,
23
+ rmdir,
24
+ sep,
25
+ stat,
26
+ unlink,
27
+ walk
28
+ } from "./chunk-TJFGYXBJ.js";
29
+ import "./chunk-PZ5AY32C.js";
30
+ export {
31
+ altsep,
32
+ chdir,
33
+ curdir,
34
+ environ,
35
+ extsep,
36
+ getcwd,
37
+ getcwdb,
38
+ getenv,
39
+ linesep,
40
+ listdir,
41
+ makedirs,
42
+ mkdir,
43
+ name,
44
+ pardir,
45
+ path,
46
+ pathsep,
47
+ remove,
48
+ removedirs,
49
+ rename,
50
+ renames,
51
+ replace,
52
+ rmdir,
53
+ sep,
54
+ stat,
55
+ unlink,
56
+ walk
57
+ };
58
+ //# sourceMappingURL=os.js.map
package/dist/os.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Python random module for TypeScript
3
+ *
4
+ * Provides random number generation functions matching Python's random module.
5
+ * Uses JavaScript's Math.random() as the underlying generator.
6
+ *
7
+ * Note: This is NOT cryptographically secure. For security-sensitive
8
+ * applications, use the Web Crypto API instead.
9
+ */
10
+ /** Return a random floating point number in the range [0.0, 1.0) */
11
+ declare function random(): number;
12
+ /** Return a random floating point number N such that a <= N <= b */
13
+ declare function uniform(a: number, b: number): number;
14
+ /** Return a random integer N such that a <= N <= b (inclusive) */
15
+ declare function randint(a: number, b: number): number;
16
+ /** Return a randomly selected element from range(start, stop, step) */
17
+ declare function randrange(start: number, stop?: number, step?: number): number;
18
+ /** Return a random element from the non-empty sequence */
19
+ declare function choice<T>(seq: T[] | string): T | string;
20
+ /** Return a k-length list of elements chosen from the population with replacement */
21
+ declare function choices<T>(population: T[], options?: {
22
+ weights?: number[];
23
+ k?: number;
24
+ }): T[];
25
+ /** Return a k-length list of unique elements chosen from the population (without replacement) */
26
+ declare function sample<T>(population: T[], k: number): T[];
27
+ /** Shuffle the sequence in place */
28
+ declare function shuffle(x: unknown[]): void;
29
+ /** Gaussian distribution with mean mu and standard deviation sigma */
30
+ declare function gauss(mu?: number, sigma?: number): number;
31
+ /** Normal distribution (alias for gauss) */
32
+ declare const normalvariate: typeof gauss;
33
+ /** Triangular distribution with low, high, and mode */
34
+ declare function triangular(low?: number, high?: number, mode?: number): number;
35
+ /** Beta distribution with alpha and beta parameters */
36
+ declare function betavariate(alpha: number, beta: number): number;
37
+ /** Exponential distribution with mean 1/lambd */
38
+ declare function expovariate(lambd: number): number;
39
+ /** Gamma distribution with shape alpha and scale beta */
40
+ declare function gammavariate(alpha: number, beta: number): number;
41
+ /** Log normal distribution */
42
+ declare function lognormvariate(mu: number, sigma: number): number;
43
+ /** Von Mises distribution (circular data) */
44
+ declare function vonmisesvariate(mu: number, kappa: number): number;
45
+ /** Pareto distribution */
46
+ declare function paretovariate(alpha: number): number;
47
+ /** Weibull distribution */
48
+ declare function weibullvariate(alpha: number, beta: number): number;
49
+
50
+ declare const randomModule_betavariate: typeof betavariate;
51
+ declare const randomModule_choice: typeof choice;
52
+ declare const randomModule_choices: typeof choices;
53
+ declare const randomModule_expovariate: typeof expovariate;
54
+ declare const randomModule_gammavariate: typeof gammavariate;
55
+ declare const randomModule_gauss: typeof gauss;
56
+ declare const randomModule_lognormvariate: typeof lognormvariate;
57
+ declare const randomModule_normalvariate: typeof normalvariate;
58
+ declare const randomModule_paretovariate: typeof paretovariate;
59
+ declare const randomModule_randint: typeof randint;
60
+ declare const randomModule_random: typeof random;
61
+ declare const randomModule_randrange: typeof randrange;
62
+ declare const randomModule_sample: typeof sample;
63
+ declare const randomModule_shuffle: typeof shuffle;
64
+ declare const randomModule_triangular: typeof triangular;
65
+ declare const randomModule_uniform: typeof uniform;
66
+ declare const randomModule_vonmisesvariate: typeof vonmisesvariate;
67
+ declare const randomModule_weibullvariate: typeof weibullvariate;
68
+ declare namespace randomModule {
69
+ export { randomModule_betavariate as betavariate, randomModule_choice as choice, randomModule_choices as choices, randomModule_expovariate as expovariate, randomModule_gammavariate as gammavariate, randomModule_gauss as gauss, randomModule_lognormvariate as lognormvariate, randomModule_normalvariate as normalvariate, randomModule_paretovariate as paretovariate, randomModule_randint as randint, randomModule_random as random, randomModule_randrange as randrange, randomModule_sample as sample, randomModule_shuffle as shuffle, randomModule_triangular as triangular, randomModule_uniform as uniform, randomModule_vonmisesvariate as vonmisesvariate, randomModule_weibullvariate as weibullvariate };
70
+ }
71
+
72
+ export { random as a, randint as b, randrange as c, choice as d, choices as e, shuffle as f, gauss as g, betavariate as h, expovariate as i, gammavariate as j, lognormvariate as l, normalvariate as n, paretovariate as p, randomModule as r, sample as s, triangular as t, uniform as u, vonmisesvariate as v, weibullvariate as w };
@@ -0,0 +1 @@
1
+ export { h as betavariate, d as choice, e as choices, i as expovariate, j as gammavariate, g as gauss, l as lognormvariate, n as normalvariate, p as paretovariate, b as randint, a as random, c as randrange, s as sample, f as shuffle, t as triangular, u as uniform, v as vonmisesvariate, w as weibullvariate } from './random-D5S5iSV3.js';
package/dist/random.js ADDED
@@ -0,0 +1,42 @@
1
+ import {
2
+ betavariate,
3
+ choice,
4
+ choices,
5
+ expovariate,
6
+ gammavariate,
7
+ gauss,
8
+ lognormvariate,
9
+ normalvariate,
10
+ paretovariate,
11
+ randint,
12
+ random,
13
+ randrange,
14
+ sample,
15
+ shuffle,
16
+ triangular,
17
+ uniform,
18
+ vonmisesvariate,
19
+ weibullvariate
20
+ } from "./chunk-WAONBJE5.js";
21
+ import "./chunk-PZ5AY32C.js";
22
+ export {
23
+ betavariate,
24
+ choice,
25
+ choices,
26
+ expovariate,
27
+ gammavariate,
28
+ gauss,
29
+ lognormvariate,
30
+ normalvariate,
31
+ paretovariate,
32
+ randint,
33
+ random,
34
+ randrange,
35
+ sample,
36
+ shuffle,
37
+ triangular,
38
+ uniform,
39
+ vonmisesvariate,
40
+ weibullvariate
41
+ };
42
+ //# sourceMappingURL=random.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,148 @@
1
+ /**
2
+ * Python re module for TypeScript
3
+ *
4
+ * Provides regular expression matching operations matching Python's re module.
5
+ * Uses JavaScript's RegExp as the underlying engine.
6
+ *
7
+ * Note: Some Python regex features are not supported in JavaScript:
8
+ * - Lookbehind assertions (limited support in modern JS)
9
+ * - Named groups use different syntax (?P<name>...) vs (?<name>...)
10
+ * - Verbose mode (x flag) is not supported
11
+ */
12
+ /** Ignore case */
13
+ declare const IGNORECASE = 2;
14
+ declare const I = 2;
15
+ /** Multi-line mode */
16
+ declare const MULTILINE = 8;
17
+ declare const M = 8;
18
+ /** Dot matches all (including newline) */
19
+ declare const DOTALL = 16;
20
+ declare const S = 16;
21
+ /** Unicode matching (always on in JS) */
22
+ declare const UNICODE = 32;
23
+ declare const U = 32;
24
+ /** ASCII-only matching */
25
+ declare const ASCII = 256;
26
+ declare const A = 256;
27
+ declare class Match {
28
+ private _match;
29
+ private _string;
30
+ private _pattern;
31
+ private _pos;
32
+ private _endpos;
33
+ constructor(match: RegExpExecArray, string: string, pattern: Pattern, pos?: number, endpos?: number);
34
+ /** Return the string matched by the RE */
35
+ group(groupNum?: number | string): string | undefined;
36
+ /** Return a tuple containing all subgroups */
37
+ groups(defaultValue?: string): (string | undefined)[];
38
+ /** Return a dictionary of named groups */
39
+ groupdict(defaultValue?: string): Record<string, string | undefined>;
40
+ /** Return the start index of the match */
41
+ start(groupNum?: number): number;
42
+ /** Return the end index of the match */
43
+ end(groupNum?: number): number;
44
+ /** Return a tuple (start, end) */
45
+ span(groupNum?: number): [number, number];
46
+ /** Return start position of search */
47
+ get pos(): number;
48
+ /** Return end position of search */
49
+ get endpos(): number;
50
+ /** Return the last matched group index */
51
+ get lastindex(): number | undefined;
52
+ /** Return the name of the last matched group */
53
+ get lastgroup(): string | undefined;
54
+ /** Return the pattern object */
55
+ get re(): Pattern;
56
+ /** Return the input string */
57
+ get string(): string;
58
+ /** Expand template with groups */
59
+ expand(template: string): string;
60
+ /** Return iterator of all groups */
61
+ [Symbol.iterator](): Generator<string | undefined>;
62
+ toString(): string;
63
+ }
64
+ declare class Pattern {
65
+ private _regex;
66
+ private _pattern;
67
+ private _flags;
68
+ constructor(pattern: string, flags?: number);
69
+ private _compileRegex;
70
+ /** Search for pattern in string */
71
+ search(string: string, pos?: number, endpos?: number): Match | null;
72
+ /** Match pattern at start of string */
73
+ match(string: string, pos?: number, endpos?: number): Match | null;
74
+ /** Match pattern against entire string */
75
+ fullmatch(string: string, pos?: number, endpos?: number): Match | null;
76
+ /** Split string by pattern */
77
+ split(string: string, maxsplit?: number): string[];
78
+ /** Find all matches */
79
+ findall(string: string, pos?: number, endpos?: number): (string | string[])[];
80
+ /** Find all matches as iterator */
81
+ finditer(string: string, pos?: number, endpos?: number): Generator<Match>;
82
+ /** Replace pattern in string */
83
+ sub(repl: string | ((match: Match) => string), string: string, count?: number): string;
84
+ /** Replace pattern and return (newstring, count) */
85
+ subn(repl: string | ((match: Match) => string), string: string, count?: number): [string, number];
86
+ /** Return the pattern string */
87
+ get pattern(): string;
88
+ /** Return the flags */
89
+ get flags(): number;
90
+ /** Return number of groups */
91
+ get groups(): number;
92
+ /** Return named groups mapping */
93
+ get groupindex(): Record<string, number>;
94
+ toString(): string;
95
+ }
96
+ /** Compile a regular expression pattern */
97
+ declare function compile(pattern: string, flags?: number): Pattern;
98
+ /** Search for pattern in string */
99
+ declare function search(pattern: string | Pattern, string: string, flags?: number): Match | null;
100
+ /** Match pattern at start of string */
101
+ declare function match(pattern: string | Pattern, string: string, flags?: number): Match | null;
102
+ /** Match pattern against entire string */
103
+ declare function fullmatch(pattern: string | Pattern, string: string, flags?: number): Match | null;
104
+ /** Split string by pattern */
105
+ declare function split(pattern: string | Pattern, string: string, maxsplit?: number, flags?: number): string[];
106
+ /** Find all matches */
107
+ declare function findall(pattern: string | Pattern, string: string, flags?: number): (string | string[])[];
108
+ /** Find all matches as iterator */
109
+ declare function finditer(pattern: string | Pattern, string: string, flags?: number): Generator<Match>;
110
+ /** Replace pattern in string */
111
+ declare function sub(pattern: string | Pattern, repl: string | ((match: Match) => string), string: string, count?: number, flags?: number): string;
112
+ /** Replace pattern and return (newstring, count) */
113
+ declare function subn(pattern: string | Pattern, repl: string | ((match: Match) => string), string: string, count?: number, flags?: number): [string, number];
114
+ /** Escape special characters in pattern */
115
+ declare function escape(pattern: string): string;
116
+ /** Purge the regex cache (no-op in this implementation) */
117
+ declare function purge(): void;
118
+
119
+ declare const reModule_A: typeof A;
120
+ declare const reModule_ASCII: typeof ASCII;
121
+ declare const reModule_DOTALL: typeof DOTALL;
122
+ declare const reModule_I: typeof I;
123
+ declare const reModule_IGNORECASE: typeof IGNORECASE;
124
+ declare const reModule_M: typeof M;
125
+ declare const reModule_MULTILINE: typeof MULTILINE;
126
+ type reModule_Match = Match;
127
+ declare const reModule_Match: typeof Match;
128
+ type reModule_Pattern = Pattern;
129
+ declare const reModule_Pattern: typeof Pattern;
130
+ declare const reModule_S: typeof S;
131
+ declare const reModule_U: typeof U;
132
+ declare const reModule_UNICODE: typeof UNICODE;
133
+ declare const reModule_compile: typeof compile;
134
+ declare const reModule_escape: typeof escape;
135
+ declare const reModule_findall: typeof findall;
136
+ declare const reModule_finditer: typeof finditer;
137
+ declare const reModule_fullmatch: typeof fullmatch;
138
+ declare const reModule_match: typeof match;
139
+ declare const reModule_purge: typeof purge;
140
+ declare const reModule_search: typeof search;
141
+ declare const reModule_split: typeof split;
142
+ declare const reModule_sub: typeof sub;
143
+ declare const reModule_subn: typeof subn;
144
+ declare namespace reModule {
145
+ export { reModule_A as A, reModule_ASCII as ASCII, reModule_DOTALL as DOTALL, reModule_I as I, reModule_IGNORECASE as IGNORECASE, reModule_M as M, reModule_MULTILINE as MULTILINE, reModule_Match as Match, reModule_Pattern as Pattern, reModule_S as S, reModule_U as U, reModule_UNICODE as UNICODE, reModule_compile as compile, reModule_escape as escape, reModule_findall as findall, reModule_finditer as finditer, reModule_fullmatch as fullmatch, reModule_match as match, reModule_purge as purge, reModule_search as search, reModule_split as split, reModule_sub as sub, reModule_subn as subn };
146
+ }
147
+
148
+ export { ASCII as A, DOTALL as D, IGNORECASE as I, MULTILINE as M, Pattern as P, S, UNICODE as U, I as a, M as b, U as c, A as d, Match as e, compile as f, fullmatch as g, split as h, findall as i, finditer as j, sub as k, subn as l, match as m, escape as n, purge as p, reModule as r, search as s };
package/dist/re.d.ts ADDED
@@ -0,0 +1 @@
1
+ export { d as A, A as ASCII, D as DOTALL, a as I, I as IGNORECASE, b as M, M as MULTILINE, e as Match, P as Pattern, S, c as U, U as UNICODE, f as compile, n as escape, i as findall, j as finditer, g as fullmatch, m as match, p as purge, s as search, h as split, k as sub, l as subn } from './re-DSxiURqN.js';
package/dist/re.js ADDED
@@ -0,0 +1,52 @@
1
+ import {
2
+ A,
3
+ ASCII,
4
+ DOTALL,
5
+ I,
6
+ IGNORECASE,
7
+ M,
8
+ MULTILINE,
9
+ Match,
10
+ Pattern,
11
+ S,
12
+ U,
13
+ UNICODE,
14
+ compile,
15
+ escape,
16
+ findall,
17
+ finditer,
18
+ fullmatch,
19
+ match,
20
+ purge,
21
+ search,
22
+ split,
23
+ sub,
24
+ subn
25
+ } from "./chunk-V63LKSA3.js";
26
+ import "./chunk-PZ5AY32C.js";
27
+ export {
28
+ A,
29
+ ASCII,
30
+ DOTALL,
31
+ I,
32
+ IGNORECASE,
33
+ M,
34
+ MULTILINE,
35
+ Match,
36
+ Pattern,
37
+ S,
38
+ U,
39
+ UNICODE,
40
+ compile,
41
+ escape,
42
+ findall,
43
+ finditer,
44
+ fullmatch,
45
+ match,
46
+ purge,
47
+ search,
48
+ split,
49
+ sub,
50
+ subn
51
+ };
52
+ //# sourceMappingURL=re.js.map
package/dist/re.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}