Merge pull request #3753 from rimig/add-galleria-typings

Add definitions for jquery-galleria
This commit is contained in:
Masahiro Wakame
2015-03-03 00:32:04 +09:00
2 changed files with 62 additions and 0 deletions
+23
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
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;