Skip to content

Commit 371a8c1

Browse files
committed
Choose to not expose some property for "window" interface
1 parent 1ad7597 commit 371a8c1

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

TS.fsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ let EmitProperties flavor prefix (emitScope: EmitScope) (i: Browser.Interface)=
234234
| None -> ()
235235

236236
getAddedItems ItemKind.Property flavor
237-
|> Array.filter (matchInterface i.Name)
237+
|> Array.filter (fun addedItem -> (matchInterface i.Name addedItem) && (prefix <> "declare var " || not(OptionCheckValue false addedItem.ExposeGlobally)))
238238
|> Array.iter emitPropertyFromJson
239239

240240
let EmitMethods flavor prefix (emitScope: EmitScope) (i: Browser.Interface) =

inputfiles/addedTypes.json

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
{
6565
"kind": "property",
6666
"interface": "Window",
67+
"exposeGlobally": false,
6768
"name": "URL",
6869
"type": "URL"
6970
},

inputfiles/sample.json

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
{
33
"kind": "property",
44
"interface": "Window",
5+
"exposeGlobally": false,
56
"name": "URL",
67
"type": "URL"
78
},

0 commit comments

Comments
 (0)