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
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/core.ts","../src/builtins.ts","../src/list.ts","../src/dict.ts","../src/set.ts","../src/index.ts"],"sourcesContent":["/**\n * Core Python operations for TypeScript\n * Arithmetic operations with Python semantics, slicing, etc.\n */\n\n// ============================================================\n// Arithmetic Operations (Python semantics)\n// ============================================================\n\n/**\n * Floor division (Python //)\n * Always rounds towards negative infinity, unlike Math.floor for negatives\n */\nexport function floordiv(a: number, b: number): number {\n return Math.floor(a / b)\n}\n\n/**\n * Power operator (Python **)\n */\nexport function pow(base: number, exp: number): number {\n return Math.pow(base, exp)\n}\n\n/**\n * Modulo (Python %)\n * Python's % always returns a result with the same sign as the divisor\n */\nexport function mod(a: number, b: number): number {\n return ((a % b) + b) % b\n}\n\n/**\n * Python divmod()\n */\nexport function divmod(a: number, b: number): [number, number] {\n return [floordiv(a, b), mod(a, b)]\n}\n\n// ============================================================\n// String Formatting\n// ============================================================\n\n/**\n * Python %-style string formatting\n * Handles %s, %d, %i, %f, %r, %x, %o, etc.\n */\nexport function sprintf(template: string, args: unknown): string {\n const values = Array.isArray(args) ? args : [args]\n let index = 0\n return template.replace(\n /%([+-]?\\d*\\.?\\d*)([sdifxXorec%])/g,\n (match: string, flags: string, type: string) => {\n if (type === \"%\") return \"%\"\n if (index >= values.length) return match\n const value: unknown = values[index++]\n switch (type) {\n case \"s\":\n return String(value)\n case \"d\":\n case \"i\":\n return String(Math.floor(Number(value)))\n case \"f\":\n if (flags && flags.includes(\".\")) {\n const precision = parseInt(flags.split(\".\")[1] ?? \"6\", 10)\n return Number(value).toFixed(precision)\n }\n return String(Number(value))\n case \"x\":\n return Math.floor(Number(value)).toString(16)\n case \"X\":\n return Math.floor(Number(value)).toString(16).toUpperCase()\n case \"o\":\n return Math.floor(Number(value)).toString(8)\n case \"r\":\n return JSON.stringify(value)\n case \"e\":\n return Number(value).toExponential()\n case \"c\":\n return String.fromCharCode(Number(value))\n default:\n return String(value)\n }\n }\n )\n}\n\n/**\n * Python str.format() style string formatting\n * Handles {} positional and {name} named placeholders\n */\nexport function strFormat(template: string, ...args: unknown[]): string {\n let positionalIndex = 0\n const lastArg = args[args.length - 1]\n const namedParams =\n lastArg && typeof lastArg === \"object\" && !Array.isArray(lastArg)\n ? (lastArg as Record<string, unknown>)\n : {}\n\n return template.replace(/\\{([^}]*)\\}/g, (match, key: string) => {\n if (key === \"\") {\n if (positionalIndex < args.length) {\n return String(args[positionalIndex++])\n }\n return match\n }\n\n const numIndex = parseInt(key, 10)\n if (!isNaN(numIndex) && numIndex < args.length) {\n return String(args[numIndex])\n }\n\n if (key in namedParams) {\n return String(namedParams[key])\n }\n\n return match\n })\n}\n\n// ============================================================\n// Slicing\n// ============================================================\n\nfunction normalizeIndex(index: number, length: number, forNegativeStep = false): number {\n if (index < 0) {\n index = length + index\n }\n\n if (forNegativeStep) {\n return Math.max(-1, Math.min(length - 1, index))\n }\n\n return Math.max(0, Math.min(length, index))\n}\n\n/**\n * Python-style slice operation\n * Supports negative indices and step\n */\nexport function slice<T>(\n obj: string | T[],\n start?: number,\n stop?: number,\n step?: number\n): string | T[] {\n const len = obj.length\n const actualStep = step ?? 1\n\n if (actualStep === 0) {\n throw new Error(\"slice step cannot be zero\")\n }\n\n let actualStart: number\n let actualStop: number\n\n if (actualStep > 0) {\n actualStart = start === undefined ? 0 : normalizeIndex(start, len)\n actualStop = stop === undefined ? len : normalizeIndex(stop, len)\n } else {\n actualStart = start === undefined ? len - 1 : normalizeIndex(start, len, true)\n actualStop = stop === undefined ? -1 : normalizeIndex(stop, len, true)\n }\n\n const result: T[] = []\n\n if (actualStep > 0) {\n for (let i = actualStart; i < actualStop; i += actualStep) {\n if (i >= 0 && i < len) {\n result.push((obj as T[])[i] as T)\n }\n }\n } else {\n for (let i = actualStart; i > actualStop; i += actualStep) {\n if (i >= 0 && i < len) {\n result.push((obj as T[])[i] as T)\n }\n }\n }\n\n if (typeof obj === \"string\") {\n return result.join(\"\")\n }\n\n return result\n}\n\n/**\n * Python-style index access with support for negative indices\n */\nexport function at<T>(obj: string | T[], index: number): T | string {\n const len = obj.length\n const normalizedIndex = index < 0 ? len + index : index\n if (normalizedIndex < 0 || normalizedIndex >= len) {\n throw new Error(\"IndexError: list index out of range\")\n }\n return (obj as T[])[normalizedIndex] as T\n}\n\n/**\n * Python-style string/array repetition\n */\nexport function repeat<T>(obj: string | T[], count: number): string | T[] {\n if (count <= 0) {\n return typeof obj === \"string\" ? \"\" : []\n }\n if (typeof obj === \"string\") {\n return obj.repeat(count)\n }\n const result: T[] = []\n for (let i = 0; i < count; i++) {\n result.push(...obj)\n }\n return result\n}\n\n// ============================================================\n// Membership & Identity\n// ============================================================\n\n/**\n * Python 'in' operator\n */\nexport function contains<T>(\n item: T,\n container: Iterable<T> | string | Map<T, unknown> | Set<T>\n): boolean {\n if (typeof container === \"string\") {\n return container.includes(item as unknown as string)\n }\n if (container instanceof Map) {\n return container.has(item)\n }\n if (container instanceof Set) {\n return container.has(item)\n }\n if (Array.isArray(container)) {\n return container.includes(item)\n }\n for (const element of container) {\n if (element === item) {\n return true\n }\n }\n return false\n}\n\n/**\n * Python 'is' operator (identity comparison)\n */\nexport function is(a: unknown, b: unknown): boolean {\n return a === b\n}\n","/**\n * Python built-in functions for TypeScript\n * len, range, enumerate, sorted, min, max, etc.\n */\n\n// Import for referencing py.bool and py.repr in str()\nimport type { py as PyType } from \"./index.js\"\nlet py: typeof PyType\n\n// This will be called from index.ts after py is constructed\nexport function _setPyRef(pyRef: typeof PyType): void {\n py = pyRef\n}\n\n// ============================================================\n// Iterables\n// ============================================================\n\n/**\n * Python range() function\n */\nexport function range(startOrStop: number, stop?: number, step?: number): Iterable<number> {\n let start: number\n let end: number\n let stepVal: number\n\n if (stop === undefined) {\n start = 0\n end = startOrStop\n stepVal = 1\n } else {\n start = startOrStop\n end = stop\n stepVal = step ?? 1\n }\n\n if (stepVal === 0) {\n throw new Error(\"range() arg 3 must not be zero\")\n }\n\n return {\n *[Symbol.iterator]() {\n if (stepVal > 0) {\n for (let i = start; i < end; i += stepVal) {\n yield i\n }\n } else {\n for (let i = start; i > end; i += stepVal) {\n yield i\n }\n }\n }\n }\n}\n\n/**\n * Python enumerate() function\n */\nexport function enumerate<T>(iterable: Iterable<T>, start = 0): Iterable<[number, T]> {\n return {\n *[Symbol.iterator]() {\n let index = start\n for (const item of iterable) {\n yield [index++, item] as [number, T]\n }\n }\n }\n}\n\n/**\n * Python zip() function\n */\nexport function zip<T extends unknown[][]>(\n ...iterables: { [K in keyof T]: Iterable<T[K]> }\n): Iterable<T> {\n return {\n *[Symbol.iterator]() {\n const iterators = iterables.map((it) => (it as Iterable<unknown>)[Symbol.iterator]())\n\n for (;;) {\n const results = iterators.map((it) => it.next())\n\n if (results.some((r) => r.done)) {\n break\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n yield results.map((r) => r.value) as T\n }\n }\n }\n}\n\n/**\n * Safe iteration helper for for-in loops\n */\nexport function iter<T>(\n obj: Iterable<T> | Record<string, unknown> | null | undefined\n): Iterable<T> | string[] {\n if (obj === null || obj === undefined) {\n return []\n }\n if (typeof (obj as Iterable<T>)[Symbol.iterator] === \"function\") {\n return obj as Iterable<T>\n }\n if (typeof obj === \"object\") {\n return Object.keys(obj)\n }\n return []\n}\n\n/**\n * Python reversed() function\n */\nexport function reversed<T>(iterable: Iterable<T>): Iterable<T> {\n const arr = Array.from(iterable)\n return {\n *[Symbol.iterator]() {\n for (let i = arr.length - 1; i >= 0; i--) {\n yield arr[i] as T\n }\n }\n }\n}\n\n/**\n * Python sorted() function\n */\nexport function sorted<T>(\n iterable: Iterable<T>,\n options?: { key?: (x: T) => unknown; reverse?: boolean }\n): T[] {\n const arr = Array.from(iterable)\n const key = options?.key ?? ((x: T) => x)\n const reverse = options?.reverse ?? false\n\n arr.sort((a, b) => {\n const aKey = key(a)\n const bKey = key(b)\n\n let cmp: number\n if (typeof aKey === \"string\" && typeof bKey === \"string\") {\n cmp = aKey.localeCompare(bKey)\n } else {\n cmp = (aKey as number) - (bKey as number)\n }\n\n return reverse ? -cmp : cmp\n })\n\n return arr\n}\n\n/**\n * Python map() function\n */\nexport function map<T, U>(fn: (x: T) => U, iterable: Iterable<T>): Iterable<U> {\n return {\n *[Symbol.iterator]() {\n for (const item of iterable) {\n yield fn(item)\n }\n }\n }\n}\n\n/**\n * Python filter() function\n */\nexport function filter<T>(fn: ((x: T) => boolean) | null, iterable: Iterable<T>): Iterable<T> {\n return {\n *[Symbol.iterator]() {\n for (const item of iterable) {\n if (fn === null ? bool(item) : fn(item)) {\n yield item\n }\n }\n }\n }\n}\n\n// ============================================================\n// Collections Constructors\n// ============================================================\n\n/**\n * Convert to list (array)\n */\nexport function list<T>(iterable?: Iterable<T>): T[] {\n if (iterable === undefined) {\n return []\n }\n return Array.from(iterable)\n}\n\n/**\n * Create a Map (Python dict)\n */\nexport function dict<K, V>(entries?: Iterable<[K, V]>): Map<K, V> {\n return new Map(entries)\n}\n\n/**\n * Create a Set\n */\nexport function set<T>(iterable?: Iterable<T>): Set<T> {\n return new Set(iterable)\n}\n\n/**\n * Create a tuple (readonly array)\n */\nexport function tuple<T extends unknown[]>(...items: T): Readonly<T> {\n return Object.freeze([...items]) as Readonly<T>\n}\n\n// ============================================================\n// Built-in Functions\n// ============================================================\n\n/**\n * Python len() function\n */\nexport function len(\n obj: string | unknown[] | Map<unknown, unknown> | Set<unknown> | { length: number }\n): number {\n if (typeof obj === \"string\" || Array.isArray(obj)) {\n return obj.length\n }\n if (obj instanceof Map || obj instanceof Set) {\n return obj.size\n }\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (typeof obj === \"object\" && obj !== null && \"length\" in obj) {\n return obj.length\n }\n throw new TypeError(\"object has no len()\")\n}\n\n/**\n * Python abs() function\n */\nexport function abs(x: number): number {\n return Math.abs(x)\n}\n\n/**\n * Python min() function\n */\nexport function min<T>(...args: T[] | [Iterable<T>]): T {\n const first = args[0]\n if (\n args.length === 1 &&\n typeof first === \"object\" &&\n first !== null &&\n Symbol.iterator in first\n ) {\n const arr = [...first]\n if (arr.length === 0) {\n throw new Error(\"min() arg is an empty sequence\")\n }\n return arr.reduce((a, b) => (a < b ? a : b))\n }\n\n if (args.length === 0) {\n throw new Error(\"min expected at least 1 argument, got 0\")\n }\n\n return (args as T[]).reduce((a, b) => (a < b ? a : b))\n}\n\n/**\n * Python max() function\n */\nexport function max<T>(...args: T[] | [Iterable<T>]): T {\n const first = args[0]\n if (\n args.length === 1 &&\n typeof first === \"object\" &&\n first !== null &&\n Symbol.iterator in first\n ) {\n const arr = [...first]\n if (arr.length === 0) {\n throw new Error(\"max() arg is an empty sequence\")\n }\n return arr.reduce((a, b) => (a > b ? a : b))\n }\n\n if (args.length === 0) {\n throw new Error(\"max expected at least 1 argument, got 0\")\n }\n\n return (args as T[]).reduce((a, b) => (a > b ? a : b))\n}\n\n/**\n * Python sum() function\n */\nexport function sum(iterable: Iterable<number>, start = 0): number {\n let total = start\n for (const item of iterable) {\n total += item\n }\n return total\n}\n\n/**\n * Python all() function\n */\nexport function all(iterable: Iterable<unknown>): boolean {\n for (const item of iterable) {\n if (!bool(item)) return false\n }\n return true\n}\n\n/**\n * Python any() function\n */\nexport function any(iterable: Iterable<unknown>): boolean {\n for (const item of iterable) {\n if (bool(item)) return true\n }\n return false\n}\n\n/**\n * Python round() function\n */\nexport function round(number: number, ndigits?: number): number {\n if (ndigits === undefined || ndigits === 0) {\n const rounded = Math.round(number)\n if (Math.abs(number % 1) === 0.5) {\n return rounded % 2 === 0 ? rounded : rounded - Math.sign(number)\n }\n return rounded\n }\n\n const factor = Math.pow(10, ndigits)\n return Math.round(number * factor) / factor\n}\n\n/**\n * Python ord()\n */\nexport function ord(char: string): number {\n if (char.length !== 1) {\n throw new Error(\"ord() expected a character\")\n }\n return char.charCodeAt(0)\n}\n\n/**\n * Python chr()\n */\nexport function chr(code: number): string {\n return String.fromCharCode(code)\n}\n\n/**\n * Python hex()\n */\nexport function hex(x: number): string {\n const prefix = x < 0 ? \"-0x\" : \"0x\"\n return prefix + Math.abs(Math.trunc(x)).toString(16)\n}\n\n/**\n * Python oct()\n */\nexport function oct(x: number): string {\n const prefix = x < 0 ? \"-0o\" : \"0o\"\n return prefix + Math.abs(Math.trunc(x)).toString(8)\n}\n\n/**\n * Python bin()\n */\nexport function bin(x: number): string {\n const prefix = x < 0 ? \"-0b\" : \"0b\"\n return prefix + Math.abs(Math.trunc(x)).toString(2)\n}\n\n// ============================================================\n// Type Conversions\n// ============================================================\n\n/**\n * Python int() function\n */\nexport function int(x: string | number | boolean, base?: number): number {\n if (typeof x === \"boolean\") {\n return x ? 1 : 0\n }\n if (typeof x === \"number\") {\n return Math.trunc(x)\n }\n const parsed = base !== undefined ? parseInt(x, base) : parseInt(x, 10)\n if (isNaN(parsed)) {\n throw new Error(`invalid literal for int(): '${x}'`)\n }\n return parsed\n}\n\n/**\n * Python float() function\n */\nexport function float(x: string | number): number {\n if (typeof x === \"number\") {\n return x\n }\n const parsed = parseFloat(x)\n if (isNaN(parsed)) {\n throw new Error(`could not convert string to float: '${x}'`)\n }\n return parsed\n}\n\n/**\n * Python str() function\n */\nexport function str(x: unknown): string {\n if (x === null) {\n return \"None\"\n }\n if (x === undefined) {\n return \"None\"\n }\n if (typeof x === \"boolean\") {\n return x ? \"True\" : \"False\"\n }\n if (Array.isArray(x)) {\n return \"[\" + x.map((item) => py.repr(item)).join(\", \") + \"]\"\n }\n if (x instanceof Map) {\n const entries = Array.from(x.entries())\n .map(([k, v]) => `${py.repr(k)}: ${py.repr(v)}`)\n .join(\", \")\n return \"{\" + entries + \"}\"\n }\n if (x instanceof Set) {\n if (x.size === 0) {\n return \"set()\"\n }\n return (\n \"{\" +\n Array.from(x)\n .map((item) => py.repr(item))\n .join(\", \") +\n \"}\"\n )\n }\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n return String(x)\n}\n\n/**\n * Python repr() function\n */\nexport function repr(x: unknown): string {\n if (typeof x === \"string\") {\n return `'${x}'`\n }\n return str(x)\n}\n\n/**\n * Python bool() function\n */\nexport function bool(x: unknown): boolean {\n if (x === null || x === undefined) {\n return false\n }\n if (typeof x === \"boolean\") {\n return x\n }\n if (typeof x === \"number\") {\n return x !== 0\n }\n if (typeof x === \"string\") {\n return x.length > 0\n }\n if (Array.isArray(x)) {\n return x.length > 0\n }\n if (x instanceof Map || x instanceof Set) {\n return x.size > 0\n }\n return true\n}\n\n/**\n * Python ascii() - returns ASCII representation\n */\nexport function ascii(x: unknown): string {\n const s = repr(x)\n let result = \"\"\n for (const char of s) {\n const code = char.charCodeAt(0)\n if (code > 127) {\n if (code > 0xffff) {\n result += `\\\\U${code.toString(16).padStart(8, \"0\")}`\n } else {\n result += `\\\\u${code.toString(16).padStart(4, \"0\")}`\n }\n } else {\n result += char\n }\n }\n return result\n}\n\n/**\n * Python isinstance() - simplified version\n */\nexport function isinstance(obj: unknown, classInfo: unknown): boolean {\n if (classInfo === Number || classInfo === \"int\" || classInfo === \"float\") {\n return typeof obj === \"number\"\n }\n if (classInfo === String || classInfo === \"str\") {\n return typeof obj === \"string\"\n }\n if (classInfo === Boolean || classInfo === \"bool\") {\n return typeof obj === \"boolean\"\n }\n if (classInfo === Array || classInfo === \"list\") {\n return Array.isArray(obj)\n }\n if (classInfo === Map || classInfo === \"dict\") {\n return obj instanceof Map\n }\n if (classInfo === Set || classInfo === \"set\") {\n return obj instanceof Set\n }\n if (typeof classInfo === \"function\") {\n return obj instanceof classInfo\n }\n return false\n}\n\n/**\n * Python type() - simplified version\n */\nexport function type(obj: unknown): string {\n if (obj === null) return \"NoneType\"\n if (typeof obj === \"number\") {\n return Number.isInteger(obj) ? \"int\" : \"float\"\n }\n if (typeof obj === \"string\") return \"str\"\n if (typeof obj === \"boolean\") return \"bool\"\n if (Array.isArray(obj)) return \"list\"\n if (obj instanceof Map) return \"dict\"\n if (obj instanceof Set) return \"set\"\n return typeof obj\n}\n\n/**\n * Python input() - for Node.js\n */\nexport function input(prompt?: string): string {\n if (prompt) {\n process.stdout.write(prompt)\n }\n throw new Error(\"input() requires async implementation\")\n}\n\n// ============================================================\n// Format Function\n// ============================================================\n\nfunction formatNumber(\n num: number,\n sign: string | undefined,\n _hash: string | undefined,\n grouping: string | undefined,\n precision?: number,\n isInteger = true\n): string {\n let result: string\n\n if (isInteger) {\n result = Math.trunc(num).toString()\n } else {\n result = num.toFixed(precision ?? 6)\n }\n\n if (grouping) {\n const sep = grouping === \"_\" ? \"_\" : \",\"\n const parts = result.split(\".\")\n const intPart = parts[0] as string\n const signChar = intPart[0] === \"-\" ? \"-\" : \"\"\n const digits = signChar ? intPart.slice(1) : intPart\n const grouped = digits.replace(/\\B(?=(\\d{3})+(?!\\d))/g, sep)\n parts[0] = signChar + grouped\n result = parts.join(\".\")\n }\n\n if (num >= 0) {\n if (sign === \"+\") {\n result = \"+\" + result\n } else if (sign === \" \") {\n result = \" \" + result\n }\n }\n\n return result\n}\n\n/**\n * Python format() - formats a value according to format spec\n */\nexport function format(value: unknown, spec: string): string {\n if (spec === \"\") {\n return str(value)\n }\n\n const match = spec.match(\n /^(.?[<>=^])?([+\\- ])?([#])?(0)?(\\d+)?([,_])?(?:\\.(\\d+))?([bcdeEfFgGnosxX%])?$/\n )\n\n if (!match) {\n return str(value)\n }\n\n const [, alignPart, sign, hash, zero, widthStr, grouping, precisionStr, typeChar] = match\n\n let fill = \" \"\n let align = \"\"\n if (alignPart) {\n if (alignPart.length === 2) {\n fill = alignPart[0] as string\n align = alignPart[1] as string\n } else {\n align = alignPart\n }\n }\n\n const width = widthStr ? parseInt(widthStr, 10) : 0\n const precision = precisionStr !== undefined ? parseInt(precisionStr, 10) : undefined\n\n if (zero && !alignPart) {\n fill = \"0\"\n align = \"=\"\n }\n\n let result: string\n\n if (typeChar === \"s\" || (!typeChar && typeof value === \"string\")) {\n result = str(value)\n if (precision !== undefined) {\n result = result.slice(0, precision)\n }\n } else if (\n typeChar === \"d\" ||\n (!typeChar && typeof value === \"number\" && Number.isInteger(value))\n ) {\n const num = typeof value === \"number\" ? value : int(value as string | number | boolean)\n result = formatNumber(num, sign, \"\", grouping)\n } else if (typeChar === \"f\" || typeChar === \"F\") {\n const num = typeof value === \"number\" ? value : float(value as string | number)\n const prec = precision ?? 6\n result = formatNumber(num, sign, \"\", grouping, prec, false)\n if (typeChar === \"F\") result = result.toUpperCase()\n } else if (typeChar === \"e\" || typeChar === \"E\") {\n const num = typeof value === \"number\" ? value : float(value as string | number)\n const prec = precision ?? 6\n result = num.toExponential(prec)\n if (sign === \"+\" && num >= 0) result = \"+\" + result\n else if (sign === \" \" && num >= 0) result = \" \" + result\n if (typeChar === \"E\") result = result.toUpperCase()\n } else if (typeChar === \"g\" || typeChar === \"G\") {\n const num = typeof value === \"number\" ? value : float(value as string | number)\n const prec = precision ?? 6\n result = num.toPrecision(prec)\n if (sign === \"+\" && num >= 0) result = \"+\" + result\n else if (sign === \" \" && num >= 0) result = \" \" + result\n if (typeChar === \"G\") result = result.toUpperCase()\n } else if (typeChar === \"x\" || typeChar === \"X\") {\n const num =\n typeof value === \"number\" ? Math.trunc(value) : int(value as string | number | boolean)\n result = Math.abs(num).toString(16)\n if (hash) result = \"0x\" + result\n if (num < 0) result = \"-\" + result\n else if (sign === \"+\") result = \"+\" + result\n else if (sign === \" \") result = \" \" + result\n if (typeChar === \"X\") result = result.toUpperCase()\n } else if (typeChar === \"o\") {\n const num =\n typeof value === \"number\" ? Math.trunc(value) : int(value as string | number | boolean)\n result = Math.abs(num).toString(8)\n if (hash) result = \"0o\" + result\n if (num < 0) result = \"-\" + result\n else if (sign === \"+\") result = \"+\" + result\n else if (sign === \" \") result = \" \" + result\n } else if (typeChar === \"b\") {\n const num =\n typeof value === \"number\" ? Math.trunc(value) : int(value as string | number | boolean)\n result = Math.abs(num).toString(2)\n if (hash) result = \"0b\" + result\n if (num < 0) result = \"-\" + result\n else if (sign === \"+\") result = \"+\" + result\n else if (sign === \" \") result = \" \" + result\n } else if (typeChar === \"c\") {\n const code = typeof value === \"number\" ? value : int(value as string | number | boolean)\n result = String.fromCharCode(code)\n } else if (typeChar === \"%\") {\n const num = typeof value === \"number\" ? value : float(value as string | number)\n const prec = precision ?? 6\n result = (num * 100).toFixed(prec) + \"%\"\n if (sign === \"+\" && num >= 0) result = \"+\" + result\n else if (sign === \" \" && num >= 0) result = \" \" + result\n } else if (typeChar === \"n\") {\n const num = typeof value === \"number\" ? value : float(value as string | number)\n result = num.toLocaleString()\n } else {\n result = str(value)\n }\n\n if (width > result.length) {\n const padding = fill.repeat(width - result.length)\n if (align === \"<\") {\n result = result + padding\n } else if (align === \">\" || align === \"\") {\n result = padding + result\n } else if (align === \"^\") {\n const leftPad = Math.floor((width - result.length) / 2)\n const rightPad = width - result.length - leftPad\n result = fill.repeat(leftPad) + result + fill.repeat(rightPad)\n } else if (align === \"=\") {\n const signMatch = result.match(/^([+\\- ]|0[xXoObB])?(.*)$/)\n if (signMatch) {\n const signPart = signMatch[1] ?? \"\"\n const numPart = signMatch[2] ?? \"\"\n result = signPart + padding + numPart\n }\n }\n }\n\n return result\n}\n","/**\n * Python list methods for TypeScript\n * Usage: py.list.remove(), py.list.sort(), etc.\n */\n\nexport const list = {\n /**\n * Python list.append() - modifies array in place\n */\n append<T>(arr: T[], item: T): void {\n arr.push(item)\n },\n\n /**\n * Python list.extend() - modifies array in place\n */\n extend<T>(arr: T[], items: Iterable<T>): void {\n arr.push(...items)\n },\n\n /**\n * Python list.insert() - modifies array in place\n */\n insert<T>(arr: T[], index: number, item: T): void {\n arr.splice(index, 0, item)\n },\n\n /**\n * Python list.remove() - removes first occurrence, modifies in place\n */\n remove<T>(arr: T[], value: T): void {\n const index = arr.indexOf(value)\n if (index === -1) {\n throw new Error(\"list.remove(x): x not in list\")\n }\n arr.splice(index, 1)\n },\n\n /**\n * Python list.pop() - removes and returns item at index\n */\n pop<T>(arr: T[], index?: number): T {\n if (arr.length === 0) {\n throw new Error(\"pop from empty list\")\n }\n const i = index ?? arr.length - 1\n const normalizedIndex = i < 0 ? arr.length + i : i\n if (normalizedIndex < 0 || normalizedIndex >= arr.length) {\n throw new Error(\"pop index out of range\")\n }\n return arr.splice(normalizedIndex, 1)[0] as T\n },\n\n /**\n * Python list.clear() - removes all items\n */\n clear(arr: unknown[]): void {\n arr.length = 0\n },\n\n /**\n * Python list.index() - finds first occurrence\n */\n index<T>(arr: T[], value: T, start?: number, end?: number): number {\n const searchStart = start ?? 0\n const searchEnd = end ?? arr.length\n for (let i = searchStart; i < searchEnd; i++) {\n if (arr[i] === value) {\n return i\n }\n }\n throw new Error(\"x not in list\")\n },\n\n /**\n * Python list.count() - counts occurrences\n */\n count<T>(arr: T[], value: T): number {\n let count = 0\n for (const item of arr) {\n if (item === value) count++\n }\n return count\n },\n\n /**\n * Python list.sort() with key function - modifies in place\n */\n sort<T>(arr: T[], options?: { key?: (x: T) => unknown; reverse?: boolean }): void {\n const key = options?.key ?? ((x: T) => x as unknown)\n const reverse = options?.reverse ?? false\n arr.sort((a, b) => {\n const aKey = key(a) as string | number\n const bKey = key(b) as string | number\n let cmp = 0\n if (aKey < bKey) cmp = -1\n else if (aKey > bKey) cmp = 1\n return reverse ? -cmp : cmp\n })\n },\n\n /**\n * Python list.reverse() - reverses in place\n */\n reverse(arr: unknown[]): void {\n arr.reverse()\n },\n\n /**\n * Python list.copy() - shallow copy\n */\n copy<T>(arr: T[]): T[] {\n return [...arr]\n },\n\n /**\n * Python slice assignment: arr[start:end:step] = values\n * Replaces a slice of the array with new values, modifying in place\n */\n sliceAssign<T>(\n arr: T[],\n start: number | undefined,\n end: number | undefined,\n step: number | undefined,\n values: T[]\n ): void {\n const len = arr.length\n const actualStep = step ?? 1\n\n // Normalize start and end\n let actualStart = start ?? (actualStep > 0 ? 0 : len - 1)\n let actualEnd = end ?? (actualStep > 0 ? len : -len - 1)\n\n // Handle negative indices\n if (actualStart < 0) actualStart = Math.max(0, len + actualStart)\n if (actualEnd < 0) actualEnd = Math.max(0, len + actualEnd)\n\n // Clamp to array bounds\n actualStart = Math.min(actualStart, len)\n actualEnd = Math.min(actualEnd, len)\n\n if (actualStep === 1) {\n // Simple case: contiguous slice\n const deleteCount = Math.max(0, actualEnd - actualStart)\n arr.splice(actualStart, deleteCount, ...values)\n } else {\n // Extended slice with step\n // Collect indices that will be replaced\n const indices: number[] = []\n if (actualStep > 0) {\n for (let i = actualStart; i < actualEnd; i += actualStep) {\n indices.push(i)\n }\n } else {\n for (let i = actualStart; i > actualEnd; i += actualStep) {\n indices.push(i)\n }\n }\n\n // For extended slices, lengths must match\n if (indices.length !== values.length) {\n throw new Error(\n `attempt to assign sequence of size ${String(values.length)} to extended slice of size ${String(indices.length)}`\n )\n }\n\n // Replace values at each index\n for (let i = 0; i < indices.length; i++) {\n const idx = indices[i]\n if (idx !== undefined) {\n arr[idx] = values[i] as T\n }\n }\n }\n }\n}\n","/**\n * Python dict methods for TypeScript\n * Usage: py.dict.get(), py.dict.keys(), etc.\n */\n\nexport const dict = {\n /**\n * Python dict.get() - get value with optional default\n */\n get<K extends string | number | symbol, V>(\n obj: Record<K, V>,\n key: K,\n defaultValue?: V\n ): V | undefined {\n return key in obj ? obj[key] : defaultValue\n },\n\n /**\n * Python dict.setdefault() - get value or set default\n */\n setdefault<K extends string | number | symbol, V>(obj: Record<K, V>, key: K, defaultValue: V): V {\n if (!(key in obj)) {\n obj[key] = defaultValue\n }\n return obj[key]\n },\n\n /**\n * Python dict.pop() - remove and return value\n */\n pop<K extends string | number | symbol, V>(\n obj: Record<K, V>,\n key: K,\n defaultValue?: V\n ): V | undefined {\n if (key in obj) {\n const value = obj[key]\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete obj[key]\n return value\n }\n if (defaultValue !== undefined) {\n return defaultValue\n }\n throw new Error(\"KeyError\")\n },\n\n /**\n * Python dict.popitem() - remove and return last item\n */\n popitem<K extends string | number | symbol, V>(obj: Record<K, V>): [K, V] {\n const keys = Object.keys(obj) as K[]\n if (keys.length === 0) {\n throw new Error(\"dictionary is empty\")\n }\n const key = keys[keys.length - 1] as K\n const value = obj[key]\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete obj[key]\n return [key, value]\n },\n\n /**\n * Python dict.update() - update with another dict\n */\n update<K extends string | number | symbol, V>(\n obj: Record<K, V>,\n other: Record<K, V> | Iterable<[K, V]>\n ): void {\n if (Symbol.iterator in other) {\n for (const [k, v] of other) {\n obj[k] = v\n }\n } else {\n Object.assign(obj, other)\n }\n },\n\n /**\n * Python dict.clear() - remove all items\n */\n clear<K extends string | number | symbol, V>(obj: Record<K, V>): void {\n for (const key of Object.keys(obj)) {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete obj[key as K]\n }\n },\n\n /**\n * Python dict.copy() - shallow copy\n */\n copy<K extends string | number | symbol, V>(obj: Record<K, V>): Record<K, V> {\n return { ...obj }\n },\n\n /**\n * Python dict.keys() - returns iterable of keys\n */\n keys<K extends string | number | symbol, V>(obj: Record<K, V>): K[] {\n return Object.keys(obj) as K[]\n },\n\n /**\n * Python dict.values() - returns iterable of values\n */\n values<K extends string | number | symbol, V>(obj: Record<K, V>): V[] {\n return Object.values(obj)\n },\n\n /**\n * Python dict.items() - returns iterable of [key, value] pairs\n */\n items<K extends string | number | symbol, V>(obj: Record<K, V>): [K, V][] {\n return Object.entries(obj) as [K, V][]\n },\n\n /**\n * Python dict.fromkeys() - create dict from keys\n */\n fromkeys<K extends string | number | symbol, V>(keys: K[], value?: V): Record<K, V | undefined> {\n const result = {} as Record<K, V | undefined>\n for (const key of keys) {\n result[key] = value\n }\n return result\n }\n}\n","/**\n * Python set methods for TypeScript\n * Usage: py.set.intersection(), py.set.union(), etc.\n */\n\nexport const set = {\n /**\n * Python set.add() - add element\n */\n add<T>(s: Set<T>, item: T): void {\n s.add(item)\n },\n\n /**\n * Python set.remove() - remove element, raises error if not found\n */\n remove<T>(s: Set<T>, item: T): void {\n if (!s.has(item)) {\n throw new Error(\"KeyError\")\n }\n s.delete(item)\n },\n\n /**\n * Python set.discard() - remove element if present\n */\n discard<T>(s: Set<T>, item: T): void {\n s.delete(item)\n },\n\n /**\n * Python set.pop() - remove and return arbitrary element\n */\n pop<T>(s: Set<T>): T {\n if (s.size === 0) {\n throw new Error(\"pop from an empty set\")\n }\n const item = s.values().next().value as T\n s.delete(item)\n return item\n },\n\n /**\n * Python set.clear() - remove all elements\n */\n clear<T>(s: Set<T>): void {\n s.clear()\n },\n\n /**\n * Python set.copy() - shallow copy\n */\n copy<T>(s: Set<T>): Set<T> {\n return new Set(s)\n },\n\n /**\n * Python set.update() - add elements from iterable\n */\n update<T>(s: Set<T>, ...iterables: Iterable<T>[]): void {\n for (const iterable of iterables) {\n for (const item of iterable) {\n s.add(item)\n }\n }\n },\n\n /**\n * Python set.union() - returns new set with all elements\n */\n union<T>(a: Set<T>, ...others: Iterable<T>[]): Set<T> {\n const result = new Set(a)\n for (const other of others) {\n for (const item of other) {\n result.add(item)\n }\n }\n return result\n },\n\n /**\n * Python set.intersection() - returns new set with common elements\n */\n intersection<T>(a: Set<T>, b: Set<T>): Set<T> {\n const result = new Set<T>()\n for (const item of a) {\n if (b.has(item)) result.add(item)\n }\n return result\n },\n\n /**\n * Python set.intersection_update() - keep only common elements\n */\n intersectionUpdate<T>(a: Set<T>, b: Set<T>): void {\n for (const item of a) {\n if (!b.has(item)) a.delete(item)\n }\n },\n\n /**\n * Python set.difference() - returns new set with elements in a but not in b\n */\n difference<T>(a: Set<T>, b: Set<T>): Set<T> {\n const result = new Set<T>()\n for (const item of a) {\n if (!b.has(item)) result.add(item)\n }\n return result\n },\n\n /**\n * Python set.difference_update() - remove elements found in b\n */\n differenceUpdate<T>(a: Set<T>, b: Set<T>): void {\n for (const item of b) {\n a.delete(item)\n }\n },\n\n /**\n * Python set.symmetric_difference() - returns new set with elements in either but not both\n */\n symmetricDifference<T>(a: Set<T>, b: Set<T>): Set<T> {\n const result = new Set<T>()\n for (const item of a) {\n if (!b.has(item)) result.add(item)\n }\n for (const item of b) {\n if (!a.has(item)) result.add(item)\n }\n return result\n },\n\n /**\n * Python set.symmetric_difference_update() - update with symmetric difference\n */\n symmetricDifferenceUpdate<T>(a: Set<T>, b: Set<T>): void {\n const toAdd: T[] = []\n const toRemove: T[] = []\n for (const item of a) {\n if (b.has(item)) toRemove.push(item)\n }\n for (const item of b) {\n if (!a.has(item)) toAdd.push(item)\n }\n for (const item of toRemove) a.delete(item)\n for (const item of toAdd) a.add(item)\n },\n\n /**\n * Python set.issubset() - test if all elements are in other\n */\n issubset<T>(a: Set<T>, b: Set<T>): boolean {\n for (const item of a) {\n if (!b.has(item)) return false\n }\n return true\n },\n\n /**\n * Python set.issuperset() - test if all other elements are in this set\n */\n issuperset<T>(a: Set<T>, b: Set<T>): boolean {\n for (const item of b) {\n if (!a.has(item)) return false\n }\n return true\n },\n\n /**\n * Python set.isdisjoint() - test if no common elements\n */\n isdisjoint<T>(a: Set<T>, b: Set<T>): boolean {\n for (const item of a) {\n if (b.has(item)) return false\n }\n return true\n }\n}\n","/**\n * Python Runtime Library for TypeScript\n *\n * Import styles:\n *\n * 1. Builtins (global Python functions):\n * import { len, range, sorted, min, max } from \"pythonlib\"\n *\n * 2. Module imports (like Python):\n * import { dump, loads } from \"pythonlib/json\"\n * import { match, search, sub } from \"pythonlib/re\"\n * import { chain, combinations } from \"pythonlib/itertools\"\n * import { Counter, defaultdict } from \"pythonlib/collections\"\n *\n * 3. Module namespaces (alternative):\n * import { json, re, itertools } from \"pythonlib\"\n * json.dump(...), re.match(...), itertools.chain(...)\n */\n\n// =============================================================================\n// Module imports (for namespace exports)\n// =============================================================================\n\nimport * as itertoolsModule from \"./itertools.js\"\nimport * as functoolsModule from \"./functools.js\"\nimport * as collectionsModule from \"./collections.js\"\nimport * as mathModule from \"./math.js\"\nimport * as randomModule from \"./random.js\"\nimport * as jsonModule from \"./json.js\"\nimport * as osModule from \"./os.js\"\nimport * as datetimeModule from \"./datetime.js\"\nimport * as reModule from \"./re.js\"\nimport * as stringModule from \"./string.js\"\nimport * as core from \"./core.js\"\nimport * as builtins from \"./builtins.js\"\nimport { list as listMethods } from \"./list.js\"\nimport { dict as dictMethods } from \"./dict.js\"\nimport { set as setMethods } from \"./set.js\"\n\n// =============================================================================\n// Module namespace exports (for: import { itertools } from \"pythonlib\")\n// =============================================================================\n\nexport const itertools = itertoolsModule\nexport const functools = functoolsModule\nexport const collections = collectionsModule\nexport const math = mathModule\nexport const random = randomModule\nexport const json = jsonModule\nexport const os = osModule\nexport const datetime = datetimeModule\nexport const re = reModule\nexport const string = {\n ...stringModule.string,\n ascii_lowercase: stringModule.ascii_lowercase,\n ascii_uppercase: stringModule.ascii_uppercase,\n ascii_letters: stringModule.ascii_letters,\n digits: stringModule.digits,\n hexdigits: stringModule.hexdigits,\n octdigits: stringModule.octdigits,\n punctuation: stringModule.punctuation,\n whitespace: stringModule.whitespace,\n printable: stringModule.printable,\n capwords: stringModule.capwords,\n Template: stringModule.Template\n}\n\n// =============================================================================\n// Core built-in types with methods (list, dict, set)\n// =============================================================================\n\ntype ListConstructor = {\n <T>(iterable?: Iterable<T>): T[]\n} & typeof listMethods\n\ntype DictConstructor = {\n <K, V>(entries?: Iterable<[K, V]>): Map<K, V>\n} & typeof dictMethods\n\ntype SetConstructor = {\n <T>(iterable?: Iterable<T>): Set<T>\n} & typeof setMethods\n\nexport const list: ListConstructor = Object.assign(\n <T>(iterable?: Iterable<T>): T[] => builtins.list(iterable),\n listMethods\n)\n\nexport const dict: DictConstructor = Object.assign(\n <K, V>(entries?: Iterable<[K, V]>): Map<K, V> => builtins.dict(entries),\n dictMethods\n)\n\nexport const set: SetConstructor = Object.assign(\n <T>(iterable?: Iterable<T>): Set<T> => builtins.set(iterable),\n setMethods\n)\n\n// =============================================================================\n// Core operations (Python-specific semantics)\n// =============================================================================\n\nexport const floordiv = core.floordiv\nexport const mod = core.mod\nexport const divmod = core.divmod\nexport const sprintf = core.sprintf\nexport const strFormat = core.strFormat\nexport const slice = core.slice\nexport const at = core.at\nexport const contains = core.contains\nexport const is = core.is\nexport { repeat as repeatValue } from \"./core.js\"\nexport { pow } from \"./core.js\"\n\n// =============================================================================\n// Built-in functions (Python global scope)\n// =============================================================================\n\n// Iteration\nexport const range = builtins.range\nexport const enumerate = builtins.enumerate\nexport const zip = builtins.zip\nexport const iter = builtins.iter\nexport const reversed = builtins.reversed\nexport const sorted = builtins.sorted\nexport const map = builtins.map\nexport const filter = builtins.filter\n\n// Collection constructors\nexport const tuple = builtins.tuple\n\n// Aggregation\nexport const len = builtins.len\nexport const abs = builtins.abs\nexport const min = builtins.min\nexport const max = builtins.max\nexport const sum = builtins.sum\nexport const all = builtins.all\nexport const any = builtins.any\nexport const round = builtins.round\n\n// Character/number conversion\nexport const ord = builtins.ord\nexport const chr = builtins.chr\nexport const hex = builtins.hex\nexport const oct = builtins.oct\nexport const bin = builtins.bin\n\n// Type conversion\nexport const int = builtins.int\nexport const float = builtins.float\nexport const str = builtins.str\nexport const repr = builtins.repr\nexport const bool = builtins.bool\nexport const ascii = builtins.ascii\n\n// Type checking & misc\nexport const isinstance = builtins.isinstance\nexport const type = builtins.type\nexport const input = builtins.input\nexport const format = builtins.format\n\n// =============================================================================\n// Legacy py.* namespace (deprecated, for backwards compatibility)\n// =============================================================================\n\nexport const py = {\n // Namespaced methods\n string: stringModule.string,\n list,\n dict,\n set,\n\n // Core operations\n floordiv: core.floordiv,\n pow: core.pow,\n mod: core.mod,\n divmod: core.divmod,\n sprintf: core.sprintf,\n strFormat: core.strFormat,\n slice: core.slice,\n at: core.at,\n repeat: core.repeat,\n in: core.contains,\n is: core.is,\n\n // Iterables\n range: builtins.range,\n enumerate: builtins.enumerate,\n zip: builtins.zip,\n iter: builtins.iter,\n reversed: builtins.reversed,\n sorted: builtins.sorted,\n map: builtins.map,\n filter: builtins.filter,\n\n // Collection constructors\n tuple: builtins.tuple,\n\n // Built-in functions\n len: builtins.len,\n abs: builtins.abs,\n min: builtins.min,\n max: builtins.max,\n sum: builtins.sum,\n all: builtins.all,\n any: builtins.any,\n round: builtins.round,\n ord: builtins.ord,\n chr: builtins.chr,\n hex: builtins.hex,\n oct: builtins.oct,\n bin: builtins.bin,\n\n // Type conversions\n int: builtins.int,\n float: builtins.float,\n str: builtins.str,\n repr: builtins.repr,\n bool: builtins.bool,\n ascii: builtins.ascii,\n\n // Type checking\n isinstance: builtins.isinstance,\n type: builtins.type,\n input: builtins.input,\n format: builtins.format,\n\n // Modules\n itertools: itertoolsModule,\n functools: functoolsModule,\n math: mathModule,\n random: randomModule,\n json: jsonModule,\n os: osModule,\n datetime: datetimeModule,\n re: reModule,\n\n // collections\n Counter: collectionsModule.Counter,\n defaultdict: collectionsModule.defaultdict,\n deque: collectionsModule.deque,\n\n // string module\n Template: stringModule.Template,\n ascii_lowercase: stringModule.ascii_lowercase,\n ascii_uppercase: stringModule.ascii_uppercase,\n ascii_letters: stringModule.ascii_letters,\n digits: stringModule.digits,\n hexdigits: stringModule.hexdigits,\n octdigits: stringModule.octdigits,\n punctuation: stringModule.punctuation,\n whitespace: stringModule.whitespace,\n printable: stringModule.printable,\n capwords: stringModule.capwords\n}\n\n// Set the py reference for builtins (needed for str() and repr())\nbuiltins._setPyRef(py)\n\nexport default py\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaO,SAAS,SAAS,GAAW,GAAmB;AACrD,SAAO,KAAK,MAAM,IAAI,CAAC;AACzB;AAKO,SAAS,IAAI,MAAc,KAAqB;AACrD,SAAO,KAAK,IAAI,MAAM,GAAG;AAC3B;AAMO,SAAS,IAAI,GAAW,GAAmB;AAChD,UAAS,IAAI,IAAK,KAAK;AACzB;AAKO,SAAS,OAAO,GAAW,GAA6B;AAC7D,SAAO,CAAC,SAAS,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC;AACnC;AAUO,SAAS,QAAQ,UAAkB,MAAuB;AAC/D,QAAM,SAAS,MAAM,QAAQ,IAAI,IAAI,OAAO,CAAC,IAAI;AACjD,MAAI,QAAQ;AACZ,SAAO,SAAS;AAAA,IACd;AAAA,IACA,CAAC,OAAe,OAAeA,UAAiB;AAC9C,UAAIA,UAAS,IAAK,QAAO;AACzB,UAAI,SAAS,OAAO,OAAQ,QAAO;AACnC,YAAM,QAAiB,OAAO,OAAO;AACrC,cAAQA,OAAM;AAAA,QACZ,KAAK;AACH,iBAAO,OAAO,KAAK;AAAA,QACrB,KAAK;AAAA,QACL,KAAK;AACH,iBAAO,OAAO,KAAK,MAAM,OAAO,KAAK,CAAC,CAAC;AAAA,QACzC,KAAK;AACH,cAAI,SAAS,MAAM,SAAS,GAAG,GAAG;AAChC,kBAAM,YAAY,SAAS,MAAM,MAAM,GAAG,EAAE,CAAC,KAAK,KAAK,EAAE;AACzD,mBAAO,OAAO,KAAK,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A;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,IAAS;AAAA,EACT;AAAA;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAGA;AAAA;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAGA,WAAW;AAAA,EACX,WAAW;AAAA,EACX,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,UAAU;AAAA,EACV,IAAI;AAAA;AAAA,EAGJ;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAGS,UAAU0C,GAAE;AAErB,IAAO,gBAAQA;","names":["type","len","digits","list","len","dict","set","string","list","dict","set","floordiv","mod","divmod","sprintf","strFormat","slice","at","contains","is","range","enumerate","zip","iter","reversed","sorted","map","filter","tuple","len","abs","min","max","sum","all","any","round","ord","chr","hex","oct","bin","int","float","str","repr","bool","ascii","isinstance","type","input","format","py"]}
@@ -0,0 +1,138 @@
1
+ /**
2
+ * Python itertools module for TypeScript
3
+ *
4
+ * Provides iterator building blocks inspired by Python's itertools module.
5
+ *
6
+ * Design Decision (ADR-0008):
7
+ * - Most functions return eager arrays for better debugging and familiarity
8
+ * - Only infinite sequences (cycle, repeat without count) use generators
9
+ */
10
+ /**
11
+ * Chain multiple iterables together into a single array
12
+ * chain([1, 2], [3, 4]) -> [1, 2, 3, 4]
13
+ */
14
+ declare function chain<T>(...iterables: Iterable<T>[]): T[];
15
+ /**
16
+ * Return successive r-length combinations of elements
17
+ * combinations([1, 2, 3], 2) -> [[1, 2], [1, 3], [2, 3]]
18
+ */
19
+ declare function combinations<T>(iterable: Iterable<T>, r: number): T[][];
20
+ /**
21
+ * Return successive r-length permutations of elements
22
+ * permutations([1, 2, 3], 2) -> [[1, 2], [1, 3], [2, 1], [2, 3], [3, 1], [3, 2]]
23
+ */
24
+ declare function permutations<T>(iterable: Iterable<T>, r?: number): T[][];
25
+ /**
26
+ * Cartesian product of input iterables
27
+ * product([1, 2], ['a', 'b']) -> [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']]
28
+ */
29
+ declare function product<T>(...iterables: Iterable<T>[]): T[][];
30
+ /**
31
+ * Cycle through an iterable indefinitely (INFINITE - returns Generator)
32
+ * cycle([1, 2, 3]) -> 1, 2, 3, 1, 2, 3, 1, 2, 3, ...
33
+ *
34
+ * WARNING: This is infinite! Use with for...of and break, or islice.
35
+ */
36
+ declare function cycle<T>(iterable: Iterable<T>): Generator<T>;
37
+ /**
38
+ * Repeat an object. If times is specified, returns an array. Otherwise returns
39
+ * an infinite generator.
40
+ *
41
+ * repeat('x', 3) -> ['x', 'x', 'x']
42
+ * repeat('x') -> Generator that yields 'x' forever (INFINITE)
43
+ */
44
+ declare function repeat<T>(obj: T, times?: number): T[] | Generator<T>;
45
+ /**
46
+ * Slice an iterable from start to stop with step
47
+ * islice([1, 2, 3, 4, 5], 1, 4) -> [2, 3, 4]
48
+ * islice([1, 2, 3, 4, 5], 3) -> [1, 2, 3]
49
+ */
50
+ declare function islice<T>(iterable: Iterable<T>, start: number, stop?: number, step?: number): T[];
51
+ /**
52
+ * Take elements while predicate is true
53
+ * takewhile(x => x < 5, [1, 4, 6, 4, 1]) -> [1, 4]
54
+ */
55
+ declare function takewhile<T>(predicate: (x: T) => boolean, iterable: Iterable<T>): T[];
56
+ /**
57
+ * Skip elements while predicate is true, then return the rest
58
+ * dropwhile(x => x < 5, [1, 4, 6, 4, 1]) -> [6, 4, 1]
59
+ */
60
+ declare function dropwhile<T>(predicate: (x: T) => boolean, iterable: Iterable<T>): T[];
61
+ /**
62
+ * Zip iterables together, filling missing values with fillvalue
63
+ * zip_longest([1, 2, 3], ['a', 'b'], { fillvalue: '-' }) -> [[1, 'a'], [2, 'b'], [3, '-']]
64
+ */
65
+ declare function zip_longest<T>(...args: [...Iterable<T>[], {
66
+ fillvalue?: T;
67
+ }] | Iterable<T>[]): T[][];
68
+ /**
69
+ * Return elements from iterable where the corresponding selector is true
70
+ * compress([1, 2, 3, 4, 5], [1, 0, 1, 0, 1]) -> [1, 3, 5]
71
+ */
72
+ declare function compress<T>(data: Iterable<T>, selectors: Iterable<unknown>): T[];
73
+ /**
74
+ * Return elements for which predicate is false
75
+ * filterfalse(x => x % 2, [1, 2, 3, 4, 5]) -> [2, 4]
76
+ */
77
+ declare function filterfalse<T>(predicate: (x: T) => unknown, iterable: Iterable<T>): T[];
78
+ /**
79
+ * Make an iterator that returns accumulated sums or accumulated results
80
+ * accumulate([1, 2, 3, 4, 5]) -> [1, 3, 6, 10, 15]
81
+ * accumulate([1, 2, 3, 4, 5], (x, y) => x * y) -> [1, 2, 6, 24, 120]
82
+ */
83
+ declare function accumulate<T>(iterable: Iterable<T>, func?: (acc: T, val: T) => T, initial?: T): T[];
84
+ /**
85
+ * Return consecutive keys and groups from the iterable
86
+ * groupby([1, 1, 2, 2, 2, 3, 1, 1]) -> [[1, [1, 1]], [2, [2, 2, 2]], [3, [3]], [1, [1, 1]]]
87
+ */
88
+ declare function groupby<T, K = T>(iterable: Iterable<T>, key?: (x: T) => K): [K, T[]][];
89
+ /**
90
+ * Make an iterator that returns evenly spaced values starting with n
91
+ * count(10, 2) -> 10, 12, 14, 16, 18, ... (INFINITE Generator)
92
+ */
93
+ declare function count(start?: number, step?: number): Generator<number>;
94
+ /**
95
+ * Return n independent iterators from a single iterable
96
+ * tee([1, 2, 3], 2) -> [[1, 2, 3], [1, 2, 3]]
97
+ */
98
+ declare function tee<T>(iterable: Iterable<T>, n?: number): T[][];
99
+ /**
100
+ * Return successive overlapping pairs from the iterable
101
+ * pairwise([1, 2, 3, 4, 5]) -> [[1, 2], [2, 3], [3, 4], [4, 5]]
102
+ */
103
+ declare function pairwise<T>(iterable: Iterable<T>): [T, T][];
104
+ /**
105
+ * Cartesian product with repeat (product(range(3), repeat=2) like nested loops)
106
+ * productRepeat([0, 1], 2) -> [[0, 0], [0, 1], [1, 0], [1, 1]]
107
+ */
108
+ declare function productRepeat<T>(iterable: Iterable<T>, repeat?: number): T[][];
109
+ /**
110
+ * Return r-length combinations with replacement
111
+ * combinations_with_replacement([1, 2, 3], 2) -> [[1, 1], [1, 2], [1, 3], [2, 2], [2, 3], [3, 3]]
112
+ */
113
+ declare function combinations_with_replacement<T>(iterable: Iterable<T>, r: number): T[][];
114
+
115
+ declare const itertoolsModule_accumulate: typeof accumulate;
116
+ declare const itertoolsModule_chain: typeof chain;
117
+ declare const itertoolsModule_combinations: typeof combinations;
118
+ declare const itertoolsModule_combinations_with_replacement: typeof combinations_with_replacement;
119
+ declare const itertoolsModule_compress: typeof compress;
120
+ declare const itertoolsModule_count: typeof count;
121
+ declare const itertoolsModule_cycle: typeof cycle;
122
+ declare const itertoolsModule_dropwhile: typeof dropwhile;
123
+ declare const itertoolsModule_filterfalse: typeof filterfalse;
124
+ declare const itertoolsModule_groupby: typeof groupby;
125
+ declare const itertoolsModule_islice: typeof islice;
126
+ declare const itertoolsModule_pairwise: typeof pairwise;
127
+ declare const itertoolsModule_permutations: typeof permutations;
128
+ declare const itertoolsModule_product: typeof product;
129
+ declare const itertoolsModule_productRepeat: typeof productRepeat;
130
+ declare const itertoolsModule_repeat: typeof repeat;
131
+ declare const itertoolsModule_takewhile: typeof takewhile;
132
+ declare const itertoolsModule_tee: typeof tee;
133
+ declare const itertoolsModule_zip_longest: typeof zip_longest;
134
+ declare namespace itertoolsModule {
135
+ export { itertoolsModule_accumulate as accumulate, itertoolsModule_chain as chain, itertoolsModule_combinations as combinations, itertoolsModule_combinations_with_replacement as combinations_with_replacement, itertoolsModule_compress as compress, itertoolsModule_count as count, itertoolsModule_cycle as cycle, itertoolsModule_dropwhile as dropwhile, itertoolsModule_filterfalse as filterfalse, itertoolsModule_groupby as groupby, itertoolsModule_islice as islice, itertoolsModule_pairwise as pairwise, itertoolsModule_permutations as permutations, itertoolsModule_product as product, itertoolsModule_productRepeat as productRepeat, itertoolsModule_repeat as repeat, itertoolsModule_takewhile as takewhile, itertoolsModule_tee as tee, itertoolsModule_zip_longest as zip_longest };
136
+ }
137
+
138
+ export { combinations as a, product as b, chain as c, cycle as d, islice as e, dropwhile as f, compress as g, filterfalse as h, itertoolsModule as i, accumulate as j, groupby as k, count as l, tee as m, pairwise as n, productRepeat as o, permutations as p, combinations_with_replacement as q, repeat as r, takewhile as t, zip_longest as z };
@@ -0,0 +1 @@
1
+ export { j as accumulate, c as chain, a as combinations, q as combinations_with_replacement, g as compress, l as count, d as cycle, f as dropwhile, h as filterfalse, k as groupby, e as islice, n as pairwise, p as permutations, b as product, o as productRepeat, r as repeat, t as takewhile, m as tee, z as zip_longest } from './itertools-Bj8XivI6.js';
@@ -0,0 +1,44 @@
1
+ import {
2
+ accumulate,
3
+ chain,
4
+ combinations,
5
+ combinations_with_replacement,
6
+ compress,
7
+ count,
8
+ cycle,
9
+ dropwhile,
10
+ filterfalse,
11
+ groupby,
12
+ islice,
13
+ pairwise,
14
+ permutations,
15
+ product,
16
+ productRepeat,
17
+ repeat,
18
+ takewhile,
19
+ tee,
20
+ zip_longest
21
+ } from "./chunk-TOI6IG3T.js";
22
+ import "./chunk-PZ5AY32C.js";
23
+ export {
24
+ accumulate,
25
+ chain,
26
+ combinations,
27
+ combinations_with_replacement,
28
+ compress,
29
+ count,
30
+ cycle,
31
+ dropwhile,
32
+ filterfalse,
33
+ groupby,
34
+ islice,
35
+ pairwise,
36
+ permutations,
37
+ product,
38
+ productRepeat,
39
+ repeat,
40
+ takewhile,
41
+ tee,
42
+ zip_longest
43
+ };
44
+ //# sourceMappingURL=itertools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Python json module for TypeScript
3
+ *
4
+ * Provides JSON encoding and decoding functions matching Python's json module.
5
+ * Maps directly to JavaScript's JSON object with Python-compatible options.
6
+ */
7
+ type JsonValue = string | number | boolean | null | JsonValue[] | {
8
+ [key: string]: JsonValue;
9
+ };
10
+ interface DumpsOptions {
11
+ /** If specified, use this many spaces for indentation */
12
+ indent?: number;
13
+ /** Separators for items and key-value pairs [item_sep, key_sep] */
14
+ separators?: [string, string];
15
+ /** Sort dictionary keys */
16
+ sort_keys?: boolean;
17
+ /** If false, non-ASCII characters are escaped. Default true */
18
+ ensure_ascii?: boolean;
19
+ /** Custom serialization function */
20
+ default?: (obj: unknown) => JsonValue;
21
+ }
22
+ interface LoadsOptions {
23
+ /** Custom deserialization function */
24
+ object_hook?: (obj: Record<string, unknown>) => unknown;
25
+ /** Parse floats with this function */
26
+ parse_float?: (s: string) => number;
27
+ /** Parse integers with this function */
28
+ parse_int?: (s: string) => number;
29
+ }
30
+ /**
31
+ * Serialize obj to a JSON formatted string.
32
+ *
33
+ * @param obj - The object to serialize
34
+ * @param options - Serialization options
35
+ * @returns JSON string
36
+ */
37
+ declare function dumps(obj: unknown, options?: DumpsOptions): string;
38
+ /**
39
+ * Deserialize a JSON string to a Python object.
40
+ *
41
+ * @param s - JSON string to parse
42
+ * @param options - Deserialization options
43
+ * @returns Parsed object
44
+ */
45
+ declare function loads(s: string, options?: LoadsOptions): unknown;
46
+ /**
47
+ * Serialize obj to a JSON formatted string and write to file.
48
+ * Note: This is a no-op in browser environments.
49
+ *
50
+ * @param obj - The object to serialize
51
+ * @param fp - File-like object with write method
52
+ * @param options - Serialization options
53
+ */
54
+ declare function dump(obj: unknown, fp: {
55
+ write: (s: string) => void;
56
+ }, options?: DumpsOptions): void;
57
+ /**
58
+ * Deserialize a JSON string from file to a Python object.
59
+ * Note: This is a no-op in browser environments.
60
+ *
61
+ * @param fp - File-like object with read method
62
+ * @param options - Deserialization options
63
+ * @returns Parsed object
64
+ */
65
+ declare function load(fp: {
66
+ read: () => string;
67
+ }, options?: LoadsOptions): unknown;
68
+
69
+ declare const jsonModule_dump: typeof dump;
70
+ declare const jsonModule_dumps: typeof dumps;
71
+ declare const jsonModule_load: typeof load;
72
+ declare const jsonModule_loads: typeof loads;
73
+ declare namespace jsonModule {
74
+ export { jsonModule_dump as dump, jsonModule_dumps as dumps, jsonModule_load as load, jsonModule_loads as loads };
75
+ }
76
+
77
+ export { dump as a, load as b, dumps as d, jsonModule as j, loads as l };
package/dist/json.d.ts ADDED
@@ -0,0 +1 @@
1
+ export { a as dump, d as dumps, b as load, l as loads } from './json-Xpk0kwSd.js';
package/dist/json.js ADDED
@@ -0,0 +1,14 @@
1
+ import {
2
+ dump,
3
+ dumps,
4
+ load,
5
+ loads
6
+ } from "./chunk-P3SGIF72.js";
7
+ import "./chunk-PZ5AY32C.js";
8
+ export {
9
+ dump,
10
+ dumps,
11
+ load,
12
+ loads
13
+ };
14
+ //# sourceMappingURL=json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,147 @@
1
+ /**
2
+ * Python math module for TypeScript
3
+ *
4
+ * Provides mathematical functions and constants matching Python's math module.
5
+ * Most functions map directly to JavaScript's Math object.
6
+ */
7
+ /** Mathematical constant π = 3.141592... */
8
+ declare const pi: number;
9
+ /** Mathematical constant e = 2.718281... */
10
+ declare const e: number;
11
+ /** Mathematical constant τ = 2π = 6.283185... */
12
+ declare const tau: number;
13
+ /** Positive infinity */
14
+ declare const inf: number;
15
+ /** Not a Number (NaN) */
16
+ declare const nan: number;
17
+ /** Return the ceiling of x, the smallest integer greater than or equal to x */
18
+ declare function ceil(x: number): number;
19
+ /** Return the floor of x, the largest integer less than or equal to x */
20
+ declare function floor(x: number): number;
21
+ /** Return the truncated integer part of x (rounds toward zero) */
22
+ declare function trunc(x: number): number;
23
+ /** Return the absolute value of x */
24
+ declare function fabs(x: number): number;
25
+ /** Return x with the sign of y */
26
+ declare function copysign(x: number, y: number): number;
27
+ /** Return the fractional and integer parts of x */
28
+ declare function modf(x: number): [number, number];
29
+ /** Return the greatest common divisor of a and b */
30
+ declare function gcd(a: number, b: number): number;
31
+ /** Return the least common multiple of a and b */
32
+ declare function lcm(a: number, b: number): number;
33
+ /** Return True if x is neither infinity nor NaN */
34
+ declare function isfinite(x: number): boolean;
35
+ /** Return True if x is positive or negative infinity */
36
+ declare function isinf(x: number): boolean;
37
+ /** Return True if x is NaN */
38
+ declare function isnan(x: number): boolean;
39
+ /** Return True if the values a and b are close to each other */
40
+ declare function isclose(a: number, b: number, rel_tol?: number, abs_tol?: number): boolean;
41
+ /** Return e raised to the power x */
42
+ declare function exp(x: number): number;
43
+ /** Return e raised to the power x, minus 1 (more accurate for small x) */
44
+ declare function expm1(x: number): number;
45
+ /** Return the natural logarithm of x */
46
+ declare function log(x: number, base?: number): number;
47
+ /** Return the natural logarithm of 1+x (more accurate for small x) */
48
+ declare function log1p(x: number): number;
49
+ /** Return the base-2 logarithm of x */
50
+ declare function log2(x: number): number;
51
+ /** Return the base-10 logarithm of x */
52
+ declare function log10(x: number): number;
53
+ /** Return x raised to the power y */
54
+ declare function pow(x: number, y: number): number;
55
+ /** Return the square root of x */
56
+ declare function sqrt(x: number): number;
57
+ /** Return the cube root of x */
58
+ declare function cbrt(x: number): number;
59
+ /** Return the Euclidean norm, sqrt(sum(x**2 for x in args)) */
60
+ declare function hypot(...args: number[]): number;
61
+ /** Return the sine of x (x in radians) */
62
+ declare function sin(x: number): number;
63
+ /** Return the cosine of x (x in radians) */
64
+ declare function cos(x: number): number;
65
+ /** Return the tangent of x (x in radians) */
66
+ declare function tan(x: number): number;
67
+ /** Return the arc sine of x, in radians */
68
+ declare function asin(x: number): number;
69
+ /** Return the arc cosine of x, in radians */
70
+ declare function acos(x: number): number;
71
+ /** Return the arc tangent of x, in radians */
72
+ declare function atan(x: number): number;
73
+ /** Return atan(y / x), in radians. The result is between -π and π */
74
+ declare function atan2(y: number, x: number): number;
75
+ /** Return the hyperbolic sine of x */
76
+ declare function sinh(x: number): number;
77
+ /** Return the hyperbolic cosine of x */
78
+ declare function cosh(x: number): number;
79
+ /** Return the hyperbolic tangent of x */
80
+ declare function tanh(x: number): number;
81
+ /** Return the inverse hyperbolic sine of x */
82
+ declare function asinh(x: number): number;
83
+ /** Return the inverse hyperbolic cosine of x */
84
+ declare function acosh(x: number): number;
85
+ /** Return the inverse hyperbolic tangent of x */
86
+ declare function atanh(x: number): number;
87
+ /** Convert angle x from radians to degrees */
88
+ declare function degrees(x: number): number;
89
+ /** Convert angle x from degrees to radians */
90
+ declare function radians(x: number): number;
91
+ /** Return the factorial of n as an integer */
92
+ declare function factorial(n: number): number;
93
+ /** Return the sum of products of values from iterables (dot product) */
94
+ declare function fsum(iterable: Iterable<number>): number;
95
+ /** Return the product of all elements in the iterable */
96
+ declare function prod(iterable: Iterable<number>, start?: number): number;
97
+
98
+ declare const mathModule_acos: typeof acos;
99
+ declare const mathModule_acosh: typeof acosh;
100
+ declare const mathModule_asin: typeof asin;
101
+ declare const mathModule_asinh: typeof asinh;
102
+ declare const mathModule_atan: typeof atan;
103
+ declare const mathModule_atan2: typeof atan2;
104
+ declare const mathModule_atanh: typeof atanh;
105
+ declare const mathModule_cbrt: typeof cbrt;
106
+ declare const mathModule_ceil: typeof ceil;
107
+ declare const mathModule_copysign: typeof copysign;
108
+ declare const mathModule_cos: typeof cos;
109
+ declare const mathModule_cosh: typeof cosh;
110
+ declare const mathModule_degrees: typeof degrees;
111
+ declare const mathModule_e: typeof e;
112
+ declare const mathModule_exp: typeof exp;
113
+ declare const mathModule_expm1: typeof expm1;
114
+ declare const mathModule_fabs: typeof fabs;
115
+ declare const mathModule_factorial: typeof factorial;
116
+ declare const mathModule_floor: typeof floor;
117
+ declare const mathModule_fsum: typeof fsum;
118
+ declare const mathModule_gcd: typeof gcd;
119
+ declare const mathModule_hypot: typeof hypot;
120
+ declare const mathModule_inf: typeof inf;
121
+ declare const mathModule_isclose: typeof isclose;
122
+ declare const mathModule_isfinite: typeof isfinite;
123
+ declare const mathModule_isinf: typeof isinf;
124
+ declare const mathModule_isnan: typeof isnan;
125
+ declare const mathModule_lcm: typeof lcm;
126
+ declare const mathModule_log: typeof log;
127
+ declare const mathModule_log10: typeof log10;
128
+ declare const mathModule_log1p: typeof log1p;
129
+ declare const mathModule_log2: typeof log2;
130
+ declare const mathModule_modf: typeof modf;
131
+ declare const mathModule_nan: typeof nan;
132
+ declare const mathModule_pi: typeof pi;
133
+ declare const mathModule_pow: typeof pow;
134
+ declare const mathModule_prod: typeof prod;
135
+ declare const mathModule_radians: typeof radians;
136
+ declare const mathModule_sin: typeof sin;
137
+ declare const mathModule_sinh: typeof sinh;
138
+ declare const mathModule_sqrt: typeof sqrt;
139
+ declare const mathModule_tan: typeof tan;
140
+ declare const mathModule_tanh: typeof tanh;
141
+ declare const mathModule_tau: typeof tau;
142
+ declare const mathModule_trunc: typeof trunc;
143
+ declare namespace mathModule {
144
+ export { mathModule_acos as acos, mathModule_acosh as acosh, mathModule_asin as asin, mathModule_asinh as asinh, mathModule_atan as atan, mathModule_atan2 as atan2, mathModule_atanh as atanh, mathModule_cbrt as cbrt, mathModule_ceil as ceil, mathModule_copysign as copysign, mathModule_cos as cos, mathModule_cosh as cosh, mathModule_degrees as degrees, mathModule_e as e, mathModule_exp as exp, mathModule_expm1 as expm1, mathModule_fabs as fabs, mathModule_factorial as factorial, mathModule_floor as floor, mathModule_fsum as fsum, mathModule_gcd as gcd, mathModule_hypot as hypot, mathModule_inf as inf, mathModule_isclose as isclose, mathModule_isfinite as isfinite, mathModule_isinf as isinf, mathModule_isnan as isnan, mathModule_lcm as lcm, mathModule_log as log, mathModule_log10 as log10, mathModule_log1p as log1p, mathModule_log2 as log2, mathModule_modf as modf, mathModule_nan as nan, mathModule_pi as pi, mathModule_pow as pow, mathModule_prod as prod, mathModule_radians as radians, mathModule_sin as sin, mathModule_sinh as sinh, mathModule_sqrt as sqrt, mathModule_tan as tan, mathModule_tanh as tanh, mathModule_tau as tau, mathModule_trunc as trunc };
145
+ }
146
+
147
+ export { cbrt as A, hypot as B, sin as C, cos as D, tan as E, asin as F, acos as G, atan as H, atan2 as I, sinh as J, cosh as K, tanh as L, asinh as M, acosh as N, atanh as O, degrees as P, radians as Q, factorial as R, fsum as S, prod as T, trunc as a, fabs as b, ceil as c, copysign as d, e, floor as f, modf as g, gcd as h, inf as i, isfinite as j, isinf as k, lcm as l, mathModule as m, nan as n, isnan as o, pi as p, isclose as q, exp as r, expm1 as s, tau as t, log as u, log1p as v, log2 as w, log10 as x, pow as y, sqrt as z };
package/dist/math.d.ts ADDED
@@ -0,0 +1 @@
1
+ export { G as acos, N as acosh, F as asin, M as asinh, H as atan, I as atan2, O as atanh, A as cbrt, c as ceil, d as copysign, D as cos, K as cosh, P as degrees, e, r as exp, s as expm1, b as fabs, R as factorial, f as floor, S as fsum, h as gcd, B as hypot, i as inf, q as isclose, j as isfinite, k as isinf, o as isnan, l as lcm, u as log, x as log10, v as log1p, w as log2, g as modf, n as nan, p as pi, y as pow, T as prod, Q as radians, C as sin, J as sinh, z as sqrt, E as tan, L as tanh, t as tau, a as trunc } from './math-BrT4Aw3E.js';