@signal24/vue-foundation 4.30.7 → 4.30.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,53 +1,45 @@
1
- import type { Writable } from 'type-fest';
2
- import { type AllowedComponentProps, type ComponentInternalInstance, type ComponentPublicInstance, type ComputedOptions, type MethodOptions, type Raw, type VNode, type VNodeProps } from 'vue';
1
+ import { type AllowedComponentProps, type Component, type ComponentCustomProps, type ComponentInternalInstance, type Raw, type VNode, type VNodeProps } from 'vue';
3
2
  import type { OverlayAnchorOptions } from './overlay-types';
4
- interface OverlayOptions<C extends OverlayComponent, R extends ComponentReturn<C>> {
3
+ interface OverlayOptions<C extends Component, R extends ComponentReturn<C>> {
5
4
  anchor?: OverlayAnchorOptions;
6
5
  onCallback?: (result: R) => void | Promise<boolean>;
7
6
  }
8
- export interface OverlayInjection<C extends OverlayComponent, R extends ComponentReturn<C>> {
7
+ export interface OverlayInjection<C extends Component> {
9
8
  id: string;
10
- component: OverlayComponentUnwrapped<C>;
11
- props: OverlayComponentProps<C>;
12
- options: OverlayOptions<C, R>;
9
+ component: Raw<C>;
10
+ props: {
11
+ callback?: () => void;
12
+ } & OverlayComponentProps<C>;
13
+ options: OverlayOptions<C, any>;
13
14
  vnode: VNode;
14
15
  wrapperVnode?: VNode;
15
16
  }
16
17
  export declare const OverlayContainer: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
17
18
  [key: string]: any;
18
19
  }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
19
- export type Vue__ComponentPublicInstanceConstructor<T extends ComponentPublicInstance<Props, RawBindings, D, C, M> = ComponentPublicInstance<any>, Props = any, RawBindings = any, D = any, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions> = {
20
- __isFragment?: never;
21
- __isTeleport?: never;
22
- __isSuspense?: never;
23
- new (...args: any[]): T;
24
- };
25
- export type ObjectComponentConfig<T extends Vue__ComponentPublicInstanceConstructor> = T extends Vue__ComponentPublicInstanceConstructor<infer P> ? P : never;
26
- export type ObjectComponentProps<T extends Vue__ComponentPublicInstanceConstructor> = Writable<Omit<ObjectComponentConfig<T>['$props'], keyof VNodeProps | keyof AllowedComponentProps>>;
27
- type ObjectOrDefault<T> = T extends object ? T : PropsWithCallback<{}>;
28
- export type OverlayComponent = Vue__ComponentPublicInstanceConstructor | ((props: any) => any);
29
- export type OverlayComponentConfig<T> = T extends Vue__ComponentPublicInstanceConstructor ? {
30
- props: ObjectComponentProps<T>;
31
- component: Raw<T>;
32
- } : T extends (props: infer P) => any ? {
33
- props: Omit<ObjectOrDefault<P>, keyof VNodeProps | keyof AllowedComponentProps>;
34
- component: T;
35
- } : never;
36
- export type OverlayComponentUnwrapped<T extends OverlayComponent> = OverlayComponentConfig<T>['component'];
37
- export type OverlayComponentProps<T extends OverlayComponent> = OverlayComponentConfig<T>['props'];
38
- interface PropsWithCallback<T> {
39
- callback?: (result: T) => void;
40
- }
41
- type ComponentReturn<M extends OverlayComponent> = OverlayComponentProps<M> extends PropsWithCallback<infer R> ? R : never;
42
20
  export type AnyComponentPublicInstance = {
43
21
  $?: ComponentInternalInstance;
44
22
  };
45
- export declare function createOverlayInjection<C extends OverlayComponent, R extends ComponentReturn<C>>(component: C, props: OverlayComponentProps<C>, options?: OverlayOptions<C, R>): OverlayInjection<C, R>;
23
+ type ExtractComponentProps<C> = C extends new (...args: any) => any ? InstanceType<C>['$props'] : C extends (props: infer P, ...args: any) => any ? P : C extends {
24
+ __props?: infer P;
25
+ } ? P : never;
26
+ type CleanProps<P> = {
27
+ [K in keyof P as K extends keyof (VNodeProps & AllowedComponentProps & ComponentCustomProps) ? never : string extends K ? never : K]: P[K];
28
+ };
29
+ type HasCallbackProp<C> = CleanProps<ExtractComponentProps<C>> extends {
30
+ callback: (result: any) => void;
31
+ } ? true : false;
32
+ type OverlayComponent<C extends Component> = HasCallbackProp<C> extends true ? C : never;
33
+ type ComponentReturn<C> = CleanProps<ExtractComponentProps<C>> extends {
34
+ callback: (result: infer R) => void;
35
+ } ? R : never;
36
+ type OverlayComponentProps<C> = CleanProps<ExtractComponentProps<C>>;
37
+ export declare function createOverlayInjection<C extends Component, R extends ComponentReturn<C>>(component: OverlayComponent<C>, props: OverlayComponentProps<C>, options?: OverlayOptions<C, R>): OverlayInjection<C>;
46
38
  export declare function dismissOverlayInjectionByInstance(instance: AnyComponentPublicInstance): void;
47
39
  export declare function dismissOverlayInjectionByInternalInstance(instance: ComponentInternalInstance): void;
48
40
  export declare function dismissOverlayInjectionByVnode(vnode: VNode): boolean;
49
41
  export declare function dismissOverlayInjectionById(id: string): boolean;
50
- export declare function removeOverlayInjection(injection: OverlayInjection<any, any>): void;
51
- export declare function presentOverlay<C extends OverlayComponent, R extends ComponentReturn<C>>(component: C, props: Omit<OverlayComponentProps<C>, 'callback'>, options?: OverlayOptions<C, R>): Promise<R | undefined>;
52
- export declare function updateOverlayProps<C extends OverlayComponent>(injection: OverlayInjection<C, any>, props: Partial<Omit<OverlayComponentProps<C>, 'callback'>>): Promise<void>;
42
+ export declare function removeOverlayInjection(injection: OverlayInjection<any>): void;
43
+ export declare function presentOverlay<C extends Component, R extends ComponentReturn<C>>(component: OverlayComponent<C>, props: Omit<OverlayComponentProps<C>, 'callback'>, options?: OverlayOptions<C, R>): Promise<R | undefined>;
44
+ export declare function updateOverlayProps<C extends Component>(injection: OverlayInjection<C>, props: Partial<Omit<OverlayComponentProps<C>, 'callback'>>): Promise<void>;
53
45
  export {};