Added var-persist
All checks were successful
Build / Build NPM Project (push) Successful in 28s
Build / Tag Version (push) Successful in 6s

This commit is contained in:
Zakary Timson 2024-09-30 21:43:13 -04:00
parent 8094b6507f
commit 91c0858d9f
4 changed files with 5776 additions and 5595 deletions

11359
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "@ztimson/utils",
"version": "0.16.10",
"version": "0.17.0",
"description": "Utility library",
"author": "Zak Timson",
"license": "MIT",
@ -39,5 +39,8 @@
},
"files": [
"dist"
]
],
"dependencies": {
"var-persist": "^1.0.1"
}
}

View File

@ -1,6 +1,10 @@
export type Listener = (...args: any[]) => any;
export type TypedEvents = {[k in string | symbol]: Listener} & {'*': (event: string, ...args: any[]) => any};
export type NamespaceEvents<Namespace extends string, Events extends TypedEvents> = {
[K in keyof Events as `${Namespace}:${Extract<K, string>}`]: Events[K];
};
export class TypedEmitter<T extends TypedEvents = TypedEvents> {
private static listeners: {[key: string]: Listener[]} = {};

View File

@ -15,3 +15,4 @@ export * from './promise-progress';
export * from './string';
export * from './time';
export * from './types';
export * from 'var-persist';