[improvement] organize type definitions

This commit is contained in:
陈嘉涵
2019-05-13 19:07:04 +08:00
parent 96b1d8f81d
commit 7755b1738e
40 changed files with 111 additions and 121 deletions
+2 -8
View File
@@ -1,8 +1,5 @@
import Vue, { RenderContext, VNodeData } from 'vue';
type ObjectIndex = {
[key: string]: any;
};
import { ObjectIndex } from './types';
type Context = RenderContext & { data: VNodeData & ObjectIndex };
@@ -22,10 +19,7 @@ const inheritKey = [
const mapInheritKey: ObjectIndex = { nativeOn: 'on' };
// inherit partial context, map nativeOn to on
export function inherit(
context: Context,
inheritListeners?: boolean
): InheritContext {
export function inherit(context: Context, inheritListeners?: boolean): InheritContext {
const result = inheritKey.reduce(
(obj, key) => {
if (context.data[key]) {