{"_id":"@bubblyworld/highs-ts","_rev":"6-0eb6ecf89ed4b41feaee11092239f8e4","name":"@bubblyworld/highs-ts","dist-tags":{"latest":"1.4.1"},"versions":{"1.0.0":{"name":"@bubblyworld/highs-ts","version":"1.0.0","keywords":["highs","constraint","optimise","lp","mip","milp"],"author":{"name":"Guy Paterson-Jones"},"license":"MIT","_id":"@bubblyworld/highs-ts@1.0.0","maintainers":[{"name":"bubblyworld","email":"guy.paterson.jones@gmail.com"}],"homepage":"https://github.com/Bubblyworld/highs-ts#readme","bugs":{"url":"https://github.com/Bubblyworld/highs-ts/issues"},"dist":{"shasum":"483f04b707a5c709604423f5860b64d8d65fa55f","tarball":"https://registry.npmjs.org/@bubblyworld/highs-ts/-/highs-ts-1.0.0.tgz","fileCount":77,"integrity":"sha512-dZSxqSl6OpydBZz1oFHPGPhQXYiisTNDllDt21J9kqrgeQjbHXFdktrWzNdvgyan5F2mXETTSuJnqdBgNn2ZLQ==","signatures":[{"sig":"MEUCIQCx22xdZ/kW6oo8uK6CVUduApsw9pxFftm59ecndPe91gIgREwq5r+tISeDWQtdZYPF2P9ioRWyBsiGK+Xwlm87AnU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4031837},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"node":"./dist/index.node.js","types":"./dist/index.d.ts","browser":"./dist/index.browser.js","default":"./dist/index.browser.js"}},"gitHead":"fa57dfda86ddaeeb829f5ceeef9afb74e6fc5d2b","scripts":{"test":"npm run test:node && npm run test:browser","build":"npm run build:wasm && npm run build:ts","serve":"node --import tsx web/server.ts","build:ts":"tsc && rollup -c","test:node":"vitest run","build:wasm":"cd build && ./build.sh","test:watch":"vitest","test:browser":"playwright test --config test/playwright.config.ts","prepublishOnly":"npm run build"},"_npmUser":{"name":"bubblyworld","email":"guy.paterson.jones@gmail.com"},"repository":{"url":"git+https://github.com/Bubblyworld/highs-ts.git","type":"git"},"_npmVersion":"10.9.2","description":"A wasm build of the HiGHS (highs.dev) MILP solver with a convenient typescript interface. Runs with zero dependencies in both node and web environments.","directories":{},"_nodeVersion":"22.16.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.0.0","rollup":"^4.0.0","vitest":"^1.0.0","typescript":"^5.0.0","@types/node":"^20.0.0","@playwright/test":"^1.40.0","@rollup/plugin-typescript":"^11.0.0"},"_npmOperationalInternal":{"tmp":"tmp/highs-ts_1.0.0_1770626860090_0.8613558713929834","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@bubblyworld/highs-ts","version":"1.1.0","keywords":["highs","constraint","optimise","lp","mip","milp"],"author":{"name":"Guy Paterson-Jones"},"license":"MIT","_id":"@bubblyworld/highs-ts@1.1.0","maintainers":[{"name":"bubblyworld","email":"guy.paterson.jones@gmail.com"}],"homepage":"https://github.com/Bubblyworld/highs-ts#readme","bugs":{"url":"https://github.com/Bubblyworld/highs-ts/issues"},"dist":{"shasum":"9c0edabfa0a3772a96ae2ac9ce040bb8c539e5b4","tarball":"https://registry.npmjs.org/@bubblyworld/highs-ts/-/highs-ts-1.1.0.tgz","fileCount":81,"integrity":"sha512-zRZpBig3MdoBFuVQ65AN7jszdRLkAbFhTXxgM9M3stj/WoIXUlgr1qxJo/GHoU0xKjNG+mAtF9JG7cL9QB6MDw==","signatures":[{"sig":"MEQCHzTCTFqe6mWCJULgXYV0I5wSjsctFoaps6V6ZcjT/KsCIQDQdFg+2Nl/3pqlqcSXAkqevbfSDqaE8D6KH78/tSQngQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4166801},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"node":"./dist/index.node.js","types":"./dist/index.d.ts","browser":"./dist/index.browser.js","default":"./dist/index.browser.js"}},"gitHead":"61c53f6eacdc68aa93796707fcf0b6f06d6b2bda","scripts":{"test":"npm run test:node && npm run test:browser","build":"npm run build:wasm && npm run build:ts","serve":"node --import tsx web/server.ts","build:ts":"tsc && rollup -c","test:node":"vitest run","build:wasm":"cd build && ./build.sh","test:watch":"vitest","test:browser":"playwright test --config test/playwright.config.ts","prepublishOnly":"npm run build"},"_npmUser":{"name":"bubblyworld","email":"guy.paterson.jones@gmail.com"},"repository":{"url":"git+https://github.com/Bubblyworld/highs-ts.git","type":"git"},"_npmVersion":"10.9.2","description":"A wasm build of the HiGHS (highs.dev) MILP solver with a convenient typescript interface. Runs with zero dependencies in both node and web environments.","directories":{},"_nodeVersion":"22.16.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e","devDependencies":{"tsx":"^4.0.0","rollup":"^4.0.0","vitest":"^1.0.0","typescript":"^5.0.0","@types/node":"^20.0.0","@playwright/test":"^1.40.0","@rollup/plugin-typescript":"^11.0.0"},"_npmOperationalInternal":{"tmp":"tmp/highs-ts_1.1.0_1770975428131_0.6794858172059375","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@bubblyworld/highs-ts","version":"1.2.0","keywords":["highs","constraint","optimise","lp","mip","milp"],"author":{"name":"Guy Paterson-Jones"},"license":"MIT","_id":"@bubblyworld/highs-ts@1.2.0","maintainers":[{"name":"bubblyworld","email":"guy.paterson.jones@gmail.com"}],"homepage":"https://github.com/Bubblyworld/highs-ts#readme","bugs":{"url":"https://github.com/Bubblyworld/highs-ts/issues"},"dist":{"shasum":"e89f17fa34f1ee7e51786d728e4eb1ab32f5833d","tarball":"https://registry.npmjs.org/@bubblyworld/highs-ts/-/highs-ts-1.2.0.tgz","fileCount":84,"integrity":"sha512-kNSJie2SAUKlFqqVFe0vPFlotLlNC9WZwZVFEPzIDng24+SCYjXeYAY19HjL8hebrwYz3dWW21O8egK0UGSFxQ==","signatures":[{"sig":"MEUCIHZkAhnd0RFh91W1zrBAOhMowWuLwkrSEltif/gvRoTGAiEAjph4ByG1rsU5+/fscmS1I3bjnAX3cxPUcVJJNOliMZI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4277316},"main":"./dist/index.node.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.node.js","exports":{".":{"node":{"import":{"types":"./dist/index.node.d.ts","default":"./dist/index.node.js"},"require":{"types":"./dist/index.node.d.cts","default":"./dist/index.node.cjs"}},"browser":{"types":"./dist/index.browser.d.ts","default":"./dist/index.browser.js"},"default":{"types":"./dist/index.browser.d.ts","default":"./dist/index.browser.js"}}},"gitHead":"c86a8abbff5b53c2f90b75247c1599bbd9c944c3","scripts":{"test":"npm run test:node && npm run test:browser","build":"npm run build:wasm && npm run build:ts","serve":"node --import tsx web/server.ts","build:ts":"tsc && rollup -c && cp dist/index.node.d.ts dist/index.node.d.cts","test:node":"vitest run","build:wasm":"cd build && ./build.sh","test:watch":"vitest","test:browser":"playwright test --config test/playwright.config.ts","prepublishOnly":"npm run build"},"_npmUser":{"name":"bubblyworld","email":"guy.paterson.jones@gmail.com"},"repository":{"url":"git+https://github.com/Bubblyworld/highs-ts.git","type":"git"},"_npmVersion":"10.9.2","description":"A wasm build of the HiGHS (highs.dev) MILP solver with a convenient typescript interface. Runs with zero dependencies in both node and web environments.","directories":{},"_nodeVersion":"22.16.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e","devDependencies":{"tsx":"^4.0.0","rollup":"^4.0.0","vitest":"^1.0.0","typescript":"^5.0.0","@types/node":"^20.0.0","@playwright/test":"^1.40.0","@rollup/plugin-typescript":"^11.0.0"},"_npmOperationalInternal":{"tmp":"tmp/highs-ts_1.2.0_1771495815044_0.3233030406853963","host":"s3://npm-registry-packages-npm-production"}},"1.3.0":{"name":"@bubblyworld/highs-ts","version":"1.3.0","keywords":["highs","constraint","optimise","lp","mip","milp"],"author":{"name":"Guy Paterson-Jones"},"license":"MIT","_id":"@bubblyworld/highs-ts@1.3.0","maintainers":[{"name":"bubblyworld","email":"guy.paterson.jones@gmail.com"}],"homepage":"https://github.com/Bubblyworld/highs-ts#readme","bugs":{"url":"https://github.com/Bubblyworld/highs-ts/issues"},"dist":{"shasum":"e56a58f8450c94dfd27cddec8699b6ede9f860f2","tarball":"https://registry.npmjs.org/@bubblyworld/highs-ts/-/highs-ts-1.3.0.tgz","fileCount":84,"integrity":"sha512-3ruLLFy0nJTdDCZp7s5ALofw91WV6nJuTfTjwnZEtmSLcSx2HALd7CM5libTW3oBWQOORLFxmzWd4DUYj5GP1w==","signatures":[{"sig":"MEUCID5tsUcacuUJqND1NfHG8G2305LJPnNwxGszSdQBCntYAiEA5Nl38zrSAsXq+zbxEatfTpOS6KknJ1lJuu3Thjf5BQU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4323987},"main":"./dist/index.node.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.node.js","exports":{".":{"node":{"import":{"types":"./dist/index.node.d.ts","default":"./dist/index.node.js"},"require":{"types":"./dist/index.node.d.cts","default":"./dist/index.node.cjs"}},"browser":{"types":"./dist/index.browser.d.ts","default":"./dist/index.browser.js"},"default":{"types":"./dist/index.browser.d.ts","default":"./dist/index.browser.js"}}},"gitHead":"03f309d4f406ef63c406236da97a7385c52d24ed","scripts":{"test":"npm run test:node && npm run test:browser","build":"npm run build:wasm && npm run build:ts","serve":"node --import tsx web/server.ts","build:ts":"tsc && rollup -c && cp dist/index.node.d.ts dist/index.node.d.cts","test:node":"vitest run","build:wasm":"cd build && ./build.sh","test:watch":"vitest","test:browser":"playwright test --config test/playwright.config.ts","prepublishOnly":"npm run build"},"_npmUser":{"name":"bubblyworld","email":"guy.paterson.jones@gmail.com"},"repository":{"url":"git+https://github.com/Bubblyworld/highs-ts.git","type":"git"},"_npmVersion":"11.12.1","description":"A wasm build of the HiGHS (highs.dev) MILP solver with a convenient typescript interface. Runs with zero dependencies in both node and web environments.","directories":{},"_nodeVersion":"22.16.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e","devDependencies":{"tsx":"^4.0.0","rollup":"^4.0.0","vitest":"^1.0.0","typescript":"^5.0.0","@types/node":"^20.0.0","@playwright/test":"^1.40.0","@rollup/plugin-typescript":"^11.0.0"},"_npmOperationalInternal":{"tmp":"tmp/highs-ts_1.3.0_1784625640338_0.17423303116259214","host":"s3://npm-registry-packages-npm-production"}},"1.4.0":{"name":"@bubblyworld/highs-ts","version":"1.4.0","keywords":["highs","constraint","optimise","lp","mip","milp"],"author":{"name":"Guy Paterson-Jones"},"license":"MIT","_id":"@bubblyworld/highs-ts@1.4.0","maintainers":[{"name":"bubblyworld","email":"guy.paterson.jones@gmail.com"}],"homepage":"https://github.com/Bubblyworld/highs-ts#readme","bugs":{"url":"https://github.com/Bubblyworld/highs-ts/issues"},"dist":{"shasum":"a421699820d4bd9b7118efdd6f4afe9ce9f39d08","tarball":"https://registry.npmjs.org/@bubblyworld/highs-ts/-/highs-ts-1.4.0.tgz","fileCount":84,"integrity":"sha512-8nuhPAjeIJFJZ428R2CYGp/ljZHoqKVW84HGoP/UwMjBS+hilU56TpjbJDhTXXCk/L+7JIhezeYJQOoAHICXYA==","signatures":[{"sig":"MEUCIHYBM7AZwNN6sWbiw0AKYM50ty2G11r9s0trfBW7MtG0AiEA2rwxNI4LVfSJap0+N6T17BUwIMIjGEORhMSK+qEK5qM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4334467},"main":"./dist/index.node.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.node.js","exports":{".":{"node":{"import":{"types":"./dist/index.node.d.ts","default":"./dist/index.node.js"},"require":{"types":"./dist/index.node.d.cts","default":"./dist/index.node.cjs"}},"browser":{"types":"./dist/index.browser.d.ts","default":"./dist/index.browser.js"},"default":{"types":"./dist/index.browser.d.ts","default":"./dist/index.browser.js"}}},"gitHead":"570909734a5d41bfa240754bb06b801b33d7091a","scripts":{"test":"npm run test:node && npm run test:browser","build":"npm run build:wasm && npm run build:ts","serve":"node --import tsx web/server.ts","build:ts":"tsc && rollup -c && cp dist/index.node.d.ts dist/index.node.d.cts","test:node":"vitest run","build:wasm":"cd build && ./build.sh","test:watch":"vitest","test:browser":"playwright test --config test/playwright.config.ts","prepublishOnly":"npm run build"},"_npmUser":{"name":"bubblyworld","email":"guy.paterson.jones@gmail.com"},"repository":{"url":"git+https://github.com/Bubblyworld/highs-ts.git","type":"git"},"_npmVersion":"11.19.0","description":"A wasm build of the HiGHS (highs.dev) MILP solver with a convenient typescript interface. Runs with zero dependencies in both node and web environments.","directories":{},"_nodeVersion":"26.8.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e","devDependencies":{"tsx":"^4.0.0","rollup":"^4.0.0","vitest":"^1.0.0","typescript":"^5.0.0","@types/node":"^20.0.0","@playwright/test":"^1.40.0","@rollup/plugin-typescript":"^11.0.0"},"_npmOperationalInternal":{"tmp":"tmp/highs-ts_1.4.0_1788434758235_0.04518723986596629","host":"s3://npm-registry-packages-npm-production"}},"1.4.1":{"name":"@bubblyworld/highs-ts","version":"1.4.1","description":"A wasm build of the HiGHS (highs.dev) MILP solver with a convenient typescript interface. Runs with zero dependencies in both node and web environments.","type":"module","main":"./dist/index.node.cjs","module":"./dist/index.node.js","types":"./dist/index.d.ts","publishConfig":{"access":"public"},"exports":{".":{"node":{"import":{"types":"./dist/index.node.d.ts","default":"./dist/index.node.js"},"require":{"types":"./dist/index.node.d.cts","default":"./dist/index.node.cjs"}},"browser":{"types":"./dist/index.browser.d.ts","default":"./dist/index.browser.js"},"default":{"types":"./dist/index.browser.d.ts","default":"./dist/index.browser.js"}}},"scripts":{"build":"npm run build:wasm && npm run build:ts","build:wasm":"cd build && ./build.sh","build:ts":"tsc && rollup -c && cp dist/index.node.d.ts dist/index.node.d.cts","serve":"node --import tsx web/server.ts","test":"npm run test:node && npm run test:browser","test:node":"vitest run","test:browser":"playwright test --config test/playwright.config.ts","test:watch":"vitest","prepublishOnly":"npm run build"},"keywords":["highs","constraint","optimise","lp","mip","milp"],"author":{"name":"Guy Paterson-Jones"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Bubblyworld/highs-ts.git"},"devDependencies":{"@playwright/test":"^1.40.0","@rollup/plugin-typescript":"^11.0.0","@types/node":"^20.0.0","rollup":"^4.0.0","tsx":"^4.0.0","typescript":"^5.0.0","vitest":"^1.0.0"},"packageManager":"yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e","gitHead":"5903b1f40b6bcc0c4e9d95a3d24916e2e4eca785","_id":"@bubblyworld/highs-ts@1.4.1","bugs":{"url":"https://github.com/Bubblyworld/highs-ts/issues"},"homepage":"https://github.com/Bubblyworld/highs-ts#readme","_nodeVersion":"26.8.1","_npmVersion":"11.19.0","dist":{"integrity":"sha512-6C8aa6AxgoJq4QHICilti4oHmhb6WCLv3PFZ8ce8Uvkgw2l54DmCL5Zgiw9pVYdzpBd6+fcMAs6Mp3yiW51xcQ==","shasum":"5cb3d8ddefd019a972ae8a17273af2c92d026034","tarball":"https://registry.npmjs.org/@bubblyworld/highs-ts/-/highs-ts-1.4.1.tgz","fileCount":84,"unpackedSize":4339657,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIAEdj0t4maIcqG3XxKjJ/nmub66Nymi4egqDAnnZ6l3rAiEAhnNpXP0WpUHLJ8SP3PGAVaah9lchFLQRJNKPIn0CWCY="}]},"_npmUser":{"name":"bubblyworld","email":"guy.paterson.jones@gmail.com"},"directories":{},"maintainers":[{"name":"bubblyworld","email":"guy.paterson.jones@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/highs-ts_1.4.1_1788502005456_0.06226975253450395"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-09T08:47:39.992Z","modified":"2026-09-04T06:06:45.784Z","1.0.0":"2026-02-09T08:47:40.314Z","1.1.0":"2026-02-13T09:37:08.342Z","1.2.0":"2026-02-19T10:10:15.333Z","1.3.0":"2026-07-21T09:20:40.520Z","1.4.0":"2026-09-03T11:25:58.385Z","1.4.1":"2026-09-04T06:06:45.649Z"},"bugs":{"url":"https://github.com/Bubblyworld/highs-ts/issues"},"author":{"name":"Guy Paterson-Jones"},"license":"MIT","homepage":"https://github.com/Bubblyworld/highs-ts#readme","keywords":["highs","constraint","optimise","lp","mip","milp"],"repository":{"type":"git","url":"git+https://github.com/Bubblyworld/highs-ts.git"},"description":"A wasm build of the HiGHS (highs.dev) MILP solver with a convenient typescript interface. Runs with zero dependencies in both node and web environments.","maintainers":[{"name":"bubblyworld","email":"guy.paterson.jones@gmail.com"}],"readme":"# highs-ts\n\n[![npm version](https://img.shields.io/npm/v/@bubblyworld/highs-ts)](https://www.npmjs.com/package/@bubblyworld/highs-ts)\n[![CI](https://github.com/Bubblyworld/highs-ts/actions/workflows/ci.yml/badge.svg)](https://github.com/Bubblyworld/highs-ts/actions/workflows/ci.yml)\n[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\n[WASM](https://webassembly.org/) build of the [HiGHS](https://highs.dev) solver with TypeScript bindings. Supports linear and mixed-integer linear programming, and runs in both node and browser environments with zero runtime dependencies.\n\nThe solver's emscripten glue is loaded with a plain relative `import()`, so the package works both unbundled (served as native ES modules) and under bundlers like webpack and vite, which statically resolve the import and include the glue and wasm in your bundle.\n\n## Basic Usage\n\nThe `HiGHS` class provides direct access to the solver. Problems can be loaded from strings in [CPLEX LP](https://www.ibm.com/docs/en/icos/22.1.0?topic=cplex-lp-file-format-algebraic-representation) or [MPS](https://en.wikipedia.org/wiki/MPS_(format)) format.\n\n```typescript\nimport { HiGHS } from '@bubblyworld/highs-ts';\n\nconst lp = `\nMaximize\n  obj: x + 2 y\nSubject To\n  c1: x + y <= 10\n  c2: x <= 5\nBounds\n  0 <= x <= 10\n  0 <= y <= 10\nEnd\n`;\n\nconst highs = await HiGHS.create();\nawait highs.parse(lp, 'lp');\nconst result = await highs.solve();\n\nconsole.log(result.status);     // @expect: result.status === 'optimal'\nconsole.log(result.objective);  // @expect: result.objective === 20\nconsole.log(result.solution);   // Map { 'x' => 0, 'y' => 10 }\n\nhighs.free();\n```\n\n## Raw Columnar Input\n\nFor large models, serializing to LP/MPS text and parsing it back becomes the\ndominant cost. `passModel` skips both: it copies typed arrays straight into\nsolver memory via `Highs_passLp` (or `Highs_passMip` when `integrality` is\ngiven). The constraint matrix is sparse, row-wise by default, and bounds\ndefault to `0 <= x < +inf` for columns and `-inf < row < +inf` for rows —\npass `HIGHS_INF` explicitly where you need it. `getSolutionValues` reads the\nsolution back densely by column index, which is the natural pairing since\nraw columns have no names.\n\n```typescript\nimport { HiGHS } from '@bubblyworld/highs-ts';\n\n// The same problem as above, in columnar form.\nconst highs = await HiGHS.create();\nhighs.passModel({\n  numCol: 2,\n  numRow: 2,\n  sense: 'maximize',\n  colCost: Float64Array.from([1, 2]),\n  colUpper: Float64Array.from([10, 10]),\n  rowUpper: Float64Array.from([10, 5]),\n  matrix: {\n    start: Int32Array.from([0, 2, 3]),\n    index: Int32Array.from([0, 1, 0]),\n    value: Float64Array.from([1, 1, 1]),\n  },\n});\nconst result = await highs.solve();\nconst values = highs.getSolutionValues();\n\nconsole.log(result.status);     // @expect: result.status === 'optimal'\nconsole.log(result.objective);  // @expect: result.objective === 20\nconsole.log(values[1]);         // @expect: values[1] === 10\n\nhighs.free();\n```\n\n## High-Level API\n\nThe `Model` class provides a builder interface for defining problems programmatically.\n\n```typescript\nimport { Model, sum } from '@bubblyworld/highs-ts';\n\nconst model = new Model();\n\n// Variables: numVar (continuous), intVar (integer), boolVar (binary)\nconst x = model.numVar(0, 10, 'x');\nconst y = model.numVar(0, 10, 'y');\n\n// Constraints with expressions\nmodel.addConstraint(x.plus(y).leq(10), 'c1');\nmodel.addConstraint(x.leq(5), 'c2');\n\n// Objective\nmodel.maximize(x.plus(y.times(2)));\n\nconst solution = await model.solve();\nconsole.log(solution.status);      // @expect: solution.status === 'optimal'\nconsole.log(solution.objective);   // @expect: solution.objective === 20\nconsole.log(solution.getValue(x)); // 0\nconsole.log(solution.getValue(y)); // 10\n```\n\nVariable and constraint names can be any whitespace-free string. `solve()` hands the model to the solver in MPS format, which — unlike the LP grammar — reserves no characters, so names like `item-cost` or `x[1,2]` are fine. To inspect a model yourself, `model.print()` returns CPLEX LP text and `model.print('mps')` returns MPS.\n\nExpressions support chained arithmetic: `plus()`, `minus()`, `times()`, `neg()`. Constraints are created with `leq()`, `geq()`, and `eq()`. The `sum()` helper combines multiple terms, either spread as arguments or passed as a single array (prefer the array form for very large collections), and `solution.getValue()` evaluates a variable or any linear expression against the solution. You can mix and match different kinds of variables and constraints as you like:\n\n```typescript\nconst model = new Model();\nconst x_a = model.intVar(0, 10, 'x_a');\nconst x_b = model.intVar(0, 8, 'x_b');\nconst y_a = model.boolVar('y_a');\nconst y_b = model.boolVar('y_b');\n\nmodel.addConstraint(x_a.minus(y_a.times(10)).leq(0), 'cap_a');\nmodel.addConstraint(x_b.minus(y_b.times(8)).leq(0), 'cap_b');\nmodel.addConstraint(x_a.plus(x_b).leq(12), 'material');\n\nmodel.maximize(\n  x_a.times(10)\n    .plus(x_b.times(12))\n    .minus(y_a.times(50))\n    .minus(y_b.times(60))\n);\n\nconst solution = await model.solve();\nconsole.log(solution.objective); // @expect: solution.objective === 50\n```\n\n## Modelling Primitives\n\nThe `Model` class includes a number of higher-level primitives for common MILP reformulations, built on top of the basic variable and constraint API. Logical operations (`and`, `or`, `not`, `xor`), cardinality constraints (`addAtMost`, `addAtLeast`, `addExactly`), indicators, `abs`, `max`, `min`, and `product` are all available — see the source for full details. The rest of this section covers some of the less obvious primitives.\n\n### Semi-Continuous Variables\n\nA semi-continuous variable is either exactly zero or lies within a range `[lb, ub]`, with no values in between. This is useful for modelling minimum-batch-size or on/off decisions where partial activation doesn't make sense.\n\n```typescript\nconst model = new Model();\nconst batch = model.semiContVar(100, 500, 'batch');\n\nmodel.maximize(batch);\nconst solution = await model.solve();\nconsole.log(solution.objective); // @expect: solution.objective === 500\n```\n\n### Integer Division\n\n`divMod(expr, d)` returns quotient and remainder variables for dividing a non-negative integer expression by a positive integer constant.\n\n```typescript\nconst model = new Model();\nconst minutes = model.intVar(0, 1440, 'minutes');\nconst { quotient, remainder } = model.divMod(minutes, 60);\n\nmodel.addConstraint(minutes.eq(145));\nmodel.minimize(quotient);\n\nconst solution = await model.solve();\nconsole.log(solution.objective); // @expect: solution.objective === 2\n```\n\n### Either-Or Constraints\n\n`addEitherOr(c1, c2)` enforces that at least one of two constraints must hold, using indicator variables internally.\n\n```typescript\nconst model = new Model();\nconst x = model.numVar(0, 100, 'x');\nconst y = model.numVar(0, 100, 'y');\n\nmodel.addEitherOr(x.leq(10), y.leq(10));\nmodel.maximize(x.plus(y));\n\nconst solution = await model.solve();\nconsole.log(solution.objective); // @expect: solution.objective === 110\n```\n\n### Reification\n\n`reify(constraint)` returns a binary variable `delta` that is 1 if and only if the constraint is satisfied. This is the most general way to convert a constraint into a variable for use in other expressions. It supports `<=`, `>=`, and `=` senses.\n\n```typescript\nconst model = new Model();\nconst tasks = [\n  model.intVar(0, 10, 'a'),\n  model.intVar(0, 10, 'b'),\n  model.intVar(0, 10, 'c'),\n];\n\nconst overloaded = tasks.map(t => model.reify(t.geq(8)));\nmodel.addConstraint(sum(...overloaded).leq(1));\n\nmodel.maximize(sum(...tasks));\nconst solution = await model.solve();\nconsole.log(solution.objective); // @expect: solution.objective === 24\n```\n\nEpsilon defaults to 1 for purely-integer expressions (exact reification) and 1e-6 for continuous expressions. Both epsilon and Big-M can be overridden via options:\n\n```typescript\nconst model = new Model();\nconst x = model.numVar(0, 100, 'x');\nconst delta = model.reify(x.leq(50), { bigM: 200, epsilon: 1e-4 });\n\nmodel.addConstraint(delta.eq(1));\nmodel.maximize(x);\n\nconst solution = await model.solve();\nconsole.log(solution.objective); // @expect: solution.objective === 50\n```\n\n## Configuration\n\n### Console Output\n\nBy default, solver output is suppressed. To enable progress logging, pass an explicit console configuration:\n\n```typescript\nconst highs = await HiGHS.create({\n  console: {\n    log: (msg) => console.log(msg),\n    error: (msg) => console.error(msg)\n  }\n});\n```\n\nThe same option works for `Model.solve()`:\n\n```typescript\nconst solution = await model.solve({\n  console: { log: console.log, error: console.error }\n});\n```\n\n## Building\n\nBuild the project (requires Emscripten for WASM compilation):\n\n```bash\nnpm run build\nnpm run build:ts\nnpm run build:wasm\n```\n\nRun the test suite (requires a playwright-compatible browser):\n\n```bash\nnpm test\nnpm run test:node    # Node only\nnpm run test:browser # Browser only (using Playwright)\n```\n\nStart the development server:\n\n```bash\nnpm run serve\n```\n\n## Licensing\n\nThis package is licensed under the MIT License. The WASM bundle includes [HiGHS](https://highs.dev), also licensed under MIT ([license](https://github.com/ERGO-Code/HiGHS/blob/master/LICENSE.txt)).\n\n## Acknowledgements\n\nThe vast majority of the credit here goes to the authors of [HiGHS](https://highs.dev). I've just packaged it nicely for use in the javascript/typescript world.\n","readmeFilename":"README.md"}