2024-05-16 10:50:43 +00:00
|
|
|
import { AllowedComponentProps, ComponentCustomProps, MethodOptions, ObjectEmitsOptions, SlotsType, VNode, VNodeProps, DefineComponent as _DefineComponent } from 'vue';
|
2022-09-06 12:03:37 +00:00
|
|
|
|
|
|
|
declare type PublicProps = VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
|
|
|
2022-09-14 11:26:01 +00:00
|
|
|
declare type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
|
|
|
|
2024-05-16 10:50:43 +00:00
|
|
|
export declare type EmitFn<Options = ObjectEmitsOptions, Event extends keyof Options = keyof Options> = Options extends Array<infer V>
|
|
|
|
? (e: V, ...args: any[]) => void
|
2022-09-14 11:26:01 +00:00
|
|
|
: {} extends Options
|
2024-05-16 10:50:43 +00:00
|
|
|
? (e: string, ...args: any[]) => void
|
2022-09-14 11:26:01 +00:00
|
|
|
: UnionToIntersection<
|
|
|
|
{
|
2024-05-16 10:50:43 +00:00
|
|
|
[key in Event]: Options[key] extends (...args: infer Args) => any ? (e: key, ...args: Args) => void : (e: key, ...args: any[]) => void;
|
2022-09-14 11:26:01 +00:00
|
|
|
}[Event]
|
|
|
|
>;
|
2022-09-06 12:03:37 +00:00
|
|
|
|
2024-05-16 10:50:43 +00:00
|
|
|
export type DefineComponent<P = {}, S = {}, E = {}, M = {}> = _DefineComponent<P, {}, {}, {}, M & MethodOptions, {}, {}, E & ObjectEmitsOptions, string, {}, {}, {}, S & SlotsType>;
|
2022-09-06 12:03:37 +00:00
|
|
|
|
2024-05-16 10:50:43 +00:00
|
|
|
export type GlobalComponentConstructor<P = {}, S = {}, E = {}, M = {}> = {
|
|
|
|
new (): {
|
|
|
|
$props: P & PublicProps;
|
|
|
|
$slots: S;
|
|
|
|
$emit: E;
|
|
|
|
} & M;
|
2022-09-14 11:26:01 +00:00
|
|
|
};
|
2022-09-06 12:03:37 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Custom types
|
|
|
|
*/
|
|
|
|
export declare type Booleanish = boolean | 'true' | 'false';
|
|
|
|
|
|
|
|
export declare type Numberish = number | string;
|
|
|
|
|
|
|
|
export declare type Nullable<T = void> = T | null | undefined;
|
2023-05-10 11:49:54 +00:00
|
|
|
|
2023-09-05 11:28:04 +00:00
|
|
|
export declare type PassThrough<T = void> = T | object | undefined;
|
2023-08-17 23:51:01 +00:00
|
|
|
|
2024-04-02 08:24:31 +00:00
|
|
|
export declare type DesignToken<T = void> = T | object | undefined;
|
|
|
|
|
2023-09-05 11:28:04 +00:00
|
|
|
export declare type DefaultPassThrough<T = void> = T | ((instance?: VNode) => T | undefined) | undefined;
|
2024-02-23 08:38:50 +00:00
|
|
|
|
2024-02-23 08:39:54 +00:00
|
|
|
export declare type HintedString<T extends string> = (string & {}) | T;
|