UNPKG

2.1 kBTypeScriptView Raw
1import { Vue } from "./vue";
2
3export type ScopedSlot = (props: any) => ScopedSlotReturnValue;
4type ScopedSlotReturnValue = VNode | string | boolean | null | undefined | ScopedSlotReturnArray;
5interface ScopedSlotReturnArray extends Array<ScopedSlotReturnValue> {}
6
7// Scoped slots are guaranteed to return Array of VNodes starting in 2.6
8export type NormalizedScopedSlot = (props: any) => ScopedSlotChildren;
9export type ScopedSlotChildren = VNode[] | undefined;
10
11// Relaxed type compatible with $createElement
12export type VNodeChildren = VNodeChildrenArrayContents | [ScopedSlot] | string | boolean | null | undefined;
13export interface VNodeChildrenArrayContents extends Array<VNodeChildren | VNode> {}
14
15export interface VNode {
16 tag?: string;
17 data?: VNodeData;
18 children?: VNode[];
19 text?: string;
20 elm?: Node;
21 ns?: string;
22 context?: Vue;
23 key?: string | number;
24 componentOptions?: VNodeComponentOptions;
25 componentInstance?: Vue;
26 parent?: VNode;
27 raw?: boolean;
28 isStatic?: boolean;
29 isRootInsert: boolean;
30 isComment: boolean;
31}
32
33export interface VNodeComponentOptions {
34 Ctor: typeof Vue;
35 propsData?: object;
36 listeners?: object;
37 children?: VNode[];
38 tag?: string;
39}
40
41export interface VNodeData {
42 key?: string | number;
43 slot?: string;
44 scopedSlots?: { [key: string]: ScopedSlot | undefined };
45 ref?: string;
46 refInFor?: boolean;
47 tag?: string;
48 staticClass?: string;
49 class?: any;
50 staticStyle?: { [key: string]: any };
51 style?: object[] | object;
52 props?: { [key: string]: any };
53 attrs?: { [key: string]: any };
54 domProps?: { [key: string]: any };
55 hook?: { [key: string]: Function };
56 on?: { [key: string]: Function | Function[] };
57 nativeOn?: { [key: string]: Function | Function[] };
58 transition?: object;
59 show?: boolean;
60 inlineTemplate?: {
61 render: Function;
62 staticRenderFns: Function[];
63 };
64 directives?: VNodeDirective[];
65 keepAlive?: boolean;
66}
67
68export interface VNodeDirective {
69 name: string;
70 value?: any;
71 oldValue?: any;
72 expression?: any;
73 arg?: string;
74 oldArg?: string;
75 modifiers?: { [key: string]: boolean };
76}