@v1nt1248/3nclient-lib 0.3.6 → 0.3.8

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.
@@ -1,6 +1,7 @@
1
1
  import { VNode } from 'vue';
2
2
  import { Ui3nIconField } from '../../types';
3
- export type Ui3nDialogEvent = 'close' | 'confirm' | 'cancel' | 'click-overlay';
3
+ export type Ui3nDialogEventBase = 'close' | 'confirm' | 'cancel' | 'click-overlay';
4
+ export type Ui3nDialogEvent<E extends string = never> = Ui3nDialogEventBase | E;
4
5
  export interface Ui3nDialogComponentProps<V> {
5
6
  id?: string;
6
7
  title?: string;
@@ -25,9 +26,9 @@ export interface Ui3nDialogComponentProps<V> {
25
26
  data?: V;
26
27
  isValid?: boolean;
27
28
  }
28
- export interface Ui3nDialogComponentEmits<V> {
29
+ export interface Ui3nDialogComponentEmits<V, E extends string = never> {
29
30
  (event: 'action', value: {
30
- event: Ui3nDialogEvent;
31
+ event: Ui3nDialogEvent<E>;
31
32
  data?: V;
32
33
  }): void;
33
34
  }
@@ -1,4 +1,4 @@
1
- declare const _default: <V extends any>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
1
+ declare const _default: <V extends any, E extends string = never>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
2
2
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, never> & {} & Partial<{}>> & import('vue').PublicProps;
3
3
  expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
4
4
  attrs: any;
@@ -1,15 +1,15 @@
1
1
  import { Ui3nDialogComponentProps, Ui3nDialogComponentEmits, Ui3nDialogComponentSlots } from './types';
2
- declare const _default: <V extends any>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
2
+ declare const _default: <V extends any, E extends string = never>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
3
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
4
4
  readonly onAction?: ((value: {
5
- event: import('./types').Ui3nDialogEvent;
5
+ event: import('./types').Ui3nDialogEvent<E>;
6
6
  data?: V | undefined;
7
7
  }) => any) | undefined;
8
8
  } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onAction"> & Ui3nDialogComponentProps<V> & Partial<{}>> & import('vue').PublicProps;
9
9
  expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
10
10
  attrs: any;
11
11
  slots: Readonly<Ui3nDialogComponentSlots> & Ui3nDialogComponentSlots;
12
- emit: Ui3nDialogComponentEmits<V>;
12
+ emit: Ui3nDialogComponentEmits<V, E>;
13
13
  }>) => import('vue').VNode & {
14
14
  __ctx?: Awaited<typeof __VLS_setup>;
15
15
  };
@@ -9,12 +9,12 @@ export default _default;
9
9
  declare module '@vue/runtime-core' {
10
10
  interface ComponentCustomProperties {
11
11
  dialogStack: Ref<DialogOptions<any>[]>;
12
- $openDialog: <V>(component: Component, props: ExtractComponentProps<Component>) => Promise<{
13
- event: Ui3nDialogEvent;
12
+ $openDialog: <V, E extends string = never>(component: Component, props: ExtractComponentProps<Component>) => Promise<{
13
+ event: Ui3nDialogEvent<E>;
14
14
  data?: V;
15
15
  }>;
16
- $closeDialog: <V>(id: string, value: {
17
- event: Ui3nDialogEvent;
16
+ $closeDialog: <V, E extends string = never>(id: string, value: {
17
+ event: Ui3nDialogEvent<E>;
18
18
  data?: V;
19
19
  }) => void;
20
20
  $closeDialogs: () => void;
@@ -4,12 +4,12 @@ import { Ui3nDialogEvent } from '../../components/ui3n-dialog/types';
4
4
  import { DialogOptions } from './types';
5
5
  export declare function storeDialogs(context: any): {
6
6
  $dialogs: {
7
- open: <V>(component: Component, props: ExtractComponentProps<Component>) => Promise<{
8
- event: Ui3nDialogEvent;
7
+ open: <V, E extends string = never>(component: Component, props: ExtractComponentProps<Component>) => Promise<{
8
+ event: Ui3nDialogEvent<E>;
9
9
  data?: V;
10
10
  }>;
11
- close: <V>(id: string, value: {
12
- event: Ui3nDialogEvent;
11
+ close: <V, E extends string = never>(id: string, value: {
12
+ event: Ui3nDialogEvent<E>;
13
13
  data?: V;
14
14
  }) => void;
15
15
  closeAll: () => void;
@@ -1,24 +1,24 @@
1
1
  import { Component, Ref } from 'vue';
2
2
  import { ExtractComponentProps } from '../../types';
3
3
  import { Ui3nDialogEvent } from '../../components/ui3n-dialog/types';
4
- export interface DialogOptions<V> {
4
+ export interface DialogOptions<V, E extends string = never> {
5
5
  id: string;
6
6
  component: Component;
7
7
  props: ExtractComponentProps<Component>;
8
8
  resolve: (value: {
9
- event: Ui3nDialogEvent;
9
+ event: Ui3nDialogEvent<E>;
10
10
  data?: V;
11
11
  }) => void;
12
12
  }
13
13
  export interface DialogsPlugin {
14
- $openDialog: <V>(component: Component, props: ExtractComponentProps<Component>) => Promise<{
15
- event: Ui3nDialogEvent;
14
+ $openDialog: <V, E extends string = never>(component: Component, props: ExtractComponentProps<Component>) => Promise<{
15
+ event: Ui3nDialogEvent<E>;
16
16
  data?: V;
17
17
  }>;
18
- $closeDialog: <V>(id: string, value: {
19
- event: Ui3nDialogEvent;
18
+ $closeDialog: <V, E extends string = never>(id: string, value: {
19
+ event: Ui3nDialogEvent<E>;
20
20
  data?: V;
21
21
  }) => void;
22
22
  $closeDialogs: () => void;
23
- dialogStack: Ref<DialogOptions<any>[]>;
23
+ dialogStack: Ref<DialogOptions<any, ''>[]>;
24
24
  }