diff --git a/jquery-galleria/jquery-galleria-tests.ts b/jquery-galleria/jquery-galleria-tests.ts new file mode 100644 index 0000000000..413e368f82 --- /dev/null +++ b/jquery-galleria/jquery-galleria-tests.ts @@ -0,0 +1,23 @@ +/// +module JqueryGalleriaTests { + var container = document.createElement("galleria"); + + var gOptions: GalleriaJS.GalleriaOptions; + + gOptions.lightbox = true; + gOptions.autoplay = true; + + Galleria.run("galleria", gOptions); + + gOptions.lightbox = false; + + Galleria.ready(function() { + this.configure(gOptions).refreshImage(); + }); + + Galleria.run("galleria"); + + gOptions.autoplay = false; + + Galleria.run(); +} \ No newline at end of file diff --git a/jquery-galleria/jquery-galleria.d.ts b/jquery-galleria/jquery-galleria.d.ts new file mode 100644 index 0000000000..95b94aa502 --- /dev/null +++ b/jquery-galleria/jquery-galleria.d.ts @@ -0,0 +1,39 @@ +// Type definitions for galleria.js v1.4.2 +// Project: https://github.com/aino/galleria +// Definitions by: Robert Imig +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module GalleriaJS { + + interface GalleriaOptions { + dataSource: GalleriaEntry[]; + autoplay?: boolean; + lightbox?: boolean; + } + + interface GalleriaEntry { + image?: string; + thumbnail?: string; + title?: string; + description?: string; + } + + interface GalleriaFactory { + run(): GalleriaFactory; + run(selector: String): GalleriaFactory; + run(selector: String, options: GalleriaOptions): GalleriaFactory; + + loadTheme(url : String): GalleriaFactory; + configure(options: GalleriaOptions): GalleriaFactory; + + ready( method: () => any): void; + + refreshImage(): GalleriaFactory; + resize(): GalleriaFactory; + load( data: GalleriaEntry[]): GalleriaFactory; + setOptions( options: GalleriaOptions): GalleriaFactory; + } + +} + +declare var Galleria: GalleriaJS.GalleriaFactory; \ No newline at end of file