@omnia/fx
Version:
Provide Omnia Fx typings and tooling for clientside Omnia development.
31 lines (30 loc) • 3.05 kB
TypeScript
import { ComponentOptions, VueConstructor, VNode, SetupContext } from "vue";
import { ComponentPublicInstance, ShallowUnwrapRef } from "vue";
import { WebComponentBundleManifest } from "@omnia/fx-models";
import { RecordPropsDefinition } from "vue/types/options";
import { PropsForOutside, RequiredPropNames, _TsxComponentInstanceV3, _TsxComponentV3 } from "vue-tsx-support/lib/api";
import { InnerScopedSlots } from "vue-tsx-support";
import { TsxComponentTypeInfo } from "vue-tsx-support/types/base";
export type SetupContextExtend<PrefixedEvents = unknown, ScopedSlots = unknown, On = unknown> = SetupContext & {
slots: InnerScopedSlots<ScopedSlots>;
_tsx?: TsxComponentTypeInfo<{}, {}, PrefixedEvents, On>;
refs: {
[key: string]: Vue | Element | Vue[] | Element[];
};
readonly parent: Vue | null;
};
export type CompositionComponentOptions<Props, PropsDef extends RecordPropsDefinition<Props>, PrefixedEvents, ScopedSlots, On> = {
props?: PropsDef & RecordPropsDefinition<Props>;
setup: (this: void, props: Props, ctx: SetupContextExtend<PrefixedEvents, ScopedSlots, On>) => () => VNode | JSX.Element;
} & Pick<ComponentOptions<Vue>, "name" | "components" | "inheritAttrs" | "directives" | "filters">;
export type CompositionComponentOptionsWithRender<Props, PropsDef extends RecordPropsDefinition<Props>, PrefixedEvents, ScopedSlots, On, RawBinding> = {
props?: PropsDef & RecordPropsDefinition<Props>;
setup: (this: void, props: Props, ctx: SetupContextExtend<PrefixedEvents, ScopedSlots, On>) => RawBinding;
render(): VNode | JSX.Element;
} & Pick<ComponentOptions<Vue>, "name" | "components" | "inheritAttrs" | "directives" | "filters"> & ThisType<ComponentPublicInstance<Props, RawBinding>>;
type _OmniaTsxComponentV3<V extends Vue, Attributes, Props, PrefixedEvents, On, ScopedSlotArgs> = VueConstructor<_TsxComponentInstanceV3<V, Attributes, Props, PrefixedEvents, On, ScopedSlotArgs>> & {
propsDefinition: Props;
};
export declare function defineVueWebComponent<Props, PropsDef extends RecordPropsDefinition<Props> = RecordPropsDefinition<Props>, PrefixedEvents = any, ScopedSlots = any, On = any, RawBinding = any, RequiredProps extends keyof Props = RequiredPropNames<PropsDef> & keyof Props>(options: CompositionComponentOptions<Props, PropsDef, PrefixedEvents, ScopedSlots, On> | CompositionComponentOptionsWithRender<Props, PropsDef, PrefixedEvents, ScopedSlots, On, RawBinding>, register?: (manifest: WebComponentBundleManifest, component: _TsxComponentV3<Vue, {}, PropsForOutside<Props, RequiredProps>, PrefixedEvents, On, ScopedSlots>) => void): _OmniaTsxComponentV3<Vue, {}, PropsForOutside<Props, RequiredProps>, PrefixedEvents, On, ScopedSlots> | _OmniaTsxComponentV3<Vue & ShallowUnwrapRef<RawBinding>, {}, PropsForOutside<Props, RequiredProps>, PrefixedEvents, On, ScopedSlots>;
export declare function internaldefineVueWebComponent(omniaServiceId: any, manifestId: any, options: any, register?: (manifest: WebComponentBundleManifest, component: any) => void): any;
export {};