@fastkit/ev
Advanced tools
Comparing version 0.12.8 to 0.12.9
100
dist/ev.d.ts
/** | ||
* Any tag can be set for the listener. (Registration of objects as well as character strings is also possible) | ||
* By setting this tag when registering a listener with [[EV.on]] or [[EV.once]] | ||
* With [[EV.off]] you can release related listeners at once. | ||
*/ | ||
type EVListenerTag = number | string | symbol | object; | ||
type EVStackRemover = (stack: EVListener) => void; | ||
declare class EVListener { | ||
readonly context: EV; | ||
readonly type: string | null | undefined; | ||
readonly tag?: EVListenerTag; | ||
readonly handler: Function; | ||
readonly once: boolean; | ||
constructor({ context, remover, type, tag, handler, once, }: { | ||
context: EV; | ||
remover: EVStackRemover; | ||
type: string; | ||
tag?: EVListenerTag; | ||
handler: Function; | ||
once: boolean; | ||
}); | ||
/** | ||
* Remove this instance from parent context. | ||
*/ | ||
remove(): void; | ||
/** | ||
* Check match condition by type or handler or tag. | ||
* @param type - event type | ||
* @param handler - event handler | ||
* @param tag - event tag | ||
*/ | ||
match(type?: string | null, handler?: Function, tag?: EVListenerTag): boolean; | ||
/** | ||
* Trigger this listener. | ||
*/ | ||
trigger(params?: any): void; | ||
/** | ||
* @private | ||
*/ | ||
_remover: EVStackRemover; | ||
} | ||
/** | ||
* This is the default event map. | ||
*/ | ||
interface EVEventMap { | ||
[key: string]: any; | ||
} | ||
/** | ||
* The context class for event operations. | ||
@@ -27,3 +75,3 @@ * You can use as it is or inherit any classes in this class. | ||
*/ | ||
export declare class EV<EventMap extends EVEventMap = EVEventMap> { | ||
declare class EV<EventMap extends EVEventMap = EVEventMap> { | ||
/** | ||
@@ -180,50 +228,2 @@ * Create and return listener instance by type, handler. | ||
/** | ||
* This is the default event map. | ||
*/ | ||
export declare interface EVEventMap { | ||
[key: string]: any; | ||
} | ||
declare class EVListener { | ||
readonly context: EV; | ||
readonly type: string | null | undefined; | ||
readonly tag?: EVListenerTag; | ||
readonly handler: Function; | ||
readonly once: boolean; | ||
constructor({ context, remover, type, tag, handler, once, }: { | ||
context: EV; | ||
remover: EVStackRemover; | ||
type: string; | ||
tag?: EVListenerTag; | ||
handler: Function; | ||
once: boolean; | ||
}); | ||
/** | ||
* Remove this instance from parent context. | ||
*/ | ||
remove(): void; | ||
/** | ||
* Check match condition by type or handler or tag. | ||
* @param type - event type | ||
* @param handler - event handler | ||
* @param tag - event tag | ||
*/ | ||
match(type?: string | null, handler?: Function, tag?: EVListenerTag): boolean; | ||
/** | ||
* Trigger this listener. | ||
*/ | ||
trigger(params?: any): void; | ||
private _remover; | ||
} | ||
/** | ||
* Any tag can be set for the listener. (Registration of objects as well as character strings is also possible) | ||
* By setting this tag when registering a listener with [[EV.on]] or [[EV.once]] | ||
* With [[EV.off]] you can release related listeners at once. | ||
*/ | ||
declare type EVListenerTag = number | string | symbol | object; | ||
declare type EVStackRemover = (stack: EVListener) => void; | ||
export { } | ||
export { EV, EVEventMap }; |
{ | ||
"name": "@fastkit/ev", | ||
"version": "0.12.8", | ||
"version": "0.12.9", | ||
"description": "@fastkit/ev", | ||
"keywords": [ | ||
"fastkit", | ||
"event" | ||
], | ||
"homepage": "https://github.com/dadajam4/fastkit/tree/main/packages/ev#readme", | ||
"bugs": { | ||
"url": "https://github.com/dadajam4/fastkit/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/dadajam4/fastkit.git" | ||
}, | ||
"license": "MIT", | ||
"author": "dadajam4", | ||
"type": "module", | ||
"exports": { | ||
"./package.json": "./package.json", | ||
".": { | ||
"types": "./dist/ev.d.ts", | ||
"import": { | ||
"default": "./dist/ev.mjs" | ||
} | ||
}, | ||
"./*": "./dist/*" | ||
}, | ||
"main": "./dist/ev.mjs", | ||
"types": "./dist/ev.d.ts", | ||
"typesVersions": { | ||
"*": { | ||
".": [ | ||
"./dist/ev.d.ts" | ||
] | ||
} | ||
}, | ||
"files": [ | ||
"dist" | ||
], | ||
"buildOptions": { | ||
@@ -16,26 +53,13 @@ "name": "EV" | ||
}, | ||
"main": "./dist/ev.mjs", | ||
"exports": { | ||
".": "./dist/ev.mjs", | ||
"./dist/*": "./dist/*", | ||
"./package.json": "./package.json" | ||
}, | ||
"files": [ | ||
"dist" | ||
], | ||
"types": "dist/ev.d.ts", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/dadajam4/fastkit.git" | ||
}, | ||
"keywords": [ | ||
"fastkit", | ||
"event" | ||
], | ||
"author": "dadajam4", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/dadajam4/fastkit/issues" | ||
}, | ||
"homepage": "https://github.com/dadajam4/fastkit/tree/main/packages/ev#readme" | ||
} | ||
"scripts": { | ||
"build": "plugboy build", | ||
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist", | ||
"eslint": "eslint . --ext ts,tsx,js,vue,html,yaml", | ||
"eslint:fix": "eslint . --ext ts,tsx,js,vue,html,yaml --fix", | ||
"format": "pnpm run eslint:fix", | ||
"lint": "pnpm run eslint", | ||
"stub": "plugboy stub", | ||
"test": "vitest run", | ||
"typecheck": "tsc --noEmit" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34415
7
585
Yes