From a46c72a1fb2534e5e7fac19bd17f2320f85e1eec Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 5 Jun 2015 20:37:42 -0400 Subject: [PATCH 1/2] added rivets definition and test --- rivets/rivets-tests.ts | 18 ++++++++++++++++++ rivets/rivets.d.ts | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 rivets/rivets-tests.ts create mode 100644 rivets/rivets.d.ts diff --git a/rivets/rivets-tests.ts b/rivets/rivets-tests.ts new file mode 100644 index 0000000000..fec2820460 --- /dev/null +++ b/rivets/rivets-tests.ts @@ -0,0 +1,18 @@ +/// + +Rivets.configure({ + // Attribute prefix in templates + prefix: 'rv', + // Preload templates with initial data on bind + preloadData: true, + // Root sightglass interface for keypaths + rootInterface: '.', + // Template delimiters for text bindings + templateDelimiters: ['[[', ']]'], + // Augment the event handler of the on-* binder + handler: function(target:any, event:any, binding:any) { + this.call(target, event, binding.view.models) + } + }) +var t = {test: ["hello", "one", "two"]} +Rivets.bind(document.getElementById("para1"), t) \ No newline at end of file diff --git a/rivets/rivets.d.ts b/rivets/rivets.d.ts new file mode 100644 index 0000000000..0eca72a9e4 --- /dev/null +++ b/rivets/rivets.d.ts @@ -0,0 +1,35 @@ +// Type definitions for body-parser +// Project: http://rivetsjs.com/ +// Definitions by: Trevor Baron +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +interface FinchStatic { + configure(options?: { + /** + * Attribute prefix in templates + */ + prefix?: string; + /** + * Preload templates with initial data on bind + */ + preloadData?: boolean; + /** + * Root sightglass interface for keypaths + */ + rootInterface?: string; + /** + * Template delimiters for text bindings + */ + templateDelimiters?: Array + /** + * Augment the event handler of the on-* binder + */ + handler?: Function; + }):void; + bind(element:any, template:any):void; +} + +declare var Rivets: FinchStatic; +declare module "rivets" { + export = Rivets; +} \ No newline at end of file From 8ad4c108a200679182a7e847d693c22c2704cf27 Mon Sep 17 00:00:00 2001 From: Trevor Baron Date: Fri, 5 Jun 2015 20:41:14 -0400 Subject: [PATCH 2/2] fix copy paste error --- rivets/rivets.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rivets/rivets.d.ts b/rivets/rivets.d.ts index 0eca72a9e4..2b04653ec1 100644 --- a/rivets/rivets.d.ts +++ b/rivets/rivets.d.ts @@ -1,4 +1,4 @@ -// Type definitions for body-parser +// Type definitions for rivets // Project: http://rivetsjs.com/ // Definitions by: Trevor Baron // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -32,4 +32,4 @@ interface FinchStatic { declare var Rivets: FinchStatic; declare module "rivets" { export = Rivets; -} \ No newline at end of file +}