From 2c123744f00cb74676333a45e1ef4f0750b3b39f Mon Sep 17 00:00:00 2001 From: Lars Michaelis Date: Wed, 2 Dec 2015 11:46:17 +0100 Subject: [PATCH] add tests --- jsf/jsf-tests.ts | 25 +++++++++++++++++++++++++ jsf/jsf.d.ts | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/jsf/jsf-tests.ts b/jsf/jsf-tests.ts index b56749a4a..3c594f1e5 100644 --- a/jsf/jsf-tests.ts +++ b/jsf/jsf-tests.ts @@ -1,2 +1,27 @@ /// +function callbackWithoutData() { + +} + +function callback(data: jsf.ajax.RequestData) { + +} + +class RequestOptionsImpl implements jsf.ajax.RequestOptions { + execute = "@all"; + render = "@none"; +} + + +jsf.ajax.addOnEvent(callbackWithoutData); +jsf.ajax.addOnEvent(callback); + +jsf.ajax.addOnError(callbackWithoutData); +jsf.ajax.addOnError(callback); + +jsf.ajax.request("someSource"); +jsf.ajax.request("someSource", "change"); +jsf.ajax.request("someSource", "change", new RequestOptionsImpl()); + +jsf.ajax.response("someRequestObject", "someContextObject"); diff --git a/jsf/jsf.d.ts b/jsf/jsf.d.ts index 9c7f6a43d..d19dafe0e 100644 --- a/jsf/jsf.d.ts +++ b/jsf/jsf.d.ts @@ -3,7 +3,7 @@ // Definitions by: Lars Michaelis and Stephan Zerhusen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare module "jsf" { +declare module jsf { module ajax { interface RequestData {