Skip to content

Commit

Permalink
Add types for the dom apis
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas101 committed Nov 14, 2024
1 parent 7543c27 commit 5eac0a1
Show file tree
Hide file tree
Showing 10 changed files with 489 additions and 10 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,20 @@ if (window.aibrow) {
}
```

#### Typescript types

Types for `window.aibrow` can be added to your project by using the `npm install --save-dev @aibrow/dom-types` package. Then to expose them, place the following either in your `global.d.ts` or the entry point to your code

```ts
import type AI from "@aibrow/dom-types"

declare global {
interface Window {
readonly aibrow: typeof AI;
}
}
```

### Extension

Install the library using `npm install @aibrow/extension`
Expand Down
3 changes: 3 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
"extensionLibrary": {
"name": "@aibrow/extension"
},
"typesLibrary": {
"name": "@aibrow/dom-types"
},

"defaultModels": {
"text": "smollm2-1-7b-instruct-q4-k-m",
Expand Down
8 changes: 7 additions & 1 deletion examples/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5eac0a1

Please sign in to comment.