Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(568)

Side by Side Diff: sky/specs/apis.md

Issue 690793002: Specs: Make it possible to import a module from a module or application by calling module.import(ur… (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 APIS 1 APIS
2 ==== 2 ====
3 3
4 The Sky core API 4 The Sky core API
5 ---------------- 5 ----------------
6 6
7 ```javascript 7 ```javascript
8 module 'sky:core' { 8 module 'sky:core' {
9 9
10 // EVENTS 10 // EVENTS
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 } 165 }
166 interface ImgElement : Element { } 166 interface ImgElement : Element { }
167 interface IframeElement : Element { } 167 interface IframeElement : Element { }
168 interface TElement : Element { } 168 interface TElement : Element { }
169 interface AElement : Element { } 169 interface AElement : Element { }
170 interface TitleElement : Element { } 170 interface TitleElement : Element { }
171 171
172 172
173 173
174 // MODULES 174 // MODULES
175 abstract interface AbstractModule : EventTarget {
176 Promise<any> import(String url); // O(Yikes) // returns the module's exports
177 }
175 178
176 interface Module : EventTarget { 179 interface Module : AbstractModule {
177 constructor (Application application, Document document); // O(1) 180 constructor (Application application, Document document); // O(1)
178 attribute any exports; // O(1) // defaults to the module's document 181 attribute any exports; // O(1) // defaults to the module's document
179 readonly attribute Document document; // O(1) // the module's document 182 readonly attribute Document document; // O(1) // the module's document
180 readonly attribute Application application; // O(1) 183 readonly attribute Application application; // O(1)
181 } 184 }
182 185
183 interface Application : EventTarget { 186 interface Application : AbstractModule {
184 constructor (Document document); // O(1) 187 constructor (Document document); // O(1)
185 attribute String title; // O(1) 188 attribute String title; // O(1)
186 readonly attribute Document document; // O(1) // the application's document 189 readonly attribute Document document; // O(1) // the application's document
187 } 190 }
188 191
189 // see script.md for a description of the global object, though note that 192 // see script.md for a description of the global object, though note that
190 // the sky core module doesn't use it or affect it in any way. 193 // the sky core module doesn't use it or affect it in any way.
191 194
192 } 195 }
193 ``` 196 ```
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 magical imports: 310 magical imports:
308 the core mojo fabric JS API sky:mojo:fabric:core 311 the core mojo fabric JS API sky:mojo:fabric:core
309 the asyncWait/cancelWait mojo fabric JS API (interface to IPC thread) sky:moj o:fabric:ipc 312 the asyncWait/cancelWait mojo fabric JS API (interface to IPC thread) sky:moj o:fabric:ipc
310 the mojom for the shell, proxying through C++ so that the shell pipe isn't exp osed sky:mojo:shell 313 the mojom for the shell, proxying through C++ so that the shell pipe isn't exp osed sky:mojo:shell
311 the sky API sky:core 314 the sky API sky:core
312 ``` 315 ```
313 316
314 TODO(ianh): determine if we want to separate the "this" from the 317 TODO(ianh): determine if we want to separate the "this" from the
315 Document, especially for Modules, so that exposing a module's element 318 Document, especially for Modules, so that exposing a module's element
316 doesn't expose the module's exports attribute. 319 doesn't expose the module's exports attribute.
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698