From ecd46382f35b24c569af25ac8a3bf6503454839a Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Thu, 3 Mar 2011 19:47:48 -0500 Subject: [PATCH] Added brief mention and example of interfaces to README --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index cac3a31..2b28bb6 100644 --- a/README.md +++ b/README.md @@ -140,6 +140,23 @@ The abstract methods are available as a read-only `abstractMethods` property. StillAbstractFoo.isAbstract(); // true +### Interfaces +Interfaces can be declared in a very similar manner to classes. All members of +an interface must be declared as abstract. + + var MyType = Interface( + { + 'abstract foo': [] + }); + +To implement an interface, use the `implement()` class method: + + var ConcreteType = Class.implement( MyType ).extend( + { + foo: function() {} + }); + + ## Use of Reserved Words Though JavaScript doesn't currently implement classes, interfaces, etc, it does reserve the keywords. In an effort to ensure that ease.js will not clash, the