{"_id":"@bun-win32/combase","_rev":"5-5e82619edef06ab74c4830d223d3ec88","name":"@bun-win32/combase","dist-tags":{"latest":"2.0.1"},"versions":{"1.0.0":{"name":"@bun-win32/combase","version":"1.0.0","keywords":["bun","ffi","win32","windows","combase","winrt","hstring","toast","bindings","typescript","dll"],"author":"Stev Peifer <stev@bell.net>","license":"MIT","_id":"@bun-win32/combase@1.0.0","maintainers":[{"name":"obscuritysrl","email":"stev@bell.net"}],"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dist":{"shasum":"7a7f0e3af40f45b96370c3fb55f04e6cfe136a75","tarball":"https://registry.npmjs.org/@bun-win32/combase/-/combase-1.0.0.tgz","fileCount":6,"integrity":"sha512-vMRHhQZstltz7PZuOmWcfxMiH2SU0d1UtEXKYT6Ezk6kHu8wY0Zb4vQGmkb/Kb+F4pzHM+m8E+JOSR/VrrPojA==","signatures":[{"sig":"MEUCIQDRKZPfp/xGBhpUn2nxUIvLG6jXFwg7IWp85bwTVN8NRwIgG/8cqUPmaMoSDGjtq0mw5gPYiIlZyAfWabokEDJqH08=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":32530},"main":"./index.ts","type":"module","module":"index.ts","shasum":"7a7f0e3af40f45b96370c3fb55f04e6cfe136a75","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:winrt-diagnostic":"bun ./example/winrt-diagnostic.ts","example:toast-notification":"bun ./example/toast-notification.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-vMRHhQZstltz7PZuOmWcfxMiH2SU0d1UtEXKYT6Ezk6kHu8wY0Zb4vQGmkb/Kb+F4pzHM+m8E+JOSR/VrrPojA==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/combase"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 COMBASE bindings for Bun (FFI) on Windows.","directories":{},"sideEffects":false,"_nodeVersion":"24.3.0","dependencies":{"@bun-win32/core":"1.1.2"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/combase_1.0.0_1779073003669_0.5467035138870129","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@bun-win32/combase","version":"1.0.1","keywords":["bun","ffi","win32","windows","combase","winrt","hstring","toast","bindings","typescript","dll"],"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","_id":"@bun-win32/combase@1.0.1","maintainers":[{"name":"obscuritysrl","email":"stev@bell.net"}],"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dist":{"shasum":"d9de5eb282dad925f8104f867cfdad6a5d5e5c0e","tarball":"https://registry.npmjs.org/@bun-win32/combase/-/combase-1.0.1.tgz","fileCount":6,"integrity":"sha512-6P3d5jGm3trNBvIRy/pA5ChsJbLP30v93gT56lt47HR8qig8KvtXTu3g1NjkHcvqYLl6xzBlzREB4VOmGB6MVg==","signatures":[{"sig":"MEYCIQDjAKgsmkflw/awDUDKQXU3+oswEEe6/y3EuZRRfyxnrgIhANBN5dgs2BcoZ7MVdeYy+ohfKeYED0MjJKuO7XH7Odgm","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":32535},"main":"./index.ts","type":"module","module":"index.ts","shasum":"d9de5eb282dad925f8104f867cfdad6a5d5e5c0e","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:winrt-diagnostic":"bun ./example/winrt-diagnostic.ts","example:toast-notification":"bun ./example/toast-notification.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-6P3d5jGm3trNBvIRy/pA5ChsJbLP30v93gT56lt47HR8qig8KvtXTu3g1NjkHcvqYLl6xzBlzREB4VOmGB6MVg==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/combase"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 COMBASE bindings for Bun (FFI) on Windows.","directories":{},"sideEffects":false,"_nodeVersion":"24.3.0","dependencies":{"@bun-win32/core":"1.1.4"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/combase_1.0.1_1781130799726_0.10620935899061168","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@bun-win32/combase","version":"1.1.0","keywords":["bun","ffi","win32","windows","combase","winrt","hstring","toast","bindings","typescript","dll"],"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","_id":"@bun-win32/combase@1.1.0","maintainers":[{"name":"obscuritysrl","email":"stev@bell.net"}],"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dist":{"shasum":"ffa829239025ccd3c2beac7e96341cb64973170a","tarball":"https://registry.npmjs.org/@bun-win32/combase/-/combase-1.1.0.tgz","fileCount":6,"integrity":"sha512-R2zq6SW/4wU5iIkX7lcS6IoMY+DFkHOVjIoC5fOm9nBfg9jdMg9AnTNxj3McX/5FEuMKJ0XVYd3t+3n2Bw53wg==","signatures":[{"sig":"MEQCIFYDGsYZd+3TWF6SHROTVUhHs5NxLnMrytvC5Ze65+VUAiAGEZxRJXyjbxhmvKrhBtSvfzuYdfL8RKmrqloCuFfhVA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":34468},"main":"./index.ts","type":"module","module":"index.ts","shasum":"ffa829239025ccd3c2beac7e96341cb64973170a","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:winrt-diagnostic":"bun ./example/winrt-diagnostic.ts","example:toast-notification":"bun ./example/toast-notification.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-R2zq6SW/4wU5iIkX7lcS6IoMY+DFkHOVjIoC5fOm9nBfg9jdMg9AnTNxj3McX/5FEuMKJ0XVYd3t+3n2Bw53wg==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/combase"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 COMBASE bindings for Bun (FFI) on Windows.","directories":{},"sideEffects":false,"_nodeVersion":"24.3.0","dependencies":{"@bun-win32/core":"1.1.4"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/combase_1.1.0_1781375313987_0.8948410664450499","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@bun-win32/combase","version":"2.0.0","keywords":["bun","ffi","win32","windows","combase","winrt","hstring","toast","bindings","typescript","dll"],"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","_id":"@bun-win32/combase@2.0.0","maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dist":{"shasum":"2a94e4e310ed770c125a73645fb26ca015eaa05e","tarball":"https://registry.npmjs.org/@bun-win32/combase/-/combase-2.0.0.tgz","fileCount":6,"integrity":"sha512-Hn928mn242MYSl9jUk2t+KaBxTfmgHId7zRGP/jquaSZ80+qbYuHmYbZKzZ+UkNOG3yPEfxxLBW2uhrCEmEtLw==","signatures":[{"sig":"MEYCIQDzV7VhvVCZfRFdgE7FHLOv+mc/AAwNQWQoA/5FvZjvIAIhAO987XWqceY43LVy/As1xRDJ45KWkC4U8WoM6vvSm7ol","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":36236},"main":"./index.ts","type":"module","module":"index.ts","shasum":"2a94e4e310ed770c125a73645fb26ca015eaa05e","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:winrt-diagnostic":"bun ./example/winrt-diagnostic.ts","example:toast-notification":"bun ./example/toast-notification.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev.p@outlook.com"},"_integrity":"sha512-Hn928mn242MYSl9jUk2t+KaBxTfmgHId7zRGP/jquaSZ80+qbYuHmYbZKzZ+UkNOG3yPEfxxLBW2uhrCEmEtLw==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/combase"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 COMBASE bindings for Bun (FFI) on Windows.","directories":{},"sideEffects":false,"_nodeVersion":"26.3.0","dependencies":{"@bun-win32/core":"2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/combase_2.0.0_1782435279833_0.9813054204177285","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"author":"Stev Peifer <stev.p@outlook.com>","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dependencies":{"@bun-win32/core":"2.0.1"},"description":"Zero-dependency, zero-overhead Win32 COMBASE bindings for Bun (FFI) on Windows.","devDependencies":{"@types/bun":"latest"},"exports":{".":"./index.ts"},"license":"MIT","module":"index.ts","name":"@bun-win32/combase","peerDependencies":{"typescript":"^5"},"private":false,"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","repository":{"type":"git","url":"git://github.com/ObscuritySRL/bun-win32.git","directory":"packages/combase"},"type":"module","version":"2.0.1","main":"./index.ts","keywords":["bun","ffi","win32","windows","combase","winrt","hstring","toast","bindings","typescript","dll"],"sideEffects":false,"engines":{"bun":">=1.1.0"},"scripts":{"example:toast-notification":"bun ./example/toast-notification.ts","example:winrt-diagnostic":"bun ./example/winrt-diagnostic.ts"},"_id":"@bun-win32/combase@2.0.1","_integrity":"sha512-feNkBwgGouNnbOwKN1VmEyvJvvNz69ZMxQc7JExl7fGHFQOmAdNa8Oubqr2I8T5KGDzJRc5fQvj+PZ1xo8QKHQ==","_nodeVersion":"26.3.0","_npmVersion":"10.8.3","shasum":"1487f6fe2d6d5f199e64ffccef7024f56c2c83b8","dist":{"integrity":"sha512-feNkBwgGouNnbOwKN1VmEyvJvvNz69ZMxQc7JExl7fGHFQOmAdNa8Oubqr2I8T5KGDzJRc5fQvj+PZ1xo8QKHQ==","shasum":"1487f6fe2d6d5f199e64ffccef7024f56c2c83b8","tarball":"https://registry.npmjs.org/@bun-win32/combase/-/combase-2.0.1.tgz","fileCount":6,"unpackedSize":36236,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIBwIeil+6xYgcx/idP0dmaRGUimr7c4pf5gzeMiVj2XmAiAYYQ7GuMIaSXr0t9FQmSi/tAQ++MebpLKdJVmWf0DKLA=="}]},"_npmUser":{"name":"obscuritysrl","email":"stev.p@outlook.com"},"directories":{},"maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/combase_2.0.1_1782437737268_0.41948024276586593"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-18T02:56:43.545Z","modified":"2026-06-26T01:35:37.531Z","1.0.0":"2026-05-18T02:56:43.857Z","1.0.1":"2026-06-10T22:33:19.853Z","1.1.0":"2026-06-13T18:28:34.122Z","2.0.0":"2026-06-26T00:54:39.969Z","2.0.1":"2026-06-26T01:35:37.401Z"},"bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","homepage":"https://github.com/ObscuritySRL/bun-win32#readme","keywords":["bun","ffi","win32","windows","combase","winrt","hstring","toast","bindings","typescript","dll"],"repository":{"type":"git","url":"git://github.com/ObscuritySRL/bun-win32.git","directory":"packages/combase"},"description":"Zero-dependency, zero-overhead Win32 COMBASE bindings for Bun (FFI) on Windows.","maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"readme":"# @bun-win32/combase\n\nZero-dependency, zero-overhead Win32 Combase bindings for [Bun](https://bun.sh) on Windows.\n\n## Overview\n\n`@bun-win32/combase` exposes the `combase.dll` exports using [Bun](https://bun.sh)'s FFI. It provides a single class, `Combase`, which lazily binds native symbols on first use. You can optionally preload a subset or all symbols up-front via `Preload()`.\n\nThis is the **Windows Runtime (WinRT) activation core**: the `Ro*` activation functions (`RoInitialize`, `RoActivateInstance`, `RoGetActivationFactory`), the full `HSTRING` string API (`WindowsCreateString`, `WindowsGetStringRawBuffer`, …), and the WinRT error-info surface (`RoOriginateError`, `GetRestrictedErrorInfo`, …). Combined with COM vtable invocation, this is the pure-FFI path to native toast notifications, System Media Transport Controls, sensors, and the rest of the WinRT projection — with no native build step.\n\nThe bindings are strongly typed for a smooth DX in TypeScript.\n\n## Features\n\n- [Bun](https://bun.sh)-first ergonomics on Windows 10/11.\n- Direct FFI to `combase.dll` (WinRT activation, HSTRING strings, and Windows Runtime error APIs).\n- In-source docs in `structs/Combase.ts` with links to Microsoft Docs.\n- Lazy binding on first call; optional eager preload (`Combase.Preload()`).\n- No wrapper overhead; calls map 1:1 to native APIs.\n- Strongly-typed Win32 aliases (see `types/Combase.ts`).\n\n## Requirements\n\n- [Bun](https://bun.sh) runtime\n- Windows 10 or later\n\n## Installation\n\n```sh\nbun add @bun-win32/combase\n```\n\n## Quick Start\n\n```ts\nimport Combase, { RO_INIT_TYPE } from '@bun-win32/combase';\n\n// Initialize the Windows Runtime on this thread.\nCombase.RoInitialize(RO_INIT_TYPE.RO_INIT_MULTITHREADED);\n\n// Create an HSTRING from a JS string.\nconst text = 'Windows.Globalization.Calendar';\nconst source = Buffer.from(text, 'utf16le');\nconst out = Buffer.alloc(8);\nCombase.WindowsCreateString(source.ptr!, text.length, out.ptr!);\nconst hClassId = out.readBigUInt64LE(0);\n\n// Activate the WinRT runtime class.\nconst instance = Buffer.alloc(8);\nconst hr = Combase.RoActivateInstance(hClassId, instance.ptr!);\nconsole.log(`RoActivateInstance → 0x${(hr >>> 0).toString(16)}`);\n\nCombase.WindowsDeleteString(hClassId);\nCombase.RoUninitialize();\n```\n\n> [!NOTE]\n> AI agents: see `AI.md` for the package binding contract and source-navigation guidance. It explains how to use the package without scanning the entire implementation.\n\n## Examples\n\nRun the included examples:\n\n```sh\nbun run example/toast-notification.ts\nbun run example/winrt-diagnostic.ts\n```\n\n## Notes\n\n- Either rely on lazy binding or call `Combase.Preload()`.\n- `HSTRING`, `HSTRING_BUFFER`, and the registration cookies are opaque handle tokens (`bigint`); `HSTRING*` out-parameters are caller-allocated buffers (`Pointer`).\n- Windows only. Bun runtime required.\n- **SAL types & naming:** nullability is in the **type** — `Optional<T>` (formally optional, SAL `_*opt_`) and `Nullable<T>` (plain `[in]`/`[out]` the docs say can be NULL), the null sentinel derived from `T` (`null` for pointers `LP*`/`P*`, `0n` for handles/by-value addresses); direction is in the **parameter name** — `_out` (`_Out_`), `_in_out` (`_Inout_`), `_In_` bare. See `AI.md` and the repo `AGENTS.md`.\n","readmeFilename":"README.md"}