/** * This file has been auto-generated by {@link https://github.com/xolvio/meteor-webstorm} */ /* jshint ignore:start */ Meteor = Meteor || {}; EJSON = EJSON || {}; DDP = DDP || {}; Random = Random || {}; Deps = Deps || {}; Accounts = Accounts || {}; Match = Match || {}; Session = Session || {}; HTTP = HTTP || {}; UI = UI || {}; Email = Email || {}; Assets = Assets || {}; /** * Boolean variable. True if running in client environment. * * Runs Anywhere * * @method isClient * */ Meteor.isClient = function() {}; /** * Boolean variable. True if running in server environment. * * Runs Anywhere * * @method isServer * */ Meteor.isServer = function() {}; /** * Run code when a client or a server starts. * * Runs Anywhere * * @method startup * * @param {Function} func A function to run on startup. */ Meteor.startup = function(func) {}; /** * Generate an absolute URL pointing to the application. The server reads from the `ROOT_URL` environment variable to determine where it is running. This is taken care of automatically for apps deployed with `meteor deploy`, but must be provided when using `meteor bundle`. * * Runs Anywhere * * @method absoluteUrl * * @param {String} path A path to append to the root URL. Do not include a leading "`/`". */ Meteor.absoluteUrl = function() {}; /** * `Meteor.settings` contains deployment-specific configuration options. You can initialize settings by passing the `--settings` option (which takes the name of a file containing JSON data) to `meteor run` or `meteor deploy`. When running your server directly (e.g. from a bundle), you instead specify settings by putting the JSON directly into the `METEOR_SETTINGS` environment variable. If you don't provide any settings, `Meteor.settings` will be an empty object. If the settings object contains a key named `public`, then `Meteor.settings.public` will be available on the client as well as the server. All other properties of `Meteor.settings` are only defined on the server. * * Runs Anywhere * * @method settings * */ Meteor.settings = function() {}; /** * `Meteor.release` is a string containing the name of the [release](#meteorupdate) with which the project was built (for example, `"undefined"`). It is `undefined` if the project was built using a git checkout of Meteor. * * Runs Anywhere * * @method release * */ Meteor.release = function() {}; /** * Parse a string into an EJSON value. Throws an error if the string is not valid EJSON. * * Runs Anywhere * * @method parse * * @param {String} str A string to parse into an EJSON value. */ EJSON.parse = function(str) {}; /** * Serialize a value to a string. For EJSON values, the serialization fully represents the value. For non-EJSON values, serializes the same way as `JSON.stringify`. * * Runs Anywhere * * @method stringify * * @param {EJSON-compatible value} val A value to stringify. */ EJSON.stringify = function(val) {}; /** * Deserialize an EJSON value from its plain JSON representation. * * Runs Anywhere * * @method fromJSONValue * * @param {JSON-compatible value} val A value to deserialize into EJSON. */ EJSON.fromJSONValue = function(val) {}; /** * Serialize an EJSON-compatible value into its plain JSON representation. * * Runs Anywhere * * @method toJSONValue * * @param {EJSON-compatible value} val A value to serialize to plain JSON. */ EJSON.toJSONValue = function(val) {}; /** * Return true if `a` and `b` are equal to each other. Return false otherwise. Uses the `equals` method on `a` if present, otherwise performs a deep comparison. * * Runs Anywhere * * @method equals * * @param {EJSON-compatible object} a undefined * @param {EJSON-compatible object} b undefined */ EJSON.equals = function(a, b) {}; /** * Return a deep copy of `val`. * * Runs Anywhere * * @method clone * * @param {EJSON-compatible value} val A value to copy. */ EJSON.clone = function(val) {}; /** * Allocate a new buffer of binary data that EJSON can serialize. * * Runs Anywhere * * @method newBinary * * @param {Number} size The number of bytes of binary data to allocate. */ EJSON.newBinary = function(size) {}; /** * Returns true if `x` is a buffer of binary data, as returned from [`EJSON.newBinary`](#ejson_new_binary). * * Runs Anywhere * * @method isBinary * */ EJSON.isBinary = function(x) {}; /** * Add a custom datatype to EJSON. * * Runs Anywhere * * @method addType * * @param {String} name A tag for your custom type; must be unique among custom data types defined in your project, and must match the result of your type's `typeName` method. * @param {Function} factory A function that deserializes a JSON-compatible value into an instance of your type. This should match the serialization performed by your type's `toJSONValue` method. */ EJSON.addType = function(name, factory) {}; /** * Publish a record set. * * Runs on Server * * @method publish * * @param {String} name Name of the record set. If `null`, the set has no name, and the record set is automatically sent to all connected clients. * @param {Function} func Function called on the server each time a client subscribes. Inside the function, `this` is the publish handler object, described below. If the client passed arguments to `subscribe`, the function is called with the same arguments. */ Meteor.publish = function(name, func) {}; /** * Subscribe to a record set. Returns a handle that provides `stop()` and `ready()` methods. * * Runs on Client * * @method subscribe * * @param {String} name Name of the subscription. Matches the name of the server's `publish()` call. * @param {Any} arg1, arg2, ... Optional arguments passed to publisher function on server. * @param {Function or Object} callbacks Optional. May include `onError` and `onReady` callbacks. If a function is passed instead of an object, it is interpreted as an `onReady` callback. */ Meteor.subscribe = function(name) {}; /** * Defines functions that can be invoked over the network by clients. * * Runs Anywhere * * @method methods * * @param {Object} methods Dictionary whose keys are method names and values are functions. */ Meteor.methods = function(methods) {}; /** * Invokes a method passing any number of arguments. * * Runs Anywhere * * @method call * * @param {String} name Name of method to invoke * @param {EJSON} param1, param2, ... Optional method arguments * @param {Function} asyncCallback Optional callback, which is called asynchronously with the error or result after the method is complete. If not provided, the method runs synchronously if possible (see below). */ Meteor.call = function(name, param1, param2) {}; /** * Invoke a method passing an array of arguments. * * Runs Anywhere * * @method apply * * @param {String} name Name of method to invoke * @param {Array} params Method arguments * @param {Function} asyncCallback Optional callback; same semantics as in [`Meteor.call`](#meteor_call). */ Meteor.apply = function(name, params) {}; /** * Get the current connection status. A reactive data source. * * Runs on Client * * @method status * */ Meteor.status = function() {}; /** * Force an immediate reconnection attempt if the client is not connected to the server. This method does nothing if the client is already connected. * * Runs on Client * * @method reconnect * */ Meteor.reconnect = function() {}; /** * Disconnect the client from the server. * * Runs on Client * * @method disconnect * */ Meteor.disconnect = function() {}; /** * Connect to the server of a different Meteor application to subscribe to its document sets and invoke its remote methods. * * Runs Anywhere * * @method connect * * @param {String} url The URL of another Meteor application. */ DDP.connect = function(url) {}; /** * Register a callback to be called when a new DDP connection is made to the server. * * Runs on Server * * @method onConnection * * @param {function} callback The function to call when a new DDP connection is established. */ Meteor.onConnection = function(callback) {}; /** * Return a unique identifier. * * Runs Anywhere * * @method id * */ Random.id = function() {}; /** * Run a function now and rerun it later whenever its dependencies change. Returns a Computation object that can be used to stop or observe the rerunning. * * Runs on Client * * @method autorun * * @param {Function} runFunc The function to run. It receives one argument: the Computation object that will be returned. */ Deps.autorun = function(runFunc) {}; /** * Process all reactive updates immediately and ensure that all invalidated computations are rerun. * * Runs on Client * * @method flush * */ Deps.flush = function() {}; /** * Run a function without tracking dependencies. * * Runs on Client * * @method nonreactive * * @param {Function} func A function to call immediately. */ Deps.nonreactive = function(func) {}; /** * True if there is a current computation, meaning that dependencies on reactive data sources will be tracked and potentially cause the current computation to be rerun. * * Runs on Client * * @method active * */ Deps.active = function() {}; /** * The current computation, or `null` if there isn't one. The current computation is the [`Deps.Computation`](#deps_computation) object created by the innermost active call to `Deps.autorun`, and it's the computation that gains dependencies when reactive data sources are accessed. * * Runs on Client * * @method currentComputation * */ Deps.currentComputation = function() {}; /** * Registers a new [`onInvalidate`](#computation_oninvalidate) callback on the current computation (which must exist), to be called immediately when the current computation is invalidated or stopped. * * Runs on Client * * @method onInvalidate * * @param {Function} callback A callback function that will be invoked as `func(c)`, where `c` is the computation on which the callback is registered. */ Deps.onInvalidate = function(callback) {}; /** * Schedules a function to be called during the next flush, or later in the current flush if one is in progress, after all invalidated computations have been rerun. The function will be run once and not on subsequent flushes unless `afterFlush` is called again. * * Runs on Client * * @method afterFlush * * @param {Function} callback A function to call at flush time. */ Deps.afterFlush = function(callback) {}; /** * Get the current user record, or `null` if no user is logged in. A reactive data source. * * Runs Anywhere but publish functions * * @method user * */ Meteor.user = function() {}; /** * Get the current user id, or `null` if no user is logged in. A reactive data source. * * Runs Anywhere but publish functions * * @method userId * */ Meteor.userId = function() {}; /** * A [Meteor.Collection](#collections) containing user documents. * * Runs Anywhere * * @method users * */ Meteor.users = function() {}; /** * True if a login method (such as `Meteor.loginWithPassword`, `Meteor.loginWithFacebook`, or `Accounts.createUser`) is currently in progress. A reactive data source. * * Runs on Client * * @method loggingIn * */ Meteor.loggingIn = function() {}; /** * Log the user out. * * Runs on Client * * @method logout * * @param {Function} callback Optional callback. Called with no arguments on success, or with a single `Error` argument on failure. */ Meteor.logout = function() {}; /** * Log out other clients logged in as the current user, but does not log out the client that calls this function. * * Runs on Client * * @method logoutOtherClients * * @param {Function} callback Optional callback. Called with no arguments on success, or with a single `Error` argument on failure. */ Meteor.logoutOtherClients = function() {}; /** * Log the user in with a password. * * Runs on Client * * @method loginWithPassword * * @param {Object or String} user Either a string interpreted as a username or an email; or an object with a single key: `email`, `username` or `id`. * @param {String} password The user's password. This is __not__ sent in plain text over the wire — it is secured with [SRP](http://en.wikipedia.org/wiki/Secure_Remote_Password_protocol). * @param {Function} callback Optional callback. Called with no arguments on success, or with a single `Error` argument on failure. */ Meteor.loginWithPassword = function(user, password) {}; /** * Log the user in using an external service. * * Runs on Client * * @method loginWithExternalService * * @param {Function} callback Optional callback. Called with no arguments on success, or with a single `Error` argument on failure. */ Meteor.loginWithExternalService = function() {}; /** * Set global accounts options. * * Runs Anywhere * * @method config * */ Accounts.config = function(options) {}; /** * Set restrictions on new user creation. * * Runs on Server * * @method validateNewUser * * @param {Function} func Called whenever a new user is created. Takes the new user object, and returns true to allow the creation or false to abort. */ Accounts.validateNewUser = function(func) {}; /** * Customize new user creation. * * Runs on Server * * @method onCreateUser * * @param {Function} func Called whenever a new user is created. Return the new user object, or throw an `Error` to abort the creation. */ Accounts.onCreateUser = function(func) {}; /** * Validate login attempts. * * Runs on Server * * @method validateLoginAttempt * * @param {Function} func Called whenever a login is attempted (either successful or unsuccessful). A login can be aborted by returning a falsy value or throwing an exception. */ Accounts.validateLoginAttempt = function(func) {}; /** * Register a callback to be called after a login attempt. * * Runs on Server * * @method onLogin * * @param {Function} func The callback to be called after the login attempt */ Accounts.onLogin = function(func) {}; /** * Create a new user. * * Runs Anywhere * * @method createUser * * @param {Function} callback Client only, optional callback. Called with no arguments on success, or with a single `Error` argument on failure. */ Accounts.createUser = function(options) {}; /** * Change the current user's password. Must be logged in. * * Runs on Client * * @method changePassword * * @param {String} oldPassword The user's current password. This is __not__ sent in plain text over the wire. * @param {String} newPassword A new password for the user. This is __not__ sent in plain text over the wire. * @param {Function} callback Optional callback. Called with no arguments on success, or with a single `Error` argument on failure. */ Accounts.changePassword = function(oldPassword, newPassword) {}; /** * Request a forgot password email. * * Runs on Client * * @method forgotPassword * * @param {Function} callback Optional callback. Called with no arguments on success, or with a single `Error` argument on failure. */ Accounts.forgotPassword = function(options) {}; /** * Reset the password for a user using a token received in email. Logs the user in afterwards. * * Runs on Client * * @method resetPassword * * @param {String} token The token retrieved from the reset password URL. * @param {String} newPassword A new password for the user. This is __not__ sent in plain text over the wire. * @param {Function} callback Optional callback. Called with no arguments on success, or with a single `Error` argument on failure. */ Accounts.resetPassword = function(token, newPassword) {}; /** * Forcibly change the password for a user. * * Runs on Server * * @method setPassword * * @param {String} userId The id of the user to update. * @param {String} newPassword A new password for the user. */ Accounts.setPassword = function(userId, newPassword) {}; /** * Marks the user's email address as verified. Logs the user in afterwards. * * Runs on Client * * @method verifyEmail * * @param {String} token The token retrieved from the verification URL. * @param {Function} callback Optional callback. Called with no arguments on success, or with a single `Error` argument on failure. */ Accounts.verifyEmail = function(token) {}; /** * Send an email with a link the user can use to reset their password. * * Runs on Server * * @method sendResetPasswordEmail * * @param {String} userId The id of the user to send email to. * @param {String} email Optional. Which address of the user's to send the email to. This address must be in the user's `emails` list. Defaults to the first email in the list. */ Accounts.sendResetPasswordEmail = function(userId) {}; /** * Send an email with a link the user can use to set their initial password. * * Runs on Server * * @method sendEnrollmentEmail * * @param {String} userId The id of the user to send email to. * @param {String} email Optional. Which address of the user's to send the email to. This address must be in the user's `emails` list. Defaults to the first email in the list. */ Accounts.sendEnrollmentEmail = function(userId) {}; /** * Send an email with a link the user can use verify their email address. * * Runs on Server * * @method sendVerificationEmail * * @param {String} userId The id of the user to send email to. * @param {String} email Optional. Which address of the user's to send the email to. This address must be in the user's `emails` list. Defaults to the first unverified email in the list. */ Accounts.sendVerificationEmail = function(userId) {}; /** * Options to customize emails sent from the Accounts system. * * Runs Anywhere * * @method emailTemplates * */ Accounts.emailTemplates = function() {}; /** * Returns true if the value matches the [pattern](#matchpatterns). * * Runs Anywhere * * @method test * * @param {Any} value The value to check * @param {Match pattern} pattern The [pattern](#matchpatterns) to match `value` against */ Match.test = function(value, pattern) {}; /** * Call a function in the future after waiting for a specified delay. * * Runs Anywhere * * @method setTimeout * * @param {Function} func The function to run * @param {Number} delay Number of milliseconds to wait before calling function */ Meteor.setTimeout = function(func, delay) {}; /** * Call a function repeatedly, with a time delay between calls. * * Runs Anywhere * * @method setInterval * * @param {Function} func The function to run * @param {Number} delay Number of milliseconds to wait between each function call. */ Meteor.setInterval = function(func, delay) {}; /** * Cancel a function call scheduled by `Meteor.setTimeout`. * * Runs Anywhere * * @method clearTimeout * * @param {Number} id The handle returned by `Meteor.setTimeout` */ Meteor.clearTimeout = function(id) {}; /** * Cancel a repeating function call scheduled by `Meteor.setInterval`. * * Runs Anywhere * * @method clearInterval * * @param {Number} id The handle returned by `Meteor.setInterval` */ Meteor.clearInterval = function(id) {}; /** * Return the current value of an EnvironmentVariable. * * Runs Anywhere * * @method get * */ Meteor.get = function() {}; /** * Run `func` with the `env_var`'s value set to `value`. * * Runs Anywhere * * @method withValue * * @param {Anything} value Desired value of the environment variable. * @param {Function} func Function to call */ Meteor.withValue = function(value, func) {}; /** * Return a new function that calls `func` with `this` set to `_this`, and with environment variables set to their current values. * * Runs Anywhere * * @method bindEnvironment * * @param {Function} func Function to wrap * @param {Function} onException Function to call if `func` throws an exception. It expects the thrown exception as its single argument. * @param {Object} _this Value of `this` inside `func`. */ Meteor.bindEnvironment = function(func, onException, _this) {}; /** * Set a variable in the session. Notify any listeners that the value has changed (eg: redraw templates, and rerun any [`Deps.autorun`](#deps_autorun) computations, that called [`Session.get`](#session_get) on this `key`.) * * Runs on Client * * @method set * * @param {String} key The key to set, eg, `selectedItem` * @param {EJSON-able object or undefined} value The new value for `key` */ Session.set = function(key, value) {}; /** * Set a variable in the session if it is undefined. Otherwise works exactly the same as [`Session.set`](#session_set). * * Runs on Client * * @method setDefault * * @param {String} key The key to set, eg, `selectedItem` * @param {EJSON-able object or undefined} value The new value for `key` */ Session.setDefault = function(key, value) {}; /** * Get the value of a session variable. If inside a [reactive computation](#reactivity), invalidate the computation the next time the value of the variable is changed by [`Session.set`](#session_set). This returns a clone of the session value, so if it's an object or an array, mutating the returned value has no effect on the value stored in the session. * * Runs on Client * * @method get * * @param {String} key The name of the session variable to return */ Session.get = function(key) {}; /** * Test if a session variable is equal to a value. If inside a [reactive computation](#reactivity), invalidate the computation the next time the variable changes to or from the value. * * Runs on Client * * @method equals * * @param {String} key The name of the session variable to test * @param {String, Number, Boolean, null, or undefined} value The value to test against */ Session.equals = function(key, value) {}; /** * Perform an outbound HTTP request. * * Runs Anywhere * * @method call * * @param {String} method The [HTTP method](http://en.wikipedia.org/wiki/HTTP_method) to use, such as "`GET`", "`POST`", or "`HEAD`". * @param {String} url The URL to retrieve. * @param {Function} asyncCallback Optional callback. If passed, the method runs asynchronously, instead of synchronously, and calls asyncCallback. On the client, this callback is required. */ HTTP.call = function(method, url) {}; /** * Send an HTTP GET request. Equivalent to `HTTP.call("GET", ...)`. * * Runs Anywhere * * @method get * */ HTTP.get = function(url) {}; /** * Send an HTTP POST request. Equivalent to `HTTP.call("POST", ...)`. * * Runs Anywhere * * @method post * */ HTTP.post = function(url) {}; /** * Send an HTTP PUT request. Equivalent to `HTTP.call("PUT", ...)`. * * Runs Anywhere * * @method put * */ HTTP.put = function(url) {}; /** * Send an HTTP DELETE request. Equivalent to `HTTP.call("DELETE", ...)`. (Named `del` to avoid conflict with JavaScript's `delete`.) * * Runs Anywhere * * @method del * */ HTTP.del = function(url) {}; /** * Defines a [helper function](#template_helpers) which can be used from all templates. * * Runs on Client * * @method registerHelper * * @param {String} name The name of the helper function you are defining. * @param {Function} func The helper function itself. */ UI.registerHelper = function(name, func) {}; /** * The [component object](#templates_api) representing your `
` tag. * * Runs on Client * * @method body * */ UI.body = function() {}; /** * Executes a template's logic. * * Runs on Client * * @method render * * @param {Template} template The particular template to evaluate. */ UI.render = function(myTemplate) {}; /** * Executes a template's logic with a data context. Otherwise identical to `UI.render`. * * Runs on Client * * @method renderWithData * * @param {Template} template The particular template to evaluate. * @param {Object} data The data context that will be used when evaluating the template. */ UI.renderWithData = function(myTemplate, data) {}; /** * Inserts an instantiated component into the DOM and calls its [`rendered`](#template_rendered) callback. * * Runs on Client * * @method insert * * @param {Instantiated component object} instantiatedComponent The return value from `UI.render` or `UI.renderWithData`. * @param {DOM Node} parentNode The node that will be the parent of the rendered template. * @param {DOM Node} nextNode If provided, must be a child of parentNode; the template will be inserted before this node. If not provided, the template will be inserted as the last child. */ UI.insert = function(instantiatedComponent, parentNode) {}; /** * Returns the data context that was used when rendering a DOM element from a Meteor template. * * Runs on Client * * @method getElementData * * @param {DOM Element} el An element that was rendered by a Meteor template */ UI.getElementData = function(el) {}; /** * Send an email. Throws an `Error` on failure to contact mail server or if mail server returns an error. * * Runs on Server * * @method send * */ Email.send = function(options) {}; /** * Retrieve the contents of the static server asset as a UTF8-encoded string. * * Runs on Server * * @method getText * * @param {String} assetPath The path of the asset, relative to the application's `private` subdirectory. * @param {Function} asyncCallback Optional callback, which is called asynchronously with the error or result after the function is complete. If not provided, the function runs synchronously. */ Assets.getText = function(assetPath) {}; /** * Retrieve the contents of the static server asset as an [EJSON Binary](#ejson_new_binary). * * Runs on Server * * @method getBinary * * @param {String} assetPath The path of the asset, relative to the application's `private` subdirectory. * @param {Function} asyncCallback Optional callback, which is called asynchronously with the error or result after the function is complete. If not provided, the function runs synchronously. */ Assets.getBinary = function(assetPath) {}; /* jshint ignore:end */