Skip to content

Commit

Permalink
Merge pull request #264 from BoussonKarel/master
Browse files Browse the repository at this point in the history
add typescript declarations (for Glint)
  • Loading branch information
zeppelin authored Oct 6, 2023
2 parents fd1958b + 9f982d2 commit 6fe92b9
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
15 changes: 13 additions & 2 deletions ember-click-outside/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"author": "Gabor Babicz <[email protected]>",
"files": [
"addon-main.js",
"dist"
"dist",
"types"
],
"scripts": {
"build": "rollup --config",
Expand Down Expand Up @@ -63,7 +64,17 @@
},
"exports": {
".": "./dist/index.js",
"./*": "./dist/*.js",
"./*": {
"types": "./types/*.d.ts",
"default": "./dist/*.js"
},
"./addon-main.js": "./addon-main.js"
},
"typesVersions": {
"*": {
"*": [
"types/*"
]
}
}
}
17 changes: 17 additions & 0 deletions ember-click-outside/types/modifiers/on-click-outside.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import type Modifier from 'ember-modifier';

export interface ClickOutsideSignature {
Element?: HTMLElement;
Args: {
Positional: [action: (event: Event) => unknown];
Named:
| never
| {
capture?: boolean;
eventType?: keyof DocumentEventMap;
exceptSelector?: string;
};
};
}

export default class ClickOutsideModifier extends Modifier<ClickOutsideSignature> {}
5 changes: 5 additions & 0 deletions ember-click-outside/types/template-registry.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import OnClickOutside from './modifiers/on-click-outside';

export default class EmberClickOutsideRegistry {
'on-click-outside': typeof OnClickOutside;
}

0 comments on commit 6fe92b9

Please sign in to comment.