Commit ab12363
Ship TypeScript declarations with foundry-local-sdk (#666)
`package.json` advertised `"types": "dist/index.d.ts"`, but the build
never emitted declarations — consumers importing `foundry-local-sdk`
from TypeScript got no IntelliSense or type checking.
### Changes
- **`sdk/js/tsconfig.build.json`** — enable `declaration: true` and
`sourceMap: true`. Scoped to the build tsconfig so tests/examples are
unaffected. `declarationMap` is intentionally omitted to keep `src/` out
of the tarball.
- **`sdk/js/README.md`** — add a short "TypeScript support" section so
the bundled typings are discoverable.
No changes needed in `package.json` or `script/pack.cjs`: `dist/` is
already in `files`, so the 16 emitted `.d.ts` files (`index`, `catalog`,
`foundryLocalManager`, `configuration`, `imodel`, `types`, `openai/*`,
`detail/*`) flow into the tarball automatically. The
`foundry-local-sdk-winml` variant continues to inherit types
transitively via its `foundry-local-sdk` dependency.
```jsonc
// sdk/js/tsconfig.build.json
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist",
"declaration": true,
"sourceMap": true
}
```
`@internal`-tagged exports (`Model`, `ModelVariant`, `CoreInterop`,
`Configuration`) are left in the emitted declarations to keep the public
surface unchanged from what the `.js` already exposes; `stripInternal`
can be layered on as a follow-up if tightening the advertised API is
desired.
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: baijumeswani <12852605+baijumeswani@users.noreply.github.com>1 parent 088f844 commit ab12363
2 files changed
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
24 | 30 | | |
25 | 31 | | |
26 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
| |||
0 commit comments