Added var-persist
This commit is contained in:
parent
8094b6507f
commit
91c0858d9f
1655
package-lock.json
generated
1655
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@ztimson/utils",
|
"name": "@ztimson/utils",
|
||||||
"version": "0.16.10",
|
"version": "0.17.0",
|
||||||
"description": "Utility library",
|
"description": "Utility library",
|
||||||
"author": "Zak Timson",
|
"author": "Zak Timson",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@ -39,5 +39,8 @@
|
|||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"dist"
|
"dist"
|
||||||
]
|
],
|
||||||
|
"dependencies": {
|
||||||
|
"var-persist": "^1.0.1"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
export type Listener = (...args: any[]) => any;
|
export type Listener = (...args: any[]) => any;
|
||||||
export type TypedEvents = {[k in string | symbol]: Listener} & {'*': (event: string, ...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> {
|
export class TypedEmitter<T extends TypedEvents = TypedEvents> {
|
||||||
private static listeners: {[key: string]: Listener[]} = {};
|
private static listeners: {[key: string]: Listener[]} = {};
|
||||||
|
|
||||||
|
@ -15,3 +15,4 @@ export * from './promise-progress';
|
|||||||
export * from './string';
|
export * from './string';
|
||||||
export * from './time';
|
export * from './time';
|
||||||
export * from './types';
|
export * from './types';
|
||||||
|
export * from 'var-persist';
|
||||||
|
Loading…
Reference in New Issue
Block a user