Skip to content

Commit

Permalink
fix: declare missing api/types for VIntersection's function form
Browse files Browse the repository at this point in the history
  • Loading branch information
yusufkandemir committed Mar 1, 2024
1 parent 74f13af commit 0c0abe2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ui/build/build.types.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,10 @@ function copyPredefinedTypes (dir, parentDir) {
})
}

// Add types that should not be imported from ./api, but rather defined globally or generated in the final index.d.ts
const extraInterfaceExclusions = [
'IntersectionObserverEntry'
]
function addToExtraInterfaces (def) {
if (def !== void 0 && def !== null && def.tsType !== void 0) {
// When a type name is found and it has autoDefineTsType and a definition,
Expand All @@ -232,7 +236,7 @@ function addToExtraInterfaces (def) {
extraInterfaces[ def.tsType ] = getPropDefinitions({ definitions: def.definition })
}
}
else if (!extraInterfaces.hasOwnProperty(def.tsType)) {
else if (!extraInterfaces.hasOwnProperty(def.tsType) && !extraInterfaceExclusions.includes(def.tsType)) {
extraInterfaces[ def.tsType ] = void 0
}
}
Expand Down
13 changes: 13 additions & 0 deletions ui/src/directives/Intersection.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"params": {
"entry": {
"type": "Object",
"tsType": "IntersectionObserverEntry",
"desc": "The IntersectionObserverEntry object",
"definition": {
"boundingClientRect": {
Expand Down Expand Up @@ -189,6 +190,18 @@
}
}
}
},

"params": {
"entry": {
"type": "Object",
"tsType": "IntersectionObserverEntry",
"desc": "The IntersectionObserverEntry object"
}
},
"returns": {
"type": "Boolean",
"desc": "If you return Boolean false from the handler, the observer stops"
}
},

Expand Down

0 comments on commit 0c0abe2

Please sign in to comment.