You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-5Lines changed: 14 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -134,10 +134,16 @@ Both hooks have the signature `(code) => replacementCode`, where:
134
134
135
135
If either hook is omitted, then the code will not be replaced, i.e. the default is equivalent to `(code) => code`.
136
136
137
-
Both hooks also some utility methods that are are accessible via `this`:
137
+
Both hooks also have some utility methods that are accessible via `this`:
138
138
139
139
-`addImport(relPath, importedIdentifier)` utility to require external modules from the generated interface. This method accepts 2 parameters: `relPath` the relative path from the generated interface file and `importedIdentifier` the identifier to import. This method returns the local identifier from the imported path.
140
140
141
+
The following variables are available in the scope of the replacement code:
142
+
143
+
-`globalObject` (object) is the global object associated with the interface
144
+
145
+
-`interfaceName` (string) is the name of the interface
146
+
141
147
An example of code that uses these hooks is as follows:
0 commit comments