File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -199,6 +199,23 @@ It's also useful to hide the underlying type as an implementation detail others
199199can't rely on. If you ask what the type of ` Company.profession ` is, instead of
200200exposing the variant, it'll only tell you "it's ` Company.profession ` ".
201201
202+ #### Extending module signatures
203+
204+ Like modules themselves, module signatures can also be extended through ` include module type of Foo ` :
205+
206+ ``` reason
207+ module type BaseComponent = {
208+ let defaultGreeting: string;
209+ let getAudience: excited::bool => string;
210+ };
211+
212+ module type ActualComponent = {
213+ /* the signature is copied over */
214+ include module type of BaseComponent;
215+ let render: unit => string;
216+ };
217+ ```
218+
202219#### Every ` .rei ` file is a signature
203220
204221Similar to how a ` react.re ` file implicitly defines a module ` React ` , a file
You can’t perform that action at this time.
0 commit comments