@v1nt1248/3nclient-lib 0.1.24 → 0.1.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -30,7 +30,7 @@ import { default as Ui3nHtml } from './directives/ui3n-html';
30
30
  import { default as Ui3nClickOutside } from './directives/ui3n-click-outside';
31
31
  import { default as Ui3nResize } from './directives/ui3n-resize';
32
32
  import { default as Ui3nRipple } from './directives/ui3n-ripple';
33
- import { CbFunction, VueEventBus } from './plugins/vue-bus/types';
33
+ import { VueEventBus } from './plugins/vue-bus/types';
34
34
  import { DialogInstance } from './plugins/dialogs/types';
35
35
  export * from './constants';
36
36
  export * from './utils';
@@ -46,7 +46,7 @@ declare module 'vue' {
46
46
  $locale: string;
47
47
  $tr: (key: string, placeholders?: Record<string, string>) => string;
48
48
  $changeLocale: (lang: string) => void;
49
- $emitter: VueEventBus;
49
+ $emitter: VueEventBus<any>;
50
50
  }
51
51
  interface GlobalComponents {
52
52
  Ui3nBadge: typeof Ui3nBadge;
@@ -86,13 +86,7 @@ declare module 'pinia' {
86
86
  interface PiniaCustomProperties {
87
87
  $openDialog: <T extends Component, P extends Record<string, unknown>>(params: Ui3nDialogComponentProps<T, P>) => DialogInstance | undefined;
88
88
  $createNotice: (params: Ui3nNotificationProps) => void;
89
- $emitter: {
90
- on: (type: string | symbol, handler: CbFunction) => void;
91
- off: (type: string | symbol, handler?: CbFunction) => void;
92
- emit: (type: string | symbol, arguments?: any) => void;
93
- once: (type: string | symbol, handler: CbFunction) => void;
94
- clear: () => void;
95
- };
89
+ $emitter: VueEventBus<any>;
96
90
  $i18n: {
97
91
  locale: string;
98
92
  changeLocale: (lang: string) => void;
@@ -1,4 +1,4 @@
1
1
  import { VueEventBus } from './types';
2
2
  export declare function storeVueBus(context: any): {
3
- $emitter: VueEventBus;
3
+ $emitter: VueEventBus<any>;
4
4
  };
@@ -1,13 +1,13 @@
1
1
  import { InjectionKey } from 'vue';
2
- export type CbFunction = (...args: any[]) => void;
3
- export interface VueEventBus {
4
- on: (type: string | symbol, handler: CbFunction) => void;
5
- off: (type: string | symbol, handler?: CbFunction) => void;
6
- emit: (type: string | symbol, arg?: any) => void;
7
- once: (type: string | symbol, handler: CbFunction) => void;
2
+ export type CbFunction<T> = (arg: T) => void;
3
+ export interface VueEventBus<T extends object> {
4
+ on: <Ev extends keyof T>(type: Ev, handler: CbFunction<T[Ev]>) => void;
5
+ off: <Ev extends keyof T>(type: Ev, handler?: CbFunction<T[Ev]>) => void;
6
+ emit: <Ev extends keyof T>(type: Ev, arg: T[Ev]) => void;
7
+ once: <Ev extends keyof T>(type: Ev, handler: CbFunction<T[Ev]>) => void;
8
8
  clear: () => void;
9
9
  }
10
- export interface VueBusPlugin {
11
- $emitter: VueEventBus;
10
+ export interface VueBusPlugin<T extends object> {
11
+ $emitter: VueEventBus<T>;
12
12
  }
13
- export declare const VUEBUS_KEY: InjectionKey<VueBusPlugin>;
13
+ export declare const VUEBUS_KEY: InjectionKey<VueBusPlugin<any>>;
@@ -1,14 +1,8 @@
1
1
  import { Plugin } from 'vue';
2
- import { CbFunction } from './types';
2
+ import { VueEventBus } from './types';
3
3
  export declare const vueBus: Plugin;
4
4
  declare module '@vue/runtime-core' {
5
5
  interface ComponentCustomProperties {
6
- $emitter: {
7
- on: (type: string | symbol, handler: CbFunction) => void;
8
- off: (type: string | symbol, handler?: CbFunction) => void;
9
- emit: (type: string | symbol, arg?: any) => void;
10
- once: (type: string | symbol, handler: CbFunction) => void;
11
- clear: () => void;
12
- };
6
+ $emitter: VueEventBus<any>;
13
7
  }
14
8
  }
@@ -21,20 +21,14 @@ declare module 'vue' {
21
21
  $locale: string;
22
22
  $tr: (key: string, placeholders?: Record<string, string>) => string;
23
23
  $changeLocale: (lang: string) => void;
24
- $emitter: VueEventBus;
24
+ $emitter: VueEventBus<any>;
25
25
  }
26
26
  }
27
27
  declare module 'pinia' {
28
28
  interface PiniaCustomProperties {
29
29
  $openDialog: <T extends Component, P extends Record<string, unknown>>(params: Ui3nDialogComponentProps<T, P>) => DialogInstance | undefined;
30
30
  $createNotice: (params: Ui3nNotificationProps) => void;
31
- $emitter: {
32
- on: (type: string | symbol, handler: CbFunction) => void;
33
- off: (type: string | symbol, handler?: CbFunction) => void;
34
- emit: (type: string | symbol, arguments?: any) => void;
35
- once: (type: string | symbol, handler: CbFunction) => void;
36
- clear: () => void;
37
- };
31
+ $emitter: VueEventBus<any>;
38
32
  $i18n: {
39
33
  locale: string;
40
34
  changeLocale: (lang: string) => void;
@@ -8,6 +8,8 @@
8
8
  --spacing-xxl: 48px;
9
9
  --white-0: #fff;
10
10
  --white-inf: rgba(255, 255, 255, 0);
11
+ --black-0: #000;
12
+ --black-inf: rgba(0, 0, 0, 0);
11
13
  --red-0: #feeeed;
12
14
  --red-5: #fcd9d6;
13
15
  --red-10: #fbc3bf;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@v1nt1248/3nclient-lib",
3
3
  "license": "AGPL-3.0-or-later",
4
4
  "author": "v1nt1248",
5
- "version": "0.1.24",
5
+ "version": "0.1.26",
6
6
  "description": "Library for 3NWeb clients",
7
7
  "type": "module",
8
8
  "files": [