mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Merge branch 'master' of https://github.com/borisyankov/DefinitelyTyped into Backbone.Radio
This commit is contained in:
Vendored
+35
-35
@@ -13,43 +13,43 @@ interface JoyrideTemplate {
|
||||
* Link template
|
||||
* @member {string}
|
||||
*/
|
||||
link: string;
|
||||
link?: string;
|
||||
|
||||
/**
|
||||
* Timer template
|
||||
* @member {string}
|
||||
*/
|
||||
timer: string;
|
||||
timer?: string;
|
||||
|
||||
/**
|
||||
* Tip template
|
||||
* @member {string}
|
||||
*/
|
||||
tip: string;
|
||||
tip?: string;
|
||||
|
||||
/**
|
||||
* Wrapper template
|
||||
* @member {string}
|
||||
*/
|
||||
wrapper: string;
|
||||
wrapper?: string;
|
||||
|
||||
/**
|
||||
* Button template
|
||||
* @member {string}
|
||||
*/
|
||||
button: string;
|
||||
button?: string;
|
||||
|
||||
/**
|
||||
* Modal template
|
||||
* @member {string}
|
||||
*/
|
||||
modal: string;
|
||||
modal?: string;
|
||||
|
||||
/**
|
||||
* Exposed Cover template
|
||||
* @member {string}
|
||||
*/
|
||||
exposeCover: string;
|
||||
exposeCover?: string;
|
||||
}
|
||||
|
||||
interface JoyrideOptions {
|
||||
@@ -57,133 +57,133 @@ interface JoyrideOptions {
|
||||
* Version
|
||||
* @member {string}
|
||||
*/
|
||||
version: string;
|
||||
version?: string;
|
||||
|
||||
/**
|
||||
* 'top' or 'bottom' in relation to parent
|
||||
* @member {string}
|
||||
*/
|
||||
tipLocation: string;
|
||||
tipLocation?: string;
|
||||
|
||||
/**
|
||||
* override on a per tooltip bases
|
||||
* @member {any}
|
||||
*/
|
||||
nubPosition: any;
|
||||
nubPosition?: any;
|
||||
|
||||
/**
|
||||
* whether to scroll to tips
|
||||
* @member {boolean}
|
||||
*/
|
||||
scroll: boolean;
|
||||
scroll?: boolean;
|
||||
|
||||
/**
|
||||
* Page scrolling speed in ms
|
||||
* @member {number}
|
||||
*/
|
||||
scrollSpeed: number;
|
||||
scrollSpeed?: number;
|
||||
|
||||
/**
|
||||
* 0 = off, all other numbers = time(ms)
|
||||
* @member {number}
|
||||
*/
|
||||
timer: number;
|
||||
timer?: number;
|
||||
|
||||
/**
|
||||
* true or false - false tour starts when restart called
|
||||
* @member {boolean}
|
||||
*/
|
||||
autoStart: boolean;
|
||||
autoStart?: boolean;
|
||||
|
||||
/**
|
||||
* true/false to start timer on first click
|
||||
* @member {boolean}
|
||||
*/
|
||||
startTimerOnClick: boolean;
|
||||
startTimerOnClick?: boolean;
|
||||
|
||||
/**
|
||||
* the index of the tooltip you want to start on (index of the li)
|
||||
* @member {number}
|
||||
*/
|
||||
startOffset: number;
|
||||
startOffset?: number;
|
||||
|
||||
/**
|
||||
* true/false for next button visibility
|
||||
* @member {boolean}
|
||||
*/
|
||||
nextButton: boolean;
|
||||
nextButton?: boolean;
|
||||
|
||||
/**
|
||||
* 'pop' or 'fade' in each tip
|
||||
* @member {string}
|
||||
*/
|
||||
tipAnimation: string;
|
||||
tipAnimation?: string;
|
||||
|
||||
/**
|
||||
* array of indexes where to pause the tour after
|
||||
* @member {any[]}
|
||||
*/
|
||||
pauseAfter: any[];
|
||||
pauseAfter?: any[];
|
||||
|
||||
/**
|
||||
* if 'fade'- speed in ms of transition
|
||||
* @member {number}
|
||||
*/
|
||||
tipAnimationFadeSpeed: number;
|
||||
tipAnimationFadeSpeed?: number;
|
||||
|
||||
/**
|
||||
* true/false for whether cookies are used
|
||||
* @member {boolean}
|
||||
*/
|
||||
cookieMonster: boolean;
|
||||
cookieMonster?: boolean;
|
||||
|
||||
/**
|
||||
* choose your own cookie name
|
||||
* member {string}
|
||||
*/
|
||||
cookieName: string;
|
||||
cookieName?: string;
|
||||
|
||||
/**
|
||||
* Will this cookie be attached to a domain, ie. '.notableapp.com'
|
||||
* @member {any}
|
||||
*/
|
||||
cookieDomain: any;
|
||||
cookieDomain?: any;
|
||||
|
||||
/**
|
||||
* Set to '/' if you want the cookie for the whole website
|
||||
* @member {any}
|
||||
*/
|
||||
cookiePath: any;
|
||||
cookiePath?: any;
|
||||
|
||||
/**
|
||||
* true or false to control whether localstorage is used
|
||||
* @member {boolean}
|
||||
*/
|
||||
localStorage: boolean;
|
||||
localStorage?: boolean;
|
||||
|
||||
/**
|
||||
* Keyname in localstorage
|
||||
@member {string}
|
||||
*/
|
||||
localStorageKey: string;
|
||||
localStorageKey?: string;
|
||||
|
||||
/**
|
||||
* Where the tip be attached if not inline
|
||||
* @member {HTMLElement}
|
||||
*/
|
||||
tipContainer: HTMLElement;
|
||||
tipContainer?: HTMLElement;
|
||||
|
||||
/**
|
||||
* Whether to cover page with modal during the tour
|
||||
* @member {boolean}
|
||||
*/
|
||||
modal: boolean;
|
||||
modal?: boolean;
|
||||
|
||||
/**
|
||||
* Whether to expose the elements at each step in the tour (requires modal:true)
|
||||
* @member {boolean}
|
||||
*/
|
||||
expose: boolean;
|
||||
expose?: boolean;
|
||||
|
||||
/**
|
||||
* A method to call after an element has been exposed
|
||||
@@ -192,7 +192,7 @@ interface JoyrideOptions {
|
||||
* @param {JQuery} nextTip Tip object
|
||||
* @param {JQuery} el Element
|
||||
*/
|
||||
postExposeCallback: (index: number, nextTip: JQuery, el?: JQuery) => void;
|
||||
postExposeCallback?: (index: number, nextTip: JQuery, el?: JQuery) => void;
|
||||
|
||||
/**
|
||||
* A method to call before the tour starts (passed index, tip, and cloned exposed element)
|
||||
@@ -201,7 +201,7 @@ interface JoyrideOptions {
|
||||
* @param {JQuery} currentTip Current Tip object
|
||||
* @param {JQuery} el Element
|
||||
*/
|
||||
preRideCallback: (index: number, currentTip: JQuery, el?: JQuery) => void;
|
||||
preRideCallback?: (index: number, currentTip: JQuery, el?: JQuery) => void;
|
||||
|
||||
/**
|
||||
* a method to call once the tour closes
|
||||
@@ -210,7 +210,7 @@ interface JoyrideOptions {
|
||||
* @param {JQuery} currentTip Current Tip object
|
||||
* @param {boolean} isAborted Is Aborted?
|
||||
*/
|
||||
postRideCallback: (index: number, currentTip: JQuery, isAborted?: boolean) => void;
|
||||
postRideCallback?: (index: number, currentTip: JQuery, isAborted?: boolean) => void;
|
||||
|
||||
/**
|
||||
* A method to call after each step
|
||||
@@ -219,7 +219,7 @@ interface JoyrideOptions {
|
||||
* @param {JQuery} currentTip Current Tip object
|
||||
* @param {boolean} isAborted Is Aborted?
|
||||
*/
|
||||
postStepCallback: (index: number, currentTip: JQuery, isAborted?: boolean) => void;
|
||||
postStepCallback?: (index: number, currentTip: JQuery, isAborted?: boolean) => void;
|
||||
|
||||
/**
|
||||
* A method to call before each step
|
||||
@@ -228,13 +228,13 @@ interface JoyrideOptions {
|
||||
* @param {JQuery} nextTip Tip object
|
||||
* @param {JQuery} el Element
|
||||
*/
|
||||
preStepCallback: (index: number, nextTip: JQuery, el?: JQuery) => void;
|
||||
preStepCallback?: (index: number, nextTip: JQuery, el?: JQuery) => void;
|
||||
|
||||
/**
|
||||
* HTML segments for tip layout
|
||||
* @member {JoyrideTemplate}
|
||||
*/
|
||||
template: JoyrideTemplate;
|
||||
template?: JoyrideTemplate;
|
||||
}
|
||||
|
||||
interface Joyride
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
/// <reference path="./log4js.d.ts" />
|
||||
import log4js = require('log4js');
|
||||
|
||||
log4js.addAppender(log4js.appenders.file('logs/cheese.log'), 'cheese');
|
||||
|
||||
var logger = log4js.getLogger('cheese');
|
||||
logger.setLevel('ERROR');
|
||||
|
||||
logger.trace('Entering cheese testing');
|
||||
logger.debug('Got cheese.');
|
||||
logger.info('Cheese is Gouda.');
|
||||
logger.warn('Cheese is quite smelly.');
|
||||
logger.error('Cheese is too ripe!');
|
||||
logger.fatal('Cheese was breeding ground for listeria.');
|
||||
|
||||
var cb = () => {};
|
||||
log4js.shutdown(cb);
|
||||
|
||||
log4js.configure({
|
||||
appenders: [
|
||||
{ type: 'console' },
|
||||
{ type: 'file', filename: 'logs/cheese.log', category: 'cheese' }
|
||||
]
|
||||
});
|
||||
|
||||
var defaultLogger = log4js.getDefaultLogger();
|
||||
defaultLogger.debug('Got cheese.');
|
||||
Vendored
+57
@@ -0,0 +1,57 @@
|
||||
// Type definitions for log4js
|
||||
// Project: https://github.com/nomiddlename/log4js-node
|
||||
// Definitions by: Kentaro Okuno <http://github.com/armorik83>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module "log4js" {
|
||||
/**
|
||||
* Get a logger instance. Instance is cached on categoryName level.
|
||||
*
|
||||
* @param {String} [categoryName] name of category to log to.
|
||||
* @returns {Logger} instance of logger for the category
|
||||
* @static
|
||||
*/
|
||||
export function getLogger(categoryName?: string): Logger;
|
||||
|
||||
/**
|
||||
* Get the default logger instance.
|
||||
* @returns {Logger} instance of default logger
|
||||
* @static
|
||||
*/
|
||||
export function getDefaultLogger(): Logger;
|
||||
|
||||
/**
|
||||
* args are appender, then zero or more categories
|
||||
*
|
||||
* @param {*[]} appenders
|
||||
* @returns {void}
|
||||
* @static
|
||||
*/
|
||||
export function addAppender(...appenders: any[]): void;
|
||||
|
||||
/**
|
||||
* Shutdown all log appenders. This will first disable all writing to appenders
|
||||
* and then call the shutdown function each appender.
|
||||
*
|
||||
* @params {Function} cb - The callback to be invoked once all appenders have
|
||||
* shutdown. If an error occurs, the callback will be given the error object
|
||||
* as the first argument.
|
||||
* @returns {void}
|
||||
*/
|
||||
export function shutdown(cb: Function): void;
|
||||
|
||||
export function configure(config: any, options?: any): void;
|
||||
|
||||
export var appenders: any;
|
||||
|
||||
export interface Logger {
|
||||
setLevel(level: string): void;
|
||||
|
||||
trace(message: string): void;
|
||||
debug(message: string): void;
|
||||
info(message: string): void;
|
||||
warn(message: string): void;
|
||||
error(message: string): void;
|
||||
fatal(message: string): void;
|
||||
}
|
||||
}
|
||||
Vendored
+305
-170
@@ -97,180 +97,180 @@ declare module OpenLayers {
|
||||
|
||||
export class Events {
|
||||
/**
|
||||
* Method: attachToElement
|
||||
*
|
||||
* Parameters:
|
||||
* element - {HTMLDOMElement} a DOM element to attach browser events to
|
||||
*/
|
||||
attachToElement(element: HTMLElement) : void;
|
||||
* Method: attachToElement
|
||||
*
|
||||
* Parameters:
|
||||
* element - {HTMLDOMElement} a DOM element to attach browser events to
|
||||
*/
|
||||
attachToElement(element: HTMLElement): void;
|
||||
|
||||
/**
|
||||
* APIMethod: on
|
||||
* Convenience method for registering listeners with a common scope.
|
||||
* Internally, this method calls <register> as shown in the examples
|
||||
* below.
|
||||
*
|
||||
* Example use:
|
||||
* (code)
|
||||
* // register a single listener for the "loadstart" event
|
||||
* events.on({"loadstart": loadStartListener});
|
||||
*
|
||||
* // this is equivalent to the following
|
||||
* events.register("loadstart", undefined, loadStartListener);
|
||||
*
|
||||
* // register multiple listeners to be called with the same `this` object
|
||||
* events.on({
|
||||
* "loadstart": loadStartListener,
|
||||
* "loadend": loadEndListener,
|
||||
* scope: object
|
||||
* });
|
||||
*
|
||||
* // this is equivalent to the following
|
||||
* events.register("loadstart", object, loadStartListener);
|
||||
* events.register("loadend", object, loadEndListener);
|
||||
* (end)
|
||||
*
|
||||
* Parameters:
|
||||
* object - {Object}
|
||||
*/
|
||||
on(object: any) : void;
|
||||
/**
|
||||
* APIMethod: on
|
||||
* Convenience method for registering listeners with a common scope.
|
||||
* Internally, this method calls <register> as shown in the examples
|
||||
* below.
|
||||
*
|
||||
* Example use:
|
||||
* (code)
|
||||
* // register a single listener for the "loadstart" event
|
||||
* events.on({"loadstart": loadStartListener});
|
||||
*
|
||||
* // this is equivalent to the following
|
||||
* events.register("loadstart", undefined, loadStartListener);
|
||||
*
|
||||
* // register multiple listeners to be called with the same `this` object
|
||||
* events.on({
|
||||
* "loadstart": loadStartListener,
|
||||
* "loadend": loadEndListener,
|
||||
* scope: object
|
||||
* });
|
||||
*
|
||||
* // this is equivalent to the following
|
||||
* events.register("loadstart", object, loadStartListener);
|
||||
* events.register("loadend", object, loadEndListener);
|
||||
* (end)
|
||||
*
|
||||
* Parameters:
|
||||
* object - {Object}
|
||||
*/
|
||||
on(object: any): void;
|
||||
|
||||
/**
|
||||
* APIMethod: register
|
||||
* Register an event on the events object.
|
||||
*
|
||||
* When the event is triggered, the 'func' function will be called, in the
|
||||
* context of 'obj'. Imagine we were to register an event, specifying an
|
||||
* OpenLayers.Bounds Object as 'obj'. When the event is triggered, the
|
||||
* context in the callback function will be our Bounds object. This means
|
||||
* that within our callback function, we can access the properties and
|
||||
* methods of the Bounds object through the "this" variable. So our
|
||||
* callback could execute something like:
|
||||
* : leftStr = "Left: " + this.left;
|
||||
*
|
||||
* or
|
||||
*
|
||||
* : centerStr = "Center: " + this.getCenterLonLat();
|
||||
*
|
||||
* Parameters:
|
||||
* type - {String} Name of the event to register
|
||||
* obj - {Object} The object to bind the context to for the callback#.
|
||||
* If no object is specified, default is the Events's 'object' property.
|
||||
* func - {Function} The callback function. If no callback is
|
||||
* specified, this function does nothing.
|
||||
* priority - {Boolean|Object} If true, adds the new listener to the
|
||||
* *front* of the events queue instead of to the end.
|
||||
*
|
||||
* Valid options for priority:
|
||||
* extension - {Boolean} If true, then the event will be registered as
|
||||
* extension event. Extension events are handled before all other
|
||||
* events.
|
||||
*/
|
||||
register(type: string, obj: any, func: () => void, priority: boolean) : void;
|
||||
/**
|
||||
* APIMethod: register
|
||||
* Register an event on the events object.
|
||||
*
|
||||
* When the event is triggered, the 'func' function will be called, in the
|
||||
* context of 'obj'. Imagine we were to register an event, specifying an
|
||||
* OpenLayers.Bounds Object as 'obj'. When the event is triggered, the
|
||||
* context in the callback function will be our Bounds object. This means
|
||||
* that within our callback function, we can access the properties and
|
||||
* methods of the Bounds object through the "this" variable. So our
|
||||
* callback could execute something like:
|
||||
* : leftStr = "Left: " + this.left;
|
||||
*
|
||||
* or
|
||||
*
|
||||
* : centerStr = "Center: " + this.getCenterLonLat();
|
||||
*
|
||||
* Parameters:
|
||||
* type - {String} Name of the event to register
|
||||
* obj - {Object} The object to bind the context to for the callback#.
|
||||
* If no object is specified, default is the Events's 'object' property.
|
||||
* func - {Function} The callback function. If no callback is
|
||||
* specified, this function does nothing.
|
||||
* priority - {Boolean|Object} If true, adds the new listener to the
|
||||
* *front* of the events queue instead of to the end.
|
||||
*
|
||||
* Valid options for priority:
|
||||
* extension - {Boolean} If true, then the event will be registered as
|
||||
* extension event. Extension events are handled before all other
|
||||
* events.
|
||||
*/
|
||||
register(type: string, obj: any, func: () => void, priority: boolean): void;
|
||||
|
||||
/**
|
||||
* APIMethod: registerPriority
|
||||
* Same as register() but adds the new listener to the *front* of the
|
||||
* events queue instead of to the end.
|
||||
*
|
||||
* TODO: get rid of this in 3.0 - Decide whether listeners should be
|
||||
* called in the order they were registered or in reverse order.
|
||||
*
|
||||
*
|
||||
* Parameters:
|
||||
* type - {String} Name of the event to register
|
||||
* obj - {Object} The object to bind the context to for the callback#.
|
||||
* If no object is specified, default is the Events's
|
||||
* 'object' property.
|
||||
* func - {Function} The callback function. If no callback is
|
||||
* specified, this function does nothing.
|
||||
*/
|
||||
registerPriority(type: string, obj: any, func: () => void) : void;
|
||||
/**
|
||||
* APIMethod: registerPriority
|
||||
* Same as register() but adds the new listener to the *front* of the
|
||||
* events queue instead of to the end.
|
||||
*
|
||||
* TODO: get rid of this in 3.0 - Decide whether listeners should be
|
||||
* called in the order they were registered or in reverse order.
|
||||
*
|
||||
*
|
||||
* Parameters:
|
||||
* type - {String} Name of the event to register
|
||||
* obj - {Object} The object to bind the context to for the callback#.
|
||||
* If no object is specified, default is the Events's
|
||||
* 'object' property.
|
||||
* func - {Function} The callback function. If no callback is
|
||||
* specified, this function does nothing.
|
||||
*/
|
||||
registerPriority(type: string, obj: any, func: () => void): void;
|
||||
|
||||
/**
|
||||
* APIMethod: un
|
||||
* Convenience method for unregistering listeners with a common scope.
|
||||
* Internally, this method calls <unregister> as shown in the examples
|
||||
* below.
|
||||
*
|
||||
* Example use:
|
||||
* (code)
|
||||
* // unregister a single listener for the "loadstart" event
|
||||
* events.un({"loadstart": loadStartListener});
|
||||
*
|
||||
* // this is equivalent to the following
|
||||
* events.unregister("loadstart", undefined, loadStartListener);
|
||||
*
|
||||
* // unregister multiple listeners with the same `this` object
|
||||
* events.un({
|
||||
* "loadstart": loadStartListener,
|
||||
* "loadend": loadEndListener,
|
||||
* scope: object
|
||||
* });
|
||||
*
|
||||
* // this is equivalent to the following
|
||||
* events.unregister("loadstart", object, loadStartListener);
|
||||
* events.unregister("loadend", object, loadEndListener);
|
||||
* (end)
|
||||
*/
|
||||
un(object: any) : void;
|
||||
/**
|
||||
* APIMethod: un
|
||||
* Convenience method for unregistering listeners with a common scope.
|
||||
* Internally, this method calls <unregister> as shown in the examples
|
||||
* below.
|
||||
*
|
||||
* Example use:
|
||||
* (code)
|
||||
* // unregister a single listener for the "loadstart" event
|
||||
* events.un({"loadstart": loadStartListener});
|
||||
*
|
||||
* // this is equivalent to the following
|
||||
* events.unregister("loadstart", undefined, loadStartListener);
|
||||
*
|
||||
* // unregister multiple listeners with the same `this` object
|
||||
* events.un({
|
||||
* "loadstart": loadStartListener,
|
||||
* "loadend": loadEndListener,
|
||||
* scope: object
|
||||
* });
|
||||
*
|
||||
* // this is equivalent to the following
|
||||
* events.unregister("loadstart", object, loadStartListener);
|
||||
* events.unregister("loadend", object, loadEndListener);
|
||||
* (end)
|
||||
*/
|
||||
un(object: any): void;
|
||||
|
||||
/**
|
||||
* APIMethod: unregister
|
||||
*
|
||||
* Parameters:
|
||||
* type - {String}
|
||||
* obj - {Object} If none specified, defaults to this.object
|
||||
* func - {Function}
|
||||
*/
|
||||
unregister(type: string, obj: any, func: () => void) : void;
|
||||
/**
|
||||
* APIMethod: unregister
|
||||
*
|
||||
* Parameters:
|
||||
* type - {String}
|
||||
* obj - {Object} If none specified, defaults to this.object
|
||||
* func - {Function}
|
||||
*/
|
||||
unregister(type: string, obj: any, func: () => void): void;
|
||||
|
||||
/**
|
||||
* Method: remove
|
||||
* Remove all listeners for a given event type. If type is not registered,
|
||||
* does nothing.
|
||||
*
|
||||
* Parameters:
|
||||
* type - {String}
|
||||
*/
|
||||
remove(type: string) : void;
|
||||
/**
|
||||
* Method: remove
|
||||
* Remove all listeners for a given event type. If type is not registered,
|
||||
* does nothing.
|
||||
*
|
||||
* Parameters:
|
||||
* type - {String}
|
||||
*/
|
||||
remove(type: string): void;
|
||||
|
||||
/**
|
||||
* APIMethod: triggerEvent
|
||||
* Trigger a specified registered event.
|
||||
*
|
||||
* Parameters:
|
||||
* type - {String}
|
||||
* evt - {Event || Object} will be passed to the listeners.
|
||||
*
|
||||
* Returns:
|
||||
* {Boolean} The last listener return. If a listener returns false, the
|
||||
* chain of listeners will stop getting called.
|
||||
*/
|
||||
triggerEvent(type: string, evt: Event) : boolean;
|
||||
/**
|
||||
* APIMethod: triggerEvent
|
||||
* Trigger a specified registered event.
|
||||
*
|
||||
* Parameters:
|
||||
* type - {String}
|
||||
* evt - {Event || Object} will be passed to the listeners.
|
||||
*
|
||||
* Returns:
|
||||
* {Boolean} The last listener return. If a listener returns false, the
|
||||
* chain of listeners will stop getting called.
|
||||
*/
|
||||
triggerEvent(type: string, evt: Event): boolean;
|
||||
|
||||
/**
|
||||
* Method: handleBrowserEvent
|
||||
* Basically just a wrapper to the triggerEvent() function, but takes
|
||||
* care to set a property 'xy' on the event with the current mouse
|
||||
* position.
|
||||
*
|
||||
* Parameters:
|
||||
* evt - {Event}
|
||||
*/
|
||||
handleBrowserEvent(evt: Event) : void;
|
||||
/**
|
||||
* Method: handleBrowserEvent
|
||||
* Basically just a wrapper to the triggerEvent() function, but takes
|
||||
* care to set a property 'xy' on the event with the current mouse
|
||||
* position.
|
||||
*
|
||||
* Parameters:
|
||||
* evt - {Event}
|
||||
*/
|
||||
handleBrowserEvent(evt: Event): void;
|
||||
|
||||
/**
|
||||
* Method: getMousePosition
|
||||
*
|
||||
* Parameters:
|
||||
* evt - {Event}
|
||||
*
|
||||
* Returns:
|
||||
* {<OpenLayers.Pixel>} The current xy coordinate of the mouse, adjusted
|
||||
* for offsets
|
||||
*/
|
||||
getMousePosition(evt: Event) : Pixel;
|
||||
/**
|
||||
* Method: getMousePosition
|
||||
*
|
||||
* Parameters:
|
||||
* evt - {Event}
|
||||
*
|
||||
* Returns:
|
||||
* {<OpenLayers.Pixel>} The current xy coordinate of the mouse, adjusted
|
||||
* for offsets
|
||||
*/
|
||||
getMousePosition(evt: Event): Pixel;
|
||||
}
|
||||
|
||||
export class Feature {
|
||||
@@ -1438,7 +1438,7 @@ declare module OpenLayers {
|
||||
/**
|
||||
* The element that contains the map (or an id for that element).
|
||||
*/
|
||||
div: Object;
|
||||
div: HTMLElement;
|
||||
|
||||
/**
|
||||
* The map is currently being dragged.
|
||||
@@ -4558,8 +4558,143 @@ declare module OpenLayers {
|
||||
getFullRequestString(newParams: Object, altUrl: string): string;
|
||||
}
|
||||
|
||||
export class Image {
|
||||
// TODO
|
||||
export class Image extends Layer {
|
||||
/**
|
||||
* Property: isBaseLayer
|
||||
* {Boolean} The layer is a base layer. Default is true. Set this property
|
||||
* in the layer options
|
||||
*/
|
||||
isBaseLayer: boolean;
|
||||
|
||||
/**
|
||||
* Property: url
|
||||
* {String} URL of the image to use
|
||||
*/
|
||||
url: string;
|
||||
|
||||
/**
|
||||
* Property: extent
|
||||
* {<OpenLayers.Bounds>} The image bounds in map units. This extent will
|
||||
* also be used as the default maxExtent for the layer. If you wish
|
||||
* to have a maxExtent that is different than the image extent, set the
|
||||
* maxExtent property of the options argument (as with any other layer).
|
||||
*/
|
||||
extent: OpenLayers.Bounds;
|
||||
|
||||
/**
|
||||
* Property: size
|
||||
* {<OpenLayers.Size>} The image size in pixels
|
||||
*/
|
||||
size: OpenLayers.Size;
|
||||
|
||||
/**
|
||||
* Property: tile
|
||||
* {<OpenLayers.Tile.Image>}
|
||||
*/
|
||||
tile: OpenLayers.Tile.Image;
|
||||
|
||||
/**
|
||||
* Property: aspectRatio
|
||||
* {Float} The ratio of height/width represented by a single pixel in the
|
||||
* graphic
|
||||
*/
|
||||
aspectRatio: number;
|
||||
|
||||
/**
|
||||
* Constructor: OpenLayers.Layer.Image
|
||||
* Create a new image layer
|
||||
*
|
||||
* Parameters:
|
||||
* name - {String} A name for the layer.
|
||||
* url - {String} Relative or absolute path to the image
|
||||
* extent - {<OpenLayers.Bounds>} The extent represented by the image
|
||||
* size - {<OpenLayers.Size>} The size (in pixels) of the image
|
||||
* options - {Object} Hashtable of extra options to tag onto the layer
|
||||
*/
|
||||
constructor(name: string, url: string, extent: OpenLayers.Bounds, size: OpenLayers.Size, options: any);
|
||||
|
||||
/**
|
||||
* Method: destroy
|
||||
* Destroy this layer
|
||||
*/
|
||||
destroy(): void;
|
||||
|
||||
/**
|
||||
* Method: clone
|
||||
* Create a clone of this layer
|
||||
*
|
||||
* Parameters:
|
||||
* obj - {Object} An optional layer (is this ever used?)
|
||||
*
|
||||
* Returns:
|
||||
* {<OpenLayers.Layer.Image>} An exact copy of this layer
|
||||
*/
|
||||
clone(obj?: any): OpenLayers.Layer.Image;
|
||||
|
||||
/**
|
||||
* APIMethod: setMap
|
||||
*
|
||||
* Parameters:
|
||||
* map - {<OpenLayers.Map>}
|
||||
*/
|
||||
setMap(map: OpenLayers.Map): void;
|
||||
|
||||
/**
|
||||
* Method: moveTo
|
||||
* Create the tile for the image or resize it for the new resolution
|
||||
*
|
||||
* Parameters:
|
||||
* bounds - {<OpenLayers.Bounds>}
|
||||
* zoomChanged - {Boolean}
|
||||
* dragging - {Boolean}
|
||||
*/
|
||||
moveTo(bounds: OpenLayers.Bounds, zoomChanged: boolean, dragging: boolean): void;
|
||||
|
||||
/**
|
||||
* Set the tile size based on the map size.
|
||||
*/
|
||||
setTileSize(): void;
|
||||
|
||||
/**
|
||||
* Method: addTileMonitoringHooks
|
||||
* This function takes a tile as input and adds the appropriate hooks to
|
||||
* the tile so that the layer can keep track of the loading tiles.
|
||||
*
|
||||
* Parameters:
|
||||
* tile - {<OpenLayers.Tile>}
|
||||
*/
|
||||
addTileMonitoringHooks(tile: OpenLayers.Tile): void;
|
||||
|
||||
/**
|
||||
* Method: removeTileMonitoringHooks
|
||||
* This function takes a tile as input and removes the tile hooks
|
||||
* that were added in <addTileMonitoringHooks>.
|
||||
*
|
||||
* Parameters:
|
||||
* tile - {<OpenLayers.Tile>}
|
||||
*/
|
||||
removeTileMonitoringHooks(tile: OpenLayers.Tile): void;
|
||||
|
||||
/**
|
||||
* APIMethod: setUrl
|
||||
*
|
||||
* Parameters:
|
||||
* newUrl - {String}
|
||||
*/
|
||||
setUrl(newUrl: string): void;
|
||||
|
||||
/**
|
||||
* APIMethod: getURL
|
||||
* The url we return is always the same (the image itself never changes)
|
||||
* so we can ignore the bounds parameter (it will always be the same,
|
||||
* anyways)
|
||||
*
|
||||
* Parameters:
|
||||
* bounds - {<OpenLayers.Bounds>}
|
||||
*/
|
||||
getURL(bounds: OpenLayers.Bounds): string;
|
||||
|
||||
CLASS_NAME: string;
|
||||
}
|
||||
export class KaMap {
|
||||
// TODO
|
||||
@@ -4823,7 +4958,7 @@ declare module OpenLayers {
|
||||
* url - {String}
|
||||
* options - {Object} Hashtable of extra options to tag onto the layer
|
||||
*/
|
||||
constructor(name: number, url: string, options: {});
|
||||
constructor(name: string, url: string, options?: any);
|
||||
|
||||
/**
|
||||
* APIMethod: clone
|
||||
@@ -4835,7 +4970,7 @@ declare module OpenLayers {
|
||||
* Returns:
|
||||
* {<OpenLayers.Layer.XYZ>} An exact clone of this OpenLayers.Layer.XYZ
|
||||
*/
|
||||
clone(obj?: Object): Layer.XYZ;
|
||||
clone(obj?: any): Layer.XYZ;
|
||||
|
||||
/**
|
||||
* Method: getURL
|
||||
|
||||
@@ -777,7 +777,7 @@ function TestWebElementPromise() {
|
||||
elementPromise.then();
|
||||
elementPromise.then(function (element: webdriver.WebElement) { });
|
||||
elementPromise.then(function (element: webdriver.WebElement) { }, function (error: any) { });
|
||||
elementPromise.then<string>(function (element: webdriver.WebElement) { }, function (error: any) { }).then(function (result: string) { });
|
||||
elementPromise.then(function (element: webdriver.WebElement) { return "foo"; }, function (error: any) { }).then(function (result: string) { });
|
||||
|
||||
elementPromise.thenCatch(function (error: any) { }).then(function (value: any) { });
|
||||
|
||||
@@ -1029,10 +1029,9 @@ function TestPromiseClass() {
|
||||
var isPending: boolean = promise.isPending();
|
||||
|
||||
promise = promise.then();
|
||||
promise = promise.then(function( a: string ) { });
|
||||
promise = promise.then(function( a: string ) { return 'cde'; });
|
||||
promise = promise.then(function( a: string ) {}, function( e: any) {});
|
||||
promise = promise.then(function (a: string) { }, function (e: any) { return 123; });
|
||||
promise = promise.then(function( a: string ) { return 'cde'; }, function( e: any) {});
|
||||
promise = promise.then(function( a: string ) { return 'cde'; }, function (e: any) { return 123; });
|
||||
|
||||
promise = promise.thenCatch(function (error: any) { });
|
||||
|
||||
@@ -1047,10 +1046,9 @@ function TestThenableClass() {
|
||||
var isPending: boolean = thenable.isPending();
|
||||
|
||||
thenable = thenable.then();
|
||||
thenable = thenable.then(function (a: string) { });
|
||||
thenable = thenable.then(function (a: string) { return 'cde'; });
|
||||
thenable = thenable.then(function (a: string) { }, function (e: any) { });
|
||||
thenable = thenable.then(function (a: string) { }, function (e: any) { return 123; });
|
||||
thenable = thenable.then(function (a: string) { return 'cde'; }, function (e: any) { });
|
||||
thenable = thenable.then(function (a: string) { return 'cde'; }, function (e: any) { return 123; });
|
||||
|
||||
thenable = thenable.thenCatch(function (error: any) { });
|
||||
|
||||
@@ -1158,4 +1156,4 @@ function TestTestingModule() {
|
||||
|
||||
testing.afterEach(function () {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
+82
-28
@@ -505,10 +505,10 @@ declare module firefox {
|
||||
}
|
||||
|
||||
declare module executors {
|
||||
/**
|
||||
* Creates a command executor that uses WebDriver's JSON wire protocol.
|
||||
* @param url The server's URL, or a promise that will resolve to that URL.
|
||||
* @returns {!webdriver.CommandExecutor} The new command executor.
|
||||
/**
|
||||
* Creates a command executor that uses WebDriver's JSON wire protocol.
|
||||
* @param url The server's URL, or a promise that will resolve to that URL.
|
||||
* @returns {!webdriver.CommandExecutor} The new command executor.
|
||||
*/
|
||||
function createExecutor(url: string): webdriver.CommandExecutor;
|
||||
function createExecutor(url: webdriver.promise.Promise<string>): webdriver.CommandExecutor;
|
||||
@@ -1055,17 +1055,30 @@ declare module webdriver {
|
||||
/**
|
||||
* Registers listeners for when this instance is resolved.
|
||||
*
|
||||
* @param {?(function(T): (R|webdriver.promise.Promise.<R>))=} opt_callback The
|
||||
* @param opt_callback The
|
||||
* function to call if this promise is successfully resolved. The function
|
||||
* should expect a single argument: the promise's resolved value.
|
||||
* @param {?(function(*): (R|webdriver.promise.Promise.<R>))=} opt_errback The
|
||||
* @param opt_errback The
|
||||
* function to call if this promise is rejected. The function should expect
|
||||
* a single argument: the rejection reason.
|
||||
* @return {!webdriver.promise.Promise.<R>} A new promise which will be
|
||||
* @return A new promise which will be
|
||||
* resolved with the result of the invoked callback.
|
||||
* @template R
|
||||
*/
|
||||
then<R>(opt_callback?: (value: T) => any, opt_errback?: (error: any) => any): Promise<R>;
|
||||
then<R>(opt_callback?: (value: T) => Promise<R>, opt_errback?: (error: any) => any): Promise<R>;
|
||||
|
||||
/**
|
||||
* Registers listeners for when this instance is resolved.
|
||||
*
|
||||
* @param opt_callback The
|
||||
* function to call if this promise is successfully resolved. The function
|
||||
* should expect a single argument: the promise's resolved value.
|
||||
* @param opt_errback The
|
||||
* function to call if this promise is rejected. The function should expect
|
||||
* a single argument: the rejection reason.
|
||||
* @return A new promise which will be
|
||||
* resolved with the result of the invoked callback.
|
||||
*/
|
||||
then<R>(opt_callback?: (value: T) => R, opt_errback?: (error: any) => any): Promise<R>;
|
||||
|
||||
|
||||
/**
|
||||
@@ -1161,17 +1174,30 @@ declare module webdriver {
|
||||
/**
|
||||
* Registers listeners for when this instance is resolved.
|
||||
*
|
||||
* @param {?(function(T): (R|webdriver.promise.Promise.<R>))=} opt_callback The
|
||||
* @param opt_callback The
|
||||
* function to call if this promise is successfully resolved. The function
|
||||
* should expect a single argument: the promise's resolved value.
|
||||
* @param {?(function(*): (R|webdriver.promise.Promise.<R>))=} opt_errback The
|
||||
* @param opt_errback The
|
||||
* function to call if this promise is rejected. The function should expect
|
||||
* a single argument: the rejection reason.
|
||||
* @return {!webdriver.promise.Promise.<R>} A new promise which will be
|
||||
* @return A new promise which will be
|
||||
* resolved with the result of the invoked callback.
|
||||
* @template R
|
||||
*/
|
||||
then<R>(opt_callback?: (value: T) => any, opt_errback?: (error: any) => any): Promise<R>;
|
||||
then<R>(opt_callback?: (value: T) => Promise<R>, opt_errback?: (error: any) => any): Promise<R>;
|
||||
|
||||
/**
|
||||
* Registers listeners for when this instance is resolved.
|
||||
*
|
||||
* @param opt_callback The
|
||||
* function to call if this promise is successfully resolved. The function
|
||||
* should expect a single argument: the promise's resolved value.
|
||||
* @param opt_errback The
|
||||
* function to call if this promise is rejected. The function should expect
|
||||
* a single argument: the rejection reason.
|
||||
* @return A new promise which will be
|
||||
* resolved with the result of the invoked callback.
|
||||
*/
|
||||
then<R>(opt_callback?: (value: T) => R, opt_errback?: (error: any) => any): Promise<R>;
|
||||
|
||||
|
||||
/**
|
||||
@@ -1304,16 +1330,31 @@ declare module webdriver {
|
||||
* Registers listeners for when this instance is resolved. This function most
|
||||
* overridden by subtypes.
|
||||
*
|
||||
* @param {Function=} opt_callback The function to call if this promise is
|
||||
* @param opt_callback The function to call if this promise is
|
||||
* successfully resolved. The function should expect a single argument: the
|
||||
* promise's resolved value.
|
||||
* @param {Function=} opt_errback The function to call if this promise is
|
||||
* @param opt_errback The function to call if this promise is
|
||||
* rejected. The function should expect a single argument: the rejection
|
||||
* reason.
|
||||
* @return {!webdriver.promise.Promise} A new promise which will be resolved
|
||||
* @return A new promise which will be resolved
|
||||
* with the result of the invoked callback.
|
||||
*/
|
||||
then<R>(opt_callback?: (value: T) => any, opt_errback?: (error: any) => any): Promise<R>;
|
||||
then<R>(opt_callback?: (value: T) => Promise<R>, opt_errback?: (error: any) => any): Promise<R>;
|
||||
|
||||
/**
|
||||
* Registers listeners for when this instance is resolved. This function most
|
||||
* overridden by subtypes.
|
||||
*
|
||||
* @param opt_callback The function to call if this promise is
|
||||
* successfully resolved. The function should expect a single argument: the
|
||||
* promise's resolved value.
|
||||
* @param opt_errback The function to call if this promise is
|
||||
* rejected. The function should expect a single argument: the rejection
|
||||
* reason.
|
||||
* @return A new promise which will be resolved
|
||||
* with the result of the invoked callback.
|
||||
*/
|
||||
then<R>(opt_callback?: (value: T) => R, opt_errback?: (error: any) => any): Promise<R>;
|
||||
|
||||
|
||||
/**
|
||||
@@ -1762,7 +1803,7 @@ declare module webdriver {
|
||||
|
||||
module until {
|
||||
/**
|
||||
* Defines a condition to
|
||||
* Defines a condition to
|
||||
*/
|
||||
class Condition<T> {
|
||||
/**
|
||||
@@ -3536,7 +3577,7 @@ declare module webdriver {
|
||||
* capabilities for the new session.
|
||||
* @param {webdriver.promise.ControlFlow=} opt_flow The control flow all driver
|
||||
* commands should execute under, including the initial session creation.
|
||||
* Defaults to the {@link webdriver.promise.controlFlow() currently active}
|
||||
* Defaults to the {@link webdriver.promise.controlFlow() currently active}
|
||||
* control flow.
|
||||
* @return {!webdriver.WebDriver} The driver for the newly created session.
|
||||
*/
|
||||
@@ -4554,17 +4595,30 @@ declare module webdriver {
|
||||
/**
|
||||
* Registers listeners for when this instance is resolved.
|
||||
*
|
||||
* @param {?(function(T): (R|webdriver.promise.Promise.<R>))=} opt_callback The
|
||||
* @param opt_callback The
|
||||
* function to call if this promise is successfully resolved. The function
|
||||
* should expect a single argument: the promise's resolved value.
|
||||
* @param {?(function(*): (R|webdriver.promise.Promise.<R>))=} opt_errback The
|
||||
* @param opt_errback The
|
||||
* function to call if this promise is rejected. The function should expect
|
||||
* a single argument: the rejection reason.
|
||||
* @return {!webdriver.promise.Promise.<R>} A new promise which will be
|
||||
* @return A new promise which will be
|
||||
* resolved with the result of the invoked callback.
|
||||
* @template R
|
||||
*/
|
||||
then<R>(opt_callback?: (value: WebElement) => any, opt_errback?: (error: any) => any): webdriver.promise.Promise<R>;
|
||||
then<R>(opt_callback?: (value: WebElement) => webdriver.promise.Promise<R>, opt_errback?: (error: any) => any): webdriver.promise.Promise<R>;
|
||||
|
||||
/**
|
||||
* Registers listeners for when this instance is resolved.
|
||||
*
|
||||
* @param opt_callback The
|
||||
* function to call if this promise is successfully resolved. The function
|
||||
* should expect a single argument: the promise's resolved value.
|
||||
* @param opt_errback The
|
||||
* function to call if this promise is rejected. The function should expect
|
||||
* a single argument: the rejection reason.
|
||||
* @return A new promise which will be
|
||||
* resolved with the result of the invoked callback.
|
||||
*/
|
||||
then<R>(opt_callback?: (value: WebElement) => R, opt_errback?: (error: any) => any): webdriver.promise.Promise<R>;
|
||||
|
||||
|
||||
/**
|
||||
@@ -4795,11 +4849,11 @@ declare module 'selenium-webdriver/chrome' {
|
||||
|
||||
declare module 'selenium-webdriver/firefox' {
|
||||
export = firefox;
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'selenium-webdriver/executors' {
|
||||
export = executors;
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'selenium-webdriver' {
|
||||
export = webdriver;
|
||||
@@ -4807,4 +4861,4 @@ declare module 'selenium-webdriver' {
|
||||
|
||||
declare module 'selenium-webdriver/testing' {
|
||||
export = testing;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user