From 93bdc8a8a13e62547d2182ea833f6e2ecb896af9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Loi=CC=88c=20Correnson?= <loic.correnson@cea.fr>
Date: Mon, 6 Jul 2020 18:37:20 +0200
Subject: [PATCH] [ivette] generate documentation for API

---
 ivette/api/dive/index.ts              |  2 +-
 ivette/api/kernel/ast/index.ts        |  2 +-
 ivette/api/kernel/data/index.ts       | 16 ++++++++--------
 ivette/api/kernel/project/index.ts    |  2 +-
 ivette/api/kernel/properties/index.ts |  2 +-
 ivette/api/kernel/services/index.ts   |  2 +-
 ivette/api/server_tsc.ml              |  6 +++---
 ivette/tsconfig.json                  |  4 ++--
 8 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/ivette/api/dive/index.ts b/ivette/api/dive/index.ts
index a6bfaf5c218..d7e56288870 100644
--- a/ivette/api/dive/index.ts
+++ b/ivette/api/dive/index.ts
@@ -3,7 +3,7 @@
 /**
    Dive Services
    @packageDocumentation
-   @module frama-c/dive
+   @module api/dive
 */
 
 //@ts-ignore
diff --git a/ivette/api/kernel/ast/index.ts b/ivette/api/kernel/ast/index.ts
index a7c5a9921cb..decd0bc05e0 100644
--- a/ivette/api/kernel/ast/index.ts
+++ b/ivette/api/kernel/ast/index.ts
@@ -3,7 +3,7 @@
 /**
    Ast Services
    @packageDocumentation
-   @module frama-c/kernel/ast
+   @module api/kernel/ast
 */
 
 //@ts-ignore
diff --git a/ivette/api/kernel/data/index.ts b/ivette/api/kernel/data/index.ts
index 0199b1c0fef..ffd93535e84 100644
--- a/ivette/api/kernel/data/index.ts
+++ b/ivette/api/kernel/data/index.ts
@@ -3,7 +3,7 @@
 /**
    Informations
    @packageDocumentation
-   @module frama-c/kernel/data
+   @module api/kernel/data
 */
 
 //@ts-ignore
@@ -34,19 +34,19 @@ export type text = null | string | text[];
 
 /** Loose decoder for `text` */
 export const jText: Json.Loose<text> =
-  (_x) => Json.jUnion<null | string | text[]>(
-            Json.jNull,
-            Json.jString,
-            Json.jList(jText),
-          )(_x);
+  (_x: any) => Json.jUnion<null | string | text[]>(
+                 Json.jNull,
+                 Json.jString,
+                 Json.jList(jText),
+               )(_x);
 
 /** Safe decoder for `text` */
 export const jTextSafe: Json.Safe<text> =
-  (_x) => Json.jFail(jText,'Text expected')(_x);
+  (_x: any) => Json.jFail(jText,'Text expected')(_x);
 
 /** Natural order for `text` */
 export const byText: Compare.Order<text> =
-  (_x,_y) => Compare.structural(_x,_y);
+  (_x: any, _y: any) => Compare.structural(_x,_y);
 
 /** Enum Tag Description */
 export type tag = { name: string, label: markdown, descr: markdown };
diff --git a/ivette/api/kernel/project/index.ts b/ivette/api/kernel/project/index.ts
index ec7ea0fb8f1..e77efa142f1 100644
--- a/ivette/api/kernel/project/index.ts
+++ b/ivette/api/kernel/project/index.ts
@@ -3,7 +3,7 @@
 /**
    Project Management
    @packageDocumentation
-   @module frama-c/kernel/project
+   @module api/kernel/project
 */
 
 //@ts-ignore
diff --git a/ivette/api/kernel/properties/index.ts b/ivette/api/kernel/properties/index.ts
index 3e336583d5a..0d415ee563d 100644
--- a/ivette/api/kernel/properties/index.ts
+++ b/ivette/api/kernel/properties/index.ts
@@ -3,7 +3,7 @@
 /**
    Property Services
    @packageDocumentation
-   @module frama-c/kernel/properties
+   @module api/kernel/properties
 */
 
 //@ts-ignore
diff --git a/ivette/api/kernel/services/index.ts b/ivette/api/kernel/services/index.ts
index 7da04e4a0ae..87c76269438 100644
--- a/ivette/api/kernel/services/index.ts
+++ b/ivette/api/kernel/services/index.ts
@@ -3,7 +3,7 @@
 /**
    Kernel Services
    @packageDocumentation
-   @module frama-c/kernel/services
+   @module api/kernel/services
 */
 
 //@ts-ignore
diff --git a/ivette/api/server_tsc.ml b/ivette/api/server_tsc.ml
index 3df4c37188e..77a6f11beb0 100644
--- a/ivette/api/server_tsc.ml
+++ b/ivette/api/server_tsc.ml
@@ -258,12 +258,12 @@ let makeOrder ~self ~names fmt js =
 
 let makeRecursive fn fmt js =
   if Pkg.isRecursive js then
-    Format.fprintf fmt "(_x) => %a(_x)" fn js
+    Format.fprintf fmt "(_x: any) => %a(_x)" fn js
   else fn fmt js
 
 let makeRecursive2 fn fmt js =
   if Pkg.isRecursive js then
-    Format.fprintf fmt "(_x,_y) => %a(_x,_y)" fn js
+    Format.fprintf fmt "(_x: any, _y: any) => %a(_x,_y)" fn js
   else fn fmt js
 
 let makeDeclaration fmt names d =
@@ -440,7 +440,7 @@ let makePackage pkg name fmt =
     if pkg.p_descr <> [] then
       Format.fprintf fmt "@\n   @[<hov 0>%a@]@\n@\n" pp_descr pkg.p_descr ;
     Format.fprintf fmt "   @@packageDocumentation@\n" ;
-    Format.fprintf fmt "   @@module frama-c/%s@\n" name ;
+    Format.fprintf fmt "   @@module api/%s@\n" name ;
     Format.fprintf fmt "*/@\n@." ;
     let names = Pkg.resolve ~keywords pkg in
     makeIgnore fmt "import * as Json from 'dome/data/json';@\n" ;
diff --git a/ivette/tsconfig.json b/ivette/tsconfig.json
index 0f43fba3bb9..662e4cd16a7 100644
--- a/ivette/tsconfig.json
+++ b/ivette/tsconfig.json
@@ -98,8 +98,8 @@
     "readme": "./README.md",
     "inputFiles": [
       "doc/pages",
-      "src/frama-c",
-      "src/dome/src/renderer"
+      "src/frama-c", "api",
+      "src/dome/src/renderer",
     ]
   }
 }
-- 
GitLab