| OLD | NEW |
| 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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 constructor (); // shorthand | 221 constructor (); // shorthand |
| 222 | 222 |
| 223 constructor attribute String tagName; | 223 constructor attribute String tagName; |
| 224 } | 224 } |
| 225 | 225 |
| 226 // MODULES | 226 // MODULES |
| 227 abstract class AbstractModule : EventTarget { | 227 abstract class AbstractModule : EventTarget { |
| 228 readonly attribute Document document; // O(1) // the Documentof the module o
r application | 228 readonly attribute Document document; // O(1) // the Documentof the module o
r application |
| 229 Promise<any> import(String url); // O(Yikes) // returns the module's exports | 229 Promise<any> import(String url); // O(Yikes) // returns the module's exports |
| 230 | 230 |
| 231 readonly attribute String url; |
| 232 |
| 231 // createElement() lets you create elements that will be upgraded later when
you register the element | 233 // createElement() lets you create elements that will be upgraded later when
you register the element |
| 232 Element createElement(String tagName, Dictionary attributes, ChildArguments.
.. nodes); // O(M+N), M = number of attributes, N = number of nodes plus all the
ir descendants | 234 Element createElement(String tagName, Dictionary attributes, ChildArguments.
.. nodes); // O(M+N), M = number of attributes, N = number of nodes plus all the
ir descendants |
| 233 Element createElement(String tagName, Dictionary attributes); // shorthand | 235 Element createElement(String tagName, Dictionary attributes); // shorthand |
| 234 Element createElement(String tagName, ChildArguments... nodes); // shorthand | 236 Element createElement(String tagName, ChildArguments... nodes); // shorthand |
| 235 Element createElement(String tagName); // shorthand | 237 Element createElement(String tagName); // shorthand |
| 236 | 238 |
| 237 ElementConstructor registerElement(ElementRegistration options); // O(N) in
number of outstanding elements with that tag name to be upgraded | 239 ElementConstructor registerElement(ElementRegistration options); // O(N) in
number of outstanding elements with that tag name to be upgraded |
| 238 | 240 |
| 239 ScriptElement? currentScript; // O(1) // returns the <script> element curren
tly being executed if any, and if it's in this module; else null | 241 ScriptElement? currentScript; // O(1) // returns the <script> element curren
tly being executed if any, and if it's in this module; else null |
| 240 } | 242 } |
| 241 | 243 |
| 242 class Module : AbstractModule { | 244 class Module : AbstractModule { |
| 243 constructor (Application application, Document document); // O(1) | 245 constructor (Application application, Document document, String url); // O(1
) |
| 244 readonly attribute Application application; // O(1) | 246 readonly attribute Application application; // O(1) |
| 245 | 247 |
| 246 attribute any exports; // O(1) // defaults to the module's document | 248 attribute any exports; // O(1) // defaults to the module's document |
| 247 } | 249 } |
| 248 | 250 |
| 249 class Application : AbstractModule { | 251 class Application : AbstractModule { |
| 250 constructor (Document document); // O(1) | 252 constructor (Document document, String url); // O(1) |
| 251 attribute String title; // O(1) | 253 attribute String title; // O(1) |
| 252 } | 254 } |
| 253 | 255 |
| 254 // see script.md for a description of the global object, though note that | 256 // see script.md for a description of the global object, though note that |
| 255 // the sky core module doesn't use it or affect it in any way. | 257 // the sky core module doesn't use it or affect it in any way. |
| 256 | 258 |
| 257 } | 259 } |
| 258 ``` | 260 ``` |
| 259 | 261 |
| 260 TODO(ianh): is it ok that you can do | 262 TODO(ianh): is it ok that you can do |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 the core mojo fabric JS API sky:mojo:fabric:core | 428 the core mojo fabric JS API sky:mojo:fabric:core |
| 427 the asyncWait/cancelWait mojo fabric JS API (interface to IPC thread) sky:moj
o:fabric:ipc | 429 the asyncWait/cancelWait mojo fabric JS API (interface to IPC thread) sky:moj
o:fabric:ipc |
| 428 the mojom for the shell, proxying through C++ so that the shell pipe isn't exp
osed sky:mojo:shell | 430 the mojom for the shell, proxying through C++ so that the shell pipe isn't exp
osed sky:mojo:shell |
| 429 the sky API sky:core | 431 the sky API sky:core |
| 430 the sky debug symbols for private APIs sky:debug | 432 the sky debug symbols for private APIs sky:debug |
| 431 ``` | 433 ``` |
| 432 | 434 |
| 433 TODO(ianh): determine if we want to separate the "this" from the | 435 TODO(ianh): determine if we want to separate the "this" from the |
| 434 Document, especially for Modules, so that exposing a module's element | 436 Document, especially for Modules, so that exposing a module's element |
| 435 doesn't expose the module's exports attribute. | 437 doesn't expose the module's exports attribute. |
| OLD | NEW |