mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-06 06:19:58 +08:00
23
jquery-galleria/jquery-galleria-tests.ts
Normal file
23
jquery-galleria/jquery-galleria-tests.ts
Normal 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
39
jquery-galleria/jquery-galleria.d.ts
vendored
Normal 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;
|
||||
Reference in New Issue
Block a user