Mailspring/docs/classes/api.json

4449 lines
226 KiB
JSON
Raw Normal View History

2017-01-30 18:49:48 +08:00
{
"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\nValu
},
"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 <email@address.com>` 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 <Contenteditable /> component is fully React-compatible and behaves\nlike a standard controlled input.\n\n```javascript\ngetInitialState: function() {\n return {value: '<strong>Hello!</strong>'};\n},\nhandleChange: function(event) {\n this.setState({value: event.target.value});\n},\nrender: function() {\n var value = this.state.value;\n return <Contenteditable type=\"text\" value={value} onChange={this.handleChange} />;\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 `<code>` 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<Contenteditable /> 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 <div>\n <Contenteditable extensions={[MyAwesomeExtension]}>\n </div>\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 `<iframe>` element.\nYou should always use EventedIFrame, because it provides important event hooks that\nensure keyboard and mouse events are properly delivered to the application when\nfired within iFrames.",
"description": "EventedIFrame is a thin wrapper around the DOM's standard `<iframe>` element.\nYou should always use EventedIFrame, because it provides important event hooks that\nensure keyboard and mouse events are properly delivered to the application when\nfired within iFrames.\n\n```\n<div className=\"file-frame-container\">\n <EventedIFrame src={src} />\n <Spinner visible={!@state.ready} />\n</div>\n```\n\nAny `props` added to the <EventedIFrame> are passed to the iFrame it renders.\n\nSection: Component Kit"
},
"Flexbox": {
"name": "Flexbox",
"filename": "docs_src/classes/temp-cjsx/flexbox.js",
"srcUrl": null,
"sections": [],
"classMethods": [],
"instanceMethods": [
{
"name": "render",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "React `props` supported by Flexbox:",
"description": "React `props` supported by Flexbox:\n\n```\n- `direction` (optional) A {String} Flexbox direction: either `column` or `row`.\n```",
"arguments": [
{
"name": "style",
"description": "An {Object} with styles to apply to the flexbox.",
"type": "Object",
"isOptional": true
}
]
}
],
"classProperties": [],
"instanceProperties": [],
"visibility": "Public",
"summary": "A simple wrapper that provides a Flexbox layout with the given direction and style.\nAny additional props you set on the Flexbox are rendered.",
"description": "A simple wrapper that provides a Flexbox layout with the given direction and style.\nAny additional props you set on the Flexbox are rendered.\n\nSection: Component Kit"
},
"FocusedContentStore": {
"name": "FocusedContentStore",
"filename": "focused-content-store.coffee",
"srcUrl": null,
"sections": [],
"classMethods": [],
"instanceMethods": [
{
"name": "focused",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "",
"description": "",
"arguments": [
{
"name": "collection",
"description": "The {String} name of a collection. Standard collections are listed above.",
"type": "String",
"isOptional": false
}
],
"returnValues": [
{
"type": "Model",
"description": "Returns the focused {Model} in the collection specified,\nor undefined if no item is focused."
}
]
},
{
"name": "focusedId",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "",
"description": "",
"arguments": [
{
"name": "collection",
"description": "The {String} name of a collection. Standard collections are listed above.",
"type": "String",
"isOptional": false
}
],
"returnValues": [
{
"type": "Model",
"description": "Returns the ID of the focused {Model} in the collection specified,\nor undefined if no item is focused."
}
]
},
{
"name": "didFocusUsingClick",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "",
"description": "",
"arguments": [
{
"name": "collection",
"description": "The {String} name of a collection. Standard collections are listed above.",
"type": "String",
"isOptional": false
}
],
"returnValues": [
{
"type": null,
"description": "Returns true if the item for the collection was focused via a click or\nfalse otherwise."
}
]
},
{
"name": "keyboardCursor",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "",
"description": "",
"arguments": [
{
"name": "collection",
"description": "The {String} name of a collection. Standard collections are listed above.",
"type": "String",
"isOptional": false
}
],
"returnValues": [
{
"type": "Model",
"description": "Returns the {Model} the keyboard is currently focused on\nin the collection specified. Keyboard focus is not always separate from\nprimary focus (selection). You can use {::keyboardCursorEnabled} to determine\nwhether keyboard focus is enabled."
}
]
},
{
"name": "keyboardCursorId",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "",
"description": "",
"arguments": [
{
"name": "collection",
"description": "The {String} name of a collection. Standard collections are listed above.",
"type": "String",
"isOptional": false
}
],
"returnValues": [
{
"type": "Model",
"description": "Returns the ID of the {Model} the keyboard is currently focused on\nin the collection specified. Keyboard focus is not always separate from\nprimary focus (selection). You can use {::keyboardCursorEnabled} to determine\nwhether keyboard focus is enabled."
}
]
},
{
"name": "keyboardCursorEnabled",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "",
"description": "",
"returnValues": [
{
"type": "Boolean",
"description": "Returns a {Boolean} - `true` if the keyboard cursor concept applies in\nthe current {WorkspaceStore} layout mode. The keyboard cursor is currently only\nenabled in `list` mode."
}
]
}
],
"classProperties": [],
"instanceProperties": [],
"visibility": "Public",
"summary": "The FocusedContentStore provides access to the objects currently selected\nor otherwise focused in the window. Normally, focus would be maintained internally\nby components that show models. The FocusedContentStore makes the concept of\nselection public so that you can observe focus changes and trigger your own changes\nto focus.",
"description": "The FocusedContentStore provides access to the objects currently selected\nor otherwise focused in the window. Normally, focus would be maintained internally\nby components that show models. The FocusedContentStore makes the concept of\nselection public so that you can observe focus changes and trigger your own changes\nto focus.\n\nSince {FocusedContentStore} is a Flux-compatible Store, you do not call setters\non it directly. Instead, use {Actions::setFocus} or\n{Actions::setCursorPosition} to set focus. The FocusedContentStore observes\nthese models, changes it's state, and broadcasts to it's observers.\n\nNote: The {FocusedContentStore} triggers when a focused model is changed, even if\nit's ID has not. For example, if the user has a {Thread} selected and removes a tag,\n{FocusedContentStore} will trigger so you can fetch the new version of the\n{Thread}. If you observe the {FocusedContentStore} properly, you should always\nhave the latest version of the the selected object.\n\n**Standard Collections**:\n\n* thread\n* file\n\n**Example: Observing the Selected Thread**\n\n```coffeescript\n@unsubscribe = FocusedContentStore.listen(@_onFocusChanged, @)\n\n...\n\n# Called when focus has changed, or when the focused model has been modified.\n_onFocusChanged: ->\n thread = FocusedContentStore.focused('thread')\n if thread\n console.log(\"#{thread.subject} is selected!\")\n else\n console.log(\"No thread is selected!\")\n```\n\nSection: Stores"
},
"InjectedComponent": {
"name": "InjectedComponent",
"superClass": "React",
"filename": "injected-component.coffee",
"srcUrl": null,
"sections": [],
"classMethods": [],
"instanceMethods": [],
"classProperties": [
{
"name": "propTypes",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "React `props` supported by InjectedComponent:",
"description": "React `props` supported by InjectedComponent:",
"arguments": [
{
"name": "matching",
"description": "Pass an {Object} with ComponentRegistry descriptors. This set of descriptors is provided to {ComponentRegistry::findComponentsForDescriptor} to retrieve the component that will be displayed.",
"type": "Object",
"isOptional": false
},
{
"name": "onComponentDidRender",
"description": "Callback that will be called when the injected component is successfully rendered onto the DOM.",
"type": null,
"isOptional": true
},
{
"name": "className",
"description": "A {String} class name for the containing element.",
"type": "String",
"isOptional": true
},
{
"name": "exposedProps",
"description": "An {Object} with props that will be passed to each item rendered into the set.",
"type": "Object",
"isOptional": true
},
{
"name": "fallback",
"description": "A {Component} to default to in case there are no matching components in the ComponentRegistry",
"type": "Component",
"isOptional": true
},
{
"name": "requiredMethods",
"description": "(options) An {Array} with a list of methods that should be implemented by the registered component instance. If these are not implemented, an error will be thrown.",
"type": "Array",
"isOptional": false
}
]
}
],
"instanceProperties": [],
"visibility": "Public",
"summary": "InjectedComponent makes it easy to include dynamically registered\ncomponents inside of your React render method. Rather than explicitly render\na component, such as a `<Composer>`, you can use InjectedComponent:",
"description": "InjectedComponent makes it easy to include dynamically registered\ncomponents inside of your React render method. Rather than explicitly render\na component, such as a `<Composer>`, you can use InjectedComponent:\n\n```coffee\n<InjectedComponent matching={role:\"Composer\"} exposedProps={draftClientId:123} />\n```\n\nInjectedComponent will look up the component registered with that role in the\n{ComponentRegistry} and render it, passing the exposedProps (`draftClientId={123}`) along.\n\nInjectedComponent monitors the ComponentRegistry for changes. If a new component\nis registered that matches the descriptor you provide, InjectedComponent will refresh.\n\nIf no matching component is found, the InjectedComponent renders an empty div.\n\nSection: Component Kit"
},
"InjectedComponentSet": {
"name": "InjectedComponentSet",
"superClass": "React",
"filename": "injected-component-set.coffee",
"srcUrl": null,
"sections": [],
"classMethods": [],
"instanceMethods": [],
"classProperties": [
{
"name": "propTypes",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "React `props` supported by InjectedComponentSet:",
"description": "React `props` supported by InjectedComponentSet:",
"arguments": [
{
"name": "matching",
"description": "Pass an {Object} with ComponentRegistry descriptors This set of descriptors is provided to {ComponentRegistry::findComponentsForDescriptor} to retrieve components for display.",
"type": "Object",
"isOptional": false
},
{
"name": "matchLimit",
"description": "A {Number} that indicates the max number of matching elements to render",
"type": "Number",
"isOptional": true
},
{
"name": "className",
"description": "A {String} class name for the containing element.",
"type": "String",
"isOptional": true
},
{
"name": "children",
"description": "Any React elements rendered inside the InjectedComponentSet will always be displayed.",
"type": null,
"isOptional": true
},
{
"name": "onComponentsDidRender",
"description": "Callback that will be called when the injected component set is successfully rendered onto the DOM.",
"type": null,
"isOptional": false
},
{
"name": "exposedProps",
"description": "An {Object} with props that will be passed to each item rendered into the set.",
"type": "Object",
"isOptional": true
},
{
"name": "containersRequired",
"description": ". Pass false to optionally remove the containers placed around injected components to isolate them from the rest of the app.",
"type": null,
"isOptional": true
},
{
"name": null,
"description": "Any other props you provide, such as `direction`, `data-column`, etc. will be applied to the {Flexbox} rendered by the InjectedComponentSet.",
"type": null
}
]
}
],
"instanceProperties": [],
"visibility": "Public",
"summary": "InjectedComponent makes it easy to include a set of dynamically registered\ncomponents inside of your React render method. Rather than explicitly render\nan array of buttons, for example, you can use InjectedComponentSet:",
"description": "InjectedComponent makes it easy to include a set of dynamically registered\ncomponents inside of your React render method. Rather than explicitly render\nan array of buttons, for example, you can use InjectedComponentSet:\n\n```coffee\n<InjectedComponentSet className=\"message-actions\"\n matching={role: 'ThreadActionButton'}\n exposedProps={thread:@props.thread, message:@props.message}>\n```\n\nInjectedComponentSet will look up components registered for the location you provide,\nrender them inside a {Flexbox} and pass them `exposedProps`. By default, all injected\nchildren are rendered inside {UnsafeComponent} wrappers to prevent third-party code\nfrom throwing exceptions that break React renders.\n\nInjectedComponentSet monitors the ComponentRegistry for changes. If a new component\nis registered into the location you provide, InjectedComponentSet will re-render.\n\nIf no matching components is found, the InjectedComponent renders an empty span.\n\nSection: Component Kit"
},
"KeyCommandsRegion": {
"name": "KeyCommandsRegion",
"filename": "docs_src/classes/temp-cjsx/key-commands-region.js",
"srcUrl": null,
"sections": [],
"classMethods": [],
"instanceMethods": [],
"classProperties": [],
"instanceProperties": [],
"visibility": "Public",
"summary": "Easily respond to keyboard shortcuts",
"description": "Easily respond to keyboard shortcuts\n\nA keyboard shortcut has two parts to it:\n\n1. A mapping between keyboard actions and a command\n1. A mapping between a command and a callback handler\n\n#// Mapping keys to commands (not handled by this component)\n\nThe **keyboard -> command** mapping is defined in a separate `.cson` file.\nA majority of the commands your component would want to listen to you have\nalready been defined by core N1 defaults, as well as custom user\noverrides. See 'keymaps/base.cson' for more information.\n\nYou can define additional, custom keyboard -> command mappings in your own\npackage-specific keymap `.cson` file. The file can be named anything but\nmust exist in a folder called `keymaps` in the root of your package's\ndirectory.\n\n#// Mapping commands to callbacks (handled by this component)\n\nWhen a keystroke sequence matches a binding in a given context, a custom\nDOM event with a type based on the command is dispatched on the target of\nthe keyboard event.\n\nThat custom DOM event (whose type is the command you want to listen to)\nwill propagate up from its original target. That original target may or\nmay not be a descendent of your <KeyCommandsRegion> component.\n\nFrequently components will want to listen to a keyboard command regardless\nof where it was fired from. For those, use the `globalHandlers` prop. The\nDOM event will NOT be passed to `globalHandlers` callbacks.\n\nComponents may also want to listen to keyboard commands that originate\nwithin one of their descendents. For those use the `localHandlers` prop.\nThe DOM event WILL be passed to `localHandlers` callback because it is\nsometimes valuable to call `stopPropagataion` on the custom command event.\n\nProps:\n\nExample:\n\nIn `my-package/lib/my-component.cjsx`:\n\n```js\nclass MyComponent extends React.Component {\n render() {\n return (\n <KeyCommandsRegion\n globalHandlers={{\n \"core:moveDown\": this.onMoveDown\n \"core:selectItem\": this.onSelectItem\n }}\n className=\"my-component\"\n >\n <div>... sweet component ...</div>\n </KeyCommandsRegion>\n );\n }\n}\n```\n\nIn `my-package/keymaps/my-package.cson`:\n\n```js\n\".my-component\":\n \"cmd-t\": \"selectItem\"\n \"cmd-enter\": \"sendMessage\"\n```"
},
"Matcher": {
"name": "Matcher",
"superClass": null,
"filename": "docs_src/classes/temp-cjsx/matcher.js",
"srcUrl": null,
"sections": [],
"classMethods": [],
"instanceMethods": [],
"classProperties": [],
"instanceProperties": [],
"visibility": "Public",
"summary": "The Matcher class encapsulates a particular comparison clause on an {Attribute}.\nMatchers can evaluate whether or not an object matches them, and also compose\nSQL clauses for the DatabaseStore. Each matcher has a reference to a model\nattribute, a comparator and a value.",
"description": "The Matcher class encapsulates a particular comparison clause on an {Attribute}.\nMatchers can evaluate whether or not an object matches them, and also compose\nSQL clauses for the DatabaseStore. Each matcher has a reference to a model\nattribute, a comparator and a value.\n\n```coffee\n\n// Retrieving Matchers\n\nisUnread = Thread.attributes.unread.equal(true)\n\nhasLabel = Thread.attributes.categories.contains('label-id-123')\n\n// Using Matchers in Database Queries\n\nDatabaseStore.findAll(Thread).where(isUnread)...\n\n// Using Matchers to test Models\n\nthreadA = new Thread(unread: true)\nthreadB = new Thread(unread: false)\n\nisUnread.evaluate(threadA)\n// => true\nisUnread.evaluate(threadB)\n// => false\n```\n\nSection: Database"
},
"Menu": {
"name": "Menu",
"superClass": "React",
"filename": "menu.coffee",
"srcUrl": null,
"sections": [],
"classMethods": [],
"instanceMethods": [
{
"name": "getSelectedItem",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "",
"description": "",
"returnValues": [
{
"type": null,
"description": "Returns the currently selected item."
}
]
}
],
"classProperties": [
{
"name": "propTypes",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "React `props` supported by Menu:",
"description": "React `props` supported by Menu:",
"arguments": [
{
"name": "className",
"description": "The {String} class name applied to the Menu",
"type": "String",
"isOptional": true
},
{
"name": "itemContent",
"description": "A {Function} that returns a {MenuItem}, {String}, or React component for the given `item`. If you return a {MenuItem}, your item is injected into the list directly. If you return a string or React component, the result is placed within a {MenuItem}, resulting in the following DOM: `<div className=\"item [selected]\">{your content}</div>`. To create dividers and other special menu items, return an instance of:",
"type": "Function",
"isOptional": false
},
{
"name": "itemKey",
"description": "A {Function} that returns a unique string key for the given `item`. Keys are important for efficient React rendering when `items` is changed, and a key function is required.",
"type": "Function",
"isOptional": false
},
{
"name": "itemChecked",
"description": "A {Function} that returns true if the given item should be shown with a checkmark. If you don't provide an implementation for `itemChecked`, no checkmarks are ever shown.",
"type": "Function",
"isOptional": false
},
{
"name": "items",
"description": "An {Array} of arbitrary objects the menu should display.",
"type": "Array",
"isOptional": false
},
{
"name": "onSelect",
"description": "A {Function} called with the selected item when the user clicks an item in the menu or confirms their selection with the Enter key.",
"type": "Function",
"isOptional": false
},
{
"name": "onEscape",
"description": "A {Function} called when a user presses escape in the input.",
"type": "Function",
"isOptional": false
},
{
"name": "defaultSelectedIndex",
"description": "The index of the item first selected if there was no other previous index. Defaults to 0. Set to -1 if you want nothing selected.",
"type": null,
"isOptional": false
}
]
}
],
"instanceProperties": [],
"visibility": "Public",
"summary": "React component for multi-section Menus with key binding",
"description": "React component for multi-section Menus with key binding\n\nThe Menu component allows you to display a list of items. Menu takes care of\nseveral important things, ensuring that your menu is consistent with the rest\nof the N1 application and offers a near-native experience:\n\n* Keyboard Interaction with the Up and Down arrow keys, Enter to select\n* Maintaining selection across content changes\n* Highlighted state\n\nMenus are often, but not always, used in conjunction with {Popover} to display\na floating \"popup\" menu. See `template-picker.cjsx` for an example.\n\nThe Menu also exposes \"header\" and \"footer\" regions you can fill with arbitrary\ncomponents by providing the `headerComponents` and `footerComponents` props.\nThese items are nested within `.header-container`. and `.footer-container`,\nand you can customize their appearance by providing CSS selectors scoped to your\ncomponent's Menu instance:\n\n```css\n.template-picker .menu .header-container {\n height: 100px;\n}\n```\n\nSection: Component Kit"
},
"MenuItem": {
"name": "MenuItem",
"superClass": "React",
"filename": "menu.coffee",
"srcUrl": null,
"sections": [],
"classMethods": [],
"instanceMethods": [],
"classProperties": [
{
"name": "propTypes",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "React `props` supported by MenuItem:",
"description": "React `props` supported by MenuItem:",
"arguments": [
{
"name": "divider",
"description": "Pass a {Boolean} to render the menu item as a section divider.",
"type": "Boolean",
"isOptional": true
},
{
"name": "key",
"description": "Pass a {String} to be the React key to optimize rendering lists of items.",
"type": "String",
"isOptional": true
},
{
"name": "selected",
"description": "Pass a {Boolean} to specify whether the item is selected.",
"type": "Boolean",
"isOptional": true
},
{
"name": "checked",
"description": "Pass a {Boolean} to specify whether the item is checked.",
"type": "Boolean",
"isOptional": true
}
]
}
],
"instanceProperties": [],
"visibility": "Public",
"summary": "`MenuItem` components can be provided to the {Menu} by the `itemContent` function.\nMenuItem's props allow you to display dividers as well as standard items.",
"description": "`MenuItem` components can be provided to the {Menu} by the `itemContent` function.\nMenuItem's props allow you to display dividers as well as standard items.\n\nSection: Component Kit"
},
"MenuNameEmailItem": {
"name": "MenuNameEmailItem",
"superClass": "React",
"filename": "menu.coffee",
"srcUrl": null,
"sections": [],
"classMethods": [],
"instanceMethods": [],
"classProperties": [
{
"name": "propTypes",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "React `props` supported by MenuNameEmailItem:",
"description": "React `props` supported by MenuNameEmailItem:",
"arguments": [
{
"name": "name",
"description": "The {String} name to be displayed.",
"type": "String",
"isOptional": true
},
{
"name": "email",
"description": "The {String} email address to be displayed.",
"type": "String",
"isOptional": true
}
]
}
],
"instanceProperties": [],
"visibility": "Public",
"summary": "React component for a {Menu} item that displays a name and email address.",
"description": "React component for a {Menu} item that displays a name and email address.\n\nSection: Component Kit"
},
"Message": {
"name": "Message",
"superClass": "ModelWithMetadata",
"filename": "docs_src/classes/temp-cjsx/message.js",
"srcUrl": null,
"sections": [],
"classMethods": [],
"instanceMethods": [
{
"name": "participants",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "",
"description": "",
"returnValues": [
{
"type": null,
"description": "Returns a set of uniqued message participants by combining the\n`to`, `cc`, `bcc` && (optionally) `from` fields."
}
]
},
{
"name": "participantsForReplyAll",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "",
"description": "",
"returnValues": [
{
"type": null,
"description": "Returns a hash with `to` && `cc` keys for authoring a new draft in\n\"reply all\" to this message. This method takes into account whether the\nmessage === from the current user, && also looks at the replyTo field."
}
]
},
{
"name": "participantsForReply",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "",
"description": "",
"returnValues": [
{
"type": null,
"description": "Returns a hash with `to` && `cc` keys for authoring a new draft in\n\"reply\" to this message. This method takes into account whether the\nmessage === from the current user, && also looks at the replyTo field."
}
]
},
{
"name": "fileIds",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "",
"description": "",
"returnValues": [
{
"type": "Array",
"description": "Returns an {Array} of {File} IDs"
}
]
},
{
"name": "isFromMe",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "",
"description": "",
"returnValues": [
{
"type": null,
"description": "Returns true if this message === from the current user's email\naddress. In the future, this method will take into account all of the\nuser's email addresses && accounts."
}
]
},
{
"name": "computePlainText",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "",
"description": "",
"returnValues": [
{
"type": null,
"description": "Returns a plaintext version of the message body using Chromium's\nDOMParser. Use with care."
}
]
},
{
"name": "replyAttributionLine",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "",
"description": "",
"returnValues": [
{
"type": null,
"description": "Returns the standard attribution line for this message,\nlocalized for the current user.\nie \"On Dec. 12th, 2015 at 4:00PM, Ben Gotow wrote:\""
}
]
}
],
"classProperties": [],
"instanceProperties": [],
"visibility": "Public",
"summary": "The Message model represents a Message object served by the Nylas Platform API.\nFor more information about Messages on the Nylas Platform, read the\n[Messages API Documentation](https://nylas.com/cloud/docs#messages)",
"description": "The Message model represents a Message object served by the Nylas Platform API.\nFor more information about Messages on the Nylas Platform, read the\n[Messages API Documentation](https://nylas.com/cloud/docs#messages)\n\nMessages are a sub-object of threads. The content of a message === immutable (with the\nexception being drafts). Nylas does not support operations such as move || delete on\nindividual messages; those operations should be performed on the messages thread.\nAll messages are part of a thread, even if that thread has only one message.\n\n## Attributes\n\n`to`: {AttributeCollection} A collection of {Contact} objects\n\n`cc`: {AttributeCollection} A collection of {Contact} objects\n\n`bcc`: {AttributeCollection} A collection of {Contact} objects\n\n`from`: {AttributeCollection} A collection of {Contact} objects.\n\n`replyTo`: {AttributeCollection} A collection of {Contact} objects.\n\n`date`: {AttributeDateTime} When the message was delivered. Queryable.\n\n`subject`: {AttributeString} The subject of the thread. Queryable.\n\n`snippet`: {AttributeString} A short, 140-character plain-text summary of the message body.\n\n`unread`: {AttributeBoolean} True if the message === unread. Queryable.\n\n`starred`: {AttributeBoolean} True if the message === starred. Queryable.\n\n`draft`: {AttributeBoolean} True if the message === a draft. Queryable.\n\n`version`: {AttributeNumber} The version number of the message. Message\n versions are used for drafts, && increment when attributes are changed.\n\n`files`: {AttributeCollection} A set of {File} models representing\n the attachments on this thread.\n\n`body`: {AttributeJoinedData} The HTML body of the message. You must specifically\n request this attribute when querying for a Message using the {{AttributeJoinedData::include}}\n method.\n\n`pristine`: {AttributeBoolean} True if the message === a draft which has not been\n edited since it was created.\n\n`threadId`: {AttributeString} The ID of the Message's parent {Thread}. Queryable.\n\n`replyToMessageId`: {AttributeString} The ID of a {Message} that this message\n === in reply to.\n\nThis class also inherits attributes from {Model}\n\nSection: Models"
},
"MessageStoreExtension": {
"name": "MessageStoreExtension",
"filename": "message-store-extension.coffee",
"srcUrl": null,
"sections": [],
"classMethods": [],
"instanceMethods": [],
"classProperties": [],
"instanceProperties": [],
"visibility": "Public",
"summary": "MessageStoreExtension is deprecated. Use {MessageViewExtension} instead.\nSection: Extensions",
"description": "MessageStoreExtension is deprecated. Use {MessageViewExtension} instead.\nSection: Extensions"
},
"MessageViewExtension": {
"name": "MessageViewExtension",
"filename": "message-view-extension.coffee",
"srcUrl": null,
"sections": [],
"classMethods": [
{
"name": "formatMessageBody",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "Modify the body of the message provided. Note that you're provided\nthe entire message object, but you can only change `message.body`.",
"description": "Modify the body of the message provided. Note that you're provided\nthe entire message object, but you can only change `message.body`."
},
{
"name": "renderedMessageBodyIntoDocument",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "Modify the rendered message body using the DOM.\nRuns after messages goes through `formatMessageBody` and is placed\ninto the DOM.",
"description": "Modify the rendered message body using the DOM.\nRuns after messages goes through `formatMessageBody` and is placed\ninto the DOM."
}
],
"instanceMethods": [],
"classProperties": [],
"instanceProperties": [],
"visibility": "Public",
"summary": "To create MessageViewExtension that customize message viewing, you\nshould create objects that implement the interface defined at {MessageViewExtension}.",
"description": "To create MessageViewExtension that customize message viewing, you\nshould create objects that implement the interface defined at {MessageViewExtension}.\n\nTo register your extension with the ExtensionRegistry, call {ExtensionRegistry::MessageView::registerExtension}.\nWhen your package is being unloaded, you *must* call the corresponding\n{ExtensionRegistry::MessageView::unregisterExtension} to unhook your extension.\n\n```coffee\nactivate: ->\n ExtensionRegistry.MessageView.register(MyExtension)\n\n...\n\ndeactivate: ->\n ExtensionRegistry.MessageView.unregister(MyExtension)\n```\n\nThe MessageViewExtension API does not currently expose any asynchronous or {Promise}-based APIs.\nThis will likely change in the future. If you have a use-case for a Message Store extension that\nis not possible with the current API, please let us know.\n\nSection: Extensions"
},
"Model": {
"name": "Model",
"filename": "model.coffee",
"srcUrl": null,
"sections": [],
"classMethods": [],
"instanceMethods": [
{
"name": "attributes",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "",
"description": "",
"returnValues": [
{
"type": "Array",
"description": "Returns an {Array} of {Attribute} objects defined on the Model's constructor"
}
]
},
{
"name": "toJSON",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "Deflates the model to a plain JSON object. Only attributes defined\non the model are included in the JSON.",
"description": "Deflates the model to a plain JSON object. Only attributes defined\non the model are included in the JSON.",
"arguments": [
{
"name": "options",
"description": "An {Object} with additional options. To skip joined data attributes in the toJSON representation, pass the `joined:false`",
"type": "Object",
"isOptional": true
}
],
"returnValues": [
{
"type": "Object",
"description": "Returns an {Object} with the JSON representation of the model."
}
]
},
{
"name": "matches",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "Evaluates the model against one or more {Matcher} objects.",
"description": "Evaluates the model against one or more {Matcher} objects.",
"arguments": [
{
"name": "criteria",
"description": "An {Array} of {Matcher}s to run on the model.",
"type": "Array",
"isOptional": false
}
],
"returnValues": [
{
"type": null,
"description": "Returns true if the model matches the criteria."
}
]
}
],
"classProperties": [],
"instanceProperties": [],
"visibility": "Public",
"summary": "A base class for API objects that provides abstract support for\nserialization and deserialization, matching by attributes, and ID-based equality.",
"description": "A base class for API objects that provides abstract support for\nserialization and deserialization, matching by attributes, and ID-based equality.\n\n## Attributes\n\n`id`: {AttributeString} The resolved canonical ID of the model used in the\ndatabase and generally throughout the app. The id property is a custom\ngetter that resolves to the serverId first, and then the clientId.\n\n`clientId`: {AttributeString} An ID created at object construction and\npersists throughout the lifetime of the object. This is extremely useful\nfor optimistically creating objects (like drafts and categories) and\nhaving a constant reference to it. In all other cases, use the resolved\n`id` field.\n\n`serverId`: {AttributeServerId} The server ID of the model. In most cases,\nexcept optimistic creation, this will also be the canonical id of the\nobject.\n\n`object`: {AttributeString} The model's type. This field is used by the JSON\n deserializer to create an instance of the correct class when inflating the object.\n\n`accountId`: {AttributeString} The string Account Id this model belongs to.\n\nSection: Models"
},
"ModelQuery": {
"name": "ModelQuery",
"superClass": null,
"filename": "docs_src/classes/temp-cjsx/query.js",
"srcUrl": null,
"sections": [],
"classMethods": [],
"instanceMethods": [
{
"name": "where",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "Add one or more where clauses to the query",
"description": "Add one or more where clauses to the query\n\nThis method is chainable.",
"arguments": [
{
"name": "matchers",
"description": "An {Array} of {Matcher} objects that add where clauses to the underlying query.",
"type": "Array",
"isOptional": false
}
]
},
{
"name": "include",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "Include specific joined data attributes in result objects.",
"description": "Include specific joined data attributes in result objects.\n\nThis method is chainable.",
"arguments": [
{
"name": "attr",
"description": "A {AttributeJoinedData} that you want to be populated in the returned models. Note: This results in a LEFT OUTER JOIN. See {AttributeJoinedData} for more information.",
"type": "AttributeJoinedData",
"isOptional": false
}
]
},
{
"name": "includeAll",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "Include all of the available joined data attributes in returned models.",
"description": "Include all of the available joined data attributes in returned models.\n\nThis method is chainable."
},
{
"name": "order",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "Apply a sort order to the query.",
"description": "Apply a sort order to the query.\n\nThis method is chainable.",
"arguments": [
{
"name": "orders",
"description": "An {Array} of one or more {SortOrder} objects that determine the sort order of returned models.",
"type": "Array",
"isOptional": false
}
]
},
{
"name": "one",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "Set the `singular` flag - only one model will be returned from the\nquery, and a `LIMIT 1` clause will be used.",
"description": "Set the `singular` flag - only one model will be returned from the\nquery, and a `LIMIT 1` clause will be used.\n\nThis method is chainable."
},
{
"name": "limit",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "Limit the number of query results.",
"description": "Limit the number of query results.\n\nThis method is chainable.",
"arguments": [
{
"name": "limit",
"description": "{Number} The number of models that should be returned.",
"type": "Number",
"isOptional": false
}
]
},
{
"name": "offset",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "",
"description": "\n\nThis method is chainable.",
"arguments": [
{
"name": "offset",
"description": "{Number} The start offset of the query.",
"type": "Number",
"isOptional": false
}
]
},
{
"name": "page",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "",
"description": "\n\nA convenience method for setting both limit and offset given a desired page size."
},
{
"name": "count",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "Set the `count` flag - instead of returning inflated models,\nthe query will return the result `COUNT`.",
"description": "Set the `count` flag - instead of returning inflated models,\nthe query will return the result `COUNT`.\n\nThis method is chainable."
},
{
"name": "then",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "Short-hand syntax that calls run().then(fn) with the provided function.",
"description": "Short-hand syntax that calls run().then(fn) with the provided function.",
"returnValues": [
{
"type": "Promise",
"description": "Returns a {Promise} that resolves with the Models returned by the\nquery, or rejects with an error from the Database layer."
}
]
},
{
"name": "run",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "",
"description": "",
"returnValues": [
{
"type": "Promise",
"description": "Returns a {Promise} that resolves with the Models returned by the\nquery, or rejects with an error from the Database layer."
}
]
}
],
"classProperties": [],
"instanceProperties": [],
"visibility": "Public",
"summary": "ModelQuery exposes an ActiveRecord-style syntax for building database queries\nthat return models and model counts. Model queries are returned from the factory methods\n{DatabaseStore::find}, {DatabaseStore::findBy}, {DatabaseStore::findAll}, and {DatabaseStore::count}, and are the primary interface for retrieving data\nfrom the app's local cache.",
"description": "ModelQuery exposes an ActiveRecord-style syntax for building database queries\nthat return models and model counts. Model queries are returned from the factory methods\n{DatabaseStore::find}, {DatabaseStore::findBy}, {DatabaseStore::findAll}, and {DatabaseStore::count}, and are the primary interface for retrieving data\nfrom the app's local cache.\n\nModelQuery does not allow you to modify the local cache. To create, update or\ndelete items from the local cache, see {DatabaseStore::persistModel}\nand {DatabaseStore::unpersistModel}.\n\n**Simple Example:** Fetch a thread\n\n```coffee\nquery = DatabaseStore.find(Thread, '123a2sc1ef4131')\nquery.then (thread) ->\n // thread or null\n```\n\n**Advanced Example:** Fetch 50 threads in the inbox, in descending order\n\n```coffee\nquery = DatabaseStore.findAll(Thread)\nquery.where([Thread.attributes.categories.contains('label-id')])\n .order([Thread.attributes.lastMessageReceivedTimestamp.descending()])\n .limit(100).offset(50)\n .then (threads) ->\n // array of threads\n```\n\nSection: Database"
},
"MultiselectActionBar": {
"name": "MultiselectActionBar",
"superClass": "React",
"filename": "multiselect-action-bar.coffee",
"srcUrl": null,
"sections": [],
"classMethods": [],
"instanceMethods": [],
"classProperties": [
{
"name": "propTypes",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "React `props` supported by MultiselectActionBar:",
"description": "React `props` supported by MultiselectActionBar:",
"arguments": [
{
"name": "dataStore",
"description": "An instance of a {ListDataSource}.",
"type": "ListDataSource",
"isOptional": false
},
{
"name": "collection",
"description": "The name of the collection. The collection name is used for the text that appears in the bar \"1 thread selected\" and is also used to find components in the component registry that should appear in the bar (`thread` => `thread:BulkAtion`)",
"type": null,
"isOptional": false
}
]
}
],
"instanceProperties": [],
"visibility": "Public",
"summary": "MultiselectActionBar is a simple component that can be placed in a {Sheet} Toolbar.\nWhen the provided `dataStore` has a selection, it appears over the other items in the toolbar.",
"description": "MultiselectActionBar is a simple component that can be placed in a {Sheet} Toolbar.\nWhen the provided `dataStore` has a selection, it appears over the other items in the toolbar.\n\nGenerally, you wrap {MultiselectActionBar} in your own simple component to provide a dataStore\nand other settings:\n\n```coffee\nclass MultiselectActionBar extends React.Component\n @displayName: 'MultiselectActionBar'\n\n render: =>\n <MultiselectActionBar\n dataStore={ThreadListStore}\n className=\"thread-list\"\n collection=\"thread\" />\n```\n\nThe MultiselectActionBar uses the `ComponentRegistry` to find items to display for the given\ncollection name. To add an item to the bar created in the example above, register it like this:\n\n```coffee\nComponentRegistry.register ThreadBulkTrashButton,\n role: 'thread:Toolbar'\n```\n\nSection: Component Kit"
},
"MultiselectList": {
"name": "MultiselectList",
"superClass": "React",
"filename": "multiselect-list.coffee",
"srcUrl": null,
"sections": [],
"classMethods": [],
"instanceMethods": [],
"classProperties": [],
"instanceProperties": [],
"visibility": "Public",
"summary": "MultiselectList wraps {ListTabular} and makes it easy to present a\n{ListDataSource} with selection support. It adds a checkbox column to the columns\nyou provide, and also handles:",
"description": "MultiselectList wraps {ListTabular} and makes it easy to present a\n{ListDataSource} with selection support. It adds a checkbox column to the columns\nyou provide, and also handles:\n\n* Command-clicking individual items\n* Shift-clicking to select a range\n* Using the keyboard to select a range\n\nSection: Component Kit"
},
"NylasEnvConstructor": {
"name": "NylasEnvConstructor",
"filename": "nylas-env.coffee",
"srcUrl": null,
"sections": [
{
"name": "Properties",
"description": ""
},
{
"name": "Construction and Destruction",
"description": ""
},
{
"name": "Event Subscription",
"description": ""
},
{
"name": "Managing The Nylas Window",
"description": ""
},
{
"name": "Messaging the User",
"description": ""
},
{
"name": "Managing the Dev Tools",
"description": ""
}
],
"classMethods": [],
"instanceMethods": [
{
"name": "reportError",
"sectionName": "Construction and Destruction",
"srcUrl": null,
"visibility": "Public",
"summary": "report an error through the `ErrorLogger`",
"description": "report an error through the `ErrorLogger`\n\nTakes an error and an extra object to report. Hooks into the\n`onWillThrowError` and `onDidThrowError` callbacks. If someone\nregistered with `onWillThrowError` calls `preventDefault` on the event\nobject it's given, then no error will be reported.\n\nThe difference between this and `ErrorLogger.reportError` is that\n`NylasEnv.reportError` will hook into the event callbacks and handle\ntest failures and dev tool popups. "
},
{
"name": "onDidBeep",
"sectionName": "Event Subscription",
"srcUrl": null,
"visibility": "Extended",
"summary": "Invoke the given callback whenever {::beep} is called.",
"description": "Invoke the given callback whenever {::beep} is called.",
"arguments": [
{
"name": "callback",
"description": "{Function} to be called whenever {::beep} is called.",
"type": "Function",
"isOptional": false
}
],
"returnValues": [
{
"type": "Disposable",
"description": "Returns a {Disposable} on which `.dispose()` can be called to unsubscribe."
}
]
},
{
"name": "onWillThrowError",
"sectionName": "Event Subscription",
"srcUrl": null,
"visibility": "Extended",
"summary": "Invoke the given callback when there is an unhandled error, but\nbefore the devtools pop open",
"description": "Invoke the given callback when there is an unhandled error, but\nbefore the devtools pop open",
"arguments": [
{
"children": [
{
"children": [
{
"name": "originalError",
"description": "{Object} the original error object",
"type": "Object",
"isOptional": false
},
{
"name": "message",
"description": "{String} the original error object",
"type": "String",
"isOptional": false
},
{
"name": "url",
"description": "{String} Url to the file where the error originated.",
"type": "String",
"isOptional": false
},
{
"name": "line",
"description": "{Number}",
"type": "Number",
"isOptional": false
},
{
"name": "column",
"description": "{Number}",
"type": "Number",
"isOptional": false
},
{
"name": "preventDefault",
"description": "{Function} call this to avoid popping up the dev tools.",
"type": "Function",
"isOptional": false
}
],
"name": "event",
"description": "{Object}",
"type": "Object",
"isOptional": false
}
],
"name": "callback",
"description": "{Function} to be called whenever there is an unhandled error",
"type": "Function",
"isOptional": false
}
],
"returnValues": [
{
"type": "Disposable",
"description": "Returns a {Disposable} on which `.dispose()` can be called to unsubscribe."
}
]
},
{
"name": "onDidThrowError",
"sectionName": "Event Subscription",
"srcUrl": null,
"visibility": "Extended",
"summary": "Invoke the given callback whenever there is an unhandled error.",
"description": "Invoke the given callback whenever there is an unhandled error.",
"arguments": [
{
"children": [
{
"children": [
{
"name": "originalError",
"description": "{Object} the original error object",
"type": "Object",
"isOptional": false
},
{
"name": "message",
"description": "{String} the original error object",
"type": "String",
"isOptional": false
},
{
"name": "url",
"description": "{String} Url to the file where the error originated.",
"type": "String",
"isOptional": false
},
{
"name": "line",
"description": "{Number}",
"type": "Number",
"isOptional": false
},
{
"name": "column",
"description": "{Number}",
"type": "Number",
"isOptional": false
}
],
"name": "event",
"description": "{Object}",
"type": "Object",
"isOptional": false
}
],
"name": "callback",
"description": "{Function} to be called whenever there is an unhandled error",
"type": "Function",
"isOptional": false
}
],
"returnValues": [
{
"type": "Disposable",
"description": "Returns a {Disposable} on which `.dispose()` can be called to unsubscribe."
}
]
},
{
"name": "trace",
"sectionName": "Event Subscription",
"srcUrl": null,
"visibility": "Extended",
"summary": "Run the Chromium content-tracing module for five seconds, and save\nthe output to a file which is printed to the command-line output of the app.\nYou can take the file exported by this function and load it into Chrome's\ncontent trace visualizer (chrome://tracing). It's like Chromium Developer\nTools Profiler, but for all processes and threads. ",
"description": "Run the Chromium content-tracing module for five seconds, and save\nthe output to a file which is printed to the command-line output of the app.\nYou can take the file exported by this function and load it into Chrome's\ncontent trace visualizer (chrome://tracing). It's like Chromium Developer\nTools Profiler, but for all processes and threads. "
},
{
"name": "inDevMode",
"sectionName": "Event Subscription",
"srcUrl": null,
"visibility": "Public",
"summary": "Is the current window in development mode? ",
"description": "Is the current window in development mode? "
},
{
"name": "inSafeMode",
"sectionName": "Event Subscription",
"srcUrl": null,
"visibility": "Public",
"summary": "Is the current window in safe mode? ",
"description": "Is the current window in safe mode? "
},
{
"name": "inSpecMode",
"sectionName": "Event Subscription",
"srcUrl": null,
"visibility": "Public",
"summary": "Is the current window running specs? ",
"description": "Is the current window running specs? "
},
{
"name": "getVersion",
"sectionName": "Event Subscription",
"srcUrl": null,
"visibility": "Public",
"summary": "Get the version of N1.",
"description": "Get the version of N1.",
"returnValues": [
{
"type": "String",
"description": "Returns the version text {String}."
}
]
},
{
"name": "isReleasedVersion",
"sectionName": "Event Subscription",
"srcUrl": null,
"visibility": "Public",
"summary": "Determine whether the current version is an official release. ",
"description": "Determine whether the current version is an official release. "
},
{
"name": "getConfigDirPath",
"sectionName": "Event Subscription",
"srcUrl": null,
"visibility": "Public",
"summary": "Get the directory path to N1's configuration area. ",
"description": "Get the directory path to N1's configuration area. "
},
{
"name": "getWindowLoadTime",
"sectionName": "Event Subscription",
"srcUrl": null,
"visibility": "Public",
"summary": "Get the time taken to completely load the current window.",
"description": "Get the time taken to completely load the current window.\n\nThis time include things like loading and activating packages, creating\nDOM elements for the editor, and reading the config.",
"returnValues": [
{
"type": "Number",
"description": "Returns the {Number} of milliseconds taken to load the window or null\nif the window hasn't finished loading yet."
}
]
},
{
"name": "close",
"sectionName": "Managing The Nylas Window",
"srcUrl": null,
"visibility": "Essential",
"summary": "Close the current window. ",
"description": "Close the current window. "
},
{
"name": "getSize",
"sectionName": "Managing The Nylas Window",
"srcUrl": null,
"visibility": "Essential",
"summary": "Get the size of current window.",
"description": "Get the size of current window.",
"returnValues": [
{
"type": "Object",
"description": "Returns an {Object} in the format `{width: 1000, height: 700}`"
}
]
},
{
"name": "setSize",
"sectionName": "Managing The Nylas Window",
"srcUrl": null,
"visibility": "Essential",
"summary": "Set the size of current window.",
"description": "Set the size of current window.",
"arguments": [
{
"name": "width",
"description": "The {Number} of pixels.",
"type": "Number",
"isOptional": false
},
{
"name": "height",
"description": "The {Number} of pixels. ",
"type": "Number",
"isOptional": false
}
]
},
{
"name": "setSizeAnimated",
"sectionName": "Managing The Nylas Window",
"srcUrl": null,
"visibility": "Essential",
"summary": "Transition and set the size of the current window.",
"description": "Transition and set the size of the current window.",
"arguments": [
{
"name": "width",
"description": "The {Number} of pixels.",
"type": "Number",
"isOptional": false
},
{
"name": "height",
"description": "The {Number} of pixels.",
"type": "Number",
"isOptional": false
},
{
"name": "duration",
"description": "The {Number} of pixels. ",
"type": "Number",
"isOptional": false
}
]
},
{
"name": "getPosition",
"sectionName": "Managing The Nylas Window",
"srcUrl": null,
"visibility": "Essential",
"summary": "Get the position of current window.",
"description": "Get the position of current window.",
"returnValues": [
{
"type": "Object",
"description": "Returns an {Object} in the format `{x: 10, y: 20}`"
}
]
},
{
"name": "setPosition",
"sectionName": "Managing The Nylas Window",
"srcUrl": null,
"visibility": "Essential",
"summary": "Set the position of current window.",
"description": "Set the position of current window.",
"arguments": [
{
"name": "x",
"description": "The {Number} of pixels.",
"type": "Number",
"isOptional": false
},
{
"name": "y",
"description": "The {Number} of pixels. ",
"type": "Number",
"isOptional": false
}
]
},
{
"name": "center",
"sectionName": "Managing The Nylas Window",
"srcUrl": null,
"visibility": "Extended",
"summary": "Move current window to the center of the screen. ",
"description": "Move current window to the center of the screen. "
},
{
"name": "focus",
"sectionName": "Managing The Nylas Window",
"srcUrl": null,
"visibility": "Extended",
"summary": "Focus the current window. Note: this will not open the window\nif it is hidden. ",
"description": "Focus the current window. Note: this will not open the window\nif it is hidden. "
},
{
"name": "show",
"sectionName": "Managing The Nylas Window",
"srcUrl": null,
"visibility": "Extended",
"summary": "Show the current window. ",
"description": "Show the current window. "
},
{
"name": "hide",
"sectionName": "Managing The Nylas Window",
"srcUrl": null,
"visibility": "Extended",
"summary": "Hide the current window. ",
"description": "Hide the current window. "
},
{
"name": "reload",
"sectionName": "Managing The Nylas Window",
"srcUrl": null,
"visibility": "Extended",
"summary": "Reload the current window. ",
"description": "Reload the current window. "
},
{
"name": "getWindowProps",
"sectionName": "Managing The Nylas Window",
"srcUrl": null,
"visibility": "Public",
"summary": "The windowProps passed when creating the window via `newWindow`.",
"description": "The windowProps passed when creating the window via `newWindow`."
},
{
"name": "onWindowPropsReceived",
"sectionName": "Managing The Nylas Window",
"srcUrl": null,
"visibility": "Public",
"summary": "If your package declares hot-loaded window types, `onWindowPropsReceived`\nfires when your hot-loaded window is about to be shown so you can update\ncomponents to reflect the new window props.",
"description": "If your package declares hot-loaded window types, `onWindowPropsReceived`\nfires when your hot-loaded window is about to be shown so you can update\ncomponents to reflect the new window props.\n\n* callback: A function to call when window props are received, just before\n the hot window is shown. The first parameter is the new windowProps."
},
{
"name": "isMaximixed",
"sectionName": "Managing The Nylas Window",
"srcUrl": null,
"visibility": "Extended",
"summary": "Is the current window maximized? ",
"description": "Is the current window maximized? "
},
{
"name": "isFullScreen",
"sectionName": "Managing The Nylas Window",
"srcUrl": null,
"visibility": "Extended",
"summary": "Is the current window in full screen mode? ",
"description": "Is the current window in full screen mode? "
},
{
"name": "setFullScreen",
"sectionName": "Managing The Nylas Window",
"srcUrl": null,
"visibility": "Extended",
"summary": "Set the full screen state of the current window. ",
"description": "Set the full screen state of the current window. "
},
{
"name": "toggleFullScreen",
"sectionName": "Managing The Nylas Window",
"srcUrl": null,
"visibility": "Extended",
"summary": "Toggle the full screen state of the current window. ",
"description": "Toggle the full screen state of the current window. "
},
{
"name": "beep",
"sectionName": "Messaging the User",
"srcUrl": null,
"visibility": "Essential",
"summary": "Visually and audibly trigger a beep. ",
"description": "Visually and audibly trigger a beep. "
},
{
"name": "confirm",
"sectionName": "Messaging the User",
"srcUrl": null,
"visibility": "Essential",
"summary": "A flexible way to open a dialog akin to an alert dialog.",
"description": "A flexible way to open a dialog akin to an alert dialog.",
"arguments": [
{
"children": [
{
"name": "message",
"description": "The {String} message to display.",
"type": "String",
"isOptional": false
},
{
"name": "detailedMessage",
"description": "The {String} detailed message to display.",
"type": "String",
"isOptional": true
},
{
"name": "buttons",
"description": "Either an array of strings or an object where keys are button names and the values are callbacks to invoke when clicked.",
"type": null,
"isOptional": true
}
],
"name": "options",
"description": "An {Object} with the following keys:",
"type": "Object",
"isOptional": false
}
],
"examples": [
{
"description": "",
"lang": "coffee",
"code": "NylasEnv.confirm\n message: 'How you feeling?'\n detailedMessage: 'Be honest.'\n buttons:\n Good: -> window.alert('good to hear')\n Bad: -> window.alert('bummer')",
"raw": "```coffee\nNylasEnv.confirm\n message: 'How you feeling?'\n detailedMessage: 'Be honest.'\n buttons:\n Good: -> window.alert('good to hear')\n Bad: -> window.alert('bummer')\n```"
}
],
"returnValues": [
{
"type": "Number",
"description": "Returns the chosen button index {Number} if the buttons option was an array."
}
]
},
{
"name": "openDevTools",
"sectionName": "Managing the Dev Tools",
"srcUrl": null,
"visibility": "Extended",
"summary": "Open the dev tools for the current window. ",
"description": "Open the dev tools for the current window. "
},
{
"name": "toggleDevTools",
"sectionName": "Managing the Dev Tools",
"srcUrl": null,
"visibility": "Extended",
"summary": "Toggle the visibility of the dev tools for the current window. ",
"description": "Toggle the visibility of the dev tools for the current window. "
},
{
"name": "executeJavaScriptInDevTools",
"sectionName": "Managing the Dev Tools",
"srcUrl": null,
"visibility": "Extended",
"summary": "Execute code in dev tools. ",
"description": "Execute code in dev tools. "
}
],
"classProperties": [],
"instanceProperties": [
{
"name": "commands",
"sectionName": "Properties",
"srcUrl": null,
"visibility": "Public",
"summary": "A {CommandRegistry} instance ",
"description": "A {CommandRegistry} instance "
},
{
"name": "config",
"sectionName": "Properties",
"srcUrl": null,
"visibility": "Public",
"summary": "A {Config} instance ",
"description": "A {Config} instance "
},
{
"name": "menu",
"sectionName": "Properties",
"srcUrl": null,
"visibility": "Public",
"summary": "A {MenuManager} instance ",
"description": "A {MenuManager} instance "
},
{
"name": "keymaps",
"sectionName": "Properties",
"srcUrl": null,
"visibility": "Public",
"summary": "A {KeymapManager} instance ",
"description": "A {KeymapManager} instance "
},
{
"name": "packages",
"sectionName": "Properties",
"srcUrl": null,
"visibility": "Public",
"summary": "A {PackageManager} instance ",
"description": "A {PackageManager} instance "
},
{
"name": "themes",
"sectionName": "Properties",
"srcUrl": null,
"visibility": "Public",
"summary": "A {ThemeManager} instance ",
"description": "A {ThemeManager} instance "
},
{
"name": "styles",
"sectionName": "Properties",
"srcUrl": null,
"visibility": "Public",
"summary": "A {StyleManager} instance ",
"description": "A {StyleManager} instance "
}
],
"visibility": "Essential",
"summary": "NylasEnv global for dealing with packages, themes, menus, and the window.",
"description": "NylasEnv global for dealing with packages, themes, menus, and the window.\n\nThe singleton of this class is always available as the `NylasEnv` global. "
},
"PackageManager": {
"name": "PackageManager",
"filename": "package-manager.coffee",
"srcUrl": null,
"sections": [
{
"name": "Event Subscription",
"description": ""
},
{
"name": "Package system data",
"description": ""
},
{
"name": "General package data",
"description": ""
},
{
"name": "Enabling and disabling packages",
"description": ""
},
{
"name": "Accessing active packages",
"description": ""
},
{
"name": "Accessing loaded packages",
"description": ""
},
{
"name": "Accessing available packages",
"description": ""
}
],
"classMethods": [],
"instanceMethods": [
{
"name": "onDidLoadInitialPackages",
"sectionName": "Event Subscription",
"srcUrl": null,
"visibility": "Public",
"summary": "Invoke the given callback when all packages have been loaded.",
"description": "Invoke the given callback when all packages have been loaded.",
"arguments": [
{
"name": "callback",
"description": "{Function}",
"type": "Function",
"isOptional": false
}
],
"returnValues": [
{
"type": "Disposable",
"description": "Returns a {Disposable} on which `.dispose()` can be called to unsubscribe."
}
]
},
{
"name": "onDidActivateInitialPackages",
"sectionName": "Event Subscription",
"srcUrl": null,
"visibility": "Public",
"summary": "Invoke the given callback when all packages have been activated.",
"description": "Invoke the given callback when all packages have been activated.",
"arguments": [
{
"name": "callback",
"description": "{Function}",
"type": "Function",
"isOptional": false
}
],
"returnValues": [
{
"type": "Disposable",
"description": "Returns a {Disposable} on which `.dispose()` can be called to unsubscribe."
}
]
},
{
"name": "onDidActivatePackage",
"sectionName": "Event Subscription",
"srcUrl": null,
"visibility": "Public",
"summary": "Invoke the given callback when a package is activated.",
"description": "Invoke the given callback when a package is activated.",
"arguments": [
{
"children": [
{
"name": "package",
"description": "The {Package} that was activated.",
"type": "Package",
"isOptional": false
}
],
"name": "callback",
"description": "A {Function} to be invoked when a package is activated.",
"type": "Function",
"isOptional": false
}
],
"returnValues": [
{
"type": "Disposable",
"description": "Returns a {Disposable} on which `.dispose()` can be called to unsubscribe."
}
]
},
{
"name": "onDidDeactivatePackage",
"sectionName": "Event Subscription",
"srcUrl": null,
"visibility": "Public",
"summary": "Invoke the given callback when a package is deactivated.",
"description": "Invoke the given callback when a package is deactivated.",
"arguments": [
{
"children": [
{
"name": "package",
"description": "The {Package} that was deactivated.",
"type": "Package",
"isOptional": false
}
],
"name": "callback",
"description": "A {Function} to be invoked when a package is deactivated.",
"type": "Function",
"isOptional": false
}
],
"returnValues": [
{
"type": "Disposable",
"description": "Returns a {Disposable} on which `.dispose()` can be called to unsubscribe."
}
]
},
{
"name": "onDidLoadPackage",
"sectionName": "Event Subscription",
"srcUrl": null,
"visibility": "Public",
"summary": "Invoke the given callback when a package is loaded.",
"description": "Invoke the given callback when a package is loaded.",
"arguments": [
{
"children": [
{
"name": "package",
"description": "The {Package} that was loaded.",
"type": "Package",
"isOptional": false
}
],
"name": "callback",
"description": "A {Function} to be invoked when a package is loaded.",
"type": "Function",
"isOptional": false
}
],
"returnValues": [
{
"type": "Disposable",
"description": "Returns a {Disposable} on which `.dispose()` can be called to unsubscribe."
}
]
},
{
"name": "onDidUnloadPackage",
"sectionName": "Event Subscription",
"srcUrl": null,
"visibility": "Public",
"summary": "Invoke the given callback when a package is unloaded.",
"description": "Invoke the given callback when a package is unloaded.",
"arguments": [
{
"children": [
{
"name": "package",
"description": "The {Package} that was unloaded.",
"type": "Package",
"isOptional": false
}
],
"name": "callback",
"description": "A {Function} to be invoked when a package is unloaded.",
"type": "Function",
"isOptional": false
}
],
"returnValues": [
{
"type": "Disposable",
"description": "Returns a {Disposable} on which `.dispose()` can be called to unsubscribe."
}
]
},
{
"name": "getApmPath",
"sectionName": "Package system data",
"srcUrl": null,
"visibility": "Public",
"summary": "Get the path to the apm command.",
"description": "Get the path to the apm command.\n\nReturn a {String} file path to apm. "
},
{
"name": "getPackageDirPaths",
"sectionName": "Package system data",
"srcUrl": null,
"visibility": "Public",
"summary": "Get the paths being used to look for packages.",
"description": "Get the paths being used to look for packages.",
"returnValues": [
{
"type": "Array",
"description": "Returns an {Array} of {String} directory paths."
}
]
},
{
"name": "resolvePackagePath",
"sectionName": "General package data",
"srcUrl": null,
"visibility": "Public",
"summary": "Resolve the given package name to a path on disk.",
"description": "Resolve the given package name to a path on disk.\n\nReturn a {String} folder path or undefined if it could not be resolved. ",
"arguments": [
{
"name": "name",
"description": "The {String} package name.",
"type": "String",
"isOptional": false
}
]
},
{
"name": "isBundledPackage",
"sectionName": "General package data",
"srcUrl": null,
"visibility": "Public",
"summary": "Is the package with the given name bundled with Nylas?",
"description": "Is the package with the given name bundled with Nylas?",
"arguments": [
{
"name": "name",
"description": "The {String} package name.",
"type": "String",
"isOptional": false
}
],
"returnValues": [
{
"type": "Boolean",
"description": "Returns a {Boolean}."
}
]
},
{
"name": "enablePackage",
"sectionName": "Enabling and disabling packages",
"srcUrl": null,
"visibility": "Public",
"summary": "Enable the package with the given name.",
"description": "Enable the package with the given name.",
"returnValues": [
{
"type": "Package",
"description": "Returns the {Package} that was enabled or null if it isn't loaded."
}
]
},
{
"name": "disablePackage",
"sectionName": "Enabling and disabling packages",
"srcUrl": null,
"visibility": "Public",
"summary": "Disable the package with the given name.",
"description": "Disable the package with the given name.",
"returnValues": [
{
"type": "Package",
"description": "Returns the {Package} that was disabled or null if it isn't loaded."
}
]
},
{
"name": "isPackageDisabled",
"sectionName": "Enabling and disabling packages",
"srcUrl": null,
"visibility": "Public",
"summary": "Is the package with the given name disabled?",
"description": "Is the package with the given name disabled?",
"arguments": [
{
"name": "name",
"description": "The {String} package name.",
"type": "String",
"isOptional": false
}
],
"returnValues": [
{
"type": "Boolean",
"description": "Returns a {Boolean}."
}
]
},
{
"name": "getActivePackages",
"sectionName": "Accessing active packages",
"srcUrl": null,
"visibility": "Public",
"summary": "Get an {Array} of all the active {Package}s. ",
"description": "Get an {Array} of all the active {Package}s. "
},
{
"name": "getActivePackage",
"sectionName": "Accessing active packages",
"srcUrl": null,
"visibility": "Public",
"summary": "Get the active {Package} with the given name.",
"description": "Get the active {Package} with the given name.",
"arguments": [
{
"name": "name",
"description": "The {String} package name.",
"type": "String",
"isOptional": false
}
],
"returnValues": [
{
"type": "Package",
"description": "Returns a {Package} or ."
}
]
},
{
"name": "isPackageActive",
"sectionName": "Accessing active packages",
"srcUrl": null,
"visibility": "Public",
"summary": "Is the {Package} with the given name active?",
"description": "Is the {Package} with the given name active?",
"arguments": [
{
"name": "name",
"description": "The {String} package name.",
"type": "String",
"isOptional": false
}
],
"returnValues": [
{
"type": "Boolean",
"description": "Returns a {Boolean}."
}
]
},
{
"name": "getLoadedPackages",
"sectionName": "Accessing loaded packages",
"srcUrl": null,
"visibility": "Public",
"summary": "Get an {Array} of all the loaded {Package}s ",
"description": "Get an {Array} of all the loaded {Package}s "
},
{
"name": "getLoadedPackage",
"sectionName": "Accessing loaded packages",
"srcUrl": null,
"visibility": "Public",
"summary": "Get the loaded {Package} with the given name.",
"description": "Get the loaded {Package} with the given name.",
"arguments": [
{
"name": "name",
"description": "The {String} package name.",
"type": "String",
"isOptional": false
}
],
"returnValues": [
{
"type": "Package",
"description": "Returns a {Package} or ."
}
]
},
{
"name": "getPluginIdsByPathBase",
"sectionName": "Accessing loaded packages",
"srcUrl": null,
"visibility": "Public",
"summary": "Gets the root paths of all loaded packages.",
"description": "Gets the root paths of all loaded packages.\n\nUseful when determining if an error originated from a package. "
},
{
"name": "isPackageLoaded",
"sectionName": "Accessing loaded packages",
"srcUrl": null,
"visibility": "Public",
"summary": "Is the package with the given name loaded?",
"description": "Is the package with the given name loaded?",
"arguments": [
{
"name": "name",
"description": "The {String} package name.",
"type": "String",
"isOptional": false
}
],
"returnValues": [
{
"type": "Boolean",
"description": "Returns a {Boolean}."
}
]
},
{
"name": "getAvailablePackagePaths",
"sectionName": "Accessing available packages",
"srcUrl": null,
"visibility": "Public",
"summary": "Get an {Array} of {String}s of all the available package paths.",
"description": "Get an {Array} of {String}s of all the available package paths.\n\nIf the optional windowType is passed, it will only load packages\nthat declare that windowType in their package.json "
},
{
"name": "getAvailablePackageNames",
"sectionName": "Accessing available packages",
"srcUrl": null,
"visibility": "Public",
"summary": "Get an {Array} of {String}s of all the available package names. ",
"description": "Get an {Array} of {String}s of all the available package names. "
},
{
"name": "getAvailablePackageMetadata",
"sectionName": "Accessing available packages",
"srcUrl": null,
"visibility": "Public",
"summary": "Get an {Array} of {String}s of all the available package metadata. ",
"description": "Get an {Array} of {String}s of all the available package metadata. "
}
],
"classProperties": [],
"instanceProperties": [],
"visibility": "Extended",
"summary": "Package manager for coordinating the lifecycle of Nylas Mail packages.",
"description": "Package manager for coordinating the lifecycle of Nylas Mail packages.\n\nAn instance of this class is always available as the `NylasEnv.packages` global.\n\nPackages can be loaded, activated, and deactivated, and unloaded:\n\n* Loading a package reads and parses the package's metadata and resources\n such as keymaps, menus, stylesheets, etc.\n* Activating a package registers the loaded resources and calls `activate()`\n on the package's main module.\n* Deactivating a package unregisters the package's resources and calls\n `deactivate()` on the package's main module.\n* Unloading a package removes it completely from the package manager.\n\nPackages can be enabled/disabled via the `core.disabledPackages` config\nsettings and also by calling `enablePackage()/disablePackage()`.\n\nSection: NylasEnv "
},
"QueryResultSet": {
"name": "QueryResultSet",
"superClass": null,
"filename": "docs_src/classes/temp-cjsx/query-result-set.js",
"srcUrl": null,
"sections": [],
"classMethods": [],
"instanceMethods": [],
"classProperties": [],
"instanceProperties": [],
"visibility": "Public",
"summary": "Instances of QueryResultSet hold a set of models retrieved\nfrom the database at a given offset.",
"description": "Instances of QueryResultSet hold a set of models retrieved\nfrom the database at a given offset.\n\nComplete vs Incomplete:\n\nQueryResultSet keeps an array of item ids and a lookup table of models.\nThe lookup table may be incomplete if the QuerySubscription isn't finished\npreparing results. You can use `isComplete` to determine whether the set\nhas every model.\n\nOffset vs Index:\n\nTo avoid confusion, \"index\" refers to an item's position in an\narray, and \"offset\" refers to it's position in the query result set. For example,\nan item might be at index 20 in the _ids array, but at offset 120 in the result.\n\nIds and clientIds:\n\nQueryResultSet calways returns object `ids` when asked for ids, but lookups\nfor models by clientId work once models are loaded."
},
"QuerySubscriptionPool": {
"name": "QuerySubscriptionPool",
"superClass": null,
"filename": "docs_src/classes/temp-cjsx/query-subscription-pool.js",
"srcUrl": null,
"sections": [],
"classMethods": [],
"instanceMethods": [],
"classProperties": [],
"instanceProperties": [],
"visibility": "Public",
"summary": "The QuerySubscriptionPool maintains a list of all of the query\nsubscriptions in the app. In the future, this class will monitor performance,\nmerge equivalent subscriptions, etc.",
"description": "The QuerySubscriptionPool maintains a list of all of the query\nsubscriptions in the app. In the future, this class will monitor performance,\nmerge equivalent subscriptions, etc."
},
"ResizableRegion": {
"name": "ResizableRegion",
"superClass": "React",
"filename": "resizable-region.coffee",
"srcUrl": null,
"sections": [],
"classMethods": [],
"instanceMethods": [],
"classProperties": [],
"instanceProperties": [],
"visibility": "Public",
"summary": "ResizableRegion wraps it's `children` in a div with a fixed width or height, and a\ndraggable edge. It is used throughout N1 to implement resizable columns, trays, etc.",
"description": "ResizableRegion wraps it's `children` in a div with a fixed width or height, and a\ndraggable edge. It is used throughout N1 to implement resizable columns, trays, etc.\n\nSection: Component Kit"
},
"RetinaImg": {
"name": "RetinaImg",
"filename": "docs_src/classes/temp-cjsx/retina-img.js",
"srcUrl": null,
"sections": [],
"classMethods": [],
"instanceMethods": [
{
"name": "render",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "React `props` supported by RetinaImg:",
"description": "React `props` supported by RetinaImg:\n\n```\n- `mode` (required) One of the RetinaImg.Mode constants. See above for details.\n```",
"arguments": [
{
"name": "name",
"description": "A {String} image name to display.",
"type": "String",
"isOptional": true
},
{
"name": "url",
"description": "A {String} url of an image to display. May be an http, https, or `nylas://<packagename>/<path within package>` URL.",
"type": "String",
"isOptional": true
},
{
"name": "fallback",
"description": "A {String} image name to use when `name` cannot be found.",
"type": "String",
"isOptional": true
},
{
"name": "selected",
"description": "Appends \"-selected\" to the end of the image name when when true",
"type": null,
"isOptional": true
},
{
"name": "active",
"description": "Appends \"-active\" to the end of the image name when when true",
"type": null,
"isOptional": true
},
{
"name": "style",
"description": "An {Object} with additional styles to apply to the image.",
"type": "Object",
"isOptional": true
},
{
"name": "resourcePath",
"description": "(options) Changes the default lookup location used to find the images.",
"type": null,
"isOptional": false
}
]
}
],
"classProperties": [],
"instanceProperties": [],
"visibility": "Public",
"summary": "RetinaImg wraps the DOM's standard `<img`> tag and implements a `UIImage` style\ninterface. Rather than specifying an image `src`, RetinaImg allows you to provide\nan image name. Like UIImage on iOS, it automatically finds the best image for the current\ndisplay based on pixel density. Given `image.png`, on a Retina screen, it looks for\n`image@2x.png`, `image.png`, `image@1x.png` in that order. It uses a lookup table and caches\nimage names, so images generally resolve immediately.",
"description": "RetinaImg wraps the DOM's standard `<img`> tag and implements a `UIImage` style\ninterface. Rather than specifying an image `src`, RetinaImg allows you to provide\nan image name. Like UIImage on iOS, it automatically finds the best image for the current\ndisplay based on pixel density. Given `image.png`, on a Retina screen, it looks for\n`image@2x.png`, `image.png`, `image@1x.png` in that order. It uses a lookup table and caches\nimage names, so images generally resolve immediately.\n\nRetinaImg also introduces the concept of image `modes`. Specifying an image mode\nis important for theming: it describes the content of your image, allowing theme\ndevelopers to properly adjust it. The four modes are described below:\n\n* ContentPreserve: Your image contains color or should not be adjusted by any theme.\n* ContentLight: Your image is a grayscale image with light colors, intended to be shown\n against a dark background. If a theme developer changes the background to be light, they\n can safely apply CSS filters to invert or darken this image. This mode adds the\n `content-light` CSS class to the image.\n* ContentDark: Your image is a grayscale image with dark colors, intended to be shown\n against a light background. If a theme developer changes the background to be dark, they\n can safely apply CSS filters to invert or brighten this image. This mode adds the\n `content-dark` CSS class to the image.\n* ContentIsMask: This image provides alpha information only, and color should\n be based on the `background-color` of the RetinaImg. This mode adds the\n `content-mask` CSS class to the image, and leverages `-webkit-mask-image`.\n Example: Icons displayed within buttons specify ContentIsMask, and their\n color is declared via CSS to be the same as the button text color. Changing\n `@text-color-subtle` in a theme changes both button text and button icons!\n ```css\n .btn-icon {\n color: @text-color-subtle;\n img.content-mask { background-color: @text-color-subtle; }\n }\n ```\n\nSection: Component Kit"
},
"SortOrder": {
"name": "SortOrder",
"superClass": null,
"filename": "docs_src/classes/temp-cjsx/sort-order.js",
"srcUrl": null,
"sections": [],
"classMethods": [],
"instanceMethods": [],
"classProperties": [],
"instanceProperties": [],
"visibility": "Public",
"summary": "Represents a particular sort direction on a particular column. You should not\ninstantiate SortOrders manually. Instead, call {Attribute::ascending} or\n{Attribute::descending} to obtain a sort order instance:",
"description": "Represents a particular sort direction on a particular column. You should not\ninstantiate SortOrders manually. Instead, call {Attribute::ascending} or\n{Attribute::descending} to obtain a sort order instance:\n\n```coffee\nDatabaseStore.findBy(Message)\n .where({threadId: threadId, draft: false})\n .order(Message.attributes.date.descending()).then (messages) ->\n```\n\nSection: Database"
},
"Spinner": {
"name": "Spinner",
"superClass": "React",
"filename": "spinner.coffee",
"srcUrl": null,
"sections": [],
"classMethods": [],
"instanceMethods": [],
"classProperties": [],
"instanceProperties": [],
"visibility": "Public",
"summary": "Displays an indeterminate progress indicator in the center of it's\nparent component.",
"description": "Displays an indeterminate progress indicator in the center of it's\nparent component.\n\nSection: Component Kit"
},
"StyleManager": {
"name": "StyleManager",
"filename": "style-manager.coffee",
"srcUrl": null,
"sections": [
{
"name": "Event Subscription",
"description": ""
},
{
"name": "Reading Style Elements",
"description": ""
}
],
"classMethods": [],
"instanceMethods": [
{
"name": "observeStyleElements",
"sectionName": "Event Subscription",
"srcUrl": null,
"visibility": "Extended",
"summary": "Invoke `callback` for all current and future style elements.",
"description": "Invoke `callback` for all current and future style elements.",
"arguments": [
{
"children": [
{
"children": [
{
"name": "sourcePath",
"description": "A {String} containing the path from which the style element was loaded.",
"type": "String",
"isOptional": false
},
{
"name": "context",
"description": "A {String} indicating the target context of the style element.",
"type": "String",
"isOptional": false
}
],
"name": "styleElement",
"description": "An `HTMLStyleElement` instance. The `.sheet` property will be null because this element isn't attached to the DOM. If you want to attach this element to the DOM, be sure to clone it first by calling `.cloneNode(true)` on it. The style element will also have the following non-standard properties:",
"type": null,
"isOptional": false
}
],
"name": "callback",
"description": "{Function} that is called with style elements.",
"type": "Function",
"isOptional": false
}
],
"returnValues": [
{
"type": "Disposable",
"description": "Returns a {Disposable} on which `.dispose()` can be called to cancel the\nsubscription."
}
]
},
{
"name": "onDidAddStyleElement",
"sectionName": "Event Subscription",
"srcUrl": null,
"visibility": "Extended",
"summary": "Invoke `callback` when a style element is added.",
"description": "Invoke `callback` when a style element is added.",
"arguments": [
{
"children": [
{
"children": [
{
"name": "sourcePath",
"description": "A {String} containing the path from which the style element was loaded.",
"type": "String",
"isOptional": false
},
{
"name": "context",
"description": "A {String} indicating the target context of the style element.",
"type": "String",
"isOptional": false
}
],
"name": "styleElement",
"description": "An `HTMLStyleElement` instance. The `.sheet` property will be null because this element isn't attached to the DOM. If you want to attach this element to the DOM, be sure to clone it first by calling `.cloneNode(true)` on it. The style element will also have the following non-standard properties:",
"type": null,
"isOptional": false
}
],
"name": "callback",
"description": "{Function} that is called with style elements.",
"type": "Function",
"isOptional": false
}
],
"returnValues": [
{
"type": "Disposable",
"description": "Returns a {Disposable} on which `.dispose()` can be called to cancel the\nsubscription."
}
]
},
{
"name": "onDidRemoveStyleElement",
"sectionName": "Event Subscription",
"srcUrl": null,
"visibility": "Extended",
"summary": "Invoke `callback` when a style element is removed.",
"description": "Invoke `callback` when a style element is removed.",
"arguments": [
{
"children": [
{
"name": "styleElement",
"description": "An `HTMLStyleElement` instance.",
"type": null,
"isOptional": false
}
],
"name": "callback",
"description": "{Function} that is called with style elements.",
"type": "Function",
"isOptional": false
}
],
"returnValues": [
{
"type": "Disposable",
"description": "Returns a {Disposable} on which `.dispose()` can be called to cancel the\nsubscription."
}
]
},
{
"name": "onDidUpdateStyleElement",
"sectionName": "Event Subscription",
"srcUrl": null,
"visibility": "Extended",
"summary": "Invoke `callback` when an existing style element is updated.",
"description": "Invoke `callback` when an existing style element is updated.",
"arguments": [
{
"children": [
{
"children": [
{
"name": "sourcePath",
"description": "A {String} containing the path from which the style element was loaded.",
"type": "String",
"isOptional": false
},
{
"name": "context",
"description": "A {String} indicating the target context of the style element.",
"type": "String",
"isOptional": false
}
],
"name": "styleElement",
"description": "An `HTMLStyleElement` instance. The `.sheet` property will be null because this element isn't attached to the DOM. The style element will also have the following non-standard properties:",
"type": null,
"isOptional": false
}
],
"name": "callback",
"description": "{Function} that is called with style elements.",
"type": "Function",
"isOptional": false
}
],
"returnValues": [
{
"type": "Disposable",
"description": "Returns a {Disposable} on which `.dispose()` can be called to cancel the\nsubscription."
}
]
},
{
"name": "getStyleElements",
"sectionName": "Reading Style Elements",
"srcUrl": null,
"visibility": "Extended",
"summary": "Get all loaded style elements. ",
"description": "Get all loaded style elements. "
}
],
"classProperties": [],
"instanceProperties": [],
"visibility": "Extended",
"summary": "A singleton instance of this class available via `NylasEnv.styles`,\nwhich you can use to globally query and observe the set of active style\nsheets. The `StyleManager` doesn't add any style elements to the DOM on its\nown, but is instead subscribed to by individual `<nylas-styles>` elements,\nwhich clone and attach style elements in different contexts. ",
"description": "A singleton instance of this class available via `NylasEnv.styles`,\nwhich you can use to globally query and observe the set of active style\nsheets. The `StyleManager` doesn't add any style elements to the DOM on its\nown, but is instead subscribed to by individual `<nylas-styles>` elements,\nwhich clone and attach style elements in different contexts. "
},
"Task": {
"name": "Task",
"superClass": null,
"filename": "docs_src/classes/temp-cjsx/task.js",
"srcUrl": null,
"sections": [],
"classMethods": [],
"instanceMethods": [
{
"name": "constructor",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "Override the constructor to pass initial args to your Task and\ninitialize instance variables.",
"description": "Override the constructor to pass initial args to your Task and\ninitialize instance variables.\n\n**IMPORTANT:** if (you override the constructor, be sure to call)\n`super`.\n\nOn construction, all Tasks instances are given a unique `id`."
},
{
"name": "performRemote",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "**Required** | Put the actual API request code here.",
"description": "**Required** | Put the actual API request code here.\n\nYou must return a {Promise} that resolves to one of the following\nstatus constants:\n\nThe resolved status will determine what the {TaskQueue} does with this\ntask when it is finished.\n\nThis is where you should put your actual API code. You can use the\nnode `request` library to easily hit APIs, or use the {NylasAPI} class\nto talk to the [Nylas Platform API](https://nylas.com/cloud/docs/).\n\nHere is a more detailed explanation of Task Statuses:\n\n### Task.Status.Success\n\nResolve to `Task.Status.Success` when the task successfully completes.\nOnce done, the task will be dequeued and logged as a success.\n\n### Task.Status.Retry\n\nif (you resolve `Task.Status.Retry`, the task will remain on the queue)\nand tried again later. Any other task dependent on the current one\nwill also continue waiting.\n\n`Task.Status.Retry` is useful if (it looks like we're offline, or you)\nget an API error code that indicates temporary failure.\n\n### Task.Status.Continue\n\nResolving `Task.Status.Continue` will silently dequeue the task, allow\ndependent tasks through, but not mark it as successfully resolved.\n\nThis is useful if (you get permanent API errors, but don't really care)\nif (the task failed.)\n\n### Task.Status.Failed\n\nif (you catch a permanent API error code (like a 500), or something)\nelse goes wrong then resolve to `Task.Status.Failed`.\n\nResolving `Task.Status.Failed` will dequeue this task, and **dequeue\nall dependent tasks**.\n\nYou can optionally return the error object itself for debugging\npurposes by resolving an array of the form: `[Task.Status.Failed,\nerrorObject]`\n\nYou should not `throw` exceptions. Catch all cases yourself and\ndetermine which `Task.Status` to resolve to. if (due to programmer)\nerror an exception is thrown, our {TaskQueue} will catch it, log it,\nand deal with the task as if (it resolved `Task.Status.Failed`.)",
"arguments": [
{
"name": "Task.Status.Success",
"description": "",
"type": null,
"isOptional": false
},
{
"name": "Task.Status.Retry",
"description": "",
"type": null,
"isOptional": false
},
{
"name": "Task.Status.Continue",
"description": "",
"type": null,
"isOptional": false
},
{
"name": "Task.Status.Failed",
"description": "",
"type": null,
"isOptional": false
}
],
"returnValues": [
{
"type": "Promise",
"description": "Returns a {Promise} that resolves to a valid `Task.Status` type."
}
]
},
{
"name": "isDependentOnTask",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "determines which other tasks this one is dependent on.",
"description": "determines which other tasks this one is dependent on.\n\nAny task that passes the truth test will be considered a \"dependency\".\n\nif a \"dependency\" has a `Task.Status.Failed`, then all downstream\ntasks will get dequeued recursively for any of the downstream tasks that\nreturn true for `shouldBeDequeuedOnDependencyFailure`\n\nA task will also never be run at the same time as one of its\ndependencies.",
"arguments": [
{
"name": "other",
"description": "An instance of a {Task} you must test to see if (it's a) dependency of this one.",
"type": "Task",
"isOptional": false
}
],
"returnValues": [
{
"type": null,
"description": "Returns `true` (is dependent on) or `false` (is not dependent on)"
}
]
},
{
"name": "shouldDequeueOtherTask",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "determines which other tasks this one should dequeue when\nit is first queued.",
"description": "determines which other tasks this one should dequeue when\nit is first queued.\n\nAny task that passes the truth test will be considered \"obsolete\" and\ndequeued immediately.\n\nThis is particularly useful in offline mode. Users may queue up tons\nof tasks but when we come back online to process them, we only want to\nprocess the latest one.",
"arguments": [
{
"name": "other",
"description": "An instance of a {Task} you must test to see if (it's now) obsolete.",
"type": "Task",
"isOptional": false
}
],
"returnValues": [
{
"type": null,
"description": "Returns `true` (should dequeue) or `false` (should not dequeue)"
}
]
},
{
"name": "shouldBeDequeuedOnDependencyFailure",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "determines if the current task should be dequeued if one of the\ntasks it depends on fails.",
"description": "determines if the current task should be dequeued if one of the\ntasks it depends on fails.",
"returnValues": [
{
"type": null,
"description": "Returns `true` (should dequeue) or `false` (should not dequeue)"
}
]
},
{
"name": "isUndo",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "It's up to you to determine how you want to indicate whether\nor not you have an instance of an \"Undo Task\". We commonly use a\nsimple instance variable boolean flag.",
"description": "It's up to you to determine how you want to indicate whether\nor not you have an instance of an \"Undo Task\". We commonly use a\nsimple instance variable boolean flag.",
"returnValues": [
{
"type": null,
"description": "Returns `true` (is an Undo Task) or `false` (is not an Undo Task)"
}
]
},
{
"name": "canBeUndone",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "Determines whether or not this task can be undone via the\n{UndoRedoStore}",
"description": "Determines whether or not this task can be undone via the\n{UndoRedoStore}",
"returnValues": [
{
"type": null,
"description": "Returns `true` (can be undone) or `false` (can't be undone)"
}
]
},
{
"name": "createUndoTask",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "Return from `createIdenticalTask` and set a flag so your\n`performLocal` and `performRemote` methods know that this is an undo\ntask.",
"description": "Return from `createIdenticalTask` and set a flag so your\n`performLocal` and `performRemote` methods know that this is an undo\ntask."
},
{
"name": "createIdenticalTask",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "Return a deep-cloned task to be used for an undo task",
"description": "Return a deep-cloned task to be used for an undo task"
},
{
"name": "cancel",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "code to run if (someone tries to dequeue your task while it is)\nin flight.",
"description": "code to run if (someone tries to dequeue your task while it is)\nin flight."
},
{
"name": "label",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "(optional) A string displayed to users when your task is run.",
"description": "(optional) A string displayed to users when your task is run.\n\nWhen tasks are run, we automatically display a notification to users\nof the form \"label (numberOfImpactedItems)\". if (this does not a return)\na string, no notification is displayed"
},
{
"name": "numberOfImpactedItems",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "A string displayed to users indicating how many items your\ntask affected.",
"description": "A string displayed to users indicating how many items your\ntask affected."
}
],
"classProperties": [],
"instanceProperties": [],
"visibility": "Public",
"summary": "Tasks are a robust way to handle any mutating changes that need\nto interface with a remote API.",
"description": "Tasks are a robust way to handle any mutating changes that need\nto interface with a remote API.\n\nTasks help you handle and encapsulate optimistic updates, rollbacks,\nundo/redo, API responses, API errors, queuing, and multi-step\ndependencies.\n\nThey are especially useful in offline mode. Users may have taken tons of\nactions that we've queued up to process when they come back online.\n\nTasks represent individual changes to the datastore that alter the local\ncache and need to be synced back to the server.\n\nTo create your own task, subclass Task and implement the following\nrequired methods:\n\n* {Task::performLocal}\n* {Task::performRemote}\n\nSee their usage in the documentation below.\n\n## Task Dependencies\n\nThe Task system handles dependencies between multiple queued tasks. For\nexample, the {SendDraftTask} has a dependency on the {SyncbackDraftTask}\n(aka saving) succeeding. To establish dependencies between tasks, your\nsubclass may implement one or more of the following methods:\n\n* {Task::isDependentOnTask}\n* {Task::onDependentTaskError}\n* {Task::shouldDequeueOtherTask}\n\n## Undo / Redo\n\nThe Task system also supports undo/redo handling. Your subclass must\nimplement the following methods to enable this:\n\n* {Task::isUndo}\n* {Task::canBeUndone}\n* {Task::createUndoTask}\n* {Task::createIdenticalTask}\n\n## Offline Considerations\n\nAll tasks should gracefully handle the case when there is no network\nconnection.\n\nif we're offline the common behavior is for a task to:\n\n1. Perform its local change\n1. Attempt the remote request, which will fail\n1. Have `performRemote` resolve a `Task.Status.Retry`\n1. Sit queued up waiting to be retried\n\nRemember that a user may be offline for hours and perform thousands of\ntasks in the meantime. It's important that your tasks implement\n`shouldDequeueOtherTask` and `isDependentOnTask` to make sure ordering\nalways remains correct.\n\n## Serialization and Window Considerations\n\nThe whole {TaskQueue} and all of its Tasks are serialized and stored in\nthe Database. This allows the {TaskQueue} to work across windows and\nensures we don't lose any pending tasks if (a user is offline for a while)\nand quits and relaunches the application.\n\nAll instance variables you create must be able to be serialized to a\nJSON string and re-inflated. Notably, **`function` objects will not be\nproperly re-inflated**.\n\nif (you have instance variables that are instances of core {Model})\nclasses or {Task} classes, they will be automatically re-inflated to the\ncorrect class via {Utils::deserializeRegisteredObject}. if (you create)\nyour own custom classes, they must be registered once per window via\n{TaskRegistry::register}\n\n## Example Task\n\n**Task Definition**:\n\n```js\nimport _ from 'underscore'\nimport request from 'request'\nimport {Task, DatabaseStore} from 'nylas-exports'\n\nclass UpdateTodoTask extends Task {\nconstructor(existingTodo, newData) {\nsuper()\nthis.existingTodo = existingTodo;\nthis.newData = newData;\n}\n\nperformLocal() {\nthis.updatedTodo = _.extend(_.clone(this.existingTodo), this.newData);\nreturn DatabaseStore.inTransaction((t) => t.persistModel(this.updatedTodo));\n}\n\nperformRemote() {\nreturn new Promise (resolve, reject) => {\nconst options = {url: \"https://myapi.co\", method: 'PUT', json: this.newData}\nrequest(options, (error, response, body) => {\nif (error) {\nresolve(Task.Status.Failed);\n}\nresolve(Task.Status.Success);\n});\n};\n};\n}\n```\n\n**Task Usage**:\n\n```coffee\nimport {Actions} from 'nylas-exports';\nimport UpdateTodoTask from './update-todo-task';\n\nsomeMethod() {\n...\nconst task = new UpdateTodoTask(existingTodo, {name: \"Test\"});\nActions.queueTask(task);\n...\n}\n```\n\nThis example `UpdateTodoTask` does not handle undo/redo, nor does it\nrollback the changes if (there's an API error. See examples in)\n{Task::performLocal} for ideas on how to handle this."
},
"TaskQueue": {
"name": "TaskQueue",
"filename": "task-queue.coffee",
"srcUrl": null,
"sections": [],
"classMethods": [],
"instanceMethods": [
{
"name": "findTask",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "",
"description": "",
"arguments": [
{
"name": "type",
"description": "The string name of the task class, or the Task class itself. (ie: {SaveDraftTask} or 'SaveDraftTask')",
"type": "SaveDraftTask",
"isOptional": false
},
{
"name": "matching",
"description": "Optional An {Object} with criteria to pass to _.isMatch. For a SaveDraftTask, this could be {draftClientId: \"123123\"}",
"type": "Object",
"isOptional": false
}
],
"returnValues": [
{
"type": null,
"description": "Returns an existing task in the queue that matches the type you provide,\nand any other match properties. Useful for checking to see if something, like\na \"SendDraft\" task is in-flight."
},
{
"type": "Task",
"description": "Returns a matching {Task}, or null."
}
]
}
],
"classProperties": [],
"instanceProperties": [],
"visibility": "Public",
"summary": "The TaskQueue is a Flux-compatible Store that manages a queue of {Task}\nobjects. Each {Task} represents an individual API action, like sending a draft\nor marking a thread as \"read\". Tasks optimistically make changes to the app's\nlocal cache and encapsulate logic for performing changes on the server, rolling\nback in case of failure, and waiting on dependent tasks.",
"description": "The TaskQueue is a Flux-compatible Store that manages a queue of {Task}\nobjects. Each {Task} represents an individual API action, like sending a draft\nor marking a thread as \"read\". Tasks optimistically make changes to the app's\nlocal cache and encapsulate logic for performing changes on the server, rolling\nback in case of failure, and waiting on dependent tasks.\n\nThe TaskQueue is essential to offline mode in N1. It automatically pauses\nwhen the user's internet connection is unavailable and resumes when online.\n\nThe task queue is persisted to disk, ensuring that tasks are executed later,\neven if the user quits N1.\n\nThe TaskQueue is only available in the app's main window. Rather than directly\nqueuing tasks, you should use the {Actions} to interact with the {TaskQueue}.\nTasks queued from secondary windows are serialized and sent to the application's\nmain window via IPC.\n\n## Queueing a Task\n\n```coffee\nif @_thread && @_thread.unread\n Actions.queueTask(new ChangeStarredTask(thread: @_thread, starred: true))\n```\n\n## Dequeueing a Task\n\n```coffee\nActions.dequeueMatchingTask({\n type: 'DestroyCategoryTask',\n matching: {\n categoryId: 'bla'\n }\n})\n```\n\nSection: Stores"
},
"TaskQueueStatusStore": {
"name": "TaskQueueStatusStore",
"superClass": "NylasStore",
"filename": "task-queue-status-store.coffee",
"srcUrl": null,
"sections": [],
"classMethods": [],
"instanceMethods": [],
"classProperties": [],
"instanceProperties": [],
"visibility": "Public",
"summary": "The TaskQueueStatusStore allows you to inspect the task queue from\nany window, even though the queue itself only runs in the work window.",
"description": "The TaskQueueStatusStore allows you to inspect the task queue from\nany window, even though the queue itself only runs in the work window."
},
"ThemeManager": {
"name": "ThemeManager",
"filename": "theme-manager.coffee",
"srcUrl": null,
"sections": [
{
"name": "Event Subscription",
"description": ""
},
{
"name": "Accessing Loaded Themes",
"description": ""
},
{
"name": "Accessing Active Themes",
"description": ""
},
{
"name": "Managing Enabled Themes",
"description": ""
}
],
"classMethods": [],
"instanceMethods": [
{
"name": "onDidChangeActiveThemes",
"sectionName": "Event Subscription",
"srcUrl": null,
"visibility": "Essential",
"summary": "Invoke `callback` when style sheet changes associated with\nupdating the list of active themes have completed.",
"description": "Invoke `callback` when style sheet changes associated with\nupdating the list of active themes have completed.",
"arguments": [
{
"name": "callback",
"description": "{Function} ",
"type": "Function",
"isOptional": false
}
]
},
{
"name": "getLoadedThemeNames",
"sectionName": "Accessing Loaded Themes",
"srcUrl": null,
"visibility": "Public",
"summary": "Get an array of all the loaded theme names. ",
"description": "Get an array of all the loaded theme names. "
},
{
"name": "getLoadedThemes",
"sectionName": "Accessing Loaded Themes",
"srcUrl": null,
"visibility": "Public",
"summary": "Get an array of all the loaded themes. ",
"description": "Get an array of all the loaded themes. "
},
{
"name": "getActiveThemeNames",
"sectionName": "Accessing Active Themes",
"srcUrl": null,
"visibility": "Public",
"summary": "Get an array of all the active theme names. ",
"description": "Get an array of all the active theme names. "
},
{
"name": "getActiveThemes",
"sectionName": "Accessing Active Themes",
"srcUrl": null,
"visibility": "Public",
"summary": "Get an array of all the active themes. ",
"description": "Get an array of all the active themes. "
},
{
"name": "getEnabledThemeNames",
"sectionName": "Managing Enabled Themes",
"srcUrl": null,
"visibility": "Public",
"summary": "Get the enabled theme names from the config.",
"description": "Get the enabled theme names from the config.",
"returnValues": [
{
"type": null,
"description": "Returns an array of theme names in the order that they should be activated."
}
]
}
],
"classProperties": [],
"instanceProperties": [],
"visibility": "Extended",
"summary": "Handles loading and activating available themes.",
"description": "Handles loading and activating available themes.\n\nAn instance of this class is always available as the `NylasEnv.themes` global. "
},
"Thread": {
"name": "Thread",
"superClass": "ModelWithMetadata",
"filename": "docs_src/classes/temp-cjsx/thread.js",
"srcUrl": null,
"sections": [],
"classMethods": [],
"instanceMethods": [],
"classProperties": [],
"instanceProperties": [],
"visibility": "Public",
"summary": "The Thread model represents a Thread object served by the Nylas Platform API.\nFor more information about Threads on the Nylas Platform, read the\n[Threads API Documentation](https://nylas.com/cloud/docs#threads)",
"description": "The Thread model represents a Thread object served by the Nylas Platform API.\nFor more information about Threads on the Nylas Platform, read the\n[Threads API Documentation](https://nylas.com/cloud/docs#threads)\n\nAttributes\n\n`snippet`: {AttributeString} A short, ~140 character string with the content\n of the last message in the thread. Queryable.\n\n`subject`: {AttributeString} The subject of the thread. Queryable.\n\n`unread`: {AttributeBoolean} True if the thread is unread. Queryable.\n\n`starred`: {AttributeBoolean} True if the thread is starred. Queryable.\n\n`version`: {AttributeNumber} The version number of the thread.\n\n`participants`: {AttributeCollection} A set of {Contact} models\n representing the participants in the thread.\n Note: Contacts on Threads do not have IDs.\n\n`lastMessageReceivedTimestamp`: {AttributeDateTime} The timestamp of the\n last message on the thread.\n\nThis class also inherits attributes from {Model}\n\nSection: Models\n@class Thread"
},
"UnsafeComponent": {
"name": "UnsafeComponent",
"superClass": "React",
"filename": "unsafe-component.coffee",
"srcUrl": null,
"sections": [],
"classMethods": [],
"instanceMethods": [],
"classProperties": [
{
"name": "propTypes",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "React `props` supported by UnsafeComponent:",
"description": "React `props` supported by UnsafeComponent:",
"arguments": [
{
"name": "component",
"description": "The {React.Component} to display. All other props will be passed on to this component.",
"type": "React.Component",
"isOptional": false
}
]
}
],
"instanceProperties": [],
"visibility": "Public",
"summary": "Renders a component provided via the `component` prop, and ensures that\nfailures in the component's code do not cause state inconsistencies elsewhere in\nthe application. This component is used by {InjectedComponent} and\n{InjectedComponentSet} to isolate third party code that could be buggy.",
"description": "Renders a component provided via the `component` prop, and ensures that\nfailures in the component's code do not cause state inconsistencies elsewhere in\nthe application. This component is used by {InjectedComponent} and\n{InjectedComponentSet} to isolate third party code that could be buggy.\n\nOccasionally, having your component wrapped in {UnsafeComponent} can cause style\nissues. For example, in a Flexbox, the `div.unsafe-component-wrapper` will cause\nyour `flex` and `order` values to be one level too deep. For these scenarios,\nUnsafeComponent looks for `containerStyles` on your React component and attaches\nthem to the wrapper div:\n\n```coffee\nclass MyComponent extends React.Component\n @displayName: 'MyComponent'\n @containerStyles:\n flex: 1\n order: 2\n```\n\nSection: Component Kit"
},
"WorkspaceStore": {
"name": "WorkspaceStore",
"superClass": "NylasStore",
"filename": "workspace-store.coffee",
"srcUrl": null,
"sections": [],
"classMethods": [],
"instanceMethods": [
{
"name": "topSheet",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "",
"description": "",
"returnValues": [
{
"type": "Sheet",
"description": "Returns The top {Sheet} in the current stack. Use this method to determine\nthe sheet the user is looking at."
}
]
},
{
"name": "rootSheet",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "",
"description": "",
"returnValues": [
{
"type": "Sheet",
"description": "Returns The {Sheet} at the root of the current stack."
}
]
},
{
"name": "sheetStack",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "",
"description": "",
"returnValues": [
{
"type": null,
"description": "Returns an {Array<Sheet>} The stack of sheets"
}
]
},
{
"name": "hiddenLocations",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "",
"description": "",
"returnValues": [
{
"type": "Array",
"description": "Returns an {Array} of locations that have been hidden."
}
]
},
{
"name": "isLocationHidden",
"sectionName": null,
"srcUrl": null,
"visibility": "Public",
"summary": "",
"description": "",
"returnValues": [
{
"type": "Boolean",
"description": "Returns a {Boolean} indicating whether the location provided is hidden.\nYou should provide one of the WorkspaceStore.Location constant values."
}
]
}
],
"classProperties": [],
"instanceProperties": [],
"visibility": "Public",
"summary": "The WorkspaceStore manages Sheets and layout modes in the application.\nObserving the WorkspaceStore makes it easy to monitor the sheet stack. To learn\nmore about sheets and layout in N1, see the {InterfaceConcepts.md}\ndocumentation.",
"description": "The WorkspaceStore manages Sheets and layout modes in the application.\nObserving the WorkspaceStore makes it easy to monitor the sheet stack. To learn\nmore about sheets and layout in N1, see the {InterfaceConcepts.md}\ndocumentation.\n\nSection: Stores"
}
}
}