# index.js

    1// Copyright 2012 Selenium committers2// Copyright 2012 Software Freedom Conservancy3//4// Licensed under the Apache License, Version 2.0 (the "License");5// you may not use this file except in compliance with the License.6//     You may obtain a copy of the License at7//8// http://www.apache.org/licenses/LICENSE-2.09//10// Unless required by applicable law or agreed to in writing, software11// distributed under the License is distributed on an "AS IS" BASIS,12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.13// See the License for the specific language governing permissions and14// limitations under the License.1516/**17 * @fileoverview The main user facing module. Exports WebDriver's primary18 * public API and provides convenience assessors to certain sub-modules.19 */2021var base = require('./_base');22var builder = require('./builder');23var error = require('./error');242526// NOTE: the remainder of this file is nasty and verbose, but the annotations27// are necessary to guide the Closure Compiler's type analysis. Without them,28// we would not be able to extract any meaningful API documentation.293031/** @type {function(new: webdriver.ActionSequence)} */32exports.ActionSequence = base.require('webdriver.ActionSequence');333435/** @type {function(new: builder.Builder)} */36exports.Builder = builder.Builder;373839/** @type {webdriver.By.} */40exports.By = base.require('webdriver.By');414243/** @type {function(new: webdriver.Capabilities)} */44exports.Capabilities = base.require('webdriver.Capabilities');454647/** @type {function(new: webdriver.Command)} */48exports.Command = base.require('webdriver.Command');495051/** @type {function(new: webdriver.EventEmitter)} */52exports.EventEmitter = base.require('webdriver.EventEmitter');535455/** @type {function(new: webdriver.Session)} */56exports.Session = base.require('webdriver.Session');575859/** @type {function(new: webdriver.WebDriver)} */60exports.WebDriver = base.require('webdriver.WebDriver');616263/** @type {function(new: webdriver.WebElement)} */64exports.WebElement = base.require('webdriver.WebElement');656667/** @type {function(new: webdriver.WebElementPromise)} */68exports.WebElementPromise = base.require('webdriver.WebElementPromise');697071// Export the remainder of our API through getters to keep things cleaner72// when this module is used in a REPL environment.737475/** @type {webdriver.Browser.} */76(exports.__defineGetter__('Browser', function() {77  return base.require('webdriver.Browser');78}));798081/** @type {webdriver.Button.} */82(exports.__defineGetter__('Button', function() {83  return base.require('webdriver.Button');84}));858687/** @type {webdriver.Capability.} */88(exports.__defineGetter__('Capability', function() {89  return base.require('webdriver.Capability');90}));919293/** @type {webdriver.CommandName.} */94(exports.__defineGetter__('CommandName', function() {95  return base.require('webdriver.CommandName');96}));979899/** @type {webdriver.Key.} */100(exports.__defineGetter__('Key', function() {101  return base.require('webdriver.Key');102}));103104105/** @type {error.} */106(exports.__defineGetter__('error', function() {107  return error;108}));109110111/** @type {error.} */112(exports.__defineGetter__('error', function() {113  return error;114}));115116117/** @type {webdriver.logging.} */118(exports.__defineGetter__('logging', function() {119  return base.exportPublicApi('webdriver.logging');120}));121122123/** @type {webdriver.promise.} */124(exports.__defineGetter__('promise', function() {125  return base.exportPublicApi('webdriver.promise');126}));127128129/** @type {webdriver.stacktrace.} */130(exports.__defineGetter__('stacktrace', function() {131  return base.exportPublicApi('webdriver.stacktrace');132}));133134135/** @type {webdriver.until.} */136(exports.__defineGetter__('until', function() {137  return base.exportPublicApi('webdriver.until');138}));