Add definitions for jquery-galleria

http://galleria.io/
This commit is contained in:
Robert Imig
2015-02-26 09:09:24 -05:00
parent 25286fd7b2
commit b69a3a08f3
2 changed files with 62 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
/// <reference path="jquery-galleria.d.ts" />
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();
}

39
jquery-galleria/jquery-galleria.d.ts vendored Normal file
View File

@@ -0,0 +1,39 @@
// Type definitions for galleria.js v1.4.2
// Project: https://github.com/aino/galleria
// Definitions by: Robert Imig <https://github.com/rimig>
// 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;