mirror of
https://github.com/vuejs/vue.git
synced 2024-11-22 04:39:46 +00:00
dfc64e8a11
Add TypeScript definition Remove unnecessary definition Update definitions * separate files * remove unnecessary `{[key: string]: any}` * from singular to plural Update definitions * Add more definitions * Rename filename and interface * Sort definitions * Fix indent Fix Add test * add test * fix some definitions * fix typo Fix ComputedOptions Update Vue.set Update definitions Add npm script
66 lines
1.5 KiB
TypeScript
66 lines
1.5 KiB
TypeScript
import { Vue } from "./vue.d";
|
|
|
|
export type VNodeChildren = VNodeChildrenArrayContents | string;
|
|
export interface VNodeChildrenArrayContents {
|
|
[x: number]: VNode | string | VNodeChildren;
|
|
}
|
|
|
|
export interface VNode {
|
|
tag?: string;
|
|
data?: VNodeData;
|
|
children?: VNode[];
|
|
text?: string;
|
|
elm?: Node;
|
|
ns?: string;
|
|
context?: Vue;
|
|
key?: string | number;
|
|
componentOptions?: VNodeComponentOptions;
|
|
child?: Vue;
|
|
parent?: VNode;
|
|
raw?: boolean;
|
|
isStatic?: boolean;
|
|
isRootInsert: boolean;
|
|
isComment: boolean;
|
|
}
|
|
|
|
export interface VNodeComponentOptions {
|
|
Ctor: Vue;
|
|
propsData?: Object;
|
|
listeners?: Object;
|
|
children?: VNodeChildren;
|
|
tag?: string;
|
|
}
|
|
|
|
export interface VNodeData {
|
|
key?: string | number;
|
|
slot?: string;
|
|
ref?: string;
|
|
tag?: string;
|
|
staticClass?: string;
|
|
class?: any;
|
|
style?: Object[] | Object;
|
|
props?: { [key: string]: any };
|
|
attrs?: { [key: string]: any };
|
|
domProps?: { [key: string]: any };
|
|
hook?: { [key: string]: Function };
|
|
on?: { [key: string]: Function | Function[] };
|
|
nativeOn?: { [key: string]: Function | Function[] };
|
|
transition?: Object;
|
|
show?: boolean;
|
|
inlineTemplate?: {
|
|
render: Function;
|
|
staticRenderFns: Function[];
|
|
};
|
|
directives?: VNodeDirective[];
|
|
keepAlive?: boolean;
|
|
}
|
|
|
|
export interface VNodeDirective {
|
|
readonly name: string;
|
|
readonly value: any;
|
|
readonly oldValue: any;
|
|
readonly expression: any;
|
|
readonly arg: string;
|
|
readonly modifiers: { [key: string]: boolean };
|
|
}
|