Skip to content

Commit

Permalink
feat: add TypeScript definitions
Browse files Browse the repository at this point in the history
BREAKING CHANGE: you may need to remove custom `declare module '@sanity/eventsource'` instances in your codebase
  • Loading branch information
stipsan committed Mar 22, 2023
1 parent 5f6e126 commit eb9076a
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 8 deletions.
22 changes: 22 additions & 0 deletions package-lock.json

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

41 changes: 33 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,25 @@
"type": "commonjs",
"exports": {
".": {
"browser": "./browser.js",
"types": "./node.d.ts",
"browser": {
"types": "./browser.d.ts",
"default": "./browser.js"
},
"default": "./node.js"
},
"./browser": {
"types": "./browser.d.ts",
"default": "./browser.js"
},
"./node": {
"types": "./node.d.ts",
"default": "./node.js"
},
"./browser": "./browser.js",
"./node": "./node.js",
"./package.json": "./package.json"
},
"main": "./node.js",
"browser": "./browser.js",
"files": [
"CHANGELOG.md",
"browser.js",
"node.js"
],
"scripts": {
"prepublishOnly": "tsc",
"test": "tsc --noEmit --emitDeclarationOnly false"
Expand All @@ -47,7 +52,27 @@
"semi": false,
"singleQuote": true
},
"types": "./node.d.ts",
"typesVersions": {
"*": {
"browser": [
"./browser.d.ts"
],
"node": [
"./node.d.ts"
]
}
},
"files": [
"CHANGELOG.md",
"browser.js",
"browser.d.ts",
"node.js",
"node.d.ts"
],
"dependencies": {
"@types/event-source-polyfill": "1.0.1",
"@types/eventsource": "1.1.11",
"event-source-polyfill": "1.0.31",
"eventsource": "2.0.2"
},
Expand Down

0 comments on commit eb9076a

Please sign in to comment.