Matheus Giovani 2 лет назад
Родитель
Сommit
b508f2f301

+ 0 - 2
.gitignore

@@ -8,8 +8,6 @@ node_modules
 yarn-error.log
 yarn.lock
 
-**/types
-
 # Logs
 logs
 *.log

+ 3 - 2
packages/compiler/.gitignore

@@ -1,2 +1,3 @@
-types/
-out/
+!src/types/
+/out/
+/types/

+ 3 - 2
packages/renderer/.gitignore

@@ -1,2 +1,3 @@
-./types/*
-out/
+!src/types/
+/out/
+/types/

+ 0 - 0
packages/renderer/src/types/pupper.d.ts → packages/renderer/src/typings/pupper.d.ts


+ 19 - 0
packages/renderer/src/typings/virtual-dom.d.ts

@@ -0,0 +1,19 @@
+namespace VirtualDOM {
+    interface VComment {
+        comment: string;
+        version: string;
+        type: string;
+    }
+
+    function isVComment(x: any): boolean;
+    
+    interface VCommentConstructor {
+        new (comment: string): VComment;
+    }
+
+    type VTree = VText | VComment | VNode | Widget | Thunk;
+
+    declare interface h {
+        c(comment: string): VComment;
+    }
+}

+ 10 - 0
packages/renderer/src/typings/virtual-dom/vcomment.d.ts

@@ -0,0 +1,10 @@
+declare module "virtual-dom/vnode/vcomment" {
+    import VCommentConstructor = VirtualDOM.VCommentConstructor;
+    const VComment: VCommentConstructor;
+    export = VComment;
+}
+
+declare module "virtual-dom/vnode/is-vcomment" {
+    import isVComment = VirtualDOM.isVComment;
+    export = isVComment;
+}

+ 1 - 1
packages/renderer/tsconfig.json

@@ -8,6 +8,6 @@
             "@/*": ["./*"]
         }
     },
-    "include": ["./src/*.ts", "./src/types/**/*.d.ts"],
+    "include": ["./src/*.ts", "src/typings/**/*.d.ts"],
     "exclude": ["node_modules"],
 }