Peter StJ
2016-02-29 23:36:58 UTC
I am looking for a way to expose namespaced functions and possibly instance
methods/properties.
for example like how google.maps.* works.
The way this works in closure (from where maps are exposed) is that the
namespace is created specifically named as desired while the method names
are possibly as they are in the class implementation, something in the
lines of:
goog.exportMethod('my.namespace.fnname', /* actual code that will be
compiled / minified */(...));
class MyClass {
/** @export */
myMethod() {...} // name will be preserved as it is so accessible when an
instance of the (possibly renamed) class is created
}
The main idea is that I want to be able to expose entry points to Dart code
while Dart is compiled as a whole application, for example provide runtime
settings or API that can change behavior to the browser users or possibly
scriptwriters / extension writers.
Is this possible now in latest Dart? If yes - where are the relevant docs?
Thank you.
methods/properties.
for example like how google.maps.* works.
The way this works in closure (from where maps are exposed) is that the
namespace is created specifically named as desired while the method names
are possibly as they are in the class implementation, something in the
lines of:
goog.exportMethod('my.namespace.fnname', /* actual code that will be
compiled / minified */(...));
class MyClass {
/** @export */
myMethod() {...} // name will be preserved as it is so accessible when an
instance of the (possibly renamed) class is created
}
The main idea is that I want to be able to expose entry points to Dart code
while Dart is compiled as a whole application, for example provide runtime
settings or API that can change behavior to the browser users or possibly
scriptwriters / extension writers.
Is this possible now in latest Dart? If yes - where are the relevant docs?
Thank you.
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.