# 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// Export the remainder of our API through getters to keep things cleaner68// when this module is used in a REPL environment.697071/** @type {webdriver.Browser.} */72(exports.__defineGetter__('Browser', function() {73  return base.require('webdriver.Browser');74}));757677/** @type {webdriver.Button.} */78(exports.__defineGetter__('Button', function() {79  return base.require('webdriver.Button');80}));818283/** @type {webdriver.Capability.} */84(exports.__defineGetter__('Capability', function() {85  return base.require('webdriver.Capability');86}));878889/** @type {webdriver.CommandName.} */90(exports.__defineGetter__('CommandName', function() {91  return base.require('webdriver.CommandName');92}));939495/** @type {webdriver.Key.} */96(exports.__defineGetter__('Key', function() {97  return base.require('webdriver.Key');98}));99100101/** @type {error.} */102(exports.__defineGetter__('error', function() {103  return error;104}));105106107/** @type {error.} */108(exports.__defineGetter__('error', function() {109  return error;110}));111112113/** @type {webdriver.promise.} */114(exports.__defineGetter__('promise', function() {115  return base.exportPublicApi('webdriver.promise');116}));117118119/** @type {webdriver.stacktrace.} */120(exports.__defineGetter__('stacktrace', function() {121  return base.exportPublicApi('webdriver.stacktrace');122}));