forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🤖 Merge PR DefinitelyTyped#69089 Definitions for eventbusjs by @Longq…
…in88888 Co-authored-by: longfeng <[email protected]>
- Loading branch information
1 parent
d98e6c5
commit 1abb6a1
Showing
5 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
* | ||
!**/*.d.ts | ||
!**/*.d.cts | ||
!**/*.d.mts | ||
!**/*.d.*.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// Type definitions for eventbusjs 0.2.0 | ||
// Project: https://github.com/krasimir/EventBus | ||
|
||
import * as EventBus from "eventbusjs" | ||
|
||
function myFunction() { }; | ||
EventBus.addEventListener('my_function_event', myFunction); | ||
let isEvent: boolean = EventBus.hasEventListener('my_function_event', myFunction); | ||
let events: string = EventBus.getEvents(); | ||
EventBus.dispatch('my_function_event'); | ||
EventBus.removeEventListener('my_function_event', myFunction); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Type definitions for eventbusjs 0.2.0 | ||
// Project: https://github.com/krasimir/EventBus | ||
|
||
export type EventListener = (...args: any) => any; | ||
|
||
export function addEventListener(type: string, listener?: EventListener, scope?: object): void; | ||
|
||
export function removeEventListener(type: string, listener?: EventListener, scope?: object): void; | ||
|
||
export function hasEventListener(type: string, listener?: EventListener, scope?: object): boolean; | ||
|
||
export function dispatch(type: string, target?: object, arg?: string, arg2?: string): void; | ||
|
||
export function getEvents(): string; | ||
|
||
export as namespace EventBus; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"private": true, | ||
"name": "@types/eventbusjs", | ||
"version": "0.2.9999", | ||
"projects": [ | ||
"https://github.com/krasimir/EventBus" | ||
], | ||
"devDependencies": { | ||
"@types/eventbusjs": "workspace:." | ||
}, | ||
"owners": [ | ||
{ | ||
"name": "long2014", | ||
"githubUsername": "Longqin88888" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "node16", | ||
"lib": [ | ||
"es6" | ||
], | ||
"noImplicitAny": true, | ||
"noImplicitThis": true, | ||
"strictNullChecks": true, | ||
"strictFunctionTypes": true, | ||
"types": [], | ||
"noEmit": true, | ||
"forceConsistentCasingInFileNames": true | ||
}, | ||
"files": [ | ||
"index.d.ts", | ||
"eventbusjs-tests.ts" | ||
] | ||
} |