Skip to content

Commit 7f4edf7

Browse files
authored
Merge pull request #193 from Microsoft/usePromise
Use Promise<T> instead of PromiseLike<T>
2 parents 92f4c64 + 414ee14 commit 7f4edf7

File tree

3 files changed

+108
-110
lines changed

3 files changed

+108
-110
lines changed

TS.fsx

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ module Types =
7474

7575
member this.Printl content =
7676
Printf.kprintf (fun s -> output.Append("\r\n" + this.GetCurIndent() + s) |> ignore) content
77-
77+
7878
member this.PrintlToStack content =
7979
Printf.kprintf (fun s -> stack.Append("\r\n" + this.GetCurIndent() + s) |> ignore) content
80-
80+
8181
member this.StackIsEmpty () = stack.Length = 0
8282

8383
member this.IncreaseIndent() = curTabCount <- curTabCount + 1
@@ -324,8 +324,8 @@ module Data =
324324

325325
type KnownWorkerInterfaceType = JsonProvider<"inputfiles/knownWorkerInterfaces.json", InferTypesFromValues=false>
326326
let knownWorkerInterfaces =
327-
File.ReadAllText(Path.Combine(GlobalVars.inputFolder, "knownWorkerInterfaces.json"))
328-
|> KnownWorkerInterfaceType.Parse
327+
File.ReadAllText(Path.Combine(GlobalVars.inputFolder, "knownWorkerInterfaces.json"))
328+
|> KnownWorkerInterfaceType.Parse
329329
|> set
330330

331331
let GetAllInterfacesByFlavor flavor =
@@ -736,8 +736,6 @@ module Emit =
736736
let tName = DomTypeToTsType (genericMatch.Groups.[1].Value)
737737
let paramName = DomTypeToTsType (genericMatch.Groups.[2].Value)
738738
match tName with
739-
| "Promise" ->
740-
"PromiseLike<" + paramName + ">"
741739
| _ ->
742740
if tName = "Array" then paramName + "[]"
743741
else tName + "<" + paramName + ">"
@@ -894,7 +892,7 @@ module Emit =
894892
| Some pollutor -> "this: " + pollutor.Name + ", "
895893
| _ -> ""
896894

897-
let EmitProperties flavor prefix (emitScope: EmitScope) (i: Browser.Interface) (conflictedMembers: Set<string>) =
895+
let EmitProperties flavor prefix (emitScope: EmitScope) (i: Browser.Interface) (conflictedMembers: Set<string>) =
898896
let emitPropertyFromJson (p: InputJsonType.Root) =
899897
let readOnlyModifier =
900898
match p.Readonly with
@@ -1030,7 +1028,7 @@ module Emit =
10301028

10311029
/// Emit the properties and methods of a given interface
10321030
let EmitMembers flavor (prefix: string) (emitScope: EmitScope) (i:Browser.Interface) =
1033-
let conflictedMembers =
1031+
let conflictedMembers =
10341032
match Map.tryFind i.Name extendConflictsBaseTypes with
10351033
| Some conflict -> conflict.MemberNames
10361034
| _ -> []
@@ -1129,7 +1127,7 @@ module Emit =
11291127
match Map.tryFind iName extendConflictsBaseTypes with
11301128
| Some _ -> iName + "Base"
11311129
| _ -> iName
1132-
1130+
11331131
let processedIName = processIName i.Name
11341132
if processedIName <> i.Name then
11351133
Pt.PrintlToStack "interface %s extends %s {" i.Name processedIName
@@ -1462,7 +1460,7 @@ module Emit =
14621460
Pt.Printl ""
14631461

14641462
EmitDictionaries flavor
1465-
browser.CallbackInterfaces.Interfaces |> Array.iter EmitCallBackInterface
1463+
browser.CallbackInterfaces.Interfaces |> Array.iter EmitCallBackInterface
14661464
EmitNonCallbackInterfaces flavor
14671465

14681466
// Add missed interface definition from the spec

0 commit comments

Comments
 (0)