{ "classes": { "AccountStore": { "name": "AccountStore", "superClass": "NylasStore", "filename": "docs_src/classes/temp-cjsx/account-store.js", "srcUrl": null, "sections": [], "classMethods": [], "instanceMethods": [ { "name": "accountForId", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "", "description": "", "returnValues": [ { "type": "Account", "description": "Returns the {Account} for the given account id, or null." } ] }, { "name": "current", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "", "description": "", "returnValues": [ { "type": "Account", "description": "Returns the currently active {Account}." } ] } ], "classProperties": [], "instanceProperties": [], "visibility": "Public", "summary": "The AccountStore listens to changes to the available accounts in\nthe database and exposes the currently active Account via {::current}", "description": "The AccountStore listens to changes to the available accounts in\nthe database and exposes the currently active Account via {::current}\n\nSection: Stores" }, "Actions": { "name": "Actions", "superClass": null, "filename": "docs_src/classes/temp-cjsx/actions.js", "srcUrl": null, "sections": [], "classMethods": [], "instanceMethods": [], "classProperties": [], "instanceProperties": [], "visibility": "Public", "summary": "In the Flux {Architecture.md}, almost every user action\nis translated into an Action object and fired globally. Stores in the app observe\nthese actions and perform business logic. This loose coupling means that your\npackages can observe actions and perform additional logic, or fire actions which\nthe rest of the app will handle.", "description": "In the Flux {Architecture.md}, almost every user action\nis translated into an Action object and fired globally. Stores in the app observe\nthese actions and perform business logic. This loose coupling means that your\npackages can observe actions and perform additional logic, or fire actions which\nthe rest of the app will handle.\n\nIn Reflux, each {Action} is an independent object that acts as an event emitter.\nYou can listen to an Action, or invoke it as a function to fire it.\n\n## Action Scopes\n\nN1 is a multi-window application. The `scope` of an Action dictates\nhow it propogates between windows.\n\n* **Global**: These actions can be listened to from any window and fired from any\n window. The action is sent from the originating window to all other windows via\n IPC, so they should be used with care. Firing this action from anywhere will\n cause all listeners in all windows to fire.\n* **Main Window**: You can fire these actions in any window. They'll be sent\n to the main window and triggered there.\n* **Window**: These actions only trigger listeners in the window they're fired in.\n\n## Firing Actions\n\n```coffee\nActions.queueTask(new ChangeStarredTask(thread: @_thread, starred: true))\n```\n\n## Listening for Actions\n\nIf you're using Reflux to create your own Store, you can use the `listenTo`\nconvenience method to listen for an Action. If you're creating your own class\nthat is not a Store, you can still use the `listen` method provided by Reflux:\n\n```coffee\nsetup: ->\n @unlisten = Actions.onNewMailDeltas.listen(@onNewMailReceived, @)\n\nonNewMailReceived: (data) ->\n console.log(\"You've got mail!\", data)\n\nteardown: ->\n @unlisten()\n```\n\nSection: General" }, "Attribute": { "name": "Attribute", "superClass": null, "filename": "docs_src/classes/temp-cjsx/attribute.js", "srcUrl": null, "sections": [], "classMethods": [], "instanceMethods": [ { "name": "equal", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "", "description": "", "returnValues": [ { "type": "Matcher", "description": "Returns a {Matcher} for objects `=` to the provided value." } ] }, { "name": "in", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "", "description": "", "returnValues": [ { "type": "Matcher", "description": "Returns a {Matcher} for objects `=` to the provided value." } ] }, { "name": "not", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "", "description": "", "returnValues": [ { "type": "Matcher", "description": "Returns a {Matcher} for objects `!=` to the provided value." } ] }, { "name": "descending", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "", "description": "", "returnValues": [ { "type": "SortOrder", "description": "Returns a descending {SortOrder} for this attribute." } ] }, { "name": "ascending", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "", "description": "", "returnValues": [ { "type": "SortOrder", "description": "Returns an ascending {SortOrder} for this attribute." } ] } ], "classProperties": [], "instanceProperties": [], "visibility": "Public", "summary": "The Attribute class represents a single model attribute, like 'account_id'.\nSubclasses of {Attribute} like {AttributeDateTime} know how to covert between\nthe JSON representation of that type and the javascript representation.\nThe Attribute class also exposes convenience methods for generating {Matcher} objects.", "description": "The Attribute class represents a single model attribute, like 'account_id'.\nSubclasses of {Attribute} like {AttributeDateTime} know how to covert between\nthe JSON representation of that type and the javascript representation.\nThe Attribute class also exposes convenience methods for generating {Matcher} objects.\n\nSection: Database" }, "AttributeBoolean": { "name": "AttributeBoolean", "superClass": "Attribute", "filename": "docs_src/classes/temp-cjsx/attribute-boolean.js", "srcUrl": null, "sections": [], "classMethods": [], "instanceMethods": [], "classProperties": [], "instanceProperties": [], "visibility": "Public", "summary": "The value of this attribute is always a boolean. Null values are coerced to false.", "description": "The value of this attribute is always a boolean. Null values are coerced to false.\n\nString attributes can be queries using `equal` and `not`. Matching on\n`greaterThan` and `lessThan` is not supported.\n\nSection: Database" }, "AttributeCollection": { "name": "AttributeCollection", "superClass": "Attribute", "filename": "docs_src/classes/temp-cjsx/attribute-collection.js", "srcUrl": null, "sections": [], "classMethods": [], "instanceMethods": [ { "name": "contains", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "", "description": "", "returnValues": [ { "type": "Matcher", "description": "Returns a {Matcher} for objects containing the provided value." } ] } ], "classProperties": [], "instanceProperties": [], "visibility": "Public", "summary": "Collection attributes provide basic support for one-to-many relationships.\nFor example, Threads in N1 have a collection of Labels or Folders.", "description": "Collection attributes provide basic support for one-to-many relationships.\nFor example, Threads in N1 have a collection of Labels or Folders.\n\nWhen Collection attributes are marked as `queryable`, the DatabaseStore\nautomatically creates a join table and maintains it as you create, save,\nand delete models. When you call `persistModel`, entries are added to the\njoin table associating the ID of the model with the IDs of models in the collection.\n\nCollection attributes have an additional clause builder, `contains`:\n\n```coffee\nDatabaseStore.findAll(Thread).where([Thread.attributes.categories.contains('inbox')])\n```\n\nThis is equivalent to writing the following SQL:\n\n```sql\nSELECT `Thread`.`data` FROM `Thread`\nINNER JOIN `ThreadLabel` AS `M1` ON `M1`.`id` = `Thread`.`id`\nWHERE `M1`.`value` = 'inbox'\nORDER BY `Thread`.`last_message_received_timestamp` DESC\n```\n\nThe value of this attribute is always an array of other model objects.\n\nSection: Database" }, "AttributeDateTime": { "name": "AttributeDateTime", "superClass": "Attribute", "filename": "docs_src/classes/temp-cjsx/attribute-datetime.js", "srcUrl": null, "sections": [], "classMethods": [], "instanceMethods": [ { "name": "greaterThan", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "", "description": "", "returnValues": [ { "type": "Matcher", "description": "Returns a {Matcher} for objects greater than the provided value." } ] }, { "name": "lessThan", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "", "description": "", "returnValues": [ { "type": "Matcher", "description": "Returns a {Matcher} for objects less than the provided value." } ] }, { "name": "greaterThanOrEqualTo", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "", "description": "", "returnValues": [ { "type": "Matcher", "description": "Returns a {Matcher} for objects greater than the provided value." } ] }, { "name": "lessThanOrEqualTo", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "", "description": "", "returnValues": [ { "type": "Matcher", "description": "Returns a {Matcher} for objects less than the provided value." } ] } ], "classProperties": [], "instanceProperties": [], "visibility": "Public", "summary": "The value of this attribute is always a Javascript `Date`, or `null`.", "description": "The value of this attribute is always a Javascript `Date`, or `null`.\n\nSection: Database" }, "AttributeJoinedData": { "name": "AttributeJoinedData", "superClass": "Attribute", "filename": "docs_src/classes/temp-cjsx/attribute-joined-data.js", "srcUrl": null, "sections": [], "classMethods": [], "instanceMethods": [], "classProperties": [], "instanceProperties": [], "visibility": "Public", "summary": "Joined Data attributes allow you to store certain attributes of an\nobject in a separate table in the database. We use this attribute\ntype for Message bodies. Storing message bodies, which can be very\nlarge, in a separate table allows us to make queries on message\nmetadata extremely fast, and inflate Message objects without their\nbodies to build the thread list.", "description": "Joined Data attributes allow you to store certain attributes of an\nobject in a separate table in the database. We use this attribute\ntype for Message bodies. Storing message bodies, which can be very\nlarge, in a separate table allows us to make queries on message\nmetadata extremely fast, and inflate Message objects without their\nbodies to build the thread list.\n\nWhen building a query on a model with a JoinedData attribute, you need\nto call `include` to explicitly load the joined data attribute.\nThe query builder will automatically perform a `LEFT OUTER JOIN` with\nthe secondary table to retrieve the attribute:\n\n```coffee\nDatabaseStore.find(Message, '123').then (message) ->\n // message.body is undefined\n\nDatabaseStore.find(Message, '123').include(Message.attributes.body).then (message) ->\n // message.body is defined\n```\n\nWhen you call `persistModel`, JoinedData attributes are automatically\nwritten to the secondary table.\n\nJoinedData attributes cannot be `queryable`.\n\nSection: Database" }, "AttributeNumber": { "name": "AttributeNumber", "superClass": "Attribute", "filename": "docs_src/classes/temp-cjsx/attribute-number.js", "srcUrl": null, "sections": [], "classMethods": [], "instanceMethods": [ { "name": "greaterThan", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "", "description": "", "returnValues": [ { "type": "Matcher", "description": "Returns a {Matcher} for objects greater than the provided value." } ] }, { "name": "lessThan", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "", "description": "", "returnValues": [ { "type": "Matcher", "description": "Returns a {Matcher} for objects less than the provided value." } ] }, { "name": "greaterThanOrEqualTo", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "", "description": "", "returnValues": [ { "type": "Matcher", "description": "Returns a {Matcher} for objects greater than the provided value." } ] }, { "name": "lessThanOrEqualTo", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "", "description": "", "returnValues": [ { "type": "Matcher", "description": "Returns a {Matcher} for objects less than the provided value." } ] } ], "classProperties": [], "instanceProperties": [], "visibility": "Public", "summary": "The value of this attribute is always a number, or null.", "description": "The value of this attribute is always a number, or null.\n\nSection: Database" }, "AttributeObject": { "name": "AttributeObject", "superClass": "Attribute", "filename": "docs_src/classes/temp-cjsx/attribute-object.js", "srcUrl": null, "sections": [], "classMethods": [], "instanceMethods": [], "classProperties": [], "instanceProperties": [], "visibility": "Public", "summary": "An object that can be cast to `itemClass`\nSection: Database", "description": "An object that can be cast to `itemClass`\nSection: Database" }, "AttributeServerId": { "name": "AttributeServerId", "superClass": "AttributeString", "filename": "docs_src/classes/temp-cjsx/attribute-serverid.js", "srcUrl": null, "sections": [], "classMethods": [], "instanceMethods": [], "classProperties": [], "instanceProperties": [], "visibility": "Public", "summary": "The value of this attribute is always a string or `null`.", "description": "The value of this attribute is always a string or `null`.\n\nString attributes can be queries using `equal`, `not`, and `startsWith`. Matching on\n`greaterThan` and `lessThan` is not supported.\n\nSection: Database" }, "AttributeString": { "name": "AttributeString", "superClass": "Attribute", "filename": "docs_src/classes/temp-cjsx/attribute-string.js", "srcUrl": null, "sections": [], "classMethods": [], "instanceMethods": [ { "name": "startsWith", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "", "description": "", "returnValues": [ { "type": "Matcher", "description": "Returns a {Matcher} for objects starting with the provided value." } ] } ], "classProperties": [], "instanceProperties": [], "visibility": "Public", "summary": "The value of this attribute is always a string or `null`.", "description": "The value of this attribute is always a string or `null`.\n\nString attributes can be queries using `equal`, `not`, and `startsWith`. Matching on\n`greaterThan` and `lessThan` is not supported.\n\nSection: Database" }, "BufferedProcess": { "name": "BufferedProcess", "filename": "buffered-process.coffee", "srcUrl": null, "sections": [ { "name": "Construction", "description": "" }, { "name": "Event Subscription", "description": "" }, { "name": "Helper Methods", "description": "" } ], "classMethods": [], "instanceMethods": [ { "name": "constructor", "sectionName": "Construction", "srcUrl": null, "visibility": "Public", "summary": "Runs the given command by spawning a new child process.", "description": "Runs the given command by spawning a new child process.", "arguments": [ { "children": [ { "name": "command", "description": "The {String} command to execute.", "type": "String", "isOptional": false }, { "name": "args", "description": "The {Array} of arguments to pass to the command (optional).", "type": "Array", "isOptional": false }, { "name": "options", "description": "{Object} (optional) The options {Object} to pass to Node's `ChildProcess.spawn` method.", "type": "Object", "isOptional": false }, { "children": [ { "name": "data", "description": "{String}", "type": "String", "isOptional": false } ], "name": "stdout", "description": "{Function} (optional) The callback that receives a single argument which contains the standard output from the command. The callback is called as data is received but it's buffered to ensure only complete lines are passed until the source stream closes. After the source stream has closed all remaining data is sent in a final call.", "type": "Function", "isOptional": false }, { "children": [ { "name": "data", "description": "{String}", "type": "String", "isOptional": false } ], "name": "stderr", "description": "{Function} (optional) The callback that receives a single argument which contains the standard error output from the command. The callback is called as data is received but it's buffered to ensure only complete lines are passed until the source stream closes. After the source stream has closed all remaining data is sent in a final call.", "type": "Function", "isOptional": false }, { "children": [ { "name": "code", "description": "{Number} ", "type": "Number", "isOptional": false } ], "name": "exit", "description": "{Function} (optional) The callback which receives a single argument containing the exit status.", "type": "Function", "isOptional": false } ], "name": "options", "description": "An {Object} with the following keys:", "type": "Object", "isOptional": false } ] }, { "name": "onWillThrowError", "sectionName": "Event Subscription", "srcUrl": null, "visibility": "Public", "summary": "Will call your callback when an error will be raised by the process.\nUsually this is due to the command not being available or not on the PATH.\nYou can call `handle()` on the object passed to your callback to indicate\nthat you have handled this error.", "description": "Will call your callback when an error will be raised by the process.\nUsually this is due to the command not being available or not on the PATH.\nYou can call `handle()` on the object passed to your callback to indicate\nthat you have handled this error.", "arguments": [ { "children": [ { "children": [ { "name": "error", "description": "{Object} the error object", "type": "Object", "isOptional": false }, { "name": "handle", "description": "{Function} call this to indicate you have handled the error. The error will not be thrown if this function is called.", "type": "Function", "isOptional": false } ], "name": "errorObject", "description": "{Object}", "type": "Object", "isOptional": false } ], "name": "callback", "description": "{Function} callback", "type": "Function", "isOptional": false } ], "returnValues": [ { "type": "Disposable", "description": "Returns a {Disposable}" } ] }, { "name": "kill", "sectionName": "Helper Methods", "srcUrl": null, "visibility": "Public", "summary": "Terminate the process. ", "description": "Terminate the process. " } ], "classProperties": [], "instanceProperties": [], "visibility": "Extended", "summary": "A wrapper which provides standard error/output line buffering for\nNode's ChildProcess.", "description": "A wrapper which provides standard error/output line buffering for\nNode's ChildProcess.", "examples": [ { "description": "", "lang": "coffee", "code": "{BufferedProcess} = require 'nylas-exports'\n\ncommand = 'ps'\nargs = ['-ef']\nstdout = (output) -> console.log(output)\nexit = (code) -> console.log(\"ps -ef exited with #{code}\")\nprocess = new BufferedProcess({command, args, stdout, exit})", "raw": "```coffee\n{BufferedProcess} = require 'nylas-exports'\n\ncommand = 'ps'\nargs = ['-ef']\nstdout = (output) -> console.log(output)\nexit = (code) -> console.log(\"ps -ef exited with #{code}\")\nprocess = new BufferedProcess({command, args, stdout, exit})\n```" } ] }, "ChangeFolderTask": { "name": "ChangeFolderTask", "superClass": "ChangeMailTask", "filename": "docs_src/classes/temp-cjsx/change-folder-task.js", "srcUrl": null, "sections": [], "classMethods": [], "instanceMethods": [], "classProperties": [], "instanceProperties": [], "visibility": "Public", "summary": "Create a new task to apply labels to a message or thread.", "description": "Create a new task to apply labels to a message or thread.\n\nTakes an options object of the form:\n\n* folder: The {Folder} or {Folder} IDs to move to\n* threads: An array of {Thread}s or {Thread} IDs\n* threads: An array of {Message}s or {Message} IDs\n* undoData: Since changing the folder is a destructive action,\n undo tasks need to store the configuration of what folders messages\n were in. When creating an undo task, we fill this parameter with\n that configuration" }, "ChangeLabelsTask": { "name": "ChangeLabelsTask", "superClass": "ChangeMailTask", "filename": "docs_src/classes/temp-cjsx/change-labels-task.js", "srcUrl": null, "sections": [], "classMethods": [], "instanceMethods": [], "classProperties": [], "instanceProperties": [], "visibility": "Public", "summary": "Create a new task to apply labels to a message or thread.", "description": "Create a new task to apply labels to a message or thread.\n\nTakes an options object of the form:\n\n* labelsToAdd: An {Array} of {Category}s or {Category} ids to add\n* labelsToRemove: An {Array} of {Category}s or {Category} ids to remove\n* threads: An {Array} of {Thread}s or {Thread} ids\n* messages: An {Array} of {Message}s or {Message} ids" }, "ChangeMailTask": { "name": "ChangeMailTask", "superClass": "Task", "filename": "docs_src/classes/temp-cjsx/change-mail-task.js", "srcUrl": null, "sections": [], "classMethods": [], "instanceMethods": [ { "name": "changesToModel", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "Override this method and return an object with key-value pairs\nrepresenting changed values. For example, if (your task sets unread:)\nfalse, return {unread: false}.", "description": "Override this method and return an object with key-value pairs\nrepresenting changed values. For example, if (your task sets unread:)\nfalse, return {unread: false}.", "arguments": [ { "name": "model", "description": "an individual {Thread} or {Message}", "type": "Thread", "isOptional": false } ], "returnValues": [ { "type": null, "description": "Returns an object whos key-value pairs represent the desired changed\nobject." } ] }, { "name": "requestBodyForModel", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "Override this method and return an object that will be the\nrequest body used for saving changes to `model`.", "description": "Override this method and return an object that will be the\nrequest body used for saving changes to `model`.", "arguments": [ { "name": "model", "description": "an individual {Thread} or {Message}", "type": "Thread", "isOptional": false } ], "returnValues": [ { "type": null, "description": "Returns an object that will be passed as the `body` to the actual API\n`request` object" } ] }, { "name": "processNestedMessages", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "Override to indicate whether actions need to be taken for all\nmessages of each thread.", "description": "Override to indicate whether actions need to be taken for all\nmessages of each thread.\n\nGenerally, you cannot provide both messages and threads at the same\ntime. However, ChangeMailTask runs for provided threads first and then\nmessages. Override and return true, and you will receive\n`changesToModel` for messages in changed threads, and any changes you\nmake will be written to the database and undone during undo.\n\nNote that API requests are only made for threads if (threads are)\npresent." }, { "name": "categoriesToAdd", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "", "description": "", "returnValues": [ { "type": null, "description": "Returns categories that this task will add to the set of threads\nMust be overriden" } ] }, { "name": "categoriesToRemove", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "", "description": "", "returnValues": [ { "type": null, "description": "Returns categories that this task will remove the set of threads\nMust be overriden" } ] } ], "classProperties": [], "instanceProperties": [], "visibility": "Public", "summary": "The ChangeMailTask is a base class for all tasks that modify sets\nof threads or messages.", "description": "The ChangeMailTask is a base class for all tasks that modify sets\nof threads or messages.\n\nSubclasses implement {ChangeMailTask::changesToModel} and\n{ChangeMailTask::requestBodyForModel} to define the specific transforms\nthey provide, and override {ChangeMailTask::performLocal} to perform\nadditional consistency checks.\n\nChangeMailTask aims to be fast and efficient. It does not write changes to\nthe database or make API requests for models that are unmodified by\n{ChangeMailTask::changesToModel}\n\nChangeMailTask stores the previous values of all models it changes into\nthis._restoreValues and handles undo/redo. When undoing, it restores previous\nvalues and calls {ChangeMailTask::requestBodyForModel} to make undo API\nrequests. It does not call {ChangeMailTask::changesToModel}." }, "Color": { "name": "Color", "filename": "color.coffee", "srcUrl": null, "sections": [], "classMethods": [ { "name": "parse", "sectionName": null, "srcUrl": null, "visibility": "Essential", "summary": "Parse a {String} or {Object} into a {Color}.", "description": "Parse a {String} or {Object} into a {Color}.", "arguments": [ { "name": "value", "description": "A {String} such as `'white'`, `#ff00ff`, or `'rgba(255, 15, 60, .75)'` or an {Object} with `red`, `green`, `blue`, and `alpha` properties.", "type": "String", "isOptional": false } ], "returnValues": [ { "type": "Color", "description": "Returns a {Color} or `null` if it cannot be parsed." } ] } ], "instanceMethods": [ { "name": "toHexString", "sectionName": null, "srcUrl": null, "visibility": "Essential", "summary": "", "description": "", "returnValues": [ { "type": "String", "description": "Returns a {String} in the form `'#abcdef'`." } ] }, { "name": "toRGBAString", "sectionName": null, "srcUrl": null, "visibility": "Essential", "summary": "", "description": "", "returnValues": [ { "type": "String", "description": "Returns a {String} in the form `'rgba(25, 50, 75, .9)'`." } ] } ], "classProperties": [], "instanceProperties": [], "visibility": "Essential", "summary": "A simple color class returned from {Config::get} when the value\nat the key path is of type 'color'. ", "description": "A simple color class returned from {Config::get} when the value\nat the key path is of type 'color'. " }, "ComponentRegistry": { "name": "ComponentRegistry", "filename": "component-registry.coffee", "srcUrl": null, "sections": [], "classMethods": [], "instanceMethods": [ { "name": "register", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "Register a new component with the Component Registry.\nTypically, packages call this method from their main `activate` method\nto extend the Nylas user interface, and call the corresponding `unregister`\nmethod in `deactivate`.", "description": "Register a new component with the Component Registry.\nTypically, packages call this method from their main `activate` method\nto extend the Nylas user interface, and call the corresponding `unregister`\nmethod in `deactivate`.\n\nThis method is chainable.", "arguments": [ { "name": "component", "description": "{Object} A React Component with a `displayName`", "type": "Object", "isOptional": false }, { "children": [ { "name": "role", "description": "{String} If you want to display your component in a location desigated by a role, pass the role identifier.", "type": "String", "isOptional": true }, { "name": "modes", "description": "{Array} If your component should only be displayed in particular Workspace Modes, pass an array of supported modes. ('list', 'split', etc.)", "type": "Array", "isOptional": true }, { "name": "location", "description": "{Object} If your component should be displayed in a column or toolbar, pass the fully qualified location object, such as: `WorkspaceStore.Location.ThreadList`", "type": "Object", "isOptional": true } ], "name": "options", "description": "{Object}: Note that for advanced use cases, you can also pass (`modes`, `roles`, `locations`) with arrays instead of single values.", "type": "Object", "isOptional": false } ] }, { "name": "findComponentByName", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "Retrieve the registry entry for a given name.", "description": "Retrieve the registry entry for a given name.", "arguments": [ { "name": "name", "description": "The {String} name of the registered component to retrieve.", "type": "String", "isOptional": false } ], "returnValues": [ { "type": "React.Component", "description": "Returns a {React.Component}" } ] }, { "name": "findComponentsMatching", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "Retrieve all of the registry entries matching a given descriptor.", "description": "Retrieve all of the registry entries matching a given descriptor.\n\n```coffee\n ComponentRegistry.findComponentsMatching({\n role: 'Composer:ActionButton'\n })\n\n ComponentRegistry.findComponentsMatching({\n location: WorkspaceStore.Location.RootSidebar.Toolbar\n })\n```", "arguments": [ { "children": [ { "name": "mode", "description": "{String} Components that specifically list modes will only be returned if they include this mode.", "type": "String", "isOptional": true }, { "name": "role", "description": "{String} Only return components that have registered for this role.", "type": "String", "isOptional": true }, { "name": "location", "description": "{Object} Only return components that have registered for this location.", "type": "Object", "isOptional": true } ], "name": "descriptor", "description": "An {Object} that specifies set of components using the available keys below. Note that for advanced use cases, you can also pass (`modes`, `roles`, `locations`) with arrays instead of single values.", "type": "Object", "isOptional": false } ], "returnValues": [ { "type": "Array", "description": "Returns an {Array} of {React.Component} objects" } ] } ], "classProperties": [], "instanceProperties": [], "visibility": "Public", "summary": "The ComponentRegistry maintains an index of React components registered\nby Nylas packages. Components can use {InjectedComponent} and {InjectedComponentSet}\nto dynamically render components registered with the ComponentRegistry.", "description": "The ComponentRegistry maintains an index of React components registered\nby Nylas packages. Components can use {InjectedComponent} and {InjectedComponentSet}\nto dynamically render components registered with the ComponentRegistry.\n\nSection: Stores" }, "ComposerExtension": { "name": "ComposerExtension", "superClass": "ContenteditableExtension", "filename": "composer-extension.coffee", "srcUrl": null, "sections": [], "classMethods": [ { "name": "sendActions", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "Allows the addition of new types of send actions such as \"Send\nLater\"", "description": "Allows the addition of new types of send actions such as \"Send\nLater\"\n\nReturn an array of objects that adhere to the following spec. If the draft data\nindicates that your action should not be available, then return null.", "arguments": [ { "name": "title", "description": "A short, single string that is displayed to users when describing your component. It is used in the hover title text of your option in the dropdown menu. It is also used in the \"Default Send Behavior\" dropdown setting. If your string is selected, then the `core.sending.defaultSendType` will be set to your string and your option will appear as the default.", "type": null, "isOptional": false }, { "name": "performSendAction", "description": "Callback for when your option is clicked as the primary action. The function will be passed `{draft}` as its only argument. It does not need to return anything. It may be asynchronous and likely queue Tasks.", "type": "draft", "isOptional": false }, { "name": "isEnabled", "description": "Callback to determine if this send action should be rendered for the given draft. Takes a draft: A fully populated {Message} object that is about to be sent.", "type": "Message", "isOptional": false }, { "name": "iconUrl", "description": "A custom icon to be placed in the Send button. SendAction extensions have the form \"Send + {ICON}\"", "type": "ICON", "isOptional": false } ] }, { "name": "warningsForSending", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "Inspect the draft, and return any warnings that need to be\ndisplayed before the draft is sent. Warnings should be string phrases,\nsuch as \"without an attachment\" that fit into a message of the form:\n\"Send #{phase1} and #{phase2}?\"", "description": "Inspect the draft, and return any warnings that need to be\ndisplayed before the draft is sent. Warnings should be string phrases,\nsuch as \"without an attachment\" that fit into a message of the form:\n\"Send #{phase1} and #{phase2}?\"", "arguments": [ { "name": "draft", "description": "A fully populated {Message} object that is about to be sent.", "type": "Message", "isOptional": false } ], "returnValues": [ { "type": null, "description": "Returns a list of warning strings, or an empty array if no warnings need\nto be displayed." } ] }, { "name": "prepareNewDraft", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "Override prepareNewDraft to modify a brand new draft before it\nis displayed in a composer. This is one of the only places in the\napplication where it's safe to modify the draft object you're given\ndirectly to add participants to the draft, add a signature, etc.", "description": "Override prepareNewDraft to modify a brand new draft before it\nis displayed in a composer. This is one of the only places in the\napplication where it's safe to modify the draft object you're given\ndirectly to add participants to the draft, add a signature, etc.\n\nBy default, new drafts are considered `pristine`. If the user leaves the\ncomposer without making any changes, the draft is discarded. If your\nextension populates the draft in a way that makes it \"populated\" in a\nvaluable way, you should set `draft.pristine = false` so the draft\nsaves, even if no further changes are made." }, { "name": "applyTransformsForSending", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "applyTransformsToDraft is called when a draft the user is editing\nis saved to the server and/or sent. This method gives you an opportunity to\nremove any annotations you've inserted into the draft body, apply final changes\nto the body, etc.", "description": "applyTransformsToDraft is called when a draft the user is editing\nis saved to the server and/or sent. This method gives you an opportunity to\nremove any annotations you've inserted into the draft body, apply final changes\nto the body, etc.\n\nNote that your extension /must/ be able to reverse the changes it applies to\nthe draft in `applyTransformsToDraft`. If the user re-opens the draft,\n`unapplyTransformsToDraft` will be called and must restore the draft to it's\nprevious edit-ready state.\n\nExamples:\n\nThis method should return a modified {Message} object, or a {Promise} which resolves\nto a modified Message object.", "arguments": [ { "name": "draft", "description": "A {Message} the user is about to finish editing.", "type": "Message", "isOptional": false } ] }, { "name": "unapplyTransformsForSending", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "unapplyTransformsToDraft should revert the changes made in\n`applyTransformsToDraft`. See the documentation for that method for more\ninformation.", "description": "unapplyTransformsToDraft should revert the changes made in\n`applyTransformsToDraft`. See the documentation for that method for more\ninformation." } ], "instanceMethods": [], "classProperties": [], "instanceProperties": [], "visibility": "Public", "summary": "To create ComposerExtensions that enhance the composer experience,\nyou should create objects that implement the interface defined at\n{ComposerExtension}.", "description": "To create ComposerExtensions that enhance the composer experience,\nyou should create objects that implement the interface defined at\n{ComposerExtension}.\n\n{ComposerExtension} extends {ContenteditableExtension}, so you can also\nimplement the methods defined there to further enhance the composer\nexperience.\n\nTo register your extension with the ExtensionRegistry, call\n{ExtensionRegistry::Composer::register}. When your package is being\nunloaded, you *must* call the corresponding\n{ExtensionRegistry::Composer::unregister} to unhook your extension.\n\n```\ncoffee activate: -> ExtensionRegistry.Composer.register(MyExtension)\n\n...\n\ndeactivate: -> ExtensionRegistry.Composer.unregister(MyExtension)\n```\n\n**Your ComposerExtension should be stateless**. The user may have multiple\ndrafts open at any time, and the methods of your ComposerExtension may be\ncalled for different drafts at any time. You should not expect that the\nsession you receive in {::applyTransformsToDraft} is for the same\ndraft you previously received in {::warningsForSending}, etc.\n\nThe ComposerExtension API does not currently expose any asynchronous or\n{Promise}-based APIs, except for applyTransformsToDraft and unapplyTransformsToDraft,\nwhich can optionally return a promsie. This will likely change in the future.\nIf you have a use-case for a ComposerExtension that is not possible with the current\nAPI, please let us know.\n\nSection: Extensions" }, "Config": { "name": "Config", "filename": "config.coffee", "srcUrl": null, "sections": [ { "name": "Config Subscription", "description": "" }, { "name": "Managing Settings", "description": "" } ], "classMethods": [], "instanceMethods": [ { "name": "observe", "sectionName": "Config Subscription", "srcUrl": null, "visibility": "Essential", "summary": "Add a listener for changes to a given key path. This is different\nthan {::onDidChange} in that it will immediately call your callback with the\ncurrent value of the config entry.", "description": "Add a listener for changes to a given key path. This is different\nthan {::onDidChange} in that it will immediately call your callback with the\ncurrent value of the config entry.\n\n### Examples\n\nYou might want to be notified when the themes change. We'll watch\n`core.themes` for changes\n\n```coffee\nNylasEnv.config.observe 'core.themes', (value) ->\n # do stuff with value\n```", "arguments": [ { "name": "keyPath", "description": "{String} name of the key to observe", "type": "String", "isOptional": false }, { "children": [ { "name": "value", "description": "the new value of the key", "type": null, "isOptional": false } ], "name": "callback", "description": "{Function} to call when the value of the key changes.", "type": "Function", "isOptional": false } ], "returnValues": [ { "type": "Disposable", "description": "Returns a {Disposable} with the following keys on which you can call\n`.dispose()` to unsubscribe." } ] }, { "name": "onDidChange", "sectionName": "Config Subscription", "srcUrl": null, "visibility": "Essential", "summary": "Add a listener for changes to a given key path. If `keyPath` is\nnot specified, your callback will be called on changes to any key.", "description": "Add a listener for changes to a given key path. If `keyPath` is\nnot specified, your callback will be called on changes to any key.", "arguments": [ { "name": "keyPath", "description": "{String} name of the key to observe.", "type": "String", "isOptional": true }, { "children": [ { "children": [ { "name": "newValue", "description": "the new value of the key", "type": null, "isOptional": false }, { "name": "oldValue", "description": "the prior value of the key.", "type": null, "isOptional": false }, { "name": "keyPath", "description": "the keyPath of the changed key", "type": null, "isOptional": false } ], "name": "event", "description": "{Object}", "type": "Object", "isOptional": false } ], "name": "callback", "description": "{Function} to call when the value of the key changes.", "type": "Function", "isOptional": false } ], "returnValues": [ { "type": "Disposable", "description": "Returns a {Disposable} with the following keys on which you can call\n`.dispose()` to unsubscribe." } ] }, { "name": "get", "sectionName": "Managing Settings", "srcUrl": null, "visibility": "Essential", "summary": "Retrieves the setting for the given key.", "description": "Retrieves the setting for the given key.\n\n### Examples\n\nYou might want to know what themes are enabled, so check `core.themes`\n\n```coffee\nNylasEnv.config.get('core.themes')\n```", "arguments": [ { "name": "keyPath", "description": "The {String} name of the key to retrieve.", "type": "String", "isOptional": false } ], "returnValues": [ { "type": null, "description": "Returns the value from N1's default settings, the user's configuration\nfile in the type specified by the configuration schema." } ] }, { "name": "set", "sectionName": "Managing Settings", "srcUrl": null, "visibility": "Essential", "summary": "Sets the value for a configuration setting.", "description": "Sets the value for a configuration setting.\n\nThis value is stored in N1's internal configuration file.\n\n### Examples\n\nYou might want to change the themes programmatically:\n\n```coffee\nNylasEnv.config.set('core.themes', ['ui-light', 'my-custom-theme'])\n```", "arguments": [ { "name": "keyPath", "description": "The {String} name of the key.", "type": "String", "isOptional": false }, { "name": "value", "description": "The value of the setting. Passing `undefined` will revert the setting to the default value.", "type": null, "isOptional": false } ], "returnValues": [ { "type": "Boolean", "description": "Returns a {Boolean}\n\n* `true` if the value was set.\n* `false` if the value was not able to be coerced to the type specified in the setting's schema." } ] }, { "name": "unset", "sectionName": "Managing Settings", "srcUrl": null, "visibility": "Essential", "summary": "Restore the setting at `keyPath` to its default value.", "description": "Restore the setting at `keyPath` to its default value.", "arguments": [ { "name": "keyPath", "description": "The {String} name of the key.", "type": "String", "isOptional": false }, { "name": "options", "description": "{Object} ", "type": "Object", "isOptional": true } ] }, { "name": "getSchema", "sectionName": "Managing Settings", "srcUrl": null, "visibility": "Extended", "summary": "Retrieve the schema for a specific key path. The schema will tell\nyou what type the keyPath expects, and other metadata about the config\noption.", "description": "Retrieve the schema for a specific key path. The schema will tell\nyou what type the keyPath expects, and other metadata about the config\noption.", "arguments": [ { "name": "keyPath", "description": "The {String} name of the key.", "type": "String", "isOptional": false } ], "returnValues": [ { "type": "Object", "description": "Returns an {Object} eg. `{type: 'integer', default: 23, minimum: 1}`." }, { "type": null, "description": "Returns `null` when the keyPath has no schema specified." } ] }, { "name": "transact", "sectionName": "Managing Settings", "srcUrl": null, "visibility": "Extended", "summary": "Suppress calls to handler functions registered with {::onDidChange}\nand {::observe} for the duration of `callback`. After `callback` executes,\nhandlers will be called once if the value for their key-path has changed.", "description": "Suppress calls to handler functions registered with {::onDidChange}\nand {::observe} for the duration of `callback`. After `callback` executes,\nhandlers will be called once if the value for their key-path has changed.", "arguments": [ { "name": "callback", "description": "{Function} to execute while suppressing calls to handlers. ", "type": "Function", "isOptional": false } ] } ], "classProperties": [], "instanceProperties": [], "visibility": "Essential", "summary": "Used to access all of N1's configuration details.", "description": "Used to access all of N1's configuration details.\n\nAn instance of this class is always available as the `NylasEnv.config` global.\n\n## Getting and setting config settings.\n\n```coffee\n# Note that with no value set, ::get returns the setting's default value.\nNylasEnv.config.get('my-package.myKey') # -> 'defaultValue'\n\nNylasEnv.config.set('my-package.myKey', 'value')\nNylasEnv.config.get('my-package.myKey') # -> 'value'\n```\n\nYou may want to watch for changes. Use {::observe} to catch changes to the setting.\n\n```coffee\nNylasEnv.config.set('my-package.myKey', 'value')\nNylasEnv.config.observe 'my-package.myKey', (newValue) ->\n # `observe` calls immediately and every time the value is changed\n console.log 'My configuration changed:', newValue\n```\n\nIf you want a notification only when the value changes, use {::onDidChange}.\n\n```coffee\nNylasEnv.config.onDidChange 'my-package.myKey', ({newValue, oldValue}) ->\n console.log 'My configuration changed:', newValue, oldValue\n```\n\n### Value Coercion\n\nConfig settings each have a type specified by way of a\n[schema](json-schema.org). For example we might an integer setting that only\nallows integers greater than `0`:\n\n```coffee\n# When no value has been set, `::get` returns the setting's default value\nNylasEnv.config.get('my-package.anInt') # -> 12\n\n# The string will be coerced to the integer 123\nNylasEnv.config.set('my-package.anInt', '123')\nNylasEnv.config.get('my-package.anInt') # -> 123\n\n# The string will be coerced to an integer, but it must be greater than 0, so is set to 1\nNylasEnv.config.set('my-package.anInt', '-20')\nNylasEnv.config.get('my-package.anInt') # -> 1\n```\n\n## Defining settings for your package\n\nDefine a schema under a `config` key in your package main.\n\n```coffee\nmodule.exports =\n # Your config schema\n config:\n someInt:\n type: 'integer'\n default: 23\n minimum: 1\n\n activate: (state) -> # ...\n # ...\n```\n\n## Config Schemas\n\nWe use [json schema](http://json-schema.org) which allows you to define your value's\ndefault, the type it should be, etc. A simple example:\n\n```coffee\n# We want to provide an `enableThing`, and a `thingVolume`\nconfig:\n enableThing:\n type: 'boolean'\n default: false\n thingVolume:\n type: 'integer'\n default: 5\n minimum: 1\n maximum: 11\n```\n\nThe type keyword allows for type coercion and validation. If a `thingVolume` is\nset to a string `'10'`, it will be coerced into an integer.\n\n```coffee\nNylasEnv.config.set('my-package.thingVolume', '10')\nNylasEnv.config.get('my-package.thingVolume') # -> 10\n\n# It respects the min / max\nNylasEnv.config.set('my-package.thingVolume', '400')\nNylasEnv.config.get('my-package.thingVolume') # -> 11\n\n# If it cannot be coerced, the value will not be set\nNylasEnv.config.set('my-package.thingVolume', 'cats')\nNylasEnv.config.get('my-package.thingVolume') # -> 11\n```\n\n### Supported Types\n\nThe `type` keyword can be a string with any one of the following. You can also\nchain them by specifying multiple in an an array. For example\n\n```coffee\nconfig:\n someSetting:\n type: ['boolean', 'integer']\n default: 5\n\n# Then\nNylasEnv.config.set('my-package.someSetting', 'true')\nNylasEnv.config.get('my-package.someSetting') # -> true\n\nNylasEnv.config.set('my-package.someSetting', '12')\nNylasEnv.config.get('my-package.someSetting') # -> 12\n```\n\n#### string\n\nValues must be a string.\n\n```coffee\nconfig:\n someSetting:\n type: 'string'\n default: 'hello'\n```\n\n#### integer\n\nValues will be coerced into integer. Supports the (optional) `minimum` and\n`maximum` keys.\n\n```coffee\n config:\n someSetting:\n type: 'integer'\n default: 5\n minimum: 1\n maximum: 11\n```\n\n#### number\n\nValues will be coerced into a number, including real numbers. Supports the\n(optional) `minimum` and `maximum` keys.\n\n```coffee\nconfig:\n someSetting:\n type: 'number'\n default: 5.3\n minimum: 1.5\n maximum: 11.5\n```\n\n#### boolean\n\nValues will be coerced into a Boolean. `'true'` and `'false'` will be coerced into\na boolean. Numbers, arrays, objects, and anything else will not be coerced.\n\n```coffee\nconfig:\n someSetting:\n type: 'boolean'\n default: false\n```\n\n#### array\n\nValue must be an Array. The types of the values can be specified by a\nsubschema in the `items` key.\n\n```coffee\nconfig:\n someSetting:\n type: 'array'\n default: [1, 2, 3]\n items:\n type: 'integer'\n minimum: 1.5\n maximum: 11.5\n```\n\n#### object\n\nValue must be an object. This allows you to nest config options. Sub options\nmust be under a `properties key`\n\n```coffee\nconfig:\n someSetting:\n type: 'object'\n properties:\n myChildIntOption:\n type: 'integer'\n minimum: 1.5\n maximum: 11.5\n```\n\n#### color\n\nValues will be coerced into a {Color} with `red`, `green`, `blue`, and `alpha`\nproperties that all have numeric values. `red`, `green`, `blue` will be in\nthe range 0 to 255 and `value` will be in the range 0 to 1. Values can be any\nvalid CSS color format such as `#abc`, `#abcdef`, `white`,\n`rgb(50, 100, 150)`, and `rgba(25, 75, 125, .75)`.\n\n```coffee\nconfig:\n someSetting:\n type: 'color'\n default: 'white'\n```\n\n### Other Supported Keys\n\n#### enum\n\nAll types support an `enum` key. The enum key lets you specify all values\nthat the config setting can possibly be. `enum` _must_ be an array of values\nof your specified type. Schema:\n\n```coffee\nconfig:\n someSetting:\n type: 'integer'\n default: 4\n enum: [2, 4, 6, 8]\n```\n\nUsage:\n\n```coffee\nNylasEnv.config.set('my-package.someSetting', '2')\nNylasEnv.config.get('my-package.someSetting') # -> 2\n\n# will not set values outside of the enum values\nNylasEnv.config.set('my-package.someSetting', '3')\nNylasEnv.config.get('my-package.someSetting') # -> 2\n\n# If it cannot be coerced, the value will not be set\nNylasEnv.config.set('my-package.someSetting', '4')\nNylasEnv.config.get('my-package.someSetting') # -> 4\n```\n\n#### title and description\n\nThe settings view will use the `title` and `description` keys to display your\nconfig setting in a readable way. By default the settings view humanizes your\nconfig key, so `someSetting` becomes `Some Setting`. In some cases, this is\nconfusing for users, and a more descriptive title is useful.\n\nDescriptions will be displayed below the title in the settings view.\n\n```coffee\nconfig:\n someSetting:\n title: 'Setting Magnitude'\n description: 'This will affect the blah and the other blah'\n type: 'integer'\n default: 4\n```\n\n__Note__: You should strive to be so clear in your naming of the setting that\nyou do not need to specify a title or description!\n\n## Best practices\n\n* Don't depend on (or write to) configuration keys outside of your keypath." }, "Contact": { "name": "Contact", "superClass": "Model", "filename": "docs_src/classes/temp-cjsx/contact.js", "srcUrl": null, "sections": [], "classMethods": [], "instanceMethods": [ { "name": "toString", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "", "description": "", "returnValues": [ { "type": null, "description": "Returns a string of the format `Full Name ` if\nthe contact has a populated name, just the email address otherwise." } ] }, { "name": "isValid", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "", "description": "", "returnValues": [ { "type": "Contact", "description": "Returns true if the contact provided is a {Contact} instance and\ncontains a properly formatted email address." } ] }, { "name": "isMe", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "", "description": "", "returnValues": [ { "type": null, "description": "Returns true if the contact is the current user, false otherwise.\nYou should use this method instead of comparing the user's email address to\nthe account email, since it is case-insensitive and future-proof." } ] } ], "classProperties": [], "instanceProperties": [], "visibility": "Public", "summary": "The Contact model represents a Contact object served by the Nylas Platform API.\nFor more information about Contacts on the Nylas Platform, read the\n[Contacts API Documentation](https://nylas.com/cloud/docs#contacts)", "description": "The Contact model represents a Contact object served by the Nylas Platform API.\nFor more information about Contacts on the Nylas Platform, read the\n[Contacts API Documentation](https://nylas.com/cloud/docs#contacts)\n\nAttributes\n\n`name`: {AttributeString} The name of the contact. Queryable.\n\n`email`: {AttributeString} The email address of the contact. Queryable.\n\n`thirdPartyData`: {AttributeObject} Extra data that we find out about a\ncontact. The data is keyed by the 3rd party service that dumped the data\nthere. The value is an object of raw data in the form that the service\nprovides\n\nWe also have \"normalized\" optional data for each contact. This list may\ngrow as the needs of a contact become more complex.\n\nThis class also inherits attributes from {Model}\n\nSection: Models" }, "ContactStore": { "name": "ContactStore", "superClass": "NylasStore", "filename": "contact-store.coffee", "srcUrl": null, "sections": [], "classMethods": [], "instanceMethods": [ { "name": "searchContacts", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "Search the user's contact list for the given search term.\nThis method compares the `search` string against each Contact's\n`name` and `email`.", "description": "Search the user's contact list for the given search term.\nThis method compares the `search` string against each Contact's\n`name` and `email`.", "arguments": [ { "name": "search", "description": "{String} A search phrase, such as `ben@n` or `Ben G`", "type": "String", "isOptional": false }, { "name": "options", "description": "{Object} If you will only be displaying a few results, you should pass a limit value. {::searchContacts} will return as soon as `limit` matches have been found.", "type": "Object", "isOptional": true } ], "returnValues": [ { "type": "Array", "description": "Returns an {Array} of matching {Contact} models" } ] } ], "classProperties": [], "instanceProperties": [], "visibility": "Public", "summary": "ContactStore provides convenience methods for searching contacts and\nformatting contacts. When Contacts become editable, this store will be expanded\nwith additional actions.", "description": "ContactStore provides convenience methods for searching contacts and\nformatting contacts. When Contacts become editable, this store will be expanded\nwith additional actions.\n\nSection: Stores" }, "Contenteditable": { "name": "Contenteditable", "superClass": "React", "filename": "contenteditable.coffee", "srcUrl": null, "sections": [], "classMethods": [], "instanceMethods": [ { "name": "atomicEdit", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "perform an editing operation on the Contenteditable", "description": "perform an editing operation on the Contenteditable\n\nIf the current selection at the time of running the extension is out of\nscope, it will be set to the last saved state. This ensures extensions\noperate on a valid {ExtendedSelection}.\n\nEdits made within the editing function will eventually fire _onDOMMutated", "arguments": [ { "name": "editingFunction", "description": "A function to mutate the DOM and {ExtendedSelection}. It gets passed an {EditorAPI} object that contains mutating methods.", "type": "ExtendedSelection", "isOptional": false } ] } ], "classProperties": [], "instanceProperties": [], "visibility": "Public", "summary": "A modern React-compatible contenteditable", "description": "A modern React-compatible contenteditable\n\nThis component is fully React-compatible and behaves\nlike a standard controlled input.\n\n```javascript\ngetInitialState: function() {\n return {value: 'Hello!'};\n},\nhandleChange: function(event) {\n this.setState({value: event.target.value});\n},\nrender: function() {\n var value = this.state.value;\n return ;\n}\n```" }, "ContenteditableExtension": { "name": "ContenteditableExtension", "filename": "contenteditable-extension.coffee", "srcUrl": null, "sections": [], "classMethods": [ { "name": "onContentChanged", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "Gets called anytime any atomic change is made to the DOM of the\ncontenteditable.", "description": "Gets called anytime any atomic change is made to the DOM of the\ncontenteditable.\n\nWhen a user types a key, deletes some text, or does anything that\nchanges the DOM. it will trigger `onContentChanged`. It is wrapper over\na native DOM {MutationObserver}. It only gets called if there are\nmutations\n\nThis also gets called at the end of callbacks that mutate the DOM. If\nanother extension overrides `onClick` and performs several mutations to\nthe DOM during that callback, those changes will be batched and then\n`onContentChanged` will be called once at the end of the callback with\nthose mutations.\n\nCallback params:\n\n* editor: The {Editor} controller that provides a host of convenience\n methods for manipulating the selection and DOM\n* mutations: An array of DOM Mutations as returned by the\n {MutationObserver}. Note that these may not always be populated\n\nYou may mutate the contenteditable in place, we do not expect any return\nvalue from this method.\n\nThe onContentChanged event can be triggered by a variety of events, some\nof which could have been already been looked at by a callback. Any DOM\nmutation will fire this event. Sometimes those mutations are the cause\nof other callbacks.\n\nExample:\n\nThe Nylas `templates` package uses this method to see if the user has\npopulated a `` tag placed in the body and change it's CSS class to\nreflect that it is no longer empty.\n\n```coffee\nonContentChanged: ({editor, mutations}) ->\n isWithinNode = (node) ->\n test = selection.baseNode\n while test isnt editableNode\n return true if test is node\n test = test.parentNode\n return false\n\n codeTags = editableNode.querySelectorAll('code.var.empty')\n for codeTag in codeTags\n if selection.containsNode(codeTag) or isWithinNode(codeTag)\n codeTag.classList.remove('empty')\n```" }, { "name": "onBlur", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "Override onBlur to mutate the contenteditable DOM node whenever the\nonBlur event is fired on it. You may mutate the contenteditable in place, we\nnot expect any return value from this method.", "description": "Override onBlur to mutate the contenteditable DOM node whenever the\nonBlur event is fired on it. You may mutate the contenteditable in place, we\nnot expect any return value from this method.\n\n* editor: The {Editor} controller that provides a host of convenience\n methods for manipulating the selection and DOM\n* event: DOM event fired on the contenteditable" }, { "name": "onFocus", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "Override onFocus to mutate the contenteditable DOM node whenever the\nonFocus event is fired on it. You may mutate the contenteditable in place, we\nnot expect any return value from this method.", "description": "Override onFocus to mutate the contenteditable DOM node whenever the\nonFocus event is fired on it. You may mutate the contenteditable in place, we\nnot expect any return value from this method.\n\n* editor: The {Editor} controller that provides a host of convenience\n methods for manipulating the selection and DOM\n* event: DOM event fired on the contenteditable" }, { "name": "onClick", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "Override onClick to mutate the contenteditable DOM node whenever the\nonClick event is fired on it. You may mutate the contenteditable in place, we\nnot expect any return value from this method.", "description": "Override onClick to mutate the contenteditable DOM node whenever the\nonClick event is fired on it. You may mutate the contenteditable in place, we\nnot expect any return value from this method.\n\n* editor: The {Editor} controller that provides a host of convenience\n methods for manipulating the selection and DOM\n* event: DOM event fired on the contenteditable" }, { "name": "onKeyDown", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "Override onKeyDown to mutate the contenteditable DOM node whenever the\nonKeyDown event is fired on it.\nPublic: Called when the user presses a key while focused on the contenteditable's body field.\nOverride onKeyDown in your ContenteditableExtension to adjust the selection or\nperform other actions.", "description": "Override onKeyDown to mutate the contenteditable DOM node whenever the\nonKeyDown event is fired on it.\nPublic: Called when the user presses a key while focused on the contenteditable's body field.\nOverride onKeyDown in your ContenteditableExtension to adjust the selection or\nperform other actions.\n\nIf your package implements key down behavior for a particular scenario, you\nshould prevent the default behavior of the key via `event.preventDefault()`.\nYou may mutate the contenteditable in place, we not expect any return value\nfrom this method.\n\nImportant: You should prevent the default key down behavior with great care.\n\n* editor: The {Editor} controller that provides a host of convenience\n methods for manipulating the selection and DOM\n* event: DOM event fired on the contenteditable" }, { "name": "onShowContextMenu", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "Override onShowContextMenu to add new menu items to the right click menu\ninside the contenteditable.", "description": "Override onShowContextMenu to add new menu items to the right click menu\ninside the contenteditable.\n\n* editor: The {Editor} controller that provides a host of convenience\n methods for manipulating the selection and DOM\n* event: DOM event fired on the contenteditable\n* menu: [Menu](https://github.com/atom/electron/blob/master/docs/api/menu.md)\n object you can mutate in order to add new [MenuItems](https://github.com/atom/electron/blob/master/docs/api/menu-item.md)\n to the context menu that will be displayed when you right click the contenteditable." }, { "name": "keyCommandHandlers", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "Override `keyCommandHandlers` to declaratively map keyboard\ncommands to callbacks.", "description": "Override `keyCommandHandlers` to declaratively map keyboard\ncommands to callbacks.\n\nReturn an object keyed by the command name whose values are the\ncallbacks.\n\nCallbacks are automatically bound to the Contenteditable context and\npassed `({editor, event})` as its argument.\n\nNew commands are defined in keymap.cson files." }, { "name": "toolbarButtons", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "Override `toolbarButtons` to declaratively add your own button\nto the composer's toolbar.", "description": "Override `toolbarButtons` to declaratively add your own button\nto the composer's toolbar.\n\n* toolbarState: The current state of the Toolbar and Composer. This is\n Read only.\n\nMust return an array of objects obeying the following spec:\n\n* className: A string class name\n* onClick: Callback to fire when your button is clicked. The callback\n is automatically bound to the editor and will get passed an single\n object with the following args.\n * editor - The {Editor} controller for manipulating the DOM\n * event - The click Event object\n* tooltip: A string to display when users hover over your button\n* iconUrl: A url for the icon." }, { "name": "toolbarComponentConfig", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "Override `toolbarComponentConfig` to declaratively show your own\ntoolbar when certain conditions are met.", "description": "Override `toolbarComponentConfig` to declaratively show your own\ntoolbar when certain conditions are met.\n\nIf you want to hide your toolbar component, return null.\n\nIf you want to display your toolbar, then return an object with the\nsignature indicated below.\n\nThis methods gets called anytime the `toolbarState` changes. Since\n`toolbarState` includes the current value of the Selection and any\nobjects a user is hovering over, you should expect it to change very\nfrequently.\n\n* toolbarState: The current state of the Toolbar and Composer. This is\n Read only.\n * dragging\n * doubleDown\n * hoveringOver\n * editableNode\n * exportedSelection\n * extensions\n * atomicEdit\n\nMust return an object with the following signature\n\n* component: A React component or null.\n* props: Props to be passed into your custom Component\n* locationRefNode: Anything (usually a DOM Node) that responds to\n `getBoundingClientRect`. This is used to determine where to display\n your component.\n* width: The width of your component. This is necessary because when\n your component is displayed in the {FloatingToolbar}, the position is\n pre-computed based on the absolute width of the item.\n* height: The height of your component. This is necessary for the same\n reason listed above; the position of the toolbar will be determined\n by the absolute height given." } ], "instanceMethods": [], "classProperties": [], "instanceProperties": [], "visibility": "Public", "summary": "ContenteditableExtension is an abstract base class.\nImplementations of this are used to make additional changes to a", "description": "ContenteditableExtension is an abstract base class.\nImplementations of this are used to make additional changes to a\n\n component beyond a user's input intents. The hooks in\nthis class provide the contenteditable DOM Node itself, allowing you to\nadjust selection ranges and change content as necessary.\n\nWhile some ContenteditableExtension are included with the core\n<{Contenteditable} /> component, others may be added via the `plugins`\nprop when you use it inside your own components.\n\nExample:\n\n```javascript\nrender() {\n return(\n
\n \n
\n );\n}\n```\n\nIf you specifically want to enhance the Composer experience you should\nregister a {ComposerExtension}\n\nSection: Extensions" }, "DatabaseStore": { "name": "DatabaseStore", "superClass": "NylasStore", "filename": "docs_src/classes/temp-cjsx/database-store.js", "srcUrl": null, "sections": [], "classMethods": [], "instanceMethods": [ { "name": "find", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "Creates a new Model Query for retrieving a single model specified by\nthe class and id.", "description": "Creates a new Model Query for retrieving a single model specified by\nthe class and id.\n\n* \\`class\\` The class of the {Model} you're trying to retrieve.\n* \\`id\\` The {String} id of the {Model} you're trying to retrieve\n\nExample:\n\n```coffee\nDatabaseStore.find(Thread, 'id-123').then (thread) ->\n// thread is a Thread object, or null if no match was found.\n```", "returnValues": [ { "type": "Query", "description": "Returns a {Query}" } ] }, { "name": "findBy", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "Creates a new Model Query for retrieving a single model matching the\npredicates provided.", "description": "Creates a new Model Query for retrieving a single model matching the\npredicates provided.\n\n* \\`class\\` The class of the {Model} you're trying to retrieve.\n* \\`predicates\\` An {Array} of {matcher} objects. The set of predicates the\n returned model must match.", "returnValues": [ { "type": "Query", "description": "Returns a {Query}" } ] }, { "name": "findAll", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "Creates a new Model Query for retrieving all models matching the\npredicates provided.", "description": "Creates a new Model Query for retrieving all models matching the\npredicates provided.\n\n* \\`class\\` The class of the {Model} you're trying to retrieve.\n* \\`predicates\\` An {Array} of {matcher} objects. The set of predicates the\n returned model must match.", "returnValues": [ { "type": "Query", "description": "Returns a {Query}" } ] }, { "name": "count", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "Creates a new Model Query that returns the {Number} of models matching\nthe predicates provided.", "description": "Creates a new Model Query that returns the {Number} of models matching\nthe predicates provided.\n\n* \\`class\\` The class of the {Model} you're trying to retrieve.\n* \\`predicates\\` An {Array} of {matcher} objects. The set of predicates the\n returned model must match.", "returnValues": [ { "type": "Query", "description": "Returns a {Query}" } ] }, { "name": "modelify", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "Modelify converts the provided array of IDs or models (or a mix of\nIDs and models) into an array of models of the \\`klass\\` provided by querying for the missing items.", "description": "Modelify converts the provided array of IDs or models (or a mix of\nIDs and models) into an array of models of the \\`klass\\` provided by querying for the missing items.\n\nModelify is efficient and uses a single database query. It resolves Immediately\nif no query is necessary.\n\n* \\`class\\` The {Model} class desired.\n* 'arr' An {Array} with a mix of string model IDs and/or models." }, { "name": "run", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "Executes a {Query} on the local database.", "description": "Executes a {Query} on the local database.\n\n* \\`modelQuery\\` A {Query} to execute.", "returnValues": [ { "type": "Promise", "description": "Returns a {Promise} that\n\n* resolves with the result of the database query." } ] }, { "name": "inTransaction", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "Opens a new database transaction for writing changes.\nDatabaseStore.inTransacion makes the following guarantees:", "description": "Opens a new database transaction for writing changes.\nDatabaseStore.inTransacion makes the following guarantees:\n\n* No other calls to \\`inTransaction\\` will run until the promise has finished.\n* No other process will be able to write to sqlite while the provided function\n is running. `BEGIN IMMEDIATE TRANSACTION` semantics are:\n* No other connection will be able to write any changes.\n* Other connections can read from the database, but they will not see\n pending changes.", "returnValues": [ { "type": "function", "description": "this.param fn {function} callback that will be executed inside a database transaction" }, { "type": "Promise", "description": "Returns a {Promise} that resolves when the transaction has successfully\ncompleted." } ] } ], "classProperties": [], "instanceProperties": [], "visibility": "Public", "summary": "N1 is built on top of a custom database layer modeled after\nActiveRecord. For many parts of the application, the database is the source\nof truth. Data is retrieved from the API, written to the database, and changes\nto the database trigger Stores and components to refresh their contents.", "description": "N1 is built on top of a custom database layer modeled after\nActiveRecord. For many parts of the application, the database is the source\nof truth. Data is retrieved from the API, written to the database, and changes\nto the database trigger Stores and components to refresh their contents.\n\nThe DatabaseStore is available in every application window and allows you to\nmake queries against the local cache. Every change to the local cache is\nbroadcast as a change event, and listening to the DatabaseStore keeps the\nrest of the application in sync.\n\n#// Listening for Changes\n\nTo listen for changes to the local cache, subscribe to the DatabaseStore and\ninspect the changes that are sent to your listener method.\n\n```coffeescript\nthis.unsubscribe = DatabaseStore.listen(this._onDataChanged, this.)\n\n...\n\n_onDataChanged: (change) ->\n return unless change.objectClass is Message\n return unless this._myMessageID in _.map change.objects, (m) -> m.id\n\n // Refresh Data\n```\n\nThe local cache changes very frequently, and your stores and components should\ncarefully choose when to refresh their data. The \\`change\\` object passed to your\nevent handler allows you to decide whether to refresh your data and exposes\nthe following keys:\n\n\\`objectClass\\`: The {Model} class that has been changed. If multiple types of models\nwere saved to the database, you will receive multiple change events.\n\n\\`objects\\`: An {Array} of {Model} instances that were either created, updated or\ndeleted from the local cache. If your component or store presents a single object\nor a small collection of objects, you should look to see if any of the objects\nare in your displayed set before refreshing.\n\nSection: Database" }, "DraftChangeSet": { "name": "DraftChangeSet", "filename": "draft-editing-session.coffee", "srcUrl": null, "sections": [], "classMethods": [], "instanceMethods": [], "classProperties": [], "instanceProperties": [], "visibility": "Public", "summary": "As the user interacts with the draft, changes are accumulated in the\nDraftChangeSet associated with the store session. The DraftChangeSet does two things:", "description": "As the user interacts with the draft, changes are accumulated in the\nDraftChangeSet associated with the store session. The DraftChangeSet does two things:\n\n1. It debounces changes and calls Actions.saveDraft() at a reasonable interval.\n1. It exposes `applyToModel`, which allows you to optimistically apply changes\n to a draft object. When the session vends the draft, it passes it through this\n function to apply uncommitted changes. This means the Draft provided by the\n DraftEditingSession will always relfect recent changes, even though they're\n written to the database intermittently.\n\nSection: Drafts" }, "DraftEditingSession": { "name": "DraftEditingSession", "filename": "draft-editing-session.coffee", "srcUrl": null, "sections": [], "classMethods": [], "instanceMethods": [ { "name": "draft", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "", "description": "", "returnValues": [ { "type": null, "description": "Returns the draft object with the latest changes applied." } ] }, { "name": "draftPristineBody", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "", "description": "", "returnValues": [ { "type": null, "description": "Returns the initial body of the draft when it was pristine, or null if the\ndraft was never pristine in this editing session. Useful for determining if the\nbody is still in an unchanged / empty state." } ] } ], "classProperties": [], "instanceProperties": [], "visibility": "Public", "summary": "DraftEditingSession is a small class that makes it easy to implement components\nthat display Draft objects or allow for interactive editing of Drafts.", "description": "DraftEditingSession is a small class that makes it easy to implement components\nthat display Draft objects or allow for interactive editing of Drafts.\n\n1. It synchronously provides an instance of a draft via `draft()`, and\n triggers whenever that draft instance has changed.\n1. It provides an interface for modifying the draft that transparently\n batches changes, and ensures that the draft provided via `draft()`\n always has pending changes applied.\n\nSection: Drafts" }, "DraftStore": { "name": "DraftStore", "superClass": "NylasStore", "filename": "docs_src/classes/temp-cjsx/draft-store.js", "srcUrl": null, "sections": [], "classMethods": [], "instanceMethods": [ { "name": "isSendingDraft", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "Look up the sending state of the given draftClientId.\nIn popout windows the existance of the window is the sending state.", "description": "Look up the sending state of the given draftClientId.\nIn popout windows the existance of the window is the sending state." } ], "classProperties": [], "instanceProperties": [], "visibility": "Public", "summary": "DraftStore responds to Actions that interact with Drafts and exposes\npublic getter methods to return Draft objects and sessions.", "description": "DraftStore responds to Actions that interact with Drafts and exposes\npublic getter methods to return Draft objects and sessions.\n\nIt also creates and queues {Task} objects to persist changes to the Nylas\nAPI.\n\nRemember that a \"Draft\" is actually just a \"Message\" with `draft: true`.\n\nSection: Drafts" }, "DraftStoreExtension": { "name": "DraftStoreExtension", "filename": "draft-store-extension.coffee", "srcUrl": null, "sections": [], "classMethods": [], "instanceMethods": [], "classProperties": [], "instanceProperties": [], "visibility": "Public", "summary": "DraftStoreExtension is deprecated. Use {ComposerExtension} instead.\nSection: Extensions", "description": "DraftStoreExtension is deprecated. Use {ComposerExtension} instead.\nSection: Extensions" }, "EventedIFrame": { "name": "EventedIFrame", "superClass": "React", "filename": "evented-iframe.coffee", "srcUrl": null, "sections": [], "classMethods": [], "instanceMethods": [ { "name": "didReplaceDocument", "sectionName": null, "srcUrl": null, "visibility": "Public", "summary": "Call this method if you replace the contents of the iframe's document.\nThis allows {EventedIframe} to re-attach it's event listeners.", "description": "Call this method if you replace the contents of the iframe's document.\nThis allows {EventedIframe} to re-attach it's event listeners." } ], "classProperties": [], "instanceProperties": [], "visibility": "Public", "summary": "EventedIFrame is a thin wrapper around the DOM's standard `