Skip to content

Commit a405b43

Browse files
committed
change js type declaration to output ts
1 parent 2e24782 commit a405b43

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

CASES-TO-ADD.md

+8
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,11 @@ in js should call setState
2323

2424
subCost section := @@prices[section]
2525
^ doesn't add a return
26+
27+
28+
29+
add support for ts interfaces:
30+
31+
export interface HelloWorldProps {
32+
name: string;
33+
}

src/ToJs.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ instance ConvertToJs ArgumentName where
9090
instance ConvertToJs Argument where
9191
toJs (Argument (Just (ArgumentType False typ _)) name (Just default_)) = print3 "?% % = %" typ (toJs name) default_
9292
toJs (Argument (Just (ArgumentType True typ _)) name (Just default_)) = print3 "?% % = %" typ (toJs name) default_
93-
toJs (Argument (Just (ArgumentType False typ _)) name Nothing) = typ ++ " " ++ (toJs name)
93+
toJs (Argument (Just (ArgumentType False typ _)) name Nothing) = print2 "%: %" (toJs name) typ
9494
toJs (Argument (Just (ArgumentType True typ _)) name Nothing) = print2 "?% % = null" typ (toJs name)
9595
toJs (Argument Nothing name (Just default_)) = print2 "% = %" (toJs name) default_
9696
toJs (Argument Nothing name Nothing) = toJs name

0 commit comments

Comments
 (0)